From afe406ec2dfe1a7109aecb3f025c1e8fc95314cd Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 20 Dec 2020 16:35:44 +0000 Subject: [PATCH 01/52] Reduce trim timer delay on simulator --- radio/src/targets/simu/opentxsimulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/simu/opentxsimulator.cpp b/radio/src/targets/simu/opentxsimulator.cpp index f7e4f80e9..180709484 100644 --- a/radio/src/targets/simu/opentxsimulator.cpp +++ b/radio/src/targets/simu/opentxsimulator.cpp @@ -222,7 +222,7 @@ void OpenTxSimulator::setTrim(unsigned int idx, int value) emit outputValueChange(OUTPUT_SRC_TRIM_VALUE, idx, 0); timer->deleteLater(); }); - timer->start(350); + timer->start(50); } } From 5321a8afe9f7e59a2138de0aac281de224154d5a Mon Sep 17 00:00:00 2001 From: elecpower Date: Thu, 14 Jan 2021 17:33:26 +1100 Subject: [PATCH 02/52] Refactor sensor printing --- companion/src/firmwares/rawsource.cpp | 2 +- companion/src/firmwares/sensordata.cpp | 306 ++++++++++++++++--------- companion/src/firmwares/sensordata.h | 5 +- companion/src/modelprinter.cpp | 163 ------------- companion/src/modelprinter.h | 7 - companion/src/multimodelprinter.cpp | 14 +- 6 files changed, 210 insertions(+), 287 deletions(-) diff --git a/companion/src/firmwares/rawsource.cpp b/companion/src/firmwares/rawsource.cpp index 67ad743b6..898c0ca4a 100644 --- a/companion/src/firmwares/rawsource.cpp +++ b/companion/src/firmwares/rawsource.cpp @@ -60,7 +60,7 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting result.min = -30000 * result.step; result.max = +30000 * result.step; result.decimals = sensor.prec; - result.unit = sensor.unitString(); + result.unit = SensorData::unitToString(qr.quot); break; } diff --git a/companion/src/firmwares/sensordata.cpp b/companion/src/firmwares/sensordata.cpp index 753d2eed0..152e51a81 100644 --- a/companion/src/firmwares/sensordata.cpp +++ b/companion/src/firmwares/sensordata.cpp @@ -33,10 +33,206 @@ void SensorData::updateUnit() } } -// TODO depreciated -QString SensorData::unitString() const +QString SensorData::nameToString(int index) const { - return unitToString(unit); + return RadioData::getElementName(tr("TELE"), index + 1, label); +} + +QString SensorData::getOrigin(const ModelData * model) const +{ + if (type != TELEM_TYPE_CUSTOM || !id) + return QString(); + + const ModuleData & module = model->moduleData[moduleIdx]; + if (module.isPxx2Module() && rxIdx <= 2 && module.access.receivers & (1 << rxIdx)) { + return QString(module.access.receiverName[rxIdx]); + } + else { + return QString(); + } +} + +bool SensorData::isEmpty() const +{ + return (!isAvailable() && type == 0 && id == 0 && subid == 0 && instance == 0 && rxIdx == 0 && moduleIdx == 0 && unit == 0 && ratio == 0 && prec == 0 && offset == 0 && autoOffset == 0 && filter == 0 && onlyPositive == 0 && logs == 0); +} + +constexpr int SENSOR_ISCONFIGURABLE { 1 << 1 }; +constexpr int SENSOR_PRINT_GPS { 1 << 2 }; +constexpr int SENSOR_PRINT_CELLS { 1 << 3 }; +constexpr int SENSOR_PRINT_CONSUMPTION { 1 << 4 }; +constexpr int SENSOR_PRINT_RATIO { 1 << 5 }; +constexpr int SENSOR_PRINT_TOTALIZE { 1 << 6 }; +constexpr int SENSOR_PRINT_SOURCES_12 { 1 << 7 }; +constexpr int SENSOR_PRINT_SOURCES_34 { 1 << 8 }; +constexpr char FMT_LABEL[] { "%1: " }; +constexpr char FMT_VALUE[] { "%1 " }; +constexpr char FMT_LABEL_VALUE[] { "%1: %2 " }; + +QString SensorData::paramsToString(const ModelData * model) const +{ + if (!isAvailable()) + return ""; + + QString str; + int mask = 0; + + if (type == TELEM_TYPE_CALCULATED) { + if (formula < TELEM_FORMULA_CELL) + mask |= SENSOR_ISCONFIGURABLE; + if (formula == TELEM_FORMULA_DIST) + mask |= SENSOR_PRINT_GPS; + if (formula == TELEM_FORMULA_CELL) + mask |= SENSOR_PRINT_CELLS; + if (formula == TELEM_FORMULA_CONSUMPTION) + mask |= SENSOR_PRINT_CONSUMPTION; + if (formula <= TELEM_FORMULA_MULTIPLY) + mask |= SENSOR_PRINT_SOURCES_12; + if (formula < TELEM_FORMULA_MULTIPLY) + mask |= SENSOR_PRINT_SOURCES_34; + if (formula == TELEM_FORMULA_TOTALIZE) + mask |= SENSOR_PRINT_TOTALIZE; + + str.append(QString(FMT_LABEL_VALUE).arg(tr("Formula")).arg(formulaToString(formula))); + } + else { + if (unit < UNIT_FIRST_VIRTUAL) + mask |= (SENSOR_ISCONFIGURABLE | SENSOR_PRINT_RATIO); + + str.append(QString(FMT_LABEL_VALUE).arg(tr("Id")).arg(QString::number(id, 16).toUpper())); + str.append(QString(FMT_LABEL_VALUE).arg(tr("Instance")).arg(instance)); + } + + if (mask & SENSOR_PRINT_CELLS) { + str.append(QString(FMT_LABEL_VALUE).arg(tr("Sensor")).arg(sourceToString(model, source))); + str.append(QString(FMT_VALUE).arg(cellIndexToString(index))); + } + + if (mask & SENSOR_PRINT_SOURCES_12) { + str.append(QString(FMT_LABEL).arg(tr("Sources"))); + for (int i = 0; i < 4; i++) { + if (i < 2 || mask & SENSOR_PRINT_SOURCES_34) { + str.append(QString(FMT_VALUE).arg(sourceToString(model, sources[i]))); + } + } + } + + if (mask & SENSOR_PRINT_CONSUMPTION || mask & SENSOR_PRINT_TOTALIZE) + str.append(QString(FMT_LABEL_VALUE).arg(tr("Sensor")).arg(sourceToString(model, amps))); + + if (mask & SENSOR_PRINT_GPS) { + str.append(QString(FMT_LABEL_VALUE).arg(tr("GPS")).arg(sourceToString(model, gps))); + str.append(QString(FMT_LABEL_VALUE).arg(tr("Alt")).arg(sourceToString(model, alt))); + } + + str.append(QString(FMT_LABEL_VALUE).arg(tr("Unit")).arg(unitToString(unit))); + + if (mask & SENSOR_ISCONFIGURABLE && unit != UNIT_FAHRENHEIT) + str.append(QString(FMT_LABEL_VALUE).arg(tr("Precision")).arg(precToString(prec))); + + if (mask & SENSOR_PRINT_RATIO) { + if (unit != UNIT_RPMS) { + int precsn = prec == 0 ? 1 : pow(10, prec); + str.append(QString(FMT_LABEL_VALUE).arg(tr("Ratio")).arg((float)ratio / 10)); + str.append(QString(FMT_LABEL_VALUE).arg(tr("Offset")).arg(QString::number((float)offset / precsn, 'f', prec))); + str.append(QString(FMT_LABEL_VALUE).arg(tr("Auto Offset")).arg(boolToString(autoOffset))); + } + else { + str.append(QString(FMT_LABEL_VALUE).arg(tr("Blades")).arg(ratio)); // TODO refactor to dedicated RPMS field + str.append(QString(FMT_LABEL_VALUE).arg(tr("Multi")).arg(offset)); // TODO refactor to dedicated RPMS field + } + } + + if (mask & SENSOR_ISCONFIGURABLE) + str.append(QString(FMT_LABEL_VALUE).arg(tr("Filter")).arg(boolToString(filter))); + + if (type == TELEM_TYPE_CALCULATED) + str.append(QString(FMT_LABEL_VALUE).arg(tr("Persist")).arg(boolToString(persistent))); + + str.append(QString(FMT_LABEL_VALUE).arg(tr("Positive")).arg(boolToString(onlyPositive))); + str.append(QString(FMT_LABEL_VALUE).arg(tr("Log")).arg(boolToString(logs))); + + return str; +} + +// static +QString SensorData::typeToString(const int value) +{ + switch(value) { + case TELEM_TYPE_CUSTOM: + return tr("Custom"); + case TELEM_TYPE_CALCULATED: + return tr("Calculated"); + default: + return CPN_STR_UNKNOWN_ITEM; + } +} + +// static +QString SensorData::formulaToString(const int value) +{ + switch(value) { + case TELEM_FORMULA_ADD: + return tr("Add"); + case TELEM_FORMULA_AVERAGE: + return tr("Average"); + case TELEM_FORMULA_MIN: + return tr("Minimum"); + case TELEM_FORMULA_MAX: + return tr("Maximum"); + case TELEM_FORMULA_MULTIPLY: + return tr("Multiply"); + case TELEM_FORMULA_TOTALIZE: + return tr("Totalize"); + case TELEM_FORMULA_CELL: + return tr("Cell"); + case TELEM_FORMULA_CONSUMPTION: + return tr("Consumption"); + case TELEM_FORMULA_DIST: + return tr("Distance"); + default: + return CPN_STR_UNKNOWN_ITEM; + } +} + +// static +QString SensorData::cellIndexToString(const int value) +{ + if (value == TELEM_CELL_INDEX_LOWEST) + return tr("Lowest"); + if (value > TELEM_CELL_INDEX_LOWEST && value < TELEM_CELL_INDEX_HIGHEST) + return tr("Cell %1").arg(value - TELEM_CELL_INDEX_LOWEST); + if (value== TELEM_CELL_INDEX_HIGHEST) + return tr("Highest"); + if (value == TELEM_CELL_INDEX_DELTA) + return tr("Delta"); + return CPN_STR_UNKNOWN_ITEM; +} + +// static +QString SensorData::precToString(const int value) +{ + return QString("0.%1").arg(QString(value, '0')); +} + +// static +QString SensorData::sourceToString(const ModelData * model, const int index, const bool sign) +{ + if (model) { + const QString prfx = sign ? index < 0 ? "-" : "+" : ""; + + if (abs(index) > 0) { + const SensorData &sd = model->sensorData[abs(index) - 1]; + if (sd.type == SensorData::TELEM_TYPE_CUSTOM) + return QString("%1%2 (%3)").arg(prfx).arg(sd.label).arg(sd.getOrigin(model)); + else + return QString("%1%2").arg(prfx).arg(sd.label); + } + else + return CPN_STR_NONE_ITEM; + } + + return ""; } // static @@ -106,110 +302,6 @@ QString SensorData::unitToString(const int value) } } -QString SensorData::nameToString(int index) const -{ - return RadioData::getElementName(tr("TELE"), index + 1, label); -} - -QString SensorData::getOrigin(const ModelData * model) const -{ - if (type != TELEM_TYPE_CUSTOM || !id) - return QString(); - - const ModuleData & module = model->moduleData[moduleIdx]; - if (module.isPxx2Module() && rxIdx <= 2 && module.access.receivers & (1 << rxIdx)) { - return QString(module.access.receiverName[rxIdx]); - } - else { - return QString(); - } -} - -bool SensorData::isEmpty() const -{ - return (!isAvailable() && type == 0 && id == 0 && subid == 0 && instance == 0 && rxIdx == 0 && moduleIdx == 0 && unit == 0 && ratio == 0 && prec == 0 && offset == 0 && autoOffset == 0 && filter == 0 && onlyPositive == 0 && logs == 0); -} - -// static -QString SensorData::typeToString(const int value) -{ - switch(value) { - case TELEM_TYPE_CUSTOM: - return tr("Custom"); - case TELEM_TYPE_CALCULATED: - return tr("Calculated"); - default: - return CPN_STR_UNKNOWN_ITEM; - } -} - -// static -QString SensorData::formulaToString(const int value) -{ - switch(value) { - case TELEM_FORMULA_ADD: - return tr("Add"); - case TELEM_FORMULA_AVERAGE: - return tr("Average"); - case TELEM_FORMULA_MIN: - return tr("Minimum"); - case TELEM_FORMULA_MAX: - return tr("Maximum"); - case TELEM_FORMULA_MULTIPLY: - return tr("Multiply"); - case TELEM_FORMULA_TOTALIZE: - return tr("Totalize"); - case TELEM_FORMULA_CELL: - return tr("Cell"); - case TELEM_FORMULA_CONSUMPTION: - return tr("Consumption"); - case TELEM_FORMULA_DIST: - return tr("Distance"); - default: - return CPN_STR_UNKNOWN_ITEM; - } -} - -// static -QString SensorData::cellIndexToString(const int value) -{ - if (value == TELEM_CELL_INDEX_LOWEST) - return tr("Lowest"); - if (value > TELEM_CELL_INDEX_LOWEST && value < TELEM_CELL_INDEX_HIGHEST) - return tr("Cell %1").arg(value - TELEM_CELL_INDEX_LOWEST); - if (value== TELEM_CELL_INDEX_HIGHEST) - return tr("Highest"); - if (value == TELEM_CELL_INDEX_DELTA) - return tr("Delta"); - return CPN_STR_UNKNOWN_ITEM; -} - -// static -QString SensorData::precisionToString(const int value) -{ - return QString("0.%1").arg(QString(value, '0')); -} - -// static -QString SensorData::sourceToString(const ModelData * model, const int index, const bool sign) -{ - if (model) { - const QString prfx = sign ? index < 0 ? "-" : "+" : ""; - - if (abs(index) > 0) { - const SensorData &sd = model->sensorData[abs(index) - 1]; - if (sd.type == SensorData::TELEM_TYPE_CUSTOM) - return QString("%1%2 (%3)").arg(prfx).arg(sd.label).arg(sd.getOrigin(model)); - else - return QString("%1%2").arg(prfx).arg(sd.label); - } - else - return CPN_STR_NONE_ITEM; - } - - return ""; -} - // static bool SensorData::isSourceAvailable(const ModelData * model, const int index) { diff --git a/companion/src/firmwares/sensordata.h b/companion/src/firmwares/sensordata.h index afd9d7891..23d8a7fcc 100644 --- a/companion/src/firmwares/sensordata.h +++ b/companion/src/firmwares/sensordata.h @@ -167,11 +167,11 @@ class SensorData { bool isAvailable() const { return strlen(label) > 0; } void updateUnit(); - QString unitString() const; QString nameToString(int index) const; QString getOrigin(const ModelData* model) const; void clear() { memset(this, 0, sizeof(SensorData)); } bool isEmpty() const; + QString paramsToString(const ModelData * model) const; static QString sourceToString(const ModelData * model, const int index, const bool sign = false); static bool isSourceAvailable(const ModelData * model, const int index); @@ -179,7 +179,8 @@ class SensorData { static QString formulaToString(const int value); static QString cellIndexToString(const int value); static QString unitToString(const int value); - static QString precisionToString(const int value); + static QString precToString(const int value); + static QString boolToString(const bool value) { return value ? tr("Y") : tr("N"); } static AbstractStaticItemModel * typeItemModel(); static AbstractStaticItemModel * formulaItemModel(); diff --git a/companion/src/modelprinter.cpp b/companion/src/modelprinter.cpp index 61bfedda9..282f53550 100644 --- a/companion/src/modelprinter.cpp +++ b/companion/src/modelprinter.cpp @@ -1071,17 +1071,6 @@ QString ModelPrinter::printRssiAlarmsDisabled(bool mb) return printBoolean(!mb, BOOLEAN_ENABLEDISABLE); } -QString ModelPrinter::printTelemetrySource(int val) -{ - QStringList strings = QStringList() << tr("None"); - - for (unsigned i=1; i<=CPN_MAX_SENSORS; ++i) { - strings << QString("%1").arg(model.sensorData[i-1].label); - } - - return QString("%1%2").arg((val < 0 ? "-" : "")).arg(strings.value(abs(val))); -} - QString ModelPrinter::printVarioSource(unsigned int val) { switch (val) { @@ -1155,144 +1144,6 @@ QString ModelPrinter::printIgnoreSensorIds(bool mb) return printBoolean(mb, BOOLEAN_ENABLEDISABLE); } -QString ModelPrinter::printSensorType(unsigned int val) -{ - switch (val) { - case SensorData::TELEM_TYPE_CUSTOM: - return tr("Custom"); - case SensorData::TELEM_TYPE_CALCULATED: - return tr("Calculated"); - default: - return CPN_STR_UNKNOWN_ITEM; - } -} - -QString ModelPrinter::printSensorFormula(unsigned int val) -{ - switch (val) { - case SensorData::TELEM_FORMULA_ADD: - return tr("Add"); - case SensorData::TELEM_FORMULA_AVERAGE: - return tr("Average"); - case SensorData::TELEM_FORMULA_MIN: - return tr("Min"); - case SensorData::TELEM_FORMULA_MAX: - return tr("Max"); - case SensorData::TELEM_FORMULA_MULTIPLY: - return tr("Multiply"); - case SensorData::TELEM_FORMULA_TOTALIZE: - return tr("Totalise"); - case SensorData::TELEM_FORMULA_CELL: - return tr("Cell"); - case SensorData::TELEM_FORMULA_CONSUMPTION: - return tr("Consumption"); - case SensorData::TELEM_FORMULA_DIST: - return tr("Distance"); - default: - return CPN_STR_UNKNOWN_ITEM; - } -} - -QString ModelPrinter::printSensorCells(unsigned int val) -{ - QStringList strings; - - strings << tr("Lowest"); - for (int i=1; i<=6; i++) - strings << tr("Cell %1").arg(i); - strings << tr("Highest") << tr("Delta"); - - return strings.value(val); -} - -QString ModelPrinter::printSensorTypeCond(unsigned int idx) -{ - if (!model.sensorData[idx].isAvailable()) - return ""; - else - return printSensorType(model.sensorData[idx].type); -} - -QString ModelPrinter::printSensorParams(unsigned int idx) -{ - QString str = ""; - SensorData sensor = model.sensorData[idx]; - - if (!sensor.isAvailable()) - return str; - - bool isConfigurable = false; - bool gpsFieldsPrinted = false; - bool cellsFieldsPrinted = false; - bool consFieldsPrinted = false; - bool ratioFieldsPrinted = false; - bool totalizeFieldsPrinted = false; - bool sources12FieldsPrinted = false; - bool sources34FieldsPrinted = false; - - if (sensor.type == SensorData::TELEM_TYPE_CALCULATED) { - isConfigurable = (sensor.formula < SensorData::TELEM_FORMULA_CELL); - gpsFieldsPrinted = (sensor.formula == SensorData::TELEM_FORMULA_DIST); - cellsFieldsPrinted = (sensor.formula == SensorData::TELEM_FORMULA_CELL); - consFieldsPrinted = (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION); - sources12FieldsPrinted = (sensor.formula <= SensorData::TELEM_FORMULA_MULTIPLY); - sources34FieldsPrinted = (sensor.formula < SensorData::TELEM_FORMULA_MULTIPLY); - totalizeFieldsPrinted = (sensor.formula == SensorData::TELEM_FORMULA_TOTALIZE); - - str.append(printLabelValue(tr("F"), printSensorFormula(sensor.formula))); - } - else { - isConfigurable = sensor.unit < SensorData::UNIT_FIRST_VIRTUAL; - ratioFieldsPrinted = (sensor.unit < SensorData::UNIT_FIRST_VIRTUAL); - - str.append(printLabelValue(tr("Id"), QString::number(sensor.id,16).toUpper())); - str.append(printLabelValue(tr("Inst"), QString::number(sensor.instance))); - } - if (cellsFieldsPrinted) { - str.append(printLabelValue(tr("Sensor"), QString("%1 %2").arg(printTelemetrySource(sensor.source), false).arg(printSensorCells(sensor.index)))); - } - if (sources12FieldsPrinted) { - QStringList srcs; - for (int i=0;i<4;i++) { - if (i < 2 || sources34FieldsPrinted) { - srcs << printTelemetrySource(sensor.sources[i]); - } - } - str.append(printLabelValues(tr("Sources"), srcs)); - } - if (consFieldsPrinted || totalizeFieldsPrinted) - str.append(printLabelValue(tr("Sensor"), printTelemetrySource(sensor.amps))); - if (gpsFieldsPrinted) { - str.append(printLabelValue(tr("GPS"), printTelemetrySource(sensor.gps))); - str.append(printLabelValue(tr("Alt"), printTelemetrySource(sensor.alt))); - } - QString u = sensor.unitString(); - u = u.trimmed() == "" ? "-" : u; - str.append(printLabelValue(tr("Unit"), u)); - if (isConfigurable && sensor.unit != SensorData::UNIT_FAHRENHEIT) - str.append(printLabelValue(tr("Prec"), printTelemetryPrecision(sensor.prec))); - if (ratioFieldsPrinted) { - if (sensor.unit != SensorData::UNIT_RPMS) { - int prec = sensor.prec == 0 ? 1 : pow(10, sensor.prec); - str.append(printLabelValue(tr("Ratio"), QString::number((float)sensor.ratio / 10))); - str.append(printLabelValue(tr("Offset"), QString::number((float)sensor.offset / prec, 'f', sensor.prec))); - } - else if (sensor.unit == SensorData::UNIT_RPMS) { - str.append(printLabelValue(tr("Blades"), QString::number(sensor.ratio))); - str.append(printLabelValue(tr("Multi"), QString::number(sensor.offset))); - } - } - if (sensor.unit != SensorData::UNIT_RPMS && isConfigurable) - str.append(printLabelValue(tr("Auto Offset"), printBoolean(sensor.autoOffset, BOOLEAN_YN))); - if (isConfigurable) - str.append(printLabelValue(tr("Filter"), printBoolean(sensor.filter, BOOLEAN_YN))); - if (sensor.type == SensorData::TELEM_TYPE_CALCULATED) - str.append(printLabelValue(tr("Persist"), printBoolean(sensor.persistent, BOOLEAN_YN))); - str.append(printLabelValue(tr("Positive"), printBoolean(sensor.onlyPositive, BOOLEAN_YN))); - str.append(printLabelValue(tr("Log"), printBoolean(sensor.logs, BOOLEAN_YN), false)); - return str; -} - QString ModelPrinter::printTelemetryScreenType(unsigned int val) { switch (val) { @@ -1373,17 +1224,3 @@ QString ModelPrinter::printChecklist() } return str; } - -QString ModelPrinter::printTelemetryPrecision(unsigned int val) -{ - switch (val) { - case 0: - return tr("0."); - case 1: - return tr("0.0"); - case 2: - return tr("0.00"); - default: - return CPN_STR_UNKNOWN_ITEM; - } -} diff --git a/companion/src/modelprinter.h b/companion/src/modelprinter.h index 2cce3585d..639eddb0e 100644 --- a/companion/src/modelprinter.h +++ b/companion/src/modelprinter.h @@ -116,22 +116,15 @@ class ModelPrinter: public QObject QString printLabelValue(const QString & lbl, const QString & val, const bool sep = false); QString printLabelValues(const QString & lbl, const QStringList & vals, const bool sep = false); QString printRssiAlarmsDisabled(bool mb); - QString printTelemetrySource(int val); QString printVarioSource(unsigned int val); QString printVarioCenterSilent(bool mb); QString printVoltsSource(unsigned int val); QString printCurrentSource(unsigned int val); QString printMahPersistent(bool mb); QString printIgnoreSensorIds(bool mb); - QString printSensorType(unsigned int val); - QString printSensorFormula(unsigned int val); - QString printSensorCells(unsigned int val); - QString printSensorTypeCond(unsigned int idx); - QString printSensorParams(unsigned int idx); QString printTelemetryScreenType(unsigned int val); QString printTelemetryScreen(unsigned int idx, unsigned int line, unsigned int width); QString printChecklist(); - QString printTelemetryPrecision(unsigned int val); private: Firmware * firmware; diff --git a/companion/src/multimodelprinter.cpp b/companion/src/multimodelprinter.cpp index 4da889cb1..9686dd944 100644 --- a/companion/src/multimodelprinter.cpp +++ b/companion/src/multimodelprinter.cpp @@ -777,7 +777,7 @@ QString MultiModelPrinter::printTelemetry() if (firmware->getCapability(HasVario)) { columns.appendRowStart(tr("Altimetry"), 20); if (IS_HORUS_OR_TARANIS(firmware->getBoard())) { - LABELCOMPARECELL(tr("Vario source"), modelPrinter->printTelemetrySource(model->frsky.varioSource), 80); + LABELCOMPARECELL(tr("Vario source"), SensorData::sourceToString(model, model->frsky.varioSource), 80); } else { LABELCOMPARECELL(tr("Vario source"), modelPrinter->printVarioSource(model->frsky.varioSource), 80); @@ -801,8 +801,8 @@ QString MultiModelPrinter::printTelemetry() if (IS_HORUS_OR_TARANIS(firmware->getBoard())) { columns.appendRowStart(tr("Top Bar"), 20); columns.appendCellStart(80); - COMPARESTRING(tr("Volts source"), modelPrinter->printTelemetrySource(model->frsky.voltsSource), true); - COMPARESTRING(tr("Altitude source"), modelPrinter->printTelemetrySource(model->frsky.altitudeSource), false); + COMPARESTRING(tr("Volts source"), SensorData::sourceToString(model, model->frsky.voltsSource), true); + COMPARESTRING(tr("Altitude source"), SensorData::sourceToString(model, model->frsky.altitudeSource), false); columns.appendCellEnd(); columns.appendRowEnd(); } @@ -822,9 +822,9 @@ QString MultiModelPrinter::printSensors() int count = 0; columns.appendSectionTableStart(); columns.appendRowHeader(QStringList() << tr("Name") << tr("Type") << tr("Parameters")); - for (unsigned i=0; isensorData[i].isAvailable()) { tsEmpty = false; break; @@ -836,8 +836,8 @@ QString MultiModelPrinter::printSensors() columns.appendCellStart(20, true); COMPARE(model->sensorData[i].nameToString(i)); columns.appendCellEnd(true); - COMPARECELLWIDTH(modelPrinter->printSensorTypeCond(i), 15); - COMPARECELLWIDTH(modelPrinter->printSensorParams(i), 65); + COMPARECELLWIDTH(model->sensorData[i].isAvailable() ? SensorData::typeToString(model->sensorData[i].type) : "", 15); + COMPARECELLWIDTH(model->sensorData[i].paramsToString(model), 65); columns.appendRowEnd(); } } From ef1fea95f2bfd7d6709c2643df39e17deb83e195 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 21 Jan 2021 09:24:12 +0100 Subject: [PATCH 03/52] Remove retry timer for set trim --- radio/src/targets/simu/opentxsimulator.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/radio/src/targets/simu/opentxsimulator.cpp b/radio/src/targets/simu/opentxsimulator.cpp index 180709484..df763c8fa 100644 --- a/radio/src/targets/simu/opentxsimulator.cpp +++ b/radio/src/targets/simu/opentxsimulator.cpp @@ -213,17 +213,7 @@ void OpenTxSimulator::setTrim(unsigned int idx, int value) if (i < 4) // swap axes i = modn12x3[4 * getStickMode() + idx]; uint8_t phase = getTrimFlightMode(getFlightMode(), i); - - if (!setTrimValue(phase, i, value)) { - QTimer *timer = new QTimer(this); - timer->setSingleShot(true); - connect(timer, &QTimer::timeout, [=]() { - emit trimValueChange(idx, 0); - emit outputValueChange(OUTPUT_SRC_TRIM_VALUE, idx, 0); - timer->deleteLater(); - }); - timer->start(50); - } + setTrimValue(phase, i, value); } void OpenTxSimulator::setTrainerInput(unsigned int inputNumber, int16_t value) From 514d7cd9d2d4103b6442f2c5d9f9821a6e100060 Mon Sep 17 00:00:00 2001 From: olliw42 Date: Tue, 26 Jan 2021 07:59:56 +0100 Subject: [PATCH 04/52] TaskIndex enum is not used, and had a superfluous bluetooth entry also --- radio/src/tasks.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/radio/src/tasks.cpp b/radio/src/tasks.cpp index 16e120784..fc2df74c7 100644 --- a/radio/src/tasks.cpp +++ b/radio/src/tasks.cpp @@ -32,16 +32,6 @@ RTOS_DEFINE_STACK(audioStack, AUDIO_STACK_SIZE); RTOS_MUTEX_HANDLE audioMutex; RTOS_MUTEX_HANDLE mixerMutex; -enum TaskIndex { - MENU_TASK_INDEX, - MIXER_TASK_INDEX, - AUDIO_TASK_INDEX, - CLI_TASK_INDEX, - BLUETOOTH_TASK_INDEX, - TASK_INDEX_COUNT, - MAIN_TASK_INDEX = 255 -}; - void stackPaint() { menusStack.paint(); From f573c4886257d9a0d827d8dc970ef3309cacc05d Mon Sep 17 00:00:00 2001 From: LapinFou Date: Tue, 26 Jan 2021 12:05:23 +0100 Subject: [PATCH 05/52] Initial version. --- companion/src/translations/companion_fr.ts | 990 +++++++++++---------- 1 file changed, 508 insertions(+), 482 deletions(-) diff --git a/companion/src/translations/companion_fr.ts b/companion/src/translations/companion_fr.ts index 593231b91..d052a6e2c 100644 --- a/companion/src/translations/companion_fr.ts +++ b/companion/src/translations/companion_fr.ts @@ -743,58 +743,58 @@ Manche Droit: Profondeur, Direction Boards - + Left Horizontal Gauche Horizontal - + Left Vertical Gauche Vertical - + Right Vertical Droit Vertical - + Right Horizontal Droit Horizontal - + Aux. 1 - + Aux. 2 - - + + Unknown Inconnu - + Rud Dir - + Ele Prf - + Thr Gaz - + Ail @@ -843,62 +843,62 @@ Manche Droit: Profondeur, Direction ChannelsPanel - + Name Nom - + Subtrim Subtrim - + Min - + Max - + Direction - + Curve Courbe - + PPM Center Neutre PPM - + Linear Subtrim Subtrim linéaire - + CH%1 VOIE%1 - + Popup menu available Menu contextuel disponible - + --- - + INV @@ -1386,6 +1386,29 @@ Si vous avez un fichier de sauvegarde des paramètres, vous pouvez l'import CB + + CurveReference + + + Diff + + + + + Expo + + + + + Func + + + + + Curve + Courbe + + Curves @@ -1478,112 +1501,112 @@ Si vous avez un fichier de sauvegarde des paramètres, vous pouvez l'import CurvesPanel - + Curve %1 Courbe %1 - + Popup menu available Menu contextuel disponible - + %1 points - + Linear Linéaire - + Single Expo Expo simple - + Symmetrical f(x)=-f(-x) Symétrique f(x)=-f(-x) - + Symmetrical f(x)=f(-x) Symétrique f(x)=f(-x) - + Editing curve %1 Édition de la courbe %1 - + Not enough free points in EEPROM to store the curve. Pas assez de points disponibles en mémoire pour enregistrer la courbe. - + Copy Copier - + Cut Couper - + Paste Coller - + Clear Effacer - + Insert Insérer - + Delete Supprimer - + Move Up Monter - + Move Down Descendre - + Clear All Effacer Tout - + Clear Curve. Are you sure? Effacer la Courbe. Êtes-vous sûr? - + Clear all Curves. Are you sure? Effacer toutes les Courbes. Êtes-vous sûr? - + Cut Curve. Are you sure? Couper la Courbe. Êtes-vous sûr? - + Delete Curve. Are you sure? Supprimer la Courbe. Êtes-vous sûr? @@ -1657,8 +1680,8 @@ Si vous avez un fichier de sauvegarde des paramètres, vous pouvez l'import - Set Timer %1 - Définir chrono %1 + Set %1 + @@ -1746,79 +1769,64 @@ Si vous avez un fichier de sauvegarde des paramètres, vous pouvez l'import Bind module externe - - Timer1 - Chrono 1 - - - - Timer2 - Chrono 2 - - - - Timer3 - Chrono 3 - - - + Flight Vol - + Telemetry Télémétrie - + Rotary Encoder Sélecteur Rotatif - + REa - + REb - + s - - + + <font color=red><b>Inconsistent parameter</b></font> <font color=red><b>Paramètre inconsistant</b></font> - + Value Valeur - + played once, not during startup !1x Lu une fois, mais pas à la mise en route - + repeat(%1s) Répéter chaque %1s - + DISABLED DESACTIVE - + CFN FPN @@ -1826,139 +1834,139 @@ Si vous avez un fichier de sauvegarde des paramètres, vous pouvez l'import CustomFunctionsPanel - + Switch Interrupteur - + Action - + Parameters Paramètres - + Enable Actif - + Popup menu available Menu contextuel disponible - + SF%1 FS%1 - + GF%1 FG%1 - + ON - + Error occurred while trying to play sound, possibly the file is already opened. (Err: %1 [%2]) Une erreur s'est produite lors de la lecture du son, le fichier est peut-être déjà ouvert. (Err: %1 [%2]) - + Unable to find or open sound file: %1 Impossible de trouver ou d'ouvrir le fichier son: %1 - + Delete Function. Are you sure? Supprimer la Fonction. Êtes-vous sûr? - + Cut Special Function. Are you sure? Couper la Fonction. Êtes-vous sûr? - + Copy Copier - + Cut Couper - + Paste Coller - + Clear Effacer - + Insert Insérer - + Delete Supprimer - + Move Up Monter - + Move Down Descendre - + Clear All Effacer Tout - + Value Valeur - + Source Source - + GVAR VG - + Increment Incrément - + Clear Function. Are you sure? Effacer la Fonction. Êtes-vous sûr? - + Clear all Functions. Are you sure? Effacer toutes les Fonctions. Êtes-vous sûr? @@ -2126,48 +2134,48 @@ Si vous avez un fichier de sauvegarde des paramètres, vous pouvez l'import Erreur de conversion du champ %1 - + Switch Interrupteur - + Switch L'interrupteur - + cannot be exported on this board! n'est pas supporté sur cette carte ! - + Source - + Source %1 cannot be exported on this board! La source %1 n'est pas supportée sur cette plateforme ! - + OpenTX only accepts %1 points in all curves OpenTX n'accepte que %1 points au maximum entre toutes les courbes - + OpenTx only accepts %1 points in all curves OpenTX n'accepte que %1 points au maximum entre toutes les courbes - - + + OpenTX on this board doesn't accept this function OpenTX ne supporte pas cette fonction sur cette carte - + OpenTX doesn't accept this radio protocol OpenTX ne supporte pas ce protocole radio @@ -2500,27 +2508,27 @@ Si vide, la ligne est toujours active. Les 2 - + Edit %1 Éditer %1 - + Popup menu available Menu contextuel disponible - + Clear All Effacer Tout - + Set All Définir Tout - + Invert All Inverser Tout @@ -2889,272 +2897,293 @@ Blanc signifie "inclure tous".Les métacaractères ?, * et [...] sont Firmware - + Channel values displayed in us Positions de voies affichées en µs - + No OverrideCH functions available Désactive la fonction spéciale "Remplacer VOIExx" - + Possibility to enable FAI MODE (no telemetry) at field Possibilité d'activer le mode FAI (télémétrie désactivée) sur le terrain - + FAI MODE (no telemetry) always enabled Mode FAI (télémétrie toujours désactivée) - + Removes D8 FrSky protocol support which is not legal for use in the EU on radios sold after Jan 1st, 2015 Masque le protocole D8. Légalement obligatoire sur les radios Européennes importées après le 1er janvier 2015 - - - + + + + + Disable HELI menu and cyclic mix support Supprimer le menu HELICO et les mixages cycliques - - - + + + + + Disable Global variables Supprimer le support des variables globales - - - + + + + + Enable Lua custom scripts screen Activer l'écran des scripts Lua personnalisés - + Use alternative SQT5 font Utiliser la police alternative SQT5 - - + + Disable RAS (SWR) Désactiver le RAS (SWR). Utile uniquement pour les X9D+ avec un RAS/SWR non fonctionnel - + Pots use in menus navigation Support de la navigation dans les menus avec les POTS - + Enable AFHDS3 support Activer le support du AFHDS3 - + FrSky Taranis X9D+ - + FrSky Taranis X9D+ 2019 - + FrSky Taranis X9D - + Haptic module installed Module vibreur installé - + FrSky Taranis X9E - + Confirmation before radio shutdown Confirmation avant l'arrêt de la radio - + Horus gimbals installed (Hall sensors) Manches Horus à effet HALL installés - + FrSky Taranis X9-Lite - + FrSky Taranis X9-Lite S - + FrSky Taranis X7 / X7S - + FrSky Taranis X7 / X7S Access - + FrSky Taranis X-Lite S/PRO - + FrSky Taranis X-Lite - + FrSky Horus X10 / X10S - - + + Support for ACCESS internal module replacement Prise en charge du module de remplacement interne ACCESS - - - - - + + + + + Support hardware mod: R9M ACCESS Prise en charge du mod hardware: R9M ACCESS - + FrSky Horus X10 Express / X10S Express - + FrSky Horus X12S - + Use ONLY with first DEV pcb version Exclusivement pour les Horus DEV - - + + Support for MULTI internal module Prise en charge du module MULTI interne - - - + + Jumper T-Lite + + + + + + Support for bluetooth module Prise en charge du module Bluetooth - + + Radiomaster T8 + + + + + Allow bind using bind key + + + + Support internal GPS Prise en charge du GPS interne - + Jumper T18 - + Turnigy 9XR-PRO - + Enable HELI menu and cyclic mix support Activer le menu hélico et les mixages CCPM - + Global variables Variables globales - + Enable non certified firmwares Activer les firmwares non certifiés - + In model setup menus automatically set source by moving the control Sélectionner les sources des mixeurs en bougeant le contrôle désiré - + In model setup menus automatically set switch by moving the control Sélectionner les interrupteurs en bougeant le contrôle désiré - + No graphical check boxes and sliders Pas de cases à cocher et de curseurs graphiques - + Battery graph Graphique de la batterie - + Don't use bold font for highlighting active items Ne pas mettre les lignes actives en gras - + Enable resetting values by pressing up and down at the same time Permet la remise à zéro des valeurs en pressant haut-bas en même temps, valeur min avec gauche/bas, valeur max avec haut/droite, inversion avec gauche/droite - + Radiomaster TX12 - + Radiomaster TX16S / SE / Hall / Masterfire - + 9X with AR9X board 9X avec carte AR9X - + Jumper T12 / T12 Pro - + Jumper T16 / T16+ / T16 Pro - + 9X with Sky9x board 9X avec carte Sky9x @@ -3864,17 +3893,17 @@ Vous utilisez actuellement: FlightModesPanel - + Flight Mode %1 Phase de vol %1 - + (%1) - + (default) (par défaut) @@ -4127,7 +4156,7 @@ p, li { white-space: pre-wrap; } GeneralEdit - + Setup Configuration @@ -4144,7 +4173,7 @@ These will be relevant for all models in the same EEPROM. Communs à tous les modèles d'une même EEPROM. - + Trainer Écolage @@ -4159,42 +4188,42 @@ Communs à tous les modèles d'une même EEPROM. Lire étalonnage et paramètres hw du profil - + Global Functions Fonctions globales - + Hardware Matériel - + Calibration - + Wrong data in profile, radio calibration was not retrieved Données du profil erronnées, l'étalonnage n'a pas été lu - + Wrong data in profile, Switch/pot config not retrieved Données incorecte, Interrupteurs/Pot non trouvés - + Wrong data in profile, hw related parameters were not retrieved Données du profil erronnées, les paramètres hw n'ont pas été lus - + Do you want to store calibration in %1 profile<br>overwriting existing calibration? Voulez-vous stocker l'étalonnage dans le profil %1<br> et écraser l'étalonnage existant ? - + Calibration and HW parameters saved. Etalonnage et paramètres hw enregistrés avec succès. @@ -4202,7 +4231,7 @@ Communs à tous les modèles d'une même EEPROM. GeneralSettings - + Radio Settings Paramètres de la radio @@ -5709,159 +5738,159 @@ Cette fonction ne peut pas être désactivée sur la radio. InputsPanel - + + - Move Up Monter - - + + Ctrl+Up Ctrl+Haut - + + - Move Down Descendre - - + + Ctrl+Down Ctrl+Bas - + Clear All Inputs Effacer toutes les entrées - + Not enough available Inputs! Pas assez d'Entrées disponibles! - + Delete selected Input lines. Are you sure? Supprimer les lignes Entrée sélectionnées. Êtes-vous sûr? - + Cut selected Input lines. Are you sure? Couper les lignes Entrée sélectionnées. Êtes-vous sûr? - + Lines Linéaire - + &Add &Ajouter - + Ctrl+A Ctrl+A - + &Edit &Édition - + Enter Entrée - + &Delete &Supprimer - - + + Delete Supprimer - + &Copy &Copier - + Ctrl+C - + &Cut &Couper - + Ctrl+X - + &Paste &Coller - + Ctrl+V - + Du&plicate Du&pliquer - + Ctrl+U - + Input Entrée - + Insert Insérer - + Clear Effacer - + Clear All Effacer Tout - + Clear all Input lines. Are you sure? Effacer toutes les lignes Entrée. Êtes-vous sûr? - + Clear all lines for the selected Inputs. Are you sure? Effacer toutes les lignes Entrée sélectionnées. Êtes-vous sûr? - + Delete all lines for the selected Inputs. Are you sure? Supprimer toutes les lignes Entrée sélectionnées. Êtes-vous sûr? @@ -6058,72 +6087,72 @@ Cette fonction ne peut pas être désactivée sur la radio. - + (infinite) (infini) - + Delete Logical Switch. Are you sure? Supprimer l'Interrupteur Logique. Êtes-vous sûr? - + Cut Logical Switch. Are you sure? Couper l'Interrupteur Logique. Êtes-vous sûr? - + Copy Copier - + Cut Couper - + Paste Coller - + Clear Effacer - + Insert Insérer - + Delete Supprimer - + Move Up Monter - + Move Down Descendre - + Clear All Effacer Tout - + Clear Logical Switch. Are you sure? Effacer l'Interrupteur Logique. Êtes-vous sûr? - + Clear all Logical Switches. Are you sure? Effacer tous les Interrupteurs Logiques. Êtes-vous sûr? @@ -7850,27 +7879,27 @@ Mixage actif par défaut si non-renseigné. Nom - + DEST -> %1 - + Click to access popup menu Cliquez pour accéder au menu contextuel - + Clear All Effacer Tout - + Set All Définir Tout - + Invert All Inverser Tout @@ -7916,136 +7945,136 @@ Mixage actif par défaut si non-renseigné. MixesPanel - - + + Move Up Monter - - + + Ctrl+Up Ctrl+Haut - - + + Move Down Descendre - - + + Ctrl+Down Ctrl+Bas - + Clear Mixes Effacer tous les mixages - + Not enough available mixers! Plus de mixages disponibles ! - + Delete selected Mix lines. Are you sure? Supprimer les lignes Mixeur sélectionnées. Êtes-vous sûr? - + Cut selected Mix lines. Are you sure? Couper les lignes Mixeur sélectionnées. Êtes-vous sûr? - + &Add &Ajouter - + Ctrl+A - + &Edit &Édition - + Enter Entrée - + Ctrl+T - + &Toggle highlight &(Dé)sélectionner - + &Delete &Supprimer - + Delete Supprimer - + &Copy &Copier - + Ctrl+C - + Ctrl+X - + C&ut &Couper - + &Paste &Coller - + Ctrl+V - + Du&plicate &Dupliquer - + Ctrl+U - + Clear Mixes? Effacer tous les mixages ? - + Really clear all the mixes? Êtes-vous sûr de vraiment vouloir effacer tous les mixages ? @@ -8062,6 +8091,11 @@ Mixage actif par défaut si non-renseigné. Throttle Source Source des gaz + + + THR + GAZ + ModelEdit @@ -8071,32 +8105,32 @@ Mixage actif par défaut si non-renseigné. Simulation - + Heli Paramètres hélico - + Inputs Entrées - + Mixes Mixages - + Logical Switches Inters logiques - + Setup Configuration - + Curves Courbes @@ -8106,22 +8140,22 @@ Mixage actif par défaut si non-renseigné. Dialogue - + Flight Modes Phases de vol - + Outputs Sorties - + Special Functions Fonctions spéciales - + Telemetry Télémesure @@ -9208,12 +9242,12 @@ Mixage actif par défaut si non-renseigné. ModuleData - + Positive - + Negative Négative @@ -9319,42 +9353,42 @@ Mixage actif par défaut si non-renseigné. ModulePanel - + Value Valeur - + Hold Maintien - + No Pulse Pas d'impulsion - + Ask Demander - + Internal Interne - + Internal + External Interne + Externe - + External Externe - + Bind on channel Bind avec VOIE @@ -9830,22 +9864,22 @@ Mixage actif par défaut si non-renseigné. OpenTxEepromInterface - + Unknown error Erreur inconnue - + ... plus %1 errors ... plus %1 erreurs - + Cannot write radio settings Impossible d'écrire les paramètres de la radio - + Cannot write model %1 Impossible d'écrire le modèle %1 @@ -10350,17 +10384,6 @@ E REb - - - - ??? - - - - - ---- - - I @@ -10389,7 +10412,7 @@ E - + SRC @@ -10637,146 +10660,226 @@ E SensorData - - + + Raw (-) + Chiffres bruts (-) + + + + V - + A - + mA - + kts - + m/s - + km/h - + mph - + m - + f - + °C - + °F - + % - + mAh - + W - + mW - + dB - + rpms - + g - + ° - + Rad - + hours heures - + minutes - + seconds secondes - + ml/minute - + Hertz - + mS - + uS - + TELE + + + Custom + Prédéfini + + + + Calculated + Calculé + + + + Add + Addition + + + + Average + Moyenne + + + + Minimum + + + + + Maximum + + + + + Multiply + Multiplication + + + + Totalize + Totalisation + + + + Cell + Element LiPo + + + + Consumption + Consommation + + + + Distance + + + + + Lowest + Min + + + + Cell %1 + Elém. %1 + + + + Highest + Max + + + + Delta + + Setup @@ -10960,92 +11063,92 @@ Si cette option est cochée, la voie des gaz est inversée: le ralenti est &apo SetupPanel - + Popup menu available Menu contextuel disponible - + Timer %1 Chrono %1 - + THR GAZ - + Profile Settings Paramètres du profil - + SD structure path not specified or invalid Chemin de la structure SD non spécifié ou invalide - + Copy Copier - + Cut Couper - + Paste Coller - + Clear Effacer - + Insert Insérer - + Delete Supprimer - + Move Up Monter - + Move Down Descendre - + Clear All Effacer Tout - + Clear Timer. Are you sure? Effacer le Chrono. Êtes-vous sûr? - + Clear all Timers. Are you sure? Effacer tous les Chronos. Êtes-vous sûr? - + Cut Timer. Are you sure? Couper le Chrono. Êtes-vous sûr? - + Delete Timer. Are you sure? Supprimer le Chrono. Êtes-vous sûr? @@ -11769,62 +11872,62 @@ La valeur par défaut est configurée dans le profil radio sélectionné.Simulateur Radio (%1) - + Could not determine startup data source. Impossible de déterminer les données source. - + Could not load data, possibly wrong format. Impossible de charger les données, mauvais format. - + Data Load Error Erreur de lecture des données - + Invalid startup data provided. Plese specify a proper file/path. Données de démarrage fournies non valides. Veuillez spécifier un fichier/chemin approprié. - + Simulator Startup Error Erreur de démarrage du simulateur - + Error saving data: could open file for writing: '%1' Erreur de sauvegarde des données: impossible d'écrire le fichier '%1' - + Error saving data: could not get data from simulator interface. Erreur de sauvegarde des données: impossible de récupérer les données depuis l'interface de simulation. - + An unexpected error occurred while attempting to save radio data to file '%1'. Une erreur inattendue s'est produite lors de l'enregistrement des données radio dans le fichier '%1'. - + Data Save Error Erreur de sauvegarde des données - + Cannot open joystick, joystick disabled Impossible d'accéder au Joystick, Joystick désactivé - + Radio firmware error: %1 Erreur firmware radio: %1 - + - Flight Mode %1 (#%2) - Phase de Vol %1 (#%2) @@ -12479,22 +12582,22 @@ Trop d'erreurs, abandon. Type d'écran personnalisé - + None Aucun - + Numbers Chiffres - + Bars Barres - + Script @@ -12522,109 +12625,52 @@ Trop d'erreurs, abandon. TelemetryPanel - + FrSky S.PORT - + FrSky D - + FrSky D (cable) FrSky D (câble) - + Telemetry screen %1 Ecran de télémesure %1 - + Source - + Low Alarm Alarme basse - + Critical Alarm Alarme critique - + Winged Shadow How High - + Winged Shadow How High (not supported) Winged Shadow How High (non supporté) - - Alti - Alt - - - - Alti+ - Alt+ - - - - VSpeed - Vitesse verticale - - - - - - A1 - - - - - - - A2 - - - - - - A3 - - - - - - A4 - - - - - - FAS - - - - - Cells - Velm - - - - --- - - - - + Delete Sensor. Are you sure? Supprimer le Capteur. Êtes-vous sûr? @@ -12922,92 +12968,72 @@ Trop d'erreurs, abandon. TelemetrySensorPanel - + TELE%1 - + Popup menu available Menu contextuel disponible - - Lowest - Min - - - - Cell %1 - Elém. %1 - - - - Highest - Max - - - - Delta - - - - + Copy Copier - + Cut Couper - + Paste Coller - + Clear Effacer - + Insert Insérer - + Delete Supprimer - + Move Up Monter - + Move Down Descendre - + Clear All Effacer Tout - + Cut Telemetry Sensor. Are you sure? Couper le capteur de télémétrie. Êtes-vous sûr? - + Clear Telemetry Sensor. Are you sure? Effacer le capteur de télémétrie. Êtes-vous sûr? - + Clear all Telemetry Sensors. Are you sure? Effacez tous les capteurs de télémétrie. Êtes-vous sûr? From f10eaa48ee16434d2f9c34fdaaa0556512d069c5 Mon Sep 17 00:00:00 2001 From: Kilrah Date: Tue, 26 Jan 2021 12:17:06 +0100 Subject: [PATCH 06/52] Companion countdown start --- companion/src/firmwares/modeldata.h | 2 ++ .../src/firmwares/opentx/opentxeeprom.cpp | 3 ++- companion/src/modeledit/setup.cpp | 18 +++++++++++++++++- companion/src/modeledit/setup.h | 1 + companion/src/modeledit/setup_timer.ui | 14 +++++++++++++- 5 files changed, 35 insertions(+), 3 deletions(-) diff --git a/companion/src/firmwares/modeldata.h b/companion/src/firmwares/modeldata.h index 2b277568f..847997d94 100644 --- a/companion/src/firmwares/modeldata.h +++ b/companion/src/firmwares/modeldata.h @@ -70,6 +70,8 @@ class TimerData { unsigned int countdownBeep; unsigned int val; unsigned int persistent; + int countdownStart; + unsigned int direction; int pvalue; void clear() { memset(reinterpret_cast(this), 0, sizeof(TimerData)); mode = RawSwitch(SWITCH_TYPE_TIMER_MODE, 0); } void convert(RadioDataConversionState & cstate); diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 111e3c391..f9fc8c8f5 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -2311,7 +2311,8 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsig internalField.Append(new UnsignedField<2>(this, modelData.timers[i].countdownBeep)); internalField.Append(new BoolField<1>(this, modelData.timers[i].minuteBeep)); internalField.Append(new UnsignedField<2>(this, modelData.timers[i].persistent)); - internalField.Append(new SpareBitsField<3>(this)); + internalField.Append(new SignedField<2>(this, modelData.timers[i].countdownStart)); + internalField.Append(new UnsignedField<1>(this, modelData.timers[i].direction)); if (HAS_LARGE_LCD(board)) internalField.Append(new ZCharField<8>(this, modelData.timers[i].name, "Timer name")); else diff --git a/companion/src/modeledit/setup.cpp b/companion/src/modeledit/setup.cpp index 25cd576ec..093c8acf7 100644 --- a/companion/src/modeledit/setup.cpp +++ b/companion/src/modeledit/setup.cpp @@ -73,13 +73,20 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge ui->persistent->addItem(tr("Not persistent"), 0); ui->persistent->addItem(tr("Persistent (flight)"), 1); ui->persistent->addItem(tr("Persistent (manual reset)"), 2); + + ui->countdownStart->setField(timer.countdownStart, this); + ui->countdownStart->addItem("5s", 1); + ui->countdownStart->addItem("10s", 0); + ui->countdownStart->addItem("20s", -1); + ui->countdownStart->addItem("30s", 2); disableMouseScrolling(); QWidget::setTabOrder(prevFocus, ui->name); QWidget::setTabOrder(ui->name, ui->value); QWidget::setTabOrder(ui->value, ui->mode); QWidget::setTabOrder(ui->mode, ui->countdownBeep); - QWidget::setTabOrder(ui->countdownBeep, ui->minuteBeep); + QWidget::setTabOrder(ui->countdownBeep, ui->countdownStart); + QWidget::setTabOrder(ui->countdownStart, ui->minuteBeep); QWidget::setTabOrder(ui->minuteBeep, ui->persistent); update(); @@ -121,6 +128,7 @@ void TimerPanel::update() ui->countdownBeep->updateValue(); ui->minuteBeep->setChecked(timer.minuteBeep); ui->persistent->updateValue(); + ui->countdownStart->updateValue(); lock = false; } @@ -129,6 +137,14 @@ QWidget * TimerPanel::getLastFocus() return ui->persistent; } +void TimerPanel::on_countdownBeep_currentIndexChanged(int index) +{ + if(index == TimerData::COUNTDOWN_SILENT) + ui->countdownStart->hide(); + else + ui->countdownStart->show(); +} + void TimerPanel::on_value_editingFinished() { if (!lock) { diff --git a/companion/src/modeledit/setup.h b/companion/src/modeledit/setup.h index c931f9dd7..7a5cddba9 100644 --- a/companion/src/modeledit/setup.h +++ b/companion/src/modeledit/setup.h @@ -51,6 +51,7 @@ class TimerPanel : public ModelPanel void onModeChanged(int index); void on_value_editingFinished(); void on_minuteBeep_toggled(bool checked); + void on_countdownBeep_currentIndexChanged(int index); void on_name_editingFinished(); void onItemModelAboutToBeUpdated(); void onItemModelUpdateComplete(); diff --git a/companion/src/modeledit/setup_timer.ui b/companion/src/modeledit/setup_timer.ui index b6b920a10..11f566b45 100644 --- a/companion/src/modeledit/setup_timer.ui +++ b/companion/src/modeledit/setup_timer.ui @@ -20,7 +20,16 @@ 6 - + + 0 + + + 0 + + + 0 + + 0 @@ -59,6 +68,9 @@ + + + From 00b2b295ca94fb1e327d6ef616bcf8b6accde2c6 Mon Sep 17 00:00:00 2001 From: 3djc Date: Tue, 26 Jan 2021 13:01:20 +0100 Subject: [PATCH 07/52] 128 GUI --- radio/src/gui/128x64/model_setup.cpp | 109 +++++++++++++++------------ 1 file changed, 62 insertions(+), 47 deletions(-) diff --git a/radio/src/gui/128x64/model_setup.cpp b/radio/src/gui/128x64/model_setup.cpp index 468597b29..ec199df66 100644 --- a/radio/src/gui/128x64/model_setup.cpp +++ b/radio/src/gui/128x64/model_setup.cpp @@ -236,7 +236,8 @@ inline uint8_t MODULE_SUBTYPE_ROWS(int moduleIdx) } #define POT_WARN_ROWS ((g_model.potsWarnMode) ? (uint8_t)(NUM_POTS+NUM_SLIDERS) : (uint8_t)0) -#define TIMER_ROWS 2, 0, 0, 0, 0 +#define TIMER_ROWS(x) 2, 0, 0, 0, g_model.timers[x].countdownBeep != COUNTDOWN_SILENT ? (uint8_t) 1 : (uint8_t)0 +#define TIMERS_ROWS TIMER_ROWS(0), TIMER_ROWS(1), TIMER_ROWS(2) #if defined(PCBSKY9X) #define EXTRA_MODULE_ROWS LABEL(ExtraModule), 1, 2, @@ -306,6 +307,63 @@ void onBluetoothConnectMenu(const char * result) } #endif +void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, event_t event) +{ + TimerData & timer = g_model.timers[timerIdx]; + drawStringWithIndex(0*FW, y, STR_TIMER, timerIdx+1); + drawTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer.mode, menuHorizontalPosition==0 ? attr : 0); + drawTimer(MODEL_SETUP_2ND_COLUMN + 5 * FW - 2 + 5 * FWNUM + 1, y, timer.start, RIGHT | (menuHorizontalPosition == 1 ? attr : 0),menuHorizontalPosition == 2 ? attr : 0); + if (attr && s_editMode>0) { + div_t qr = div(timer.start, 60); + switch (menuHorizontalPosition) { + case 0: + { + swsrc_t timerMode = timer.mode; + if (timerMode < 0) timerMode -= TMRMODE_COUNT-1; + CHECK_INCDEC_MODELVAR_CHECK(event, timerMode, -TMRMODE_COUNT-SWSRC_LAST+1, TMRMODE_COUNT+SWSRC_LAST-1, isSwitchAvailableInTimers); + if (timerMode < 0) timerMode += TMRMODE_COUNT-1; + timer.mode = timerMode; +#if defined(AUTOSWITCH) + if (s_editMode>0) { + swsrc_t val = timer.mode - (TMRMODE_COUNT-1); + swsrc_t switchVal = checkIncDecMovedSwitch(val); + if (val != switchVal) { + timer.mode = switchVal + (TMRMODE_COUNT-1); + storageDirty(EE_MODEL); + } + } +#endif + break; + } + case 1: + qr.quot = checkIncDec(event, qr.quot, 0, 1439, EE_MODEL | NO_INCDEC_MARKS); // 23h59 + timer.start = qr.rem + qr.quot*60; + break; + } + } +} + +void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event) +{ + TimerData & timer = g_model.timers[timerIdx]; + lcdDrawTextAlignedLeft(y, STR_BEEPCOUNTDOWN); + lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VBEEPCOUNTDOWN, timer.countdownBeep, (menuHorizontalPosition==0 ? attr : 0)); + if (timer.countdownBeep != COUNTDOWN_SILENT) { + lcdDrawNumber(MODEL_SETUP_2ND_COLUMN + 6 * FW, y, TIMER_COUNTDOWN_START(timerIdx), (menuHorizontalPosition == 1 ? attr : 0) | LEFT); + lcdDrawChar(lcdLastRightPos, y, 's'); + } + if (attr && s_editMode>0) { + switch (menuHorizontalPosition) { + case 0: + CHECK_INCDEC_MODELVAR(event, timer.countdownBeep, COUNTDOWN_SILENT, COUNTDOWN_COUNT - 1); + break; + case 1: + timer.countdownStart = -checkIncDecModel(event, -timer.countdownStart, -1, +2); + break; + } + } +} + #include "common/stdlcd/model_setup_pxx1.cpp" #if defined(PXX2) @@ -375,9 +433,7 @@ void menuModelSetup(event_t event) MENU_TAB({ HEADER_LINE_COLUMNS 0, - TIMER_ROWS, - TIMER_ROWS, - TIMER_ROWS, + TIMERS_ROWS, 0, // Extended limits 1, // Extended trims 0, // Show trims @@ -502,47 +558,7 @@ void menuModelSetup(event_t event) case ITEM_MODEL_SETUP_TIMER2: case ITEM_MODEL_SETUP_TIMER3: { - unsigned int timerIdx = (k>=ITEM_MODEL_SETUP_TIMER3 ? 2 : (k>=ITEM_MODEL_SETUP_TIMER2 ? 1 : 0)); - TimerData * timer = &g_model.timers[timerIdx]; - drawStringWithIndex(0*FW, y, STR_TIMER, timerIdx+1); - drawTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, menuHorizontalPosition==0 ? attr : 0); - drawTimer(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, RIGHT | (menuHorizontalPosition==1 ? attr : 0), menuHorizontalPosition==2 ? attr : 0); - if (attr && s_editMode > 0) { - div_t qr = div(timer->start, 60); - switch (menuHorizontalPosition) { - case 0: - { - swsrc_t timerMode = timer->mode; - if (timerMode < 0) - timerMode -= TMRMODE_COUNT-1; - CHECK_INCDEC_MODELVAR_CHECK(event, timerMode, -TMRMODE_COUNT-SWSRC_LAST+1, TMRMODE_COUNT+SWSRC_LAST-1, isSwitchAvailableInTimers); - if (timerMode < 0) - timerMode += TMRMODE_COUNT-1; - timer->mode = timerMode; -#if defined(AUTOSWITCH) - if (s_editMode>0) { - int8_t val = timer->mode - (TMRMODE_COUNT-1); - int8_t switchVal = checkIncDecMovedSwitch(val); - if (val != switchVal) { - timer->mode = switchVal + (TMRMODE_COUNT-1); - storageDirty(EE_MODEL); - } - } -#endif - break; - } - case 1: - CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 539); // 8:59 - timer->start = qr.rem + qr.quot*60; - break; - case 2: - qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2; - timer->start -= qr.rem; - if ((int16_t)timer->start < 0) timer->start=0; - if ((int16_t)timer->start > 5999) timer->start=32399; // 8:59:59 - break; - } - } + editTimerMode(k>=ITEM_MODEL_SETUP_TIMER3 ? 2 : (k>=ITEM_MODEL_SETUP_TIMER2 ? 1 : 0), y, attr, event); break; } @@ -568,8 +584,7 @@ void menuModelSetup(event_t event) case ITEM_MODEL_SETUP_TIMER2_COUNTDOWN_BEEP: case ITEM_MODEL_SETUP_TIMER3_COUNTDOWN_BEEP: { - TimerData * timer = &g_model.timers[k>=ITEM_MODEL_SETUP_TIMER3 ? 2 : (k>=ITEM_MODEL_SETUP_TIMER2 ? 1 : 0)]; - timer->countdownBeep = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_BEEPCOUNTDOWN, STR_VBEEPCOUNTDOWN, timer->countdownBeep, COUNTDOWN_SILENT, COUNTDOWN_COUNT-1, attr, event); + editTimerCountdown(k>=ITEM_MODEL_SETUP_TIMER3 ? 2 : (k>=ITEM_MODEL_SETUP_TIMER2 ? 1 : 0), y, attr, event); break; } From fcb3f3de4c6333187ef604fc39d01286e00cb70c Mon Sep 17 00:00:00 2001 From: 3djc Date: Tue, 26 Jan 2021 13:24:25 +0100 Subject: [PATCH 08/52] Fix --- radio/src/gui/128x64/model_setup.cpp | 78 +++++++++++++++------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/radio/src/gui/128x64/model_setup.cpp b/radio/src/gui/128x64/model_setup.cpp index ec199df66..b2c39b63b 100644 --- a/radio/src/gui/128x64/model_setup.cpp +++ b/radio/src/gui/128x64/model_setup.cpp @@ -307,42 +307,6 @@ void onBluetoothConnectMenu(const char * result) } #endif -void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, event_t event) -{ - TimerData & timer = g_model.timers[timerIdx]; - drawStringWithIndex(0*FW, y, STR_TIMER, timerIdx+1); - drawTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer.mode, menuHorizontalPosition==0 ? attr : 0); - drawTimer(MODEL_SETUP_2ND_COLUMN + 5 * FW - 2 + 5 * FWNUM + 1, y, timer.start, RIGHT | (menuHorizontalPosition == 1 ? attr : 0),menuHorizontalPosition == 2 ? attr : 0); - if (attr && s_editMode>0) { - div_t qr = div(timer.start, 60); - switch (menuHorizontalPosition) { - case 0: - { - swsrc_t timerMode = timer.mode; - if (timerMode < 0) timerMode -= TMRMODE_COUNT-1; - CHECK_INCDEC_MODELVAR_CHECK(event, timerMode, -TMRMODE_COUNT-SWSRC_LAST+1, TMRMODE_COUNT+SWSRC_LAST-1, isSwitchAvailableInTimers); - if (timerMode < 0) timerMode += TMRMODE_COUNT-1; - timer.mode = timerMode; -#if defined(AUTOSWITCH) - if (s_editMode>0) { - swsrc_t val = timer.mode - (TMRMODE_COUNT-1); - swsrc_t switchVal = checkIncDecMovedSwitch(val); - if (val != switchVal) { - timer.mode = switchVal + (TMRMODE_COUNT-1); - storageDirty(EE_MODEL); - } - } -#endif - break; - } - case 1: - qr.quot = checkIncDec(event, qr.quot, 0, 1439, EE_MODEL | NO_INCDEC_MARKS); // 23h59 - timer.start = qr.rem + qr.quot*60; - break; - } - } -} - void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event) { TimerData & timer = g_model.timers[timerIdx]; @@ -558,7 +522,47 @@ void menuModelSetup(event_t event) case ITEM_MODEL_SETUP_TIMER2: case ITEM_MODEL_SETUP_TIMER3: { - editTimerMode(k>=ITEM_MODEL_SETUP_TIMER3 ? 2 : (k>=ITEM_MODEL_SETUP_TIMER2 ? 1 : 0), y, attr, event); + unsigned int timerIdx = (k>=ITEM_MODEL_SETUP_TIMER3 ? 2 : (k>=ITEM_MODEL_SETUP_TIMER2 ? 1 : 0)); + TimerData * timer = &g_model.timers[timerIdx]; + drawStringWithIndex(0*FW, y, STR_TIMER, timerIdx+1); + drawTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, menuHorizontalPosition==0 ? attr : 0); + drawTimer(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, RIGHT | (menuHorizontalPosition==1 ? attr : 0), menuHorizontalPosition==2 ? attr : 0); + if (attr && s_editMode > 0) { + div_t qr = div(timer->start, 60); + switch (menuHorizontalPosition) { + case 0: + { + swsrc_t timerMode = timer->mode; + if (timerMode < 0) + timerMode -= TMRMODE_COUNT-1; + CHECK_INCDEC_MODELVAR_CHECK(event, timerMode, -TMRMODE_COUNT-SWSRC_LAST+1, TMRMODE_COUNT+SWSRC_LAST-1, isSwitchAvailableInTimers); + if (timerMode < 0) + timerMode += TMRMODE_COUNT-1; + timer->mode = timerMode; +#if defined(AUTOSWITCH) + if (s_editMode>0) { + int8_t val = timer->mode - (TMRMODE_COUNT-1); + int8_t switchVal = checkIncDecMovedSwitch(val); + if (val != switchVal) { + timer->mode = switchVal + (TMRMODE_COUNT-1); + storageDirty(EE_MODEL); + } + } +#endif + break; + } + case 1: + CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 539); // 8:59 + timer->start = qr.rem + qr.quot*60; + break; + case 2: + qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2; + timer->start -= qr.rem; + if ((int16_t)timer->start < 0) timer->start=0; + if ((int16_t)timer->start > 5999) timer->start=32399; // 8:59:59 + break; + } + } break; } From a908efffa03763b4a887b5defb398cf3937aa75f Mon Sep 17 00:00:00 2001 From: Kilrah Date: Tue, 26 Jan 2021 13:31:47 +0100 Subject: [PATCH 09/52] Fix 30s value --- companion/src/modeledit/setup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/companion/src/modeledit/setup.cpp b/companion/src/modeledit/setup.cpp index 093c8acf7..d1756aa48 100644 --- a/companion/src/modeledit/setup.cpp +++ b/companion/src/modeledit/setup.cpp @@ -78,7 +78,7 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge ui->countdownStart->addItem("5s", 1); ui->countdownStart->addItem("10s", 0); ui->countdownStart->addItem("20s", -1); - ui->countdownStart->addItem("30s", 2); + ui->countdownStart->addItem("30s", -2); disableMouseScrolling(); QWidget::setTabOrder(prevFocus, ui->name); From b5d1d4d57924d89fa78e3592f6aa0c672bded274 Mon Sep 17 00:00:00 2001 From: LapinFou Date: Tue, 26 Jan 2021 13:32:01 +0100 Subject: [PATCH 10/52] Updated French Translation --- companion/src/translations/companion_fr.ts | 54 +++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/companion/src/translations/companion_fr.ts b/companion/src/translations/companion_fr.ts index d052a6e2c..89a6734e2 100644 --- a/companion/src/translations/companion_fr.ts +++ b/companion/src/translations/companion_fr.ts @@ -1391,22 +1391,22 @@ Si vous avez un fichier de sauvegarde des paramètres, vous pouvez l'import Diff - + Expo - + Func - + Fonc Curve - Courbe + Courbe @@ -1681,7 +1681,7 @@ Si vous avez un fichier de sauvegarde des paramètres, vous pouvez l'import Set %1 - + Activer %1 @@ -3078,7 +3078,7 @@ Blanc signifie "inclure tous".Les métacaractères ?, * et [...] sont Jumper T-Lite - + @@ -3090,12 +3090,12 @@ Blanc signifie "inclure tous".Les métacaractères ?, * et [...] sont Radiomaster T8 - + Allow bind using bind key - + Autoriser l'appairage avec le bouton"bind" @@ -4180,12 +4180,12 @@ Communs à tous les modèles d'une même EEPROM. Store calib. and hw settings in selected profile - Sauver étalonnage et paramètres hw dans profil + Sauver paramètres Radio dans profil Retrieve calib. and hw settings from profile - Lire étalonnage et paramètres hw du profil + Lire paramètres Radio depuis profil @@ -8094,7 +8094,7 @@ Mixage actif par défaut si non-renseigné. THR - GAZ + GAZ @@ -10662,7 +10662,7 @@ E Raw (-) - Chiffres bruts (-) + Chiffres bruts (-) @@ -10808,77 +10808,77 @@ E Custom - Prédéfini + Prédéfini Calculated - Calculé + Calculé Add - Addition + Addition Average - Moyenne + Moyenne Minimum - + Maximum - + Multiply - Multiplication + Multiplication Totalize - Totalisation + Totalisation Cell - Element LiPo + Element LiPo Consumption - Consommation + Consommation Distance - + Lowest - Min + Min Cell %1 - Elém. %1 + Elément %1 Highest - Max + Max Delta - + From f6c4da918ad8e7dad7469fc8d7d047edd7f7d746 Mon Sep 17 00:00:00 2001 From: 3djc Date: Tue, 26 Jan 2021 15:46:18 +0100 Subject: [PATCH 11/52] Enable compilation on servers --- companion/src/firmwares/opentx/opentxinterface.cpp | 2 +- radio/util/build-firmware.py | 5 +++++ radio/util/fwoptions.py | 12 ++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index a9b3f69e9..1190062c5 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -1307,7 +1307,7 @@ void registerOpenTxFirmwares() firmware->addOption("lua", Firmware::tr("Enable Lua custom scripts screen")); addOpenTxFontOptions(firmware); registerOpenTxFirmware(firmware); - addOpenTxRfOptions(firmware, FLEX + AFHDS3); + addOpenTxRfOptions(firmware, FLEX); /* Jumper T16 board */ firmware = new OpenTxFirmware("opentx-t16", Firmware::tr("Jumper T16 / T16+ / T16 Pro"), BOARD_JUMPER_T16); diff --git a/radio/util/build-firmware.py b/radio/util/build-firmware.py index b7132d510..5d577092c 100755 --- a/radio/util/build-firmware.py +++ b/radio/util/build-firmware.py @@ -138,6 +138,11 @@ def main(): cmake_options["PCB"] = "X12S" firmware_options = options_horus_x12s maxsize = 2 * 1024 * 1024 + elif board_name == "tlite": + cmake_options["PCB"] = "X7" + cmake_options["PCBREV"] = "TLITE" + firmware_options = options_jumper_tlite + maxsize = 65536 * 8 elif board_name == "t12": cmake_options["PCB"] = "X7" cmake_options["PCBREV"] = "T12" diff --git a/radio/util/fwoptions.py b/radio/util/fwoptions.py index 7b2a01edd..4ce915426 100755 --- a/radio/util/fwoptions.py +++ b/radio/util/fwoptions.py @@ -207,6 +207,18 @@ options_horus_x10express = { "flexr9m": ("MODULE_PROTOCOL_FLEX", "YES", None), } +options_jumper_tlite = { + "noheli": ("HELI", "NO", "YES"), + "ppmus": ("PPM_UNIT", "US", "PERCENT_PREC1"), + "lua": ("LUA", "YES", "NO_MODEL_SCRIPTS"), + "nogvars": ("GVARS", "NO", "YES"), + "faimode": ("FAI", "YES", None), + "faichoice": ("FAI", "CHOICE", None), + "nooverridech": ("OVERRIDE_CHANNEL_FUNCTION", "NO", "YES"), + "flexr9m": ("MODULE_PROTOCOL_FLEX", "YES", None), +} + + options_jumper_t12 = { "noheli": ("HELI", "NO", "YES"), "ppmus": ("PPM_UNIT", "US", "PERCENT_PREC1"), From 20e8c5ac8c802ffe82a848642b3c185ef3e5c140 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 27 Jan 2021 18:57:47 +0100 Subject: [PATCH 12/52] Update CREDITS.txt --- CREDITS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.txt b/CREDITS.txt index 5e7672e1f..c4015a865 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2117,3 +2117,4 @@ Aldo Visentin Greg Wilson Mark Sutton Lukas Kana +Peter Newman From 51049e89761b4653736f856631a73aa718e71313 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 27 Jan 2021 18:58:10 +0100 Subject: [PATCH 13/52] Update CREDITS.txt --- CREDITS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.txt b/CREDITS.txt index c4015a865..47335f694 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2118,3 +2118,4 @@ Greg Wilson Mark Sutton Lukas Kana Peter Newman +Kevin Cave From 582f84435ff01959b6decea18372b21f4185141a Mon Sep 17 00:00:00 2001 From: 3djc Date: Thu, 28 Jan 2021 08:02:41 +0100 Subject: [PATCH 14/52] Display only on debug on capable radios --- radio/src/gui/480x272/radio_hardware.cpp | 2 +- radio/src/telemetry/crossfire.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/gui/480x272/radio_hardware.cpp b/radio/src/gui/480x272/radio_hardware.cpp index 419fedbf5..8e63a79c6 100644 --- a/radio/src/gui/480x272/radio_hardware.cpp +++ b/radio/src/gui/480x272/radio_hardware.cpp @@ -126,7 +126,7 @@ void onHardwareAntennaSwitchConfirm(const char * result) #define EXTERNAL_ANTENNA_ROW #endif -#if (defined(CROSSFIRE) || defined(GHOST)) +#if (defined(CROSSFIRE) || defined(GHOST)) && (SPORT_MAX_BAUDRATE < 400000 || defined(DEBUG)) #define MAX_BAUDRATE_ROW 0 #else #define MAX_BAUDRATE_ROW HIDDEN_ROW diff --git a/radio/src/telemetry/crossfire.h b/radio/src/telemetry/crossfire.h index 9855b78f4..5e7d59c78 100644 --- a/radio/src/telemetry/crossfire.h +++ b/radio/src/telemetry/crossfire.h @@ -102,7 +102,7 @@ const uint8_t CROSSFIRE_PERIODS[] = { 4, 16, }; -#if SPORT_MAX_BAUDRATE < 400000 +#if SPORT_MAX_BAUDRATE < 400000 || defined(DEBUG) #define CROSSFIRE_BAUDRATE CROSSFIRE_BAUDRATES[g_eeGeneral.telemetryBaudrate] #define CROSSFIRE_PERIOD CROSSFIRE_PERIODS[g_eeGeneral.telemetryBaudrate] #else From 3a2a51e35365376788c1f4db5e7f1192ed9cc89a Mon Sep 17 00:00:00 2001 From: 3djc Date: Thu, 28 Jan 2021 08:05:33 +0100 Subject: [PATCH 15/52] b&w too --- radio/src/gui/common/stdlcd/radio_hardware.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/gui/common/stdlcd/radio_hardware.cpp b/radio/src/gui/common/stdlcd/radio_hardware.cpp index cd4cfb905..7f38f692e 100644 --- a/radio/src/gui/common/stdlcd/radio_hardware.cpp +++ b/radio/src/gui/common/stdlcd/radio_hardware.cpp @@ -284,7 +284,7 @@ enum { #define TX_CAPACITY_MEASUREMENT_ROWS #endif -#if (defined(CROSSFIRE) || defined(GHOST)) && SPORT_MAX_BAUDRATE < 400000 +#if (defined(CROSSFIRE) || defined(GHOST)) && (SPORT_MAX_BAUDRATE < 400000 || defined(DEBUG)) #define MAX_BAUD_ROWS 0, #else #define MAX_BAUD_ROWS From a933903e6b86310e1795acba6e8fa830aaea308b Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 28 Jan 2021 09:31:17 +0100 Subject: [PATCH 16/52] Update CREDITS.txt --- CREDITS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.txt b/CREDITS.txt index 47335f694..a47100b3b 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2119,3 +2119,4 @@ Mark Sutton Lukas Kana Peter Newman Kevin Cave +Arold Reinders From a706622d994b95e5968331e354cea0be4fb1fbb7 Mon Sep 17 00:00:00 2001 From: 3djc Date: Fri, 29 Jan 2021 14:55:57 +0100 Subject: [PATCH 17/52] Fix multi per channel failsafe --- radio/src/pulses/multi.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radio/src/pulses/multi.cpp b/radio/src/pulses/multi.cpp index dcc7c7f9c..6c6471c9c 100644 --- a/radio/src/pulses/multi.cpp +++ b/radio/src/pulses/multi.cpp @@ -108,15 +108,15 @@ static void sendFailsafeChannels(uint8_t moduleIdx) int16_t failsafeValue = g_model.failsafeChannels[i]; int pulseValue; - if (g_model.moduleData[moduleIdx].failsafeMode == FAILSAFE_HOLD) { + if (g_model.moduleData[moduleIdx].failsafeMode == FAILSAFE_HOLD || failsafeValue == FAILSAFE_CHANNEL_HOLD) { pulseValue = 2047; } - else if (g_model.moduleData[moduleIdx].failsafeMode == FAILSAFE_NOPULSES) { + else if (g_model.moduleData[moduleIdx].failsafeMode == FAILSAFE_NOPULSES || failsafeValue == FAILSAFE_CHANNEL_NOPULSE) { pulseValue = 0; } else { failsafeValue += 2 * PPM_CH_CENTER(g_model.moduleData[moduleIdx].channelsStart + i) - 2 * PPM_CENTER; - pulseValue = limit(1, (failsafeValue * 800 / 1000) + 1024, 2047); + pulseValue = limit(1, (failsafeValue * 800 / 1000) + 1024, 2046); } bits |= pulseValue << bitsavailable; From 452f7b6c6a3c108412d228e316c81b56e4f73531 Mon Sep 17 00:00:00 2001 From: olliw42 Date: Sun, 31 Jan 2021 07:51:41 +0100 Subject: [PATCH 18/52] remove superfluous trainerSbusFifo in aux_serial_driver & horus/trainer_driver --- radio/src/targets/common/arm/stm32/aux_serial_driver.cpp | 6 +----- radio/src/targets/horus/trainer_driver.cpp | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/radio/src/targets/common/arm/stm32/aux_serial_driver.cpp b/radio/src/targets/common/arm/stm32/aux_serial_driver.cpp index 965ae0daf..9cc558b51 100644 --- a/radio/src/targets/common/arm/stm32/aux_serial_driver.cpp +++ b/radio/src/targets/common/arm/stm32/aux_serial_driver.cpp @@ -21,10 +21,6 @@ #include "opentx.h" #include "targets/horus/board.h" -#if defined(SBUS) -extern Fifo trainerSbusFifo; -#endif - #if defined(AUX_SERIAL) uint8_t auxSerialMode = UART_MODE_COUNT; // Prevent debug output before port is setup Fifo auxSerialTxFifo; @@ -416,4 +412,4 @@ extern "C" void AUX2_SERIAL_USART_IRQHandler(void) } } #endif // SIMU -#endif // AUX2_SERIAL \ No newline at end of file +#endif // AUX2_SERIAL diff --git a/radio/src/targets/horus/trainer_driver.cpp b/radio/src/targets/horus/trainer_driver.cpp index ce649c688..38d25cb45 100644 --- a/radio/src/targets/horus/trainer_driver.cpp +++ b/radio/src/targets/horus/trainer_driver.cpp @@ -20,10 +20,6 @@ #include "opentx.h" -#if defined(SBUS_TRAINER) -Fifo trainerSbusFifo; -#endif - void trainerSendNextFrame(); void init_trainer_ppm() @@ -174,4 +170,4 @@ int sbusGetByte(uint8_t * byte) default: return false; } -} \ No newline at end of file +} From 68e0d130d0116f2e2d09fadd957d55eba4455545 Mon Sep 17 00:00:00 2001 From: 3djc Date: Sun, 31 Jan 2021 09:00:32 +0100 Subject: [PATCH 19/52] Fix some trainer modes missing on Horus --- radio/src/targets/horus/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/radio/src/targets/horus/CMakeLists.txt b/radio/src/targets/horus/CMakeLists.txt index 2a7f14ec5..6f64dae51 100644 --- a/radio/src/targets/horus/CMakeLists.txt +++ b/radio/src/targets/horus/CMakeLists.txt @@ -21,6 +21,7 @@ set(RTC_BACKUP_RAM YES) set(PPM_LIMITS_SYMETRICAL YES) set(USB_SERIAL ON CACHE BOOL "Enable USB serial (CDC)") set(ROTARY_ENCODER YES) +set(EXTERNAL_MODULE YES) # for size report script set(CPU_TYPE_FULL STM32F429xI) @@ -173,6 +174,10 @@ if(INTERNAL_MODULE_MULTI) add_definitions(-DINTERNAL_MODULE_MULTI) endif() +if(EXTERNAL_MODULE) + add_definitions(-DHARDWARE_EXTERNAL_MODULE) +endif() + include_directories(${RADIO_SRC_DIRECTORY}/fonts/480x272 gui/${GUI_DIR} gui/${GUI_DIR}/layouts) file(GLOB THEMES_SRC RELATIVE ${RADIO_SRC_DIRECTORY}/gui/480x272 ${RADIO_SRC_DIRECTORY}/gui/480x272/themes/*.cpp) From 5ac380360dcda0d9b9c0bef4930cb2554f69c68b Mon Sep 17 00:00:00 2001 From: elecpower Date: Fri, 29 Jan 2021 16:54:45 +1100 Subject: [PATCH 20/52] Sensor ui refactoring --- companion/src/firmwares/CMakeLists.txt | 1 + companion/src/firmwares/helpersdata.h | 53 +++++ companion/src/firmwares/sensordata.cpp | 175 +++++++++++++---- companion/src/firmwares/sensordata.h | 28 ++- companion/src/modeledit/telemetry.cpp | 206 ++++++++------------ companion/src/modeledit/telemetry.h | 9 +- companion/src/modeledit/telemetry_sensor.ui | 198 +------------------ companion/src/multimodelprinter.cpp | 2 +- companion/src/shared/autocheckbox.h | 5 + companion/src/shared/autolineedit.h | 7 +- 10 files changed, 319 insertions(+), 365 deletions(-) create mode 100644 companion/src/firmwares/helpersdata.h diff --git a/companion/src/firmwares/CMakeLists.txt b/companion/src/firmwares/CMakeLists.txt index e50d9241b..bf05bc44d 100644 --- a/companion/src/firmwares/CMakeLists.txt +++ b/companion/src/firmwares/CMakeLists.txt @@ -30,6 +30,7 @@ string(REPLACE ".cpp" ".h" firmwares_HDRS "${firmwares_SRCS}") list(APPEND firmwares_HDRS eepromimportexport.h moduledata.h + helpersdata.h ) set(firmwares_QT diff --git a/companion/src/firmwares/helpersdata.h b/companion/src/firmwares/helpersdata.h new file mode 100644 index 000000000..850bcb8a7 --- /dev/null +++ b/companion/src/firmwares/helpersdata.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _HELPERS_DATA_H_ +#define _HELPERS_DATA_H_ + +#include + +class FieldRange +{ + Q_DECLARE_TR_FUNCTIONS(FieldRange) + + public: + FieldRange(): + decimals(0), + min(0.0), + max(0.0), + step(1.0), + offset(0.0), + prefix(""), + unit("") + { + } + + float getValue(int value) { return float(value) * step; } + + int decimals; + double min; + double max; + double step; + double offset; + QString prefix; + QString unit; +}; + +#endif // _HELPERS_DATA_H_ diff --git a/companion/src/firmwares/sensordata.cpp b/companion/src/firmwares/sensordata.cpp index b5cce1809..f9660f1db 100644 --- a/companion/src/firmwares/sensordata.cpp +++ b/companion/src/firmwares/sensordata.cpp @@ -57,17 +57,65 @@ bool SensorData::isEmpty() const return (!isAvailable() && type == 0 && id == 0 && subid == 0 && instance == 0 && rxIdx == 0 && moduleIdx == 0 && unit == 0 && ratio == 0 && prec == 0 && offset == 0 && autoOffset == 0 && filter == 0 && onlyPositive == 0 && logs == 0); } -constexpr int SENSOR_ISCONFIGURABLE { 1 << 1 }; -constexpr int SENSOR_PRINT_GPS { 1 << 2 }; -constexpr int SENSOR_PRINT_CELLS { 1 << 3 }; -constexpr int SENSOR_PRINT_CONSUMPTION { 1 << 4 }; -constexpr int SENSOR_PRINT_RATIO { 1 << 5 }; -constexpr int SENSOR_PRINT_TOTALIZE { 1 << 6 }; -constexpr int SENSOR_PRINT_SOURCES_12 { 1 << 7 }; -constexpr int SENSOR_PRINT_SOURCES_34 { 1 << 8 }; -constexpr char FMT_LABEL[] { "%1: " }; -constexpr char FMT_VALUE[] { "%1 " }; -constexpr char FMT_LABEL_VALUE[] { "%1: %2 " }; +QString SensorData::typeToString() const +{ + return typeToString(type); +} + +QString SensorData::formulaToString() const +{ + return formulaToString(formula); +} + +QString SensorData::cellIndexToString() const +{ + return cellIndexToString(index); +} + +QString SensorData::unitToString() const +{ + return unitToString(unit); +} + +QString SensorData::precToString() const +{ + return precToString(prec); +} + +int SensorData::getMask() const +{ + int mask = 0; + + if (type == TELEM_TYPE_CALCULATED) { + if (formula < TELEM_FORMULA_CELL) + mask |= SENSOR_ISCONFIGURABLE | SENSOR_HAS_POSITIVE; + if (formula == TELEM_FORMULA_DIST) + mask |= SENSOR_HAS_GPS; + if (formula == TELEM_FORMULA_CELL) + mask |= SENSOR_HAS_CELLS; + if (formula == TELEM_FORMULA_CONSUMPTION) + mask |= SENSOR_HAS_CONSUMPTION; + if (formula <= TELEM_FORMULA_MULTIPLY) + mask |= SENSOR_HAS_SOURCES_12; + if (formula < TELEM_FORMULA_MULTIPLY) + mask |= SENSOR_HAS_SOURCES_34; + if (formula == TELEM_FORMULA_TOTALIZE) + mask |= SENSOR_HAS_TOTALIZE; + } + else { + if (unit < UNIT_FIRST_VIRTUAL) + mask |= (SENSOR_ISCONFIGURABLE | SENSOR_HAS_RATIO | SENSOR_HAS_POSITIVE); + } + + if (mask & SENSOR_ISCONFIGURABLE && unit != UNIT_FAHRENHEIT) + mask |= SENSOR_HAS_PRECISION; + + return mask; +} + +constexpr char FMT_LABEL[] { "%1: " }; +constexpr char FMT_VALUE[] { "%1 " }; +constexpr char FMT_LABEL_VALUE[] { "%1: %2 " }; QString SensorData::paramsToString(const ModelData * model) const { @@ -75,62 +123,45 @@ QString SensorData::paramsToString(const ModelData * model) const return ""; QString str; - int mask = 0; + int mask = getMask(); if (type == TELEM_TYPE_CALCULATED) { - if (formula < TELEM_FORMULA_CELL) - mask |= SENSOR_ISCONFIGURABLE; - if (formula == TELEM_FORMULA_DIST) - mask |= SENSOR_PRINT_GPS; - if (formula == TELEM_FORMULA_CELL) - mask |= SENSOR_PRINT_CELLS; - if (formula == TELEM_FORMULA_CONSUMPTION) - mask |= SENSOR_PRINT_CONSUMPTION; - if (formula <= TELEM_FORMULA_MULTIPLY) - mask |= SENSOR_PRINT_SOURCES_12; - if (formula < TELEM_FORMULA_MULTIPLY) - mask |= SENSOR_PRINT_SOURCES_34; - if (formula == TELEM_FORMULA_TOTALIZE) - mask |= SENSOR_PRINT_TOTALIZE; - str.append(QString(FMT_LABEL_VALUE).arg(tr("Formula")).arg(formulaToString(formula))); } else { - if (unit < UNIT_FIRST_VIRTUAL) - mask |= (SENSOR_ISCONFIGURABLE | SENSOR_PRINT_RATIO); - str.append(QString(FMT_LABEL_VALUE).arg(tr("Id")).arg(QString::number(id, 16).toUpper())); str.append(QString(FMT_LABEL_VALUE).arg(tr("Instance")).arg(instance)); } - if (mask & SENSOR_PRINT_CELLS) { + if (mask & SENSOR_HAS_CELLS) { str.append(QString(FMT_LABEL_VALUE).arg(tr("Sensor")).arg(sourceToString(model, source))); str.append(QString(FMT_VALUE).arg(cellIndexToString(index))); } - if (mask & SENSOR_PRINT_SOURCES_12) { + if (mask & SENSOR_HAS_SOURCES_12) { str.append(QString(FMT_LABEL).arg(tr("Sources"))); for (int i = 0; i < 4; i++) { - if (i < 2 || mask & SENSOR_PRINT_SOURCES_34) { + if (i < 2 || mask & SENSOR_HAS_SOURCES_34) { str.append(QString(FMT_VALUE).arg(sourceToString(model, sources[i]))); } } } - if (mask & SENSOR_PRINT_CONSUMPTION || mask & SENSOR_PRINT_TOTALIZE) + if (mask & SENSOR_HAS_CONSUMPTION || mask & SENSOR_HAS_TOTALIZE) str.append(QString(FMT_LABEL_VALUE).arg(tr("Sensor")).arg(sourceToString(model, amps))); - if (mask & SENSOR_PRINT_GPS) { + if (mask & SENSOR_HAS_GPS) { str.append(QString(FMT_LABEL_VALUE).arg(tr("GPS")).arg(sourceToString(model, gps))); str.append(QString(FMT_LABEL_VALUE).arg(tr("Alt")).arg(sourceToString(model, alt))); } - str.append(QString(FMT_LABEL_VALUE).arg(tr("Unit")).arg(unitToString(unit))); + if (mask & SENSOR_ISCONFIGURABLE) + str.append(QString(FMT_LABEL_VALUE).arg(tr("Unit")).arg(unitToString(unit))); - if (mask & SENSOR_ISCONFIGURABLE && unit != UNIT_FAHRENHEIT) + if (mask & SENSOR_HAS_PRECISION) str.append(QString(FMT_LABEL_VALUE).arg(tr("Precision")).arg(precToString(prec))); - if (mask & SENSOR_PRINT_RATIO) { + if (mask & SENSOR_HAS_RATIO) { if (unit != UNIT_RPMS) { int precsn = prec == 0 ? 1 : pow(10, prec); str.append(QString(FMT_LABEL_VALUE).arg(tr("Ratio")).arg((float)ratio / 10)); @@ -149,12 +180,78 @@ QString SensorData::paramsToString(const ModelData * model) const if (type == TELEM_TYPE_CALCULATED) str.append(QString(FMT_LABEL_VALUE).arg(tr("Persist")).arg(boolToString(persistent))); - str.append(QString(FMT_LABEL_VALUE).arg(tr("Positive")).arg(boolToString(onlyPositive))); + if (mask & SENSOR_HAS_POSITIVE) + str.append(QString(FMT_LABEL_VALUE).arg(tr("Positive")).arg(boolToString(onlyPositive))); + str.append(QString(FMT_LABEL_VALUE).arg(tr("Log")).arg(boolToString(logs))); return str; } +FieldRange SensorData::getRatioRange() const +{ + FieldRange result; + + if (unit == SensorData::UNIT_RPMS) { + result.decimals = 0; + result.max = 30000; + result.min = 1; + result.step = 1; + } + else { + result.decimals = 1; + result.max = 30000; + result.min = 0; + result.step = 0.1; + } + + return result; +} + +FieldRange SensorData::getOffsetRange() const +{ + FieldRange result; + + if (unit == SensorData::UNIT_RPMS) { + result.decimals = 0; + result.max = 30000; + result.min = 1; + result.step = 1; + } + else { + result.decimals = prec; + result.max = 30000.0f / powf(10.0f, prec); + result.min = -result.max; + result.step = pow(0.1, prec); + } + + return result; +} + +void SensorData::formulaChanged() +{ + switch (formula) { + case TELEM_FORMULA_CELL: + prec = 2; + unit = UNIT_VOLTS; + break; + case TELEM_FORMULA_CONSUMPTION: + prec = 0; + unit = UNIT_MAH; + break; + case TELEM_FORMULA_DIST: + prec = 0; + unit = UNIT_METERS; + break; + } +} + +void SensorData::unitChanged() +{ + if (unit == UNIT_FAHRENHEIT) + prec = 0; +} + // static QString SensorData::typeToString(const int value) { diff --git a/companion/src/firmwares/sensordata.h b/companion/src/firmwares/sensordata.h index 23d8a7fcc..0a24cd301 100644 --- a/companion/src/firmwares/sensordata.h +++ b/companion/src/firmwares/sensordata.h @@ -21,16 +21,30 @@ #ifndef SENSORDATA_H #define SENSORDATA_H +#include "helpersdata.h" + #include -constexpr int CPN_MAX_SENSORS = 60; -constexpr int SENSOR_LABEL_LEN = 4; +constexpr int CPN_MAX_SENSORS { 60 }; +constexpr int SENSOR_LABEL_LEN { 4 }; + +constexpr int SENSOR_ISCONFIGURABLE { 1 << 1 }; +constexpr int SENSOR_HAS_GPS { 1 << 2 }; +constexpr int SENSOR_HAS_CELLS { 1 << 3 }; +constexpr int SENSOR_HAS_CONSUMPTION { 1 << 4 }; +constexpr int SENSOR_HAS_RATIO { 1 << 5 }; +constexpr int SENSOR_HAS_TOTALIZE { 1 << 6 }; +constexpr int SENSOR_HAS_SOURCES_12 { 1 << 7 }; +constexpr int SENSOR_HAS_SOURCES_34 { 1 << 8 }; +constexpr int SENSOR_HAS_POSITIVE { 1 << 9 }; +constexpr int SENSOR_HAS_PRECISION { 1 << 10 }; class ModelData; class AbstractStaticItemModel; class PrecisionItemModel; class SensorData { + Q_DECLARE_TR_FUNCTIONS(SensorData) public: @@ -171,7 +185,17 @@ class SensorData { QString getOrigin(const ModelData* model) const; void clear() { memset(this, 0, sizeof(SensorData)); } bool isEmpty() const; + QString typeToString() const; + QString formulaToString() const; + QString cellIndexToString() const; + QString unitToString() const; + QString precToString() const; + int getMask() const; QString paramsToString(const ModelData * model) const; + FieldRange getRatioRange() const; + FieldRange getOffsetRange() const; + void formulaChanged(); + void unitChanged(); static QString sourceToString(const ModelData * model, const int index, const bool sign = false); static bool isSourceAvailable(const ModelData * model, const int index); diff --git a/companion/src/modeledit/telemetry.cpp b/companion/src/modeledit/telemetry.cpp index 423e10e5d..8cda220a9 100644 --- a/companion/src/modeledit/telemetry.cpp +++ b/companion/src/modeledit/telemetry.cpp @@ -27,13 +27,13 @@ #include -constexpr char FIM_RAWSOURCE[] {"Raw Source"}; -constexpr char FIM_TELEALLSRC[] {"Tele All Source"}; -constexpr char FIM_TELEPOSSRC[] {"Tele Pos Source"}; -constexpr char FIM_SENSORTYPE[] {"Sensor.Type"}; -constexpr char FIM_SENSORFORMULA[] {"Sensor.Formula"}; +constexpr char FIM_RAWSOURCE[] {"Raw Source"}; +constexpr char FIM_TELEALLSRC[] {"Tele All Source"}; +constexpr char FIM_TELEPOSSRC[] {"Tele Pos Source"}; +constexpr char FIM_SENSORTYPE[] {"Sensor.Type"}; +constexpr char FIM_SENSORFORMULA[] {"Sensor.Formula"}; constexpr char FIM_SENSORCELLINDEX[] {"Sensor.CellIndex"}; -constexpr char FIM_SENSORUNIT[] {"Sensor.Unit"}; +constexpr char FIM_SENSORUNIT[] {"Sensor.Unit"}; constexpr char FIM_SENSORPRECISION[] {"Sensor.Precision"}; TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model, FrSkyScreenData & screen, GeneralSettings & generalSettings, @@ -336,9 +336,6 @@ TelemetrySensorPanel::TelemetrySensorPanel(QWidget *parent, SensorData & sensor, modelsUpdateCnt(0), parentLock(parentLock) { - // TODO ui definition housekeeping - // - remove all predefined combobox lists leaving to code - // - use Auto types for consistency ui->setupUi(this); FilteredItemModel * fltmdl; @@ -358,11 +355,19 @@ TelemetrySensorPanel::TelemetrySensorPanel(QWidget *parent, SensorData & sensor, ui->numLabel->setToolTip(tr("Popup menu available")); ui->numLabel->setMouseTracking(true); connect(ui->numLabel, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(on_customContextMenuRequested(QPoint))); + ui->name->setField(sensor.label, SENSOR_LABEL_LEN); + connect(ui->name, SIGNAL(currentDataChanged()), this, SLOT(on_nameDataChanged())); ui->id->setField(sensor.id, this); ui->instance->setField(sensor.instance, this); ui->type->setModel(panelFilteredItemModels->getItemModel(FIM_SENSORTYPE)); + ui->type->setField(sensor.type); + connect(ui->type, SIGNAL(currentDataChanged(int)), this, SLOT(update())); ui->formula->setModel(panelFilteredItemModels->getItemModel(FIM_SENSORFORMULA)); + ui->formula->setField(sensor.formula); + connect(ui->formula, SIGNAL(currentDataChanged(int)), this, SLOT(on_formulaDataChanged())); ui->unit->setModel(panelFilteredItemModels->getItemModel(FIM_SENSORUNIT)); + ui->unit->setField(sensor.unit); + connect(ui->unit, SIGNAL(currentDataChanged(int)), this, SLOT(on_unitDataChanged())); ui->ratio->setField(sensor.ratio, this); ui->offset->setField(sensor.offset, this); ui->autoOffset->setField(sensor.autoOffset, this); @@ -390,7 +395,9 @@ TelemetrySensorPanel::TelemetrySensorPanel(QWidget *parent, SensorData & sensor, ui->source3->setField(sensor.sources[2], this); ui->source4->setModel(fltmdl); ui->source4->setField(sensor.sources[3], this); - ui->prec->setField(sensor.prec, 0, 2, false, "", this); // TODO replace autoprecisioncombobox with autocombobox and filtereditemmodel + ui->prec->setModel(panelFilteredItemModels->getItemModel(FIM_SENSORPRECISION)); + ui->prec->setField(sensor.prec); + connect(ui->prec, SIGNAL(currentDataChanged(int)), this, SLOT(on_precDataChanged())); lock = false; update(); @@ -403,20 +410,13 @@ TelemetrySensorPanel::~TelemetrySensorPanel() void TelemetrySensorPanel::update() { - // TODO use bit mask - bool isConfigurable = false; - bool gpsFieldsDisplayed = false; - bool cellsFieldsDisplayed = false; - bool consFieldsDisplayed = false; - bool ratioFieldsDisplayed = false; - bool totalizeFieldsDisplayed = false; - bool sources12FieldsDisplayed = false; - bool sources34FieldsDisplayed = false; - lock = true; - ui->name->setText(sensor.label); - ui->type->setCurrentIndex(ui->type->findData(sensor.type)); - ui->unit->setCurrentIndex(ui->unit->findData(sensor.unit)); + int mask = sensor.getMask(); + + ui->name->updateValue(); + ui->type->updateValue(); + ui->formula->updateValue(); + ui->unit->updateValue(); ui->id->updateValue(); ui->instance->updateValue(); ui->ratio->updateValue(); @@ -443,13 +443,6 @@ void TelemetrySensorPanel::update() ui->origin->hide(); ui->formula->show(); ui->formula->setCurrentIndex(ui->formula->findData(sensor.formula)); - isConfigurable = (sensor.formula < SensorData::TELEM_FORMULA_CELL); - gpsFieldsDisplayed = (sensor.formula == SensorData::TELEM_FORMULA_DIST); - cellsFieldsDisplayed = (sensor.formula == SensorData::TELEM_FORMULA_CELL); - 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); ui->source1->updateValue(); ui->source2->updateValue(); ui->source3->updateValue(); @@ -464,121 +457,78 @@ void TelemetrySensorPanel::update() ui->originLabel->setVisible(!origin.isEmpty()); ui->origin->setVisible(!origin.isEmpty()); ui->origin->setText(origin); - ui->formula->hide(); - isConfigurable = sensor.unit < SensorData::UNIT_FIRST_VIRTUAL; - ratioFieldsDisplayed = (sensor.unit < SensorData::UNIT_FIRST_VIRTUAL); - if (sensor.unit == SensorData::UNIT_RPMS) { - if (ui->ratio->decimals()) { - ui->ratio->setDecimals(0); - ui->ratio->setMaximum(30000); - ui->ratio->setMinimum(1); - ui->ratio->setSingleStep(1); - ui->offset->setDecimals(0); - ui->offset->setMaximum(30000); - ui->offset->setMinimum(1); - ui->offset->setSingleStep(1); - } - } - else { - if (!ui->ratio->decimals()) { - ui->ratio->setDecimals(1); - ui->ratio->setMaximum(3000); - ui->ratio->setMinimum(0); - ui->ratio->setSingleStep(0.1); - } - if (ui->offset->decimals() != (int)sensor.prec) { - ui->offset->setDecimals(sensor.prec); - ui->offset->setMaximum(30000.0f / powf(10.0f, sensor.prec)); - ui->offset->setMinimum(-ui->offset->maximum()); - ui->offset->setSingleStep(pow(0.1, sensor.prec)); - } - } + FieldRange rng = sensor.getRatioRange(); + ui->ratio->setDecimals(rng.decimals); + ui->ratio->setMaximum(rng.max); + ui->ratio->setMinimum(rng.min); + ui->ratio->setSingleStep(rng.step); + rng = sensor.getOffsetRange(); + ui->offset->setDecimals(rng.decimals); + ui->offset->setMaximum(rng.max); + ui->offset->setMinimum(rng.min); + ui->offset->setSingleStep(rng.step); } - ui->ratioLabel->setVisible(ratioFieldsDisplayed && sensor.unit != SensorData::UNIT_RPMS); - ui->bladesLabel->setVisible(sensor.unit == SensorData::UNIT_RPMS); - ui->ratio->setVisible(ratioFieldsDisplayed); - 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 && 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 || totalizeFieldsDisplayed); - ui->ampsSensor->setVisible(consFieldsDisplayed || totalizeFieldsDisplayed); - ui->cellsSensorLabel->setVisible(cellsFieldsDisplayed); - ui->cellsSensor->setVisible(cellsFieldsDisplayed); - ui->cellsIndex->setVisible(cellsFieldsDisplayed); - ui->source1->setVisible(sources12FieldsDisplayed); - ui->source2->setVisible(sources12FieldsDisplayed); - ui->source3->setVisible(sources34FieldsDisplayed); - ui->source4->setVisible(sources34FieldsDisplayed); - ui->autoOffset->setVisible(sensor.unit != SensorData::UNIT_RPMS && isConfigurable); - ui->filter->setVisible(isConfigurable); - ui->persistent->setVisible(sensor.type == SensorData::TELEM_TYPE_CALCULATED); + ui->ratioLabel->setVisible(mask & SENSOR_HAS_RATIO && sensor.unit != SensorData::UNIT_RPMS); + ui->bladesLabel->setVisible(mask & SENSOR_HAS_RATIO && sensor.unit == SensorData::UNIT_RPMS); + ui->ratio->setVisible(mask & SENSOR_HAS_RATIO); + + ui->offsetLabel->setVisible(mask & SENSOR_HAS_RATIO && sensor.unit != SensorData::UNIT_RPMS); + ui->multiplierLabel->setVisible(mask & SENSOR_HAS_RATIO && sensor.unit == SensorData::UNIT_RPMS); + ui->offset->setVisible(mask & SENSOR_HAS_RATIO); + + ui->precLabel->setVisible(mask & SENSOR_HAS_PRECISION); + ui->prec->setVisible(mask & SENSOR_HAS_PRECISION); + + ui->unit->setVisible(mask & SENSOR_ISCONFIGURABLE); + + ui->gpsSensorLabel->setVisible(mask & SENSOR_HAS_GPS); + ui->gpsSensor->setVisible(mask & SENSOR_HAS_GPS); + + ui->altSensorLabel->setVisible(mask & SENSOR_HAS_GPS); + ui->altSensor->setVisible(mask & SENSOR_HAS_GPS); + + ui->ampsSensorLabel->setVisible(mask & SENSOR_HAS_CONSUMPTION || mask & SENSOR_HAS_TOTALIZE); + ui->ampsSensor->setVisible(mask & SENSOR_HAS_CONSUMPTION || mask & SENSOR_HAS_TOTALIZE); + + ui->cellsSensorLabel->setVisible(mask & SENSOR_HAS_CELLS); + ui->cellsSensor->setVisible(mask & SENSOR_HAS_CELLS); + ui->cellsIndex->setVisible(mask & SENSOR_HAS_CELLS); + + ui->source1->setVisible(mask & SENSOR_HAS_SOURCES_12); + ui->source2->setVisible(mask & SENSOR_HAS_SOURCES_12); + ui->source3->setVisible(mask & SENSOR_HAS_SOURCES_34); + ui->source4->setVisible(mask & SENSOR_HAS_SOURCES_34); + + ui->autoOffset->setEnabled(mask & SENSOR_HAS_RATIO && sensor.unit != SensorData::UNIT_RPMS); + ui->onlyPositive->setEnabled(mask & SENSOR_HAS_POSITIVE); + ui->filter->setEnabled(mask & SENSOR_ISCONFIGURABLE); + ui->persistent->setEnabled(sensor.type == SensorData::TELEM_TYPE_CALCULATED); lock = false; } -void TelemetrySensorPanel::on_name_editingFinished() +void TelemetrySensorPanel::on_nameDataChanged() { - if (!isLocked() && (sensor.label != ui->name->text().toLatin1())) { - strcpy(sensor.label, ui->name->text().toLatin1()); - emit dataModified(); - } + emit dataModified(); } -void TelemetrySensorPanel::on_type_currentIndexChanged(int index) +void TelemetrySensorPanel::on_formulaDataChanged() { - if (!isLocked()) { - sensor.type = ui->type->itemData(index).toInt(); - update(); - emit modified(); - } + sensor.formulaChanged(); + update(); } -void TelemetrySensorPanel::on_formula_currentIndexChanged(int index) +void TelemetrySensorPanel::on_unitDataChanged() { - if (!isLocked()) { - sensor.formula = ui->formula->itemData(index).toInt(); - if (sensor.formula == SensorData::TELEM_FORMULA_CELL) { - sensor.prec = 2; - sensor.unit = SensorData::UNIT_VOLTS; - } - else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION) { - sensor.prec = 0; - sensor.unit = SensorData::UNIT_MAH; - } - else if (sensor.formula == SensorData::TELEM_FORMULA_DIST) { - sensor.prec = 0; - sensor.unit = SensorData::UNIT_METERS; - } - emit dataModified(); - } + sensor.unitChanged(); + update(); } -void TelemetrySensorPanel::on_unit_currentIndexChanged(int index) +void TelemetrySensorPanel::on_precDataChanged() { - if (!isLocked()) { - sensor.unit = ui->unit->itemData(index).toInt(); - if (sensor.unit == SensorData::UNIT_FAHRENHEIT) { - sensor.prec = 0; - } - update(); - emit modified(); - } -} - -void TelemetrySensorPanel::on_prec_valueChanged() -{ - if (!isLocked()) { - update(); - } + update(); } void TelemetrySensorPanel::on_customContextMenuRequested(QPoint pos) diff --git a/companion/src/modeledit/telemetry.h b/companion/src/modeledit/telemetry.h index 224f88020..2ed0ab2e8 100644 --- a/companion/src/modeledit/telemetry.h +++ b/companion/src/modeledit/telemetry.h @@ -94,11 +94,6 @@ class TelemetrySensorPanel: public ModelPanel void moveDownSensor(int index); protected slots: - void on_name_editingFinished(); - void on_type_currentIndexChanged(int index); - void on_formula_currentIndexChanged(int index); - void on_unit_currentIndexChanged(int index); - void on_prec_valueChanged(); void on_customContextMenuRequested(QPoint pos); bool hasClipboardData(QByteArray * data = nullptr) const; void cmCopy(); @@ -112,6 +107,10 @@ class TelemetrySensorPanel: public ModelPanel void cmMoveDown(); void onItemModelAboutToBeUpdated(); void onItemModelUpdateComplete(); + void on_nameDataChanged(); + void on_formulaDataChanged(); + void on_unitDataChanged(); + void on_precDataChanged(); private: Ui::TelemetrySensor * ui; diff --git a/companion/src/modeledit/telemetry_sensor.ui b/companion/src/modeledit/telemetry_sensor.ui index 12af2cf06..e70cc7aa2 100644 --- a/companion/src/modeledit/telemetry_sensor.ui +++ b/companion/src/modeledit/telemetry_sensor.ui @@ -40,7 +40,7 @@ - + 0 @@ -59,23 +59,13 @@ - + 0 0 - - - Custom - - - - - Calculated - - @@ -147,7 +137,7 @@ - + 0 @@ -175,58 +165,13 @@ - + 0 0 - - - Add - - - - - Average - - - - - Min - - - - - Max - - - - - Multiply - - - - - Totalize - - - - - Cell - - - - - Consumption - - - - - Dist - - @@ -412,138 +357,13 @@ - + 0 0 - - - Raw (-) - - - - - V - - - - - A - - - - - mA - - - - - kt - - - - - m/s - - - - - ft/s - - - - - km/h - - - - - mph - - - - - m - - - - - ft - - - - - °C - - - - - °F - - - - - % - - - - - mAh - - - - - W - - - - - mW - - - - - dBm - - - - - RPM - - - - - g - - - - - ° - - - - - Rad - - - - - mL - - - - - US fl.Oz. - - - - - ml/min - - @@ -560,7 +380,7 @@ - + @@ -720,9 +540,9 @@
autohexspinbox.h
- AutoPrecisionComboBox - QComboBox -
autoprecisioncombobox.h
+ AutoLineEdit + QLineEdit +
autolineedit.h
diff --git a/companion/src/multimodelprinter.cpp b/companion/src/multimodelprinter.cpp index 9686dd944..17cb30be4 100644 --- a/companion/src/multimodelprinter.cpp +++ b/companion/src/multimodelprinter.cpp @@ -836,7 +836,7 @@ QString MultiModelPrinter::printSensors() columns.appendCellStart(20, true); COMPARE(model->sensorData[i].nameToString(i)); columns.appendCellEnd(true); - COMPARECELLWIDTH(model->sensorData[i].isAvailable() ? SensorData::typeToString(model->sensorData[i].type) : "", 15); + COMPARECELLWIDTH(model->sensorData[i].isAvailable() ? model->sensorData[i].typeToString() : "", 15); COMPARECELLWIDTH(model->sensorData[i].paramsToString(model), 65); columns.appendRowEnd(); } diff --git a/companion/src/shared/autocheckbox.h b/companion/src/shared/autocheckbox.h index df99278a2..d65753168 100644 --- a/companion/src/shared/autocheckbox.h +++ b/companion/src/shared/autocheckbox.h @@ -45,6 +45,11 @@ class AutoCheckBox: public QCheckBox updateValue(); } + void setEnabled(bool enabled) + { + QCheckBox::setEnabled(enabled); + } + void updateValue() { lock = true; diff --git a/companion/src/shared/autolineedit.h b/companion/src/shared/autolineedit.h index 36d848972..e8567c803 100644 --- a/companion/src/shared/autolineedit.h +++ b/companion/src/shared/autolineedit.h @@ -71,10 +71,13 @@ class AutoLineEdit: public QLineEdit lock = false; } + signals: + void currentDataChanged(); + protected slots: void onEdited() { - if (lock) + if ((panel && panel->lock) || lock) return; if (field) @@ -86,6 +89,8 @@ class AutoLineEdit: public QLineEdit if (panel) emit panel->modified(); + + emit currentDataChanged(); } protected: From 9a7c7cd303894f512e5c40411a57e9f886daf3c6 Mon Sep 17 00:00:00 2001 From: elecpower Date: Sat, 30 Jan 2021 09:14:02 +1100 Subject: [PATCH 21/52] Another ToString function --- companion/src/firmwares/sensordata.cpp | 23 +++++++++++++++++------ companion/src/firmwares/sensordata.h | 2 ++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/companion/src/firmwares/sensordata.cpp b/companion/src/firmwares/sensordata.cpp index f9660f1db..a87dc6d21 100644 --- a/companion/src/firmwares/sensordata.cpp +++ b/companion/src/firmwares/sensordata.cpp @@ -57,6 +57,11 @@ bool SensorData::isEmpty() const return (!isAvailable() && type == 0 && id == 0 && subid == 0 && instance == 0 && rxIdx == 0 && moduleIdx == 0 && unit == 0 && ratio == 0 && prec == 0 && offset == 0 && autoOffset == 0 && filter == 0 && onlyPositive == 0 && logs == 0); } +QString SensorData::idToString() const +{ + return idToString(id); +} + QString SensorData::typeToString() const { return typeToString(type); @@ -126,16 +131,16 @@ QString SensorData::paramsToString(const ModelData * model) const int mask = getMask(); if (type == TELEM_TYPE_CALCULATED) { - str.append(QString(FMT_LABEL_VALUE).arg(tr("Formula")).arg(formulaToString(formula))); + str.append(QString(FMT_LABEL_VALUE).arg(tr("Formula")).arg(formulaToString())); } else { - str.append(QString(FMT_LABEL_VALUE).arg(tr("Id")).arg(QString::number(id, 16).toUpper())); + str.append(QString(FMT_LABEL_VALUE).arg(tr("Id")).arg(idToString())); str.append(QString(FMT_LABEL_VALUE).arg(tr("Instance")).arg(instance)); } if (mask & SENSOR_HAS_CELLS) { str.append(QString(FMT_LABEL_VALUE).arg(tr("Sensor")).arg(sourceToString(model, source))); - str.append(QString(FMT_VALUE).arg(cellIndexToString(index))); + str.append(QString(FMT_VALUE).arg(cellIndexToString())); } if (mask & SENSOR_HAS_SOURCES_12) { @@ -156,10 +161,10 @@ QString SensorData::paramsToString(const ModelData * model) const } if (mask & SENSOR_ISCONFIGURABLE) - str.append(QString(FMT_LABEL_VALUE).arg(tr("Unit")).arg(unitToString(unit))); + str.append(QString(FMT_LABEL_VALUE).arg(tr("Unit")).arg(unitToString())); if (mask & SENSOR_HAS_PRECISION) - str.append(QString(FMT_LABEL_VALUE).arg(tr("Precision")).arg(precToString(prec))); + str.append(QString(FMT_LABEL_VALUE).arg(tr("Precision")).arg(precToString())); if (mask & SENSOR_HAS_RATIO) { if (unit != UNIT_RPMS) { @@ -170,7 +175,7 @@ QString SensorData::paramsToString(const ModelData * model) const } else { str.append(QString(FMT_LABEL_VALUE).arg(tr("Blades")).arg(ratio)); // TODO refactor to dedicated RPMS field - str.append(QString(FMT_LABEL_VALUE).arg(tr("Multi")).arg(offset)); // TODO refactor to dedicated RPMS field + str.append(QString(FMT_LABEL_VALUE).arg(tr("Multiplier")).arg(offset)); // TODO refactor to dedicated RPMS field } } @@ -252,6 +257,12 @@ void SensorData::unitChanged() prec = 0; } +// static +QString SensorData::idToString(const int value) +{ + return QString::number(value, 16).toUpper(); +} + // static QString SensorData::typeToString(const int value) { diff --git a/companion/src/firmwares/sensordata.h b/companion/src/firmwares/sensordata.h index 0a24cd301..5870d9649 100644 --- a/companion/src/firmwares/sensordata.h +++ b/companion/src/firmwares/sensordata.h @@ -185,6 +185,7 @@ class SensorData { QString getOrigin(const ModelData* model) const; void clear() { memset(this, 0, sizeof(SensorData)); } bool isEmpty() const; + QString idToString() const; QString typeToString() const; QString formulaToString() const; QString cellIndexToString() const; @@ -199,6 +200,7 @@ class SensorData { static QString sourceToString(const ModelData * model, const int index, const bool sign = false); static bool isSourceAvailable(const ModelData * model, const int index); + static QString idToString(const int value); static QString typeToString(const int value); static QString formulaToString(const int value); static QString cellIndexToString(const int value); From c35301ec053921fbd86d6c09cc00924f5db2e9ef Mon Sep 17 00:00:00 2001 From: elecpower Date: Sun, 31 Jan 2021 07:11:53 +1100 Subject: [PATCH 22/52] Modernise header guards --- companion/src/firmwares/helpersdata.h | 5 +---- companion/src/firmwares/sensordata.h | 5 +---- companion/src/modeledit/telemetry.h | 5 +---- companion/src/modelprinter.h | 5 +---- companion/src/shared/autobitsetcheckbox.h | 5 +---- companion/src/shared/autocheckbox.h | 5 +---- companion/src/shared/autocombobox.h | 5 +---- companion/src/shared/autodoublespinbox.h | 5 +---- companion/src/shared/autohexspinbox.h | 5 +---- companion/src/shared/autolineedit.h | 5 +---- companion/src/shared/autoprecisioncombobox.h | 5 +---- companion/src/shared/genericpanel.h | 5 +---- companion/src/shared/hexspinbox.h | 5 +---- companion/src/shared/verticalscrollarea.h | 6 +----- 14 files changed, 14 insertions(+), 57 deletions(-) diff --git a/companion/src/firmwares/helpersdata.h b/companion/src/firmwares/helpersdata.h index 850bcb8a7..29273e5f0 100644 --- a/companion/src/firmwares/helpersdata.h +++ b/companion/src/firmwares/helpersdata.h @@ -18,8 +18,7 @@ * GNU General Public License for more details. */ -#ifndef _HELPERS_DATA_H_ -#define _HELPERS_DATA_H_ +#pragma once #include @@ -49,5 +48,3 @@ class FieldRange QString prefix; QString unit; }; - -#endif // _HELPERS_DATA_H_ diff --git a/companion/src/firmwares/sensordata.h b/companion/src/firmwares/sensordata.h index 5870d9649..5e888d749 100644 --- a/companion/src/firmwares/sensordata.h +++ b/companion/src/firmwares/sensordata.h @@ -18,8 +18,7 @@ * GNU General Public License for more details. */ -#ifndef SENSORDATA_H -#define SENSORDATA_H +#pragma once #include "helpersdata.h" @@ -214,5 +213,3 @@ class SensorData { static AbstractStaticItemModel * unitItemModel(); static PrecisionItemModel * precisionItemModel(); }; - -#endif // SENSORDATA_H diff --git a/companion/src/modeledit/telemetry.h b/companion/src/modeledit/telemetry.h index 2ed0ab2e8..3f04bebf6 100644 --- a/companion/src/modeledit/telemetry.h +++ b/companion/src/modeledit/telemetry.h @@ -18,8 +18,7 @@ * GNU General Public License for more details. */ -#ifndef _TELEMETRY_H_ -#define _TELEMETRY_H_ +#pragma once #include "modeledit.h" #include "eeprominterface.h" @@ -180,5 +179,3 @@ class TelemetryPanel : public ModelPanel void connectItemModelEvents(const int id); inline bool isLocked() { return lock; } }; - -#endif // _TELEMETRY_H_ diff --git a/companion/src/modelprinter.h b/companion/src/modelprinter.h index 639eddb0e..ea2eab2d8 100644 --- a/companion/src/modelprinter.h +++ b/companion/src/modelprinter.h @@ -18,8 +18,7 @@ * GNU General Public License for more details. */ -#ifndef _MODELPRINTER_H_ -#define _MODELPRINTER_H_ +#pragma once #include #include @@ -132,5 +131,3 @@ class ModelPrinter: public QObject const ModelData & model; }; - -#endif // _MODELPRINTER_H_ diff --git a/companion/src/shared/autobitsetcheckbox.h b/companion/src/shared/autobitsetcheckbox.h index 6274e0117..ea86db956 100644 --- a/companion/src/shared/autobitsetcheckbox.h +++ b/companion/src/shared/autobitsetcheckbox.h @@ -18,8 +18,7 @@ * GNU General Public License for more details. */ -#ifndef AUTOBITSETCHECKBOX_H -#define AUTOBITSETCHECKBOX_H +#pragma once #include #include "genericpanel.h" @@ -174,5 +173,3 @@ class AutoBitsetCheckBox: public QCheckBox bool m_lock = false; GenericPanel * m_panel = nullptr; }; - -#endif // AUTOBITSETCHECKBOX_H diff --git a/companion/src/shared/autocheckbox.h b/companion/src/shared/autocheckbox.h index d65753168..f5b233fed 100644 --- a/companion/src/shared/autocheckbox.h +++ b/companion/src/shared/autocheckbox.h @@ -18,8 +18,7 @@ * GNU General Public License for more details. */ -#ifndef _AUTOCHECKBOX_H_ -#define _AUTOCHECKBOX_H_ +#pragma once #include #include "modeledit/modeledit.h" @@ -75,5 +74,3 @@ class AutoCheckBox: public QCheckBox ModelPanel * panel; bool lock; }; - -#endif // _AUTOCHECKBOX_H_ diff --git a/companion/src/shared/autocombobox.h b/companion/src/shared/autocombobox.h index 158352f97..784abaefa 100644 --- a/companion/src/shared/autocombobox.h +++ b/companion/src/shared/autocombobox.h @@ -18,8 +18,7 @@ * GNU General Public License for more details. */ -#ifndef _AUTOCOMBOBOX_H_ -#define _AUTOCOMBOBOX_H_ +#pragma once #include #include "genericpanel.h" @@ -137,5 +136,3 @@ class AutoComboBox: public QComboBox bool lock = false; bool hasModel = false; }; - -#endif // _AUTOCOMBOBOX_H_ diff --git a/companion/src/shared/autodoublespinbox.h b/companion/src/shared/autodoublespinbox.h index 17188243b..6560b6ea2 100644 --- a/companion/src/shared/autodoublespinbox.h +++ b/companion/src/shared/autodoublespinbox.h @@ -18,8 +18,7 @@ * GNU General Public License for more details. */ -#ifndef _AUTODOUBLESPINBOX_H_ -#define _AUTODOUBLESPINBOX_H_ +#pragma once #include #include "modeledit/modeledit.h" @@ -97,5 +96,3 @@ class AutoDoubleSpinBox: public QDoubleSpinBox ModelPanel * panel; bool lock; }; - -#endif // _AUTODOUBLESPINBOX_H_ diff --git a/companion/src/shared/autohexspinbox.h b/companion/src/shared/autohexspinbox.h index 7db76d2a3..d7df46bd6 100644 --- a/companion/src/shared/autohexspinbox.h +++ b/companion/src/shared/autohexspinbox.h @@ -18,8 +18,7 @@ * GNU General Public License for more details. */ -#ifndef _AUTOHEXSPINBOX_H_ -#define _AUTOHEXSPINBOX_H_ +#pragma once #include "hexspinbox.h" #include "modeledit/modeledit.h" @@ -68,5 +67,3 @@ class AutoHexSpinBox: public HexSpinBox ModelPanel * panel; bool lock; }; - -#endif // _AUTOHEXSPINBOX_H_ diff --git a/companion/src/shared/autolineedit.h b/companion/src/shared/autolineedit.h index e8567c803..0f888e6df 100644 --- a/companion/src/shared/autolineedit.h +++ b/companion/src/shared/autolineedit.h @@ -18,8 +18,7 @@ * GNU General Public License for more details. */ -#ifndef _AUTOLINEEDIT_H_ -#define _AUTOLINEEDIT_H_ +#pragma once #include #include @@ -99,5 +98,3 @@ class AutoLineEdit: public QLineEdit GenericPanel * panel; bool lock; }; - -#endif // _AUTOLINEEDIT_H_ diff --git a/companion/src/shared/autoprecisioncombobox.h b/companion/src/shared/autoprecisioncombobox.h index 4e143f286..e93059199 100644 --- a/companion/src/shared/autoprecisioncombobox.h +++ b/companion/src/shared/autoprecisioncombobox.h @@ -18,8 +18,7 @@ * GNU General Public License for more details. */ -#ifndef _AUTOPRECISIONCOMBOBOX_H_ -#define _AUTOPRECISIONCOMBOBOX_H_ +#pragma once #include "genericpanel.h" @@ -253,5 +252,3 @@ class AutoPrecisionComboBox: public QComboBox QString m_suffix = ""; bool m_lock = false; }; - -#endif // _AUTOPRECISIONCOMBOBOX_H_ diff --git a/companion/src/shared/genericpanel.h b/companion/src/shared/genericpanel.h index 5351355b6..bbb9b7254 100644 --- a/companion/src/shared/genericpanel.h +++ b/companion/src/shared/genericpanel.h @@ -18,8 +18,7 @@ * GNU General Public License for more details. */ -#ifndef _GENERICPANEL_H_ -#define _GENERICPANEL_H_ +#pragma once #include @@ -65,5 +64,3 @@ class GenericPanel : public QWidget void setFocusFilter(QWidget * w); void disableMouseScrolling(); }; - -#endif // _GENERICPANEL_H_ diff --git a/companion/src/shared/hexspinbox.h b/companion/src/shared/hexspinbox.h index fc404d98a..204cc8a55 100644 --- a/companion/src/shared/hexspinbox.h +++ b/companion/src/shared/hexspinbox.h @@ -18,8 +18,7 @@ * GNU General Public License for more details. */ -#ifndef _HEXSPINBOX_H_ -#define _HEXSPINBOX_H_ +#pragma once #include @@ -40,5 +39,3 @@ class HexSpinBox : public QSpinBox private: QRegExpValidator *validator; }; - -#endif // _HEXSPINBOX_H_ diff --git a/companion/src/shared/verticalscrollarea.h b/companion/src/shared/verticalscrollarea.h index 36f564dd7..d409a18ca 100644 --- a/companion/src/shared/verticalscrollarea.h +++ b/companion/src/shared/verticalscrollarea.h @@ -18,8 +18,7 @@ * GNU General Public License for more details. */ -#ifndef _VERTICALSCROLLAREA_H_ -#define _VERTICALSCROLLAREA_H_ +#pragma once #include @@ -36,6 +35,3 @@ class VerticalScrollArea : public QScrollArea private: GenericPanel * panel; }; - -#endif // _VERTICALSCROLLAREA_H_ - From 138b4fd49e56128a0fa29b9bbe02782391613a69 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sun, 31 Jan 2021 21:12:03 +0100 Subject: [PATCH 23/52] Update CREDITS.txt --- CREDITS.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CREDITS.txt b/CREDITS.txt index a47100b3b..06466819f 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2120,3 +2120,5 @@ Lukas Kana Peter Newman Kevin Cave Arold Reinders +Jason Plant +John Beech From c084a4a3c19d9b60277cfff763f29d407c245fa7 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sun, 31 Jan 2021 21:12:53 +0100 Subject: [PATCH 24/52] Update CREDITS.txt --- CREDITS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.txt b/CREDITS.txt index 06466819f..0165efcf4 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2122,3 +2122,4 @@ Kevin Cave Arold Reinders Jason Plant John Beech +Ian Parris From e0a5f268291572581612cb42955f96175cedffc3 Mon Sep 17 00:00:00 2001 From: elecpower Date: Mon, 1 Feb 2021 08:04:02 +1100 Subject: [PATCH 25/52] Stop compile warnings --- companion/src/firmwares/boards.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/companion/src/firmwares/boards.cpp b/companion/src/firmwares/boards.cpp index cfeabc918..a201d50ed 100644 --- a/companion/src/firmwares/boards.cpp +++ b/companion/src/firmwares/boards.cpp @@ -91,11 +91,9 @@ uint32_t Boards::getFourCC(Type board) return 0x4178746F; case BOARD_RADIOMASTER_T8: return 0x4378746F; - case BOARD_UNKNOWN: - break; + default: + return 0; } - - return 0; } int Boards::getEEpromSize(Board::Type board) @@ -130,9 +128,9 @@ int Boards::getEEpromSize(Board::Type board) case BOARD_JUMPER_T18: case BOARD_RADIOMASTER_TX16S: return 0; + default: + return 0; } - - return 0; } int Boards::getFlashSize(Type board) From 2aeb5f7ae6c5a0b24dc944b94b42f3ced6b03fa5 Mon Sep 17 00:00:00 2001 From: 3djc Date: Mon, 1 Feb 2021 08:49:21 +0100 Subject: [PATCH 26/52] Ensure module are on after model change --- radio/src/pulses/pulses.cpp | 8 ++++++++ radio/src/pulses/pulses.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/radio/src/pulses/pulses.cpp b/radio/src/pulses/pulses.cpp index ed56f8b61..7f0650afa 100755 --- a/radio/src/pulses/pulses.cpp +++ b/radio/src/pulses/pulses.cpp @@ -484,6 +484,10 @@ bool setupPulsesInternalModule() { uint8_t protocol = getRequiredProtocol(INTERNAL_MODULE); + if(protocol != PROTOCOL_CHANNELS_NONE) { + INTERNAL_MODULE_ON(); + } + heartbeat |= (HEART_TIMER_PULSES << INTERNAL_MODULE); if (moduleState[INTERNAL_MODULE].protocol != protocol) { @@ -502,6 +506,10 @@ bool setupPulsesExternalModule() { uint8_t protocol = getRequiredProtocol(EXTERNAL_MODULE); + if(protocol != PROTOCOL_CHANNELS_NONE) { + EXTERNAL_MODULE_ON(); + } + heartbeat |= (HEART_TIMER_PULSES << EXTERNAL_MODULE); if (moduleState[EXTERNAL_MODULE].protocol != protocol) { diff --git a/radio/src/pulses/pulses.h b/radio/src/pulses/pulses.h index 84ecee015..6f37f2a60 100644 --- a/radio/src/pulses/pulses.h +++ b/radio/src/pulses/pulses.h @@ -353,7 +353,9 @@ inline void startPulses() setupPulsesInternalModule(); #endif +#if defined(HARDWARE_EXTERNAL_MODULE) setupPulsesExternalModule(); +#endif #if defined(HARDWARE_EXTRA_MODULE) extramodulePpmStart(); From 6c819382b4432a2d2c88dc1c420b62c9df0f370c Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 2 Feb 2021 14:10:34 +0100 Subject: [PATCH 27/52] Update CREDITS.txt --- CREDITS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.txt b/CREDITS.txt index 0165efcf4..8d9a23ddb 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2123,3 +2123,4 @@ Arold Reinders Jason Plant John Beech Ian Parris +Danny Music From 1067d642f39780bbf7ebe645a092df7d026c7a3c Mon Sep 17 00:00:00 2001 From: 3djc Date: Tue, 2 Feb 2021 16:19:17 +0100 Subject: [PATCH 28/52] Cosmetics --- radio/src/gui/128x64/model_setup.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/radio/src/gui/128x64/model_setup.cpp b/radio/src/gui/128x64/model_setup.cpp index b2c39b63b..46b92919b 100644 --- a/radio/src/gui/128x64/model_setup.cpp +++ b/radio/src/gui/128x64/model_setup.cpp @@ -236,7 +236,7 @@ inline uint8_t MODULE_SUBTYPE_ROWS(int moduleIdx) } #define POT_WARN_ROWS ((g_model.potsWarnMode) ? (uint8_t)(NUM_POTS+NUM_SLIDERS) : (uint8_t)0) -#define TIMER_ROWS(x) 2, 0, 0, 0, g_model.timers[x].countdownBeep != COUNTDOWN_SILENT ? (uint8_t) 1 : (uint8_t)0 +#define TIMER_ROWS(x) 2, 0, 0, 0, g_model.timers[x].countdownBeep != COUNTDOWN_SILENT ? (uint8_t)1 : (uint8_t)0 #define TIMERS_ROWS TIMER_ROWS(0), TIMER_ROWS(1), TIMER_ROWS(2) #if defined(PCBSKY9X) @@ -316,7 +316,7 @@ void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event) lcdDrawNumber(MODEL_SETUP_2ND_COLUMN + 6 * FW, y, TIMER_COUNTDOWN_START(timerIdx), (menuHorizontalPosition == 1 ? attr : 0) | LEFT); lcdDrawChar(lcdLastRightPos, y, 's'); } - if (attr && s_editMode>0) { + if (attr && s_editMode > 0) { switch (menuHorizontalPosition) { case 0: CHECK_INCDEC_MODELVAR(event, timer.countdownBeep, COUNTDOWN_SILENT, COUNTDOWN_COUNT - 1); @@ -509,7 +509,7 @@ void menuModelSetup(event_t event) } uint8_t moduleIdx = CURRENT_MODULE_EDITED(k); - LcdFlags blink = ((s_editMode>0) ? BLINK|INVERS : INVERS); + LcdFlags blink = ((s_editMode > 0) ? BLINK|INVERS : INVERS); LcdFlags attr = (sub == k ? blink : 0); switch (k) { @@ -540,7 +540,7 @@ void menuModelSetup(event_t event) timerMode += TMRMODE_COUNT-1; timer->mode = timerMode; #if defined(AUTOSWITCH) - if (s_editMode>0) { + if (s_editMode > 0) { int8_t val = timer->mode - (TMRMODE_COUNT-1); int8_t switchVal = checkIncDecMovedSwitch(val); if (val != switchVal) { From 0970b44e8a83d1aac7198a43ae0cbd5ec3f49af5 Mon Sep 17 00:00:00 2001 From: 3djc Date: Tue, 2 Feb 2021 16:21:14 +0100 Subject: [PATCH 29/52] Cosmetics --- radio/src/gui/128x64/model_setup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/gui/128x64/model_setup.cpp b/radio/src/gui/128x64/model_setup.cpp index 46b92919b..6208ad218 100644 --- a/radio/src/gui/128x64/model_setup.cpp +++ b/radio/src/gui/128x64/model_setup.cpp @@ -311,7 +311,7 @@ void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event) { TimerData & timer = g_model.timers[timerIdx]; lcdDrawTextAlignedLeft(y, STR_BEEPCOUNTDOWN); - lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VBEEPCOUNTDOWN, timer.countdownBeep, (menuHorizontalPosition==0 ? attr : 0)); + lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VBEEPCOUNTDOWN, timer.countdownBeep, (menuHorizontalPosition == 0 ? attr : 0)); if (timer.countdownBeep != COUNTDOWN_SILENT) { lcdDrawNumber(MODEL_SETUP_2ND_COLUMN + 6 * FW, y, TIMER_COUNTDOWN_START(timerIdx), (menuHorizontalPosition == 1 ? attr : 0) | LEFT); lcdDrawChar(lcdLastRightPos, y, 's'); From a11198bc7282114b7a1be8ebe365f67d8f593145 Mon Sep 17 00:00:00 2001 From: 3djc Date: Wed, 3 Feb 2021 08:26:09 +0100 Subject: [PATCH 30/52] Fix compilation --- radio/src/gui/128x64/model_setup.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/radio/src/gui/128x64/model_setup.cpp b/radio/src/gui/128x64/model_setup.cpp index 6208ad218..33a3d1c36 100644 --- a/radio/src/gui/128x64/model_setup.cpp +++ b/radio/src/gui/128x64/model_setup.cpp @@ -428,9 +428,7 @@ void menuModelSetup(event_t event) MENU_TAB({ HEADER_LINE_COLUMNS 0, - TIMER_ROWS, - TIMER_ROWS, - TIMER_ROWS, + TIMERS_ROWS, 0, // Extended limits 1, // Extended trims 0, // Show trims From a2b591face8c3a5077e71116fafb8236d421196b Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 3 Feb 2021 08:31:43 +0100 Subject: [PATCH 31/52] Update CREDITS.txt --- CREDITS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.txt b/CREDITS.txt index 8d9a23ddb..5231f9615 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2124,3 +2124,4 @@ Jason Plant John Beech Ian Parris Danny Music +Eric Bissonnette From f1e957e466eb5c771f6f3fd6aa3d8c43098cfda0 Mon Sep 17 00:00:00 2001 From: 3djc Date: Wed, 3 Feb 2021 10:42:04 +0100 Subject: [PATCH 32/52] Improve --- radio/src/pulses/pulses.cpp | 20 ++++++++++++-------- radio/src/pulses/pulses.h | 4 ++++ radio/src/storage/storage_common.cpp | 8 ++++---- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/radio/src/pulses/pulses.cpp b/radio/src/pulses/pulses.cpp index 7f0650afa..94fb99d52 100755 --- a/radio/src/pulses/pulses.cpp +++ b/radio/src/pulses/pulses.cpp @@ -480,14 +480,16 @@ bool setupPulsesInternalModule(uint8_t protocol) } } +void stopPulsesInternalModule() +{ + intmoduleStop(); + moduleState[INTERNAL_MODULE].protocol = PROTOCOL_CHANNELS_NONE; +} + bool setupPulsesInternalModule() { uint8_t protocol = getRequiredProtocol(INTERNAL_MODULE); - if(protocol != PROTOCOL_CHANNELS_NONE) { - INTERNAL_MODULE_ON(); - } - heartbeat |= (HEART_TIMER_PULSES << INTERNAL_MODULE); if (moduleState[INTERNAL_MODULE].protocol != protocol) { @@ -502,14 +504,16 @@ bool setupPulsesInternalModule() } #endif +void stopPulsesExternalModule() +{ + extmoduleStop(); + moduleState[EXTERNAL_MODULE].protocol = PROTOCOL_CHANNELS_NONE; +} + bool setupPulsesExternalModule() { uint8_t protocol = getRequiredProtocol(EXTERNAL_MODULE); - if(protocol != PROTOCOL_CHANNELS_NONE) { - EXTERNAL_MODULE_ON(); - } - heartbeat |= (HEART_TIMER_PULSES << EXTERNAL_MODULE); if (moduleState[EXTERNAL_MODULE].protocol != protocol) { diff --git a/radio/src/pulses/pulses.h b/radio/src/pulses/pulses.h index 6f37f2a60..c08f8bb88 100644 --- a/radio/src/pulses/pulses.h +++ b/radio/src/pulses/pulses.h @@ -315,8 +315,12 @@ extern TrainerPulsesData trainerPulsesData; #if defined(HARDWARE_INTERNAL_MODULE) bool setupPulsesInternalModule(); +void stopPulsesInternalModule(); #endif +#if defined(HARDWARE_EXTERNAL_MODULE) bool setupPulsesExternalModule(); +void stopPulsesExternalModule(); +#endif void setupPulsesDSM2(); void setupPulsesCrossfire(); void setupPulsesGhost(); diff --git a/radio/src/storage/storage_common.cpp b/radio/src/storage/storage_common.cpp index 40bac6a67..857cdd1a6 100644 --- a/radio/src/storage/storage_common.cpp +++ b/radio/src/storage/storage_common.cpp @@ -53,11 +53,11 @@ void preModelLoad() } pauseMixerCalculations(); -#if defined(INTMODULE_PWR_GPIO) - INTERNAL_MODULE_OFF(); +#if defined(HARDWARE_INTERNAL_MODULE) + stopPulsesInternalModule(); #endif -#if defined(EXTMODULE_PWR_GPIO) - EXTERNAL_MODULE_OFF(); +#if defined(HARDWARE_EXTERNAL_MODULE) + stopPulsesExternalModule(); #endif stopTrainer(); From f7d17b715c2a4fb2c5eb1e1863b6aba7a1898192 Mon Sep 17 00:00:00 2001 From: 3djc Date: Wed, 3 Feb 2021 12:00:48 +0100 Subject: [PATCH 33/52] Please Travis --- radio/src/storage/storage_common.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/radio/src/storage/storage_common.cpp b/radio/src/storage/storage_common.cpp index 857cdd1a6..6edf79834 100644 --- a/radio/src/storage/storage_common.cpp +++ b/radio/src/storage/storage_common.cpp @@ -53,11 +53,13 @@ void preModelLoad() } pauseMixerCalculations(); +#if !defined(SIMU) #if defined(HARDWARE_INTERNAL_MODULE) stopPulsesInternalModule(); #endif #if defined(HARDWARE_EXTERNAL_MODULE) stopPulsesExternalModule(); +#endif #endif stopTrainer(); From 00cf3f87580ff2eb643c90cfc74550a8117b9654 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 3 Feb 2021 22:06:22 +0100 Subject: [PATCH 34/52] Update CREDITS.txt --- CREDITS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.txt b/CREDITS.txt index 5231f9615..384f48bbd 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2125,3 +2125,4 @@ John Beech Ian Parris Danny Music Eric Bissonnette +Riso LTD From 963d7455b721ab90047919ec0f193a8aa415ccc6 Mon Sep 17 00:00:00 2001 From: elecpower Date: Fri, 5 Feb 2021 16:50:02 +1100 Subject: [PATCH 35/52] Fix source filters for inputs and mixes --- companion/src/modeledit/expodialog.cpp | 2 +- companion/src/modeledit/mixerdialog.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/companion/src/modeledit/expodialog.cpp b/companion/src/modeledit/expodialog.cpp index 808cff7ba..abede1d73 100644 --- a/companion/src/modeledit/expodialog.cpp +++ b/companion/src/modeledit/expodialog.cpp @@ -92,7 +92,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G if (firmware->getCapability(VirtualInputs)) { ui->inputName->setMaxLength(firmware->getCapability(InputsLength)); id = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource), - (RawSource::InputSourceGroups & ~ RawSource::NoneGroup & ~RawSource::InputsGroup)), + (RawSource::InputSourceGroups & ~RawSource::NoneGroup & ~RawSource::InputsGroup) | RawSource::TelemGroup), "RawSource"); ui->sourceCB->setModel(dialogFilteredItemModels->getItemModel(id)); ui->sourceCB->setCurrentIndex(ui->sourceCB->findData(ed->srcRaw.toValue())); diff --git a/companion/src/modeledit/mixerdialog.cpp b/companion/src/modeledit/mixerdialog.cpp index 67b01f8f6..645a25274 100644 --- a/companion/src/modeledit/mixerdialog.cpp +++ b/companion/src/modeledit/mixerdialog.cpp @@ -49,7 +49,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData * mixdata, this->setWindowTitle(tr("DEST -> %1").arg(RawSource(SOURCE_TYPE_CH, md->destCh - 1).toString(&model, &generalSettings))); id = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource), - ((RawSource::InputSourceGroups | RawSource::ScriptsGroup) & ~ RawSource::NoneGroup)), + (RawSource::InputSourceGroups & ~RawSource::NoneGroup) | RawSource::ScriptsGroup), "RawSource"); ui->sourceCB->setModel(dialogFilteredItemModels->getItemModel(id)); ui->sourceCB->setCurrentIndex(ui->sourceCB->findData(md->srcRaw.toValue())); From b78b45723444d931315323835348ce1b7fe15fa9 Mon Sep 17 00:00:00 2001 From: 3djc Date: Fri, 5 Feb 2021 13:17:54 +0100 Subject: [PATCH 36/52] Please Travis --- radio/src/pulses/pulses.cpp | 4 +++- radio/src/storage/storage_common.cpp | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/radio/src/pulses/pulses.cpp b/radio/src/pulses/pulses.cpp index 94fb99d52..f6651ce4f 100755 --- a/radio/src/pulses/pulses.cpp +++ b/radio/src/pulses/pulses.cpp @@ -483,7 +483,9 @@ bool setupPulsesInternalModule(uint8_t protocol) void stopPulsesInternalModule() { intmoduleStop(); - moduleState[INTERNAL_MODULE].protocol = PROTOCOL_CHANNELS_NONE; + if (pulsesStarted()) { + moduleState[INTERNAL_MODULE].protocol = PROTOCOL_CHANNELS_NONE; + } } bool setupPulsesInternalModule() diff --git a/radio/src/storage/storage_common.cpp b/radio/src/storage/storage_common.cpp index 6edf79834..857cdd1a6 100644 --- a/radio/src/storage/storage_common.cpp +++ b/radio/src/storage/storage_common.cpp @@ -53,13 +53,11 @@ void preModelLoad() } pauseMixerCalculations(); -#if !defined(SIMU) #if defined(HARDWARE_INTERNAL_MODULE) stopPulsesInternalModule(); #endif #if defined(HARDWARE_EXTERNAL_MODULE) stopPulsesExternalModule(); -#endif #endif stopTrainer(); From b9b5ee8a9d70f703e81ae7a632163117332bc884 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 6 Feb 2021 14:58:34 +0100 Subject: [PATCH 37/52] Add switch I X9D+2019 --- radio/src/lua/CMakeLists.txt | 1 + radio/src/lua/api_general.cpp | 2 ++ radio/src/targets/taranis/CMakeLists.txt | 1 + 3 files changed, 4 insertions(+) diff --git a/radio/src/lua/CMakeLists.txt b/radio/src/lua/CMakeLists.txt index 138c8b60a..589b5d1c1 100644 --- a/radio/src/lua/CMakeLists.txt +++ b/radio/src/lua/CMakeLists.txt @@ -24,6 +24,7 @@ if(PYTHONINTERP_FOUND) add_lua_export_target(xlite ${LUA_INCLUDES} -DPCBTARANIS -DPCBXLITE) add_lua_export_target(xlites ${LUA_INCLUDES} -DPCBTARANIS -DPCBXLITES -DPCBXLITE -DGYRO) add_lua_export_target(x9d ${LUA_INCLUDES} -DPCBTARANIS -DPCBX9D -DPCBX9) + add_lua_export_target(x9d+2019 ${LUA_INCLUDES} -DPCBTARANIS -DPCBX9D -DPCBX9 -DRADIO_X9DP2019) add_lua_export_target(x9e ${LUA_INCLUDES} -DPCBTARANIS -DPCBX9E -DPCBX9) add_lua_export_target(x10 ${LUA_INCLUDES} -DPCBHORUS -DPCBX10) add_lua_export_target(x12s ${LUA_INCLUDES} -DPCBHORUS -DPCBX12S) diff --git a/radio/src/lua/api_general.cpp b/radio/src/lua/api_general.cpp index 18b8c0fb8..b205b1c70 100644 --- a/radio/src/lua/api_general.cpp +++ b/radio/src/lua/api_general.cpp @@ -54,6 +54,8 @@ #include "lua/lua_exports_xlites.inc" #elif defined(PCBXLITE) #include "lua/lua_exports_xlite.inc" +#elif defined(RADIO_X9DP2019) + #include "lua/lua_exports_x9d+2019.inc" #elif defined(PCBTARANIS) #include "lua/lua_exports_x9d.inc" #endif diff --git a/radio/src/targets/taranis/CMakeLists.txt b/radio/src/targets/taranis/CMakeLists.txt index 54779f137..f399ae550 100644 --- a/radio/src/targets/taranis/CMakeLists.txt +++ b/radio/src/targets/taranis/CMakeLists.txt @@ -63,6 +63,7 @@ elseif(PCB STREQUAL X9D+) option(INTERNAL_MODULE_PXX1 "Support for PXX1 internal module" OFF) option(INTERNAL_MODULE_PXX2 "Support for PXX2 internal module" ON) set(FLAVOUR x9d+2019) + set(LUA_EXPORT lua_export_x9d+2019) set(CPU_TYPE STM32F4) set(CPU_TYPE_FULL STM32F407xE) # for size report set(LINKER_SCRIPT targets/taranis/stm32f4_flash.ld) From 02e91afff2f96ae171d3c9857488b8f1e0dcb3b7 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 8 Feb 2021 16:07:49 +0100 Subject: [PATCH 38/52] Fix model menu 9x --- radio/src/gui/128x64/model_setup.cpp | 33 ++++++++-------------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/radio/src/gui/128x64/model_setup.cpp b/radio/src/gui/128x64/model_setup.cpp index 33a3d1c36..10baf8724 100644 --- a/radio/src/gui/128x64/model_setup.cpp +++ b/radio/src/gui/128x64/model_setup.cpp @@ -129,9 +129,6 @@ enum MenuModelSetupItems { ITEM_MODEL_SETUP_EXTERNAL_MODULE_CHANNELS, ITEM_MODEL_SETUP_EXTERNAL_MODULE_NOT_ACCESS_RXNUM_BIND_RANGE, ITEM_MODEL_SETUP_EXTERNAL_MODULE_PXX2_MODEL_NUM, -#if defined(PCBSKY9X) && defined(REVX) - ITEM_MODEL_SETUP_EXTERNAL_MODULE_OUTPUT_TYPE, -#endif #if defined(AFHDS3) ITEM_MODEL_SETUP_EXTERNAL_MODULE_AFHDS3_RX_FREQ, ITEM_MODEL_SETUP_EXTERNAL_MODULE_AFHDS3_ACTUAL_POWER, @@ -151,6 +148,9 @@ enum MenuModelSetupItems { ITEM_MODEL_SETUP_EXTERNAL_MODULE_PXX2_RECEIVER_2, ITEM_MODEL_SETUP_EXTERNAL_MODULE_PXX2_RECEIVER_3, +#if defined(PCBSKY9X) && defined(REVX) + ITEM_MODEL_SETUP_EXTERNAL_MODULE_OUTPUT_TYPE, +#endif #if defined(PCBSKY9X) ITEM_MODEL_SETUP_EXTRA_MODULE_LABEL, ITEM_MODEL_SETUP_EXTRA_MODULE_CHANNELS, @@ -443,30 +443,15 @@ void menuModelSetup(event_t event) 0, // Throttle warning NUM_SWITCHES-1, // Switch warning - NUM_STICKS+NUM_POTS+NUM_SLIDERS-1, // Center beeps + NUM_STICKS + NUM_POTS + NUM_SLIDERS - 1, // Center beeps 0, // Global functions - LABEL(ExternalModule), - MODULE_TYPE_ROWS(EXTERNAL_MODULE), - MULTIMODULE_TYPE_ROWS(EXTERNAL_MODULE) - MULTIMODULE_SUBTYPE_ROWS(EXTERNAL_MODULE) - MULTIMODULE_STATUS_ROWS(EXTERNAL_MODULE) - - MODULE_CHANNELS_ROWS(EXTERNAL_MODULE), - IF_NOT_ACCESS_MODULE_RF(EXTERNAL_MODULE, MODULE_BIND_ROWS(EXTERNAL_MODULE)), // line reused for PPM: PPM settings - IF_ACCESS_MODULE_RF(EXTERNAL_MODULE, 0), // RxNum - 0, // Output type (OpenDrain / PushPull) - MODULE_POWER_ROW(EXTERNAL_MODULE), - IF_NOT_PXX2_MODULE(EXTERNAL_MODULE, MODULE_OPTION_ROW(EXTERNAL_MODULE)), - MULTIMODULE_MODULE_ROWS(EXTERNAL_MODULE) - FAILSAFE_ROWS(EXTERNAL_MODULE), - IF_ACCESS_MODULE_RF(EXTERNAL_MODULE, 1), // Range check and Register buttons - IF_PXX2_MODULE(EXTERNAL_MODULE, 0), // Module options - IF_ACCESS_MODULE_RF(EXTERNAL_MODULE, 0), // Receiver 1 - IF_ACCESS_MODULE_RF(EXTERNAL_MODULE, 0), // Receiver 2 - IF_ACCESS_MODULE_RF(EXTERNAL_MODULE, 0), // Receiver 3 - + EXTERNAL_MODULE_ROWS +#if defined(PCBSKY9X) && defined(REVX) + 0, // Output type (OpenDrain / PushPull) +#endif EXTRA_MODULE_ROWS + TRAINER_ROWS }); #endif From c88999827f47850a2d9d93b0b74c10def213d4b6 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 8 Feb 2021 21:33:55 +0100 Subject: [PATCH 39/52] Compilation fix --- radio/src/gui/128x64/model_setup.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/radio/src/gui/128x64/model_setup.cpp b/radio/src/gui/128x64/model_setup.cpp index 10baf8724..0b9cf9868 100644 --- a/radio/src/gui/128x64/model_setup.cpp +++ b/radio/src/gui/128x64/model_setup.cpp @@ -239,6 +239,12 @@ inline uint8_t MODULE_SUBTYPE_ROWS(int moduleIdx) #define TIMER_ROWS(x) 2, 0, 0, 0, g_model.timers[x].countdownBeep != COUNTDOWN_SILENT ? (uint8_t)1 : (uint8_t)0 #define TIMERS_ROWS TIMER_ROWS(0), TIMER_ROWS(1), TIMER_ROWS(2) +#if defined(PCBSKY9X) && defined(REVX) + #define EXTERNAL_MODULE_OUTPUT_ROW 0, // Output type (OpenDrain / PushPull) +#else + #define EXTERNAL_MODULE_OUTPUT_ROW +#endif + #if defined(PCBSKY9X) #define EXTRA_MODULE_ROWS LABEL(ExtraModule), 1, 2, #else @@ -447,9 +453,9 @@ void menuModelSetup(event_t event) 0, // Global functions EXTERNAL_MODULE_ROWS -#if defined(PCBSKY9X) && defined(REVX) - 0, // Output type (OpenDrain / PushPull) -#endif + + EXTERNAL_MODULE_OUTPUT_ROW + EXTRA_MODULE_ROWS TRAINER_ROWS From 1f038dc5ce958b5ae31e9ccc31eaf84ceebd1f8a Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 9 Feb 2021 13:17:11 +0100 Subject: [PATCH 40/52] Output type only with 9xrpro and ppm and refactor --- radio/src/gui/128x64/model_setup.cpp | 52 ++++++++-------------------- 1 file changed, 14 insertions(+), 38 deletions(-) diff --git a/radio/src/gui/128x64/model_setup.cpp b/radio/src/gui/128x64/model_setup.cpp index 0b9cf9868..136ab6801 100644 --- a/radio/src/gui/128x64/model_setup.cpp +++ b/radio/src/gui/128x64/model_setup.cpp @@ -211,8 +211,8 @@ enum MenuModelSetupItems { #endif #if defined(PCBSKY9X) && defined(REVX) - #define OUTPUT_TYPE_ROW (isModulePPM(EXTERNAL_MODULE) ? (uint8_t)0 : HIDDEN_ROW), -#elif defined(PCBSKY9X) + #define OUTPUT_TYPE_ROW (isModulePPM(EXTERNAL_MODULE) ? (uint8_t)0 : HIDDEN_ROW), // Output type (OpenDrain / PushPull) +#else #define OUTPUT_TYPE_ROW #endif @@ -239,12 +239,6 @@ inline uint8_t MODULE_SUBTYPE_ROWS(int moduleIdx) #define TIMER_ROWS(x) 2, 0, 0, 0, g_model.timers[x].countdownBeep != COUNTDOWN_SILENT ? (uint8_t)1 : (uint8_t)0 #define TIMERS_ROWS TIMER_ROWS(0), TIMER_ROWS(1), TIMER_ROWS(2) -#if defined(PCBSKY9X) && defined(REVX) - #define EXTERNAL_MODULE_OUTPUT_ROW 0, // Output type (OpenDrain / PushPull) -#else - #define EXTERNAL_MODULE_OUTPUT_ROW -#endif - #if defined(PCBSKY9X) #define EXTRA_MODULE_ROWS LABEL(ExtraModule), 1, 2, #else @@ -393,12 +387,22 @@ void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event) #define EXTERNAL_MODULE_ROWS #endif +#if defined(PCBTARANIS) + #define WARN_ROWS \ + SW_WARN_ROWS, /* Switch warning */ \ + POT_WARN_ROWS, /* Pot warning */ +#else + #define WARN_ROWS \ + NUM_SWITCHES - 1, /* Switch warning */ +#endif + void menuModelSetup(event_t event) { int8_t old_editMode = s_editMode; #if defined(PCBTARANIS) int8_t old_posHorz = menuHorizontalPosition; +#endif MENU_TAB({ HEADER_LINE_COLUMNS @@ -416,8 +420,7 @@ void menuModelSetup(event_t event) LABEL(PreflightCheck), 0, // Checklist 0, // Throttle warning - SW_WARN_ROWS, // Switch warning - POT_WARN_ROWS, // Pot warning + WARN_ROWS NUM_STICKS + NUM_POTS + NUM_SLIDERS - 1, // Center beeps 0, // Global functions @@ -428,39 +431,12 @@ void menuModelSetup(event_t event) EXTERNAL_MODULE_ROWS - TRAINER_ROWS - }); -#else - MENU_TAB({ - HEADER_LINE_COLUMNS - 0, - TIMERS_ROWS, - 0, // Extended limits - 1, // Extended trims - 0, // Show trims - 0, // Trims step - 0, // Throttle reverse - 0, // Throttle trace source - 0, // Throttle trim - 0, // Throttle trim switch - - LABEL(PreflightCheck), - 0, // Checklist - 0, // Throttle warning - NUM_SWITCHES-1, // Switch warning - - NUM_STICKS + NUM_POTS + NUM_SLIDERS - 1, // Center beeps - 0, // Global functions - - EXTERNAL_MODULE_ROWS - - EXTERNAL_MODULE_OUTPUT_ROW + OUTPUT_TYPE_ROW EXTRA_MODULE_ROWS TRAINER_ROWS }); -#endif MENU_CHECK(menuTabModel, MENU_MODEL_SETUP, HEADER_LINE + ITEM_MODEL_SETUP_LINES_COUNT); title(STR_MENUSETUP); From da3f3f60322793f21dfc3c22fb27d449ae376224 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 9 Feb 2021 17:27:12 +0100 Subject: [PATCH 41/52] Update CREDITS.txt --- CREDITS.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CREDITS.txt b/CREDITS.txt index 384f48bbd..e77c0266f 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2126,3 +2126,13 @@ Ian Parris Danny Music Eric Bissonnette Riso LTD +William Booth +Ferenc Kunkli +Offer Shmuely +Troy Atneosen +Long Technologies +John Jaugilas +Jan-Hinrich Klee +Hans-Reinhard Mette +Alejandro Casals Oliver +David Homewood From e5d0b9d854d4a2ce5b5c611a8214653b48817b9b Mon Sep 17 00:00:00 2001 From: Kilrah Date: Wed, 10 Feb 2021 14:25:32 +0100 Subject: [PATCH 42/52] Add missing externalaccess option for T18 --- radio/util/fwoptions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/radio/util/fwoptions.py b/radio/util/fwoptions.py index 4ce915426..2349bdd18 100755 --- a/radio/util/fwoptions.py +++ b/radio/util/fwoptions.py @@ -256,6 +256,7 @@ options_jumper_t18 = { "nooverridech": ("OVERRIDE_CHANNEL_FUNCTION", "NO", "YES"), "flexr9m": ("MODULE_PROTOCOL_FLEX", "YES", None), "bluetooth": ("BLUETOOTH", "YES", "NO"), + "externalaccessmod": ("HARDWARE_EXTERNAL_ACCESS_MOD", "YES", "NO"), } options_radiomaster_tx12 = { From 5280afecf6f248dfb08a6c41be568ec259b5695f Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 11 Feb 2021 08:43:49 +0100 Subject: [PATCH 43/52] Update CREDITS.txt --- CREDITS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.txt b/CREDITS.txt index e77c0266f..19cc3b980 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2136,3 +2136,4 @@ Jan-Hinrich Klee Hans-Reinhard Mette Alejandro Casals Oliver David Homewood +John Dunning From bdf9e630caac5c3f276b4134f97e1b0cea64f231 Mon Sep 17 00:00:00 2001 From: 3djc Date: Thu, 11 Feb 2021 17:27:53 +0100 Subject: [PATCH 44/52] Improve --- radio/src/pulses/pulses.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/radio/src/pulses/pulses.cpp b/radio/src/pulses/pulses.cpp index f6651ce4f..32ae59342 100755 --- a/radio/src/pulses/pulses.cpp +++ b/radio/src/pulses/pulses.cpp @@ -482,8 +482,8 @@ bool setupPulsesInternalModule(uint8_t protocol) void stopPulsesInternalModule() { - intmoduleStop(); - if (pulsesStarted()) { + if (moduleState[INTERNAL_MODULE].protocol != PROTOCOL_CHANNELS_UNINITIALIZED) { + intmoduleStop(); moduleState[INTERNAL_MODULE].protocol = PROTOCOL_CHANNELS_NONE; } } @@ -508,8 +508,10 @@ bool setupPulsesInternalModule() void stopPulsesExternalModule() { - extmoduleStop(); - moduleState[EXTERNAL_MODULE].protocol = PROTOCOL_CHANNELS_NONE; + if (moduleState[EXTERNAL_MODULE].protocol != PROTOCOL_CHANNELS_UNINITIALIZED)) { + extmoduleStop(); + moduleState[EXTERNAL_MODULE].protocol = PROTOCOL_CHANNELS_NONE; + } } bool setupPulsesExternalModule() From e4b64b1d0e28879ae61f94d187ba1f5954668dab Mon Sep 17 00:00:00 2001 From: 3djc Date: Fri, 12 Feb 2021 07:03:14 +0100 Subject: [PATCH 45/52] Fix compilation --- radio/src/pulses/pulses.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/pulses/pulses.cpp b/radio/src/pulses/pulses.cpp index 32ae59342..c5cb0abbf 100755 --- a/radio/src/pulses/pulses.cpp +++ b/radio/src/pulses/pulses.cpp @@ -508,7 +508,7 @@ bool setupPulsesInternalModule() void stopPulsesExternalModule() { - if (moduleState[EXTERNAL_MODULE].protocol != PROTOCOL_CHANNELS_UNINITIALIZED)) { + if (moduleState[EXTERNAL_MODULE].protocol != PROTOCOL_CHANNELS_UNINITIALIZED) { extmoduleStop(); moduleState[EXTERNAL_MODULE].protocol = PROTOCOL_CHANNELS_NONE; } From fa2dbcf72a214bbb7e5396c224d9e98c343cc961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Charpentier?= Date: Fri, 12 Feb 2021 13:03:58 +0100 Subject: [PATCH 46/52] Lapin fou/fr translation (#8280) * Updated French translation. --- companion/src/translations/companion_fr.ts | 821 +++++++-------------- 1 file changed, 286 insertions(+), 535 deletions(-) diff --git a/companion/src/translations/companion_fr.ts b/companion/src/translations/companion_fr.ts index 89a6734e2..1d1b1b331 100644 --- a/companion/src/translations/companion_fr.ts +++ b/companion/src/translations/companion_fr.ts @@ -743,58 +743,58 @@ Manche Droit: Profondeur, Direction Boards - + Left Horizontal Gauche Horizontal - + Left Vertical Gauche Vertical - + Right Vertical Droit Vertical - + Right Horizontal Droit Horizontal - + Aux. 1 - + Aux. 2 - - + + Unknown Inconnu - + Rud Dir - + Ele Prf - + Thr Gaz - + Ail @@ -8399,11 +8399,6 @@ Mixage actif par défaut si non-renseigné. Warn(%1) Alerte(%1) - - - Offset - Décalage - Flight modes @@ -8557,8 +8552,8 @@ Mixage actif par défaut si non-renseigné. - - + + Source @@ -8598,252 +8593,89 @@ Mixage actif par défaut si non-renseigné. FrSky D (câble) - + Alti Alt - + Alti+ Alt+ - + VSpeed Vitesse verticale - - - + + + A1 - - - + + + A2 - - + + A3 - - + + A4 - - + + FAS - + Cells Velm - - Calculated - Calculé - - - - Add - Addition - - - - Average - Moyenne - - - - + Min - - + Max - - Multiply - Multiplication - - - - Totalise - - - - - Cell - Element LiPo - - - - Consumption - Consommation - - - - Distance - - - - - Lowest - Min - - - - Cell %1 - Elém. %1 - - - - Highest - Max - - - - Delta - - - - - Auto Offset - Offset Auto - - - - 0. - - - - - 0.0 - - - - - 0.00 - - - - - Id - - - - - - Sensor - Capteur - - - - Sources - - - - - GPS - - - - - Blades - Pales - - - - F - - - - - Inst - - - - - Alt - Altitude - - - - Unit - Unité - - - - Prec - - - - - Ratio - - - - - Multi - - - - - Filter - Filtre - - - - Persist - - - - - Positive - - - - - Log - - - - + Numbers Chiffres - + Bars Barres - + Script - + Filename Nom de fichier - + Error: Unable to open or read file! Erreur: Impossible d'ouvrir ou de lire le fichier! @@ -8861,9 +8693,8 @@ Mixage actif par défaut si non-renseigné. - - - + + None Aucun @@ -8939,7 +8770,6 @@ Mixage actif par défaut si non-renseigné. - Custom Prédéfini @@ -9353,42 +9183,42 @@ Mixage actif par défaut si non-renseigné. ModulePanel - + Value Valeur - + Hold Maintien - + No Pulse Pas d'impulsion - + Ask Demander - + Internal Interne - + Internal + External Interne + Externe - + External Externe - + Bind on channel Bind avec VOIE @@ -10660,226 +10490,327 @@ E SensorData - + Raw (-) Chiffres bruts (-) - - + + V - + A - + mA - + kts - + m/s - + km/h - + mph - + m - + f - + °C - + °F - + % - + mAh - + W - + mW - + dB - + rpms - + g - + ° - + Rad - + hours heures - + minutes - + seconds secondes - + ml/minute - + Hertz - + mS - + uS - + TELE - - Custom - Prédéfini + + Formula + Formule - - Calculated - Calculé - - - - Add - Addition - - - - Average - Moyenne - - - - Minimum + + Id - - Maximum + + Instance + + + + + + Sensor + Capteur + + + + Sources - Multiply - Multiplication + GPS + - - Totalize - Totalisation + + Alt + Altitude - - Cell - Element LiPo - - - - Consumption - Consommation + + Unit + Unité - Distance + Precision + Précision + + + + Ratio + + + + + Offset + Décalage + + + + Auto Offset + Blades + Pales + + + + Multiplier + Multiplicateur + + + + Filter + Filtre + + + + Persist + Persistant + + + + Positive + + + + + Log + + + + + Custom + Prédéfini + + + + Calculated + Calculé + + + + Add + Addition + + + + Average + Moyenne + + + + Minimum + + + + + Maximum + + + + + Multiply + Multiplication + + + + Totalize + Totalisation + + + + Cell + Element LiPo + + + + Consumption + Consommation + + + + Distance + + + + Lowest Min - + Cell %1 Elément %1 - + Highest Max - + Delta + + + Y + O + + + + N + + Setup @@ -11063,92 +10994,92 @@ Si cette option est cochée, la voie des gaz est inversée: le ralenti est &apo SetupPanel - + Popup menu available Menu contextuel disponible - + Timer %1 Chrono %1 - + THR GAZ - + Profile Settings Paramètres du profil - + SD structure path not specified or invalid Chemin de la structure SD non spécifié ou invalide - + Copy Copier - + Cut Couper - + Paste Coller - + Clear Effacer - + Insert Insérer - + Delete Supprimer - + Move Up Monter - + Move Down Descendre - + Clear All Effacer Tout - + Clear Timer. Are you sure? Effacer le Chrono. Êtes-vous sûr? - + Clear all Timers. Are you sure? Effacer tous les Chronos. Êtes-vous sûr? - + Cut Timer. Are you sure? Couper le Chrono. Êtes-vous sûr? - + Delete Timer. Are you sure? Supprimer le Chrono. Êtes-vous sûr? @@ -12625,52 +12556,52 @@ Trop d'erreurs, abandon. TelemetryPanel - + FrSky S.PORT - + FrSky D - + FrSky D (cable) FrSky D (câble) - + Telemetry screen %1 Ecran de télémesure %1 - + Source - + Low Alarm Alarme basse - + Critical Alarm Alarme critique - + Winged Shadow How High - + Winged Shadow How High (not supported) Winged Shadow How High (non supporté) - + Delete Sensor. Are you sure? Supprimer le Capteur. Êtes-vous sûr? @@ -12688,279 +12619,99 @@ Trop d'erreurs, abandon. - - Custom - Prédéfini - - - - Calculated - Calculé - - - + Id - + Instance - + Rx - - Add - Addition - - - - Average - Moyenne - - - - Min - - - - - Max - - - - - Multiply - Multiplication - - - - Totalize - Totalisation - - - - Cell - Element LiPo - - - - Consumption - Consommation - - - - Dist - Distance - - - + Cells Sensor : Capteur d'éléments: - - - - - - - - + + + + + + + + --- - + GPS Sensor : Capteur GPS: - + Alt. Sensor : Capteur d'altitude: - + Sensor : Capteur: - - V - - - - - A - - - - - mA - - - - - kt - - - - - m/s - - - - - ft/s - - - - - km/h - - - - - mph - - - - - m - - - - - ft - - - - - °C - - - - - °F - - - - - % - - - - - mAh - - - - - W - - - - - mW - - - - - dBm - - - - - g - - - - - ° - - - - - Rad - - - - - mL - - - - - US fl.Oz. - - - - - Raw (-) - Chiffres bruts (-) - - - - RPM - Tours/minute - - - - ml/min - - - - + Precision Précision - + Ratio - + Blades Pales - + Offset Décalage - + Multiplier Multiplicateur - + Auto Offset Offset auto - + Filter Filtre - + Persistent Persistant - + Positive - + Logs @@ -12968,72 +12719,72 @@ Trop d'erreurs, abandon. TelemetrySensorPanel - + TELE%1 - + Popup menu available Menu contextuel disponible - + Copy Copier - + Cut Couper - + Paste Coller - + Clear Effacer - + Insert Insérer - + Delete Supprimer - + Move Up Monter - + Move Down Descendre - + Clear All Effacer Tout - + Cut Telemetry Sensor. Are you sure? Couper le capteur de télémétrie. Êtes-vous sûr? - + Clear Telemetry Sensor. Are you sure? Effacer le capteur de télémétrie. Êtes-vous sûr? - + Clear all Telemetry Sensors. Are you sure? Effacez tous les capteurs de télémétrie. Êtes-vous sûr? @@ -13403,12 +13154,12 @@ hh:mm:ss Timer - + Countdown Compte à rebours - + Minute Call Annonces minutes From 92b25e71fc1a63c81e5bacf1377a1726fc070a8b Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sat, 13 Feb 2021 22:30:45 +0100 Subject: [PATCH 47/52] Update CREDITS.txt --- CREDITS.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CREDITS.txt b/CREDITS.txt index 19cc3b980..07df1ae15 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2137,3 +2137,6 @@ Hans-Reinhard Mette Alejandro Casals Oliver David Homewood John Dunning +Konrad Helbach +Bernard Delpy +Raymond Ellsworth From e94f6c0ccdc1ecd800f2ef27a28120878bc9ec41 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sun, 14 Feb 2021 10:40:34 +0100 Subject: [PATCH 48/52] Update CREDITS.txt --- CREDITS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.txt b/CREDITS.txt index 07df1ae15..669935391 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2140,3 +2140,4 @@ John Dunning Konrad Helbach Bernard Delpy Raymond Ellsworth +Bogdan Musial From 2d1276f08119f97f238d9b29e92f104fb221e570 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Mon, 15 Feb 2021 09:15:58 +0100 Subject: [PATCH 49/52] Update CREDITS.txt --- CREDITS.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CREDITS.txt b/CREDITS.txt index 669935391..d83f82e79 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2141,3 +2141,5 @@ Konrad Helbach Bernard Delpy Raymond Ellsworth Bogdan Musial +Гасак Сергей +Philip Garcia From 96eb5d2bb0aa190f64da943ddc7c2a3e2ae5a5d2 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Mon, 15 Feb 2021 14:01:26 +0100 Subject: [PATCH 50/52] Update CREDITS.txt --- CREDITS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.txt b/CREDITS.txt index d83f82e79..38c1f732d 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2143,3 +2143,4 @@ Raymond Ellsworth Bogdan Musial Гасак Сергей Philip Garcia +Helder Simoes From af8dff9da296e0c87cdd1ac8d215c1f9fc512752 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Mon, 15 Feb 2021 14:37:07 +0100 Subject: [PATCH 51/52] Update CREDITS.txt --- CREDITS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.txt b/CREDITS.txt index 38c1f732d..8553a80fc 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2144,3 +2144,4 @@ Bogdan Musial Гасак Сергей Philip Garcia Helder Simoes +Thomas Blanchin From 9e254e7dd621ba69dbb2cff63923c7aeb3396eb5 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 16 Feb 2021 10:43:15 +0100 Subject: [PATCH 52/52] Update CREDITS.txt --- CREDITS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.txt b/CREDITS.txt index 8553a80fc..ffa4dca00 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2145,3 +2145,4 @@ Bogdan Musial Philip Garcia Helder Simoes Thomas Blanchin +Jean-Luc Mesnier