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:
Max Paperno
2016-12-27 22:04:24 +01:00
committed by Bertrand Songis
parent fd01376f1e
commit e204031ef6
8 changed files with 406 additions and 183 deletions
+8 -5
View File
@@ -54,11 +54,12 @@ class VirtualJoystickWidget;
#define SIMULATOR_FLAGS_S1 4
#define SIMULATOR_FLAGS_S2 8
#define SIMULATOR_FLAGS_S3 16
#define SIMULATOR_FLAGS_S4 32 // reserved for the future
#define SIMULATOR_FLAGS_S4 32 // reserved for the future
#define SIMULATOR_FLAGS_S1_MULTI 64
#define SIMULATOR_FLAGS_S2_MULTI 128
#define SIMULATOR_FLAGS_S3_MULTI 256
#define SIMULATOR_FLAGS_S4_MULTI 512 // reserved for the future
#define SIMULATOR_FLAGS_S4_MULTI 512 // reserved for the future
#define SIMULATOR_FLAGS_STANDALONE 1024 // started from stanalone simulator
void traceCb(const char * text);
@@ -72,9 +73,9 @@ class SimulatorDialog : public QDialog
void start(const char * filename);
void start(QByteArray & eeprom);
void setRadioProfileId(int value);
virtual void traceCallback(const char * text);
protected:
template <class T> void initUi(T * ui);
virtual void setLightOn(bool enable) { }
@@ -109,16 +110,18 @@ class SimulatorDialog : public QDialog
#endif
SimulatorInterface *simulator;
int radioProfileId;
unsigned int lastPhase;
void setupTimer();
QFrame * createLogicalSwitch(QWidget * parent, int switchNo, QVector<QLabel *> & labels);
void setupOutputsDisplay();
void setupGVarsDisplay();
void startCommon();
void setupTimer();
void centerSticks();
void setTrims();
void setValues();
virtual void getValues() = 0;
int getValue(qint8 i);