Merge branch 'master' into kilrah/ar9x
This commit is contained in:
@@ -6,7 +6,7 @@ SET(C9X_VERSION_REVISION "2")
|
||||
SET(C9X_VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
|
||||
|
||||
SET(C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION}${C9X_VERSION_SUFFIX})
|
||||
MESSAGE(STATUS OpenTX Companion ${C9X_VERSION})
|
||||
MESSAGE(STATUS "OpenTX Companion ${C9X_VERSION}")
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
||||
|
||||
|
||||
+10
-10
@@ -312,10 +312,10 @@ QString Profile::speaker() const { return _speaker; }
|
||||
QString Profile::stickPotCalib() const { return _stickPotCalib; }
|
||||
QString Profile::timeStamp() const { return _timeStamp; }
|
||||
QString Profile::trainerCalib() const { return _trainerCalib; }
|
||||
int Profile::currentCalib() const { return _currentCalib; }
|
||||
int Profile::txCurrentCalibration() const { return _txCurrentCalibration; }
|
||||
int Profile::gsStickMode() const { return _gsStickMode; }
|
||||
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
|
||||
int Profile::vBatCalib() const { return _vBatCalib; }
|
||||
int Profile::txVoltageCalibration() const { return _txVoltageCalibration; }
|
||||
int Profile::vBatWarn() const { return _vBatWarn; }
|
||||
int Profile::vBatMin() const { return _vBatMin; }
|
||||
int Profile::vBatMax() const { return _vBatMax; }
|
||||
@@ -342,10 +342,10 @@ void Profile::speaker (const QString x) { store(x, _speaker, "Speake
|
||||
void Profile::stickPotCalib (const QString x) { store(x, _stickPotCalib, "StickPotCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::timeStamp (const QString x) { store(x, _timeStamp, "TimeStamp" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::trainerCalib (const QString x) { store(x, _trainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::currentCalib (const int x) { store(x, _currentCalib, "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::vBatCalib (const int x) { store(x, _vBatCalib, "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));}
|
||||
@@ -378,10 +378,10 @@ Profile& Profile::operator=(const Profile& rhs)
|
||||
speaker ( rhs.speaker() );
|
||||
stickPotCalib( rhs.stickPotCalib() );
|
||||
trainerCalib ( rhs.trainerCalib() );
|
||||
currentCalib ( rhs.currentCalib() );
|
||||
txCurrentCalibration ( rhs.txCurrentCalibration() );
|
||||
gsStickMode ( rhs.gsStickMode() );
|
||||
ppmMultiplier( rhs.ppmMultiplier() );
|
||||
vBatCalib ( rhs.vBatCalib() );
|
||||
txVoltageCalibration ( rhs.txVoltageCalibration() );
|
||||
vBatWarn ( rhs.vBatWarn() );
|
||||
vBatMin ( rhs.vBatMin() );
|
||||
vBatMax ( rhs.vBatMax() );
|
||||
@@ -424,10 +424,10 @@ void Profile::initFwVariables()
|
||||
_timeStamp = "";
|
||||
_trainerCalib = "";
|
||||
|
||||
_currentCalib = 0;
|
||||
_txCurrentCalibration = 0;
|
||||
_gsStickMode = 0;
|
||||
_ppmMultiplier = 0;
|
||||
_vBatCalib = 0;
|
||||
_txVoltageCalibration = 0;
|
||||
_vBatWarn = 0;
|
||||
_vBatMin = 0;
|
||||
_vBatMax = 0;
|
||||
@@ -483,10 +483,10 @@ void Profile::flush()
|
||||
getset( _stickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _timeStamp, "TimeStamp" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _trainerCalib, "TrainerCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _currentCalib, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _txCurrentCalibration, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatCalib, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _txVoltageCalibration, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatWarn, "vBatWarn" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatMin, "VbatMin" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatMax, "VbatMax" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
|
||||
@@ -125,10 +125,10 @@ class Profile: protected CompStoreObj
|
||||
QString _stickPotCalib;
|
||||
QString _timeStamp;
|
||||
QString _trainerCalib;
|
||||
int _currentCalib;
|
||||
int _txCurrentCalibration;
|
||||
int _gsStickMode;
|
||||
int _ppmMultiplier;
|
||||
int _vBatCalib;
|
||||
int _txVoltageCalibration;
|
||||
int _vBatWarn;
|
||||
int _vBatMin;
|
||||
int _vBatMax;
|
||||
@@ -156,10 +156,10 @@ class Profile: protected CompStoreObj
|
||||
QString stickPotCalib() const;
|
||||
QString timeStamp() const;
|
||||
QString trainerCalib() const;
|
||||
int currentCalib() const;
|
||||
int txCurrentCalibration() const;
|
||||
int gsStickMode() const;
|
||||
int ppmMultiplier() const;
|
||||
int vBatCalib() const;
|
||||
int txVoltageCalibration() const;
|
||||
int vBatWarn() const;
|
||||
int vBatMin() const;
|
||||
int vBatMax() const;
|
||||
@@ -186,10 +186,10 @@ class Profile: protected CompStoreObj
|
||||
void stickPotCalib (const QString);
|
||||
void timeStamp (const QString);
|
||||
void trainerCalib (const QString);
|
||||
void currentCalib (const int);
|
||||
void txCurrentCalibration (const int);
|
||||
void gsStickMode (const int);
|
||||
void ppmMultiplier (const int);
|
||||
void vBatCalib (const int);
|
||||
void txVoltageCalibration (const int);
|
||||
void vBatWarn (const int);
|
||||
void vBatMin (const int);
|
||||
void vBatMax (const int);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
<file>icon.png</file>
|
||||
<file>../../CREDITS.txt</file>
|
||||
<file>../../DONATIONS.txt</file>
|
||||
<file>../../BLACKLIST.txt</file>
|
||||
<file>../releasenotes.txt</file>
|
||||
<file>images/9xdb.png</file>
|
||||
<file>images/9xdl.png</file>
|
||||
|
||||
@@ -63,12 +63,15 @@ ContributorsDialog::ContributorsDialog(QWidget * parent):
|
||||
" <tr><td class=\"normal\">" + tr("Honors go to Rafal Tomczak (RadioClone), Thomas Husterer (th9x) and Erez Raviv (er9x and eePe)") + "<br/></td></tr>" \
|
||||
"</table>");
|
||||
|
||||
#if 0
|
||||
QFile blacklist(":/BLACKLIST.txt");
|
||||
if (blacklist.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QStringList names;
|
||||
names << blacklist.readAll();
|
||||
str.append(formatTable(tr("OpenTX Blacklist"), names, 1));
|
||||
}
|
||||
#endif
|
||||
|
||||
str.append("</body></html>");
|
||||
ui->textEditor->setHtml(str);
|
||||
ui->textEditor->scroll(0, 0);
|
||||
|
||||
@@ -897,7 +897,7 @@ QString CustomFunctionData::paramToString(const ModelData * model) const
|
||||
}
|
||||
else if ((func==FuncVolume)|| (func==FuncPlayValue)) {
|
||||
RawSource item(param);
|
||||
return item.toString();
|
||||
return item.toString(model);
|
||||
}
|
||||
else if ((func==FuncPlayPrompt) || (func==FuncPlayBoth)) {
|
||||
if ( GetCurrentFirmware()->getCapability(VoicesAsNumbers)) {
|
||||
@@ -1083,8 +1083,8 @@ GeneralSettings::GeneralSettings()
|
||||
}
|
||||
else {
|
||||
QString t_trainercalib=g.profile[g.id()].trainerCalib();
|
||||
int8_t t_vBatCalib=(int8_t)g.profile[g.id()].vBatCalib();
|
||||
int8_t t_currentCalib=(int8_t)g.profile[g.id()].currentCalib();
|
||||
int8_t t_txVoltageCalibration=(int8_t)g.profile[g.id()].txVoltageCalibration();
|
||||
int8_t t_txCurrentCalibration=(int8_t)g.profile[g.id()].txCurrentCalibration();
|
||||
int8_t t_PPM_Multiplier=(int8_t)g.profile[g.id()].ppmMultiplier();
|
||||
uint8_t t_stickMode=(uint8_t)g.profile[g.id()].gsStickMode();
|
||||
uint8_t t_vBatWarn=(uint8_t)g.profile[g.id()].vBatWarn();
|
||||
@@ -1118,8 +1118,8 @@ GeneralSettings::GeneralSettings()
|
||||
if (ok)
|
||||
trainer.calib[i]=byte16;
|
||||
}
|
||||
currentCalib=t_currentCalib;
|
||||
vBatCalib=t_vBatCalib;
|
||||
txCurrentCalibration=t_txCurrentCalibration;
|
||||
txVoltageCalibration=t_txVoltageCalibration;
|
||||
vBatWarn=t_vBatWarn;
|
||||
PPM_Multiplier=t_PPM_Multiplier;
|
||||
stickMode = t_stickMode;
|
||||
@@ -1383,16 +1383,16 @@ void ModelData::clear()
|
||||
moduleData[2].ppmDelay = 300;
|
||||
int board = GetEepromInterface()->getBoard();
|
||||
if (IS_TARANIS(board)) {
|
||||
moduleData[0].protocol=PXX_XJT_X16;
|
||||
moduleData[1].protocol=OFF;
|
||||
moduleData[0].protocol = PULSES_PXX_XJT_X16;
|
||||
moduleData[1].protocol = PULSES_OFF;
|
||||
}
|
||||
else if (IS_SKY9X(board)) {
|
||||
moduleData[0].protocol=PPM;
|
||||
moduleData[1].protocol=PPM;
|
||||
moduleData[0].protocol = PULSES_PPM;
|
||||
moduleData[1].protocol = PULSES_PPM;
|
||||
}
|
||||
else {
|
||||
moduleData[0].protocol=PPM;
|
||||
moduleData[1].protocol=OFF;
|
||||
moduleData[0].protocol = PULSES_PPM;
|
||||
moduleData[1].protocol = PULSES_OFF;
|
||||
}
|
||||
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
|
||||
flightModeData[i].clear();
|
||||
|
||||
@@ -815,31 +815,31 @@ class TimerData {
|
||||
void clear() { memset(this, 0, sizeof(TimerData)); mode = RawSwitch(SWITCH_TYPE_TIMER_MODE, 0); }
|
||||
};
|
||||
|
||||
enum Protocol {
|
||||
OFF,
|
||||
PPM,
|
||||
SILV_A,
|
||||
SILV_B,
|
||||
SILV_C,
|
||||
CTP1009,
|
||||
LP45,
|
||||
DSM2,
|
||||
DSMX,
|
||||
PPM16,
|
||||
PPMSIM,
|
||||
PXX_XJT_X16,
|
||||
PXX_XJT_D8,
|
||||
PXX_XJT_LR12,
|
||||
PXX_DJT,
|
||||
PROTO_LAST
|
||||
enum PulsesProtocol {
|
||||
PULSES_OFF,
|
||||
PULSES_PPM,
|
||||
PULSES_SILV_A,
|
||||
PULSES_SILV_B,
|
||||
PULSES_SILV_C,
|
||||
PULSES_CTP1009,
|
||||
PULSES_LP45,
|
||||
PULSES_DSM2,
|
||||
PULSES_DSMX,
|
||||
PULSES_PPM16,
|
||||
PULSES_PPMSIM,
|
||||
PULSES_PXX_XJT_X16,
|
||||
PULSES_PXX_XJT_D8,
|
||||
PULSES_PXX_XJT_LR12,
|
||||
PULSES_PXX_DJT,
|
||||
PULSES_PROTOCOL_LAST
|
||||
};
|
||||
|
||||
enum TrainerProtocol {
|
||||
MASTER_JACK,
|
||||
SLAVE_JACK,
|
||||
MASTER_SBUS_MODULE,
|
||||
MASTER_CPPM_MODULE,
|
||||
MASTER_SBUS_BATT_COMPARTMENT
|
||||
TRAINER_MASTER_JACK,
|
||||
TRAINER_SLAVE_JACK,
|
||||
TRAINER_MASTER_SBUS_MODULE,
|
||||
TRAINER_MASTER_CPPM_MODULE,
|
||||
TRAINER_MASTER_SBUS_BATT_COMPARTMENT
|
||||
};
|
||||
|
||||
class ModuleData {
|
||||
@@ -1139,7 +1139,8 @@ class GeneralSettings {
|
||||
unsigned int currModel; // 0..15
|
||||
unsigned int contrast;
|
||||
unsigned int vBatWarn;
|
||||
int vBatCalib;
|
||||
int txVoltageCalibration;
|
||||
int txCurrentCalibration;
|
||||
int vBatMin;
|
||||
int vBatMax;
|
||||
int backlightMode;
|
||||
@@ -1187,7 +1188,6 @@ class GeneralSettings {
|
||||
int speakerVolume;
|
||||
unsigned int backlightBright;
|
||||
int switchesDelay;
|
||||
int currentCalib;
|
||||
int temperatureCalib;
|
||||
int temperatureWarn;
|
||||
unsigned int mAhWarn;
|
||||
@@ -1318,7 +1318,7 @@ enum Capability {
|
||||
PPMCenter,
|
||||
PPMUnitMicroseconds,
|
||||
SYMLimits,
|
||||
HasCurrentCalibration,
|
||||
HastxCurrentCalibration,
|
||||
HasVolume,
|
||||
HasBrightness,
|
||||
PerModelTimers,
|
||||
@@ -1378,7 +1378,7 @@ class EEPROMInterface
|
||||
|
||||
virtual int getSize(const GeneralSettings &) = 0;
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0) = 0;
|
||||
virtual int isAvailable(PulsesProtocol proto, int port=0) = 0;
|
||||
|
||||
virtual const int getEEpromSize() = 0;
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ Er9xGeneral::operator GeneralSettings ()
|
||||
result.currModel = currModel;
|
||||
result.contrast = contrast;
|
||||
result.vBatWarn = vBatWarn;
|
||||
result.vBatCalib = vBatCalib;
|
||||
result.txVoltageCalibration = txVoltageCalibration;
|
||||
result.trainer = trainer;
|
||||
result.blightinv=blightinv;
|
||||
result.stickScroll=stickScroll;
|
||||
@@ -361,16 +361,16 @@ t_Er9xModelData::operator ModelData ()
|
||||
c9x.timers[0].val = tmrVal;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
|
||||
@@ -61,7 +61,7 @@ PACK(typedef struct t_Er9xGeneral {
|
||||
uint8_t currModel; //0..15
|
||||
uint8_t contrast;
|
||||
uint8_t vBatWarn;
|
||||
int8_t vBatCalib;
|
||||
int8_t txVoltageCalibration;
|
||||
int8_t lightSw;
|
||||
Er9xTrainerData trainer;
|
||||
uint8_t view;
|
||||
|
||||
@@ -200,13 +200,13 @@ int Er9xInterface::getSize(const GeneralSettings &settings)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Er9xInterface::isAvailable(Protocol prot, int port)
|
||||
int Er9xInterface::isAvailable(PulsesProtocol prot, int port)
|
||||
{
|
||||
switch (prot) {
|
||||
case PPM:
|
||||
case DSM2:
|
||||
case PXX_DJT:
|
||||
case PPM16:
|
||||
case PULSES_PPM:
|
||||
case PULSES_DSM2:
|
||||
case PULSES_PXX_DJT:
|
||||
case PULSES_PPM16:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
|
||||
@@ -46,7 +46,7 @@ class Er9xInterface : public EEPROMInterface
|
||||
|
||||
virtual int getSize(const GeneralSettings &settings);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
virtual int isAvailable(PulsesProtocol proto, int port=0);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ Ersky9xGeneral::operator GeneralSettings ()
|
||||
result.currModel = currModel;
|
||||
result.contrast = contrast;
|
||||
result.vBatWarn = vBatWarn;
|
||||
result.vBatCalib = vBatCalib;
|
||||
result.txVoltageCalibration = txVoltageCalibration;
|
||||
|
||||
result.backlightMode = 0;
|
||||
if (lightSw == 22) {
|
||||
@@ -135,7 +135,7 @@ Ersky9xGeneral::operator GeneralSettings ()
|
||||
result.switchWarningStates = switchWarningStates;
|
||||
result.speakerVolume = volume;
|
||||
result.backlightBright = bright ;
|
||||
result.currentCalib = current_calib;
|
||||
result.txCurrentCalibration = current_calib;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -493,16 +493,16 @@ t_Ersky9xModelData_v10::operator ModelData ()
|
||||
}
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
@@ -608,16 +608,16 @@ t_Ersky9xModelData_v11::operator ModelData ()
|
||||
}
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
|
||||
@@ -69,7 +69,7 @@ PACK(typedef struct t_Ersky9xGeneral {
|
||||
uint8_t currModel; //0..15
|
||||
uint8_t contrast;
|
||||
uint8_t vBatWarn;
|
||||
int8_t vBatCalib;
|
||||
int8_t txVoltageCalibration;
|
||||
int8_t lightSw;
|
||||
Ersky9xTrainerData trainer;
|
||||
uint8_t view;
|
||||
|
||||
@@ -244,13 +244,13 @@ int Ersky9xInterface::getSize(const GeneralSettings & settings)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Ersky9xInterface::isAvailable(Protocol prot, int port)
|
||||
int Ersky9xInterface::isAvailable(PulsesProtocol prot, int port)
|
||||
{
|
||||
switch (prot) {
|
||||
case PPM:
|
||||
case DSM2:
|
||||
case PXX_DJT:
|
||||
case PPM16:
|
||||
case PULSES_PPM:
|
||||
case PULSES_DSM2:
|
||||
case PULSES_PXX_DJT:
|
||||
case PULSES_PPM16:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
|
||||
@@ -46,7 +46,7 @@ class Ersky9xInterface : public EEPROMInterface
|
||||
|
||||
virtual int getSize(const GeneralSettings & settings);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
virtual int isAvailable(PulsesProtocol proto, int port=0);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ Gruvin9xGeneral_v103::operator GeneralSettings ()
|
||||
result.currModel = currModel;
|
||||
result.contrast = contrast;
|
||||
result.vBatWarn = vBatWarn;
|
||||
result.vBatCalib = vBatCalib;
|
||||
result.txVoltageCalibration = txVoltageCalibration;
|
||||
|
||||
result.backlightMode = 0;
|
||||
if (lightSw == 22) {
|
||||
@@ -127,7 +127,7 @@ Gruvin9xGeneral_v104::operator GeneralSettings ()
|
||||
result.currModel = currModel;
|
||||
result.contrast = contrast;
|
||||
result.vBatWarn = vBatWarn;
|
||||
result.vBatCalib = vBatCalib;
|
||||
result.txVoltageCalibration = txVoltageCalibration;
|
||||
|
||||
result.backlightMode = 0;
|
||||
if (lightSw == 22) {
|
||||
@@ -423,25 +423,25 @@ t_Gruvin9xModelData_v102::operator ModelData ()
|
||||
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = SILV_A;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_A;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = SILV_B;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_B;
|
||||
break;
|
||||
case 5:
|
||||
c9x.moduleData[0].protocol = SILV_C;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_C;
|
||||
break;
|
||||
case 6:
|
||||
c9x.moduleData[0].protocol = CTP1009;
|
||||
c9x.moduleData[0].protocol = PULSES_CTP1009;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -493,25 +493,25 @@ t_Gruvin9xModelData_v103::operator ModelData ()
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = SILV_A;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_A;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = SILV_B;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_B;
|
||||
break;
|
||||
case 5:
|
||||
c9x.moduleData[0].protocol = SILV_C;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_C;
|
||||
break;
|
||||
case 6:
|
||||
c9x.moduleData[0].protocol = CTP1009;
|
||||
c9x.moduleData[0].protocol = PULSES_CTP1009;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -563,25 +563,25 @@ t_Gruvin9xModelData_v105::operator ModelData ()
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = SILV_A;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_A;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = SILV_B;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_B;
|
||||
break;
|
||||
case 5:
|
||||
c9x.moduleData[0].protocol = SILV_C;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_C;
|
||||
break;
|
||||
case 6:
|
||||
c9x.moduleData[0].protocol = CTP1009;
|
||||
c9x.moduleData[0].protocol = PULSES_CTP1009;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -653,25 +653,25 @@ t_Gruvin9xModelData_v106::operator ModelData ()
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = SILV_A;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_A;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = SILV_B;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_B;
|
||||
break;
|
||||
case 5:
|
||||
c9x.moduleData[0].protocol = SILV_C;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_C;
|
||||
break;
|
||||
case 6:
|
||||
c9x.moduleData[0].protocol = CTP1009;
|
||||
c9x.moduleData[0].protocol = PULSES_CTP1009;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
|
||||
@@ -69,7 +69,7 @@ PACK(typedef struct t_Gruvin9xGeneral_v103 {
|
||||
uint8_t currModel; //0..15
|
||||
uint8_t contrast;
|
||||
uint8_t vBatWarn;
|
||||
int8_t vBatCalib;
|
||||
int8_t txVoltageCalibration;
|
||||
int8_t lightSw;
|
||||
Gruvin9xTrainerData_v103 trainer;
|
||||
uint8_t view; //index of subview in main scrren
|
||||
@@ -106,7 +106,7 @@ PACK(typedef struct t_Gruvin9xGeneral_v104 {
|
||||
uint8_t currModel; //0..15
|
||||
uint8_t contrast;
|
||||
uint8_t vBatWarn;
|
||||
int8_t vBatCalib;
|
||||
int8_t txVoltageCalibration;
|
||||
int8_t lightSw;
|
||||
Gruvin9xTrainerData_v104 trainer;
|
||||
uint8_t view; //index of subview in main scrren
|
||||
|
||||
@@ -216,15 +216,15 @@ int Gruvin9xInterface::getSize(const GeneralSettings & settings)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Gruvin9xInterface::isAvailable(Protocol proto, int port)
|
||||
int Gruvin9xInterface::isAvailable(PulsesProtocol proto, int port)
|
||||
{
|
||||
switch (proto) {
|
||||
case PPM:
|
||||
case SILV_A:
|
||||
case SILV_B:
|
||||
case SILV_C:
|
||||
case CTP1009:
|
||||
case DSM2:
|
||||
case PULSES_PPM:
|
||||
case PULSES_SILV_A:
|
||||
case PULSES_SILV_B:
|
||||
case PULSES_SILV_C:
|
||||
case PULSES_CTP1009:
|
||||
case PULSES_DSM2:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
|
||||
@@ -47,7 +47,7 @@ class Gruvin9xInterface : public EEPROMInterface
|
||||
|
||||
virtual int getSize(const GeneralSettings & settings);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
virtual int isAvailable(PulsesProtocol proto, int port=0);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -440,16 +440,16 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -514,19 +514,19 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -596,19 +596,19 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -679,19 +679,19 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -766,19 +766,19 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
|
||||
}
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
|
||||
@@ -716,19 +716,19 @@ t_Open9xArmModelData_v208::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -799,19 +799,19 @@ t_Open9xArmModelData_v209::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -883,19 +883,19 @@ t_Open9xArmModelData_v210::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -967,19 +967,19 @@ t_Open9xArmModelData_v211::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1054,19 +1054,19 @@ t_Open9xArmModelData_v212::operator ModelData ()
|
||||
}
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
|
||||
@@ -917,16 +917,16 @@ t_Open9xModelData_v201::operator ModelData ()
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -991,16 +991,16 @@ t_Open9xModelData_v202::operator ModelData ()
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1067,16 +1067,16 @@ t_Open9xModelData_v203::operator ModelData ()
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1141,16 +1141,16 @@ t_Open9xModelData_v204::operator ModelData ()
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1217,19 +1217,19 @@ t_Open9xModelData_v205::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1295,19 +1295,19 @@ t_Open9xModelData_v208::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1381,19 +1381,19 @@ t_Open9xModelData_v209::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1468,19 +1468,19 @@ t_Open9xModelData_v210::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1556,19 +1556,19 @@ t_Open9xModelData_v211::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#define HAS_PERSISTENT_TIMERS(board) (IS_ARM(board) || IS_2560(board))
|
||||
#define HAS_LARGE_LCD(board) IS_TARANIS(board)
|
||||
#define MAX_VIEWS(board) (HAS_LARGE_LCD(board) ? 2 : 256)
|
||||
#define MAX_POTS(board) (IS_TARANIS(board) ? (IS_TARANIS_X9E(board) ? 4 : 3) : 3)
|
||||
#define MAX_POTS(board, version) (IS_TARANIS(board) ? (IS_TARANIS_X9E(board) ? 4 : (version >= 216 ? 3 : 2)) : 3)
|
||||
#define MAX_SLIDERS(board) (IS_TARANIS(board) ? (IS_TARANIS_X9E(board) ? 4 : 2) : 0)
|
||||
#define MAX_SWITCHES(board, version) (IS_TARANIS(board) ? (IS_TARANIS_X9E(board) ? 18 : 8) : 7)
|
||||
#define MAX_SWITCHES_POSITION(board, version) (IS_TARANIS_X9E(board) ? 18*3 : (IS_TARANIS(board) ? 8*3 : 9))
|
||||
@@ -80,7 +80,7 @@ class SwitchesConversionTable: public ConversionTable {
|
||||
}
|
||||
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
for (int i=1; i<=MAX_POTS(board)*6; i++) {
|
||||
for (int i=1; i<=MAX_POTS(board, version)*6; i++) {
|
||||
addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, -i), -val+offset);
|
||||
addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i), val++);
|
||||
}
|
||||
@@ -212,8 +212,9 @@ class SourcesConversionTable: public ConversionTable {
|
||||
}
|
||||
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
for (int i=0; i<32; i++)
|
||||
for (int i=0; i<32; i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i), val++);
|
||||
}
|
||||
for (int i=0; i<7; i++) {
|
||||
for (int j=0; j<6; j++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_LUA_OUTPUT, i*16+j), val++);
|
||||
@@ -221,16 +222,18 @@ class SourcesConversionTable: public ConversionTable {
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_STICKS+MAX_POTS(board)+MAX_SLIDERS(board); i++) {
|
||||
for (int i=0; i<NUM_STICKS+MAX_POTS(board, version)+MAX_SLIDERS(board); i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_STICK, i), val++);
|
||||
}
|
||||
|
||||
for (int i=0; i<MAX_ROTARY_ENCODERS(board); i++)
|
||||
for (int i=0; i<MAX_ROTARY_ENCODERS(board); i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_ROTARY_ENCODER, 0), val++);
|
||||
}
|
||||
|
||||
if (!afterrelease21March2013) {
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_TRIM, i), val++);
|
||||
}
|
||||
}
|
||||
|
||||
addConversion(RawSource(SOURCE_TYPE_MAX), val++);
|
||||
@@ -1746,6 +1749,7 @@ class LogicalSwitchField: public TransformedField {
|
||||
{
|
||||
delete andswitchesConversionTable;
|
||||
}
|
||||
|
||||
virtual void beforeExport()
|
||||
{
|
||||
if (csw.func == LS_FN_TIMER) {
|
||||
@@ -1787,8 +1791,14 @@ class LogicalSwitchField: public TransformedField {
|
||||
switchesConversionTable->importValue(v2, csw.val2);
|
||||
}
|
||||
else if (csw.func >= LS_FN_EQUAL && csw.func <= LS_FN_ELESS) {
|
||||
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
|
||||
sourcesConversionTable->importValue((uint8_t)v2, csw.val2);
|
||||
if (IS_ARM(board)) {
|
||||
sourcesConversionTable->importValue((uint32_t)v1, csw.val1);
|
||||
sourcesConversionTable->importValue((uint32_t)v2, csw.val2);
|
||||
}
|
||||
else {
|
||||
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
|
||||
sourcesConversionTable->importValue((uint8_t)v2, csw.val2);
|
||||
}
|
||||
if (IS_TARANIS(board) && version < 216) {
|
||||
RawSource val1(csw.val1);
|
||||
if (val1.type == SOURCE_TYPE_STICK && val1.index < NUM_STICKS) {
|
||||
@@ -1801,7 +1811,12 @@ class LogicalSwitchField: public TransformedField {
|
||||
}
|
||||
}
|
||||
else if (csw.func != LS_FN_OFF) {
|
||||
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
|
||||
if (IS_ARM(board)) {
|
||||
sourcesConversionTable->importValue((uint32_t)v1, csw.val1);
|
||||
}
|
||||
else {
|
||||
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
|
||||
}
|
||||
if (IS_TARANIS(board) && version < 216) {
|
||||
RawSource val1(csw.val1);
|
||||
if (val1.type == SOURCE_TYPE_STICK && val1.index < NUM_STICKS) {
|
||||
@@ -2809,7 +2824,8 @@ class SensorField: public TransformedField {
|
||||
if (sensor.type == SensorData::TELEM_TYPE_CUSTOM) {
|
||||
_id = sensor.id;
|
||||
_instance = sensor.instance;
|
||||
_param = (sensor.ratio) + ((unsigned int)sensor.offset << 16);
|
||||
_ratio = sensor.ratio;
|
||||
_offset = sensor.offset;
|
||||
}
|
||||
else {
|
||||
_id = sensor.persistentValue;
|
||||
@@ -2820,7 +2836,7 @@ class SensorField: public TransformedField {
|
||||
_param = ((uint8_t)sensor.sources[0]) + ((uint8_t)sensor.sources[1] << 8) + ((uint8_t)sensor.sources[2] << 16) + ((uint8_t)sensor.sources[3] << 24);
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST)
|
||||
_param = (sensor.gps) + (sensor.alt << 8);
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION)
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION || sensor.formula == SensorData::TELEM_FORMULA_TOTALIZE)
|
||||
_param = (sensor.amps);
|
||||
}
|
||||
}
|
||||
@@ -2830,8 +2846,8 @@ class SensorField: public TransformedField {
|
||||
if (sensor.type == SensorData::TELEM_TYPE_CUSTOM) {
|
||||
sensor.id = _id;
|
||||
sensor.instance = _instance;
|
||||
sensor.ratio = _param & 0xFFFF;
|
||||
sensor.offset = (_param >> 16) & 0xFFFF;
|
||||
sensor.ratio = _ratio;
|
||||
sensor.offset = _offset;
|
||||
}
|
||||
else {
|
||||
sensor.persistentValue = _id;
|
||||
@@ -2843,7 +2859,7 @@ class SensorField: public TransformedField {
|
||||
sensor.sources[i] = _sources[i];
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST)
|
||||
(sensor.gps = _sources[0], sensor.alt = _sources[1]);
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION)
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION || sensor.formula == SensorData::TELEM_FORMULA_TOTALIZE)
|
||||
sensor.amps = _sources[0];
|
||||
}
|
||||
eepromImportDebug() << QString("imported %1").arg(internalField.getName());
|
||||
@@ -2857,6 +2873,10 @@ class SensorField: public TransformedField {
|
||||
union {
|
||||
unsigned int _param;
|
||||
uint8_t _sources[4];
|
||||
struct {
|
||||
uint16_t _ratio;
|
||||
int16_t _offset;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -3148,7 +3168,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
|
||||
if (IS_ARM(board) && version >= 217) {
|
||||
for (int i=0; i<8; i++) {
|
||||
if (i < MAX_POTS(board)+MAX_SLIDERS(board))
|
||||
if (i < MAX_POTS(board, version)+MAX_SLIDERS(board))
|
||||
internalField.Append(new BoolField<1>(modelData.potsWarningEnabled[i]));
|
||||
else
|
||||
internalField.Append(new SpareBitsField<1>());
|
||||
@@ -3156,7 +3176,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
}
|
||||
else if (IS_ARM(board) && version >= 216) {
|
||||
for (int i=0; i<6; i++) {
|
||||
if (i < MAX_POTS(board)+MAX_SLIDERS(board))
|
||||
if (i < MAX_POTS(board, version)+MAX_SLIDERS(board))
|
||||
internalField.Append(new BoolField<1>(modelData.potsWarningEnabled[i]));
|
||||
else
|
||||
internalField.Append(new SpareBitsField<1>());
|
||||
@@ -3165,7 +3185,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
}
|
||||
|
||||
if (IS_ARM(board) && version >= 216) {
|
||||
for (int i=0; i < MAX_POTS(board)+MAX_SLIDERS(board); i++) {
|
||||
for (int i=0; i < MAX_POTS(board, version)+MAX_SLIDERS(board); i++) {
|
||||
internalField.Append(new SignedField<8>(modelData.potPosition[i]));
|
||||
}
|
||||
}
|
||||
@@ -3191,10 +3211,10 @@ void OpenTxModelData::beforeExport()
|
||||
// qDebug() << QString("before export model") << modelData.name;
|
||||
|
||||
for (int module=0; module<3; module++) {
|
||||
if (modelData.moduleData[module].protocol >= PXX_XJT_X16 && modelData.moduleData[module].protocol <= PXX_XJT_LR12)
|
||||
subprotocols[module] = modelData.moduleData[module].protocol - PXX_XJT_X16;
|
||||
else if (modelData.moduleData[module].protocol >= LP45 && modelData.moduleData[module].protocol <= DSMX)
|
||||
subprotocols[module] = modelData.moduleData[module].protocol - LP45;
|
||||
if (modelData.moduleData[module].protocol >= PULSES_PXX_XJT_X16 && modelData.moduleData[module].protocol <= PULSES_PXX_XJT_LR12)
|
||||
subprotocols[module] = modelData.moduleData[module].protocol - PULSES_PXX_XJT_X16;
|
||||
else if (modelData.moduleData[module].protocol >= PULSES_LP45 && modelData.moduleData[module].protocol <= PULSES_DSMX)
|
||||
subprotocols[module] = modelData.moduleData[module].protocol - PULSES_LP45;
|
||||
else
|
||||
subprotocols[module] = (module==0 ? -1 : 0);
|
||||
}
|
||||
@@ -3224,15 +3244,15 @@ void OpenTxModelData::afterImport()
|
||||
}
|
||||
|
||||
for (int module=0; module<3; module++) {
|
||||
if (modelData.moduleData[module].protocol == PXX_XJT_X16 || modelData.moduleData[module].protocol == LP45) {
|
||||
if (modelData.moduleData[module].protocol == PULSES_PXX_XJT_X16 || modelData.moduleData[module].protocol == PULSES_LP45) {
|
||||
if (subprotocols[module] >= 0)
|
||||
modelData.moduleData[module].protocol += subprotocols[module];
|
||||
else
|
||||
modelData.moduleData[module].protocol = OFF;
|
||||
modelData.moduleData[module].protocol = PULSES_OFF;
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_TARANIS(board) && version < 217 && modelData.moduleData[1].protocol != OFF) {
|
||||
if (IS_TARANIS(board) && version < 217 && modelData.moduleData[1].protocol != PULSES_OFF) {
|
||||
modelData.moduleData[1].modelId = modelData.moduleData[0].modelId;
|
||||
}
|
||||
}
|
||||
@@ -3243,7 +3263,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
generalData(generalData),
|
||||
board(board),
|
||||
version(version),
|
||||
inputsCount(NUM_STICKS+MAX_POTS(board)+MAX_SLIDERS(board))
|
||||
inputsCount(NUM_STICKS+MAX_POTS(board, version)+MAX_SLIDERS(board))
|
||||
{
|
||||
eepromImportDebug() << QString("OpenTxGeneralData::OpenTxGeneralData(board: %1, version:%2, variant:%3)").arg(board).arg(version).arg(variant);
|
||||
|
||||
@@ -3280,7 +3300,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
internalField.Append(new UnsignedField<8>(generalData.currModel));
|
||||
internalField.Append(new UnsignedField<8>(generalData.contrast));
|
||||
internalField.Append(new UnsignedField<8>(generalData.vBatWarn));
|
||||
internalField.Append(new SignedField<8>(generalData.vBatCalib));
|
||||
internalField.Append(new SignedField<8>(generalData.txVoltageCalibration));
|
||||
internalField.Append(new SignedField<8>(generalData.backlightMode));
|
||||
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
@@ -3364,7 +3384,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
internalField.Append(new UnsignedField<8>(generalData.backlightBright));
|
||||
internalField.Append(new SignedField<8>(generalData.currentCalib));
|
||||
internalField.Append(new SignedField<8>(generalData.txCurrentCalibration));
|
||||
if (version >= 213) {
|
||||
internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
|
||||
internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
|
||||
@@ -3407,7 +3427,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
internalField.Append(new UnsignedField<8>(generalData.hw_uartMode));
|
||||
}
|
||||
for (int i=0; i<4; i++) {
|
||||
if (i < MAX_POTS(board))
|
||||
if (i < MAX_POTS(board, version))
|
||||
internalField.Append(new UnsignedField<2>(generalData.potConfig[i]));
|
||||
else
|
||||
internalField.Append(new SpareBitsField<2>());
|
||||
@@ -3439,7 +3459,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
for (int i=0; i<NUM_STICKS; ++i) {
|
||||
internalField.Append(new ZCharField<3>(generalData.stickName[i]));
|
||||
}
|
||||
for (int i=0; i<MAX_POTS(board); ++i) {
|
||||
for (int i=0; i<MAX_POTS(board, version); ++i) {
|
||||
internalField.Append(new ZCharField<3>(generalData.potName[i]));
|
||||
}
|
||||
for (int i=0; i<MAX_SLIDERS(board); ++i) {
|
||||
|
||||
@@ -56,30 +56,30 @@ class ProtocolsConversionTable: public ConversionTable
|
||||
{
|
||||
int val = 0;
|
||||
if (IS_ARM(board)) {
|
||||
addConversion(OFF, val++);
|
||||
addConversion(PULSES_OFF, val++);
|
||||
}
|
||||
addConversion(PPM, val++);
|
||||
addConversion(PULSES_PPM, val++);
|
||||
if (!IS_ARM(board)) {
|
||||
addConversion(PPM16, val++);
|
||||
addConversion(PPMSIM, val++);
|
||||
addConversion(PULSES_PPM16, val++);
|
||||
addConversion(PULSES_PPMSIM, val++);
|
||||
}
|
||||
if (IS_ARM(board)) {
|
||||
addConversion(PXX_XJT_X16, val);
|
||||
addConversion(PXX_XJT_D8, val);
|
||||
addConversion(PXX_XJT_LR12, val++);
|
||||
addConversion(PULSES_PXX_XJT_X16, val);
|
||||
addConversion(PULSES_PXX_XJT_D8, val);
|
||||
addConversion(PULSES_PXX_XJT_LR12, val++);
|
||||
}
|
||||
else {
|
||||
addConversion(PXX_DJT, val++);
|
||||
addConversion(PULSES_PXX_DJT, val++);
|
||||
}
|
||||
if (IS_ARM(board)) {
|
||||
addConversion(LP45, val);
|
||||
addConversion(DSM2, val);
|
||||
addConversion(DSMX, val++);
|
||||
addConversion(PULSES_LP45, val);
|
||||
addConversion(PULSES_DSM2, val);
|
||||
addConversion(PULSES_DSMX, val++);
|
||||
}
|
||||
else {
|
||||
addConversion(LP45, val++);
|
||||
addConversion(DSM2, val++);
|
||||
addConversion(DSMX, val++);
|
||||
addConversion(PULSES_LP45, val++);
|
||||
addConversion(PULSES_DSM2, val++);
|
||||
addConversion(PULSES_DSMX, val++);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -714,7 +714,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
return (IS_ARM(board) && !IS_9XRPRO(board)) ? 2 : 1;
|
||||
case HasPPMStart:
|
||||
return (IS_ARM(board) ? true : false);
|
||||
case HasCurrentCalibration:
|
||||
case HastxCurrentCalibration:
|
||||
return (IS_SKY9X(board) ? true : false);
|
||||
case HasVolume:
|
||||
return (IS_ARM(board) ? true : false);
|
||||
@@ -797,16 +797,16 @@ bool OpenTxFirmware::isTelemetrySourceAvailable(int source)
|
||||
return true;
|
||||
}
|
||||
|
||||
int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
|
||||
int OpenTxEepromInterface::isAvailable(PulsesProtocol proto, int port)
|
||||
{
|
||||
if (IS_TARANIS(board)) {
|
||||
switch (port) {
|
||||
case 0:
|
||||
switch (proto) {
|
||||
case OFF:
|
||||
case PXX_XJT_X16:
|
||||
case PXX_XJT_D8:
|
||||
case PXX_XJT_LR12:
|
||||
case PULSES_OFF:
|
||||
case PULSES_PXX_XJT_X16:
|
||||
case PULSES_PXX_XJT_D8:
|
||||
case PULSES_PXX_XJT_LR12:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
@@ -814,15 +814,15 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
|
||||
break;
|
||||
case 1:
|
||||
switch (proto) {
|
||||
case OFF:
|
||||
case PPM:
|
||||
case PXX_XJT_X16:
|
||||
case PXX_XJT_D8:
|
||||
case PXX_XJT_LR12:
|
||||
//case PXX_DJT: // Unavailable for now
|
||||
case LP45:
|
||||
case DSM2:
|
||||
case DSMX:
|
||||
case PULSES_OFF:
|
||||
case PULSES_PPM:
|
||||
case PULSES_PXX_XJT_X16:
|
||||
case PULSES_PXX_XJT_D8:
|
||||
case PULSES_PXX_XJT_LR12:
|
||||
//case PULSES_PXX_DJT: // Unavailable for now
|
||||
case PULSES_LP45:
|
||||
case PULSES_DSM2:
|
||||
case PULSES_DSMX:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
@@ -830,7 +830,7 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
|
||||
break;
|
||||
case -1:
|
||||
switch (proto) {
|
||||
case PPM:
|
||||
case PULSES_PPM:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
@@ -844,13 +844,13 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
|
||||
switch (port) {
|
||||
case 0:
|
||||
switch (proto) {
|
||||
case PPM:
|
||||
case PXX_XJT_X16:
|
||||
case PXX_XJT_D8:
|
||||
case PXX_XJT_LR12:
|
||||
case LP45:
|
||||
case DSM2:
|
||||
case DSMX:
|
||||
case PULSES_PPM:
|
||||
case PULSES_PXX_XJT_X16:
|
||||
case PULSES_PXX_XJT_D8:
|
||||
case PULSES_PXX_XJT_LR12:
|
||||
case PULSES_LP45:
|
||||
case PULSES_DSM2:
|
||||
case PULSES_DSMX:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
@@ -858,7 +858,7 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
|
||||
break;
|
||||
case 1:
|
||||
switch (proto) {
|
||||
case PPM:
|
||||
case PULSES_PPM:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
@@ -870,13 +870,13 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
|
||||
}
|
||||
else {
|
||||
switch (proto) {
|
||||
case PPM:
|
||||
case DSMX:
|
||||
case LP45:
|
||||
case DSM2:
|
||||
case PXX_DJT:
|
||||
case PPM16:
|
||||
case PPMSIM:
|
||||
case PULSES_PPM:
|
||||
case PULSES_DSMX:
|
||||
case PULSES_LP45:
|
||||
case PULSES_DSM2:
|
||||
case PULSES_PXX_DJT:
|
||||
case PULSES_PPM16:
|
||||
case PULSES_PPMSIM:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
|
||||
@@ -45,7 +45,7 @@ class OpenTxEepromInterface : public EEPROMInterface
|
||||
|
||||
virtual int getSize(const GeneralSettings &);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
virtual int isAvailable(PulsesProtocol proto, int port=0);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ namespace NAMESPACE {
|
||||
#include "radio/src/targets/taranis/pulses_driver.cpp"
|
||||
#include "radio/src/targets/taranis/rtc_driver.cpp"
|
||||
#include "radio/src/targets/taranis/trainer_driver.cpp"
|
||||
#include "radio/src/targets/taranis/uart3_driver.cpp"
|
||||
#include "radio/src/targets/taranis/serial2_driver.cpp"
|
||||
#elif defined(PCBSKY9X)
|
||||
#include "radio/src/targets/sky9x/board_sky9x.cpp"
|
||||
#include "radio/src/targets/sky9x/telemetry_driver.cpp"
|
||||
@@ -244,7 +244,7 @@ namespace NAMESPACE {
|
||||
#include "radio/src/targets/sky9x/sdcard_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/coproc_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/haptic_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/second_serial_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/serial2_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/pulses_driver.cpp"
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#include "radio/src/targets/gruvin9x/board_gruvin9x.cpp"
|
||||
|
||||
@@ -62,7 +62,7 @@ Th9xGeneral::operator GeneralSettings ()
|
||||
result.currModel = currModel;
|
||||
result.contrast = contrast;
|
||||
result.vBatWarn = vBatWarn;
|
||||
result.vBatCalib = vBatCalib;
|
||||
result.txVoltageCalibration = txVoltageCalibration;
|
||||
// result.lightSw = th9xToSwitch(lightSw);
|
||||
result.trainer = trainer;
|
||||
result.view = view;
|
||||
|
||||
@@ -64,7 +64,7 @@ PACK(typedef struct t_Th9xGeneral {
|
||||
uint8_t currModel; //0..15
|
||||
uint8_t contrast;
|
||||
uint8_t vBatWarn;
|
||||
int8_t vBatCalib;
|
||||
int8_t txVoltageCalibration;
|
||||
int8_t lightSw;
|
||||
Th9xTrainerData trainer;
|
||||
uint8_t adcFilt:2;
|
||||
|
||||
@@ -140,14 +140,14 @@ int Th9xInterface::getSize(const GeneralSettings & settings)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Th9xInterface::isAvailable(Protocol proto, int port)
|
||||
int Th9xInterface::isAvailable(PulsesProtocol proto, int port)
|
||||
{
|
||||
switch (proto) {
|
||||
case PPM:
|
||||
case SILV_A:
|
||||
case SILV_B:
|
||||
case SILV_C:
|
||||
case CTP1009:
|
||||
case PULSES_PPM:
|
||||
case PULSES_SILV_A:
|
||||
case PULSES_SILV_B:
|
||||
case PULSES_SILV_C:
|
||||
case PULSES_CTP1009:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
|
||||
@@ -46,7 +46,7 @@ class Th9xInterface : public EEPROMInterface
|
||||
|
||||
virtual int getSize(const GeneralSettings &);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
virtual int isAvailable(PulsesProtocol proto, int port=0);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -175,8 +175,8 @@ bool FlashEEpromDialog::patchCalibration()
|
||||
QString calib = g.profile[g.id()].stickPotCalib();
|
||||
QString trainercalib = g.profile[g.id()].trainerCalib();
|
||||
int potsnum=GetCurrentFirmware()->getCapability(Pots);
|
||||
int8_t vBatCalib=(int8_t) g.profile[g.id()].vBatCalib();
|
||||
int8_t currentCalib=(int8_t) g.profile[g.id()].currentCalib();
|
||||
int8_t txVoltageCalibration=(int8_t) g.profile[g.id()].txVoltageCalibration();
|
||||
int8_t txCurrentCalibration=(int8_t) g.profile[g.id()].txCurrentCalibration();
|
||||
int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
|
||||
|
||||
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
|
||||
@@ -204,8 +204,8 @@ bool FlashEEpromDialog::patchCalibration()
|
||||
radioData->generalSettings.trainer.calib[i] = byte16;
|
||||
}
|
||||
}
|
||||
radioData->generalSettings.currentCalib = currentCalib;
|
||||
radioData->generalSettings.vBatCalib = vBatCalib;
|
||||
radioData->generalSettings.txCurrentCalibration = txCurrentCalibration;
|
||||
radioData->generalSettings.txVoltageCalibration = txVoltageCalibration;
|
||||
radioData->generalSettings.PPM_Multiplier = PPM_Multiplier;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -159,6 +159,11 @@ CalibrationPanel::CalibrationPanel(QWidget * parent, GeneralSettings & generalSe
|
||||
ui->serialPortLabel->hide();
|
||||
}
|
||||
|
||||
if (!IS_SKY9X(firmware->getBoard())) {
|
||||
ui->txCurrentCalibration->hide();
|
||||
ui->txCurrentCalibrationLabel->hide();
|
||||
}
|
||||
|
||||
if (IS_TARANIS_X9E(firmware->getBoard())) {
|
||||
ui->bluetoothEnable->setChecked(generalSettings.bluetoothEnable);
|
||||
ui->bluetoothName->setField(generalSettings.bluetoothName, 10, this);
|
||||
@@ -214,9 +219,9 @@ void CalibrationPanel::on_PPM4_editingFinished()
|
||||
}
|
||||
|
||||
|
||||
void CalibrationPanel::on_CurrentCalib_SB_editingFinished()
|
||||
void CalibrationPanel::on_txCurrentCalibration_editingFinished()
|
||||
{
|
||||
generalSettings.currentCalib = ui->CurrentCalib_SB->value();
|
||||
generalSettings.txCurrentCalibration = ui->txCurrentCalibration->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
@@ -228,8 +233,8 @@ void CalibrationPanel::on_bluetoothEnable_stateChanged(int)
|
||||
|
||||
void CalibrationPanel::setValues()
|
||||
{
|
||||
ui->battCalibDSB->setValue((double)generalSettings.vBatCalib/10);
|
||||
ui->CurrentCalib_SB->setValue((double)generalSettings.currentCalib);
|
||||
ui->txVoltageCalibration->setValue((double)generalSettings.txVoltageCalibration/10);
|
||||
ui->txCurrentCalibration->setValue((double)generalSettings.txCurrentCalibration);
|
||||
|
||||
ui->ana1Neg->setValue(generalSettings.calibSpanNeg[0]);
|
||||
ui->ana2Neg->setValue(generalSettings.calibSpanNeg[1]);
|
||||
@@ -265,9 +270,9 @@ void CalibrationPanel::setValues()
|
||||
ui->PPM_MultiplierDSB->setValue((qreal)(generalSettings.PPM_Multiplier+10)/10);
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_battCalibDSB_editingFinished()
|
||||
void CalibrationPanel::on_txVoltageCalibration_editingFinished()
|
||||
{
|
||||
generalSettings.vBatCalib = ui->battCalibDSB->value()*10;
|
||||
generalSettings.txVoltageCalibration = ui->txVoltageCalibration->value()*10;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,14 +21,14 @@ class CalibrationPanel : public GeneralPanel
|
||||
// virtual void update();
|
||||
|
||||
private slots:
|
||||
void on_battCalibDSB_editingFinished();
|
||||
void on_txVoltageCalibration_editingFinished();
|
||||
void on_PPM1_editingFinished();
|
||||
void on_PPM2_editingFinished();
|
||||
void on_PPM3_editingFinished();
|
||||
void on_PPM4_editingFinished();
|
||||
void on_PPM_MultiplierDSB_editingFinished();
|
||||
|
||||
void on_CurrentCalib_SB_editingFinished();
|
||||
void on_txCurrentCalibration_editingFinished();
|
||||
void on_bluetoothEnable_stateChanged(int);
|
||||
|
||||
void on_ana1Neg_editingFinished();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>805</width>
|
||||
<height>1269</height>
|
||||
<height>1313</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -562,14 +562,14 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="42" column="0">
|
||||
<widget class="QLabel" name="label_22">
|
||||
<widget class="QLabel" name="txVoltageCalibrationLabel">
|
||||
<property name="text">
|
||||
<string>Battery</string>
|
||||
<string>Battery Offset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="42" column="1">
|
||||
<widget class="QDoubleSpinBox" name="battCalibDSB">
|
||||
<widget class="QDoubleSpinBox" name="txVoltageCalibration">
|
||||
<property name="statusTip">
|
||||
<string/>
|
||||
</property>
|
||||
@@ -674,7 +674,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="43" column="1">
|
||||
<widget class="QSpinBox" name="CurrentCalib_SB">
|
||||
<widget class="QSpinBox" name="txCurrentCalibration">
|
||||
<property name="minimum">
|
||||
<number>-49</number>
|
||||
</property>
|
||||
@@ -698,9 +698,9 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="43" column="0">
|
||||
<widget class="QLabel" name="label_CurrentCalib">
|
||||
<widget class="QLabel" name="txCurrentCalibrationLabel">
|
||||
<property name="text">
|
||||
<string>Current</string>
|
||||
<string>Current Offset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -88,8 +88,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
}
|
||||
else {
|
||||
QString trainercalib = g.profile[profile_id].trainerCalib();
|
||||
int8_t vBatCalib = (int8_t)g.profile[profile_id].vBatCalib();
|
||||
int8_t currentCalib = (int8_t)g.profile[profile_id].currentCalib();
|
||||
int8_t txVoltageCalibration = (int8_t)g.profile[profile_id].txVoltageCalibration();
|
||||
int8_t txCurrentCalibration = (int8_t)g.profile[profile_id].txCurrentCalibration();
|
||||
int8_t PPM_Multiplier = (int8_t)g.profile[profile_id].ppmMultiplier();
|
||||
uint8_t GSStickMode = (uint8_t)g.profile[profile_id].gsStickMode();
|
||||
uint8_t vBatWarn = (uint8_t)g.profile[profile_id].vBatWarn();
|
||||
@@ -123,8 +123,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
if (ok)
|
||||
generalSettings.trainer.calib[i]=byte16;
|
||||
}
|
||||
generalSettings.currentCalib=currentCalib;
|
||||
generalSettings.vBatCalib=vBatCalib;
|
||||
generalSettings.txCurrentCalibration=txCurrentCalibration;
|
||||
generalSettings.txVoltageCalibration=txVoltageCalibration;
|
||||
generalSettings.vBatWarn=vBatWarn;
|
||||
if (GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
|
||||
generalSettings.vBatMin = (int8_t) g.profile[profile_id].vBatMin();
|
||||
@@ -225,8 +225,8 @@ void GeneralEdit::on_calstore_PB_clicked()
|
||||
calib.append(QString("%1").arg((uint16_t)generalSettings.trainer.calib[i], 4, 16, QChar('0')));
|
||||
}
|
||||
g.profile[profile_id].trainerCalib( calib );
|
||||
g.profile[profile_id].vBatCalib( generalSettings.vBatCalib );
|
||||
g.profile[profile_id].currentCalib( generalSettings.currentCalib );
|
||||
g.profile[profile_id].txVoltageCalibration( generalSettings.txVoltageCalibration );
|
||||
g.profile[profile_id].txCurrentCalibration( generalSettings.txCurrentCalibration );
|
||||
g.profile[profile_id].vBatWarn( generalSettings.vBatWarn );
|
||||
if (GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
|
||||
g.profile[profile_id].vBatMin( generalSettings.vBatMin );
|
||||
|
||||
@@ -1118,8 +1118,8 @@ void MainWindow::createMenus()
|
||||
languageMenu->addAction(germanLangAct);
|
||||
languageMenu->addAction(finnishLangAct);
|
||||
languageMenu->addAction(frenchLangAct);
|
||||
// languageMenu->addAction(hebrewLangAct);
|
||||
languageMenu->addAction(italianLangAct);
|
||||
// languageMenu->addAction(hebrewLangAct);
|
||||
languageMenu->addAction(polishLangAct);
|
||||
// languageMenu->addAction(portugueseLangAct);
|
||||
languageMenu->addAction(spanishLangAct);
|
||||
@@ -1366,20 +1366,20 @@ void MainWindow::updateLanguageActions()
|
||||
frenchLangAct->setChecked(true);
|
||||
else if (langId=="it_IT")
|
||||
italianLangAct->setChecked(true);
|
||||
else if (langId=="he_IL")
|
||||
hebrewLangAct->setChecked(true);
|
||||
// else if (langId=="he_IL")
|
||||
// hebrewLangAct->setChecked(true);
|
||||
else if (langId=="pl_PL")
|
||||
polishLangAct->setChecked(true);
|
||||
else if (langId=="pt_PT")
|
||||
portugueseLangAct->setChecked(true);
|
||||
else if (langId=="ru_RU")
|
||||
russianLangAct->setChecked(true);
|
||||
// else if (langId=="pt_PT")
|
||||
// portugueseLangAct->setChecked(true);
|
||||
else if (langId=="es_ES")
|
||||
spanishLangAct->setChecked(true);
|
||||
else if (langId=="sv_SE")
|
||||
swedishLangAct->setChecked(true);
|
||||
else if (langId=="nl_NL")
|
||||
dutchLangAct->setChecked(true);
|
||||
// else if (langId=="ru_RU")
|
||||
// russianLangAct->setChecked(true);
|
||||
// else if (langId=="nl_NL")
|
||||
// dutchLangAct->setChecked(true);
|
||||
}
|
||||
|
||||
void MainWindow::updateIconThemeActions()
|
||||
|
||||
@@ -262,20 +262,22 @@ class MainWindow : public QMainWindow
|
||||
QAction *normalIconAct;
|
||||
QAction *bigIconAct;
|
||||
QAction *hugeIconAct;
|
||||
|
||||
QAction *sysLangAct;
|
||||
QAction *englishLangAct;
|
||||
QAction *czechLangAct;
|
||||
QAction *germanLangAct;
|
||||
QAction *frenchLangAct;
|
||||
QAction *englishLangAct;
|
||||
QAction *finnishLangAct;
|
||||
QAction *frenchLangAct;
|
||||
QAction *italianLangAct;
|
||||
QAction *hebrewLangAct;
|
||||
// QAction *hebrewLangAct;
|
||||
QAction *polishLangAct;
|
||||
// QAction *portugueseLangAct;
|
||||
QAction *spanishLangAct;
|
||||
QAction *portugueseLangAct;
|
||||
QAction *swedishLangAct;
|
||||
QAction *russianLangAct;
|
||||
QAction *dutchLangAct;
|
||||
// QAction *russianLangAct;
|
||||
// QAction *dutchLangAct;
|
||||
|
||||
QAction *openDocURLAct;
|
||||
};
|
||||
|
||||
|
||||
@@ -121,14 +121,14 @@ bool MixesPanel::AddMixerLine(int dest)
|
||||
QString MixesPanel::getMixerText(int dest, bool * new_ch)
|
||||
{
|
||||
QString str;
|
||||
if (new_ch) *new_ch = 0;
|
||||
bool newChannel = false;
|
||||
if (dest < 0) {
|
||||
str = modelPrinter.printMixerName(-dest);
|
||||
//highlight channel if needed
|
||||
if (-dest == (int)highlightedSource) {
|
||||
str = "<b>" + str + "</b>";
|
||||
}
|
||||
if (new_ch) *new_ch = 1;
|
||||
newChannel = true;
|
||||
}
|
||||
else {
|
||||
MixData & mix = model->mixData[dest];
|
||||
@@ -136,7 +136,7 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch)
|
||||
str = modelPrinter.printMixerName(mix.destCh);
|
||||
|
||||
if ((dest == 0) || (model->mixData[dest-1].destCh != mix.destCh)) {
|
||||
if (new_ch) *new_ch = 1;
|
||||
newChannel = true;
|
||||
//highlight channel if needed
|
||||
if (mix.destCh == highlightedSource) {
|
||||
str = "<b>" + str + "</b>";
|
||||
@@ -146,8 +146,9 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch)
|
||||
str.fill(' ');
|
||||
}
|
||||
|
||||
str += modelPrinter.printMixerLine(mix, highlightedSource);
|
||||
str += modelPrinter.printMixerLine(mix, !newChannel, highlightedSource);
|
||||
}
|
||||
if (new_ch) *new_ch = newChannel;
|
||||
return str.replace(" ", " ");
|
||||
}
|
||||
|
||||
|
||||
@@ -167,8 +167,8 @@ ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module
|
||||
ui->label_module->setText(label);
|
||||
|
||||
// The protocols available on this board
|
||||
for (int i=0; i<PROTO_LAST; i++) {
|
||||
if (GetEepromInterface()->isAvailable((Protocol)i, moduleIdx)) {
|
||||
for (int i=0; i<PULSES_PROTOCOL_LAST; i++) {
|
||||
if (GetEepromInterface()->isAvailable((PulsesProtocol)i, moduleIdx)) {
|
||||
ui->protocol->addItem(ModelPrinter::printModuleProtocol(i), (QVariant)i);
|
||||
if (i == module.protocol) ui->protocol->setCurrentIndex(ui->protocol->count()-1);
|
||||
}
|
||||
@@ -223,42 +223,42 @@ ModulePanel::~ModulePanel()
|
||||
void ModulePanel::update()
|
||||
{
|
||||
unsigned int mask = 0;
|
||||
Protocol protocol = (Protocol)module.protocol;
|
||||
PulsesProtocol protocol = (PulsesProtocol)module.protocol;
|
||||
unsigned int max_rx_num = 63;
|
||||
|
||||
if (moduleIdx >= 0) {
|
||||
mask |= MASK_PROTOCOL;
|
||||
switch (protocol) {
|
||||
case PXX_XJT_X16:
|
||||
case PXX_XJT_D8:
|
||||
case PXX_XJT_LR12:
|
||||
case PXX_DJT:
|
||||
case PULSES_PXX_XJT_X16:
|
||||
case PULSES_PXX_XJT_D8:
|
||||
case PULSES_PXX_XJT_LR12:
|
||||
case PULSES_PXX_DJT:
|
||||
mask |= MASK_CHANNELS_RANGE | MASK_CHANNELS_COUNT;
|
||||
if ((protocol==PXX_XJT_X16) || (protocol==PXX_XJT_LR12)) mask |= MASK_FAILSAFES | MASK_RX_NUMBER;
|
||||
if ((protocol==PULSES_PXX_XJT_X16) || (protocol==PULSES_PXX_XJT_LR12)) mask |= MASK_FAILSAFES | MASK_RX_NUMBER;
|
||||
break;
|
||||
case LP45:
|
||||
case DSM2:
|
||||
case DSMX:
|
||||
case PULSES_LP45:
|
||||
case PULSES_DSM2:
|
||||
case PULSES_DSMX:
|
||||
mask |= MASK_CHANNELS_RANGE | MASK_RX_NUMBER;
|
||||
module.channelsCount = 6;
|
||||
max_rx_num = 20;
|
||||
break;
|
||||
case PPM:
|
||||
case PULSES_PPM:
|
||||
mask |= MASK_PPM_FIELDS | MASK_CHANNELS_RANGE| MASK_CHANNELS_COUNT;
|
||||
if (IS_9XRPRO(firmware->getBoard())) {
|
||||
mask |= MASK_OPEN_DRAIN;
|
||||
}
|
||||
break;
|
||||
case OFF:
|
||||
case PULSES_OFF:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (IS_TARANIS(firmware->getBoard())) {
|
||||
switch(model->trainerMode) {
|
||||
case MASTER_JACK:
|
||||
case TRAINER_MASTER_JACK:
|
||||
break;
|
||||
case SLAVE_JACK:
|
||||
case TRAINER_SLAVE_JACK:
|
||||
mask |= MASK_PPM_FIELDS | MASK_CHANNELS_RANGE | MASK_CHANNELS_COUNT;
|
||||
break;
|
||||
default:
|
||||
@@ -266,7 +266,7 @@ void ModulePanel::update()
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (model->trainerMode != MASTER_JACK) {
|
||||
else if (model->trainerMode != TRAINER_MASTER_JACK) {
|
||||
mask |= MASK_PPM_FIELDS | MASK_CHANNELS_RANGE | MASK_CHANNELS_COUNT;
|
||||
}
|
||||
|
||||
|
||||
@@ -533,6 +533,7 @@ void TelemetrySensorPanel::update()
|
||||
bool cellsFieldsDisplayed = false;
|
||||
bool consFieldsDisplayed = false;
|
||||
bool ratioFieldsDisplayed = false;
|
||||
bool totalizeFieldsDisplayed = false;
|
||||
bool sources12FieldsDisplayed = false;
|
||||
bool sources34FieldsDisplayed = false;
|
||||
|
||||
@@ -556,6 +557,7 @@ void TelemetrySensorPanel::update()
|
||||
consFieldsDisplayed = (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION);
|
||||
sources12FieldsDisplayed = (sensor.formula <= SensorData::TELEM_FORMULA_MULTIPLY);
|
||||
sources34FieldsDisplayed = (sensor.formula < SensorData::TELEM_FORMULA_MULTIPLY);
|
||||
totalizeFieldsDisplayed = (sensor.formula == SensorData::TELEM_FORMULA_TOTALIZE);
|
||||
updateSourcesComboBox(ui->source1, true);
|
||||
updateSourcesComboBox(ui->source2, true);
|
||||
updateSourcesComboBox(ui->source3, true);
|
||||
@@ -595,15 +597,15 @@ void TelemetrySensorPanel::update()
|
||||
ui->offsetLabel->setVisible(ratioFieldsDisplayed && sensor.unit != SensorData::UNIT_RPMS);
|
||||
ui->multiplierLabel->setVisible(sensor.unit == SensorData::UNIT_RPMS);
|
||||
ui->offset->setVisible(ratioFieldsDisplayed);
|
||||
ui->precLabel->setVisible(isConfigurable);
|
||||
ui->precLabel->setVisible(isConfigurable && sensor.unit != SensorData::UNIT_FAHRENHEIT);
|
||||
ui->prec->setVisible(isConfigurable && sensor.unit != SensorData::UNIT_FAHRENHEIT);
|
||||
ui->unit->setVisible((sensor.type == SensorData::TELEM_TYPE_CALCULATED && (sensor.formula == SensorData::TELEM_FORMULA_DIST)) || isConfigurable);
|
||||
ui->gpsSensorLabel->setVisible(gpsFieldsDisplayed);
|
||||
ui->gpsSensor->setVisible(gpsFieldsDisplayed);
|
||||
ui->altSensorLabel->setVisible(gpsFieldsDisplayed);
|
||||
ui->altSensor->setVisible(gpsFieldsDisplayed);
|
||||
ui->ampsSensorLabel->setVisible(consFieldsDisplayed);
|
||||
ui->ampsSensor->setVisible(consFieldsDisplayed);
|
||||
ui->ampsSensorLabel->setVisible(consFieldsDisplayed || totalizeFieldsDisplayed);
|
||||
ui->ampsSensor->setVisible(consFieldsDisplayed || totalizeFieldsDisplayed);
|
||||
ui->cellsSensorLabel->setVisible(cellsFieldsDisplayed);
|
||||
ui->cellsSensor->setVisible(cellsFieldsDisplayed);
|
||||
ui->cellsIndex->setVisible(cellsFieldsDisplayed);
|
||||
@@ -749,7 +751,7 @@ TelemetryPanel::~TelemetryPanel()
|
||||
void TelemetryPanel::update()
|
||||
{
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
if (model->moduleData[0].protocol == OFF && model->moduleData[1].protocol == PPM) {
|
||||
if (model->moduleData[0].protocol == PULSES_OFF && model->moduleData[1].protocol == PULSES_PPM) {
|
||||
ui->telemetryProtocol->setEnabled(true);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -62,7 +62,16 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="rssiLayout" columnstretch="0,0,1">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item row="2" column="0">
|
||||
@@ -269,7 +278,16 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="A1Layout">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item>
|
||||
@@ -294,7 +312,16 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="A2Layout">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item>
|
||||
@@ -322,7 +349,16 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_39">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
@@ -571,7 +607,16 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_40">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
@@ -642,7 +687,16 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
@@ -893,7 +947,16 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="sensorsLayout" columnstretch="0">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
|
||||
@@ -272,7 +272,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Amps Sensor :</string>
|
||||
<string>Sensor :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -366,82 +366,82 @@
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Voltage (V)</string>
|
||||
<string>V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Current (A)</string>
|
||||
<string>A</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Current (mA)</string>
|
||||
<string>mA</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Speed (kts)</string>
|
||||
<string>kt</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Speed (m/s)</string>
|
||||
<string>m/s</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Speed (ft/s)</string>
|
||||
<string>ft/s</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Speed (km/h)</string>
|
||||
<string>km/h</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Speed (miles/h)</string>
|
||||
<string>mph</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Meters (m)</string>
|
||||
<string>m</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Feet (ft)</string>
|
||||
<string>ft</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Temp (°C)</string>
|
||||
<string>°C</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Temp (°F)</string>
|
||||
<string>°F</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Percentage (%)</string>
|
||||
<string>%</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Energy (mAh)</string>
|
||||
<string>mAh</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Power (W)</string>
|
||||
<string>W</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>RF Power (dBm)</string>
|
||||
<string>dBm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
@@ -451,22 +451,22 @@
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Acceleration (g)</string>
|
||||
<string>g</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Heading (°)</string>
|
||||
<string>°</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Volume (mL)</string>
|
||||
<string>mL</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Volume (US fl.Oz.)</string>
|
||||
<string>US fl.Oz.</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
|
||||
@@ -108,13 +108,13 @@ QString ModelPrinter::printModuleProtocol(unsigned int protocol)
|
||||
QString ModelPrinter::printModule(int idx)
|
||||
{
|
||||
const ModuleData & module = model.moduleData[idx];
|
||||
if (module.protocol == OFF)
|
||||
if (module.protocol == PULSES_OFF)
|
||||
return printModuleProtocol(module.protocol);
|
||||
else if (module.protocol == PPM)
|
||||
else if (module.protocol == PULSES_PPM)
|
||||
return tr("%1, Channels(%2-%3), PPM delay(%4usec), Pulse polarity(%5)").arg(printModuleProtocol(module.protocol)).arg(module.channelsStart+1).arg(module.channelsStart+module.channelsCount).arg(module.ppmDelay).arg(module.polarityToString());
|
||||
else {
|
||||
QString result = tr("%1, Channels(%2-%3)").arg(printModuleProtocol(module.protocol)).arg(module.channelsStart+1).arg(module.channelsStart+module.channelsCount);
|
||||
if (module.protocol != PXX_XJT_D8) {
|
||||
if (module.protocol != PULSES_PXX_XJT_D8) {
|
||||
result += " " + tr("Receiver number(%1)").arg(module.modelId);
|
||||
}
|
||||
return result;
|
||||
@@ -327,21 +327,25 @@ QString ModelPrinter::printMixerName(int curDest)
|
||||
return Qt::escape(str);
|
||||
}
|
||||
|
||||
QString ModelPrinter::printMixerLine(int idx, int highlightedSource)
|
||||
QString ModelPrinter::printMixerLine(int idx, bool showMultiplex, int highlightedSource)
|
||||
{
|
||||
return printMixerLine(model.mixData[idx], highlightedSource);
|
||||
return printMixerLine(model.mixData[idx], highlightedSource, showMultiplex);
|
||||
}
|
||||
|
||||
QString ModelPrinter::printMixerLine(const MixData & mix, int highlightedSource)
|
||||
QString ModelPrinter::printMixerLine(const MixData & mix, bool showMultiplex, int highlightedSource)
|
||||
{
|
||||
QString str = " ";
|
||||
|
||||
switch(mix.mltpx) {
|
||||
case (1): str += "*"; break;
|
||||
case (2): str += "R"; break;
|
||||
default: str += " "; break;
|
||||
};
|
||||
|
||||
if (showMultiplex) {
|
||||
switch(mix.mltpx) {
|
||||
case (1): str += "*="; break;
|
||||
case (2): str += ":="; break;
|
||||
default: str += "+="; break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
str += " ";
|
||||
}
|
||||
// highlight source if needed
|
||||
QString source = Qt::escape(mix.srcRaw.toString(&model));
|
||||
if ( (mix.srcRaw.type == SOURCE_TYPE_CH) && (mix.srcRaw.index+1 == (int)highlightedSource) ) {
|
||||
|
||||
@@ -50,8 +50,8 @@ class ModelPrinter: public QObject
|
||||
QString printInputLine(int idx);
|
||||
QString printInputLine(const ExpoData & ed);
|
||||
QString printMixerName(int curDest);
|
||||
QString printMixerLine(int idx, int highlightedSource = 0);
|
||||
QString printMixerLine(const MixData & md, int highlightedSource = 0);
|
||||
QString printMixerLine(int idx, bool showMultiplex, int highlightedSource = 0);
|
||||
QString printMixerLine(const MixData & md, bool showMultiplex, int highlightedSource = 0);
|
||||
QString printLogicalSwitchLine(int idx);
|
||||
QString printCustomFunctionLine(int idx);
|
||||
static QString printChannelName(int idx);
|
||||
|
||||
@@ -357,7 +357,7 @@ QString MultiModelPrinter::printMixers()
|
||||
for (int j=0; j<count; j++) {
|
||||
if (j > 0)
|
||||
columns.append("<br/>");
|
||||
COMPARE((j < model->mixes(i).size()) ? modelPrinter->printMixerLine(*model->mixes(i)[j]) : " ");
|
||||
COMPARE((j < model->mixes(i).size()) ? modelPrinter->printMixerLine(*model->mixes(i)[j], (j>0)) : " ");
|
||||
}
|
||||
columns.append("</td></tr>");
|
||||
}
|
||||
|
||||
+1574
-1413
File diff suppressed because it is too large
Load Diff
+1597
-1344
File diff suppressed because it is too large
Load Diff
+1533
-1525
File diff suppressed because it is too large
Load Diff
+1562
-1437
File diff suppressed because it is too large
Load Diff
+1599
-1341
File diff suppressed because it is too large
Load Diff
+1604
-2152
File diff suppressed because it is too large
Load Diff
+1600
-1334
File diff suppressed because it is too large
Load Diff
+1562
-2109
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1655
-1999
File diff suppressed because it is too large
Load Diff
+1646
-2026
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -69,7 +69,7 @@ void saveGeneralSettings(GeneralSettings & settings, global_settings & gs)
|
||||
|
||||
// TODO BSS settings.currModel;
|
||||
gs.contrast(settings.contrast);
|
||||
gs.battery(battery(settings.vBatCalib, settings.vBatWarn));
|
||||
gs.battery(battery(settings.txVoltageCalibration, settings.vBatWarn));
|
||||
|
||||
gs.ppm_input_calibration(ppm_input_calibration(settings.PPM_Multiplier,
|
||||
PPMCalibration(settings.trainer.calib[0]),
|
||||
@@ -124,7 +124,7 @@ void saveModel(ModelData & m, model & xm)
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (m.moduleData[0].protocol != PPM || m.moduleData[0].channelsCount != 8 || m.moduleData[0].ppmDelay != 300 || m.moduleData[0].ppmPulsePol != 0) {
|
||||
if (m.moduleData[0].protocol != PULSES_PPM || m.moduleData[0].channelsCount != 8 || m.moduleData[0].ppmDelay != 300 || m.moduleData[0].ppmPulsePol != 0) {
|
||||
modulation mod;
|
||||
mod.type(modulation::type_type::value(m.moduleData[0].protocol));
|
||||
mod.channels(m.moduleData[0].channelsCount);
|
||||
|
||||
Reference in New Issue
Block a user