mirror of
https://github.com/opentx/opentx.git
synced 2025-07-21 07:15:12 +03:00
Merge branch 'origin/next'
Conflicts: companion/src/CMakeLists.txt companion/src/apppreferencesdialog.ui companion/src/companion.qrc companion/src/mdichild.cpp
This commit is contained in:
commit
8059daccaf
236 changed files with 25514 additions and 16461 deletions
|
@ -127,11 +127,14 @@ RawSourceRange RawSource::getRange(bool singleprec)
|
|||
result.max = singleprec ? 1540 : 3000;
|
||||
break;
|
||||
case TELEMETRY_SOURCE_T1:
|
||||
case TELEMETRY_SOURCE_T1_MAX:
|
||||
case TELEMETRY_SOURCE_T2:
|
||||
case TELEMETRY_SOURCE_T2_MAX:
|
||||
result.min = -30;
|
||||
result.max = 225;
|
||||
break;
|
||||
case TELEMETRY_SOURCE_RPM:
|
||||
case TELEMETRY_SOURCE_RPM_MAX:
|
||||
result.step = singleprec ? 50 : 1;
|
||||
result.max = singleprec ? 12750 : 20000;
|
||||
break;
|
||||
|
@ -139,6 +142,7 @@ RawSourceRange RawSource::getRange(bool singleprec)
|
|||
result.max = 100;
|
||||
break;
|
||||
case TELEMETRY_SOURCE_SPEED:
|
||||
case TELEMETRY_SOURCE_SPEED_MAX:
|
||||
result.step = singleprec ? 4 : 1;
|
||||
result.max = singleprec ? 944 : 2000;
|
||||
if (model && !model->frsky.imperial) {
|
||||
|
@ -147,21 +151,26 @@ RawSourceRange RawSource::getRange(bool singleprec)
|
|||
}
|
||||
break;
|
||||
case TELEMETRY_SOURCE_DIST:
|
||||
case TELEMETRY_SOURCE_DIST_MAX:
|
||||
result.step = singleprec ? 8 : 1;
|
||||
result.max = singleprec ? 2040 : 10000;
|
||||
break;
|
||||
case TELEMETRY_SOURCE_CELL:
|
||||
case TELEMETRY_SOURCE_CELL_MIN:
|
||||
result.step = singleprec ? 0.02 : 0.01;
|
||||
result.max = 5.1;
|
||||
result.decimals = 2;
|
||||
break;
|
||||
case TELEMETRY_SOURCE_CELLS_SUM:
|
||||
case TELEMETRY_SOURCE_CELLS_MIN:
|
||||
case TELEMETRY_SOURCE_VFAS:
|
||||
case TELEMETRY_SOURCE_VFAS_MIN:
|
||||
result.step = 0.1;
|
||||
result.max = 25.5;
|
||||
result.decimals = 1;
|
||||
break;
|
||||
case TELEMETRY_SOURCE_CURRENT:
|
||||
case TELEMETRY_SOURCE_CURRENT_MAX:
|
||||
result.step = singleprec ? 0.5 : 0.1;
|
||||
result.max = singleprec ? 127.5 : 200.0;
|
||||
result.decimals = 1;
|
||||
|
@ -171,6 +180,7 @@ RawSourceRange RawSource::getRange(bool singleprec)
|
|||
result.max = singleprec ? 5100 : 10000;
|
||||
break;
|
||||
case TELEMETRY_SOURCE_POWER:
|
||||
case TELEMETRY_SOURCE_POWER_MAX:
|
||||
result.step = singleprec ? 5 : 1;
|
||||
result.max = singleprec ? 1275 : 2000;
|
||||
break;
|
||||
|
@ -222,20 +232,20 @@ QString RawSource::toString()
|
|||
QObject::tr("A1"), QObject::tr("A2"), QObject::tr("A3"), QObject::tr("A4"),
|
||||
QObject::tr("Alt"), QObject::tr("Rpm"), QObject::tr("Fuel"), QObject::tr("T1"), QObject::tr("T2"),
|
||||
QObject::tr("Speed"), QObject::tr("Dist"), QObject::tr("GPS Alt"),
|
||||
QObject::tr("Cell"), QObject::tr("Cels"), QObject::tr("Vfas"), QObject::tr("Curr"), QObject::tr("Cnsp"), QObject::tr("Powr"),
|
||||
QObject::tr("Cell"), QObject::tr("Cells"), QObject::tr("Vfas"), QObject::tr("Curr"), QObject::tr("Cnsp"), QObject::tr("Powr"),
|
||||
QObject::tr("AccX"), QObject::tr("AccY"), QObject::tr("AccZ"),
|
||||
QObject::tr("HDG "), QObject::tr("VSpd"), QObject::tr("ASpd"), QObject::tr("dTE"),
|
||||
QObject::tr("A1-"), QObject::tr("A2-"), QObject::tr("A3-"), QObject::tr("A4-"),
|
||||
QObject::tr("Alt-"), QObject::tr("Alt+"), QObject::tr("Rpm+"), QObject::tr("T1+"), QObject::tr("T2+"), QObject::tr("Spd+"), QObject::tr("Dst+"),
|
||||
QObject::tr("Cel-"), QObject::tr("Cels-"), QObject::tr("Vfs-"), QObject::tr("Cur+"), QObject::tr("Pwr+"),
|
||||
QObject::tr("Alt-"), QObject::tr("Alt+"), QObject::tr("Rpm+"), QObject::tr("T1+"), QObject::tr("T2+"), QObject::tr("Speed+"), QObject::tr("Dist+"),
|
||||
QObject::tr("Cell-"), QObject::tr("Cells-"), QObject::tr("Vfas-"), QObject::tr("Curr+"), QObject::tr("Powr+"),
|
||||
QObject::tr("ACC"), QObject::tr("Time"),
|
||||
};
|
||||
|
||||
static const QString virtualSwitches[] = {
|
||||
QObject::tr("LS1"), QObject::tr("LS2"), QObject::tr("LS3"), QObject::tr("LS4"), QObject::tr("LS5"), QObject::tr("LS6"), QObject::tr("LS7"), QObject::tr("LS8"), QObject::tr("LS9"), QObject::tr("LSA"),
|
||||
QObject::tr("LSB"), QObject::tr("LSC"), QObject::tr("LSD"), QObject::tr("LSE"), QObject::tr("LSF"), QObject::tr("LSG"), QObject::tr("LSH"), QObject::tr("LSI"), QObject::tr("LSJ"), QObject::tr("LSK"),
|
||||
QObject::tr("LSL"), QObject::tr("LSM"), QObject::tr("LSN"), QObject::tr("LSO"), QObject::tr("LSP"), QObject::tr("LSQ"), QObject::tr("LSR"), QObject::tr("LSS"), QObject::tr("LST"), QObject::tr("LSU"),
|
||||
QObject::tr("LSV"), QObject::tr("LSW")
|
||||
QObject::tr("L1"), QObject::tr("L2"), QObject::tr("L3"), QObject::tr("L4"), QObject::tr("L5"), QObject::tr("L6"), QObject::tr("L7"), QObject::tr("L8"), QObject::tr("L9"), QObject::tr("L10"),
|
||||
QObject::tr("L11"), QObject::tr("L12"), QObject::tr("L13"), QObject::tr("L14"), QObject::tr("L15"), QObject::tr("L16"), QObject::tr("L17"), QObject::tr("L18"), QObject::tr("L19"), QObject::tr("L20"),
|
||||
QObject::tr("L21"), QObject::tr("L22"), QObject::tr("L23"), QObject::tr("L24"), QObject::tr("L25"), QObject::tr("L26"), QObject::tr("L27"), QObject::tr("L28"), QObject::tr("L29"), QObject::tr("L30"),
|
||||
QObject::tr("L31"), QObject::tr("L32")
|
||||
};
|
||||
|
||||
if (index<0) {
|
||||
|
@ -265,7 +275,7 @@ QString RawSource::toString()
|
|||
case SOURCE_TYPE_CYC:
|
||||
return QObject::tr("CYC%1").arg(index+1);
|
||||
case SOURCE_TYPE_PPM:
|
||||
return QObject::tr("PPM%1").arg(index+1);
|
||||
return QObject::tr("TR%1").arg(index+1);
|
||||
case SOURCE_TYPE_CH:
|
||||
if (index < GetEepromInterface()->getCapability(Outputs))
|
||||
return QObject::tr("CH%1%2").arg((index+1)/10).arg((index+1)%10);
|
||||
|
@ -312,10 +322,10 @@ QString RawSwitch::toString()
|
|||
};
|
||||
|
||||
static const QString virtualSwitches[] = {
|
||||
QObject::tr("LS1"), QObject::tr("LS2"), QObject::tr("LS3"), QObject::tr("LS4"), QObject::tr("LS5"), QObject::tr("LS6"), QObject::tr("LS7"), QObject::tr("LS8"), QObject::tr("LS9"), QObject::tr("LSA"),
|
||||
QObject::tr("LSB"), QObject::tr("LSC"), QObject::tr("LSD"), QObject::tr("LSE"), QObject::tr("LSF"), QObject::tr("LSG"), QObject::tr("LSH"), QObject::tr("LSI"), QObject::tr("LSJ"), QObject::tr("LSK"),
|
||||
QObject::tr("LSL"), QObject::tr("LSM"), QObject::tr("LSN"), QObject::tr("LSO"), QObject::tr("LSP"), QObject::tr("LSQ"), QObject::tr("LSR"), QObject::tr("LSS"), QObject::tr("LST"), QObject::tr("LSU"),
|
||||
QObject::tr("LSV"), QObject::tr("LSW")
|
||||
QObject::tr("L1"), QObject::tr("L2"), QObject::tr("L3"), QObject::tr("L4"), QObject::tr("L5"), QObject::tr("L6"), QObject::tr("L7"), QObject::tr("L8"), QObject::tr("L9"), QObject::tr("L10"),
|
||||
QObject::tr("L11"), QObject::tr("L12"), QObject::tr("L13"), QObject::tr("L14"), QObject::tr("L15"), QObject::tr("L16"), QObject::tr("L17"), QObject::tr("L18"), QObject::tr("L19"), QObject::tr("L20"),
|
||||
QObject::tr("L21"), QObject::tr("L22"), QObject::tr("L23"), QObject::tr("L24"), QObject::tr("L25"), QObject::tr("L26"), QObject::tr("L27"), QObject::tr("L28"), QObject::tr("L29"), QObject::tr("L30"),
|
||||
QObject::tr("L31"), QObject::tr("L32")
|
||||
};
|
||||
|
||||
static const QString multiposPots[] = {
|
||||
|
@ -451,7 +461,7 @@ QString LogicalSwitchData::funcToString()
|
|||
case LS_FN_STICKY:
|
||||
return QObject::tr("Sticky");
|
||||
case LS_FN_STAY:
|
||||
return QObject::tr("Stay");
|
||||
return QObject::tr("Edge");
|
||||
default:
|
||||
return QObject::tr("Unknown");
|
||||
}
|
||||
|
@ -782,115 +792,122 @@ QString FuncSwData::repeatToString()
|
|||
GeneralSettings::GeneralSettings()
|
||||
{
|
||||
memset(this, 0, sizeof(GeneralSettings));
|
||||
|
||||
contrast = 25;
|
||||
vBatWarn = 90;
|
||||
for (int i=0; i<(NUM_STICKS+C9X_NUM_POTS ); ++i) {
|
||||
|
||||
for (int i=0; i<NUM_STICKS+C9X_NUM_POTS; ++i) {
|
||||
calibMid[i] = 0x200;
|
||||
calibSpanNeg[i] = 0x180;
|
||||
calibSpanPos[i] = 0x180;
|
||||
}
|
||||
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
potsType[0] = 1;
|
||||
potsType[1] = 1;
|
||||
}
|
||||
|
||||
templateSetup = g.profile[g.id()].channelOrder();
|
||||
stickMode = g.profile[g.id()].defaultMode();
|
||||
|
||||
QString t_calib=g.profile[g.id()].stickPotCalib();
|
||||
int potsnum=GetEepromInterface()->getCapability(Pots);
|
||||
if (t_calib.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
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_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();
|
||||
QString t_DisplaySet=g.profile[g.id()].display();
|
||||
QString t_BeeperSet=g.profile[g.id()].beeper();
|
||||
QString t_HapticSet=g.profile[g.id()].haptic();
|
||||
QString t_SpeakerSet=g.profile[g.id()].speaker();
|
||||
QString t_CountrySet=g.profile[g.id()].countryCode();
|
||||
QString t_calib=g.profile[g.id()].stickPotCalib();
|
||||
int potsnum=GetEepromInterface()->getCapability(Pots);
|
||||
if (t_calib.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
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_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();
|
||||
QString t_DisplaySet=g.profile[g.id()].display();
|
||||
QString t_BeeperSet=g.profile[g.id()].beeper();
|
||||
QString t_HapticSet=g.profile[g.id()].haptic();
|
||||
QString t_SpeakerSet=g.profile[g.id()].speaker();
|
||||
QString t_CountrySet=g.profile[g.id()].countryCode();
|
||||
|
||||
if ((t_calib.length()==(NUM_STICKS+potsnum)*12) && (t_trainercalib.length()==16)) {
|
||||
QString Byte;
|
||||
int16_t byte16;
|
||||
bool ok;
|
||||
for (int i=0; i<(NUM_STICKS+potsnum); i++) {
|
||||
Byte=t_calib.mid(i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
calibMid[i]=byte16;
|
||||
Byte=t_calib.mid(4+i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
calibSpanNeg[i]=byte16;
|
||||
Byte=t_calib.mid(8+i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
calibSpanPos[i]=byte16;
|
||||
}
|
||||
for (int i=0; i<4; i++) {
|
||||
Byte=t_trainercalib.mid(i*4,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
trainer.calib[i]=byte16;
|
||||
}
|
||||
currentCalib=t_currentCalib;
|
||||
vBatCalib=t_vBatCalib;
|
||||
vBatWarn=t_vBatWarn;
|
||||
PPM_Multiplier=t_PPM_Multiplier;
|
||||
stickMode = t_stickMode;
|
||||
if ((t_calib.length()==(NUM_STICKS+potsnum)*12) && (t_trainercalib.length()==16)) {
|
||||
QString Byte;
|
||||
int16_t byte16;
|
||||
bool ok;
|
||||
for (int i=0; i<(NUM_STICKS+potsnum); i++) {
|
||||
Byte=t_calib.mid(i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
calibMid[i]=byte16;
|
||||
Byte=t_calib.mid(4+i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
calibSpanNeg[i]=byte16;
|
||||
Byte=t_calib.mid(8+i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
calibSpanPos[i]=byte16;
|
||||
}
|
||||
if ((t_DisplaySet.length()==6) && (t_BeeperSet.length()==4) && (t_HapticSet.length()==6) && (t_SpeakerSet.length()==6)) {
|
||||
uint8_t byte8u;
|
||||
int8_t byte8;
|
||||
bool ok;
|
||||
byte8=(int8_t)t_DisplaySet.mid(0,2).toInt(&ok,16);
|
||||
for (int i=0; i<4; i++) {
|
||||
Byte=t_trainercalib.mid(i*4,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
optrexDisplay=(byte8==1 ? true : false);
|
||||
byte8u=(uint8_t)t_DisplaySet.mid(2,2).toUInt(&ok,16);
|
||||
trainer.calib[i]=byte16;
|
||||
}
|
||||
currentCalib=t_currentCalib;
|
||||
vBatCalib=t_vBatCalib;
|
||||
vBatWarn=t_vBatWarn;
|
||||
PPM_Multiplier=t_PPM_Multiplier;
|
||||
stickMode = t_stickMode;
|
||||
}
|
||||
if ((t_DisplaySet.length()==6) && (t_BeeperSet.length()==4) && (t_HapticSet.length()==6) && (t_SpeakerSet.length()==6)) {
|
||||
uint8_t byte8u;
|
||||
int8_t byte8;
|
||||
bool ok;
|
||||
byte8=(int8_t)t_DisplaySet.mid(0,2).toInt(&ok,16);
|
||||
if (ok)
|
||||
optrexDisplay=(byte8==1 ? true : false);
|
||||
byte8u=(uint8_t)t_DisplaySet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
contrast=byte8u;
|
||||
byte8u=(uint8_t)t_DisplaySet.mid(4,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
backlightBright=byte8u;
|
||||
byte8=(int8_t)t_BeeperSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
beeperMode=(BeeperMode)byte8;
|
||||
byte8=(int8_t)t_BeeperSet.mid(2,2).toInt(&ok,16);
|
||||
if (ok)
|
||||
beeperLength=byte8;
|
||||
byte8=(int8_t)t_HapticSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
hapticMode=(BeeperMode)byte8;
|
||||
byte8u=(uint8_t)t_HapticSet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
hapticStrength=byte8u;
|
||||
byte8=(int8_t)t_HapticSet.mid(4,2).toInt(&ok,16);
|
||||
if (ok)
|
||||
hapticLength=byte8;
|
||||
byte8u=(uint8_t)t_SpeakerSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
speakerMode=byte8u;
|
||||
byte8u=(uint8_t)t_SpeakerSet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
speakerPitch=byte8u;
|
||||
byte8u=(uint8_t)t_SpeakerSet.mid(4,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
speakerVolume=byte8u;
|
||||
if (t_CountrySet.length()==6) {
|
||||
byte8u=(uint8_t)t_CountrySet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
contrast=byte8u;
|
||||
byte8u=(uint8_t)t_DisplaySet.mid(4,2).toUInt(&ok,16);
|
||||
countryCode=byte8u;
|
||||
byte8u=(uint8_t)t_CountrySet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
backlightBright=byte8u;
|
||||
byte8=(int8_t)t_BeeperSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
beeperMode=(BeeperMode)byte8;
|
||||
byte8=(int8_t)t_BeeperSet.mid(2,2).toInt(&ok,16);
|
||||
if (ok)
|
||||
beeperLength=byte8;
|
||||
byte8=(int8_t)t_HapticSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
hapticMode=(BeeperMode)byte8;
|
||||
byte8u=(uint8_t)t_HapticSet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
hapticStrength=byte8u;
|
||||
byte8=(int8_t)t_HapticSet.mid(4,2).toInt(&ok,16);
|
||||
if (ok)
|
||||
hapticLength=byte8;
|
||||
byte8u=(uint8_t)t_SpeakerSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
speakerMode=byte8u;
|
||||
byte8u=(uint8_t)t_SpeakerSet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
speakerPitch=byte8u;
|
||||
byte8u=(uint8_t)t_SpeakerSet.mid(4,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
speakerVolume=byte8u;
|
||||
if (t_CountrySet.length()==6) {
|
||||
byte8u=(uint8_t)t_CountrySet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
countryCode=byte8u;
|
||||
byte8u=(uint8_t)t_CountrySet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
imperial=byte8u;
|
||||
QString chars=t_CountrySet.mid(4,2);
|
||||
ttsLanguage[0]=chars[0].toAscii();
|
||||
ttsLanguage[1]=chars[1].toAscii();
|
||||
}
|
||||
imperial=byte8u;
|
||||
QString chars=t_CountrySet.mid(4,2);
|
||||
ttsLanguage[0]=chars[0].toAscii();
|
||||
ttsLanguage[1]=chars[1].toAscii();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
RawSource GeneralSettings::getDefaultSource(unsigned int channel) const
|
||||
|
@ -899,6 +916,15 @@ RawSource GeneralSettings::getDefaultSource(unsigned int channel) const
|
|||
return RawSource(SOURCE_TYPE_STICK, stick_index);
|
||||
}
|
||||
|
||||
void FrSkyData::clear()
|
||||
{
|
||||
memset(this, 0, sizeof(FrSkyData));
|
||||
rssiAlarms[0].clear(2, 45);
|
||||
rssiAlarms[1].clear(3, 42);
|
||||
varioSource = 2/*VARIO*/;
|
||||
blades = 2;
|
||||
}
|
||||
|
||||
ModelData::ModelData()
|
||||
{
|
||||
clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue