Refactoring FirmwareInterface / EepromInterface
This commit is contained in:
@@ -23,13 +23,13 @@
|
||||
|
||||
class EFile;
|
||||
|
||||
class OpenTxInterface : public EEPROMInterface
|
||||
class OpenTxEepromInterface : public EEPROMInterface
|
||||
{
|
||||
public:
|
||||
|
||||
OpenTxInterface(BoardEnum board);
|
||||
OpenTxEepromInterface(BoardEnum board);
|
||||
|
||||
virtual ~OpenTxInterface();
|
||||
virtual ~OpenTxEepromInterface();
|
||||
|
||||
virtual const char * getName();
|
||||
|
||||
@@ -49,12 +49,8 @@ class OpenTxInterface : public EEPROMInterface
|
||||
|
||||
virtual int getSize(GeneralSettings &);
|
||||
|
||||
virtual int getCapability(const Capability);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
|
||||
virtual SimulatorInterface * getSimulator();
|
||||
|
||||
protected:
|
||||
|
||||
bool checkVersion(unsigned int version);
|
||||
@@ -82,10 +78,10 @@ class OpenTxInterface : public EEPROMInterface
|
||||
|
||||
};
|
||||
|
||||
class Open9xFirmware: public FirmwareInfo {
|
||||
class OpenTxFirmware: public FirmwareInterface {
|
||||
public:
|
||||
Open9xFirmware(const QString & id, const QString & name, EEPROMInterface * eepromInterface, const QString & url = QString(), const QString & stamp = QString(), const QString & rnurl = QString(), bool voice = false):
|
||||
FirmwareInfo(id, name, eepromInterface, url, stamp, rnurl, voice)
|
||||
OpenTxFirmware(const QString & id, const QString & name, const BoardEnum board, bool voice = false):
|
||||
FirmwareInterface(id, name, board, new OpenTxEepromInterface(board), voice)
|
||||
{
|
||||
addLanguage("en");
|
||||
addLanguage("fr");
|
||||
@@ -109,61 +105,19 @@ class Open9xFirmware: public FirmwareInfo {
|
||||
addTTSLanguage("es");
|
||||
}
|
||||
|
||||
virtual unsigned int getEepromVersion(unsigned int revision) {
|
||||
switch(this->eepromInterface->getBoard()) {
|
||||
case BOARD_SKY9X:
|
||||
if (revision == 0)
|
||||
return 212;
|
||||
if (revision >= 1217)
|
||||
return 212;
|
||||
if (revision >= 1174)
|
||||
return 211;
|
||||
if (revision >= 1031)
|
||||
return 210;
|
||||
if (revision >= 791)
|
||||
return 209;
|
||||
if (revision >= 641)
|
||||
return 208;
|
||||
break;
|
||||
case BOARD_GRUVIN9X:
|
||||
if (revision == 0)
|
||||
return 211;
|
||||
if (revision >= 1217)
|
||||
return 211;
|
||||
if (revision >= 1174)
|
||||
return 210;
|
||||
if (revision >= 791)
|
||||
return 209;
|
||||
if (revision >= 641)
|
||||
return 208;
|
||||
if (revision >= 547)
|
||||
return 207;
|
||||
break;
|
||||
default:
|
||||
if (revision == 0)
|
||||
return 211;
|
||||
if (revision >= 1217)
|
||||
return 211;
|
||||
if (revision >= 1174)
|
||||
return 210;
|
||||
if (revision >= 791)
|
||||
return 209;
|
||||
if (revision >= 641)
|
||||
return 208;
|
||||
break;
|
||||
}
|
||||
if (revision >= 321)
|
||||
return 205;
|
||||
else if (revision >= 217)
|
||||
return 204;
|
||||
else if (revision >= 184)
|
||||
return 203;
|
||||
else
|
||||
return 202;
|
||||
}
|
||||
virtual QString getStampUrl();
|
||||
|
||||
virtual QString getReleaseNotesUrl();
|
||||
|
||||
virtual QString getFirmwareUrl(QString & id);
|
||||
|
||||
virtual int getCapability(const Capability);
|
||||
|
||||
virtual SimulatorInterface * getSimulator();
|
||||
|
||||
|
||||
};
|
||||
|
||||
void RegisterOpen9xFirmwares();
|
||||
void UnregisterOpen9xFirmwares();
|
||||
void registerOpenTxFirmwares();
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user