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

[Companion] Radio data translation/strings (#5554)

* [Companion] Add Qt tr() functions to all radio data classes instead of using generic QObject type.  (no functional changes)

* Small fix for gcc.

* Move more element name string generation to individual classes; settle on nameToString as function name.

* Also put firmware build options translations into Firmware scope.
This commit is contained in:
Max Paperno 2017-12-21 12:26:11 -05:00 committed by Bertrand Songis
parent 7806c2096d
commit a951292f27
34 changed files with 606 additions and 514 deletions

View file

@ -270,27 +270,27 @@ const int Boards::getCapability(Board::Type board, Board::Capability capability)
const QString Boards::getAxisName(int index) const QString Boards::getAxisName(int index)
{ {
const QString axes[] = { const QString axes[] = {
QObject::tr("Left Horizontal"), tr("Left Horizontal"),
QObject::tr("Left Vertical"), tr("Left Vertical"),
QObject::tr("Right Vertical"), tr("Right Vertical"),
QObject::tr("Right Horizontal"), tr("Right Horizontal"),
QObject::tr("Aux. 1"), tr("Aux. 1"),
QObject::tr("Aux. 2"), tr("Aux. 2"),
}; };
if (index < (int)DIM(axes)) if (index < (int)DIM(axes))
return axes[index]; return axes[index];
else else
return QObject::tr("Unknown"); return tr("Unknown");
} }
const QString Boards::getAnalogInputName(Board::Type board, unsigned index) const QString Boards::getAnalogInputName(Board::Type board, unsigned index)
{ {
if ((int)index < getBoardCapability(board, Board::Sticks)) { if ((int)index < getBoardCapability(board, Board::Sticks)) {
const QString sticks[] = { const QString sticks[] = {
QObject::tr("Rud"), tr("Rud"),
QObject::tr("Ele"), tr("Ele"),
QObject::tr("Thr"), tr("Thr"),
QObject::tr("Ail") tr("Ail")
}; };
return sticks[index]; return sticks[index];
} }
@ -398,7 +398,7 @@ const QString Boards::getBoardName(Board::Type board)
case BOARD_X10: case BOARD_X10:
return "X10"; return "X10";
default: default:
return QObject::tr("Unknown"); return tr("Unknown");
} }
} }
*/ */

View file

@ -21,6 +21,7 @@
#ifndef _BOARDS_H_ #ifndef _BOARDS_H_
#define _BOARDS_H_ #define _BOARDS_H_
#include <QtCore>
#include <QObject> #include <QObject>
#include <QString> #include <QString>
@ -140,6 +141,8 @@ namespace Board {
class Boards class Boards
{ {
Q_DECLARE_TR_FUNCTIONS(Boards)
public: public:
Boards(Board::Type board) Boards(Board::Type board)

View file

@ -34,17 +34,17 @@ QString CurveReference::toString(const ModelData * model, bool verbose) const
switch(type) { switch(type) {
case CURVE_REF_DIFF: case CURVE_REF_DIFF:
ret = QObject::tr("Diff(%1)").arg(Helpers::getAdjustmentString(value, model)); ret = tr("Diff(%1)").arg(Helpers::getAdjustmentString(value, model));
break; break;
case CURVE_REF_EXPO: case CURVE_REF_EXPO:
ret = QObject::tr("Expo(%1)").arg(Helpers::getAdjustmentString(value, model)); ret = tr("Expo(%1)").arg(Helpers::getAdjustmentString(value, model));
break; break;
case CURVE_REF_FUNC: case CURVE_REF_FUNC:
ret = QString("x>0" "x<0" "|x|" "f>0" "f<0" "|f|").mid(3*(value-1), 3); ret = QString("x>0" "x<0" "|x|" "f>0" "f<0" "|f|").mid(3*(value-1), 3);
if (verbose) if (verbose)
ret = QObject::tr("Function(%1)").arg(ret); ret = tr("Function(%1)").arg(ret);
break; break;
default: default:
@ -53,7 +53,7 @@ QString CurveReference::toString(const ModelData * model, bool verbose) const
else else
ret = CurveData().nameToString(idx); ret = CurveData().nameToString(idx);
if (verbose) if (verbose)
ret = QObject::tr("Curve(%1)").arg(ret); ret = tr("Curve(%1)").arg(ret);
if (value < 0) if (value < 0)
ret.prepend(CPN_STR_SW_INDICATOR_REV); ret.prepend(CPN_STR_SW_INDICATOR_REV);
break; break;

View file

@ -26,6 +26,8 @@
class ModelData; class ModelData;
class CurveReference { class CurveReference {
Q_DECLARE_TR_FUNCTIONS(CurveReference)
public: public:
enum CurveRefType { enum CurveRefType {
CURVE_REF_DIFF, CURVE_REF_DIFF,

View file

@ -37,71 +37,71 @@ bool CustomFunctionData::isEmpty() const
return (swtch.type == SWITCH_TYPE_NONE); return (swtch.type == SWITCH_TYPE_NONE);
} }
QString CustomFunctionData::toString(int index, bool globalContext) const QString CustomFunctionData::nameToString(int index, bool globalContext) const
{ {
return RadioData::getElementName((globalContext ? QObject::tr("GF") : QObject::tr("SF")), index+1, 0, true); return RadioData::getElementName((globalContext ? tr("GF") : tr("SF")), index+1, 0, true);
} }
QString CustomFunctionData::funcToString(const ModelData * model) const QString CustomFunctionData::funcToString(const ModelData * model) const
{ {
if (func >= FuncOverrideCH1 && func <= FuncOverrideCH32) if (func >= FuncOverrideCH1 && func <= FuncOverrideCH32)
return QObject::tr("Override %1").arg(RawSource(SOURCE_TYPE_CH, func).toString(model)); return tr("Override %1").arg(RawSource(SOURCE_TYPE_CH, func).toString(model));
else if (func == FuncTrainer) else if (func == FuncTrainer)
return QObject::tr("Trainer"); return tr("Trainer");
else if (func == FuncTrainerRUD) else if (func == FuncTrainerRUD)
return QObject::tr("Trainer RUD"); return tr("Trainer RUD");
else if (func == FuncTrainerELE) else if (func == FuncTrainerELE)
return QObject::tr("Trainer ELE"); return tr("Trainer ELE");
else if (func == FuncTrainerTHR) else if (func == FuncTrainerTHR)
return QObject::tr("Trainer THR"); return tr("Trainer THR");
else if (func == FuncTrainerAIL) else if (func == FuncTrainerAIL)
return QObject::tr("Trainer AIL"); return tr("Trainer AIL");
else if (func == FuncInstantTrim) else if (func == FuncInstantTrim)
return QObject::tr("Instant Trim"); return tr("Instant Trim");
else if (func == FuncPlaySound) else if (func == FuncPlaySound)
return QObject::tr("Play Sound"); return tr("Play Sound");
else if (func == FuncPlayHaptic) else if (func == FuncPlayHaptic)
return QObject::tr("Haptic"); return tr("Haptic");
else if (func == FuncReset) else if (func == FuncReset)
return QObject::tr("Reset"); return tr("Reset");
else if (func >= FuncSetTimer1 && func <= FuncSetTimer3) else if (func >= FuncSetTimer1 && func <= FuncSetTimer3)
return QObject::tr("Set Timer %1").arg(func-FuncSetTimer1+1); return tr("Set Timer %1").arg(func-FuncSetTimer1+1);
else if (func == FuncVario) else if (func == FuncVario)
return QObject::tr("Vario"); return tr("Vario");
else if (func == FuncPlayPrompt) else if (func == FuncPlayPrompt)
return QObject::tr("Play Track"); return tr("Play Track");
else if (func == FuncPlayBoth) else if (func == FuncPlayBoth)
return QObject::tr("Play Both"); return tr("Play Both");
else if (func == FuncPlayValue) else if (func == FuncPlayValue)
return QObject::tr("Play Value"); return tr("Play Value");
else if (func == FuncPlayScript) else if (func == FuncPlayScript)
return QObject::tr("Play Script"); return tr("Play Script");
else if (func == FuncLogs) else if (func == FuncLogs)
return QObject::tr("SD Logs"); return tr("SD Logs");
else if (func == FuncVolume) else if (func == FuncVolume)
return QObject::tr("Volume"); return tr("Volume");
else if (func == FuncBacklight) else if (func == FuncBacklight)
return QObject::tr("Backlight"); return tr("Backlight");
else if (func == FuncScreenshot) else if (func == FuncScreenshot)
return QObject::tr("Screenshot"); return tr("Screenshot");
else if (func == FuncBackgroundMusic) else if (func == FuncBackgroundMusic)
return QObject::tr("Background Music"); return tr("Background Music");
else if (func == FuncBackgroundMusicPause) else if (func == FuncBackgroundMusicPause)
return QObject::tr("Background Music Pause"); return tr("Background Music Pause");
else if (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast) else if (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast)
return QObject::tr("Adjust %1").arg(RawSource(SOURCE_TYPE_GVAR, func-FuncAdjustGV1).toString(model)); return tr("Adjust %1").arg(RawSource(SOURCE_TYPE_GVAR, func-FuncAdjustGV1).toString(model));
else if (func == FuncSetFailsafeInternalModule) else if (func == FuncSetFailsafeInternalModule)
return QObject::tr("SetFailsafe Int. Module"); return tr("SetFailsafe Int. Module");
else if (func == FuncSetFailsafeExternalModule) else if (func == FuncSetFailsafeExternalModule)
return QObject::tr("SetFailsafe Ext. Module"); return tr("SetFailsafe Ext. Module");
else if (func == FuncRangeCheckInternalModule) else if (func == FuncRangeCheckInternalModule)
return QObject::tr("RangeCheck Int. Module"); return tr("RangeCheck Int. Module");
else if (func == FuncRangeCheckExternalModule) else if (func == FuncRangeCheckExternalModule)
return QObject::tr("RangeCheck Ext. Module"); return tr("RangeCheck Ext. Module");
else if (func == FuncBindInternalModule) else if (func == FuncBindInternalModule)
return QObject::tr("Bind Int. Module"); return tr("Bind Int. Module");
else if (func == FuncBindExternalModule) else if (func == FuncBindExternalModule)
return QObject::tr("Bind Ext. Module"); return tr("Bind Ext. Module");
else { else {
return QString("???"); // Highlight unknown functions with output of question marks.(BTW should not happen that we do not know what a function is) return QString("???"); // Highlight unknown functions with output of question marks.(BTW should not happen that we do not know what a function is)
} }
@ -113,20 +113,20 @@ void CustomFunctionData::populateResetParams(const ModelData * model, QComboBox
Firmware * firmware = Firmware::getCurrentVariant(); Firmware * firmware = Firmware::getCurrentVariant();
Board::Type board = firmware->getBoard(); Board::Type board = firmware->getBoard();
b->addItem(QObject::tr("Timer1"), val++); b->addItem(tr("Timer1"), val++);
b->addItem(QObject::tr("Timer2"), val++); b->addItem(tr("Timer2"), val++);
if (IS_ARM(board)) { if (IS_ARM(board)) {
b->addItem( QObject::tr("Timer3"), val++); b->addItem( tr("Timer3"), val++);
} }
b->addItem(QObject::tr("Flight"), val++); b->addItem(tr("Flight"), val++);
b->addItem(QObject::tr("Telemetry"), val++); b->addItem(tr("Telemetry"), val++);
int reCount = firmware->getCapability(RotaryEncoders); int reCount = firmware->getCapability(RotaryEncoders);
if (reCount == 1) { if (reCount == 1) {
b->addItem(QObject::tr("Rotary Encoder"), val++); b->addItem(tr("Rotary Encoder"), val++);
} }
else if (reCount == 2) { else if (reCount == 2) {
b->addItem(QObject::tr("REa"), val++); b->addItem(tr("REa"), val++);
b->addItem(QObject::tr("REb"), val++); b->addItem(tr("REb"), val++);
} }
if ((int)value < b->count()) { if ((int)value < b->count()) {
b->setCurrentIndex(value); b->setCurrentIndex(value);
@ -162,21 +162,21 @@ QString CustomFunctionData::paramToString(const ModelData * model) const
return QString("%1").arg(param); return QString("%1").arg(param);
} }
else if (func==FuncLogs) { else if (func==FuncLogs) {
return QString("%1").arg(param/10.0) + QObject::tr("s"); return QString("%1").arg(param/10.0) + tr("s");
} }
else if (func==FuncPlaySound) { else if (func==FuncPlaySound) {
CustomFunctionData::populatePlaySoundParams(qs); CustomFunctionData::populatePlaySoundParams(qs);
if (param>=0 && param<(int)qs.count()) if (param>=0 && param<(int)qs.count())
return qs.at(param); return qs.at(param);
else else
return QObject::tr("<font color=red><b>Inconsistent parameter</b></font>"); return tr("<font color=red><b>Inconsistent parameter</b></font>");
} }
else if (func==FuncPlayHaptic) { else if (func==FuncPlayHaptic) {
CustomFunctionData::populateHapticParams(qs); CustomFunctionData::populateHapticParams(qs);
if (param>=0 && param<(int)qs.count()) if (param>=0 && param<(int)qs.count())
return qs.at(param); return qs.at(param);
else else
return QObject::tr("<font color=red><b>Inconsistent parameter</b></font>"); return tr("<font color=red><b>Inconsistent parameter</b></font>");
} }
else if (func==FuncReset) { else if (func==FuncReset) {
QComboBox cb; QComboBox cb;
@ -185,7 +185,7 @@ QString CustomFunctionData::paramToString(const ModelData * model) const
if (pos >= 0) if (pos >= 0)
return cb.itemText(pos); return cb.itemText(pos);
else else
return QObject::tr("<font color=red><b>Inconsistent parameter</b></font>"); return tr("<font color=red><b>Inconsistent parameter</b></font>");
} }
else if ((func==FuncVolume)|| (func==FuncPlayValue)) { else if ((func==FuncVolume)|| (func==FuncPlayValue)) {
RawSource item(param); RawSource item(param);
@ -202,13 +202,13 @@ QString CustomFunctionData::paramToString(const ModelData * model) const
else if ((func>=FuncAdjustGV1) && (func<FuncCount)) { else if ((func>=FuncAdjustGV1) && (func<FuncCount)) {
switch (adjustMode) { switch (adjustMode) {
case FUNC_ADJUST_GVAR_CONSTANT: case FUNC_ADJUST_GVAR_CONSTANT:
return QObject::tr("Value ")+QString("%1").arg(param); return tr("Value ")+QString("%1").arg(param);
case FUNC_ADJUST_GVAR_SOURCE: case FUNC_ADJUST_GVAR_SOURCE:
case FUNC_ADJUST_GVAR_GVAR: case FUNC_ADJUST_GVAR_GVAR:
return RawSource(param).toString(); return RawSource(param).toString();
case FUNC_ADJUST_GVAR_INCDEC: case FUNC_ADJUST_GVAR_INCDEC:
if (param==0) return QObject::tr("Decr:") + " -1"; if (param==0) return tr("Decr:") + " -1";
else return QObject::tr("Incr:") + " +1"; else return tr("Incr:") + " +1";
} }
} }
return ""; return "";
@ -217,14 +217,14 @@ QString CustomFunctionData::paramToString(const ModelData * model) const
QString CustomFunctionData::repeatToString() const QString CustomFunctionData::repeatToString() const
{ {
if (repeatParam == -1) { if (repeatParam == -1) {
return QObject::tr("played once, not during startup"); return tr("played once, not during startup");
} }
else if (repeatParam == 0) { else if (repeatParam == 0) {
return ""; return "";
} }
else { else {
unsigned int step = IS_ARM(getCurrentBoard()) ? 1 : 10; unsigned int step = IS_ARM(getCurrentBoard()) ? 1 : 10;
return QObject::tr("repeat(%1s)").arg(step*repeatParam); return tr("repeat(%1s)").arg(step*repeatParam);
} }
} }
@ -237,7 +237,7 @@ QString CustomFunctionData::enabledToString() const
(func==FuncVolume) || (func==FuncVolume) ||
(func <= FuncInstantTrim)) { (func <= FuncInstantTrim)) {
if (!enabled) { if (!enabled) {
return QObject::tr("DISABLED"); return tr("DISABLED");
} }
} }
return ""; return "";
@ -245,8 +245,8 @@ QString CustomFunctionData::enabledToString() const
void CustomFunctionData::convert(RadioDataConversionState & cstate) void CustomFunctionData::convert(RadioDataConversionState & cstate)
{ {
cstate.setComponent("CFN", 8); cstate.setComponent(tr("CFN"), 8);
cstate.setSubComp(toString(cstate.subCompIdx, (cstate.toModel() ? false : true))); cstate.setSubComp(nameToString(cstate.subCompIdx, (cstate.toModel() ? false : true)));
swtch.convert(cstate); swtch.convert(cstate);
if (func == FuncVolume || func == FuncPlayValue || (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast && adjustMode == 1)) { if (func == FuncVolume || func == FuncPlayValue || (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast && adjustMode == 1)) {
param = RawSource(param).convert(cstate.withComponentField("PARAM")).toValue(); param = RawSource(param).convert(cstate.withComponentField("PARAM")).toValue();

View file

@ -79,7 +79,9 @@ enum GVarAdjustModes
FUNC_ADJUST_GVAR_INCDEC FUNC_ADJUST_GVAR_INCDEC
}; };
class CustomFunctionData { // Function Switches data class CustomFunctionData {
Q_DECLARE_TR_FUNCTIONS(CustomFunctionData)
public: public:
CustomFunctionData(AssignFunc func=FuncOverrideCH1) { clear(); this->func = func; } CustomFunctionData(AssignFunc func=FuncOverrideCH1) { clear(); this->func = func; }
RawSwitch swtch; RawSwitch swtch;
@ -92,7 +94,7 @@ class CustomFunctionData { // Function Switches data
void clear(); void clear();
bool isEmpty() const; bool isEmpty() const;
QString toString(int index, bool globalContext = false) const; QString nameToString(int index, bool globalContext = false) const;
QString funcToString(const ModelData * model = NULL) const; QString funcToString(const ModelData * model = NULL) const;
QString paramToString(const ModelData * model) const; QString paramToString(const ModelData * model) const;
QString repeatToString() const; QString repeatToString() const;

View file

@ -22,9 +22,13 @@
#define _EEPROMIMPORTEXPORT_H_ #define _EEPROMIMPORTEXPORT_H_
#include "customdebug.h" #include "customdebug.h"
#include <QtCore>
#include <QBitArray> #include <QBitArray>
class DataField { class DataField {
Q_DECLARE_TR_FUNCTIONS(DataField)
public: public:
DataField(DataField * parent, const char * name=""): DataField(DataField * parent, const char * name=""):
parent(parent), parent(parent),
@ -742,7 +746,7 @@ class ConversionField: public TransformedField {
if (table) { if (table) {
if (!table->exportValue(_field, _field)) { if (!table->exportValue(_field, _field)) {
setError(error.isEmpty() ? QObject::tr("Conversion error on field %1").arg(name) : error); setError(error.isEmpty() ? tr("Conversion error on field %1").arg(name) : error);
} }
return; return;
} }

View file

@ -64,31 +64,32 @@ void unregisterEEpromInterfaces()
OpenTxEepromCleanup(); OpenTxEepromCleanup();
} }
#if 0 // TODO: remove if unused, currently commented out in mdiChild.cpp
// TODO: No GUI here, e.g. return string list instead // TODO: No GUI here, e.g. return string list instead
void ShowEepromErrors(QWidget *parent, const QString &title, const QString &mainMessage, unsigned long errorsFound) void EEPROMInterface::showEepromErrors(QWidget *parent, const QString &title, const QString &mainMessage, unsigned long errorsFound)
{ {
std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound); std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound);
QStringList errorsList; QStringList errorsList;
errorsList << QT_TRANSLATE_NOOP("EepromInterface", "Possible causes for this:"); errorsList << tr("Possible causes for this:");
if (errors.test(UNSUPPORTED_NEWER_VERSION)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is from a newer version of OpenTX"); } if (errors.test(UNSUPPORTED_NEWER_VERSION)) { errorsList << tr("- Eeprom is from a newer version of OpenTX"); }
if (errors.test(NOT_OPENTX)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from OpenTX"); } if (errors.test(NOT_OPENTX)) { errorsList << tr("- Eeprom is not from OpenTX"); }
if (errors.test(NOT_TH9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from Th9X"); } if (errors.test(NOT_TH9X)) { errorsList << tr("- Eeprom is not from Th9X"); }
if (errors.test(NOT_GRUVIN9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from Gruvin9X"); } if (errors.test(NOT_GRUVIN9X)) { errorsList << tr("- Eeprom is not from Gruvin9X"); }
if (errors.test(NOT_ERSKY9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from ErSky9X"); } if (errors.test(NOT_ERSKY9X)) { errorsList << tr("- Eeprom is not from ErSky9X"); }
if (errors.test(NOT_ER9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from Er9X"); } if (errors.test(NOT_ER9X)) { errorsList << tr("- Eeprom is not from Er9X"); }
if (errors.test(WRONG_SIZE)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom size is invalid"); } if (errors.test(WRONG_SIZE)) { errorsList << tr("- Eeprom size is invalid"); }
if (errors.test(WRONG_FILE_SYSTEM)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom file system is invalid"); } if (errors.test(WRONG_FILE_SYSTEM)) { errorsList << tr("- Eeprom file system is invalid"); }
if (errors.test(UNKNOWN_BOARD)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is from a unknown board"); } if (errors.test(UNKNOWN_BOARD)) { errorsList << tr("- Eeprom is from a unknown board"); }
if (errors.test(WRONG_BOARD)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is from the wrong board"); } if (errors.test(WRONG_BOARD)) { errorsList << tr("- Eeprom is from the wrong board"); }
if (errors.test(BACKUP_NOT_SUPPORTED)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom backup not supported"); } if (errors.test(BACKUP_NOT_SUPPORTED)) { errorsList << tr("- Eeprom backup not supported"); }
if (errors.test(UNKNOWN_ERROR)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Something that couldn't be guessed, sorry"); } if (errors.test(UNKNOWN_ERROR)) { errorsList << tr("- Something that couldn't be guessed, sorry"); }
if (errors.test(HAS_WARNINGS)) { if (errors.test(HAS_WARNINGS)) {
errorsList << QT_TRANSLATE_NOOP("EepromInterface", "Warning:"); errorsList << tr("Warning:");
if (errors.test(WARNING_WRONG_FIRMWARE)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"); } if (errors.test(WARNING_WRONG_FIRMWARE)) { errorsList << tr("- Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"); }
} }
QMessageBox msgBox(parent); QMessageBox msgBox(parent);
@ -99,14 +100,15 @@ void ShowEepromErrors(QWidget *parent, const QString &title, const QString &main
msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec(); msgBox.exec();
} }
#endif
// TODO: No GUI here, e.g. return string list instead // TODO: No GUI here, e.g. return string list instead
void ShowEepromWarnings(QWidget *parent, const QString &title, unsigned long errorsFound) void EEPROMInterface::showEepromWarnings(QWidget *parent, const QString &title, unsigned long errorsFound)
{ {
std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound); std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound);
QStringList warningsList; QStringList warningsList;
if (errors.test(WARNING_WRONG_FIRMWARE)) { warningsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"); } if (errors.test(WARNING_WRONG_FIRMWARE)) { warningsList << tr("- Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"); }
if (errors.test(OLD_VERSION)) { warningsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your eeprom is from an old version of OpenTX, upgrading!\n To keep your original file as a backup, please choose File -> Save As specifying a different name."); } if (errors.test(OLD_VERSION)) { warningsList << tr("- Your eeprom is from an old version of OpenTX, upgrading!\n To keep your original file as a backup, please choose File -> Save As specifying a different name."); }
QMessageBox msgBox(parent); QMessageBox msgBox(parent);
msgBox.setWindowTitle(title); msgBox.setWindowTitle(title);

View file

@ -21,15 +21,19 @@
#ifndef _EEPROMINTERFACE_H_ #ifndef _EEPROMINTERFACE_H_
#define _EEPROMINTERFACE_H_ #define _EEPROMINTERFACE_H_
#include "boards.h"
#include "macros.h" #include "macros.h"
#include "radiodata.h" #include "radiodata.h"
#include "../../radio/src/definitions.h" #include "../../radio/src/definitions.h"
#include "simulatorinterface.h" #include "simulatorinterface.h"
#include <QtCore>
#include <QStringList> #include <QStringList>
#include <QList> #include <QList>
#include <iostream>
#include <QDebug> #include <QDebug>
#include <iostream>
const uint8_t modn12x3[4][4]= { const uint8_t modn12x3[4][4]= {
{1, 2, 3, 4}, {1, 2, 3, 4},
{1, 3, 2, 4}, {1, 3, 2, 4},
@ -143,9 +147,10 @@ enum Capability {
HasModelCategories HasModelCategories
}; };
class SimulatorInterface;
class EEPROMInterface class EEPROMInterface
{ {
Q_DECLARE_TR_FUNCTIONS(EEPROMInterface)
public: public:
EEPROMInterface(Board::Type board): EEPROMInterface(Board::Type board):
@ -167,6 +172,9 @@ class EEPROMInterface
virtual int getSize(const GeneralSettings &) = 0; virtual int getSize(const GeneralSettings &) = 0;
//static void showEepromErrors(QWidget *parent, const QString &title, const QString &mainMessage, unsigned long errorsFound);
static void showEepromWarnings(QWidget *parent, const QString &title, unsigned long errorsFound);
protected: protected:
Board::Type board; Board::Type board;
@ -234,17 +242,15 @@ enum EepromLoadErrors {
NUM_ERRORS NUM_ERRORS
}; };
void ShowEepromErrors(QWidget *parent, const QString &title, const QString &mainMessage, unsigned long errorsFound);
void ShowEepromWarnings(QWidget *parent, const QString &title, unsigned long errorsFound);
struct Option { struct Option {
const char * name; const char * name;
QString tooltip; QString tooltip;
uint32_t variant; uint32_t variant;
}; };
class Firmware { class Firmware
{
Q_DECLARE_TR_FUNCTIONS(Firmware)
public: public:
Firmware(const QString & id, const QString & name, Board::Type board): Firmware(const QString & id, const QString & name, Board::Type board):

View file

@ -290,7 +290,7 @@ void GeneralSettings::convert(RadioDataConversionState & cstate)
{ {
// Here we can add explicit conversions when moving from one board to another // Here we can add explicit conversions when moving from one board to another
cstate.setOrigin(QObject::tr("Radio Settings")); cstate.setOrigin(tr("Radio Settings"));
setDefaultControlTypes(cstate.toType); // start with default switches/pots/sliders setDefaultControlTypes(cstate.toType); // start with default switches/pots/sliders

View file

@ -60,6 +60,8 @@ class TrainerData {
}; };
class GeneralSettings { class GeneralSettings {
Q_DECLARE_TR_FUNCTIONS(GeneralSettings)
public: public:
enum BeeperMode { enum BeeperMode {

View file

@ -20,15 +20,17 @@
#include "gvardata.h" #include "gvardata.h"
#include "radiodata.h"
QString GVarData::unitToString() const QString GVarData::unitToString() const
{ {
switch (unit) { switch (unit) {
case GVAR_UNIT_NUMBER: case GVAR_UNIT_NUMBER:
return QObject::tr(""); return tr("");
case GVAR_UNIT_PERCENT: case GVAR_UNIT_PERCENT:
return QObject::tr("%"); return tr("%");
default: default:
return QObject::tr("?"); // highlight unknown value return tr("?"); // highlight unknown value
} }
} }
@ -36,14 +38,19 @@ QString GVarData::precToString() const
{ {
switch (prec) { switch (prec) {
case GVAR_PREC_MUL10: case GVAR_PREC_MUL10:
return QObject::tr("0._"); return tr("0._");
case GVAR_PREC_MUL1: case GVAR_PREC_MUL1:
return QObject::tr("0.0"); return tr("0.0");
default: default:
return QObject::tr("?.?"); // highlight unknown value return tr("?.?"); // highlight unknown value
} }
} }
QString GVarData::nameToString(int index) const
{
return RadioData::getElementName(tr("GV"), index + 1, name);
}
int GVarData::multiplierSet() int GVarData::multiplierSet()
{ {
return (prec == 0 ? 1 : 10); return (prec == 0 ? 1 : 10);

View file

@ -28,6 +28,8 @@
#define GVAR_MIN_VALUE -GVAR_MAX_VALUE #define GVAR_MIN_VALUE -GVAR_MAX_VALUE
class GVarData { class GVarData {
Q_DECLARE_TR_FUNCTIONS(GVarData)
public: public:
GVarData() { clear(); } GVarData() { clear(); }
@ -51,6 +53,7 @@ class GVarData {
void clear() {memset(this, 0, sizeof(GVarData)); } void clear() {memset(this, 0, sizeof(GVarData)); }
QString unitToString() const; QString unitToString() const;
QString precToString() const; QString precToString() const;
QString nameToString(int index) const;
int multiplierSet(); int multiplierSet();
float multiplierGet() const; float multiplierGet() const;
void setMin(float val); void setMin(float val);

View file

@ -29,8 +29,8 @@
void ExpoData::convert(RadioDataConversionState & cstate) void ExpoData::convert(RadioDataConversionState & cstate)
{ {
cstate.setComponent(QObject::tr("INP"), 3); cstate.setComponent(tr("INP"), 3);
cstate.setSubComp(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, chn).toString(cstate.fromModel(), cstate.fromGS(), cstate.fromType) % QObject::tr(" (@%1)").arg(cstate.subCompIdx)); cstate.setSubComp(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, chn).toString(cstate.fromModel(), cstate.fromGS(), cstate.fromType) % tr(" (@%1)").arg(cstate.subCompIdx));
srcRaw.convert(cstate); srcRaw.convert(cstate);
swtch.convert(cstate); swtch.convert(cstate);
} }
@ -42,8 +42,8 @@ void ExpoData::convert(RadioDataConversionState & cstate)
void MixData::convert(RadioDataConversionState & cstate) void MixData::convert(RadioDataConversionState & cstate)
{ {
cstate.setComponent(QObject::tr("MIX"), 4); cstate.setComponent(tr("MIX"), 4);
cstate.setSubComp(RawSource(SOURCE_TYPE_CH, destCh-1).toString(cstate.fromModel(), cstate.fromGS(), cstate.fromType) % QObject::tr(" (@%1)").arg(cstate.subCompIdx)); cstate.setSubComp(RawSource(SOURCE_TYPE_CH, destCh-1).toString(cstate.fromModel(), cstate.fromGS(), cstate.fromType) % tr(" (@%1)").arg(cstate.subCompIdx));
srcRaw.convert(cstate); srcRaw.convert(cstate);
swtch.convert(cstate); swtch.convert(cstate);
} }
@ -65,7 +65,12 @@ QString LimitData::maxToString() const
QString LimitData::revertToString() const QString LimitData::revertToString() const
{ {
return revert ? QObject::tr("INV") : QObject::tr("NOR"); return revert ? tr("INV") : tr("NOR");
}
QString LimitData::nameToString(int index) const
{
return RadioData::getElementName(tr("CH"), index + 1, name);
} }
QString LimitData::offsetToString() const QString LimitData::offsetToString() const
@ -108,7 +113,7 @@ bool CurveData::isEmpty() const
QString CurveData::nameToString(const int idx) const QString CurveData::nameToString(const int idx) const
{ {
return RadioData::getElementName(QCoreApplication::translate("Curve", "CV"), idx + 1, name); return RadioData::getElementName(tr("CV"), idx + 1, name);
} }
@ -129,14 +134,14 @@ void FlightModeData::clear(const int phase)
} }
} }
QString FlightModeData::toString(int index) const QString FlightModeData::nameToString(int index) const
{ {
return RadioData::getElementName(QObject::tr("FM"), index, name, true); return RadioData::getElementName(tr("FM"), index, name); // names are zero-based, FM0, FM1, etc
} }
void FlightModeData::convert(RadioDataConversionState & cstate) void FlightModeData::convert(RadioDataConversionState & cstate)
{ {
cstate.setComponent("FMD", 2); cstate.setComponent("FMD", 2);
cstate.setSubComp(toString(cstate.subCompIdx)); cstate.setSubComp(nameToString(cstate.subCompIdx));
swtch.convert(cstate); swtch.convert(cstate);
} }

View file

@ -38,6 +38,8 @@ enum InputMode {
}; };
class ExpoData { class ExpoData {
Q_DECLARE_TR_FUNCTIONS(ExpoData)
public: public:
ExpoData() { clear(); } ExpoData() { clear(); }
RawSource srcRaw; RawSource srcRaw;
@ -64,6 +66,8 @@ enum MltpxValue {
#define MIXDATA_NAME_LEN 10 #define MIXDATA_NAME_LEN 10
class MixData { class MixData {
Q_DECLARE_TR_FUNCTIONS(MixData)
public: public:
MixData() { clear(); } MixData() { clear(); }
void convert(RadioDataConversionState & cstate); void convert(RadioDataConversionState & cstate);
@ -89,6 +93,8 @@ class MixData {
}; };
class LimitData { class LimitData {
Q_DECLARE_TR_FUNCTIONS(LimitData)
public: public:
LimitData() { clear(); } LimitData() { clear(); }
int min; int min;
@ -103,6 +109,7 @@ class LimitData {
QString maxToString() const; QString maxToString() const;
QString offsetToString() const; QString offsetToString() const;
QString revertToString() const; QString revertToString() const;
QString nameToString(int index) const;
void clear(); void clear();
}; };
@ -113,6 +120,8 @@ class CurvePoint {
}; };
class CurveData { class CurveData {
Q_DECLARE_TR_FUNCTIONS(CurveData)
public: public:
enum CurveType { enum CurveType {
CURVE_TYPE_STANDARD, CURVE_TYPE_STANDARD,
@ -133,6 +142,8 @@ class CurveData {
}; };
class FlightModeData { class FlightModeData {
Q_DECLARE_TR_FUNCTIONS(FlightModeData)
public: public:
FlightModeData() { clear(0); } FlightModeData() { clear(0); }
int trimMode[CPN_MAX_TRIMS]; int trimMode[CPN_MAX_TRIMS];
@ -145,11 +156,13 @@ class FlightModeData {
int rotaryEncoders[CPN_MAX_ENCODERS]; int rotaryEncoders[CPN_MAX_ENCODERS];
int gvars[CPN_MAX_GVARS]; int gvars[CPN_MAX_GVARS];
void clear(const int phase); void clear(const int phase);
QString toString(int index) const; QString nameToString(int index) const;
void convert(RadioDataConversionState & cstate); void convert(RadioDataConversionState & cstate);
}; };
class SwashRingData { // Swash Ring data class SwashRingData {
Q_DECLARE_TR_FUNCTIONS(SwashRingData)
public: public:
SwashRingData() { clear(); } SwashRingData() { clear(); }
int elevatorWeight; int elevatorWeight;

View file

@ -20,6 +20,7 @@
#include "logicalswitchdata.h" #include "logicalswitchdata.h"
#include "radiodata.h"
#include "radiodataconversionstate.h" #include "radiodataconversionstate.h"
#include "rawsource.h" #include "rawsource.h"
#include "rawswitch.h" #include "rawswitch.h"
@ -62,55 +63,60 @@ QString LogicalSwitchData::funcToString() const
{ {
switch (func) { switch (func) {
case LS_FN_OFF: case LS_FN_OFF:
return QObject::tr("---"); return tr("---");
case LS_FN_VPOS: case LS_FN_VPOS:
return QObject::tr("a>x"); return tr("a>x");
case LS_FN_VNEG: case LS_FN_VNEG:
return QObject::tr("a<x"); return tr("a<x");
case LS_FN_APOS: case LS_FN_APOS:
return QObject::tr("|a|>x"); return tr("|a|>x");
case LS_FN_ANEG: case LS_FN_ANEG:
return QObject::tr("|a|<x"); return tr("|a|<x");
case LS_FN_AND: case LS_FN_AND:
return QObject::tr("AND"); return tr("AND");
case LS_FN_OR: case LS_FN_OR:
return QObject::tr("OR"); return tr("OR");
case LS_FN_XOR: case LS_FN_XOR:
return QObject::tr("XOR"); return tr("XOR");
case LS_FN_EQUAL: case LS_FN_EQUAL:
return QObject::tr("a=b"); return tr("a=b");
case LS_FN_NEQUAL: case LS_FN_NEQUAL:
return QObject::tr("a!=b"); return tr("a!=b");
case LS_FN_GREATER: case LS_FN_GREATER:
return QObject::tr("a>b"); return tr("a>b");
case LS_FN_LESS: case LS_FN_LESS:
return QObject::tr("a<b"); return tr("a<b");
case LS_FN_EGREATER: case LS_FN_EGREATER:
return QObject::tr("a>=b"); return tr("a>=b");
case LS_FN_ELESS: case LS_FN_ELESS:
return QObject::tr("a<=b"); return tr("a<=b");
case LS_FN_DPOS: case LS_FN_DPOS:
return QObject::tr("d>=x"); return tr("d>=x");
case LS_FN_DAPOS: case LS_FN_DAPOS:
return QObject::tr("|d|>=x"); return tr("|d|>=x");
case LS_FN_VEQUAL: case LS_FN_VEQUAL:
return QObject::tr("a=x"); return tr("a=x");
case LS_FN_VALMOSTEQUAL: case LS_FN_VALMOSTEQUAL:
return QObject::tr("a~x"); return tr("a~x");
case LS_FN_TIMER: case LS_FN_TIMER:
return QObject::tr("Timer"); return tr("Timer");
case LS_FN_STICKY: case LS_FN_STICKY:
return QObject::tr("Sticky"); return tr("Sticky");
case LS_FN_EDGE: case LS_FN_EDGE:
return QObject::tr("Edge"); return tr("Edge");
default: default:
return QObject::tr("Unknown"); return tr("Unknown");
} }
} }
QString LogicalSwitchData::nameToString(int index) const
{
return RadioData::getElementName(tr("L"), index + 1, NULL, true);
}
void LogicalSwitchData::convert(RadioDataConversionState & cstate) void LogicalSwitchData::convert(RadioDataConversionState & cstate)
{ {
cstate.setComponent("LSW", 7); cstate.setComponent(tr("LSW"), 7);
cstate.setSubComp(RawSwitch(SWITCH_TYPE_VIRTUAL, cstate.subCompIdx + 1).toString(cstate.fromType, cstate.fromGS(), cstate.fromModel())); cstate.setSubComp(RawSwitch(SWITCH_TYPE_VIRTUAL, cstate.subCompIdx + 1).toString(cstate.fromType, cstate.fromGS(), cstate.fromModel()));
CSFunctionFamily family = getFunctionFamily(); CSFunctionFamily family = getFunctionFamily();
switch(family) { switch(family) {

View file

@ -60,7 +60,9 @@ enum CSFunctionFamily {
LS_FAMILY_EDGE, LS_FAMILY_EDGE,
}; };
class LogicalSwitchData { // Logical Switches data class LogicalSwitchData {
Q_DECLARE_TR_FUNCTIONS(LogicalSwitchData)
public: public:
LogicalSwitchData(unsigned int func=0) LogicalSwitchData(unsigned int func=0)
{ {
@ -80,6 +82,7 @@ class LogicalSwitchData { // Logical Switches data
CSFunctionFamily getFunctionFamily() const; CSFunctionFamily getFunctionFamily() const;
unsigned int getRangeFlags() const; unsigned int getRangeFlags() const;
QString funcToString() const; QString funcToString() const;
QString nameToString(int index) const;
void convert(RadioDataConversionState & cstate); void convert(RadioDataConversionState & cstate);
}; };

View file

@ -61,8 +61,8 @@ QString removeAccents(const QString & str)
void TimerData::convert(RadioDataConversionState & cstate) void TimerData::convert(RadioDataConversionState & cstate)
{ {
cstate.setComponent("TMR", 1); cstate.setComponent(tr("TMR"), 1);
cstate.setSubComp(QObject::tr("Timer %1").arg(cstate.subCompIdx + 1)); cstate.setSubComp(tr("Timer %1").arg(cstate.subCompIdx + 1));
mode.convert(cstate); mode.convert(cstate);
} }
@ -423,11 +423,11 @@ void ModelData::convert(RadioDataConversionState & cstate)
QString origin = QString(name); QString origin = QString(name);
if (origin.isEmpty()) if (origin.isEmpty())
origin = QString::number(cstate.modelIdx+1); origin = QString::number(cstate.modelIdx+1);
cstate.setOrigin(QObject::tr("Model: ") % origin); cstate.setOrigin(tr("Model: ") % origin);
cstate.setComponent("SET", 0); cstate.setComponent("SET", 0);
if (thrTraceSrc && (int)thrTraceSrc < cstate.fromBoard.getCapability(Board::Pots) + cstate.fromBoard.getCapability(Board::Sliders)) { if (thrTraceSrc && (int)thrTraceSrc < cstate.fromBoard.getCapability(Board::Pots) + cstate.fromBoard.getCapability(Board::Sliders)) {
cstate.setSubComp(QObject::tr("Throttle Source")); cstate.setSubComp(tr("Throttle Source"));
thrTraceSrc = RawSource(SOURCE_TYPE_STICK, (int)thrTraceSrc + 3).convert(cstate).index - 3; thrTraceSrc = RawSource(SOURCE_TYPE_STICK, (int)thrTraceSrc + 3).convert(cstate).index - 3;
} }

View file

@ -57,6 +57,8 @@ class RSSIAlarmData {
#define TIMER_NAME_LEN 8 #define TIMER_NAME_LEN 8
class TimerData { class TimerData {
Q_DECLARE_TR_FUNCTIONS(TimerData)
public: public:
enum CountDownMode { enum CountDownMode {
COUNTDOWN_SILENT, COUNTDOWN_SILENT,
@ -124,6 +126,8 @@ enum TrainerMode {
}; };
class ModelData { class ModelData {
Q_DECLARE_TR_FUNCTIONS(ModelData)
public: public:
ModelData(); ModelData();
ModelData(const ModelData & src); ModelData(const ModelData & src);

View file

@ -96,6 +96,8 @@ enum TrainerProtocol {
}; };
class ModuleData { class ModuleData {
Q_DECLARE_TR_FUNCTIONS(ModuleData)
public: public:
ModuleData() { clear(); } ModuleData() { clear(); }
unsigned int modelId; unsigned int modelId;
@ -133,7 +135,7 @@ class ModuleData {
void clear() { memset(this, 0, sizeof(ModuleData)); } void clear() { memset(this, 0, sizeof(ModuleData)); }
QString polarityToString() const { return ppm.pulsePol ? QObject::tr("Positive") : QObject::tr("Negative"); } // TODO ModelPrinter QString polarityToString() const { return ppm.pulsePol ? tr("Positive") : tr("Negative"); } // TODO ModelPrinter
}; };
#endif // MODULEDATA_H #endif // MODULEDATA_H

View file

@ -433,8 +433,8 @@ template <int N>
class SwitchField: public ConversionField< SignedField<N> > { class SwitchField: public ConversionField< SignedField<N> > {
public: public:
SwitchField(DataField * parent, RawSwitch & sw, Board::Type board, unsigned int version, unsigned long flags=0): SwitchField(DataField * parent, RawSwitch & sw, Board::Type board, unsigned int version, unsigned long flags=0):
ConversionField< SignedField<N> >(parent, _switch, SwitchesConversionTable::getInstance(board, version, flags), QObject::tr("Switch").toLatin1(), ConversionField< SignedField<N> >(parent, _switch, SwitchesConversionTable::getInstance(board, version, flags), this->tr("Switch").toLatin1(),
QObject::tr("Switch ").toLatin1() + sw.toString(board) + QObject::tr(" cannot be exported on this board!").toLatin1()), this->tr("Switch ").toLatin1() + sw.toString(board) + this->tr(" cannot be exported on this board!").toLatin1()),
sw(sw), sw(sw),
_switch(0), _switch(0),
board(board) board(board)
@ -597,7 +597,7 @@ class SourceField: public ConversionField< UnsignedField<N> > {
public: public:
SourceField(DataField * parent, RawSource & source, Board::Type board, unsigned int version, unsigned int variant, unsigned long flags=0): SourceField(DataField * parent, RawSource & source, Board::Type board, unsigned int version, unsigned int variant, unsigned long flags=0):
ConversionField< UnsignedField<N> >(parent, _source, SourcesConversionTable::getInstance(board, version, variant, flags), ConversionField< UnsignedField<N> >(parent, _source, SourcesConversionTable::getInstance(board, version, variant, flags),
"Source", QObject::tr("Source %1 cannot be exported on this board!").arg(source.toString())), this->tr("Source").toLatin1(), this->tr("Source %1 cannot be exported on this board!").arg(source.toString())),
source(source), source(source),
_source(0) _source(0)
{ {
@ -1569,14 +1569,14 @@ class CurvesField: public TransformedField {
if (IS_STM32(board) && version >= 216) { if (IS_STM32(board) && version >= 216) {
offset += (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count); offset += (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count);
if (offset > maxPoints) { if (offset > maxPoints) {
setError(QObject::tr("OpenTX only accepts %1 points in all curves").arg(maxPoints)); setError(tr("OpenTX only accepts %1 points in all curves").arg(maxPoints));
break; break;
} }
} }
else { else {
offset += (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count) - 5; offset += (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count) - 5;
if (offset > maxPoints - 5 * maxCurves) { if (offset > maxPoints - 5 * maxCurves) {
setError(QObject::tr("OpenTx only accepts %1 points in all curves").arg(maxPoints)); setError(tr("OpenTx only accepts %1 points in all curves").arg(maxPoints));
break; break;
} }
_curves[i] = offset; _curves[i] = offset;
@ -2154,11 +2154,11 @@ class ArmCustomFunctionField: public TransformedField {
if (version >= 218) { if (version >= 218) {
internalField.Append(new SwitchField<9>(this, fn.swtch, board, version)); internalField.Append(new SwitchField<9>(this, fn.swtch, board, version));
internalField.Append(new ConversionField< UnsignedField<7> >(this, _func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function"))); internalField.Append(new ConversionField< UnsignedField<7> >(this, _func, &functionsConversionTable, "Function", tr("OpenTX on this board doesn't accept this function")));
} }
else { else {
internalField.Append(new SwitchField<8>(this, fn.swtch, board, version)); internalField.Append(new SwitchField<8>(this, fn.swtch, board, version));
internalField.Append(new ConversionField< UnsignedField<8> >(this, _func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function"))); internalField.Append(new ConversionField< UnsignedField<8> >(this, _func, &functionsConversionTable, "Function", tr("OpenTX on this board doesn't accept this function")));
} }
if (IS_TARANIS(board) && version >= 216) if (IS_TARANIS(board) && version >= 216)
@ -2394,7 +2394,7 @@ class AvrCustomFunctionField: public TransformedField {
{ {
if (version >= 217 && IS_2560(board)) { if (version >= 217 && IS_2560(board)) {
internalField.Append(new SwitchField<8>(this, fn.swtch, board, version)); internalField.Append(new SwitchField<8>(this, fn.swtch, board, version));
internalField.Append(new ConversionField< UnsignedField<8> >(this, (unsigned int &)fn.func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function"))); internalField.Append(new ConversionField< UnsignedField<8> >(this, (unsigned int &)fn.func, &functionsConversionTable, "Function", tr("OpenTX on this board doesn't accept this function")));
internalField.Append(new UnsignedField<2>(this, fn.adjustMode)); internalField.Append(new UnsignedField<2>(this, fn.adjustMode));
internalField.Append(new UnsignedField<4>(this, _union_param)); internalField.Append(new UnsignedField<4>(this, _union_param));
internalField.Append(new UnsignedField<1>(this, _active)); internalField.Append(new UnsignedField<1>(this, _active));
@ -2402,18 +2402,18 @@ class AvrCustomFunctionField: public TransformedField {
} }
else if (version >= 216) { else if (version >= 216) {
internalField.Append(new SwitchField<6>(this, fn.swtch, board, version)); internalField.Append(new SwitchField<6>(this, fn.swtch, board, version));
internalField.Append(new ConversionField< UnsignedField<4> >(this, (unsigned int &)fn.func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function"))); internalField.Append(new ConversionField< UnsignedField<4> >(this, (unsigned int &)fn.func, &functionsConversionTable, "Function", tr("OpenTX on this board doesn't accept this function")));
internalField.Append(new UnsignedField<5>(this, _union_param)); internalField.Append(new UnsignedField<5>(this, _union_param));
internalField.Append(new UnsignedField<1>(this, _active)); internalField.Append(new UnsignedField<1>(this, _active));
} }
else if (version >= 213) { else if (version >= 213) {
internalField.Append(new SwitchField<8>(this, fn.swtch, board, version)); internalField.Append(new SwitchField<8>(this, fn.swtch, board, version));
internalField.Append(new UnsignedField<3>(this, _union_param)); internalField.Append(new UnsignedField<3>(this, _union_param));
internalField.Append(new ConversionField< UnsignedField<5> >(this, (unsigned int &)fn.func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function"))); internalField.Append(new ConversionField< UnsignedField<5> >(this, (unsigned int &)fn.func, &functionsConversionTable, "Function", tr("OpenTX on this board doesn't accept this function")));
} }
else { else {
internalField.Append(new SwitchField<8>(this, fn.swtch, board, version)); internalField.Append(new SwitchField<8>(this, fn.swtch, board, version));
internalField.Append(new ConversionField< UnsignedField<7> >(this, (unsigned int &)fn.func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function"))); internalField.Append(new ConversionField< UnsignedField<7> >(this, (unsigned int &)fn.func, &functionsConversionTable, "Function", tr("OpenTX on this board doesn't accept this function")));
internalField.Append(new BoolField<1>(this, (bool &)fn.enabled)); internalField.Append(new BoolField<1>(this, (bool &)fn.enabled));
} }
internalField.Append(new UnsignedField<8>(this, _param)); internalField.Append(new UnsignedField<8>(this, _param));
@ -3137,7 +3137,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsig
if (IS_ARM(board)) if (IS_ARM(board))
internalField.Append(new UnsignedField<3>(this, modelData.telemetryProtocol)); internalField.Append(new UnsignedField<3>(this, modelData.telemetryProtocol));
else else
internalField.Append(new ConversionField< UnsignedField<3> >(this, (unsigned int &)modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this telemetry protocol"))); internalField.Append(new ConversionField< UnsignedField<3> >(this, (unsigned int &)modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", tr("OpenTX doesn't accept this telemetry protocol")));
internalField.Append(new BoolField<1>(this, modelData.thrTrim)); internalField.Append(new BoolField<1>(this, modelData.thrTrim));
@ -3150,7 +3150,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsig
internalField.Append(new SpareBitsField<4>(this)); internalField.Append(new SpareBitsField<4>(this));
} }
else { else {
internalField.Append(new ConversionField< SignedField<4> >(this, modelData.moduleData[0].channelsCount, &channelsConversionTable, "Channels number", ::QObject::tr("OpenTX doesn't allow this number of channels"))); internalField.Append(new ConversionField< SignedField<4> >(this, modelData.moduleData[0].channelsCount, &channelsConversionTable, "Channels number", tr("OpenTX doesn't allow this number of channels")));
} }
if (version >= 216) if (version >= 216)
@ -3272,7 +3272,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsig
internalField.Append(new UnsignedField<2>(this, modelData.potsWarningMode)); internalField.Append(new UnsignedField<2>(this, modelData.potsWarningMode));
} }
else { else {
internalField.Append(new ConversionField< SignedField<8> >(this, modelData.moduleData[1].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this radio protocol"))); internalField.Append(new ConversionField< SignedField<8> >(this, modelData.moduleData[1].protocol, &protocolsConversionTable, "Protocol", tr("OpenTX doesn't accept this radio protocol")));
internalField.Append(new UnsignedField<8>(this, modelData.trainerMode)); internalField.Append(new UnsignedField<8>(this, modelData.trainerMode));
} }
} }
@ -3284,14 +3284,14 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsig
} }
else if (version >= 216) { else if (version >= 216) {
modulesCount = 3; modulesCount = 3;
internalField.Append(new ConversionField< SignedField<8> >(this, modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this radio protocol"))); internalField.Append(new ConversionField< SignedField<8> >(this, modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", tr("OpenTX doesn't accept this radio protocol")));
} }
} }
if (IS_ARM(board) && version >= 215) { if (IS_ARM(board) && version >= 215) {
for (int module=0; module<modulesCount; module++) { for (int module=0; module<modulesCount; module++) {
if (version >= 217) { if (version >= 217) {
internalField.Append(new ConversionField<SignedField<4> >(this, modelData.moduleData[module].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this radio protocol"))); internalField.Append(new ConversionField<SignedField<4> >(this, modelData.moduleData[module].protocol, &protocolsConversionTable, "Protocol", tr("OpenTX doesn't accept this radio protocol")));
internalField.Append(new SignedField<4>(this, subprotocols[module])); internalField.Append(new SignedField<4>(this, subprotocols[module]));
} }
else { else {

View file

@ -234,7 +234,7 @@ unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *
if (version_error == OLD_VERSION) { if (version_error == OLD_VERSION) {
errors.set(version_error); errors.set(version_error);
errors.set(HAS_WARNINGS); errors.set(HAS_WARNINGS);
ShowEepromWarnings(NULL, QObject::tr("Warning"), errors.to_ulong()); showEepromWarnings(NULL, tr("Warning"), errors.to_ulong());
} }
else if (version_error == NOT_OPENTX) { else if (version_error == NOT_OPENTX) {
dbg << " not open9x"; dbg << " not open9x";
@ -285,7 +285,7 @@ void OpenTxEepromInterface::showErrors(const QString & title, const QStringList
{ {
QString msg; QString msg;
if (errors.empty()) { if (errors.empty()) {
msg = QObject::tr("Unknown error"); msg = tr("Unknown error");
} }
else { else {
int noErrorsToDisplay = std::min((int)errors.size(), 10); int noErrorsToDisplay = std::min((int)errors.size(), 10);
@ -293,12 +293,12 @@ void OpenTxEepromInterface::showErrors(const QString & title, const QStringList
msg += " -" + errors.at(n) + "\n"; msg += " -" + errors.at(n) + "\n";
} }
if (noErrorsToDisplay < errors.size()) { if (noErrorsToDisplay < errors.size()) {
msg += QObject::tr(" ... plus %1 errors").arg(errors.size() - noErrorsToDisplay) + "\n" + msg; msg += tr(" ... plus %1 errors").arg(errors.size() - noErrorsToDisplay) + "\n" + msg;
} }
} }
QMessageBox::warning(NULL, QMessageBox::warning(NULL,
QObject::tr("Error"), tr("Error"),
title + "\n" + msg); title + "\n" + msg);
} }
@ -330,7 +330,7 @@ int OpenTxEepromInterface::save(uint8_t * eeprom, const RadioData & radioData, u
generator.Export(data); generator.Export(data);
int sz = efile->writeRlc2(FILE_GENERAL, FILE_TYP_GENERAL, (const uint8_t *)data.constData(), data.size()); int sz = efile->writeRlc2(FILE_GENERAL, FILE_TYP_GENERAL, (const uint8_t *)data.constData(), data.size());
if (sz == 0 || generator.errors().count() > 0) { if (sz == 0 || generator.errors().count() > 0) {
showErrors(QObject::tr("Cannot write radio settings"), generator.errors()); showErrors(tr("Cannot write radio settings"), generator.errors());
return 0; return 0;
} }
@ -342,7 +342,7 @@ int OpenTxEepromInterface::save(uint8_t * eeprom, const RadioData & radioData, u
generator.Export(data); generator.Export(data);
int sz = efile->writeRlc2(FILE_MODEL(i), FILE_TYP_MODEL, (const uint8_t *)data.constData(), data.size()); int sz = efile->writeRlc2(FILE_MODEL(i), FILE_TYP_MODEL, (const uint8_t *)data.constData(), data.size());
if (sz == 0 || generator.errors().count() > 0) { if (sz == 0 || generator.errors().count() > 0) {
showErrors(QObject::tr("Cannot write model %1").arg(radioData.models[i].name), generator.errors()); showErrors(tr("Cannot write model %1").arg(radioData.models[i].name), generator.errors());
return 0; return 0;
} }
} }
@ -1056,45 +1056,45 @@ QString OpenTxFirmware::getStampUrl()
void addOpenTxCommonOptions(OpenTxFirmware * firmware) void addOpenTxCommonOptions(OpenTxFirmware * firmware)
{ {
firmware->addOption("ppmus", QObject::tr("Channel values displayed in us")); firmware->addOption("ppmus", QCoreApplication::translate("Firmare", "Channel values displayed in us"));
firmware->addOption("nooverridech", QObject::tr("No OverrideCH functions available")); firmware->addOption("nooverridech", QCoreApplication::translate("Firmare", "No OverrideCH functions available"));
Option fai_options[] = {{"faichoice", QObject::tr("Possibility to enable FAI MODE (no telemetry) at field")}, Option fai_options[] = {{"faichoice", QCoreApplication::translate("Firmare", "Possibility to enable FAI MODE (no telemetry) at field")},
{"faimode", QObject::tr("FAI MODE (no telemetry) always enabled")}, {"faimode", QCoreApplication::translate("Firmare", "FAI MODE (no telemetry) always enabled")},
{NULL}}; {NULL}};
firmware->addOptions(fai_options); firmware->addOptions(fai_options);
} }
void addOpenTxArmOptions(OpenTxFirmware * firmware) void addOpenTxArmOptions(OpenTxFirmware * firmware)
{ {
firmware->addOption("multimodule", QObject::tr("Support for the DIY-Multiprotocol-TX-Module")); firmware->addOption("multimodule", QCoreApplication::translate("Firmare", "Support for the DIY-Multiprotocol-TX-Module"));
firmware->addOption("eu", QObject::tr("Removes D8 FrSky protocol support which is not legal for use in the EU on radios sold after Jan 1st, 2015")); firmware->addOption("eu", QCoreApplication::translate("Firmare", "Removes D8 FrSky protocol support which is not legal for use in the EU on radios sold after Jan 1st, 2015"));
} }
void addOpenTxFrskyOptions(OpenTxFirmware * firmware) void addOpenTxFrskyOptions(OpenTxFirmware * firmware)
{ {
addOpenTxCommonOptions(firmware); addOpenTxCommonOptions(firmware);
addOpenTxArmOptions(firmware); addOpenTxArmOptions(firmware);
firmware->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support")); firmware->addOption("noheli", QCoreApplication::translate("Firmare", "Disable HELI menu and cyclic mix support"));
firmware->addOption("nogvars", QObject::tr("Disable Global variables")); firmware->addOption("nogvars", QCoreApplication::translate("Firmare", "Disable Global variables"));
firmware->addOption("lua", QObject::tr("Enable Lua custom scripts screen")); firmware->addOption("lua", QCoreApplication::translate("Firmare", "Enable Lua custom scripts screen"));
firmware->addOption("luac", QObject::tr("Enable Lua compiler")); firmware->addOption("luac", QCoreApplication::translate("Firmare", "Enable Lua compiler"));
} }
void addOpenTxTaranisOptions(OpenTxFirmware * firmware) void addOpenTxTaranisOptions(OpenTxFirmware * firmware)
{ {
addOpenTxFrskyOptions(firmware); addOpenTxFrskyOptions(firmware);
firmware->addOption("internalppm", QObject::tr("Support for PPM internal module hack")); firmware->addOption("internalppm", QCoreApplication::translate("Firmare", "Support for PPM internal module hack"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); firmware->addOption("sqt5font", QCoreApplication::translate("Firmare", "Use alternative SQT5 font"));
} }
void addOpenTxLcdOptions(OpenTxFirmware * firmware) void addOpenTxLcdOptions(OpenTxFirmware * firmware)
{ {
Option lcd_options[] = { Option lcd_options[] = {
{"ST7565P", QObject::tr("ST7565P LCD or compatible")}, {"ST7565P", QCoreApplication::translate("Firmare", "ST7565P LCD or compatible")},
{"ST7565R", QObject::tr("ST7565R LCD or compatible")}, {"ST7565R", QCoreApplication::translate("Firmare", "ST7565R LCD or compatible")},
{"ERC12864FSF", QObject::tr("ERC12864FSF LCD")}, {"ERC12864FSF", QCoreApplication::translate("Firmare", "ERC12864FSF LCD")},
{"ST7920", QObject::tr("ST7920 LCD")}, {"ST7920", QCoreApplication::translate("Firmare", "ST7920 LCD")},
{"KS108", QObject::tr("KS108 LCD")}, {"KS108", QCoreApplication::translate("Firmare", "KS108 LCD")},
{NULL} {NULL}
}; };
firmware->addOptions(lcd_options); firmware->addOptions(lcd_options);
@ -1103,8 +1103,8 @@ void addOpenTxLcdOptions(OpenTxFirmware * firmware)
void addOpenTxVoiceOptions(OpenTxFirmware * firmware) void addOpenTxVoiceOptions(OpenTxFirmware * firmware)
{ {
Option voice_options[] = { Option voice_options[] = {
{"WTV20", QObject::tr("WTV20 voice module")}, {"WTV20", QCoreApplication::translate("Firmare", "WTV20 voice module")},
{"JQ6500", QObject::tr("JQ6500 voice module")}, {"JQ6500", QCoreApplication::translate("Firmare", "JQ6500 voice module")},
{NULL} {NULL}
}; };
firmware->addOptions(voice_options); firmware->addOptions(voice_options);
@ -1125,303 +1125,303 @@ void registerOpenTxFirmwares()
{ {
OpenTxFirmware * firmware; OpenTxFirmware * firmware;
Option ext_options[] = {{"frsky", QObject::tr("Support for frsky telemetry mod"), FRSKY_VARIANT}, Option ext_options[] = {{"frsky", QCoreApplication::translate("Firmare", "Support for frsky telemetry mod"), FRSKY_VARIANT},
{"telemetrez", QObject::tr("Support for telemetry easy board"), FRSKY_VARIANT}, {"telemetrez", QCoreApplication::translate("Firmare", "Support for telemetry easy board"), FRSKY_VARIANT},
{"jeti", QObject::tr("Support for jeti telemetry mod"), 0}, {"jeti", QCoreApplication::translate("Firmare", "Support for jeti telemetry mod"), 0},
{"ardupilot", QObject::tr("Support for receiving ardupilot data"), 0}, {"ardupilot", QCoreApplication::translate("Firmare", "Support for receiving ardupilot data"), 0},
{"nmea", QObject::tr("Support for receiving NMEA data"), 0}, {"nmea", QCoreApplication::translate("Firmare", "Support for receiving NMEA data"), 0},
{"mavlink", QObject::tr("Support for MAVLINK devices"), MAVLINK_VARIANT}, {"mavlink", QCoreApplication::translate("Firmare", "Support for MAVLINK devices"), MAVLINK_VARIANT},
{NULL}}; {NULL}};
Option extr_options[] = {{"frsky", QObject::tr("Support for frsky telemetry mod"), FRSKY_VARIANT}, Option extr_options[] = {{"frsky", QCoreApplication::translate("Firmare", "Support for frsky telemetry mod"), FRSKY_VARIANT},
{"jeti", QObject::tr("Support for jeti telemetry mod"), 0}, {"jeti", QCoreApplication::translate("Firmare", "Support for jeti telemetry mod"), 0},
{"ardupilot", QObject::tr("Support for receiving ardupilot data"), 0}, {"ardupilot", QCoreApplication::translate("Firmare", "Support for receiving ardupilot data"), 0},
{"nmea", QObject::tr("Support for receiving NMEA data"), 0}, {"nmea", QCoreApplication::translate("Firmare", "Support for receiving NMEA data"), 0},
{"mavlink", QObject::tr("Support for MAVLINK devices"), MAVLINK_VARIANT}, {"mavlink", QCoreApplication::translate("Firmare", "Support for MAVLINK devices"), MAVLINK_VARIANT},
{NULL}}; {NULL}};
Option nav_options[] = {{"rotenc", QObject::tr("Rotary Encoder use in menus navigation")}, Option nav_options[] = {{"rotenc", QCoreApplication::translate("Firmare", "Rotary Encoder use in menus navigation")},
{"potscroll", QObject::tr("Pots use in menus navigation")}, {"potscroll", QCoreApplication::translate("Firmare", "Pots use in menus navigation")},
{NULL}}; {NULL}};
Option dsm2_options[] = {{"DSM2", QObject::tr("Support for DSM2 modules"), 0}, Option dsm2_options[] = {{"DSM2", QCoreApplication::translate("Firmare", "Support for DSM2 modules"), 0},
{"DSM2PPM", QObject::tr("Support for DSM2 modules using ppm instead of true serial"), 0}, {"DSM2PPM", QCoreApplication::translate("Firmare", "Support for DSM2 modules using ppm instead of true serial"), 0},
{NULL}}; {NULL}};
/* FrSky Taranis X9D+ board */ /* FrSky Taranis X9D+ board */
firmware = new OpenTxFirmware("opentx-x9d+", QObject::tr("FrSky Taranis X9D+"), BOARD_TARANIS_X9DP); firmware = new OpenTxFirmware("opentx-x9d+", QCoreApplication::translate("Firmare", "FrSky Taranis X9D+"), BOARD_TARANIS_X9DP);
addOpenTxTaranisOptions(firmware); addOpenTxTaranisOptions(firmware);
registerOpenTxFirmware(firmware); registerOpenTxFirmware(firmware);
/* FrSky Taranis X9D board */ /* FrSky Taranis X9D board */
firmware = new OpenTxFirmware("opentx-x9d", QObject::tr("FrSky Taranis X9D"), BOARD_TARANIS_X9D); firmware = new OpenTxFirmware("opentx-x9d", QCoreApplication::translate("Firmare", "FrSky Taranis X9D"), BOARD_TARANIS_X9D);
firmware->addOption("haptic", QObject::tr("Haptic module installed")); firmware->addOption("haptic", QCoreApplication::translate("Firmare", "Haptic module installed"));
addOpenTxTaranisOptions(firmware); addOpenTxTaranisOptions(firmware);
registerOpenTxFirmware(firmware); registerOpenTxFirmware(firmware);
/* FrSky Taranis X9E board */ /* FrSky Taranis X9E board */
firmware = new OpenTxFirmware("opentx-x9e", QObject::tr("FrSky Taranis X9E"), BOARD_TARANIS_X9E); firmware = new OpenTxFirmware("opentx-x9e", QCoreApplication::translate("Firmare", "FrSky Taranis X9E"), BOARD_TARANIS_X9E);
firmware->addOption("shutdownconfirm", QObject::tr("Confirmation before radio shutdown")); firmware->addOption("shutdownconfirm", QCoreApplication::translate("Firmare", "Confirmation before radio shutdown"));
firmware->addOption("horussticks", QObject::tr("Horus gimbals installed (Hall sensors)")); firmware->addOption("horussticks", QCoreApplication::translate("Firmare", "Horus gimbals installed (Hall sensors)"));
addOpenTxTaranisOptions(firmware); addOpenTxTaranisOptions(firmware);
registerOpenTxFirmware(firmware); registerOpenTxFirmware(firmware);
/* FrSky X7 board */ /* FrSky X7 board */
firmware = new OpenTxFirmware("opentx-x7", QObject::tr("FrSky Taranis X7 / X7S"), BOARD_TARANIS_X7); firmware = new OpenTxFirmware("opentx-x7", QCoreApplication::translate("Firmare", "FrSky Taranis X7 / X7S"), BOARD_TARANIS_X7);
// No mixersmon for now // No mixersmon for now
addOpenTxFrskyOptions(firmware); addOpenTxFrskyOptions(firmware);
firmware->addOption("internalppm", QObject::tr("Support for PPM internal module hack")); firmware->addOption("internalppm", QCoreApplication::translate("Firmare", "Support for PPM internal module hack"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); firmware->addOption("sqt5font", QCoreApplication::translate("Firmare", "Use alternative SQT5 font"));
registerOpenTxFirmware(firmware); registerOpenTxFirmware(firmware);
/* FrSky X10 board */ /* FrSky X10 board */
firmware = new OpenTxFirmware("opentx-x10", QObject::tr("FrSky Horus X10 / X10S"), BOARD_X10); firmware = new OpenTxFirmware("opentx-x10", QCoreApplication::translate("Firmare", "FrSky Horus X10 / X10S"), BOARD_X10);
addOpenTxFrskyOptions(firmware); addOpenTxFrskyOptions(firmware);
registerOpenTxFirmware(firmware); registerOpenTxFirmware(firmware);
/* FrSky Horus board */ /* FrSky Horus board */
firmware = new OpenTxFirmware("opentx-x12s", QObject::tr("FrSky Horus X12S"), BOARD_X12S); firmware = new OpenTxFirmware("opentx-x12s", QCoreApplication::translate("Firmare", "FrSky Horus X12S"), BOARD_X12S);
addOpenTxFrskyOptions(firmware); addOpenTxFrskyOptions(firmware);
firmware->addOption("pcbdev", QObject::tr("Use ONLY with first DEV pcb version")); firmware->addOption("pcbdev", QCoreApplication::translate("Firmare", "Use ONLY with first DEV pcb version"));
registerOpenTxFirmware(firmware); registerOpenTxFirmware(firmware);
/* 9XR-Pro */ /* 9XR-Pro */
firmware = new OpenTxFirmware("opentx-9xrpro", QObject::tr("Turnigy 9XR-PRO"), BOARD_9XRPRO); firmware = new OpenTxFirmware("opentx-9xrpro", QCoreApplication::translate("Firmare", "Turnigy 9XR-PRO"), BOARD_9XRPRO);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support")); firmware->addOption("heli", QCoreApplication::translate("Firmare", "Enable HELI menu and cyclic mix support"));
firmware->addOption("nofp", QObject::tr("No flight modes")); firmware->addOption("nofp", QCoreApplication::translate("Firmare", "No flight modes"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); firmware->addOption("gvars", QCoreApplication::translate("Firmare", "Global variables"), GVARS_VARIANT);
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation")); firmware->addOption("potscroll", QCoreApplication::translate("Firmare", "Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); firmware->addOption("autosource", QCoreApplication::translate("Firmare", "In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); firmware->addOption("autoswitch", QCoreApplication::translate("Firmare", "In model setup menus automatically set switch by moving the control"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); firmware->addOption("nographics", QCoreApplication::translate("Firmare", "No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph")); firmware->addOption("battgraph", QCoreApplication::translate("Firmare", "Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); firmware->addOption("nobold", QCoreApplication::translate("Firmare", "Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface")); firmware->addOption("bluetooth", QCoreApplication::translate("Firmare", "Bluetooth interface"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); firmware->addOption("sqt5font", QCoreApplication::translate("Firmare", "Use alternative SQT5 font"));
addOpenTxArmOptions(firmware); addOpenTxArmOptions(firmware);
addOpenTxCommonOptions(firmware); addOpenTxCommonOptions(firmware);
registerOpenTxFirmware(firmware); registerOpenTxFirmware(firmware);
/* 9XR board with M128 chip */ /* 9XR board with M128 chip */
firmware = new OpenTxFirmware("opentx-9xr128", QObject::tr("Turnigy 9XR with m128 chip"), BOARD_M128); firmware = new OpenTxFirmware("opentx-9xr128", QCoreApplication::translate("Firmare", "Turnigy 9XR with m128 chip"), BOARD_M128);
firmware->addOptions(extr_options); firmware->addOptions(extr_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support")); firmware->addOption("heli", QCoreApplication::translate("Firmare", "Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu")); firmware->addOption("templates", QCoreApplication::translate("Firmare", "Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen")); firmware->addOption("nosplash", QCoreApplication::translate("Firmare", "No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes")); firmware->addOption("nofp", QCoreApplication::translate("Firmare", "No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus")); firmware->addOption("nocurves", QCoreApplication::translate("Firmare", "Disable curves menus"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker")); firmware->addOption("audio", QCoreApplication::translate("Firmare", "Support for radio modified with regular speaker"));
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode")); firmware->addOption("voice", QCoreApplication::translate("Firmare", "Used if you have modified your radio with voice mode"));
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode")); firmware->addOption("haptic", QCoreApplication::translate("Firmare", "Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol")); // NOT TESTED firmware->addOption("PXX", QCoreApplication::translate("Firmare", "Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules")); firmware->addOption("DSM2", QCoreApplication::translate("Firmare", "Support for DSM2 modules"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits")); firmware->addOption("ppmca", QCoreApplication::translate("Firmare", "PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); firmware->addOption("gvars", QCoreApplication::translate("Firmare", "Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits")); firmware->addOption("symlimits", QCoreApplication::translate("Firmare", "Symetrical Limits"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation")); firmware->addOption("potscroll", QCoreApplication::translate("Firmare", "Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); firmware->addOption("autosource", QCoreApplication::translate("Firmare", "In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); firmware->addOption("autoswitch", QCoreApplication::translate("Firmare", "In model setup menus automatically set switch by moving the control"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); firmware->addOption("nographics", QCoreApplication::translate("Firmare", "No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph")); firmware->addOption("battgraph", QCoreApplication::translate("Firmare", "Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); firmware->addOption("nobold", QCoreApplication::translate("Firmare", "Don't use bold font for highlighting active items"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics")); firmware->addOption("thrtrace", QCoreApplication::translate("Firmare", "Enable the throttle trace in Statistics"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar")); firmware->addOption("pgbar", QCoreApplication::translate("Firmare", "EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units")); firmware->addOption("imperial", QCoreApplication::translate("Firmare", "Imperial units"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); firmware->addOption("sqt5font", QCoreApplication::translate("Firmare", "Use alternative SQT5 font"));
addOpenTxCommonOptions(firmware); addOpenTxCommonOptions(firmware);
registerOpenTxFirmware(firmware); registerOpenTxFirmware(firmware);
/* 9XR board */ /* 9XR board */
firmware = new OpenTxFirmware("opentx-9xr", QObject::tr("Turnigy 9XR"), BOARD_STOCK); firmware = new OpenTxFirmware("opentx-9xr", QCoreApplication::translate("Firmare", "Turnigy 9XR"), BOARD_STOCK);
firmware->addOptions(extr_options); firmware->addOptions(extr_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support")); firmware->addOption("heli", QCoreApplication::translate("Firmare", "Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu")); firmware->addOption("templates", QCoreApplication::translate("Firmare", "Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen")); firmware->addOption("nosplash", QCoreApplication::translate("Firmare", "No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes")); firmware->addOption("nofp", QCoreApplication::translate("Firmare", "No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus")); firmware->addOption("nocurves", QCoreApplication::translate("Firmare", "Disable curves menus"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker")); firmware->addOption("audio", QCoreApplication::translate("Firmare", "Support for radio modified with regular speaker"));
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode")); firmware->addOption("voice", QCoreApplication::translate("Firmare", "Used if you have modified your radio with voice mode"));
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode")); firmware->addOption("haptic", QCoreApplication::translate("Firmare", "Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol")); // NOT TESTED firmware->addOption("PXX", QCoreApplication::translate("Firmare", "Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules")); firmware->addOption("DSM2", QCoreApplication::translate("Firmare", "Support for DSM2 modules"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits")); firmware->addOption("ppmca", QCoreApplication::translate("Firmare", "PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); firmware->addOption("gvars", QCoreApplication::translate("Firmare", "Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits")); firmware->addOption("symlimits", QCoreApplication::translate("Firmare", "Symetrical Limits"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation")); firmware->addOption("potscroll", QCoreApplication::translate("Firmare", "Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); firmware->addOption("autosource", QCoreApplication::translate("Firmare", "In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); firmware->addOption("autoswitch", QCoreApplication::translate("Firmare", "In model setup menus automatically set switch by moving the control"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); firmware->addOption("nographics", QCoreApplication::translate("Firmare", "No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph")); firmware->addOption("battgraph", QCoreApplication::translate("Firmare", "Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); firmware->addOption("nobold", QCoreApplication::translate("Firmare", "Don't use bold font for highlighting active items"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics")); firmware->addOption("thrtrace", QCoreApplication::translate("Firmare", "Enable the throttle trace in Statistics"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar")); firmware->addOption("pgbar", QCoreApplication::translate("Firmare", "EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units")); firmware->addOption("imperial", QCoreApplication::translate("Firmare", "Imperial units"));
firmware->addOption("nowshh", QObject::tr("No Winged Shadow How High support")); firmware->addOption("nowshh", QCoreApplication::translate("Firmare", "No Winged Shadow How High support"));
firmware->addOption("novario", QObject::tr("No vario support")); firmware->addOption("novario", QCoreApplication::translate("Firmare", "No vario support"));
firmware->addOption("nogps", QObject::tr("No GPS support")); firmware->addOption("nogps", QCoreApplication::translate("Firmare", "No GPS support"));
firmware->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen")); firmware->addOption("nogauges", QCoreApplication::translate("Firmare", "No gauges in the custom telemetry screen"));
firmware->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)")); firmware->addOption("stickrev", QCoreApplication::translate("Firmare", "Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); firmware->addOption("sqt5font", QCoreApplication::translate("Firmare", "Use alternative SQT5 font"));
addOpenTxCommonOptions(firmware); addOpenTxCommonOptions(firmware);
registerOpenTxFirmware(firmware); registerOpenTxFirmware(firmware);
/* 9x board */ /* 9x board */
firmware = new OpenTxFirmware("opentx-9x", QObject::tr("9X with stock board"), BOARD_STOCK); firmware = new OpenTxFirmware("opentx-9x", QCoreApplication::translate("Firmare", "9X with stock board"), BOARD_STOCK);
firmware->addOptions(ext_options); firmware->addOptions(ext_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support")); firmware->addOption("heli", QCoreApplication::translate("Firmare", "Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu")); firmware->addOption("templates", QCoreApplication::translate("Firmare", "Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen")); firmware->addOption("nosplash", QCoreApplication::translate("Firmare", "No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes")); firmware->addOption("nofp", QCoreApplication::translate("Firmare", "No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus")); firmware->addOption("nocurves", QCoreApplication::translate("Firmare", "Disable curves menus"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker")); firmware->addOption("audio", QCoreApplication::translate("Firmare", "Support for radio modified with regular speaker"));
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode")); firmware->addOption("voice", QCoreApplication::translate("Firmare", "Used if you have modified your radio with voice mode"));
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode")); firmware->addOption("haptic", QCoreApplication::translate("Firmare", "Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol")); // NOT TESTED firmware->addOption("PXX", QCoreApplication::translate("Firmare", "Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules")); firmware->addOption("DSM2", QCoreApplication::translate("Firmare", "Support for DSM2 modules"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits")); firmware->addOption("ppmca", QCoreApplication::translate("Firmare", "PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); firmware->addOption("gvars", QCoreApplication::translate("Firmare", "Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits")); firmware->addOption("symlimits", QCoreApplication::translate("Firmare", "Symetrical Limits"));
firmware->addOptions(nav_options); firmware->addOptions(nav_options);
firmware->addOption("sp22", QObject::tr("SmartieParts 2.2 Backlight support")); firmware->addOption("sp22", QCoreApplication::translate("Firmare", "SmartieParts 2.2 Backlight support"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); firmware->addOption("autosource", QCoreApplication::translate("Firmare", "In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); firmware->addOption("autoswitch", QCoreApplication::translate("Firmare", "In model setup menus automatically set switch by moving the control"));
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time")); firmware->addOption("dblkeys", QCoreApplication::translate("Firmare", "Enable resetting values by pressing up and down at the same time"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); firmware->addOption("nographics", QCoreApplication::translate("Firmare", "No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph")); firmware->addOption("battgraph", QCoreApplication::translate("Firmare", "Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); firmware->addOption("nobold", QCoreApplication::translate("Firmare", "Don't use bold font for highlighting active items"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics")); firmware->addOption("thrtrace", QCoreApplication::translate("Firmare", "Enable the throttle trace in Statistics"));
firmware->addOption("pgbar", QObject::tr("EEprom write progress bar")); firmware->addOption("pgbar", QCoreApplication::translate("Firmare", "EEprom write progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units")); firmware->addOption("imperial", QCoreApplication::translate("Firmare", "Imperial units"));
firmware->addOption("nowshh", QObject::tr("No Winged Shadow How High support")); firmware->addOption("nowshh", QCoreApplication::translate("Firmare", "No Winged Shadow How High support"));
firmware->addOption("novario", QObject::tr("No vario support")); firmware->addOption("novario", QCoreApplication::translate("Firmare", "No vario support"));
firmware->addOption("nogps", QObject::tr("No GPS support")); firmware->addOption("nogps", QCoreApplication::translate("Firmare", "No GPS support"));
firmware->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen")); firmware->addOption("nogauges", QCoreApplication::translate("Firmare", "No gauges in the custom telemetry screen"));
firmware->addOption("fasoffset", QObject::tr("Allow compensating for offset errors in FrSky FAS current sensors")); firmware->addOption("fasoffset", QCoreApplication::translate("Firmare", "Allow compensating for offset errors in FrSky FAS current sensors"));
firmware->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)")); firmware->addOption("stickrev", QCoreApplication::translate("Firmare", "Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); firmware->addOption("sqt5font", QCoreApplication::translate("Firmare", "Use alternative SQT5 font"));
addOpenTxCommonOptions(firmware); addOpenTxCommonOptions(firmware);
registerOpenTxFirmware(firmware); registerOpenTxFirmware(firmware);
/* 9x board with M128 chip */ /* 9x board with M128 chip */
firmware = new OpenTxFirmware("opentx-9x128", QObject::tr("9X with stock board and m128 chip"), BOARD_M128); firmware = new OpenTxFirmware("opentx-9x128", QCoreApplication::translate("Firmare", "9X with stock board and m128 chip"), BOARD_M128);
firmware->addOptions(ext_options); firmware->addOptions(ext_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support")); firmware->addOption("heli", QCoreApplication::translate("Firmare", "Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu")); firmware->addOption("templates", QCoreApplication::translate("Firmare", "Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen")); firmware->addOption("nosplash", QCoreApplication::translate("Firmare", "No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes")); firmware->addOption("nofp", QCoreApplication::translate("Firmare", "No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus")); firmware->addOption("nocurves", QCoreApplication::translate("Firmare", "Disable curves menus"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker")); firmware->addOption("audio", QCoreApplication::translate("Firmare", "Support for radio modified with regular speaker"));
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode")); firmware->addOption("voice", QCoreApplication::translate("Firmare", "Used if you have modified your radio with voice mode"));
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode")); firmware->addOption("haptic", QCoreApplication::translate("Firmare", "Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol")); // NOT TESTED firmware->addOption("PXX", QCoreApplication::translate("Firmare", "Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules")); firmware->addOption("DSM2", QCoreApplication::translate("Firmare", "Support for DSM2 modules"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits")); firmware->addOption("ppmca", QCoreApplication::translate("Firmare", "PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); firmware->addOption("gvars", QCoreApplication::translate("Firmare", "Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits")); firmware->addOption("symlimits", QCoreApplication::translate("Firmare", "Symetrical Limits"));
firmware->addOptions(nav_options); firmware->addOptions(nav_options);
firmware->addOption("sp22", QObject::tr("SmartieParts 2.2 Backlight support")); firmware->addOption("sp22", QCoreApplication::translate("Firmare", "SmartieParts 2.2 Backlight support"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); firmware->addOption("autosource", QCoreApplication::translate("Firmare", "In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); firmware->addOption("autoswitch", QCoreApplication::translate("Firmare", "In model setup menus automatically set switch by moving the control"));
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time")); firmware->addOption("dblkeys", QCoreApplication::translate("Firmare", "Enable resetting values by pressing up and down at the same time"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); firmware->addOption("nographics", QCoreApplication::translate("Firmare", "No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph")); firmware->addOption("battgraph", QCoreApplication::translate("Firmare", "Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); firmware->addOption("nobold", QCoreApplication::translate("Firmare", "Don't use bold font for highlighting active items"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics")); firmware->addOption("thrtrace", QCoreApplication::translate("Firmare", "Enable the throttle trace in Statistics"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar")); firmware->addOption("pgbar", QCoreApplication::translate("Firmare", "EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units")); firmware->addOption("imperial", QCoreApplication::translate("Firmare", "Imperial units"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); firmware->addOption("sqt5font", QCoreApplication::translate("Firmare", "Use alternative SQT5 font"));
addOpenTxCommonOptions(firmware); addOpenTxCommonOptions(firmware);
registerOpenTxFirmware(firmware); registerOpenTxFirmware(firmware);
/* ar9x board */ /* ar9x board */
firmware = new OpenTxFirmware("opentx-ar9x", QObject::tr("9X with AR9X board"), BOARD_AR9X); firmware = new OpenTxFirmware("opentx-ar9x", QCoreApplication::translate("Firmare", "9X with AR9X board"), BOARD_AR9X);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support")); firmware->addOption("heli", QCoreApplication::translate("Firmare", "Enable HELI menu and cyclic mix support"));
firmware->addOption("nofp", QObject::tr("No flight modes")); firmware->addOption("nofp", QCoreApplication::translate("Firmare", "No flight modes"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); firmware->addOption("gvars", QCoreApplication::translate("Firmare", "Global variables"), GVARS_VARIANT);
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation")); firmware->addOption("potscroll", QCoreApplication::translate("Firmare", "Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); firmware->addOption("autosource", QCoreApplication::translate("Firmare", "In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); firmware->addOption("autoswitch", QCoreApplication::translate("Firmare", "In model setup menus automatically set switch by moving the control"));
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time")); firmware->addOption("dblkeys", QCoreApplication::translate("Firmare", "Enable resetting values by pressing up and down at the same time"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); firmware->addOption("nographics", QCoreApplication::translate("Firmare", "No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph")); firmware->addOption("battgraph", QCoreApplication::translate("Firmare", "Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); firmware->addOption("nobold", QCoreApplication::translate("Firmare", "Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface")); firmware->addOption("bluetooth", QCoreApplication::translate("Firmare", "Bluetooth interface"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); firmware->addOption("sqt5font", QCoreApplication::translate("Firmare", "Use alternative SQT5 font"));
// firmware->addOption("rtc", QObject::tr("Optional RTC added")); // firmware->addOption("rtc", QCoreApplication::translate("Firmare", "Optional RTC added"));
// firmware->addOption("volume", QObject::tr("i2c volume control added")); // firmware->addOption("volume", QCoreApplication::translate("Firmare", "i2c volume control added"));
addOpenTxArmOptions(firmware); addOpenTxArmOptions(firmware);
addOpenTxCommonOptions(firmware); addOpenTxCommonOptions(firmware);
registerOpenTxFirmware(firmware); registerOpenTxFirmware(firmware);
/* Sky9x board */ /* Sky9x board */
firmware = new OpenTxFirmware("opentx-sky9x", QObject::tr("9X with Sky9x board"), BOARD_SKY9X); firmware = new OpenTxFirmware("opentx-sky9x", QCoreApplication::translate("Firmare", "9X with Sky9x board"), BOARD_SKY9X);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support")); firmware->addOption("heli", QCoreApplication::translate("Firmare", "Enable HELI menu and cyclic mix support"));
firmware->addOption("nofp", QObject::tr("No flight modes")); firmware->addOption("nofp", QCoreApplication::translate("Firmare", "No flight modes"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); firmware->addOption("gvars", QCoreApplication::translate("Firmare", "Global variables"), GVARS_VARIANT);
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation")); firmware->addOption("potscroll", QCoreApplication::translate("Firmare", "Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); firmware->addOption("autosource", QCoreApplication::translate("Firmare", "In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); firmware->addOption("autoswitch", QCoreApplication::translate("Firmare", "In model setup menus automatically set switch by moving the control"));
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time")); firmware->addOption("dblkeys", QCoreApplication::translate("Firmare", "Enable resetting values by pressing up and down at the same time"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); firmware->addOption("nographics", QCoreApplication::translate("Firmare", "No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph")); firmware->addOption("battgraph", QCoreApplication::translate("Firmare", "Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); firmware->addOption("nobold", QCoreApplication::translate("Firmare", "Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface")); firmware->addOption("bluetooth", QCoreApplication::translate("Firmare", "Bluetooth interface"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); firmware->addOption("sqt5font", QCoreApplication::translate("Firmare", "Use alternative SQT5 font"));
addOpenTxArmOptions(firmware); addOpenTxArmOptions(firmware);
addOpenTxCommonOptions(firmware); addOpenTxCommonOptions(firmware);
registerOpenTxFirmware(firmware); registerOpenTxFirmware(firmware);
/* Gruvin9x board */ /* Gruvin9x board */
firmware = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("9X with Gruvin9x board"), BOARD_GRUVIN9X); firmware = new OpenTxFirmware("opentx-gruvin9x", QCoreApplication::translate("Firmare", "9X with Gruvin9x board"), BOARD_GRUVIN9X);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support")); firmware->addOption("heli", QCoreApplication::translate("Firmare", "Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu")); firmware->addOption("templates", QCoreApplication::translate("Firmare", "Enable TEMPLATES menu"));
firmware->addOption("nofp", QObject::tr("No flight modes")); firmware->addOption("nofp", QCoreApplication::translate("Firmare", "No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus")); firmware->addOption("nocurves", QCoreApplication::translate("Firmare", "Disable curves menus"));
firmware->addOption("sdcard", QObject::tr("Support for SD memory card")); firmware->addOption("sdcard", QCoreApplication::translate("Firmare", "Support for SD memory card"));
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode")); firmware->addOption("voice", QCoreApplication::translate("Firmare", "Used if you have modified your radio with voice mode"));
firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol")); firmware->addOption("PXX", QCoreApplication::translate("Firmare", "Support of FrSky PXX protocol"));
firmware->addOptions(dsm2_options); firmware->addOptions(dsm2_options);
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits")); firmware->addOption("ppmca", QCoreApplication::translate("Firmare", "PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); firmware->addOption("gvars", QCoreApplication::translate("Firmare", "Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits")); firmware->addOption("symlimits", QCoreApplication::translate("Firmare", "Symetrical Limits"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation")); firmware->addOption("potscroll", QCoreApplication::translate("Firmare", "Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); firmware->addOption("autosource", QCoreApplication::translate("Firmare", "In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); firmware->addOption("autoswitch", QCoreApplication::translate("Firmare", "In model setup menus automatically set switch by moving the control"));
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time")); firmware->addOption("dblkeys", QCoreApplication::translate("Firmare", "Enable resetting values by pressing up and down at the same time"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); firmware->addOption("nographics", QCoreApplication::translate("Firmare", "No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph")); firmware->addOption("battgraph", QCoreApplication::translate("Firmare", "Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); firmware->addOption("nobold", QCoreApplication::translate("Firmare", "Don't use bold font for highlighting active items"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar")); firmware->addOption("pgbar", QCoreApplication::translate("Firmare", "EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units")); firmware->addOption("imperial", QCoreApplication::translate("Firmare", "Imperial units"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); firmware->addOption("sqt5font", QCoreApplication::translate("Firmare", "Use alternative SQT5 font"));
addOpenTxCommonOptions(firmware); addOpenTxCommonOptions(firmware);
registerOpenTxFirmware(firmware); registerOpenTxFirmware(firmware);
/* MEGA2560 board */ /* MEGA2560 board */
firmware = new OpenTxFirmware("opentx-mega2560", QObject::tr("DIY MEGA2560 radio"), BOARD_MEGA2560); firmware = new OpenTxFirmware("opentx-mega2560", QCoreApplication::translate("Firmare", "DIY MEGA2560 radio"), BOARD_MEGA2560);
addOpenTxLcdOptions(firmware); addOpenTxLcdOptions(firmware);
firmware->addOption("PWR", QObject::tr("Power management by soft-off circuitry")); firmware->addOption("PWR", QCoreApplication::translate("Firmare", "Power management by soft-off circuitry"));
firmware->addOptions(ext_options); firmware->addOptions(ext_options);
firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol")); firmware->addOption("PXX", QCoreApplication::translate("Firmare", "Support of FrSky PXX protocol"));
firmware->addOptions(dsm2_options); firmware->addOptions(dsm2_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support")); firmware->addOption("heli", QCoreApplication::translate("Firmare", "Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu")); firmware->addOption("templates", QCoreApplication::translate("Firmare", "Enable TEMPLATES menu"));
firmware->addOption("nofp", QObject::tr("No flight modes")); firmware->addOption("nofp", QCoreApplication::translate("Firmare", "No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus")); firmware->addOption("nocurves", QCoreApplication::translate("Firmare", "Disable curves menus"));
firmware->addOption("sdcard", QObject::tr("Support for SD memory card")); firmware->addOption("sdcard", QCoreApplication::translate("Firmare", "Support for SD memory card"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker")); firmware->addOption("audio", QCoreApplication::translate("Firmare", "Support for radio modified with regular speaker"));
//firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode")); //firmware->addOption("voice", QCoreApplication::translate("Firmare", "Used if you have modified your radio with voice mode"));
addOpenTxVoiceOptions(firmware); addOpenTxVoiceOptions(firmware);
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode")); firmware->addOption("haptic", QCoreApplication::translate("Firmare", "Used if you have modified your radio with haptic mode"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits")); firmware->addOption("ppmca", QCoreApplication::translate("Firmare", "PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); firmware->addOption("gvars", QCoreApplication::translate("Firmare", "Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits")); firmware->addOption("symlimits", QCoreApplication::translate("Firmare", "Symetrical Limits"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); firmware->addOption("autosource", QCoreApplication::translate("Firmare", "In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); firmware->addOption("autoswitch", QCoreApplication::translate("Firmare", "In model setup menus automatically set switch by moving the control"));
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time")); firmware->addOption("dblkeys", QCoreApplication::translate("Firmare", "Enable resetting values by pressing up and down at the same time"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); firmware->addOption("nographics", QCoreApplication::translate("Firmare", "No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph")); firmware->addOption("battgraph", QCoreApplication::translate("Firmare", "Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); firmware->addOption("nobold", QCoreApplication::translate("Firmare", "Don't use bold font for highlighting active items"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar")); firmware->addOption("pgbar", QCoreApplication::translate("Firmare", "EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units")); firmware->addOption("imperial", QCoreApplication::translate("Firmare", "Imperial units"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font")); firmware->addOption("sqt5font", QCoreApplication::translate("Firmare", "Use alternative SQT5 font"));
addOpenTxCommonOptions(firmware); addOpenTxCommonOptions(firmware);
registerOpenTxFirmware(firmware); registerOpenTxFirmware(firmware);

View file

@ -110,7 +110,7 @@ void RadioData::convert(RadioDataConversionState & cstate)
} }
if (categories.size() == 0) { if (categories.size() == 0) {
categories.push_back(CategoryData(qPrintable(QObject::tr("Models")))); categories.push_back(CategoryData(qPrintable(tr("Models"))));
for (unsigned i=0; i<models.size(); i++) { for (unsigned i=0; i<models.size(); i++) {
models[i].category = 0; models[i].category = 0;
} }

View file

@ -17,6 +17,8 @@ class CategoryData {
}; };
class RadioData { class RadioData {
Q_DECLARE_TR_FUNCTIONS(RadioData)
public: public:
RadioData(); RadioData();

View file

@ -74,19 +74,19 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
result.step = 0.1; result.step = 0.1;
result.decimals = 1; result.decimals = 1;
result.max = 25.5; result.max = 25.5;
result.unit = QObject::tr("V"); result.unit = tr("V");
break; break;
case TELEMETRY_SOURCE_TX_TIME: case TELEMETRY_SOURCE_TX_TIME:
result.step = 60; result.step = 60;
result.max = 24 * 60 * result.step - 60; // 23:59:00 with 1-minute resolution result.max = 24 * 60 * result.step - 60; // 23:59:00 with 1-minute resolution
result.unit = QObject::tr("s"); result.unit = tr("s");
break; break;
case TELEMETRY_SOURCE_TIMER1: case TELEMETRY_SOURCE_TIMER1:
case TELEMETRY_SOURCE_TIMER2: case TELEMETRY_SOURCE_TIMER2:
case TELEMETRY_SOURCE_TIMER3: case TELEMETRY_SOURCE_TIMER3:
result.step = 5; result.step = 5;
result.max = 255 * result.step; result.max = 255 * result.step;
result.unit = QObject::tr("s"); result.unit = tr("s");
break; break;
case TELEMETRY_SOURCE_RSSI_TX: case TELEMETRY_SOURCE_RSSI_TX:
case TELEMETRY_SOURCE_RSSI_RX: case TELEMETRY_SOURCE_RSSI_RX:
@ -116,10 +116,10 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
result.step = (result.step * 105) / 32; result.step = (result.step * 105) / 32;
result.min = (result.min * 105) / 32; result.min = (result.min * 105) / 32;
result.max = (result.max * 105) / 32; result.max = (result.max * 105) / 32;
result.unit = QObject::tr("ft"); result.unit = tr("ft");
} }
else { else {
result.unit = QObject::tr("m"); result.unit = tr("m");
} }
break; break;
case TELEMETRY_SOURCE_T1: case TELEMETRY_SOURCE_T1:
@ -128,13 +128,13 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
case TELEMETRY_SOURCE_T2_MAX: case TELEMETRY_SOURCE_T2_MAX:
result.min = -30; result.min = -30;
result.max = 225; result.max = 225;
result.unit = QObject::trUtf8("°C"); result.unit = trUtf8("°C");
break; break;
case TELEMETRY_SOURCE_HDG: case TELEMETRY_SOURCE_HDG:
result.step = 2; result.step = 2;
result.max = 360; result.max = 360;
result.offset = 256; result.offset = 256;
result.unit = QObject::trUtf8("°"); result.unit = trUtf8("°");
break; break;
case TELEMETRY_SOURCE_RPM: case TELEMETRY_SOURCE_RPM:
case TELEMETRY_SOURCE_RPM_MAX: case TELEMETRY_SOURCE_RPM_MAX:
@ -143,7 +143,7 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
break; break;
case TELEMETRY_SOURCE_FUEL: case TELEMETRY_SOURCE_FUEL:
result.max = 100; result.max = 100;
result.unit = QObject::tr("%"); result.unit = tr("%");
break; break;
case TELEMETRY_SOURCE_ASPEED: case TELEMETRY_SOURCE_ASPEED:
case TELEMETRY_SOURCE_ASPEED_MAX: case TELEMETRY_SOURCE_ASPEED_MAX:
@ -153,12 +153,12 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
if (firmware->getCapability(Imperial) || settings.imperial) { if (firmware->getCapability(Imperial) || settings.imperial) {
result.step *= 1.150779; result.step *= 1.150779;
result.max *= 1.150779; result.max *= 1.150779;
result.unit = QObject::tr("mph"); result.unit = tr("mph");
} }
else { else {
result.step *= 1.852; result.step *= 1.852;
result.max *= 1.852; result.max *= 1.852;
result.unit = QObject::tr("km/h"); result.unit = tr("km/h");
} }
break; break;
case TELEMETRY_SOURCE_SPEED: case TELEMETRY_SOURCE_SPEED:
@ -168,12 +168,12 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
if (firmware->getCapability(Imperial) || settings.imperial) { if (firmware->getCapability(Imperial) || settings.imperial) {
result.step *= 1.150779; result.step *= 1.150779;
result.max *= 1.150779; result.max *= 1.150779;
result.unit = QObject::tr("mph"); result.unit = tr("mph");
} }
else { else {
result.step *= 1.852; result.step *= 1.852;
result.max *= 1.852; result.max *= 1.852;
result.unit = QObject::tr("km/h"); result.unit = tr("km/h");
} }
break; break;
case TELEMETRY_SOURCE_VERTICAL_SPEED: case TELEMETRY_SOURCE_VERTICAL_SPEED:
@ -181,7 +181,7 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
result.min = -12.5; result.min = -12.5;
result.max = 13.0; result.max = 13.0;
result.decimals = 1; result.decimals = 1;
result.unit = QObject::tr("m/s"); result.unit = tr("m/s");
break; break;
case TELEMETRY_SOURCE_DTE: case TELEMETRY_SOURCE_DTE:
result.max = 30000; result.max = 30000;
@ -190,14 +190,14 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
case TELEMETRY_SOURCE_DIST_MAX: case TELEMETRY_SOURCE_DIST_MAX:
result.step = 8; result.step = 8;
result.max = 2040; result.max = 2040;
result.unit = QObject::tr("m"); result.unit = tr("m");
break; break;
case TELEMETRY_SOURCE_CELL: case TELEMETRY_SOURCE_CELL:
case TELEMETRY_SOURCE_CELL_MIN: case TELEMETRY_SOURCE_CELL_MIN:
result.step = 0.02; result.step = 0.02;
result.max = 5.1; result.max = 5.1;
result.decimals = 2; result.decimals = 2;
result.unit = QObject::tr("V"); result.unit = tr("V");
break; break;
case TELEMETRY_SOURCE_CELLS_SUM: case TELEMETRY_SOURCE_CELLS_SUM:
case TELEMETRY_SOURCE_CELLS_MIN: case TELEMETRY_SOURCE_CELLS_MIN:
@ -206,25 +206,25 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
result.step = 0.1; result.step = 0.1;
result.max = 25.5; result.max = 25.5;
result.decimals = 1; result.decimals = 1;
result.unit = QObject::tr("V"); result.unit = tr("V");
break; break;
case TELEMETRY_SOURCE_CURRENT: case TELEMETRY_SOURCE_CURRENT:
case TELEMETRY_SOURCE_CURRENT_MAX: case TELEMETRY_SOURCE_CURRENT_MAX:
result.step = 0.5; result.step = 0.5;
result.max = 127.5; result.max = 127.5;
result.decimals = 1; result.decimals = 1;
result.unit = QObject::tr("A"); result.unit = tr("A");
break; break;
case TELEMETRY_SOURCE_CONSUMPTION: case TELEMETRY_SOURCE_CONSUMPTION:
result.step = 100; result.step = 100;
result.max = 25500; result.max = 25500;
result.unit = QObject::tr("mAh"); result.unit = tr("mAh");
break; break;
case TELEMETRY_SOURCE_POWER: case TELEMETRY_SOURCE_POWER:
case TELEMETRY_SOURCE_POWER_MAX: case TELEMETRY_SOURCE_POWER_MAX:
result.step = 5; result.step = 5;
result.max = 1275; result.max = 1275;
result.unit = QObject::tr("W"); result.unit = tr("W");
break; break;
case TELEMETRY_SOURCE_ACCX: case TELEMETRY_SOURCE_ACCX:
case TELEMETRY_SOURCE_ACCY: case TELEMETRY_SOURCE_ACCY:
@ -233,7 +233,7 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
result.decimals = 2; result.decimals = 2;
result.max = 2.55; result.max = 2.55;
result.min = 0; result.min = 0;
result.unit = QObject::tr("g"); result.unit = tr("g");
break; break;
default: default:
result.max = 125; result.max = 125;
@ -277,18 +277,18 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
result.step = 0.1; result.step = 0.1;
result.decimals = 1; result.decimals = 1;
result.max = 25.5; result.max = 25.5;
result.unit = QObject::tr("V"); result.unit = tr("V");
} }
else if (index == 1) { //Time else if (index == 1) { //Time
result.step = 60; result.step = 60;
result.max = 24 * 60 * result.step - 60; // 23:59:00 with 1-minute resolution result.max = 24 * 60 * result.step - 60; // 23:59:00 with 1-minute resolution
result.unit = QObject::tr("s"); result.unit = tr("s");
} }
else { // Timers 1 - 3 else { // Timers 1 - 3
result.step = 1; result.step = 1;
result.max = 9 * 60 * 60 - 1; // 8:59:59 (to match firmware) result.max = 9 * 60 * 60 - 1; // 8:59:59 (to match firmware)
result.min = -result.max; result.min = -result.max;
result.unit = QObject::tr("s"); result.unit = tr("s");
} }
break; break;
@ -317,50 +317,50 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con
} }
static const QString trims[] = { static const QString trims[] = {
QObject::tr("TrmR"), QObject::tr("TrmE"), QObject::tr("TrmT"), QObject::tr("TrmA"), QObject::tr("Trm5"), QObject::tr("Trm6") tr("TrmR"), tr("TrmE"), tr("TrmT"), tr("TrmA"), tr("Trm5"), tr("Trm6")
}; };
static const QString special[] = { static const QString special[] = {
QObject::tr("Batt"), QObject::tr("Time"), QObject::tr("Timer1"), QObject::tr("Timer2"), QObject::tr("Timer3"), tr("Batt"), tr("Time"), tr("Timer1"), tr("Timer2"), tr("Timer3"),
}; };
static const QString telemetry[] = { static const QString telemetry[] = {
QObject::tr("Batt"), QObject::tr("Time"), QObject::tr("Timer1"), QObject::tr("Timer2"), QObject::tr("Timer3"), tr("Batt"), tr("Time"), tr("Timer1"), tr("Timer2"), tr("Timer3"),
QObject::tr("SWR"), QObject::tr("RSSI Tx"), QObject::tr("RSSI Rx"), tr("SWR"), tr("RSSI Tx"), tr("RSSI Rx"),
QObject::tr("A1"), QObject::tr("A2"), QObject::tr("A3"), QObject::tr("A4"), tr("A1"), tr("A2"), tr("A3"), tr("A4"),
QObject::tr("Alt"), QObject::tr("Rpm"), QObject::tr("Fuel"), QObject::tr("T1"), QObject::tr("T2"), tr("Alt"), tr("Rpm"), tr("Fuel"), tr("T1"), tr("T2"),
QObject::tr("Speed"), QObject::tr("Dist"), QObject::tr("GPS Alt"), tr("Speed"), tr("Dist"), tr("GPS Alt"),
QObject::tr("Cell"), QObject::tr("Cells"), QObject::tr("Vfas"), QObject::tr("Curr"), QObject::tr("Cnsp"), QObject::tr("Powr"), tr("Cell"), tr("Cells"), tr("Vfas"), tr("Curr"), tr("Cnsp"), tr("Powr"),
QObject::tr("AccX"), QObject::tr("AccY"), QObject::tr("AccZ"), tr("AccX"), tr("AccY"), tr("AccZ"),
QObject::tr("Hdg "), QObject::tr("VSpd"), QObject::tr("AirSpeed"), QObject::tr("dTE"), tr("Hdg "), tr("VSpd"), tr("AirSpeed"), tr("dTE"),
QObject::tr("A1-"), QObject::tr("A2-"), QObject::tr("A3-"), QObject::tr("A4-"), tr("A1-"), tr("A2-"), tr("A3-"), tr("A4-"),
QObject::tr("Alt-"), QObject::tr("Alt+"), QObject::tr("Rpm+"), QObject::tr("T1+"), QObject::tr("T2+"), QObject::tr("Speed+"), QObject::tr("Dist+"), QObject::tr("AirSpeed+"), tr("Alt-"), tr("Alt+"), tr("Rpm+"), tr("T1+"), tr("T2+"), tr("Speed+"), tr("Dist+"), tr("AirSpeed+"),
QObject::tr("Cell-"), QObject::tr("Cells-"), QObject::tr("Vfas-"), QObject::tr("Curr+"), QObject::tr("Powr+"), tr("Cell-"), tr("Cells-"), tr("Vfas-"), tr("Curr+"), tr("Powr+"),
QObject::tr("ACC"), QObject::tr("GPS Time"), tr("ACC"), tr("GPS Time"),
}; };
static const QString rotary[] = { QObject::tr("REa"), QObject::tr("REb") }; static const QString rotary[] = { tr("REa"), tr("REb") };
if (index<0) { if (index<0) {
return QObject::tr("???"); return tr("???");
} }
QString result; QString result;
int genAryIdx = 0; int genAryIdx = 0;
switch (type) { switch (type) {
case SOURCE_TYPE_NONE: case SOURCE_TYPE_NONE:
return QObject::tr("----"); return tr("----");
case SOURCE_TYPE_VIRTUAL_INPUT: case SOURCE_TYPE_VIRTUAL_INPUT:
{ {
const char * name = NULL; const char * name = NULL;
if (model) if (model)
name = model->inputNames[index]; name = model->inputNames[index];
return RadioData::getElementName(QCoreApplication::translate("Input", "I"), index + 1, name); return RadioData::getElementName(tr("I", "as in Input"), index + 1, name);
} }
case SOURCE_TYPE_LUA_OUTPUT: case SOURCE_TYPE_LUA_OUTPUT:
return QObject::tr("LUA%1%2").arg(index/16+1).arg(QChar('a'+index%16)); return tr("LUA%1%2").arg(index/16+1).arg(QChar('a'+index%16));
case SOURCE_TYPE_STICK: case SOURCE_TYPE_STICK:
if (generalSettings) { if (generalSettings) {
@ -380,7 +380,7 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con
case SOURCE_TYPE_ROTARY_ENCODER: case SOURCE_TYPE_ROTARY_ENCODER:
return CHECK_IN_ARRAY(rotary, index); return CHECK_IN_ARRAY(rotary, index);
case SOURCE_TYPE_MAX: case SOURCE_TYPE_MAX:
return QObject::tr("MAX"); return tr("MAX");
case SOURCE_TYPE_SWITCH: case SOURCE_TYPE_SWITCH:
if (generalSettings) if (generalSettings)
@ -393,18 +393,16 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con
return RawSwitch(SWITCH_TYPE_VIRTUAL, index+1).toString(); return RawSwitch(SWITCH_TYPE_VIRTUAL, index+1).toString();
case SOURCE_TYPE_CYC: case SOURCE_TYPE_CYC:
return QObject::tr("CYC%1").arg(index+1); return tr("CYC%1").arg(index+1);
case SOURCE_TYPE_PPM: case SOURCE_TYPE_PPM:
return RadioData::getElementName(QCoreApplication::translate("Trainer", "TR"), index + 1); return RadioData::getElementName(tr("TR", "as in Trainer"), index + 1);
case SOURCE_TYPE_CH: case SOURCE_TYPE_CH:
{ if (model)
const char * name = NULL; return model->limitData[index].nameToString(index);
if (getCurrentFirmware()->getCapability(ChannelsName) && model) else
name = model->limitData[index].name; return LimitData().nameToString(index);
return RadioData::getElementName(QCoreApplication::translate("Channel", "CH"), index + 1, name);
}
case SOURCE_TYPE_SPECIAL: case SOURCE_TYPE_SPECIAL:
return CHECK_IN_ARRAY(special, index); return CHECK_IN_ARRAY(special, index);
@ -412,7 +410,10 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con
case SOURCE_TYPE_TELEMETRY: case SOURCE_TYPE_TELEMETRY:
if (IS_ARM(board)) { if (IS_ARM(board)) {
div_t qr = div(index, 3); div_t qr = div(index, 3);
result = RadioData::getElementName(QCoreApplication::translate("Telemetry", "TELE"), qr.quot+1, model ? model->sensorData[qr.quot].label : NULL); if (model)
result = model->sensorData[qr.quot].nameToString(qr.quot);
else
result = SensorData().nameToString(qr.quot);
if (qr.rem) if (qr.rem)
result += (qr.rem == 1 ? "-" : "+"); result += (qr.rem == 1 ? "-" : "+");
return result; return result;
@ -422,15 +423,13 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con
} }
case SOURCE_TYPE_GVAR: case SOURCE_TYPE_GVAR:
{ if (model)
const char * name = NULL; return model->gvarData[index].nameToString(index);
if (getCurrentFirmware()->getCapability(GvarsName) && model) else
name = model->gvarData[index].name; return GVarData().nameToString(index);
return RadioData::getElementName(QCoreApplication::translate("Global Variable", "GV"), index + 1, name);
}
default: default:
return QObject::tr("???"); return tr("???");
} }
} }
@ -545,7 +544,7 @@ bool RawSource::isAvailable(const ModelData * const model, const GeneralSettings
RawSource RawSource::convert(RadioDataConversionState & cstate) RawSource RawSource::convert(RadioDataConversionState & cstate)
{ {
cstate.setItemType("SRC", 1); cstate.setItemType(tr("SRC"), 1);
RadioDataConversionState::EventType evt = RadioDataConversionState::EVT_NONE; RadioDataConversionState::EventType evt = RadioDataConversionState::EVT_NONE;
RadioDataConversionState::LogField oldData(index, toString(cstate.fromModel(), cstate.fromGS(), cstate.fromType)); RadioDataConversionState::LogField oldData(index, toString(cstate.fromModel(), cstate.fromGS(), cstate.fromType));

View file

@ -184,6 +184,8 @@ enum RawSourceType {
class RawSourceRange class RawSourceRange
{ {
Q_DECLARE_TR_FUNCTIONS(RawSourceRange)
public: public:
RawSourceRange(): RawSourceRange():
decimals(0), decimals(0),
@ -208,6 +210,8 @@ class RawSourceRange
#define RANGE_ABS_FUNCTION 2 #define RANGE_ABS_FUNCTION 2
class RawSource { class RawSource {
Q_DECLARE_TR_FUNCTIONS(RawSource)
public: public:
RawSource(): RawSource():
type(SOURCE_TYPE_NONE), type(SOURCE_TYPE_NONE),

View file

@ -37,21 +37,21 @@ QString RawSwitch::toString(Board::Type board, const GeneralSettings * const gen
}; };
static const QString trimsSwitches[] = { static const QString trimsSwitches[] = {
QObject::tr("RudTrim Left"), QObject::tr("RudTrim Right"), tr("RudTrim Left"), tr("RudTrim Right"),
QObject::tr("EleTrim Down"), QObject::tr("EleTrim Up"), tr("EleTrim Down"), tr("EleTrim Up"),
QObject::tr("ThrTrim Down"), QObject::tr("ThrTrim Up"), tr("ThrTrim Down"), tr("ThrTrim Up"),
QObject::tr("AilTrim Left"), QObject::tr("AilTrim Right"), tr("AilTrim Left"), tr("AilTrim Right"),
QObject::tr("Trim 5 Down"), QObject::tr("Trim 5 Up"), tr("Trim 5 Down"), tr("Trim 5 Up"),
QObject::tr("Trim 6 Down"), QObject::tr("Trim 6 Up") tr("Trim 6 Down"), tr("Trim 6 Up")
}; };
static const QString rotaryEncoders[] = { static const QString rotaryEncoders[] = {
QObject::tr("REa"), QObject::tr("REb") tr("REa"), tr("REb")
}; };
static const QString timerModes[] = { static const QString timerModes[] = {
QObject::tr("OFF"), QObject::tr("ON"), tr("OFF"), tr("ON"),
QObject::tr("THs"), QObject::tr("TH%"), QObject::tr("THt") tr("THs"), tr("TH%"), tr("THt")
}; };
const QStringList directionIndicators = QStringList() const QStringList directionIndicators = QStringList()
@ -80,11 +80,14 @@ QString RawSwitch::toString(Board::Type board, const GeneralSettings * const gen
} }
case SWITCH_TYPE_VIRTUAL: case SWITCH_TYPE_VIRTUAL:
return RadioData::getElementName(QCoreApplication::translate("Logic Switch", "L"), index, NULL, true); if (modelData)
return modelData->logicalSw[index].nameToString(index);
else
return LogicalSwitchData().nameToString(index);
case SWITCH_TYPE_MULTIPOS_POT: case SWITCH_TYPE_MULTIPOS_POT:
if (!Boards::getCapability(board, Board::MultiposPotsPositions)) if (!Boards::getCapability(board, Board::MultiposPotsPositions))
return QObject::tr("???"); return tr("???");
qr = div(index - 1, Boards::getCapability(board, Board::MultiposPotsPositions)); qr = div(index - 1, Boards::getCapability(board, Board::MultiposPotsPositions));
if (generalSettings && qr.quot < (int)DIM(generalSettings->potConfig)) if (generalSettings && qr.quot < (int)DIM(generalSettings->potConfig))
swName = QString(generalSettings->potName[qr.quot]); swName = QString(generalSettings->potName[qr.quot]);
@ -99,31 +102,37 @@ QString RawSwitch::toString(Board::Type board, const GeneralSettings * const gen
return CHECK_IN_ARRAY(rotaryEncoders, index-1); return CHECK_IN_ARRAY(rotaryEncoders, index-1);
case SWITCH_TYPE_ON: case SWITCH_TYPE_ON:
return QObject::tr("ON"); return tr("ON");
case SWITCH_TYPE_OFF: case SWITCH_TYPE_OFF:
return QObject::tr("OFF"); return tr("OFF");
case SWITCH_TYPE_ONE: case SWITCH_TYPE_ONE:
return QObject::tr("One"); return tr("One");
case SWITCH_TYPE_FLIGHT_MODE: case SWITCH_TYPE_FLIGHT_MODE:
return RadioData::getElementName(QCoreApplication::translate("Flight mode", "FM"), index - 1, modelData ? modelData->flightModeData[index-1].name : NULL); if (modelData)
return modelData->flightModeData[index-1].nameToString(index - 1);
else
return FlightModeData().nameToString(index - 1);
case SWITCH_TYPE_NONE: case SWITCH_TYPE_NONE:
return QObject::tr("----"); return tr("----");
case SWITCH_TYPE_TIMER_MODE: case SWITCH_TYPE_TIMER_MODE:
return CHECK_IN_ARRAY(timerModes, index); return CHECK_IN_ARRAY(timerModes, index);
case SWITCH_TYPE_SENSOR: case SWITCH_TYPE_SENSOR:
return RadioData::getElementName(QCoreApplication::translate("Telemetry", "TELE"), index, modelData ? modelData->sensorData[index-1].label : NULL); if (modelData)
return modelData->sensorData[index-1].nameToString(index-1);
else
return SensorData().nameToString(index-1);
case SWITCH_TYPE_TELEMETRY: case SWITCH_TYPE_TELEMETRY:
return QObject::tr("Telemetry"); return tr("Telemetry");
default: default:
return QObject::tr("???"); return tr("???");
} }
} }
} }
@ -163,7 +172,7 @@ RawSwitch RawSwitch::convert(RadioDataConversionState & cstate)
if (!index) if (!index)
return *this; return *this;
cstate.setItemType("SW", 2); cstate.setItemType(tr("SW"), 2);
RadioDataConversionState::EventType evt = RadioDataConversionState::EVT_NONE; RadioDataConversionState::EventType evt = RadioDataConversionState::EVT_NONE;
RadioDataConversionState::LogField oldData(index, toString(cstate.fromType, cstate.fromGS(), cstate.fromModel())); RadioDataConversionState::LogField oldData(index, toString(cstate.fromType, cstate.fromGS(), cstate.fromModel()));

View file

@ -49,6 +49,8 @@ enum RawSwitchType {
}; };
class RawSwitch { class RawSwitch {
Q_DECLARE_TR_FUNCTIONS(RawSwitch)
public: public:
RawSwitch(): RawSwitch():
type(SWITCH_TYPE_NONE), type(SWITCH_TYPE_NONE),

View file

@ -20,6 +20,8 @@
#include "sensordata.h" #include "sensordata.h"
#include "radiodata.h"
void SensorData::updateUnit() void SensorData::updateUnit()
{ {
if (type == TELEM_TYPE_CALCULATED) { if (type == TELEM_TYPE_CALCULATED) {
@ -32,54 +34,59 @@ QString SensorData::unitString() const
{ {
switch (unit) { switch (unit) {
case UNIT_VOLTS: case UNIT_VOLTS:
return QObject::tr("V"); return tr("V");
case UNIT_AMPS: case UNIT_AMPS:
return QObject::tr("A"); return tr("A");
case UNIT_MILLIAMPS: case UNIT_MILLIAMPS:
return QObject::tr("mA"); return tr("mA");
case UNIT_KTS: case UNIT_KTS:
return QObject::tr("kts"); return tr("kts");
case UNIT_METERS_PER_SECOND: case UNIT_METERS_PER_SECOND:
return QObject::tr("m/s"); return tr("m/s");
case UNIT_KMH: case UNIT_KMH:
return QObject::tr("km/h"); return tr("km/h");
case UNIT_MPH: case UNIT_MPH:
return QObject::tr("mph"); return tr("mph");
case UNIT_METERS: case UNIT_METERS:
return QObject::tr("m"); return tr("m");
case UNIT_FEET: case UNIT_FEET:
return QObject::tr("f"); return tr("f");
case UNIT_CELSIUS: case UNIT_CELSIUS:
return QObject::trUtf8("°C"); return trUtf8("°C");
case UNIT_FAHRENHEIT: case UNIT_FAHRENHEIT:
return QObject::trUtf8("°F"); return trUtf8("°F");
case UNIT_PERCENT: case UNIT_PERCENT:
return QObject::tr("%"); return tr("%");
case UNIT_MAH: case UNIT_MAH:
return QObject::tr("mAh"); return tr("mAh");
case UNIT_WATTS: case UNIT_WATTS:
return QObject::tr("W"); return tr("W");
case UNIT_MILLIWATTS: case UNIT_MILLIWATTS:
return QObject::tr("mW"); return tr("mW");
case UNIT_DB: case UNIT_DB:
return QObject::tr("dB"); return tr("dB");
case UNIT_RPMS: case UNIT_RPMS:
return QObject::tr("rpms"); return tr("rpms");
case UNIT_G: case UNIT_G:
return QObject::tr("g"); return tr("g");
case UNIT_DEGREE: case UNIT_DEGREE:
return QObject::trUtf8("°"); return trUtf8("°");
case UNIT_RADIANS: case UNIT_RADIANS:
return QObject::trUtf8("Rad"); return trUtf8("Rad");
case UNIT_HOURS: case UNIT_HOURS:
return QObject::tr("hours"); return tr("hours");
case UNIT_MINUTES: case UNIT_MINUTES:
return QObject::tr("minutes"); return tr("minutes");
case UNIT_SECONDS: case UNIT_SECONDS:
return QObject::tr("seconds"); return tr("seconds");
case UNIT_CELLS: case UNIT_CELLS:
return QObject::tr("V"); return tr("V");
default: default:
return ""; return "";
} }
} }
QString SensorData::nameToString(int index) const
{
return RadioData::getElementName(tr("TELE"), index + 1, label);
}

View file

@ -24,7 +24,9 @@
#include <QtCore> #include <QtCore>
#define CPN_MAX_SENSORS 32 #define CPN_MAX_SENSORS 32
class SensorData { class SensorData {
Q_DECLARE_TR_FUNCTIONS(SensorData)
public: public:
@ -141,6 +143,7 @@ class SensorData {
bool isAvailable() const { return strlen(label) > 0; } bool isAvailable() const { return strlen(label) > 0; }
void updateUnit(); void updateUnit();
QString unitString() const; QString unitString() const;
QString nameToString(int index) const;
void clear() { memset(this, 0, sizeof(SensorData)); } void clear() { memset(this, 0, sizeof(SensorData)); }
}; };

View file

@ -41,7 +41,7 @@ RawSourceRange FrSkyChannelData::getRange() const
result.step = ratio / 255; result.step = ratio / 255;
result.min = offset * result.step; result.min = offset * result.step;
result.max = ratio + result.min; result.max = ratio + result.min;
result.unit = QObject::tr("V"); result.unit = tr("V");
return result; return result;
} }

View file

@ -36,6 +36,8 @@ class FrSkyAlarmData {
}; };
class FrSkyChannelData { class FrSkyChannelData {
Q_DECLARE_TR_FUNCTIONS(FrSkyChannelData)
public: public:
FrSkyChannelData() { clear(); } FrSkyChannelData() { clear(); }
unsigned int ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc. unsigned int ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.

View file

@ -1326,7 +1326,7 @@ bool MdiChild::loadFile(const QString & filename, bool resetCurrentFile)
QString warning = storage.warning(); QString warning = storage.warning();
if (!warning.isEmpty()) { if (!warning.isEmpty()) {
// TODO ShowEepromWarnings(this, tr("Warning"), warning); // TODO EEPROMInterface::showEepromWarnings(this, tr("Warning"), warning);
} }
if (resetCurrentFile) { if (resetCurrentFile) {
@ -1577,11 +1577,11 @@ bool MdiChild::loadBackup()
#if 0 #if 0
std::bitset<NUM_ERRORS> errorsEeprom((unsigned long long)LoadBackup(radioData, (uint8_t *)eeprom.data(), eeprom_size, index)); std::bitset<NUM_ERRORS> errorsEeprom((unsigned long long)LoadBackup(radioData, (uint8_t *)eeprom.data(), eeprom_size, index));
if (!errorsEeprom.test(ALL_OK)) { if (!errorsEeprom.test(ALL_OK)) {
ShowEepromErrors(this, tr("Error"), tr("Invalid binary backup File %1").arg(fileName), (errorsEeprom).to_ulong()); EEPROMInterface::showEepromErrors(this, tr("Error"), tr("Invalid binary backup File %1").arg(fileName), (errorsEeprom).to_ulong());
return false; return false;
} }
if (errorsEeprom.test(HAS_WARNINGS)) { if (errorsEeprom.test(HAS_WARNINGS)) {
ShowEepromWarnings(this, tr("Warning"), errorsEeprom.to_ulong()); EEPROMInterface::showEepromWarnings(this, tr("Warning"), errorsEeprom.to_ulong());
} }
refresh(true); refresh(true);

View file

@ -490,7 +490,7 @@ QString ModelPrinter::printFlightModeSwitch(const RawSwitch & swtch)
QString ModelPrinter::printFlightModeName(int index) QString ModelPrinter::printFlightModeName(int index)
{ {
return model.flightModeData[index].toString(index); return model.flightModeData[index].nameToString(index);
} }
QString ModelPrinter::printFlightModes(unsigned int flightModes) QString ModelPrinter::printFlightModes(unsigned int flightModes)