diff --git a/CMakeLists.txt b/CMakeLists.txt index 06c96d374c4..824dd99f98b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ project(EdgeTX) set(VERSION_MAJOR "2") set(VERSION_MINOR "10") set(VERSION_REVISION "0") -set(CODENAME "dev") +set(CODENAME "FlyingDutchman") if(MINGW OR WIN32) set(CMAKE_OBJECT_PATH_MAX 200) diff --git a/companion/src/firmwares/customfunctiondata.h b/companion/src/firmwares/customfunctiondata.h index c27bdf71383..cf3f6af1bf9 100644 --- a/companion/src/firmwares/customfunctiondata.h +++ b/companion/src/firmwares/customfunctiondata.h @@ -27,6 +27,8 @@ #include #include +#define CF_CUSTNAME_LEN 10 + class Firmware; class ModelData; class GeneralSettings; @@ -105,6 +107,7 @@ class CustomFunctionData { unsigned int enabled; // TODO perhaps not any more the right name unsigned int adjustMode; int repeatParam; + char custName[CF_CUSTNAME_LEN + 1]; void convert(RadioDataConversionState & cstate); diff --git a/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp b/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp index d8ec947bb30..2c6f3ac791a 100644 --- a/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp +++ b/companion/src/firmwares/edgetx/yaml_customfunctiondata.cpp @@ -241,6 +241,8 @@ Node convert::encode(const CustomFunctionData& rhs) node["def"] = def; } + node["custName"] = rhs.custName; + return node; } @@ -249,6 +251,8 @@ bool convert::decode(const Node& node, { node["swtch"] >> rhs.swtch; + node["custName"] >> rhs.custName; + int func = 0; node["func"] >> customFnLut >> func; rhs.func = (AssignFunc)func; diff --git a/companion/src/firmwares/edgetx/yaml_logicalswitchdata.cpp b/companion/src/firmwares/edgetx/yaml_logicalswitchdata.cpp index 9128718c0a0..cfa13a858d2 100644 --- a/companion/src/firmwares/edgetx/yaml_logicalswitchdata.cpp +++ b/companion/src/firmwares/edgetx/yaml_logicalswitchdata.cpp @@ -41,6 +41,7 @@ static const YamlLookupTable funcLut = { {LS_FN_DAPOS, "FUNC_ADIFFEGREATER"}, {LS_FN_TIMER, "FUNC_TIMER"}, {LS_FN_STICKY, "FUNC_STICKY"}, + {LS_FN_SAFE, "FUNC_SAFE"}, }; static int timerValue2lsw(uint32_t t) @@ -79,6 +80,12 @@ Node convert::encode(const LogicalSwitchData& rhs) def += YamlRawSwitchEncode(RawSwitch(rhs.val2)); } break; + case LS_FAMILY_SAFE: { + def += YamlRawSwitchEncode(RawSwitch(rhs.val1)); + def += ","; + def += YamlRawSwitchEncode(RawSwitch(rhs.val2)); + } break; + case LS_FAMILY_EDGE: { def += YamlRawSwitchEncode(RawSwitch(rhs.val1)); def += ","; @@ -116,7 +123,7 @@ Node convert::encode(const LogicalSwitchData& rhs) node["delay"] = rhs.delay; node["duration"] = rhs.duration; node["andsw"] = YamlRawSwitchEncode(RawSwitch(rhs.andsw)); - + node["custName"] = rhs.custName; return node; } @@ -124,6 +131,7 @@ bool convert::decode(const Node& node, LogicalSwitchData& rhs) { node["func"] >> funcLut >> rhs.func; + node["custName"] >> rhs.custName; std::string def_str; node["def"] >> def_str; @@ -139,6 +147,14 @@ bool convert::decode(const Node& node, rhs.val2 = YamlRawSwitchDecode(sw_str).toValue(); } break; +case LS_FAMILY_SAFE: { + std::string sw_str; + getline(def, sw_str, ','); + rhs.val1 = YamlRawSwitchDecode(sw_str).toValue(); + getline(def, sw_str); + rhs.val2 = YamlRawSwitchDecode(sw_str).toValue(); + } break; + case LS_FAMILY_EDGE: { std::string sw_str; getline(def, sw_str, ','); diff --git a/companion/src/firmwares/logicalswitchdata.cpp b/companion/src/firmwares/logicalswitchdata.cpp index 457fc01038f..5b01f699610 100644 --- a/companion/src/firmwares/logicalswitchdata.cpp +++ b/companion/src/firmwares/logicalswitchdata.cpp @@ -27,7 +27,7 @@ bool LogicalSwitchData::isEmpty() const { - return (func == 0); + return (func == LS_FN_OFF); } CSFunctionFamily LogicalSwitchData::getFunctionFamily() const @@ -38,6 +38,8 @@ CSFunctionFamily LogicalSwitchData::getFunctionFamily() const return LS_FAMILY_TIMER; else if (func == LS_FN_STICKY) return LS_FAMILY_STICKY; + else if (func == LS_FN_SAFE) + return LS_FAMILY_SAFE; else if (func < LS_FN_AND || func > LS_FN_ELESS) return LS_FAMILY_VOFS; else if (func < LS_FN_EQUAL) @@ -102,6 +104,8 @@ QString LogicalSwitchData::funcToString() const return tr("Timer"); case LS_FN_STICKY: return tr("Sticky"); + case LS_FN_SAFE: + return tr("Safe"); case LS_FN_EDGE: return tr("Edge"); default: @@ -111,7 +115,7 @@ QString LogicalSwitchData::funcToString() const QString LogicalSwitchData::nameToString(int index) const { - return RadioData::getElementName(tr("L"), index + 1, NULL, true); + return RadioData::getElementName(tr("L"), index + 1, custName, true); } void LogicalSwitchData::convert(RadioDataConversionState & cstate) @@ -124,6 +128,10 @@ void LogicalSwitchData::convert(RadioDataConversionState & cstate) val1 = RawSource(val1).convert(cstate.withComponentField("V1")).toValue(); break; case LS_FAMILY_STICKY: + case LS_FAMILY_SAFE: + val1 = RawSwitch(val1).convert(cstate.withComponentField("V1")).toValue(); + val2 = RawSwitch(val2).convert(cstate.withComponentField("V2")).toValue(); + break; case LS_FAMILY_VBOOL: val1 = RawSwitch(val1).convert(cstate.withComponentField("V1")).toValue(); val2 = RawSwitch(val2).convert(cstate.withComponentField("V2")).toValue(); diff --git a/companion/src/firmwares/logicalswitchdata.h b/companion/src/firmwares/logicalswitchdata.h index 1b1c508204d..91b61dcfe31 100644 --- a/companion/src/firmwares/logicalswitchdata.h +++ b/companion/src/firmwares/logicalswitchdata.h @@ -18,11 +18,12 @@ * GNU General Public License for more details. */ -#ifndef LOGICALSWITCHDATA_H -#define LOGICALSWITCHDATA_H +#pragma once #include +#define LS_CUSTNAME_LEN 10 + class RadioDataConversionState; enum CSFunction { @@ -47,8 +48,10 @@ enum CSFunction { LS_FN_TIMER, LS_FN_STICKY, LS_FN_EDGE, + LS_FN_SAFE, // later ... LS_FN_RANGE, - LS_FN_MAX + LS_FN_MAX, + }; enum CSFunctionFamily { @@ -58,6 +61,7 @@ enum CSFunctionFamily { LS_FAMILY_TIMER, LS_FAMILY_STICKY, LS_FAMILY_EDGE, + LS_FAMILY_SAFE, }; class LogicalSwitchData { @@ -76,6 +80,7 @@ class LogicalSwitchData { unsigned int delay; unsigned int duration; int andsw; + char custName[LS_CUSTNAME_LEN + 1]; void clear() { memset(this, 0, sizeof(LogicalSwitchData)); } bool isEmpty() const; @@ -85,5 +90,3 @@ class LogicalSwitchData { QString nameToString(int index) const; void convert(RadioDataConversionState & cstate); }; - -#endif // LOGICALSWITCHDATA_H diff --git a/companion/src/firmwares/modeldata.cpp b/companion/src/firmwares/modeldata.cpp index 855cd7f08f6..b46717f078a 100644 --- a/companion/src/firmwares/modeldata.cpp +++ b/companion/src/firmwares/modeldata.cpp @@ -720,6 +720,12 @@ int ModelData::updateReference() } break; case LS_FAMILY_STICKY: + case LS_FAMILY_SAFE: + if (lsd->val1 != 0) + updateSwitchIntRef(lsd->val1); + if (lsd->val2 != 0) + updateSwitchIntRef(lsd->val2); + break; case LS_FAMILY_VBOOL: oldval1 = lsd->val1; oldval2 = lsd->val2; diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 71545c14c75..0cc79d678bd 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -1355,6 +1355,7 @@ class LogicalSwitchesFunctionsTable: public ConversionTable { addConversion(LS_FN_DAPOS, val++); addConversion(LS_FN_TIMER, val++); addConversion(LS_FN_STICKY, val++); + addConversion(LS_FN_SAFE, val++); } }; @@ -1410,7 +1411,7 @@ class LogicalSwitchField: public TransformedField { v2 = csw.val2; v3 = csw.val3; } - else if ((csw.func >= LS_FN_AND && csw.func <= LS_FN_XOR) || csw.func == LS_FN_STICKY) { + else if ((csw.func >= LS_FN_AND && csw.func <= LS_FN_XOR) || csw.func == LS_FN_STICKY || csw.func == LS_FN_SAFE) { switchesConversionTable->exportValue(csw.val1, v1); switchesConversionTable->exportValue(csw.val2, v2); } @@ -1435,7 +1436,7 @@ class LogicalSwitchField: public TransformedField { csw.val2 = v2; csw.val3 = v3; } - else if ((csw.func >= LS_FN_AND && csw.func <= LS_FN_XOR) || csw.func == LS_FN_STICKY) { + else if ((csw.func >= LS_FN_AND && csw.func <= LS_FN_XOR) || csw.func == LS_FN_STICKY || csw.func == LS_FN_SAFE) { switchesConversionTable->importValue(v1, csw.val1); switchesConversionTable->importValue(v2, csw.val2); } diff --git a/companion/src/firmwares/rawsource.cpp b/companion/src/firmwares/rawsource.cpp index 86c13ef2de6..7f17b56ac53 100644 --- a/companion/src/firmwares/rawsource.cpp +++ b/companion/src/firmwares/rawsource.cpp @@ -204,7 +204,7 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con return result; case SOURCE_TYPE_CUSTOM_SWITCH: - return RawSwitch(SWITCH_TYPE_VIRTUAL, index + 1).toString(); + return RawSwitch(SWITCH_TYPE_VIRTUAL, index + 1).toString(board, generalSettings, model); case SOURCE_TYPE_CYC: return tr("CYC%1").arg(index + 1); diff --git a/companion/src/firmwares/rawswitch.cpp b/companion/src/firmwares/rawswitch.cpp index efeb7adfb6f..54127e25e43 100644 --- a/companion/src/firmwares/rawswitch.cpp +++ b/companion/src/firmwares/rawswitch.cpp @@ -86,9 +86,9 @@ QString RawSwitch::toString(Board::Type board, const GeneralSettings * const gen case SWITCH_TYPE_VIRTUAL: if (modelData) - return modelData->logicalSw[index].nameToString(index-1); + return modelData->logicalSw[index - 1].nameToString(index - 1); else - return LogicalSwitchData().nameToString(index-1); + return LogicalSwitchData().nameToString(index - 1); case SWITCH_TYPE_FUNCTIONSWITCH: if (!Boards::getCapability(board, Board::FunctionSwitches)) diff --git a/companion/src/helpers.h b/companion/src/helpers.h index 4b17581740e..21f9c37032e 100644 --- a/companion/src/helpers.h +++ b/companion/src/helpers.h @@ -250,6 +250,13 @@ extern Stopwatch gStopwatch; class SemanticVersion { public: +<<<<<<< HEAD + explicit SemanticVersion(QString vers); + ~SemanticVersion() = default;; + + bool isValid(const QString vers); + QString toString() const; +======= explicit SemanticVersion(const QString vers); explicit SemanticVersion() {} ~SemanticVersion() {} @@ -262,6 +269,7 @@ class SemanticVersion bool fromInt(const unsigned int val); SemanticVersion& operator=(const SemanticVersion& rhs); +>>>>>>> e898e851460f0b76873d4442cdc8144474863f5e bool operator==(const SemanticVersion& rhs) { return compare(rhs) == 0; @@ -288,6 +296,21 @@ class SemanticVersion } private: +<<<<<<< HEAD + enum PreRelease { + PR_ALPHA = 0, + PR_BETA = 1, + PR_RC = 2, + PR_NONE = 3 + }; + + struct Version { + int major = 0; + int minor = 1; + int patch = 0; + PreRelease preReleaseType = PR_NONE; + int preReleaseNumber = 0; +======= enum PreReleaseTypes { PR_ALPHA = 0, PR_BETA, @@ -303,13 +326,17 @@ class SemanticVersion int patch = 0; int preReleaseType = PR_NONE; int preReleaseNumber = 0; +>>>>>>> e898e851460f0b76873d4442cdc8144474863f5e }; Version version; int compare(const SemanticVersion& other); +<<<<<<< HEAD +======= inline QString preReleaseTypeToString() const { return PreReleaseTypesStringList.value(version.preReleaseType, ""); } inline int preReleaseTypeToInt(QString preRelType) const { return PreReleaseTypesStringList.indexOf(preRelType); } +>>>>>>> e898e851460f0b76873d4442cdc8144474863f5e }; diff --git a/companion/src/modeledit/customfunctions.h b/companion/src/modeledit/customfunctions.h index 2bede10d627..7d2fcaef353 100644 --- a/companion/src/modeledit/customfunctions.h +++ b/companion/src/modeledit/customfunctions.h @@ -46,6 +46,7 @@ class CustomFunctionsPanel : public GenericPanel private slots: void customFunctionEdited(); + void onNameEdited(); void functionEdited(); void onCustomContextMenuRequested(QPoint pos); void refreshCustomFunction(int index, bool modified=false); @@ -93,6 +94,7 @@ class CustomFunctionsPanel : public GenericPanel QSet tracksSet; QSet scriptsSet; int mediaPlayerCurrent; + QLineEdit * name[CPN_MAX_SPECIAL_FUNCTIONS]; QComboBox * fswtchSwtch[CPN_MAX_SPECIAL_FUNCTIONS]; QComboBox * fswtchFunc[CPN_MAX_SPECIAL_FUNCTIONS]; QCheckBox * fswtchParamGV[CPN_MAX_SPECIAL_FUNCTIONS]; diff --git a/companion/src/modeledit/logicalswitches.cpp b/companion/src/modeledit/logicalswitches.cpp index c512153e194..f55a8acc393 100644 --- a/companion/src/modeledit/logicalswitches.cpp +++ b/companion/src/modeledit/logicalswitches.cpp @@ -43,7 +43,7 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model, lsCapabilityExt = firmware->getCapability(LogicalSwitchesExt); QStringList headerLabels; - headerLabels << "#" << tr("Function") << tr("V1") << tr("V2") << tr("AND Switch"); + headerLabels << "#" << tr("Name") << tr("Function") << tr("V1") << tr("V2") << tr("AND Switch"); if (lsCapabilityExt) { headerLabels << tr("Duration") << tr("Delay"); } @@ -63,12 +63,22 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model, connect(label, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onCustomContextMenuRequested(QPoint))); tableLayout->addWidget(i, 0, label); + // The Custom Name + name[i] = new QLineEdit(this); + name[i]->setProperty("index", i); + name[i]->setMaxLength(LS_CUSTNAME_LEN); + QRegExp rx(CHAR_FOR_NAMES_REGEX); + name[i]->setValidator(new QRegExpValidator(rx, this)); + name[i]->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum); + connect(name[i], SIGNAL(editingFinished()), this, SLOT(onNameEdited())); + tableLayout->addWidget(i, 1, name[i]); + // The function cbFunction[i] = new QComboBox(this); cbFunction[i]->setProperty("index", i); populateFunctionCB(cbFunction[i]); connect(cbFunction[i], SIGNAL(currentIndexChanged(int)), this, SLOT(onFunctionChanged())); - tableLayout->addWidget(i, 1, cbFunction[i]); + tableLayout->addWidget(i, 2, cbFunction[i]); // V1 QHBoxLayout *v1Layout = new QHBoxLayout(); @@ -86,7 +96,7 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model, connect(dsbValue[i], SIGNAL(editingFinished()), this, SLOT(onOffsetChanged())); v1Layout->addWidget(dsbValue[i]); dsbValue[i]->setVisible(false); - tableLayout->addLayout(i, 2, v1Layout); + tableLayout->addLayout(i, 3, v1Layout); // V2 QHBoxLayout *v2Layout = new QHBoxLayout(); @@ -119,7 +129,7 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model, connect(teOffset[i],SIGNAL(editingFinished()),this,SLOT(onOffsetChanged())); v2Layout->addWidget(teOffset[i]); teOffset[i]->setVisible(false); - tableLayout->addLayout(i, 3, v2Layout); + tableLayout->addLayout(i, 4, v2Layout); // AND cbAndSwitch[i] = new QComboBox(this); @@ -127,7 +137,7 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model, cbAndSwitch[i]->setModel(rawSwitchFilteredModel); cbAndSwitch[i]->setVisible(true); connect(cbAndSwitch[i], SIGNAL(currentIndexChanged(int)), this, SLOT(onAndSwitchChanged(int))); - tableLayout->addWidget(i, 4, cbAndSwitch[i]); + tableLayout->addWidget(i, 5, cbAndSwitch[i]); if (lsCapabilityExt) { // Duration @@ -139,7 +149,7 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model, dsbDuration[i]->setAccelerated(true); dsbDuration[i]->setDecimals(1); connect(dsbDuration[i], SIGNAL(valueChanged(double)), this, SLOT(onDurationChanged(double))); - tableLayout->addWidget(i, 5, dsbDuration[i]); + tableLayout->addWidget(i, 6, dsbDuration[i]); // Delay dsbDelay[i] = new QDoubleSpinBox(this); @@ -150,13 +160,13 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model, dsbDelay[i]->setAccelerated(true); dsbDelay[i]->setDecimals(1); connect(dsbDelay[i], SIGNAL(valueChanged(double)), this, SLOT(onDelayChanged(double))); - tableLayout->addWidget(i, 6, dsbDelay[i]); + tableLayout->addWidget(i, 7, dsbDelay[i]); } } disableMouseScrolling(); tableLayout->resizeColumnsToContents(); - tableLayout->pushRowsUp(lsCapability+1); + tableLayout->pushRowsUp(lsCapability + 1); } LogicalSwitchesPanel::~LogicalSwitchesPanel() @@ -165,6 +175,19 @@ LogicalSwitchesPanel::~LogicalSwitchesPanel() delete rawSwitchFilteredModel; } +void LogicalSwitchesPanel::onNameEdited() +{ + QLineEdit *le = qobject_cast(sender()); + int index = le->property("index").toInt(); + + if (model->logicalSw[index].custName != le->text()) { + strcpy(model->logicalSw[index].custName, le->text().toLatin1()); + if (model->logicalSw[index].func != LS_FN_OFF) + updateItemModels(); + emit modified(); + } +} + void LogicalSwitchesPanel::onFunctionChanged() { if (!lock) { @@ -356,6 +379,8 @@ void LogicalSwitchesPanel::updateLine(int i) if (!model->logicalSw[i].isEmpty()) { mask = LINE_ENABLED | DELAY_ENABLED | DURATION_ENABLED; + name[i]->setText(model->logicalSw[i].custName); + switch (model->logicalSw[i].getFunctionFamily()) { case LS_FAMILY_VOFS: @@ -391,6 +416,8 @@ void LogicalSwitchesPanel::updateLine(int i) } case LS_FAMILY_STICKY: // no break + case LS_FAMILY_SAFE: // no break + case LS_FAMILY_VBOOL: mask |= SOURCE1_VISIBLE | SOURCE2_VISIBLE; cbSource1[i]->setModel(rawSwitchFilteredModel); @@ -468,7 +495,8 @@ void LogicalSwitchesPanel::populateFunctionCB(QComboBox *b) LS_FN_DPOS, LS_FN_DAPOS, LS_FN_TIMER, - LS_FN_STICKY + LS_FN_STICKY, + LS_FN_SAFE, }; b->clear(); @@ -598,6 +626,7 @@ void LogicalSwitchesPanel::cmClear(bool prompt) model->logicalSw[selectedIndex].clear(); model->updateAllReferences(ModelData::REF_UPD_TYPE_LOGICAL_SWITCH, ModelData::REF_UPD_ACT_CLEAR, selectedIndex); + name[selectedIndex]->clear(); updateLine(selectedIndex); updateItemModels(); emit modified(); @@ -610,6 +639,7 @@ void LogicalSwitchesPanel::cmClearAll() for (int i = 0; i < lsCapability; i++) { model->logicalSw[i].clear(); + name[i]->clear(); model->updateAllReferences(ModelData::REF_UPD_TYPE_LOGICAL_SWITCH, ModelData::REF_UPD_ACT_CLEAR, i); } update(); diff --git a/companion/src/modeledit/logicalswitches.h b/companion/src/modeledit/logicalswitches.h index cfee61ea58f..f0e9be9c5da 100644 --- a/companion/src/modeledit/logicalswitches.h +++ b/companion/src/modeledit/logicalswitches.h @@ -18,8 +18,7 @@ * GNU General Public License for more details. */ -#ifndef _LOGICALSWITCHES_H_ -#define _LOGICALSWITCHES_H_ +#pragma once #include "modeledit.h" #include "radiodata.h" @@ -42,6 +41,7 @@ class LogicalSwitchesPanel : public ModelPanel private slots: void onFunctionChanged(); + void onNameEdited(); void onV1Changed(int value); void onV2Changed(int value); void onAndSwitchChanged(int value); @@ -64,6 +64,7 @@ class LogicalSwitchesPanel : public ModelPanel void onItemModelUpdateComplete(); private: + QLineEdit *name[CPN_MAX_LOGICAL_SWITCHES]; QComboBox * cbFunction[CPN_MAX_LOGICAL_SWITCHES]; QDoubleSpinBox * dsbValue[CPN_MAX_LOGICAL_SWITCHES]; QDoubleSpinBox * dsbOffset[CPN_MAX_LOGICAL_SWITCHES]; @@ -91,5 +92,3 @@ class LogicalSwitchesPanel : public ModelPanel void updateItemModels(); void connectItemModelEvents(const FilteredItemModel * itemModel); }; - -#endif // _LOGICALSWITCHES_H_ diff --git a/companion/src/modelprinter.cpp b/companion/src/modelprinter.cpp index 7e851205700..5c2c3d014df 100644 --- a/companion/src/modelprinter.cpp +++ b/companion/src/modelprinter.cpp @@ -393,6 +393,18 @@ QString ModelPrinter::printMixerLine(const MixData & mix, bool showMultiplex, in { QString str = " "; + if (firmware->getCapability(HasMixerNames) && mix.name[0]){ + std::string strMixName(mix.name); + str += QString(" [%1]").arg(mix.name).toHtmlEscaped(); + for (int i = 0; i < (6- strMixName.length()); i++) { + str += " "; + } + } + else { + str += "       "; + } + str += "     "; + if (showMultiplex) { switch(mix.mltpx) { case (1): str += "*="; break; @@ -519,6 +531,9 @@ QString ModelPrinter::printLogicalSwitchLine(int idx) case LS_FAMILY_STICKY: result += tr("Sticky") + QString("(%1, %2)").arg(sw1Name).arg(sw2Name); break; + case LS_FAMILY_SAFE: + result += tr("Safe") + QString("(%1, %2)").arg(sw1Name).arg(sw2Name); + break; case LS_FAMILY_TIMER: result += tr("Timer") + QString("(%1, %2)").arg(ValToTim(ls.val1)).arg(ValToTim(ls.val2)); break; diff --git a/companion/src/simulation/radiooutputswidget.cpp b/companion/src/simulation/radiooutputswidget.cpp index a71e3098b39..3b3b072cecd 100644 --- a/companion/src/simulation/radiooutputswidget.cpp +++ b/companion/src/simulation/radiooutputswidget.cpp @@ -282,6 +282,11 @@ void RadioOutputsWidget::setupLsDisplay() QWidget * RadioOutputsWidget::createLogicalSwitch(QWidget * parent, int switchNo) { + //TODO: place logicSwitch friendly name on radio output window. + //int modelindex = RadioData().generalSettings.currModelIndex; + //ModelData &model = RadioData().models[modelindex]; + //QString namestring = model.logicalSw[switchNo].custName; + QLabel * swtch = new QLabel(parent); swtch->setAutoFillBackground(true); swtch->setFrameStyle(QFrame::Panel | QFrame::Raised); @@ -297,7 +302,8 @@ QWidget * RadioOutputsWidget::createLogicalSwitch(QWidget * parent, int switchNo #endif font.setBold(false); swtch->setFont(font); - swtch->setText(QString("%1").arg(switchNo+1, 2, 10, QChar('0'))); + swtch->setText(QString("%1").arg(switchNo+1, 2, 10, QChar('0')) ); + //swtch->setText(QString("%1").arg(switchNo+1, 2, 10, QChar('0')) + ": " + namestring); swtch->setAlignment(Qt::AlignCenter); m_logicSwitchMap.insert(switchNo, swtch); return swtch; diff --git a/companion/src/translations/companion_sv.ts b/companion/src/translations/companion_sv.ts index f254cc45f24..923112a3880 100644 --- a/companion/src/translations/companion_sv.ts +++ b/companion/src/translations/companion_sv.ts @@ -11942,6 +11942,8 @@ Använd CTRL + skroll eller PAGE UP/DOWN tangenterna för att ändra tiden i st Delete decompress folder: %1 Radera uppackningskatalog: %1 +<<<<<<< HEAD +======= Component id: %1 exceeds maximum application settings components: %2! Komponent id: %1 överskrider "maximum application settings components": %2! @@ -11962,6 +11964,7 @@ Använd CTRL + skroll eller PAGE UP/DOWN tangenterna för att ändra tiden i st Copy directory structure Koipera katalogstruktur +>>>>>>> e898e851460f0b76873d4442cdc8144474863f5e UpdateMultiProtocol diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 90982531459..049ef262a97 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -223,6 +223,7 @@ enum LogicalSwitchesFunctions { LS_FUNC_ADIFFEGREATER, LS_FUNC_TIMER, LS_FUNC_STICKY, + LS_FUNC_SAFE, LS_FUNC_COUNT SKIP, LS_FUNC_MAX SKIP = LS_FUNC_COUNT-1 }; diff --git a/radio/src/switches.h b/radio/src/switches.h index 4a7f995b28f..0104c8baf3e 100644 --- a/radio/src/switches.h +++ b/radio/src/switches.h @@ -32,6 +32,7 @@ enum LogicalSwitchFamilies { LS_FAMILY_DIFF, LS_FAMILY_TIMER, LS_FAMILY_STICKY, + LS_FAMILY_SAFE, LS_FAMILY_RANGE, LS_FAMILY_EDGE }; diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index d9ce70ba9be..cca8d523a14 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -325,7 +325,9 @@ const char STR_MENUCURVES[] = TR_MENUCURVES; const char STR_MENUCURVE[] = TR_MENUCURVE; const char STR_MENULOGICALSWITCH[] = TR_MENULOGICALSWITCH; const char STR_MENULOGICALSWITCHES[] = TR_MENULOGICALSWITCHES; +const char STR_CUST_LOGICALSWITCH_LABEL[] = TR_CUST_LOGICALSWITCH_LABEL; const char STR_MENUCUSTOMFUNC[] = TR_MENUCUSTOMFUNC; +const char STR_CUST_FUNC_CUST_LABEL[] = TR_CUST_FUNC_CUST_LABEL; const char STR_SPLASHSCREEN[] = TR_SPLASHSCREEN; const char STR_PLAY_HELLO[] = TR_PLAY_HELLO; const char STR_PWR_ON_DELAY[] = TR_PWR_ON_DELAY; diff --git a/radio/src/translations.h b/radio/src/translations.h index 5d7c0daa0b0..c448216869c 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -509,7 +509,9 @@ extern const char STR_MENUCURVES[]; extern const char STR_MENUCURVE[]; extern const char STR_MENULOGICALSWITCH[]; extern const char STR_MENULOGICALSWITCHES[]; +extern const char STR_CUST_LOGICALSWITCH_LABEL[]; extern const char STR_MENUCUSTOMFUNC[]; +extern const char STR_CUST_FUNC_CUST_LABEL[]; extern const char STR_MENUCUSTOMSCRIPTS[]; extern const char STR_MENUTELEMETRY[]; extern const char STR_MENUSTAT[]; diff --git a/radio/src/translations/cn.h.txt b/radio/src/translations/cn.h.txt new file mode 100644 index 00000000000..b007d701f3c --- /dev/null +++ b/radio/src/translations/cn.h.txt @@ -0,0 +1,19 @@ +#define TR_CUST_FUNC_CUST_LABEL "Name" + +//if LCD_W >= 212 + //#define TR_CSWTIMER "Timer" + //#define TR_CSWSTICKY "Stcky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Range" + //#define TR_CSWSTAY "Edge" +//#else + //#define TR_CSWTIMER "Tim" + //#define TR_CSWSTICKY "Stky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Rnge" + //#define TR_CSWSTAY "Edge" +//#endif + +//#define TR_CSWEQUAL "a=x" + +#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a~x","a>x","ax","|a|b","a= 212 #define TR_CSWTIMER "Stopky" #define TR_CSWSTICKY "Sticky" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "Dosah" #define TR_CSWSTAY "Edge" #else #define TR_CSWTIMER "Tim" #define TR_CSWSTICKY "Stky" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "Rnge" #define TR_CSWSTAY "Edge" #endif diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt new file mode 100644 index 00000000000..b007d701f3c --- /dev/null +++ b/radio/src/translations/cz.h.txt @@ -0,0 +1,19 @@ +#define TR_CUST_FUNC_CUST_LABEL "Name" + +//if LCD_W >= 212 + //#define TR_CSWTIMER "Timer" + //#define TR_CSWSTICKY "Stcky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Range" + //#define TR_CSWSTAY "Edge" +//#else + //#define TR_CSWTIMER "Tim" + //#define TR_CSWSTICKY "Stky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Rnge" + //#define TR_CSWSTAY "Edge" +//#endif + +//#define TR_CSWEQUAL "a=x" + +#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a~x","a>x","ax","|a|b","a= 212 + //#define TR_CSWTIMER "Timer" + //#define TR_CSWSTICKY "Stcky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Range" + //#define TR_CSWSTAY "Edge" +//#else + //#define TR_CSWTIMER "Tim" + //#define TR_CSWSTICKY "Stky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Rnge" + //#define TR_CSWSTAY "Edge" +//#endif + +//#define TR_CSWEQUAL "a=x" + +#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a~x","a>x","ax","|a|b","a= 212 #define TR_CSWTIMER "Timer" #define TR_CSWSTICKY "Stcky" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "Range" #define TR_CSWSTAY "Edge" #else #define TR_CSWTIMER "Tim" #define TR_CSWSTICKY "Stky" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "Rnge" #define TR_CSWSTAY "Edge" #endif #define TR_CSWEQUAL "a=x" -#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a" STR_CHAR_TILDE "x","a>x","ax","|a|b","ax","ax","|a|b","ax","ax","|a|b","a>>>>>> e898e851460f0b76873d4442cdc8144474863f5e #define TR_SF_TRAINER "Trainer" #define TR_SF_INST_TRIM "Inst. Trim" @@ -476,7 +482,9 @@ #define TR_MENUCURVE "CURVE" #define TR_MENULOGICALSWITCH "LOGICAL SWITCH" #define TR_MENULOGICALSWITCHES "LOGICAL SWITCHES" +#define TR_CUST_LOGICALSWITCH_LABEL "Name" #define TR_MENUCUSTOMFUNC "SPECIAL FUNCTIONS" +#define TR_CUST_FUNC_CUST_LABEL "Name" #define TR_MENUCUSTOMSCRIPTS "CUSTOM SCRIPTS" #define TR_MENUTELEMETRY "TELEMETRY" #define TR_MENUSTAT "STATS" diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt new file mode 100644 index 00000000000..b007d701f3c --- /dev/null +++ b/radio/src/translations/en.h.txt @@ -0,0 +1,19 @@ +#define TR_CUST_FUNC_CUST_LABEL "Name" + +//if LCD_W >= 212 + //#define TR_CSWTIMER "Timer" + //#define TR_CSWSTICKY "Stcky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Range" + //#define TR_CSWSTAY "Edge" +//#else + //#define TR_CSWTIMER "Tim" + //#define TR_CSWSTICKY "Stky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Rnge" + //#define TR_CSWSTAY "Edge" +//#endif + +//#define TR_CSWEQUAL "a=x" + +#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a~x","a>x","ax","|a|b","a= 212 #define TR_CSWTIMER "Timer" #define TR_CSWSTICKY "Pega" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "Rango" #define TR_CSWSTAY "Borde" #else #define TR_CSWTIMER "Tim" #define TR_CSWSTICKY "Pega" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "Rngo" #define TR_CSWSTAY "Bord" #endif #define TR_CSWEQUAL "a=x" -#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a" STR_CHAR_TILDE "x","a>x","ax","|a|b","ax","ax","|a|b","a= 212 + //#define TR_CSWTIMER "Timer" + //#define TR_CSWSTICKY "Stcky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Range" + //#define TR_CSWSTAY "Edge" +//#else + //#define TR_CSWTIMER "Tim" + //#define TR_CSWSTICKY "Stky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Rnge" + //#define TR_CSWSTAY "Edge" +//#endif + +//#define TR_CSWEQUAL "a=x" + +#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a~x","a>x","ax","|a|b","ax","ax","|a|b","ax","ax","|a|b","a= 212 + //#define TR_CSWTIMER "Timer" + //#define TR_CSWSTICKY "Stcky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Range" + //#define TR_CSWSTAY "Edge" +//#else + //#define TR_CSWTIMER "Tim" + //#define TR_CSWSTICKY "Stky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Rnge" + //#define TR_CSWSTAY "Edge" +//#endif + +//#define TR_CSWEQUAL "a=x" + +#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a~x","a>x","ax","|a|b","a= 212 + //#define TR_CSWTIMER "Timer" + //#define TR_CSWSTICKY "Stcky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Range" + //#define TR_CSWSTAY "Edge" +//#else + //#define TR_CSWTIMER "Tim" + //#define TR_CSWSTICKY "Stky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Rnge" + //#define TR_CSWSTAY "Edge" +//#endif + +//#define TR_CSWEQUAL "a=x" + +#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a~x","a>x","ax","|a|b","a= 212 + //#define TR_CSWTIMER "Timer" + //#define TR_CSWSTICKY "Stcky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Range" + //#define TR_CSWSTAY "Edge" +//#else + //#define TR_CSWTIMER "Tim" + //#define TR_CSWSTICKY "Stky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Rnge" + //#define TR_CSWSTAY "Edge" +//#endif + +//#define TR_CSWEQUAL "a=x" + +#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a~x","a>x","ax","|a|b","a= 212 #define TR_CSWTIMER "Timer" #define TR_CSWSTICKY "Stcky" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "Range" #define TR_CSWSTAY "Edge" #else #define TR_CSWTIMER "Tim" #define TR_CSWSTICKY "Stky" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "Rnge" #define TR_CSWSTAY "Edge" #endif #define TR_CSWEQUAL "a=x" -#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a" STR_CHAR_TILDE "x","a>x","ax","|a|b","ax","ax","|a|b","a= 212 #define TR_CSWTIMER "Timer" #define TR_CSWSTICKY "Stcky" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "Range" #define TR_CSWSTAY "Edge" #else #define TR_CSWTIMER "Tim" #define TR_CSWSTICKY "Glue" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "Rnge" #define TR_CSWSTAY "Edge" #endif #define TR_CSWEQUAL "a=x" -#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a" STR_CHAR_TILDE "x","a>x","ax","|a|b","ax","ax","|a|b","a= 212 + //#define TR_CSWTIMER "Timer" + //#define TR_CSWSTICKY "Stcky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Range" + //#define TR_CSWSTAY "Edge" +//#else + //#define TR_CSWTIMER "Tim" + //#define TR_CSWSTICKY "Stky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Rnge" + //#define TR_CSWSTAY "Edge" +//#endif + +//#define TR_CSWEQUAL "a=x" + +#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a~x","a>x","ax","|a|b","a= 212 #define TR_CSWTIMER "Timer" #define TR_CSWSTICKY "Stały" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "Zasię" #define TR_CSWSTAY "Brzeg" #else #define TR_CSWTIMER "Tim" #define TR_CSWSTICKY "Stały" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "Zasię" #define TR_CSWSTAY "Brzeg" #endif #define TR_CSWEQUAL "a=x" -#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a" STR_CHAR_TILDE "x","a>x","ax","|a|b","ax","ax","|a|b","a= 212 + //#define TR_CSWTIMER "Timer" + //#define TR_CSWSTICKY "Stcky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Range" + //#define TR_CSWSTAY "Edge" +//#else + //#define TR_CSWTIMER "Tim" + //#define TR_CSWSTICKY "Stky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Rnge" + //#define TR_CSWSTAY "Edge" +//#endif + +//#define TR_CSWEQUAL "a=x" + +#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a~x","a>x","ax","|a|b","a= 212 + //#define TR_CSWTIMER "Timer" + //#define TR_CSWSTICKY "Stcky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Range" + //#define TR_CSWSTAY "Edge" +//#else + //#define TR_CSWTIMER "Tim" + //#define TR_CSWSTICKY "Stky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Rnge" + //#define TR_CSWSTAY "Edge" +//#endif + +//#define TR_CSWEQUAL "a=x" + +#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a~x","a>x","ax","|a|b","a= 212 #define TR_CSWTIMER "Timer" #define TR_CSWSTICKY "Seg" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "Vidd" #define TR_CSWSTAY "Kant" #else #define TR_CSWTIMER "Tim" #define TR_CSWSTICKY "Seg" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "Vidd" #define TR_CSWSTAY "Kant" #endif #define TR_CSWEQUAL "a=x" -#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a" STR_CHAR_TILDE "x","a>x","ax","|a|b","ax","ax","|a|b","a= 212 + //#define TR_CSWTIMER "Timer" + //#define TR_CSWSTICKY "Stcky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Range" + //#define TR_CSWSTAY "Edge" +//#else + //#define TR_CSWTIMER "Tim" + //#define TR_CSWSTICKY "Stky" +#define TR_CSWSAFE "Safe" + //#define TR_CSWRANGE "Rnge" + //#define TR_CSWSTAY "Edge" +//#endif + +//#define TR_CSWEQUAL "a=x" + +#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a~x","a>x","ax","|a|b","a= 212 #define TR_CSWTIMER "定時" #define TR_CSWSTICKY "粘滯" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "範圍" #define TR_CSWSTAY "邊沿" #else #define TR_CSWTIMER "定時" #define TR_CSWSTICKY "粘滯" + #define TR_CSWSAFE "Safe" #define TR_CSWRANGE "範圍" #define TR_CSWSTAY "邊沿" #endif #define TR_CSWEQUAL "a=x" -#define TR_VCSWFUNC "---",TR_CSWEQUAL,"a" STR_CHAR_TILDE "x","a>x","ax","|a|b","ax","ax","|a|b","a