mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 17:55:19 +03:00
Simulator updated with last Kjell improvements
This commit is contained in:
parent
5842bc8473
commit
08245aade9
5 changed files with 383 additions and 383 deletions
|
@ -96,7 +96,7 @@ include_directories(
|
||||||
add_subdirectory(modeledit)
|
add_subdirectory(modeledit)
|
||||||
add_subdirectory(simulation)
|
add_subdirectory(simulation)
|
||||||
|
|
||||||
SET( companion_SRCS
|
set(companion_SRCS
|
||||||
eeprominterface.cpp
|
eeprominterface.cpp
|
||||||
hexinterface.cpp
|
hexinterface.cpp
|
||||||
flashinterface.cpp
|
flashinterface.cpp
|
||||||
|
@ -142,12 +142,12 @@ SET( companion_SRCS
|
||||||
downloaddialog.cpp
|
downloaddialog.cpp
|
||||||
splashlibrary.cpp
|
splashlibrary.cpp
|
||||||
mainwindow.cpp
|
mainwindow.cpp
|
||||||
main.cpp
|
companion.cpp
|
||||||
modelconfigdialog.cpp
|
modelconfigdialog.cpp
|
||||||
qcustomplot.cpp
|
qcustomplot.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
SET( companion_MOC_HDRS
|
set(companion_MOC_HDRS
|
||||||
avroutputdialog.h
|
avroutputdialog.h
|
||||||
apppreferencesdialog.h
|
apppreferencesdialog.h
|
||||||
fwpreferencesdialog.h
|
fwpreferencesdialog.h
|
||||||
|
@ -171,7 +171,7 @@ SET( companion_MOC_HDRS
|
||||||
helpers.h
|
helpers.h
|
||||||
)
|
)
|
||||||
|
|
||||||
SET( companion_UIS
|
set(companion_UIS
|
||||||
mdichild.ui
|
mdichild.ui
|
||||||
avroutputdialog.ui
|
avroutputdialog.ui
|
||||||
comparedialog.ui
|
comparedialog.ui
|
||||||
|
@ -190,7 +190,7 @@ SET( companion_UIS
|
||||||
modelconfigdialog.ui
|
modelconfigdialog.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
SET( companion_RCS
|
set(companion_RCS
|
||||||
companion.qrc
|
companion.qrc
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
|
${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
|
||||||
)
|
)
|
||||||
|
@ -316,7 +316,8 @@ set(simu_SRCS
|
||||||
file.cpp # TODO not needed
|
file.cpp # TODO not needed
|
||||||
modeledit/node.cpp
|
modeledit/node.cpp
|
||||||
modeledit/edge.cpp # TODO not needed
|
modeledit/edge.cpp # TODO not needed
|
||||||
simulation/main.cpp
|
appdata.cpp
|
||||||
|
simulator.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(simu_HDRS
|
set(simu_HDRS
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
|
|
||||||
#include "appdata.h"
|
#include "appdata.h"
|
||||||
|
|
||||||
|
// Global data and storage object
|
||||||
|
AppData g;
|
||||||
|
|
||||||
// ** CompStoreObj class********************
|
// ** CompStoreObj class********************
|
||||||
void CompStoreObj::clear (const QString tag1, const QString tag2, const QString tag3)
|
void CompStoreObj::clear (const QString tag1, const QString tag2, const QString tag3)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
class CompStoreObj
|
class CompStoreObj
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void clear (const QString tag1="", const QString tag2="", const QString tag3="");
|
void clear (const QString tag1="", const QString tag2="", const QString tag3="");
|
||||||
void store(const QByteArray newArray, QByteArray &array, const QString tag, const QString group1="", const QString group2="" );
|
void store(const QByteArray newArray, QByteArray &array, const QString tag, const QString group1="", const QString group2="" );
|
||||||
void store(const QStringList newSList, QStringList &stringList, const QString tag, const QString group1="", const QString group2="" );
|
void store(const QStringList newSList, QStringList &stringList, const QString tag, const QString group1="", const QString group2="" );
|
||||||
|
@ -44,17 +44,17 @@ public:
|
||||||
void getset( int &number, const QString tag, const int def, const QString group1="", const QString group2="" );
|
void getset( int &number, const QString tag, const int def, const QString group1="", const QString group2="" );
|
||||||
};
|
};
|
||||||
|
|
||||||
class FwRevision:protected CompStoreObj
|
class FwRevision: protected CompStoreObj
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int get( const QString);
|
int get( const QString);
|
||||||
void set( const QString, const int );
|
void set( const QString, const int );
|
||||||
void remove( const QString );
|
void remove( const QString );
|
||||||
};
|
};
|
||||||
|
|
||||||
class JStickData:protected CompStoreObj
|
class JStickData: protected CompStoreObj
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
int _stickAxe;
|
int _stickAxe;
|
||||||
|
@ -63,7 +63,7 @@ private:
|
||||||
int _stickMax;
|
int _stickMax;
|
||||||
int _stickInv;
|
int _stickInv;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// All the get definitions
|
// All the get definitions
|
||||||
int stick_axe();
|
int stick_axe();
|
||||||
int stick_min();
|
int stick_min();
|
||||||
|
@ -85,9 +85,9 @@ public:
|
||||||
void flush();
|
void flush();
|
||||||
};
|
};
|
||||||
|
|
||||||
class Profile:protected CompStoreObj
|
class Profile: protected CompStoreObj
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
// Class Internal Variable
|
// Class Internal Variable
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ private:
|
||||||
int _vBatCalib;
|
int _vBatCalib;
|
||||||
int _vBatWarn;
|
int _vBatWarn;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// All the get definitions
|
// All the get definitions
|
||||||
QString firmware();
|
QString firmware();
|
||||||
QString name();
|
QString name();
|
||||||
|
@ -172,15 +172,15 @@ public:
|
||||||
void flush();
|
void flush();
|
||||||
};
|
};
|
||||||
|
|
||||||
class AppData:protected CompStoreObj
|
class AppData: protected CompStoreObj
|
||||||
{
|
{
|
||||||
// All the global variables
|
// All the global variables
|
||||||
public:
|
public:
|
||||||
Profile profile[MAX_PROFILES];
|
Profile profile[MAX_PROFILES];
|
||||||
JStickData joystick[MAX_JOYSTICKS];
|
JStickData joystick[MAX_JOYSTICKS];
|
||||||
FwRevision fwRev;
|
FwRevision fwRev;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QStringList _recentFiles;
|
QStringList _recentFiles;
|
||||||
QByteArray _mainWinGeo;
|
QByteArray _mainWinGeo;
|
||||||
QByteArray _mainWinState;
|
QByteArray _mainWinState;
|
||||||
|
@ -235,8 +235,7 @@ private:
|
||||||
int _theme;
|
int _theme;
|
||||||
int _warningId;
|
int _warningId;
|
||||||
|
|
||||||
|
public:
|
||||||
public:
|
|
||||||
// All the get definitions
|
// All the get definitions
|
||||||
QStringList recentFiles();
|
QStringList recentFiles();
|
||||||
QByteArray mainWinGeo();
|
QByteArray mainWinGeo();
|
||||||
|
|
|
@ -74,9 +74,6 @@ class MyProxyStyle : public QProxyStyle
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Global data and storge object
|
|
||||||
AppData g;
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Q_INIT_RESOURCE(companion);
|
Q_INIT_RESOURCE(companion);
|
Loading…
Add table
Add a link
Reference in a new issue