Standalone simulator startup options (#4164)
* [simulator] Save and restore Simulator window sizes and positions (based on current radio profile). * [simulator] Set startup throttle stick lock in standalone sim based on default mode in current Companion radio profile; Add new flag indicating standalone simulator; Unique titles for simulator console windows. * [simulator] New/updated Simulator startup options: Radio profile used for standalone Simulator can now be separate from Companion; Allow selecting a radio profile and EEPROM image file (in addition to radio type) at startup via GUI and CLI; All startup settings are saved between uses.
This commit is contained in:
committed by
Bertrand Songis
parent
fd01376f1e
commit
e204031ef6
@@ -310,6 +310,8 @@ bool Profile::renameFwFiles() const { return _renameFwFiles; }
|
||||
int Profile::channelOrder() const { return _channelOrder; }
|
||||
int Profile::defaultMode() const { return _defaultMode; }
|
||||
|
||||
QByteArray Profile::simuWinGeo() const { return _simuWinGeo; }
|
||||
|
||||
QString Profile::beeper() const { return _beeper; }
|
||||
QString Profile::countryCode() const { return _countryCode; }
|
||||
QString Profile::display() const { return _display; }
|
||||
@@ -342,6 +344,8 @@ void Profile::penableBackup (const bool x) { store(x, _penableBackup, "penabl
|
||||
void Profile::channelOrder (const int x) { store(x, _channelOrder, "default_channel_order" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::defaultMode (const int x) { store(x, _defaultMode, "default_mode" ,"Profiles", QString("profile%1").arg(index));}
|
||||
|
||||
void Profile::simuWinGeo (const QByteArray x) { store(x, _simuWinGeo, "simuWindowGeometry" ,"Profiles", QString("profile%1").arg(index));}
|
||||
|
||||
void Profile::beeper (const QString x) { store(x, _beeper, "Beeper" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::countryCode (const QString x) { store(x, _countryCode, "countryCode" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::display (const QString x) { store(x, _display, "Display" ,"Profiles", QString("profile%1").arg(index));}
|
||||
@@ -352,10 +356,10 @@ void Profile::timeStamp (const QString x) { store(x, _timeStamp, "TimeSt
|
||||
void Profile::trainerCalib (const QString x) { store(x, _trainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::controlTypes (const QString x) { store(x, _controlTypes, "ControlTypes" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::controlNames (const QString x) { store(x, _controlNames, "ControlNames" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::txCurrentCalibration (const int x) { store(x, _txCurrentCalibration, "currentCalib","Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::txCurrentCalibration (const int x) { store(x, _txCurrentCalibration, "currentCalib","Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::gsStickMode (const int x) { store(x, _gsStickMode, "GSStickMode" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::txVoltageCalibration (const int x) { store(x, _txVoltageCalibration, "VbatCalib","Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::txVoltageCalibration (const int x) { store(x, _txVoltageCalibration, "VbatCalib","Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::vBatWarn (const int x) { store(x, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::vBatMin (const int x) { store(x, _vBatMin, "VbatMin" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::vBatMax (const int x) { store(x, _vBatMax, "VbatMax" ,"Profiles", QString("profile%1").arg(index));}
|
||||
@@ -464,6 +468,8 @@ void Profile::init(int newIndex)
|
||||
_channelOrder = 0;
|
||||
_defaultMode = 1;
|
||||
|
||||
_simuWinGeo = QByteArray();
|
||||
|
||||
initFwVariables();
|
||||
|
||||
// Do not write empty profiles to disk except the default (0) profile.
|
||||
@@ -489,6 +495,8 @@ void Profile::flush()
|
||||
getset( _channelOrder, "default_channel_order" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _defaultMode, "default_mode" ,1 ,"Profiles", QString("profile%1").arg(index));
|
||||
|
||||
getset( _simuWinGeo, "simuWindowGeometry" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
|
||||
getset( _beeper, "Beeper" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _countryCode, "countryCode" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _display, "Display" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
@@ -529,6 +537,7 @@ QString AppData::programmer() { return _programmer; }
|
||||
QString AppData::sambaLocation() { return _sambaLocation; }
|
||||
QString AppData::sambaPort() { return _sambaPort; }
|
||||
QString AppData::lastSimulator() { return _lastSimulator; }
|
||||
QString AppData::simuLastEepe() { return _simuLastEepe; }
|
||||
|
||||
QString AppData::backupDir() { return _backupDir; }
|
||||
QString AppData::gePath() { return _gePath; }
|
||||
@@ -559,6 +568,7 @@ int AppData::jsCtrl() { return _jsCtrl; }
|
||||
int AppData::id() { return _id; }
|
||||
int AppData::theme() { return _theme; }
|
||||
int AppData::warningId() { return _warningId; }
|
||||
int AppData::simuLastProfId() { return _simuLastProfId; }
|
||||
|
||||
// Set declarations
|
||||
void AppData::recentFiles (const QStringList x) { store(x, _recentFiles, "recentFileList" );}
|
||||
@@ -578,6 +588,7 @@ void AppData::programmer (const QString x) { store(x, _programmer,
|
||||
void AppData::sambaLocation (const QString x) { store(x, _sambaLocation, "samba_location" );}
|
||||
void AppData::sambaPort (const QString x) { store(x, _sambaPort, "samba_port" );}
|
||||
void AppData::lastSimulator (const QString x) { store(x, _lastSimulator, "last_simulator" );}
|
||||
void AppData::simuLastEepe (const QString x) { store(x, _simuLastEepe, "simuLastEepe" );}
|
||||
|
||||
void AppData::backupDir (const QString x) { store(x, _backupDir, "backupPath" );}
|
||||
void AppData::gePath (const QString x) { store(x, _gePath, "gePath" );}
|
||||
@@ -608,6 +619,7 @@ void AppData::jsCtrl (const int x) { store(x, _jsCtrl,
|
||||
void AppData::id (const int x) { store(x, _id, "profileId" );}
|
||||
void AppData::theme (const int x) { store(x, _theme, "theme" );}
|
||||
void AppData::warningId (const int x) { store(x, _warningId, "warningId" );}
|
||||
void AppData::simuLastProfId (const int x) { store(x, _simuLastProfId, "simuLastProfId" );}
|
||||
|
||||
// Constructor
|
||||
AppData::AppData()
|
||||
@@ -765,6 +777,7 @@ void AppData::init()
|
||||
getset( _sambaLocation, "samba_location" ,"" );
|
||||
getset( _sambaPort, "samba_port" ,"\\USBserial\\COM23" );
|
||||
getset( _lastSimulator, "last_simulator" ,"" );
|
||||
getset( _simuLastEepe, "simuLastEepe" ,"" );
|
||||
|
||||
getset( _backupDir, "backupPath" ,"" );
|
||||
getset( _gePath, "gePath" ,"" );
|
||||
@@ -803,4 +816,15 @@ void AppData::init()
|
||||
getset( _id, "profileId" ,0 );
|
||||
getset( _theme, "theme" ,1 );
|
||||
getset( _warningId, "warningId" ,0 );
|
||||
getset( _simuLastProfId, "simuLastProfId" ,-1 );
|
||||
}
|
||||
|
||||
QMap<int, QString> AppData::getActiveProfiles()
|
||||
{
|
||||
QMap<int, QString> active;
|
||||
for (int i=0; i<MAX_PROFILES; i++) {
|
||||
if (g.profile[i].existsOnDisk())
|
||||
active.insert(i, g.profile[i].name());
|
||||
}
|
||||
return active;
|
||||
}
|
||||
|
||||
@@ -122,6 +122,9 @@ class Profile: protected CompStoreObj
|
||||
int _channelOrder;
|
||||
int _defaultMode;
|
||||
|
||||
// Simulator variables
|
||||
QByteArray _simuWinGeo;
|
||||
|
||||
// Firmware Variables
|
||||
QString _beeper;
|
||||
QString _countryCode;
|
||||
@@ -156,6 +159,8 @@ class Profile: protected CompStoreObj
|
||||
int channelOrder() const;
|
||||
int defaultMode() const;
|
||||
|
||||
QByteArray simuWinGeo() const;
|
||||
|
||||
QString beeper() const;
|
||||
QString countryCode() const;
|
||||
QString display() const;
|
||||
@@ -188,6 +193,8 @@ class Profile: protected CompStoreObj
|
||||
void channelOrder (const int);
|
||||
void defaultMode (const int);
|
||||
|
||||
void simuWinGeo (const QByteArray);
|
||||
|
||||
void beeper (const QString);
|
||||
void countryCode (const QString);
|
||||
void display (const QString);
|
||||
@@ -255,6 +262,7 @@ class AppData: protected CompStoreObj
|
||||
QString _sambaLocation;
|
||||
QString _sambaPort;
|
||||
QString _lastSimulator;
|
||||
QString _simuLastEepe;
|
||||
|
||||
QString _backupDir;
|
||||
QString _gePath;
|
||||
@@ -285,6 +293,7 @@ class AppData: protected CompStoreObj
|
||||
int _id;
|
||||
int _theme;
|
||||
int _warningId;
|
||||
int _simuLastProfId;
|
||||
|
||||
public:
|
||||
// All the get definitions
|
||||
@@ -306,6 +315,7 @@ class AppData: protected CompStoreObj
|
||||
QString sambaLocation();
|
||||
QString sambaPort();
|
||||
QString lastSimulator();
|
||||
QString simuLastEepe();
|
||||
|
||||
QString backupDir();
|
||||
QString gePath();
|
||||
@@ -336,6 +346,7 @@ class AppData: protected CompStoreObj
|
||||
int id();
|
||||
int theme();
|
||||
int warningId();
|
||||
int simuLastProfId();
|
||||
|
||||
// All the set definitions
|
||||
void recentFiles (const QStringList x);
|
||||
@@ -356,6 +367,7 @@ class AppData: protected CompStoreObj
|
||||
void sambaLocation (const QString);
|
||||
void sambaPort (const QString);
|
||||
void lastSimulator (const QString);
|
||||
void simuLastEepe (const QString);
|
||||
|
||||
void backupDir (const QString);
|
||||
void gePath (const QString);
|
||||
@@ -387,10 +399,13 @@ class AppData: protected CompStoreObj
|
||||
void id (const int);
|
||||
void theme (const int);
|
||||
void warningId (const int);
|
||||
void simuLastProfId (const int);
|
||||
|
||||
// Constructor
|
||||
AppData();
|
||||
void init();
|
||||
|
||||
QMap<int, QString> getActiveProfiles();
|
||||
};
|
||||
|
||||
extern AppData g;
|
||||
|
||||
Reference in New Issue
Block a user