Re #2260: class Profile dependency removed from simulatorinterface

This commit is contained in:
Damjan Adamic
2015-06-01 21:37:25 +02:00
parent 61c7abf214
commit 67cd321400
9 changed files with 43 additions and 21 deletions
@@ -182,7 +182,7 @@ bool Er9xSimulator::lcdChanged(bool & lightEnable)
#include "simulatorimport.h"
}
void Er9xSimulator::start(RadioData &radioData, const Profile & profile, bool tests)
void Er9xSimulator::start(RadioData &radioData, bool tests)
{
er9xInterface->save(&eeprom[0], radioData);
StartMainThread(tests);
@@ -28,7 +28,7 @@ class Er9xSimulator : public SimulatorInterface {
Er9xSimulator(Er9xInterface *);
virtual void start(RadioData & radioData, const Profile & profile, bool tests);
virtual void start(RadioData & radioData, bool tests);
virtual void stop();
@@ -204,7 +204,7 @@ bool Ersky9xSimulator::lcdChanged(bool & lightEnable)
#include "simulatorimport.h"
}
void Ersky9xSimulator::start(RadioData &radioData, const Profile & profile, bool tests)
void Ersky9xSimulator::start(RadioData &radioData, bool tests)
{
ersky9xInterface->save(Ersky9x::eeprom, radioData);
StartEepromThread(NULL);
@@ -28,7 +28,7 @@ class Ersky9xSimulator : public SimulatorInterface {
Ersky9xSimulator(Ersky9xInterface *);
virtual void start(RadioData & radioData, const Profile & profile, bool tests);
virtual void start(RadioData & radioData, bool tests);
virtual void stop();
@@ -339,6 +339,19 @@ OpenTxSimulator::OpenTxSimulator()
{
}
void OpenTxSimulator::setSdPath(const QString &sdPath)
{
#if defined(SDCARD)
strncpy(simuSdDirectory, sdPath.toAscii().constData(), sizeof(simuSdDirectory)-1);
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
#endif
}
void OpenTxSimulator::setVolumeGain(int value)
{
volumeGain = value;
}
bool OpenTxSimulator::timer10ms()
{
#define TIMER10MS_IMPORT
@@ -357,19 +370,14 @@ bool OpenTxSimulator::lcdChanged(bool & lightEnable)
#include "simulatorimport.h"
}
void OpenTxSimulator::start(QByteArray & eeprom, const Profile & profile, bool tests)
void OpenTxSimulator::start(QByteArray & eeprom, bool tests)
{
memcpy(NAMESPACE::eeprom, eeprom.data(), std::min<int>(sizeof(NAMESPACE::eeprom), eeprom.size()));
start((const char *)0, profile, tests);
start((const char *)0, tests);
}
void OpenTxSimulator::start(const char * filename, const Profile & profile, bool tests)
void OpenTxSimulator::start(const char * filename, bool tests)
{
#if defined(SDCARD)
strncpy(simuSdDirectory, profile.sdPath().toAscii().constData(), sizeof(simuSdDirectory)-1);
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
#endif
#if defined(PCBSKY9X) && !defined(REVX)
g_rotenc[0] = 0;
#elif defined(PCBGRUVIN9X)
@@ -378,7 +386,7 @@ void OpenTxSimulator::start(const char * filename, const Profile & profile, bool
#endif
StartEepromThread(filename);
StartAudioThread(profile.volumeGain());
StartAudioThread(volumeGain);
StartMainThread(tests);
}
@@ -77,13 +77,20 @@ namespace NAMESPACE {
class DLLEXPORT OpenTxSimulator : public SimulatorInterface {
private:
int volumeGain;
public:
OpenTxSimulator();
virtual void start(QByteArray & eeprom, const Profile & profile, bool tests=true);
virtual void setSdPath(const QString &sdPath);
virtual void start(const char * filename, const Profile & profile, bool tests=true);
virtual void setVolumeGain(int value);
virtual void start(QByteArray & eeprom, bool tests=true);
virtual void start(const char * filename, bool tests=true);
virtual void stop();