1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-21 15:25:17 +03:00

Merge branch 'next'

This commit is contained in:
Damjan Adamic 2014-05-05 22:13:24 +02:00
parent b9ee1d5dee
commit 61addd3d4e
42 changed files with 1291 additions and 1185 deletions

View file

@ -200,8 +200,8 @@ RawSourceRange RawSource::getRange(bool singleprec)
result.decimals = 1;
break;
case TELEMETRY_SOURCE_CONSUMPTION:
result.step = singleprec ? 20 : 1;
result.max = singleprec ? 5100 : 10000;
result.step = singleprec ? 100 : 1;
result.max = singleprec ? 25500 : 10000;
break;
case TELEMETRY_SOURCE_POWER:
case TELEMETRY_SOURCE_POWER_MAX:
@ -272,7 +272,7 @@ QString RawSource::toString()
QObject::tr("ACC"), QObject::tr("Time"),
};
static const QString virtualSwitches[] = {
static const QString logicalSwitches[] = {
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"),
@ -302,7 +302,7 @@ QString RawSource::toString()
case SOURCE_TYPE_SWITCH:
return (IS_TARANIS(GetEepromInterface()->getBoard()) ? CHECK_IN_ARRAY(switchesX9D, index) : CHECK_IN_ARRAY(switches9X, index));
case SOURCE_TYPE_CUSTOM_SWITCH:
return virtualSwitches[index];
return logicalSwitches[index];
case SOURCE_TYPE_CYC:
return QObject::tr("CYC%1").arg(index+1);
case SOURCE_TYPE_PPM:
@ -349,13 +349,17 @@ QString RawSwitch::toString()
SwitchUp('H'), SwitchDn('H'),
};
static const QString virtualSwitches[] = {
static const QString logicalSwitches[] = {
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 flightModes[] = {
QObject::tr("FM0"), QObject::tr("FM1"), QObject::tr("FM2"), QObject::tr("FM3"), QObject::tr("FM4"), QObject::tr("FM5"), QObject::tr("FM6"), QObject::tr("FM7"), QObject::tr("FM8")
};
static const QString multiposPots[] = {
QObject::tr("S11"), QObject::tr("S12"), QObject::tr("S13"), QObject::tr("S14"), QObject::tr("S15"), QObject::tr("S16"),
QObject::tr("S21"), QObject::tr("S22"), QObject::tr("S23"), QObject::tr("S24"), QObject::tr("S25"), QObject::tr("S26"),
@ -389,7 +393,7 @@ QString RawSwitch::toString()
else
return CHECK_IN_ARRAY(switches9X, index-1);
case SWITCH_TYPE_VIRTUAL:
return CHECK_IN_ARRAY(virtualSwitches, index-1);
return CHECK_IN_ARRAY(logicalSwitches, index-1);
case SWITCH_TYPE_MULTIPOS_POT:
return CHECK_IN_ARRAY(multiposPots, index-1);
case SWITCH_TYPE_TRIM:
@ -400,6 +404,8 @@ QString RawSwitch::toString()
return QObject::tr("ON");
case SWITCH_TYPE_OFF:
return QObject::tr("OFF");
case SWITCH_TYPE_FLIGHT_MODE:
return CHECK_IN_ARRAY(flightModes, index-1);
case SWITCH_TYPE_NONE:
return QObject::tr("----");
case SWITCH_TYPE_TIMER_MODE:
@ -1060,7 +1066,7 @@ void ModelData::clear()
moduleData[0].protocol=PPM;
moduleData[1].protocol=OFF;
}
for (int i=0; i<C9X_MAX_PHASES; i++)
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++)
phaseData[i].clear();
clearInputs();
clearMixes();
@ -1130,7 +1136,7 @@ void ModelData::setDefaultValues(unsigned int id, const GeneralSettings & settin
int ModelData::getTrimValue(int phaseIdx, int trimIdx)
{
int result = 0;
for (int i=0; i<C9X_MAX_PHASES; i++) {
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
PhaseData & phase = phaseData[phaseIdx];
if (phase.trimMode[trimIdx] < 0) {
return result;
@ -1153,7 +1159,7 @@ int ModelData::getTrimValue(int phaseIdx, int trimIdx)
void ModelData::setTrimValue(int phaseIdx, int trimIdx, int value)
{
for (uint8_t i=0; i<C9X_MAX_PHASES; i++) {
for (uint8_t i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
PhaseData & phase = phaseData[phaseIdx];
int mode = phase.trimMode[trimIdx];
int p = phase.trimRef[trimIdx];