diff --git a/DONATIONS.txt b/DONATIONS.txt
index a868d4b66f..0f9eb76b22 100644
--- a/DONATIONS.txt
+++ b/DONATIONS.txt
@@ -302,3 +302,8 @@ Dan Neelands
Yashiro Masayuki
Isaac Sloan
Harold Baird
+Roy Bender
+Bradley Murchie
+Maximilian Süß
+Dean Jansa
+Ronald Donker
diff --git a/companion/src/comparedialog.cpp b/companion/src/comparedialog.cpp
index 3cebee8568..6b1609c0ed 100644
--- a/companion/src/comparedialog.cpp
+++ b/companion/src/comparedialog.cpp
@@ -1260,6 +1260,7 @@ void compareDialog::printFrSky()
color=getColor1(fd1->rssiAlarms[1].value,fd2->rssiAlarms[1].value);
str.append("
"+QString::number(fd1->rssiAlarms[1].value,10)+" | ");
str.append("");
+#if 0
if (GetEepromInterface()->getCapability(TelemetryBars) || GetEepromInterface()->getCapability(TelemetryCSFields)) {
int cols=GetEepromInterface()->getCapability(TelemetryColsCSFields);
if (cols==0) cols=2;
@@ -1300,13 +1301,13 @@ void compareDialog::printFrSky()
if (fd1->screens[0].type==fd2->screens[0].type)
color=getColor1(fd1->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].source);
str.append(""+getFrSkySrc(fd1->screens[0].body.bars[i].source)+" | ");
- value1=getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMin,fd1);
- value2=getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMin,fd2);
+ // TODO value1 = getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMin,fd1);
+ // TODO value2 = getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMin,fd2);
if (fd1->screens[0].type==fd2->screens[0].type)
color=getColor1(value1,value2);
str.append(""+QString::number(value1)+" | ");
- value1=getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMax,fd1);
- value2=getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMax,fd2);
+ // TODO value1=getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMax,fd1);
+ // TODO value2=getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMax,fd2);
if (fd1->screens[0].type==fd2->screens[0].type)
color=getColor1(value1,value2);
str.append(""+QString::number(value1)+" | ");
@@ -1315,6 +1316,7 @@ void compareDialog::printFrSky()
}
}
}
+#endif
str.append("");
str.append("");
@@ -1377,7 +1379,7 @@ void compareDialog::printFrSky()
color=getColor2(fd1->rssiAlarms[1].value,fd2->rssiAlarms[1].value);
str.append(""+QString::number(fd2->rssiAlarms[1].value,10)+" | ");
str.append(" ");
-
+#if 0
if (GetEepromInterface()->getCapability(TelemetryBars) || GetEepromInterface()->getCapability(TelemetryCSFields)) {
int cols=GetEepromInterface()->getCapability(TelemetryColsCSFields);
if (cols==0) cols=2;
@@ -1418,13 +1420,13 @@ void compareDialog::printFrSky()
if (fd1->screens[0].type==fd2->screens[0].type)
color=getColor2(fd1->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].source);
str.append(" | "+getFrSkySrc(fd2->screens[0].body.bars[i].source)+" | ");
- value1=getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMin,fd1);
- value2=getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMin,fd2);
+ // TODO value1=getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMin,fd1);
+ // TODO value2=getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMin,fd2);
if (fd1->screens[0].type==fd2->screens[0].type)
color=getColor2(value1,value2);
str.append(""+QString::number(value2)+" | ");
- value1=getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMax,fd1);
- value2=getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMax,fd2);
+ // TODO value1=getBarValue(fd1->screens[0].body.bars[i].source,fd1->screens[0].body.bars[i].barMax,fd1);
+ // TODO value2=getBarValue(fd2->screens[0].body.bars[i].source,fd2->screens[0].body.bars[i].barMax,fd2);
if (fd1->screens[0].type==fd2->screens[0].type)
color=getColor2(value1,value2);
str.append(""+QString::number(value2)+" | ");
@@ -1433,6 +1435,7 @@ void compareDialog::printFrSky()
}
}
}
+#endif
str.append("");
te->append(str);
}
diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp
index 1b56e3ef56..ae3d658145 100644
--- a/companion/src/eeprominterface.cpp
+++ b/companion/src/eeprominterface.cpp
@@ -37,215 +37,117 @@ void getEEPROMString(char *dst, const char *src, int size)
}
}
-int RawSource::getDecimals(const ModelData & Model)
+RawSourceRange RawSource::getRange(bool singleprec)
{
- if(type==SOURCE_TYPE_TELEMETRY) {
- switch (index) {
- case TELEMETRY_SOURCE_A1:
- case TELEMETRY_SOURCE_A2:
- return (Model.frsky.channels[index-TELEMETRY_SOURCE_A1].type==0 ? 2: 0);
- case TELEMETRY_SOURCE_CELL:
- return 2;
- case TELEMETRY_SOURCE_CELLS_SUM:
- case TELEMETRY_SOURCE_VFAS:
- case TELEMETRY_SOURCE_CURRENT:
- return 1;
- default:
- return 0;
- }
- }
- return 0;
-}
+ RawSourceRange result;
+
+ int board = GetEepromInterface()->getBoard();
+
+ if (!singleprec && !IS_TARANIS(board)) {
+ singleprec = true;
+ }
-double RawSource::getMin(const ModelData & Model)
-{
switch (type) {
case SOURCE_TYPE_TELEMETRY:
switch (index) {
- /*case TELEMETRY_SOURCE_NONE:
case TELEMETRY_SOURCE_TX_BATT:
+ result.step = 0.1;
+ result.decimals = 1;
+ result.max = 25.5;
+ break;
case TELEMETRY_SOURCE_TIMER1:
case TELEMETRY_SOURCE_TIMER2:
- return 0; */
- case TELEMETRY_SOURCE_A1:
- case TELEMETRY_SOURCE_A2:
- if (Model.frsky.channels[index-TELEMETRY_SOURCE_A1].type==0) {
- return (Model.frsky.channels[index-TELEMETRY_SOURCE_A1].offset*Model.frsky.channels[index-TELEMETRY_SOURCE_A1].ratio)/2550.0;
- }
- else {
- return (Model.frsky.channels[index-TELEMETRY_SOURCE_A1].offset*Model.frsky.channels[index-TELEMETRY_SOURCE_A1].ratio)/255.0;
- }
- case TELEMETRY_SOURCE_ALT:
- case TELEMETRY_SOURCE_GPS_ALT:
- return -500;
- case TELEMETRY_SOURCE_T1:
- case TELEMETRY_SOURCE_T2:
- return -30;
- default:
- return 0;
- }
- break;
- default:
- return (Model.extendedLimits ? -125 :-100);
- }
-}
-
-double RawSource::getMax(const ModelData & Model)
-{
- switch (type) {
- case SOURCE_TYPE_TELEMETRY:
- switch (index) {
- case TELEMETRY_SOURCE_TIMER1:
- case TELEMETRY_SOURCE_TIMER2:
- return 765;
+ result.step = singleprec ? 3 : 1;
+ result.max = singleprec ? 765 : 7200;
+ break;
case TELEMETRY_SOURCE_RSSI_TX:
case TELEMETRY_SOURCE_RSSI_RX:
- return 100;
+ result.max = 100;
+ break;
case TELEMETRY_SOURCE_A1:
case TELEMETRY_SOURCE_A2:
- if (Model.frsky.channels[index-TELEMETRY_SOURCE_A1].type==0) {
- return (Model.frsky.channels[index-TELEMETRY_SOURCE_A1].ratio-(Model.frsky.channels[index-TELEMETRY_SOURCE_A1].offset*Model.frsky.channels[index-TELEMETRY_SOURCE_A1].ratio)/255.0)/10;
- } else {
- return Model.frsky.channels[index-TELEMETRY_SOURCE_A1].ratio-(Model.frsky.channels[index-TELEMETRY_SOURCE_A1].offset*Model.frsky.channels[index-TELEMETRY_SOURCE_A1].ratio)/255.0;
+ if (model) {
+ FrSkyChannelData channel = model->frsky.channels[index-TELEMETRY_SOURCE_A1]; // TODO const &
+ float ratio = channel.getRatio();
+ if (channel.type==0 || channel.type==1 || channel.type==2)
+ result.decimals = 2;
+ else
+ result.decimals = 0;
+ result.step = ratio / 255;
+ result.min = channel.offset * result.step;
+ result.max = ratio + result.min;
}
+ break;
case TELEMETRY_SOURCE_ALT:
case TELEMETRY_SOURCE_GPS_ALT:
- return 1540;
- case TELEMETRY_SOURCE_RPM:
- return 12750;
- case TELEMETRY_SOURCE_FUEL:
- return 100;
+ result.step = singleprec ? 8 : 1;
+ result.min = -500;
+ result.max = singleprec ? 1540 : 3000;
+ break;
case TELEMETRY_SOURCE_T1:
case TELEMETRY_SOURCE_T2:
- return 225;
- case TELEMETRY_SOURCE_SPEED:
- return 944;
- case TELEMETRY_SOURCE_DIST:
- return 2040;
- case TELEMETRY_SOURCE_CELL:
- return 5.1;
- case TELEMETRY_SOURCE_CELLS_SUM:
- case TELEMETRY_SOURCE_VFAS:
- return 25.5;
- case TELEMETRY_SOURCE_CURRENT:
- return 127.5;
- case TELEMETRY_SOURCE_CONSUMPTION:
- return 5100;
- case TELEMETRY_SOURCE_POWER:
- return 1275;
- default:
- return 125;
- }
- break;
- default:
- return (Model.extendedLimits ? 125 :100);
- }
-}
-
-double RawSource::getOffset(const ModelData & Model)
-{
- if (type==SOURCE_TYPE_TELEMETRY) {
- switch (index) {
- case TELEMETRY_SOURCE_A1:
- case TELEMETRY_SOURCE_A2:
- if (Model.frsky.channels[index-TELEMETRY_SOURCE_A1].type==0) {
- return (Model.frsky.channels[index-TELEMETRY_SOURCE_A1].offset*Model.frsky.channels[index-TELEMETRY_SOURCE_A1].ratio)/2550.0;
- }
- else {
- return (Model.frsky.channels[index-TELEMETRY_SOURCE_A1].offset*Model.frsky.channels[index-TELEMETRY_SOURCE_A1].ratio)/255.0;
- }
- case TELEMETRY_SOURCE_ALT:
- case TELEMETRY_SOURCE_GPS_ALT:
- return 524;
- case TELEMETRY_SOURCE_RPM:
- return 6400;
- case TELEMETRY_SOURCE_FUEL:
- return 0;
- case TELEMETRY_SOURCE_T1:
- case TELEMETRY_SOURCE_T2:
- return 98;
- case TELEMETRY_SOURCE_SPEED:
- return 474;
- case TELEMETRY_SOURCE_DIST:
- return 1024;
- case TELEMETRY_SOURCE_CELL:
- return 2.56;
- default:
- return 0;
- }
- }
- return 0;
-}
-
-int RawSource::getRawOffset(const ModelData & Model)
-{
- switch (type) {
- case SOURCE_TYPE_TELEMETRY:
- switch (index) {
- case TELEMETRY_SOURCE_TIMER1:
- case TELEMETRY_SOURCE_TIMER2:
- case TELEMETRY_SOURCE_RSSI_TX:
- case TELEMETRY_SOURCE_RSSI_RX:
- case TELEMETRY_SOURCE_A1:
- case TELEMETRY_SOURCE_A2:
- case TELEMETRY_SOURCE_FUEL:
- case TELEMETRY_SOURCE_CELLS_SUM:
- case TELEMETRY_SOURCE_VFAS:
- case TELEMETRY_SOURCE_CURRENT:
- case TELEMETRY_SOURCE_CONSUMPTION:
- case TELEMETRY_SOURCE_POWER:
- return 128;
- default:
- return 0;
- }
- default:
- return 0;
- }
-}
-
-double RawSource::getStep(const ModelData & Model)
-{
- switch (type) {
- case SOURCE_TYPE_TELEMETRY:
- switch (index) {
- case TELEMETRY_SOURCE_TIMER1:
- case TELEMETRY_SOURCE_TIMER2:
- return 3;
- case TELEMETRY_SOURCE_A1:
- case TELEMETRY_SOURCE_A2:
- if (Model.frsky.channels[index-TELEMETRY_SOURCE_A1].type==0) {
- return (Model.frsky.channels[index-TELEMETRY_SOURCE_A1].ratio/2550.0);
- }
- else {
- return (Model.frsky.channels[index-TELEMETRY_SOURCE_A1].ratio/255.0);
- }
- case TELEMETRY_SOURCE_ALT:
- case TELEMETRY_SOURCE_GPS_ALT:
- return 8;
+ result.min = -30;
+ result.max = 225;
+ break;
case TELEMETRY_SOURCE_RPM:
- return 50;
+ result.step = singleprec ? 50 : 1;
+ result.max = singleprec ? 12750 : 20000;
+ break;
+ case TELEMETRY_SOURCE_FUEL:
+ result.max = 100;
+ break;
case TELEMETRY_SOURCE_SPEED:
- return 4;
+ result.step = singleprec ? 4 : 1;
+ result.max = singleprec ? 944 : 2000;
+ if (model && !model->frsky.imperial) {
+ result.step *= 1.852;
+ result.max *= 1.852;
+ }
+ break;
case TELEMETRY_SOURCE_DIST:
- return 8;
+ result.step = singleprec ? 8 : 1;
+ result.max = singleprec ? 2040 : 10000;
+ break;
case TELEMETRY_SOURCE_CELL:
- return 0.02;
+ result.step = singleprec ? 0.02 : 0.01;
+ result.max = 5.1;
+ result.decimals = 2;
+ break;
case TELEMETRY_SOURCE_CELLS_SUM:
case TELEMETRY_SOURCE_VFAS:
- return 0.1;
+ result.step = 0.1;
+ result.max = 25.5;
+ result.decimals = 1;
+ break;
case TELEMETRY_SOURCE_CURRENT:
- return 0.5;
+ result.step = singleprec ? 0.5 : 0.1;
+ result.max = singleprec ? 127.5 : 200.0;
+ result.decimals = 1;
+ break;
case TELEMETRY_SOURCE_CONSUMPTION:
- return 20;
+ result.step = singleprec ? 20 : 1;
+ result.max = singleprec ? 5100 : 10000;
+ break;
case TELEMETRY_SOURCE_POWER:
- return 5;
+ result.step = singleprec ? 5 : 1;
+ result.max = singleprec ? 1275 : 2000;
+ break;
default:
- return 1;
+ result.max = 125;
+ break;
+ }
+ if (singleprec) {
+ result.offset = result.max - (127*result.step);
}
break;
- default:
- return 1;
+
+ default:
+ result.max = (model && model->extendedLimits ? 125 : 100);
+ result.min = - result.max;
+ break;
}
+
+ return result;
}
QString AnalogString(int index)
diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h
index 1e345bc606..d0bb67baff 100644
--- a/companion/src/eeprominterface.h
+++ b/companion/src/eeprominterface.h
@@ -283,6 +283,30 @@ class ModelData;
QString AnalogString(int index);
QString RotaryEncoderString(int index);
+class RawSourceRange
+{
+ public:
+ RawSourceRange():
+ decimals(0),
+ min(0.0),
+ max(0.0),
+ step(1.0),
+ offset(0.0)
+ {
+ }
+
+ float getValue(int value) {
+ return min + float(value) * step;
+ }
+
+ int decimals;
+ double min;
+ double max;
+ double step;
+ double offset;
+
+};
+
class RawSource {
public:
RawSource():
@@ -313,17 +337,16 @@ class RawSource {
QString toString();
- int getDecimals(const ModelData & Model);
- double getMin(const ModelData & Model);
- double getMax(const ModelData & Model);
- double getStep(const ModelData & Model);
- double getOffset(const ModelData & Model);
- int getRawOffset(const ModelData & Model);
+ RawSourceRange getRange(bool singleprec=false);
- bool operator== ( const RawSource& other) {
+ bool operator == ( const RawSource & other) {
return (this->type == other.type) && (this->index == other.index);
}
+ bool operator != ( const RawSource & other) {
+ return (this->type != other.type) || (this->index != other.index);
+ }
+
RawSourceType type;
int index;
const ModelData * model;
@@ -664,7 +687,7 @@ class PhaseData {
unsigned int fadeOut;
int rotaryEncoders[2];
int gvars[C9X_MAX_GVARS];
- void clear() { memset(this, 0, sizeof(PhaseData));}
+ void clear() { memset(this, 0, sizeof(PhaseData)); }
};
class SwashRingData { // Swash Ring data
@@ -715,6 +738,14 @@ class FrSkyChannelData {
unsigned int multiplier;
FrSkyAlarmData alarms[2];
+ float getRatio()
+ {
+ if (type==0 || type==1 || type==2)
+ return float(ratio << multiplier) / 10.0;
+ else
+ return ratio << multiplier;
+ }
+
void clear() { memset(this, 0, sizeof(FrSkyChannelData)); }
};
@@ -983,11 +1014,10 @@ enum Capability {
GvarsInCS,
GvarsAreNamed,
GvarsFlightPhases,
- GvarsAsSources,
GvarsName,
NoTelemetryProtocol,
- TelemetryCSFields,
- TelemetryColsCSFields,
+ TelemetryCustomScreens,
+ TelemetryCustomScreensFieldsPerLine,
TelemetryRSSIModel,
TelemetryAlarm,
TelemetryInternalAlarm,
diff --git a/companion/src/firmwares/er9x/er9xinterface.cpp b/companion/src/firmwares/er9x/er9xinterface.cpp
index 29b5ed079f..afcfedd70c 100644
--- a/companion/src/firmwares/er9x/er9xinterface.cpp
+++ b/companion/src/firmwares/er9x/er9xinterface.cpp
@@ -281,8 +281,6 @@ int Er9xInterface::getCapability(const Capability capability)
case ModelVoice:
case Gvars:
return 7;
- case GvarsAsSources:
- return 1;
case GetThrSwitch:
return DSW_THR;
default:
diff --git a/companion/src/firmwares/ersky9x/ersky9xinterface.cpp b/companion/src/firmwares/ersky9x/ersky9xinterface.cpp
index 21ff8938a7..17229bb08b 100644
--- a/companion/src/firmwares/ersky9x/ersky9xinterface.cpp
+++ b/companion/src/firmwares/ersky9x/ersky9xinterface.cpp
@@ -317,8 +317,6 @@ int Ersky9xInterface::getCapability(const Capability capability)
return 125;
case MaxVolume:
return 23;
- case GvarsAsSources:
- return 1;
case TelemetryMaxMultiplier:
return 2;
case LCDWidth:
diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp
index 9b19f59b65..b941340435 100644
--- a/companion/src/firmwares/opentx/opentxeeprom.cpp
+++ b/companion/src/firmwares/opentx/opentxeeprom.cpp
@@ -201,7 +201,7 @@ class SourcesConversionTable: public ConversionTable {
if (!(flags & FLAG_NOTELEMETRY)) {
if (release21March2013) {
if ((board != BOARD_STOCK && (board!=BOARD_M128 || version<215)) || (variant & GVARS_VARIANT)) {
- for (int i=0; i<5; i++)
+ for (int i=0; ival1)).arg(ValToTim(customSw->val2));
break;
case CS_FAMILY_VOFS: {
- RawSource source = RawSource(customSw->val1);
+ RawSource source = RawSource(customSw->val1, &model);
+ RawSourceRange range = source.getRange();
if (customSw->val1)
result += source.toString();
else
@@ -204,7 +206,7 @@ QString getCustomSwitchStr(CustomSwData * customSw, const ModelData & model)
result += " > ";
else if (customSw->func == CS_FN_ANEG || customSw->func == CS_FN_VNEG)
result += " < ";
- result += QString::number(source.getStep(model) * (customSw->val2 + source.getRawOffset(model)) + source.getOffset(model));
+ result += QString::number(range.step * (customSw->val2 /*TODO+ source.getRawOffset(model)*/) + range.offset);
break;
}
case CS_FAMILY_VBOOL:
@@ -1300,109 +1302,6 @@ QString getFrSkySrc(int index)
return RawSource(SOURCE_TYPE_TELEMETRY, index-1).toString();
}
-
-/*
- 1,2) Timer1/Timer2 0:765
- 3,4) TX/RX
- 5) A1 range
- 6) A2 range
- 7) ALT 0-1020
- 8)RPM 0-12750
- 9FUEL 0-100%
- 10) T1 -30-225
- 11) T2 -30-225
- 12) spd 0-510
- 13) dist 0-2040
- 14)GAlt 0-1020
- 15) cell 0-5.1
- 16) Cels 0 25.5
- 17) Vfas 0 25.5
- 18) Curr 0 127.5
- 19) Cnsp 0 5100
- 20) Powr 0 1275
- 21) AccX 0 2.55
- 22) AccY 0 2.55
- 23) AccZ 0 2.55
- 24) Hdg 0 255
- 25) VSpd 0 2.55
- 26) A1- A1 range
- 27) A2- A2 range
- 28) Alt- 0 255
- 29) Alt+ 0 255
- 30) Rpm+ 0 255
- 31) T1+ 0 255 (s????)
- 32) T2+ 0 255 (e????)
- 33) Spd+ 0 255 (ILG???)
- 34) Dst+ 0 255 (v ????)
- 35) Cur+ 0 25.5 (A)
- 1.852
- */
-
-float getBarValue(int barId, int value, FrSkyData *fd)
-{
- switch (barId-1) {
- case TELEMETRY_SOURCE_TX_BATT:
- return value/10.0;
- case TELEMETRY_SOURCE_TIMER1:
- case TELEMETRY_SOURCE_TIMER2:
- return (3*value);
- case TELEMETRY_SOURCE_RSSI_TX:
- case TELEMETRY_SOURCE_RSSI_RX:
- case TELEMETRY_SOURCE_FUEL:
- return std::min(100, value);
- case TELEMETRY_SOURCE_A1:
- case TELEMETRY_SOURCE_A1_MIN:
- if (fd->channels[0].type==0)
- return ((fd->channels[0].ratio*value/255.0)+fd->channels[0].offset)/10;
- else
- return ((fd->channels[0].ratio*value/255.0)+fd->channels[0].offset);
- case TELEMETRY_SOURCE_A2:
- case TELEMETRY_SOURCE_A2_MIN:
- if (fd->channels[1].type==0)
- return ((fd->channels[1].ratio*value/255.0)+fd->channels[1].offset)/10;
- else
- return ((fd->channels[1].ratio*value/255.0)+fd->channels[1].offset);
- case TELEMETRY_SOURCE_ALT:
- case TELEMETRY_SOURCE_GPS_ALT:
- case TELEMETRY_SOURCE_ALT_MAX:
- case TELEMETRY_SOURCE_ALT_MIN:
- return (8*value)-500;
- case TELEMETRY_SOURCE_RPM:
- case TELEMETRY_SOURCE_RPM_MAX:
- return value * 50;
- case TELEMETRY_SOURCE_T1:
- case TELEMETRY_SOURCE_T2:
- case TELEMETRY_SOURCE_T1_MAX:
- case TELEMETRY_SOURCE_T2_MAX:
- return value - 30.0;
- case TELEMETRY_SOURCE_CELL:
- return value*2.0/100;
- case TELEMETRY_SOURCE_CELLS_SUM:
- case TELEMETRY_SOURCE_VFAS:
- return value/10.0;
- case TELEMETRY_SOURCE_HDG:
- return std::min(359, value*2);
- case TELEMETRY_SOURCE_DIST_MAX:
- case TELEMETRY_SOURCE_DIST:
- return value * 8;
- case TELEMETRY_SOURCE_CURRENT_MAX:
- case TELEMETRY_SOURCE_CURRENT:
- return value/2.0;
- case TELEMETRY_SOURCE_POWER:
- return value*5;
- case TELEMETRY_SOURCE_CONSUMPTION:
- return value * 20;
- case TELEMETRY_SOURCE_SPEED:
- case TELEMETRY_SOURCE_SPEED_MAX:
- if (fd->imperial==1)
- return value;
- else
- return value*1.852;
- default:
- return value;
- }
-}
-
QString getTrimInc(ModelData * g_model)
{
switch (g_model->trimInc) {
diff --git a/companion/src/helpers.h b/companion/src/helpers.h
index b1c2e1726e..aa424e4826 100644
--- a/companion/src/helpers.h
+++ b/companion/src/helpers.h
@@ -136,7 +136,7 @@ QString getFrSkyUnits(int units);
QString getFrSkyProtocol(int protocol);
QString getFrSkyMeasure(int units);
QString getFrSkySrc(int index);
-float getBarValue(int barId, int value, FrSkyData *fd);
+
float c9xexpou(float point, float coeff);
float ValToTim(int value);
int TimToVal(float value);
diff --git a/companion/src/modeledit/CMakeLists.txt b/companion/src/modeledit/CMakeLists.txt
index 28c752d649..827ecf656e 100644
--- a/companion/src/modeledit/CMakeLists.txt
+++ b/companion/src/modeledit/CMakeLists.txt
@@ -42,6 +42,7 @@ set(modeledit_UIS
setup_module.ui
flightmode.ui
telemetry_analog.ui
+ telemetry_customscreen.ui
)
foreach(name ${modeledit_NAMES})
diff --git a/companion/src/modeledit/customswitches.cpp b/companion/src/modeledit/customswitches.cpp
index c7c5d6ae84..68d3fc34f2 100644
--- a/companion/src/modeledit/customswitches.cpp
+++ b/companion/src/modeledit/customswitches.cpp
@@ -146,36 +146,43 @@ void CustomSwitchesPanel::edited()
{
case (CS_FAMILY_VOFS):
if (model.customSw[i].val1 != cswitchSource1[i]->itemData(cswitchSource1[i]->currentIndex()).toInt()) {
- source=RawSource(model.customSw[i].val1);
+ source = RawSource(model.customSw[i].val1, &model);
model.customSw[i].val1 = cswitchSource1[i]->itemData(cswitchSource1[i]->currentIndex()).toInt();
- RawSource newSource = RawSource(model.customSw[i].val1);
+ RawSource newSource = RawSource(model.customSw[i].val1, &model);
if (newSource.type == SOURCE_TYPE_TELEMETRY) {
if (model.customSw[i].func>CS_FN_ELESS && model.customSw[i].funcCS_FN_ELESS && model.customSw[i].funcvalue()/source.getStep(model));
- } else {
- model.customSw[i].val2 = ((cswitchOffset[i]->value()-source.getOffset(model))/source.getStep(model))-source.getRawOffset(model);
+ model.customSw[i].val2 = (cswitchOffset[i]->value() / range.step);
+ }
+ else {
+ model.customSw[i].val2 = (cswitchOffset[i]->value() - range.offset) / range.step/* TODO - source.getRawOffset(model)*/;
}
}
setSwitchWidgetVisibility(i);
- } else {
- source=RawSource(model.customSw[i].val1);
+ }
+ else {
+ source = RawSource(model.customSw[i].val1, &model);
+ RawSourceRange range = source.getRange();
if (model.customSw[i].func>CS_FN_ELESS && model.customSw[i].funcvalue()/source.getStep(model));
- cswitchOffset[i]->setValue(model.customSw[i].val2*source.getStep(model));
- } else {
- model.customSw[i].val2 = ((cswitchOffset[i]->value()-source.getOffset(model))/source.getStep(model))-source.getRawOffset(model);
- cswitchOffset[i]->setValue((model.customSw[i].val2 +source.getRawOffset(model))*source.getStep(model)+source.getOffset(model));
+ model.customSw[i].val2 = (cswitchOffset[i]->value() / range.step);
+ cswitchOffset[i]->setValue(model.customSw[i].val2*range.step);
+ }
+ else {
+ model.customSw[i].val2 = ((cswitchOffset[i]->value()-range.offset)/range.step)/* TODO - source.getRawOffset(model)*/;
+ cswitchOffset[i]->setValue((model.customSw[i].val2 /* + TODO source.getRawOffset(model)*/)*range.step+range.offset);
}
}
break;
case (CS_FAMILY_TIMERS): {
- value=cswitchOffset[i]->value();
+ value = cswitchOffset[i]->value();
newval=TimToVal(value);
if (newval>model.customSw[i].val2) {
if (value >=60) {
@@ -246,7 +253,9 @@ void CustomSwitchesPanel::edited()
void CustomSwitchesPanel::setSwitchWidgetVisibility(int i)
{
- RawSource source = RawSource(model.customSw[i].val1);
+ RawSource source = RawSource(model.customSw[i].val1, &model);
+ RawSourceRange range = source.getRange();
+
switch (getCSFunctionFamily(model.customSw[i].func))
{
case CS_FAMILY_VOFS:
@@ -255,16 +264,16 @@ void CustomSwitchesPanel::setSwitchWidgetVisibility(int i)
cswitchValue[i]->setVisible(false);
cswitchOffset[i]->setVisible(true);
populateSourceCB(cswitchSource1[i], source, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
- cswitchOffset[i]->setDecimals(source.getDecimals(model));
- cswitchOffset[i]->setSingleStep(source.getStep(model));
+ cswitchOffset[i]->setDecimals(range.decimals);
+ cswitchOffset[i]->setSingleStep(range.step);
if (model.customSw[i].func>CS_FN_ELESS && model.customSw[i].funcsetMinimum(source.getStep(model)*-127);
- cswitchOffset[i]->setMaximum(source.getStep(model)*127);
- cswitchOffset[i]->setValue(source.getStep(model)*model.customSw[i].val2);
+ cswitchOffset[i]->setMinimum(range.step*-127);
+ cswitchOffset[i]->setMaximum(range.step*127);
+ cswitchOffset[i]->setValue(range.step*model.customSw[i].val2);
} else {
- cswitchOffset[i]->setMinimum(source.getMin(model));
- cswitchOffset[i]->setMaximum(source.getMax(model));
- cswitchOffset[i]->setValue(source.getStep(model)*(model.customSw[i].val2+source.getRawOffset(model))+source.getOffset(model));
+ cswitchOffset[i]->setMinimum(range.min);
+ cswitchOffset[i]->setMaximum(range.max);
+ cswitchOffset[i]->setValue(range.step*(model.customSw[i].val2/* TODO+source.getRawOffset(model)*/)+range.offset);
}
break;
case CS_FAMILY_VBOOL:
diff --git a/companion/src/modeledit/expodialog.cpp b/companion/src/modeledit/expodialog.cpp
index 921e916bcc..49e86fc8a4 100644
--- a/companion/src/modeledit/expodialog.cpp
+++ b/companion/src/modeledit/expodialog.cpp
@@ -48,7 +48,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, i
ui->sideLabel->hide();
ui->sideCB->hide();
ui->inputName->setMaxLength(4);
- populateSourceCB(ui->sourceCB, ed->srcRaw, model, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS | (GetEepromInterface()->getCapability(GvarsAsSources) ? POPULATE_GVARS : 0));
+ populateSourceCB(ui->sourceCB, ed->srcRaw, model, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS | POPULATE_TELEMETRY);
ui->sourceCB->removeItem(0);
}
else {
@@ -56,8 +56,6 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, i
ui->inputName->hide();
ui->sourceLabel->hide();
ui->sourceCB->hide();
- ui->scaleLabel->hide();
- ui->scaleSB->hide();
ui->trimLabel->hide();
ui->trimCB->hide();
}
@@ -83,13 +81,15 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, i
ui->lineName->setValidator(new QRegExpValidator(rx, this));
ui->lineName->setText(ed->name);
+ updateScale();
valuesChanged();
- connect(ui->lineName,SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
- connect(ui->sourceCB,SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
- connect(ui->trimCB,SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
- connect(ui->switchesCB,SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
- connect(ui->sideCB,SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
+ connect(ui->lineName, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
+ connect(ui->sourceCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
+ connect(ui->scale, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
+ connect(ui->trimCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
+ connect(ui->switchesCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
+ connect(ui->sideCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
for (int i=0; i<9; i++) {
connect(cb_fp[i], SIGNAL(toggled(bool)), this, SLOT(valuesChanged()));
}
@@ -103,23 +103,35 @@ ExpoDialog::~ExpoDialog()
delete ui;
}
-void ExpoDialog::changeEvent(QEvent *e)
+void ExpoDialog::updateScale()
{
- QDialog::changeEvent(e);
- switch (e->type()) {
- case QEvent::LanguageChange:
- ui->retranslateUi(this);
- break;
- default:
- break;
- }
+ if (GetEepromInterface()->getCapability(VirtualInputs) && ed->srcRaw.type == SOURCE_TYPE_TELEMETRY) {
+ RawSourceRange range = ed->srcRaw.getRange();
+ ui->scaleLabel->show();
+ ui->scale->show();
+ ui->scale->setDecimals(range.decimals);
+ ui->scale->setMinimum(range.min);
+ ui->scale->setMaximum(range.max);
+ ui->scale->setValue(round(range.step * ed->scale));
+ }
+ else {
+ ui->scaleLabel->hide();
+ ui->scale->hide();
+ }
}
void ExpoDialog::valuesChanged()
{
QCheckBox * cb_fp[] = {ui->cb_FP0,ui->cb_FP1,ui->cb_FP2,ui->cb_FP3,ui->cb_FP4,ui->cb_FP5,ui->cb_FP6,ui->cb_FP7,ui->cb_FP8 };
- ed->srcRaw = RawSource(ui->sourceCB->itemData(ui->sourceCB->currentIndex()).toInt());
+ RawSource srcRaw = RawSource(ui->sourceCB->itemData(ui->sourceCB->currentIndex()).toInt());
+ if (ed->srcRaw != srcRaw) {
+ ed->srcRaw = srcRaw;
+ updateScale();
+ }
+
+ RawSourceRange range = srcRaw.getRange();
+ ed->scale = round(float(ui->scale->value()) / range.step);
ed->carryTrim = 1 - ui->trimCB->currentIndex();
ed->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
ed->mode = ui->sideCB->currentIndex() + 1;
@@ -173,5 +185,5 @@ void ExpoDialog::valuesChanged()
void ExpoDialog::shrink()
{
- resize(0,0);
+ resize(0, 0);
}
diff --git a/companion/src/modeledit/expodialog.h b/companion/src/modeledit/expodialog.h
index 5281e4c29b..2d96b130a4 100644
--- a/companion/src/modeledit/expodialog.h
+++ b/companion/src/modeledit/expodialog.h
@@ -18,7 +18,7 @@ class ExpoDialog : public QDialog {
~ExpoDialog();
protected:
- void changeEvent(QEvent *e);
+ void updateScale();
private slots:
void valuesChanged();
diff --git a/companion/src/modeledit/expodialog.ui b/companion/src/modeledit/expodialog.ui
index 17fe24f9a9..82d16dbc23 100644
--- a/companion/src/modeledit/expodialog.ui
+++ b/companion/src/modeledit/expodialog.ui
@@ -330,7 +330,7 @@ If blank then the input is considered to be "ON" all the time.
-
-
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
@@ -441,6 +441,32 @@ p, li { white-space: pre-wrap; }
+
+ inputName
+ lineName
+ sourceCB
+ scale
+ trimCB
+ weightGV
+ weightSB
+ weightCB
+ curveTypeCB
+ curveGVarCB
+ curveValueCB
+ curveValueSB
+ cb_FP0
+ cb_FP1
+ cb_FP2
+ cb_FP3
+ cb_FP4
+ cb_FP5
+ cb_FP6
+ cb_FP7
+ cb_FP8
+ switchesCB
+ sideCB
+ buttonBox
+
diff --git a/companion/src/modeledit/mixerdialog.cpp b/companion/src/modeledit/mixerdialog.cpp
index 4dc69cd124..7ef03fdca9 100644
--- a/companion/src/modeledit/mixerdialog.cpp
+++ b/companion/src/modeledit/mixerdialog.cpp
@@ -20,7 +20,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, i
else
this->setWindowTitle(tr("DEST -> CH%1%2").arg(md->destCh/10).arg(md->destCh%10));
- populateSourceCB(ui->sourceCB, md->srcRaw, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TRIMS | (GetEepromInterface()->getCapability(GvarsAsSources) ? POPULATE_GVARS : 0));
+ populateSourceCB(ui->sourceCB, md->srcRaw, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TRIMS);
ui->sourceCB->removeItem(0);
int limit = GetEepromInterface()->getCapability(OffsetWeight);
diff --git a/companion/src/modeledit/telemetry.cpp b/companion/src/modeledit/telemetry.cpp
index fe62410150..014def7770 100644
--- a/companion/src/modeledit/telemetry.cpp
+++ b/companion/src/modeledit/telemetry.cpp
@@ -1,6 +1,7 @@
#include "telemetry.h"
#include "ui_telemetry.h"
#include "ui_telemetry_analog.h"
+#include "ui_telemetry_customscreen.h"
#include "helpers.h"
TelemetryAnalog::TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog):
@@ -11,15 +12,13 @@ TelemetryAnalog::TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog):
{
ui->setupUi(this);
- float ratio;
+ float ratio = analog.getRatio();
if (analog.type==0 || analog.type==1 || analog.type==2) {
- ratio = (analog.ratio<RatioSB->setDecimals(1);
ui->RatioSB->setMaximum(25.5*GetEepromInterface()->getCapability(TelemetryMaxMultiplier));
}
else {
- ratio = analog.ratio<RatioSB->setDecimals(0);
ui->RatioSB->setMaximum(255*GetEepromInterface()->getCapability(TelemetryMaxMultiplier));
}
@@ -44,69 +43,44 @@ TelemetryAnalog::TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog):
void TelemetryAnalog::update()
{
- float ratio, alarm1value, alarm2value;
- if (analog.ratio==0) {
- ui->alarm1ValueSB->setMinimum(0);
- ui->alarm1ValueSB->setMaximum(0);
- ui->alarm2ValueSB->setMinimum(0);
- ui->alarm2ValueSB->setMaximum(0);
- ui->CalibSB->setMinimum(0);
- ui->CalibSB->setMaximum(0);
- ui->CalibSB->setValue(0);
- ui->alarm1ValueSB->setValue(0);
- ui->alarm2ValueSB->setValue(0);
- return;
- }
+ float ratio = analog.getRatio();
+ float step = ratio / 255;
+ float mini = (ratio * analog.offset) / 255;
+ float maxi = mini + ratio;
- if (analog.type==0 || analog.type==1 || analog.type==2) {
- ratio=(analog.ratio<alarm1ValueSB->setDecimals(2);
- ui->alarm1ValueSB->setSingleStep(ratio/255.0);
- ui->alarm2ValueSB->setDecimals(2);
- ui->alarm2ValueSB->setSingleStep(ratio/255.0);
- ui->alarm1ValueSB->setMinimum((analog.ratio*1.0*analog.offset)/2550.0);
- ui->alarm1ValueSB->setMaximum(ratio+(analog.ratio*1.0*analog.offset)/2550.0);
- ui->alarm2ValueSB->setMinimum((analog.offset*1.0*analog.ratio)/2550.0);
- ui->alarm2ValueSB->setMaximum(ratio+(analog.offset*1.0*analog.ratio)/2550.0);
- }
- else {
- ratio=analog.ratio<alarm1ValueSB->setDecimals(2);
- ui->alarm1ValueSB->setSingleStep(ratio/255.0);
- ui->alarm2ValueSB->setDecimals(2);
- ui->alarm2ValueSB->setSingleStep(ratio/255.0);
- ui->alarm1ValueSB->setMinimum((analog.offset*1.0*analog.ratio)/255.0);
- ui->alarm1ValueSB->setMaximum(ratio+(analog.offset*1.0*analog.ratio)/255.0);
- ui->alarm2ValueSB->setMinimum((analog.offset*1.0*analog.ratio)/255.0);
- ui->alarm2ValueSB->setMaximum(ratio+(analog.offset*1.0*analog.ratio)/255.0);
- }
- ui->CalibSB->setDecimals(2);
- ui->CalibSB->setMaximum((ratio*127)/255.0);
- ui->CalibSB->setMinimum((-ratio*128)/255.0);
- ui->CalibSB->setSingleStep(ratio/255.0);
- ui->CalibSB->setValue((analog.offset*ratio)/255);
- alarm1value=ratio*(analog.alarms[0].value/255.0+analog.offset/255.0);
- alarm2value=ratio*(analog.alarms[1].value/255.0+analog.offset/255.0);;
- ui->alarm1ValueSB->setValue(alarm1value);
- ui->alarm2ValueSB->setValue(alarm2value);
+ ui->alarm1ValueSB->setDecimals(2);
+ ui->alarm1ValueSB->setSingleStep(step);
+ ui->alarm1ValueSB->setMinimum(mini);
+ ui->alarm1ValueSB->setMaximum(maxi);
+ ui->alarm1ValueSB->setValue(mini + step*analog.alarms[0].value);
+
+ ui->alarm2ValueSB->setDecimals(2);
+ ui->alarm2ValueSB->setSingleStep(step);
+ ui->alarm2ValueSB->setMinimum(mini);
+ ui->alarm2ValueSB->setMaximum(maxi);
+ ui->alarm2ValueSB->setValue(mini + step*analog.alarms[1].value);
+
+ ui->CalibSB->setDecimals(2);
+ ui->CalibSB->setMaximum(step*127);
+ ui->CalibSB->setMinimum(-step*128);
+ ui->CalibSB->setSingleStep(step);
+ ui->CalibSB->setValue(mini);
}
void TelemetryAnalog::on_UnitCB_currentIndexChanged(int index)
{
- float ratio;
- analog.type=index;
+ float ratio = analog.getRatio();
+ analog.type = index;
switch (index) {
case 0:
case 1:
case 2:
ui->RatioSB->setDecimals(1);
ui->RatioSB->setMaximum(25.5*GetEepromInterface()->getCapability(TelemetryMaxMultiplier));
- ratio=(analog.ratio<RatioSB->setDecimals(0);
ui->RatioSB->setMaximum(255*GetEepromInterface()->getCapability(TelemetryMaxMultiplier));
- ratio=(analog.ratio<RatioSB->setValue(ratio);
@@ -127,7 +101,7 @@ void TelemetryAnalog::on_RatioSB_valueChanged()
}
else {
analog.multiplier = findmult(ui->RatioSB->value(), 255);
- float singlestep =(1<RatioSB->setSingleStep(singlestep);
ui->RatioSB->setValue(round(ui->RatioSB->value()/singlestep)*singlestep);
@@ -139,15 +113,17 @@ void TelemetryAnalog::on_RatioSB_valueChanged()
void TelemetryAnalog::on_RatioSB_editingFinished()
{
+ if (!lock) {
float ratio, calib, alarm1value,alarm2value;
- if (lock) return;
+
if (analog.type==0 || analog.type==1 || analog.type==2) {
analog.multiplier = findmult(ui->RatioSB->value(), 25.5);
ui->CalibSB->setSingleStep((1<alarm1ValueSB->setSingleStep((1<alarm2ValueSB->setSingleStep((1<RatioSB->value()*10))/(1 <RatioSB->value(), 255);
ui->CalibSB->setSingleStep(1<alarm1ValueSB->setSingleStep(1<0) {
if (calib>((ratio*127)/255)) {
analog.offset=127;
- } else {
+ }
+ else {
analog.offset=round(calib*255/ratio);
}
}
@@ -185,18 +162,15 @@ void TelemetryAnalog::on_RatioSB_editingFinished()
analog.alarms[0].value=round((alarm1value*255-analog.offset*(analog.ratio<CalibSB->value()/ratio));
calib=ratio*analog.offset/255.0;
@@ -204,7 +178,8 @@ void TelemetryAnalog::on_CalibSB_editingFinished()
alarm2value=ui->alarm2ValueSB->value();
if (alarm1value(ratio+calib)) {
+ }
+ else if (alarm1value>(ratio+calib)) {
alarm1value=ratio+calib;
}
if (alarm2valuealarm1ValueSB->value();
- if (analog.type==0) {
- ratio/=10;
- }
+
if (alarm1value<((calib*ratio)/255)) {
analog.alarms[0].value=0;
- } else if (alarm1value>(ratio+(calib*ratio)/255)) {
+ }
+ else if (alarm1value>(ratio+(calib*ratio)/255)) {
analog.alarms[0].value=255;
- } else {
+ }
+ else {
analog.alarms[0].value = round((alarm1value-((calib*ratio)/255))/ratio*255);
}
update();
@@ -259,28 +234,26 @@ void TelemetryAnalog::on_alarm1ValueSB_editingFinished()
void TelemetryAnalog::on_alarm2LevelCB_currentIndexChanged(int index)
{
- analog.alarms[1].level = index;
- emit modified();
+ analog.alarms[1].level = index;
+ emit modified();
}
void TelemetryAnalog::on_alarm2GreaterCB_currentIndexChanged(int index)
{
- analog.alarms[1].greater = index;
- emit modified();
+ analog.alarms[1].greater = index;
+ emit modified();
}
void TelemetryAnalog::on_alarm2ValueSB_editingFinished()
{
- float ratio, calib, alarm2value;
- ratio = analog.ratio<alarm2ValueSB->value();
- if (analog.type==0) {
- ratio/=10;
- }
if (alarm2value<((calib*ratio)/255)) {
analog.alarms[1].value=0;
- } else if (alarm2value>(ratio+(calib*ratio)/255)) {
+ }
+ else if (alarm2value>(ratio+(calib*ratio)/255)) {
analog.alarms[1].value=255;
} else {
analog.alarms[1].value = round((alarm2value-((calib*ratio)/255))/ratio*255);
@@ -296,41 +269,182 @@ TelemetryAnalog::~TelemetryAnalog()
/******************************************************/
+TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model, FrSkyScreenData & screen):
+ ModelPanel(parent, model),
+ ui(new Ui::TelemetryCustomScreen),
+ screen(screen)
+{
+ ui->setupUi(this);
+
+ for (int l=0; l<4; l++) {
+ for (int c=0; cgetCapability(TelemetryCustomScreensFieldsPerLine); c++) {
+ fieldsCB[l][c] = new QComboBox(this);
+ fieldsCB[l][c]->setProperty("index", c + (l<<8));
+ populateCustomScreenFieldCB(fieldsCB[l][c], screen.body.lines[l].source[c], (l<4), model.frsky.usrProto);
+ ui->screenNumsLayout->addWidget(fieldsCB[l][c], l, c, 1, 1);
+ connect(fieldsCB[l][c], SIGNAL(currentIndexChanged(int)), this, SLOT(customFieldChanged(int)));
+ }
+ }
+
+ for (int l=0; l<4; l++) {
+ barsCB[l] = new QComboBox(this);
+ barsCB[l]->setProperty("index", l);
+ populateCustomScreenFieldCB(barsCB[l], screen.body.bars[l].source, false, model.frsky.usrProto);
+ connect(barsCB[l], SIGNAL(currentIndexChanged(int)), this, SLOT(barSourceChanged(int)));
+ ui->screenBarsLayout->addWidget(barsCB[l], l, 0, 1, 1);
+
+ minSB[l] = new QDoubleSpinBox(this);
+ minSB[l]->setProperty("index", l);
+ connect(minSB[l], SIGNAL(valueChanged(double)), this, SLOT(barMinChanged(double)));
+ ui->screenBarsLayout->addWidget(minSB[l], l, 1, 1, 1);
+
+ QLabel * label = new QLabel(this);
+ label->setAutoFillBackground(false);
+ label->setStyleSheet(QString::fromUtf8("Background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 128, 255), stop:0.339795 rgba(0, 0, 128, 255), stop:0.339799 rgba(255, 255, 255, 255), stop:0.662444 rgba(255, 255, 255, 255),)\n"""));
+ label->setFrameShape(QFrame::Panel);
+ label->setFrameShadow(QFrame::Raised);
+ label->setAlignment(Qt::AlignCenter);
+ ui->screenBarsLayout->addWidget(label, l, 2, 1, 1);
+
+ maxSB[l] = new QDoubleSpinBox(this);
+ maxSB[l]->setProperty("index", l);
+ connect(maxSB[l], SIGNAL(valueChanged(double)), this, SLOT(barMaxChanged(double)));
+ ui->screenBarsLayout->addWidget(maxSB[l], l, 3, 1, 1);
+ }
+
+ update();
+}
+
+TelemetryCustomScreen::~TelemetryCustomScreen()
+{
+ delete ui;
+}
+
+void TelemetryCustomScreen::update()
+{
+ lock = true;
+
+ ui->screenType->setCurrentIndex(screen.type);
+ ui->screenNums->setVisible(screen.type == 0);
+ ui->screenBars->setVisible(screen.type != 0);
+
+ if (screen.type == 0) {
+ for (int l=0; l<4; l++) {
+ for (int c=0; cgetCapability(TelemetryCustomScreensFieldsPerLine); c++) {
+ fieldsCB[l][c]->setCurrentIndex(screen.body.lines[l].source[c]);
+ }
+ }
+ }
+ else {
+ for (int i=0; i<4; i++) {
+ updateBar(i);
+ }
+ }
+
+ lock = false;
+}
+
+void TelemetryCustomScreen::updateBar(int line)
+{
+ int index = screen.body.bars[line].source;
+ barsCB[line]->setCurrentIndex(index);
+ if (index) {
+ RawSource source = RawSource(SOURCE_TYPE_TELEMETRY, index-1, &model);
+ RawSourceRange range = source.getRange(true);
+ int max = round((range.max - range.min) / range.step);
+ if (255-screen.body.bars[line].barMax > max)
+ screen.body.bars[line].barMax = 255 - max;
+ minSB[line]->setEnabled(true);
+ minSB[line]->setDecimals(range.decimals);
+ minSB[line]->setMinimum(range.min);
+ minSB[line]->setMaximum(range.max);
+ minSB[line]->setSingleStep(range.step);
+ minSB[line]->setValue(range.getValue(screen.body.bars[line].barMin));
+ maxSB[line]->setEnabled(true);
+ maxSB[line]->setDecimals(range.decimals);
+ maxSB[line]->setMinimum(range.min);
+ maxSB[line]->setMaximum(range.max);
+ maxSB[line]->setSingleStep(range.step);
+ maxSB[line]->setValue(range.getValue(255 - screen.body.bars[line].barMax));
+ }
+ else {
+ minSB[line]->setDisabled(true);
+ maxSB[line]->setDisabled(true);
+ }
+}
+
+void TelemetryCustomScreen::on_screenType_currentIndexChanged(int index)
+{
+ if (!lock) {
+ memset(&screen.body, 0, sizeof(screen.body));
+ screen.type = index;
+ update();
+ emit modified();
+ }
+}
+
+void TelemetryCustomScreen::customFieldChanged(int value)
+{
+ int index = sender()->property("index").toInt();
+ screen.body.lines[index/256].source[index%256] = value;
+ emit modified();
+}
+
+void TelemetryCustomScreen::barSourceChanged(int index)
+{
+ QComboBox * cb = qobject_cast(sender());
+ int line = cb->property("index").toInt();
+ screen.body.bars[line].source = index;
+ screen.body.bars[line].barMin = 0;
+ screen.body.bars[line].barMax = 0;
+ updateBar(line);
+ emit modified();
+}
+
+void TelemetryCustomScreen::barMinChanged(double value)
+{
+ if (!lock) {
+ int line = sender()->property("index").toInt();
+ screen.body.bars[line].barMin = round((value-minSB[line]->minimum()) / minSB[line]->singleStep());
+ // TODO set min (maxSB)
+ emit modified();
+ }
+}
+
+void TelemetryCustomScreen::barMaxChanged(double value)
+{
+ if (!lock) {
+ int line = sender()->property("index").toInt();
+ screen.body.bars[line].barMax = 255 - round((value-minSB[line]->minimum()) / maxSB[line]->singleStep());
+ // TODO set max (minSB)
+ emit modified();
+ }
+}
+
+/******************************************************/
+
TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model):
ModelPanel(parent, model),
ui(new Ui::Telemetry)
{
ui->setupUi(this);
+ if (GetEepromInterface()->getCapability(NoTelemetryProtocol)) {
+ model.frsky.usrProto = 1;
+ }
+
analogs[0] = new TelemetryAnalog(this, model.frsky.channels[0]);
ui->A1Layout->addWidget(analogs[0]);
connect(analogs[0], SIGNAL(modified()), this, SLOT(onAnalogModified()));
+
analogs[1] = new TelemetryAnalog(this, model.frsky.channels[1]);
ui->A2Layout->addWidget(analogs[1]);
connect(analogs[1], SIGNAL(modified()), this, SLOT(onAnalogModified()));
- QGroupBox* barsgb[3] = { ui->CS1Bars, ui->CS2Bars, ui->CS3Bars };
- QGroupBox* numsgb[3] = { ui->CS1Nums, ui->CS2Nums, ui->CS3Nums };
-
- QComboBox* barscb[12] = { ui->telBarCS1B1_CB, ui->telBarCS1B2_CB, ui->telBarCS1B3_CB, ui->telBarCS1B4_CB,
- ui->telBarCS2B1_CB, ui->telBarCS2B2_CB, ui->telBarCS2B3_CB, ui->telBarCS2B4_CB,
- ui->telBarCS3B1_CB, ui->telBarCS3B2_CB, ui->telBarCS3B3_CB, ui->telBarCS3B4_CB};
- QDoubleSpinBox* minSB[12] = { ui->telMinCS1SB1, ui->telMinCS1SB2, ui->telMinCS1SB3, ui->telMinCS1SB4,
- ui->telMinCS2SB1, ui->telMinCS2SB2, ui->telMinCS2SB3, ui->telMinCS2SB4,
- ui->telMinCS3SB1, ui->telMinCS3SB2, ui->telMinCS3SB3, ui->telMinCS3SB4};
- QDoubleSpinBox* maxSB[12] = { ui->telMaxCS1SB1, ui->telMaxCS1SB2, ui->telMaxCS1SB3, ui->telMaxCS1SB4,
- ui->telMaxCS2SB1, ui->telMaxCS2SB2, ui->telMaxCS2SB3, ui->telMaxCS2SB4,
- ui->telMaxCS3SB1, ui->telMaxCS3SB2, ui->telMaxCS3SB3, ui->telMaxCS3SB4};
- QComboBox* tmp[36] = { ui->telemetryCS1F1_CB, ui->telemetryCS1F2_CB, ui->telemetryCS1F3_CB, ui->telemetryCS1F4_CB, ui->telemetryCS1F5_CB, ui->telemetryCS1F6_CB, ui->telemetryCS1F7_CB, ui->telemetryCS1F8_CB, ui->telemetryCS1F9_CB, ui->telemetryCS1F10_CB, ui->telemetryCS1F11_CB, ui->telemetryCS1F12_CB,
- ui->telemetryCS2F1_CB, ui->telemetryCS2F2_CB, ui->telemetryCS2F3_CB, ui->telemetryCS2F4_CB, ui->telemetryCS2F5_CB, ui->telemetryCS2F6_CB, ui->telemetryCS2F7_CB, ui->telemetryCS2F8_CB, ui->telemetryCS2F9_CB, ui->telemetryCS2F10_CB, ui->telemetryCS2F11_CB, ui->telemetryCS2F12_CB,
- ui->telemetryCS3F1_CB, ui->telemetryCS3F2_CB, ui->telemetryCS3F3_CB, ui->telemetryCS3F4_CB, ui->telemetryCS3F5_CB, ui->telemetryCS3F6_CB, ui->telemetryCS3F7_CB, ui->telemetryCS3F8_CB, ui->telemetryCS3F9_CB, ui->telemetryCS3F10_CB, ui->telemetryCS3F11_CB, ui->telemetryCS3F12_CB};
-
- memcpy(barsGB, barsgb, sizeof(barsGB));
- memcpy(numsGB, numsgb, sizeof(numsGB));
- memcpy(barsCB, barscb, sizeof(barsCB));
- memcpy(this->maxSB, maxSB, sizeof(this->maxSB));
- memcpy(this->minSB, minSB, sizeof(this->minSB));
- memcpy(csf, tmp, sizeof(csf));
+ for (int i=0; igetCapability(TelemetryCustomScreens); i++) {
+ TelemetryCustomScreen * tab = new TelemetryCustomScreen(this, model, model.frsky.screens[i]);
+ ui->customScreens->addTab(tab, tr("Telemetry screen %1").arg(i+1));
+ }
setup();
}
@@ -346,19 +460,6 @@ void TelemetryPanel::setup()
QString firmware_id = settings.value("firmware", default_firmware_variant.id).toString();
lock=true;
- ui->telemetryCSType1->setCurrentIndex(model.frsky.screens[0].type);
- ui->telemetryCSType2->setCurrentIndex(model.frsky.screens[1].type);
- ui->telemetryCSType3->setCurrentIndex(model.frsky.screens[2].type);
-
- for (int i=0; i<3; i++) {
- bool isNum = (model.frsky.screens[i].type==0);
- barsGB[i]->setVisible(!isNum);
- numsGB[i]->setVisible(isNum);
- }
-
- connect(ui->telemetryCSType1,SIGNAL(currentIndexChanged(int)),this,SLOT(ScreenTypeCBcurrentIndexChanged(int)));
- connect(ui->telemetryCSType2,SIGNAL(currentIndexChanged(int)),this,SLOT(ScreenTypeCBcurrentIndexChanged(int)));
- connect(ui->telemetryCSType3,SIGNAL(currentIndexChanged(int)),this,SLOT(ScreenTypeCBcurrentIndexChanged(int)));
//frsky Settings
if (!GetEepromInterface()->getCapability(TelemetryRSSIModel) ) {
@@ -397,7 +498,8 @@ void TelemetryPanel::setup()
ui->VarioLabel_4->hide();
ui->varioSourceCB->hide();
ui->varioSource_label->hide();
- } else {
+ }
+ else {
if (!GetEepromInterface()->getCapability(HasVarioSink)) {
ui->varioLimitMinOff_ChkB->hide();
ui->varioLimitMin_DSB->hide();
@@ -431,44 +533,12 @@ void TelemetryPanel::setup()
if (!(GetEepromInterface()->getCapability(HasAltitudeSel)||GetEepromInterface()->getCapability(HasVario))) {
ui->altimetryGB->hide();
}
- if (GetEepromInterface()->getCapability(NoTelemetryProtocol)) {
- model.frsky.usrProto=1;
- ui->frskyProtoCB->setDisabled(true);
- } else {
- ui->frskyProtoCB->setEnabled(true);
- }
- if (GetEepromInterface()->getCapability(TelemetryCSFields)==0) {
- ui->groupBox_5->hide();
- } else {
- if (GetEepromInterface()->getCapability(TelemetryCSFields)==8) {
- ui->tabCsView->removeTab(1);
- ui->tabCsView->removeTab(2);
- }
- if (GetEepromInterface()->getCapability(TelemetryCSFields)==16) {
- ui->tabCsView->removeTab(2);
- }
- int cols=GetEepromInterface()->getCapability(TelemetryColsCSFields);
- if (cols==0) cols=2;
- for (int screen=0; screen<(GetEepromInterface()->getCapability(TelemetryCSFields)/(4*cols)); screen++) {
- for (int c=0; chide();
- }
- }
- }
+ if (GetEepromInterface()->getCapability(NoTelemetryProtocol)) {
+ ui->frskyProtoCB->setDisabled(true);
+ }
+ else {
+ ui->frskyProtoCB->setEnabled(true);
}
if (!GetEepromInterface()->getCapability(TelemetryUnits)) {
@@ -479,9 +549,11 @@ void TelemetryPanel::setup()
}
ui->frskyUnitsCB->setCurrentIndex(index);
}
+
if ((GetEepromInterface()->getCapability(Telemetry)&TM_HASWSHH)) {
ui->frskyProtoCB->addItem(tr("Winged Shadow How High"));
- } else {
+ }
+ else {
ui->frskyProtoCB->addItem(tr("Winged Shadow How High (not supported)"));
}
@@ -517,57 +589,6 @@ void TelemetryPanel::setup()
ui->frskyCurrentCB->setCurrentIndex(model.frsky.currentSource);
ui->frskyVoltCB->setCurrentIndex(model.frsky.voltsSource);
- for (int screen=0; screen<2;screen++) {
- for (int rows=0; rows<4; rows++) {
- for (int cols=0; cols<3; cols++) {
- int index=screen*12+cols*4+rows;
- populateCustomScreenFieldCB(csf[index], model.frsky.screens[screen].body.lines[rows].source[cols], (rows<4), model.frsky.usrProto);
- }
- }
- }
-
- for (int j=0; j<12; j++) {
- int screen = j/4;
- int field = j%4;
- populateCustomScreenFieldCB(barsCB[j], model.frsky.screens[screen].body.bars[field].source, false, model.frsky.usrProto);
- switch (model.frsky.screens[screen].body.bars[field].source-1) {
- case TELEMETRY_SOURCE_TX_BATT:
- case TELEMETRY_SOURCE_A1:
- case TELEMETRY_SOURCE_A1_MIN:
- case TELEMETRY_SOURCE_A2:
- case TELEMETRY_SOURCE_A2_MIN:
- case TELEMETRY_SOURCE_CELLS_SUM:
- case TELEMETRY_SOURCE_VFAS:
- case TELEMETRY_SOURCE_CURRENT_MAX:
- case TELEMETRY_SOURCE_CURRENT:
- minSB[j]->setDecimals(1);
- maxSB[j]->setDecimals(1);
- break;
- case TELEMETRY_SOURCE_CELL:
- minSB[j]->setDecimals(2);
- maxSB[j]->setDecimals(2);
- break;
- default:
- minSB[j]->setDecimals(0);
- maxSB[j]->setDecimals(0);
- }
- minSB[j]->setMinimum(getBarValue(model.frsky.screens[screen].body.bars[field].source, 0, &model.frsky));
- minSB[j]->setMaximum(getBarValue(model.frsky.screens[screen].body.bars[field].source, 255, &model.frsky));
- minSB[j]->setSingleStep(getBarStep(model.frsky.screens[screen].body.bars[field].source));
- minSB[j]->setValue(getBarValue(model.frsky.screens[screen].body.bars[field].source, model.frsky.screens[screen].body.bars[field].barMin, &model.frsky));
- maxSB[j]->setMinimum(getBarValue(model.frsky.screens[screen].body.bars[field].source, 0, &model.frsky));
- maxSB[j]->setMaximum(getBarValue(model.frsky.screens[screen].body.bars[field].source, 255, &model.frsky));
- maxSB[j]->setSingleStep(getBarStep(model.frsky.screens[screen].body.bars[field].source));
- maxSB[j]->setValue(getBarValue(model.frsky.screens[screen].body.bars[field].source, (255-model.frsky.screens[screen].body.bars[field].barMax), &model.frsky));
-
- if (model.frsky.screens[screen].body.bars[field].source==0 || model.frsky.screens[screen].type==0) {
- minSB[j]->setDisabled(true);
- maxSB[j]->setDisabled(true);
- }
- connect(barsCB[j],SIGNAL(currentIndexChanged(int)),this,SLOT(telBarCBcurrentIndexChanged(int)));
- connect(maxSB[j],SIGNAL(editingFinished()),this,SLOT(telMaxSBeditingFinished()));
- connect(minSB[j],SIGNAL(editingFinished()),this,SLOT(telMinSBeditingFinished()));
- }
lock=false;
}
@@ -602,385 +623,119 @@ void TelemetryPanel::on_frskyVoltCB_currentIndexChanged(int index)
void TelemetryPanel::on_frskyProtoCB_currentIndexChanged(int index)
{
- if (lock) return;
- int bindex[12];
- lock=true;
- for (int i=0; i<12; i++) {
- bindex[i]=barsCB[i]->currentIndex();
- model.frsky.usrProto=index;
- populateCustomScreenFieldCB(barsCB[i], bindex[i], false, model.frsky.usrProto);
- }
- if (!GetEepromInterface()->getCapability(TelemetryCSFields)) {
- ui->groupBox_5->hide();
- } else {
- for (int screen=0; screen<2;screen++) {
- for (int rows=0; rows<4; rows++) {
- for (int cols=0; cols<3; cols++) {
- int index=screen*12+cols*4+rows;
- populateCustomScreenFieldCB(csf[index], model.frsky.screens[screen].body.lines[rows].source[cols], (rows<4), model.frsky.usrProto);
- }
- }
- }
- }
- lock=false;
- if (index==0) {
- for (int i=0; i<12; i++) {
- if (bindex[i]>2) {
- barsCB[i]->setCurrentIndex(0);
- } else {
- barsCB[i]->setCurrentIndex(bindex[i]);
- }
- }
- } else if (index==2) {
- for (int i=0; i<12; i++) {
- if (bindex[i]>3) {
- barsCB[i]->setCurrentIndex(0);
- } else {
- barsCB[i]->setCurrentIndex(bindex[i]);
- }
- }
- } else {
- for (int i=0; i<12; i++) {
- barsCB[i]->setCurrentIndex(bindex[i]);
- }
- }
- emit modified();
+ model.frsky.usrProto = index;
+ emit modified();
}
-void TelemetryPanel::on_rssiAlarm1CB_currentIndexChanged(int index) {
- if (lock) return;
- model.frsky.rssiAlarms[0].level=index;
- emit modified();
+void TelemetryPanel::on_rssiAlarm1CB_currentIndexChanged(int index)
+{
+ model.frsky.rssiAlarms[0].level = index;
+ emit modified();
}
-void TelemetryPanel::on_rssiAlarm2CB_currentIndexChanged(int index) {
- if (lock) return;
- model.frsky.rssiAlarms[1].level=index;
- emit modified();
+void TelemetryPanel::on_rssiAlarm2CB_currentIndexChanged(int index)
+{
+ model.frsky.rssiAlarms[1].level = index;
+ emit modified();
}
void TelemetryPanel::on_rssiAlarm1SB_editingFinished()
{
- if (lock) return;
- model.frsky.rssiAlarms[0].value=(ui->rssiAlarm1SB->value());
- emit modified();
+ model.frsky.rssiAlarms[0].value = ui->rssiAlarm1SB->value();
+ emit modified();
}
void TelemetryPanel::on_rssiAlarm2SB_editingFinished()
{
- if (lock) return;
- model.frsky.rssiAlarms[1].value=(ui->rssiAlarm2SB->value());
- emit modified();
+ model.frsky.rssiAlarms[1].value = ui->rssiAlarm2SB->value();
+ emit modified();
}
void TelemetryPanel::on_AltitudeGPS_ChkB_toggled(bool checked)
{
- if (lock) return;
- model.frsky.FrSkyGpsAlt = checked;
- emit modified();
+ model.frsky.FrSkyGpsAlt = checked;
+ emit modified();
}
void TelemetryPanel::on_AltitudeToolbar_ChkB_toggled(bool checked)
{
- model.frsky.altitudeDisplayed = checked;
- emit modified();
+ model.frsky.altitudeDisplayed = checked;
+ emit modified();
}
void TelemetryPanel::on_varioSourceCB_currentIndexChanged(int index)
{
- if (lock) return;
- model.frsky.varioSource = index;
- emit modified();
+ model.frsky.varioSource = index;
+ emit modified();
}
void TelemetryPanel::on_varioLimitMin_DSB_editingFinished()
{
- if (lock) return;
- model.frsky.varioMin= round(ui->varioLimitMin_DSB->value()+10);
- emit modified();
+ model.frsky.varioMin = round(ui->varioLimitMin_DSB->value()+10);
+ emit modified();
}
void TelemetryPanel::on_varioLimitMax_DSB_editingFinished()
{
- if (lock) return;
- model.frsky.varioMax= round(ui->varioLimitMax_DSB->value()-10);
- emit modified();
+ model.frsky.varioMax = round(ui->varioLimitMax_DSB->value()-10);
+ emit modified();
}
void TelemetryPanel::on_varioLimitCenterMin_DSB_editingFinished()
{
- if (lock) return;
+ if (!lock) {
if (ui->varioLimitCenterMin_DSB->value()>ui->varioLimitCenterMax_DSB->value()) {
ui->varioLimitCenterMax_DSB->setValue(ui->varioLimitCenterMin_DSB->value());
}
- model.frsky.varioCenterMin= round((ui->varioLimitCenterMin_DSB->value()+0.5)*10);
+ model.frsky.varioCenterMin = round((ui->varioLimitCenterMin_DSB->value()+0.5)*10);
emit modified();
+ }
}
void TelemetryPanel::on_varioLimitMinOff_ChkB_toggled(bool checked)
{
- if (lock) return;
+ if (!lock) {
model.frsky.varioCenterMin = -16;
if (!checked) {
lock=true;
ui->varioLimitCenterMin_DSB->setValue(-2.0);
ui->varioLimitCenterMin_DSB->setEnabled(true);
lock=false;
- } else {
+ }
+ else {
ui->varioLimitCenterMin_DSB->setValue(-2.0);
ui->varioLimitCenterMin_DSB->setDisabled(true);
}
emit modified();
+ }
}
void TelemetryPanel::on_varioLimitCenterMax_DSB_editingFinished()
{
- if (lock) return;
+ if (!lock) {
if (ui->varioLimitCenterMin_DSB->value()>ui->varioLimitCenterMax_DSB->value()) {
ui->varioLimitCenterMax_DSB->setValue(ui->varioLimitCenterMin_DSB->value());
}
- model.frsky.varioCenterMax= round((ui->varioLimitCenterMax_DSB->value()-0.5)*10);
+ model.frsky.varioCenterMax = round((ui->varioLimitCenterMax_DSB->value()-0.5)*10);
emit modified();
+ }
}
void TelemetryPanel::on_fasOffset_DSB_editingFinished()
{
- model.frsky.fasOffset = ui->fasOffset_DSB->value()*10;
- emit modified();
+ model.frsky.fasOffset = ui->fasOffset_DSB->value() * 10;
+ emit modified();
}
void TelemetryPanel::on_mahCount_SB_editingFinished()
{
- model.frsky.storedMah = ui->mahCount_SB->value();
- emit modified();
+ model.frsky.storedMah = ui->mahCount_SB->value();
+ emit modified();
}
void TelemetryPanel::on_mahCount_ChkB_toggled(bool checked)
{
- model.frsky.mAhPersistent = checked;
- ui->mahCount_SB->setDisabled(!checked);
- emit modified();
-}
-
-void TelemetryPanel::telBarUpdate()
-{
- int index;
- lock=true;
- for (int i=0; i<12; i++) {
- int screen=i/4;
- index=barsCB[i]->currentIndex();
- if (index==TELEMETRY_SOURCE_A1 || index==TELEMETRY_SOURCE_A1 || index==TELEMETRY_SOURCE_A1_MIN || index==TELEMETRY_SOURCE_A2_MIN) {
- minSB[i]->setMinimum(getBarValue(index, 0, &model.frsky));
- minSB[i]->setMaximum(getBarValue(index, 255, &model.frsky));
- minSB[i]->setSingleStep(getBarStep(index));
- maxSB[i]->setMinimum(getBarValue(index, 0, &model.frsky));
- maxSB[i]->setMaximum(getBarValue(index, 255, &model.frsky));
- maxSB[i]->setSingleStep(getBarStep(index));
- minSB[i]->setValue(getBarValue(index, model.frsky.screens[screen].body.bars[i%4].barMin, &model.frsky));
- maxSB[i]->setValue(getBarValue(index, 255-model.frsky.screens[screen].body.bars[i%4].barMax, &model.frsky));
- }
- }
- lock=false;
-}
-
-void TelemetryPanel::ScreenTypeCBcurrentIndexChanged(int index)
-{
- if (lock) return;
-
- QComboBox *comboBox = qobject_cast(sender());
- int screen = comboBox->objectName().right(1).toInt() -1;
- lock=true;
- model.frsky.screens[screen].type=index;
-
- for (int i=0; i<3; i++) {
- bool isNum = (model.frsky.screens[i].type==0);
- barsGB[i]->setVisible(!isNum);
- numsGB[i]->setVisible(isNum);
- }
-
- lock=false;
- emit modified();
-}
-
-void TelemetryPanel::telBarCBcurrentIndexChanged(int index)
-{
- if (lock) return;
- QComboBox *comboBox = qobject_cast(sender());
- int screenId = comboBox->objectName().mid(8,1).toInt() - 1;
- int barId = comboBox->objectName().mid(10,1).toInt() - 1;
- int bar=barId+screenId*4;
- model.frsky.screens[screenId].body.bars[barId].source=index;
- lock=true;
- if (index==0) {
- model.frsky.screens[screenId].body.bars[barId].barMin=0;
- model.frsky.screens[screenId].body.bars[barId].barMax=0;
- minSB[bar]->setDisabled(true);
- maxSB[bar]->setDisabled(true);
- } else {
- minSB[bar]->setEnabled(true);
- maxSB[bar]->setEnabled(true);
- }
- switch (index-1) {
- case TELEMETRY_SOURCE_TX_BATT:
- case TELEMETRY_SOURCE_A1:
- case TELEMETRY_SOURCE_A1_MIN:
- case TELEMETRY_SOURCE_A2:
- case TELEMETRY_SOURCE_A2_MIN:
- case TELEMETRY_SOURCE_CELLS_SUM:
- case TELEMETRY_SOURCE_VFAS:
- case TELEMETRY_SOURCE_CURRENT_MAX:
- case TELEMETRY_SOURCE_CURRENT:
- minSB[bar]->setDecimals(1);
- maxSB[bar]->setDecimals(1);
- break;
- case TELEMETRY_SOURCE_CELL:
- minSB[bar]->setDecimals(2);
- maxSB[bar]->setDecimals(2);
- break;
- default:
- minSB[bar]->setDecimals(0);
- maxSB[bar]->setDecimals(0);
- }
- minSB[bar]->setMinimum(getBarValue(index, 0, &model.frsky));
- minSB[bar]->setMaximum(getBarValue(index, 255, &model.frsky));
- minSB[bar]->setSingleStep(getBarStep(index));
- maxSB[bar]->setMinimum(getBarValue(index, 0, &model.frsky));
- maxSB[bar]->setMaximum(getBarValue(index, 255, &model.frsky));
- maxSB[bar]->setSingleStep(getBarStep(index));
- minSB[bar]->setValue(getBarValue(index, model.frsky.screens[screenId].body.bars[barId].barMin, &model.frsky));
- maxSB[bar]->setValue(getBarValue(index, 255-model.frsky.screens[screenId].body.bars[barId].barMax, &model.frsky));
- lock=false;
- emit modified();
-}
-
-void TelemetryPanel::telMinSBeditingFinished()
-{
- if (lock) return;
- QDoubleSpinBox *spinBox = qobject_cast(sender());
- int screenId = spinBox->objectName().mid(8,1).toInt() - 1;
- int barId = spinBox->objectName().right(1).toInt() - 1;
- int minId = barId+screenId*4;
- lock=true;
- if (model.frsky.screens[screenId].body.bars[barId].source==TELEMETRY_SOURCE_A1 || model.frsky.screens[screenId].body.bars[barId].source==TELEMETRY_SOURCE_A1_MIN) {
- model.frsky.screens[screenId].body.bars[barId].barMin=round((minSB[minId]->value()-analogs[0]->ui->CalibSB->value())/getBarStep(model.frsky.screens[screenId].body.bars[barId].source));
- } else if (model.frsky.screens[screenId].body.bars[minId].source==TELEMETRY_SOURCE_A2 || model.frsky.screens[screenId].body.bars[minId].source==TELEMETRY_SOURCE_A2_MIN) {
- model.frsky.screens[screenId].body.bars[barId].barMin=round((minSB[minId]->value()-analogs[1]->ui->CalibSB->value())/getBarStep(model.frsky.screens[screenId].body.bars[barId].source));
- } else {
- model.frsky.screens[screenId].body.bars[barId].barMin=round((minSB[minId]->value()-getBarValue(model.frsky.screens[screenId].body.bars[barId].source, 0, &model.frsky))/getBarStep(model.frsky.screens[screenId].body.bars[barId].source));
- }
- spinBox->setValue(getBarValue(model.frsky.screens[screenId].body.bars[barId].source, model.frsky.screens[screenId].body.bars[barId].barMin, &model.frsky));
- if (maxSB[minId]->value()value()) {
- model.frsky.screens[screenId].body.bars[minId].barMax=(255-model.frsky.screens[screenId].body.bars[barId].barMin+1);
- maxSB[minId]->setValue(getBarValue(model.frsky.screens[screenId].body.bars[barId].source, 255-model.frsky.screens[screenId].body.bars[barId].barMax, &model.frsky));
- }
- maxSB[minId]->setMinimum(getBarValue(model.frsky.screens[screenId].body.bars[barId].source, (model.frsky.screens[screenId].body.bars[barId].barMin+1), &model.frsky));
- lock=false;
- emit modified();
-}
-
-void TelemetryPanel::telMaxSBeditingFinished()
-{
- if (lock) return;
- QDoubleSpinBox *spinBox = qobject_cast(sender());
- int screenId = spinBox->objectName().mid(8,1).toInt() - 1;
- int barId = spinBox->objectName().right(1).toInt() - 1;
- lock=true;
- if (model.frsky.screens[screenId].body.bars[barId].source==5) {
- model.frsky.screens[screenId].body.bars[barId].barMax = (255-round((spinBox->value()-analogs[0]->ui->CalibSB->value())/getBarStep(model.frsky.screens[screenId].body.bars[barId].source)));
- } else if (model.frsky.screens[screenId].body.bars[barId].source==6) {
- model.frsky.screens[screenId].body.bars[barId].barMax = (255-round((spinBox->value()-analogs[1]->ui->CalibSB->value())/getBarStep(model.frsky.screens[screenId].body.bars[barId].source)));
- } else {
- model.frsky.screens[screenId].body.bars[barId].barMax = (255-round((spinBox->value()-getBarValue(model.frsky.screens[screenId].body.bars[barId].source, 0, &model.frsky))/getBarStep(model.frsky.screens[screenId].body.bars[barId].source) ));
- }
- spinBox->setValue(getBarValue(model.frsky.screens[screenId].body.bars[barId].source, (255-model.frsky.screens[screenId].body.bars[barId].barMax), &model.frsky));
- lock=false;
- emit modified();
-}
-
-void TelemetryPanel::customFieldEdited()
-{
- if (!lock) {
- lock = true;
-
- int cols=GetEepromInterface()->getCapability(TelemetryColsCSFields);
- if (cols==0) cols=2;
-
- for (int i=0; igetCapability(TelemetryCSFields); i++) {
- int screen=i/(4*cols);
- int r=((i%(4*cols))%4);
- int c=((i%(4*cols))/4);
- if (model.frsky.screens[screen].type==0) {
- model.frsky.screens[screen].body.lines[r].source[c]=csf[i]->currentIndex();
- }
- }
- emit modified();
-
- lock = false;
- }
-}
-
-float TelemetryPanel::getBarStep(int barId)
-{
- switch (barId-1) {
- case TELEMETRY_SOURCE_TX_BATT:
- return 0.1;
- break;
- case TELEMETRY_SOURCE_TIMER1:
- case TELEMETRY_SOURCE_TIMER2:
- return 3;
- break;
- case TELEMETRY_SOURCE_A1:
- case TELEMETRY_SOURCE_A1_MIN:
- return (analogs[0]->ui->RatioSB->value()/255);
- break;
- case TELEMETRY_SOURCE_A2:
- case TELEMETRY_SOURCE_A2_MIN:
- return (analogs[1]->ui->RatioSB->value()/255);
- break;
- case TELEMETRY_SOURCE_ALT:
- case TELEMETRY_SOURCE_GPS_ALT:
- case TELEMETRY_SOURCE_ALT_MAX:
- case TELEMETRY_SOURCE_ALT_MIN:
- return 8;
- break;
- case TELEMETRY_SOURCE_RPM:
- case TELEMETRY_SOURCE_RPM_MAX:
- return 50;
- break;
- case TELEMETRY_SOURCE_CELLS_SUM:
- case TELEMETRY_SOURCE_VFAS:
- return 0.1;
- break;
- case TELEMETRY_SOURCE_CELL:
- return 0.02;
- break;
- case TELEMETRY_SOURCE_HDG:
- return 2;
- break;
- case TELEMETRY_SOURCE_DIST:
- case TELEMETRY_SOURCE_DIST_MAX:
- return 8;
- break;
- case TELEMETRY_SOURCE_CURRENT_MAX:
- case TELEMETRY_SOURCE_CURRENT:
- return 0.5;
- break;
- case TELEMETRY_SOURCE_POWER:
- return 5;
- break;
- case TELEMETRY_SOURCE_CONSUMPTION:
- return 20;
- break;
- case TELEMETRY_SOURCE_SPEED:
- case TELEMETRY_SOURCE_SPEED_MAX:
- if (model.frsky.imperial==1) {
- return 1;
- } else {
- return 1.852;
- }
- break;
- default:
- return 1;
- break;
- }
+ model.frsky.mAhPersistent = checked;
+ ui->mahCount_SB->setDisabled(!checked);
+ emit modified();
}
diff --git a/companion/src/modeledit/telemetry.h b/companion/src/modeledit/telemetry.h
index e8f6344638..44233f79c7 100644
--- a/companion/src/modeledit/telemetry.h
+++ b/companion/src/modeledit/telemetry.h
@@ -8,6 +8,7 @@
namespace Ui {
class TelemetryAnalog;
+ class TelemetryCustomScreen;
class Telemetry;
}
@@ -44,6 +45,32 @@ class TelemetryAnalog : public QWidget
void update();
};
+class TelemetryCustomScreen : public ModelPanel
+{
+ Q_OBJECT
+
+ public:
+ TelemetryCustomScreen(QWidget *parent, ModelData & model, FrSkyScreenData & screen);
+ ~TelemetryCustomScreen();
+ void update();
+
+ private slots:
+ void on_screenType_currentIndexChanged(int index);
+ void customFieldChanged(int index);
+ void barSourceChanged(int index);
+ void barMinChanged(double value);
+ void barMaxChanged(double value);
+
+ private:
+ void updateBar(int line);
+ Ui::TelemetryCustomScreen * ui;
+ FrSkyScreenData & screen;
+ QComboBox * fieldsCB[4][3];
+ QComboBox * barsCB[4];
+ QDoubleSpinBox * minSB[4];
+ QDoubleSpinBox * maxSB[4];
+};
+
class TelemetryPanel : public ModelPanel
{
Q_OBJECT
@@ -77,24 +104,12 @@ class TelemetryPanel : public ModelPanel
void on_fasOffset_DSB_editingFinished();
void on_mahCount_SB_editingFinished();
void on_mahCount_ChkB_toggled(bool checked);
- void telBarCBcurrentIndexChanged(int index);
- void ScreenTypeCBcurrentIndexChanged(int index);
- void telMaxSBeditingFinished();
- void telMinSBeditingFinished();
- void customFieldEdited();
private:
Ui::Telemetry *ui;
TelemetryAnalog * analogs[2];
- QGroupBox* barsGB[3];
- QGroupBox* numsGB[3];
- QComboBox* barsCB[12];
- QDoubleSpinBox* minSB[12];
- QDoubleSpinBox* maxSB[12];
- QComboBox* csf[36];
void setup();
- float getBarStep(int barId);
void telBarUpdate();
};
diff --git a/companion/src/modeledit/telemetry.ui b/companion/src/modeledit/telemetry.ui
index bb6bae9c92..6a3a6d6181 100644
--- a/companion/src/modeledit/telemetry.ui
+++ b/companion/src/modeledit/telemetry.ui
@@ -7,7 +7,7 @@
0
0
692
- 568
+ 457
@@ -871,1240 +871,17 @@
-
-
-
-
-
-
-
- 0
- 0
-
-
-
-
-
-
-
- 1
-
-
- 1
-
-
-
-
-
-
- 0
- 0
-
-
-
- 0
-
-
-
- Telemetry screen 1
-
-
-
-
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 0
- 0
-
-
-
- Custom Screen Type
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 90
- 0
-
-
-
-
-
- Nums
-
-
- -
-
- Bars
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
- Source
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Min
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Gauge
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Max
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- false
-
-
- Background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 128, 255), stop:0.339795 rgba(0, 0, 128, 255), stop:0.339799 rgba(255, 255, 255, 255), stop:0.662444 rgba(255, 255, 255, 255),)
-
-
-
- QFrame::Panel
-
-
- QFrame::Raised
-
-
- Gauge 1
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- false
-
-
- Background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 128, 255), stop:0.339795 rgba(0, 0, 128, 255), stop:0.339799 rgba(255, 255, 255, 255), stop:0.662444 rgba(255, 255, 255, 255),)
-
-
-
- QFrame::Panel
-
-
- QFrame::Raised
-
-
- Gauge 2
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- false
-
-
- Background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 128, 255), stop:0.339795 rgba(0, 0, 128, 255), stop:0.339799 rgba(255, 255, 255, 255), stop:0.662444 rgba(255, 255, 255, 255),)
-
-
-
- QFrame::Panel
-
-
- QFrame::Raised
-
-
- Gauge 3
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- false
-
-
- Background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 128, 255), stop:0.339795 rgba(0, 0, 128, 255), stop:0.339799 rgba(255, 255, 255, 255), stop:0.662444 rgba(255, 255, 255, 255),)
-
-
-
- QFrame::Panel
-
-
- QFrame::Raised
-
-
- Gauge 4
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- 0
-
-
-
-
-
-
-
-
-
-
- Telemetry screen 2
-
-
- -
-
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
- Source
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Min
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Gauge
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Max
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- false
-
-
- Background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 128, 255), stop:0.339795 rgba(0, 0, 128, 255), stop:0.339799 rgba(255, 255, 255, 255), stop:0.662444 rgba(255, 255, 255, 255),)
-
-
-
- QFrame::Panel
-
-
- QFrame::Raised
-
-
- Gauge 1
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- false
-
-
- Background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 128, 255), stop:0.339795 rgba(0, 0, 128, 255), stop:0.339799 rgba(255, 255, 255, 255), stop:0.662444 rgba(255, 255, 255, 255),)
-
-
-
- QFrame::Panel
-
-
- QFrame::Raised
-
-
- Gauge 2
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- false
-
-
- Background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 128, 255), stop:0.339795 rgba(0, 0, 128, 255), stop:0.339799 rgba(255, 255, 255, 255), stop:0.662444 rgba(255, 255, 255, 255),)
-
-
-
- QFrame::Panel
-
-
- QFrame::Raised
-
-
- Gauge 3
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- false
-
-
- Background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 128, 255), stop:0.339795 rgba(0, 0, 128, 255), stop:0.339799 rgba(255, 255, 255, 255), stop:0.662444 rgba(255, 255, 255, 255),)
-
-
-
- QFrame::Panel
-
-
- QFrame::Raised
-
-
- Gauge 4
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- 0
-
-
-
-
-
-
- -
-
-
-
-
-
-
- 0
- 0
-
-
-
- Custom Screen Type
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 90
- 0
-
-
-
-
-
- Nums
-
-
- -
-
- Bars
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
-
-
-
-
- Telemetry screen 3
-
-
- -
-
-
-
-
-
-
- 0
- 0
-
-
-
- Custom Screen Type
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 90
- 0
-
-
-
-
-
- Nums
-
-
- -
-
- Bars
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
- Source
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Min
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Gauge
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Max
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- false
-
-
- Background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 128, 255), stop:0.339795 rgba(0, 0, 128, 255), stop:0.339799 rgba(255, 255, 255, 255), stop:0.662444 rgba(255, 255, 255, 255),)
-
-
-
- QFrame::Panel
-
-
- QFrame::Raised
-
-
- Gauge 1
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- false
-
-
- Background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 128, 255), stop:0.339795 rgba(0, 0, 128, 255), stop:0.339799 rgba(255, 255, 255, 255), stop:0.662444 rgba(255, 255, 255, 255),)
-
-
-
- QFrame::Panel
-
-
- QFrame::Raised
-
-
- Gauge 2
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- false
-
-
- Background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 128, 255), stop:0.339795 rgba(0, 0, 128, 255), stop:0.339799 rgba(255, 255, 255, 255), stop:0.662444 rgba(255, 255, 255, 255),)
-
-
-
- QFrame::Panel
-
-
- QFrame::Raised
-
-
- Gauge 3
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- false
-
-
- Background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 128, 255), stop:0.339795 rgba(0, 0, 128, 255), stop:0.339799 rgba(255, 255, 255, 255), stop:0.662444 rgba(255, 255, 255, 255),)
-
-
-
- QFrame::Panel
-
-
- QFrame::Raised
-
-
- Gauge 4
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- 0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ 0
+ 0
+
+
+
+ -1
+
+
-
diff --git a/companion/src/modeledit/telemetry_customscreen.ui b/companion/src/modeledit/telemetry_customscreen.ui
new file mode 100644
index 0000000000..b01417450e
--- /dev/null
+++ b/companion/src/modeledit/telemetry_customscreen.ui
@@ -0,0 +1,138 @@
+
+
+ TelemetryCustomScreen
+
+
+
+ 0
+ 0
+ 650
+ 393
+
+
+
+ Form
+
+
+
-
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+ Custom Screen Type
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 90
+ 0
+
+
+
-
+
+ Nums
+
+
+ -
+
+ Bars
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+ -
+
+
-
+
+
+
+
+ -
+
+
+
-
+
+
+ Min
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ Source
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ Gauge
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ Max
+
+
+ Qt::AlignCenter
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp
index cfd6938d6b..45d149c97a 100644
--- a/companion/src/printdialog.cpp
+++ b/companion/src/printdialog.cpp
@@ -796,7 +796,7 @@ void printDialog::printFrSky()
str.append(""+tr("System of units")+" | "+getFrSkyMeasure(fd->imperial)+" |
");
str.append(""+tr("Propeller blades")+" | "+getFrSkyBlades(fd->blades)+" |
");
str.append(" |
");
-
+#if 0
if (GetEepromInterface()->getCapability(TelemetryBars) || (GetEepromInterface()->getCapability(TelemetryCSFields))) {
int cols=GetEepromInterface()->getCapability(TelemetryColsCSFields);
if (cols==0) cols=2;
@@ -834,12 +834,13 @@ void printDialog::printFrSky()
for (int i=0; i<4; i++) {
if (fd->screens[j].body.bars[i].source!=0)
tc++;
- str.append(""+QString::number(i+1,10)+" | "+getFrSkySrc(fd->screens[j].body.bars[i].source)+" | "+(fd->screens[j].body.bars[i].source>0 ? QString::number(getBarValue(fd->screens[j].body.bars[i].source, fd->screens[j].body.bars[i].barMin,fd)):"----")+" | "+(fd->screens[j].body.bars[i].source>0 ? QString::number(getBarValue(fd->screens[j].body.bars[i].source,(255-fd->screens[j].body.bars[i].barMax),fd)) :"----")+" |
");
+ // TODO str.append(""+QString::number(i+1,10)+" | "+getFrSkySrc(fd->screens[j].body.bars[i].source)+" | "+(fd->screens[j].body.bars[i].source>0 ? QString::number(getBarValue(fd->screens[j].body.bars[i].source, fd->screens[j].body.bars[i].barMin,fd)):"----")+" | "+(fd->screens[j].body.bars[i].source>0 ? QString::number(getBarValue(fd->screens[j].body.bars[i].source,(255-fd->screens[j].body.bars[i].barMax),fd)) :"----")+" |
");
}
str.append("");
}
}
}
+#endif
if (tc>0)
te->append(str);
}
diff --git a/radio/src/Makefile b/radio/src/Makefile
index 482cdbb21a..4ce9917777 100644
--- a/radio/src/Makefile
+++ b/radio/src/Makefile
@@ -1110,50 +1110,42 @@ taranis-stamp:
translations/cz.h: translations/cz.h.txt
@echo
- @echo "Create language specific header files"
- @echo "Czech"
+ @echo "Create Czech language specific header files"
$(TRANSLATE) translations/cz.h.txt translations/cz.h cz
translations/de.h: translations/de.h.txt
@echo
- @echo "Create language specific header files"
- @echo "German"
+ @echo "Create German language specific header files"
$(TRANSLATE) translations/de.h.txt translations/de.h de
translations/es.h: translations/es.h.txt
@echo
- @echo "Create language specific header files"
- @echo "Spanish"
+ @echo "Create Spanish language specific header files"
$(TRANSLATE) translations/es.h.txt translations/es.h es
translations/fr.h: translations/fr.h.txt
@echo
- @echo "Create language specific header files"
- @echo "French"
+ @echo "Create French language specific header files"
$(TRANSLATE) translations/fr.h.txt translations/fr.h fr
translations/it.h: translations/it.h.txt
@echo
- @echo "Create language specific header files"
- @echo "Italian"
+ @echo "Create Italian language specific header files"
$(TRANSLATE) translations/it.h.txt translations/it.h it
translations/pl.h: translations/pl.h.txt
@echo
- @echo "Create language specific header files"
- @echo "Polish"
+ @echo "Create Polish language specific header files"
$(TRANSLATE) translations/pl.h.txt translations/pl.h pl
translations/pt.h: translations/pt.h.txt
@echo
- @echo "Create language specific header files"
- @echo "Portugese"
+ @echo "Create Portugese language specific header files"
$(TRANSLATE) translations/pt.h.txt translations/pt.h pt
translations/se.h: translations/se.h.txt
@echo
- @echo "Create language specific header files"
- @echo "Swedish"
+ @echo "Create Swedish language specific header files"
$(TRANSLATE) translations/se.h.txt translations/se.h se
.PHONY: fonts
diff --git a/radio/src/gui/menu_model.cpp b/radio/src/gui/menu_model.cpp
index 0bce00e1c0..b2d9c9ac2d 100644
--- a/radio/src/gui/menu_model.cpp
+++ b/radio/src/gui/menu_model.cpp
@@ -5536,18 +5536,14 @@ void menuModelTelemetry(uint8_t event)
lineIndex = k-ITEM_TELEMETRY_SCREEN_LINE5;
}
-#if 0
- putsStrIdx(0, y, PSTR(INDENT"Line"), lineIndex+1, m_posHorz<0 ? attr : 0);
-#endif
-
#if defined(GAUGES)
if (IS_BARS_SCREEN(screenIndex)) {
FrSkyBarData & bar = g_model.frsky.screens[screenIndex].bars[lineIndex];
uint8_t barSource = bar.source;
lcd_putsiAtt(TELEM_COL1, y, STR_VTELEMCHNS, barSource, m_posHorz==0 ? attr : 0);
if (barSource) {
- putsTelemetryChannel(TELEM_BARS_COLMIN, y, barSource-1, convertTelemValue(barSource, bar.barMin), (m_posHorz==1 ? attr : 0) | LEFT);
- putsTelemetryChannel(TELEM_BARS_COLMAX, y, barSource-1, convertTelemValue(barSource, 255-bar.barMax), (m_posHorz==2 ? attr : 0) | LEFT);
+ putsTelemetryChannel(TELEM_BARS_COLMIN, y, barSource-1, convertBarTelemValue(barSource, bar.barMin), (m_posHorz==1 ? attr : 0) | LEFT);
+ putsTelemetryChannel(TELEM_BARS_COLMAX, y, barSource-1, convertBarTelemValue(barSource, 255-bar.barMax), (m_posHorz==2 ? attr : 0) | LEFT);
}
else if (attr) {
MOVE_CURSOR_FROM_HERE();
@@ -5558,14 +5554,14 @@ void menuModelTelemetry(uint8_t event)
bar.source = checkIncDecModel(event, barSource, 0, TELEM_DISPLAY_MAX);
if (checkIncDec_Ret) {
bar.barMin = 0;
- bar.barMax = 255-maxTelemValue(bar.source);
+ bar.barMax = 255 - maxBarTelemValue(bar.source);
}
break;
case 1:
bar.barMin = checkIncDec(event, bar.barMin, 0, 254-bar.barMax, EE_MODEL|NO_INCDEC_MARKS);
break;
case 2:
- bar.barMax = 255 - checkIncDec(event, 255-bar.barMax, bar.barMin+1, maxTelemValue(barSource), EE_MODEL|NO_INCDEC_MARKS);
+ bar.barMax = 255 - checkIncDec(event, 255-bar.barMax, bar.barMin+1, maxBarTelemValue(barSource), EE_MODEL|NO_INCDEC_MARKS);
break;
}
}
diff --git a/radio/src/gui/view_telemetry.cpp b/radio/src/gui/view_telemetry.cpp
index 3c62c1b02a..9e9c100c6a 100644
--- a/radio/src/gui/view_telemetry.cpp
+++ b/radio/src/gui/view_telemetry.cpp
@@ -214,8 +214,8 @@ void menuTelemetryFrsky(uint8_t event)
for (int8_t i=3; i>=0; i--) {
FrSkyBarData & bar = screen.bars[i];
uint8_t source = bar.source;
- getvalue_t barMin = convertTelemValue(source, bar.barMin);
- getvalue_t barMax = convertTelemValue(source, 255-bar.barMax);
+ getvalue_t barMin = convertBarTelemValue(source, bar.barMin);
+ getvalue_t barMax = convertBarTelemValue(source, 255-bar.barMax);
if (source && barMax > barMin) {
uint8_t y = barHeight+6+i*(barHeight+6);
lcd_putsiAtt(0, y+barHeight-5, STR_VTELEMCHNS, source, 0);
@@ -234,7 +234,7 @@ void menuTelemetryFrsky(uint8_t event)
threshold = g_model.frsky.channels[source-TELEM_A1].alarms_value[0];
#if defined(FRSKY_HUB)
else
- threshold = convertTelemValue(source, barsThresholds[source-TELEM_ALT]);
+ threshold = convertBarTelemValue(source, barsThresholds[source-TELEM_ALT]);
#endif
if (threshold) {
diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp
index 2c63a88e48..921ab33840 100644
--- a/radio/src/opentx.cpp
+++ b/radio/src/opentx.cpp
@@ -1900,7 +1900,7 @@ csw_telemetry_value_t maxTelemValue(uint8_t channel)
#endif
#if defined(CPUARM)
-getvalue_t convertTelemValue(uint8_t channel, csw_telemetry_value_t value)
+getvalue_t convert16bitsTelemValue(uint8_t channel, csw_telemetry_value_t value)
{
getvalue_t result;
switch (channel) {
@@ -1913,8 +1913,14 @@ getvalue_t convertTelemValue(uint8_t channel, csw_telemetry_value_t value)
}
return result;
}
-#else
-getvalue_t convertTelemValue(uint8_t channel, csw_telemetry_value_t value)
+
+csw_telemetry_value_t max8bitsTelemValue(uint8_t channel)
+{
+ return min(255, maxTelemValue(channel));
+}
+#endif
+
+getvalue_t convert8bitsTelemValue(uint8_t channel, csw_telemetry_value_t value)
{
getvalue_t result;
switch (channel) {
@@ -1924,6 +1930,10 @@ getvalue_t convertTelemValue(uint8_t channel, csw_telemetry_value_t value)
break;
#if defined(FRSKY)
case TELEM_ALT:
+#if defined(CPUARM)
+ result = 100 * (value * 8 - 500);
+ break;
+#endif
case TELEM_GPSALT:
case TELEM_MAX_ALT:
case TELEM_MIN_ALT:
@@ -1961,18 +1971,17 @@ getvalue_t convertTelemValue(uint8_t channel, csw_telemetry_value_t value)
}
return result;
}
-#endif
getvalue_t convertCswTelemValue(CustomSwData * cs)
{
getvalue_t val;
#if defined(CPUARM)
- val = convertTelemValue(cs->v1 - MIXSRC_FIRST_TELEM + 1, cs->v2);
+ val = convert16bitsTelemValue(cs->v1 - MIXSRC_FIRST_TELEM + 1, cs->v2);
#else
if (cswFamily(cs->func)==CS_VOFS)
- val = convertTelemValue(cs->v1 - MIXSRC_FIRST_TELEM + 1, 128+cs->v2);
+ val = convert8bitsTelemValue(cs->v1 - MIXSRC_FIRST_TELEM + 1, 128+cs->v2);
else
- val = convertTelemValue(cs->v1 - MIXSRC_FIRST_TELEM + 1, 128+cs->v2) - convertTelemValue(cs->v1 - MIXSRC_FIRST_TELEM + 1, 128);
+ val = convert8bitsTelemValue(cs->v1 - MIXSRC_FIRST_TELEM + 1, 128+cs->v2) - convert8bitsTelemValue(cs->v1 - MIXSRC_FIRST_TELEM + 1, 128);
#endif
return val;
}
diff --git a/radio/src/opentx.h b/radio/src/opentx.h
index 1c62f25fda..6d009ab66e 100644
--- a/radio/src/opentx.h
+++ b/radio/src/opentx.h
@@ -1637,9 +1637,24 @@ extern uint8_t barsThresholds[THLD_MAX];
#define maxTelemValue(channel) 255
#endif
-getvalue_t convertTelemValue(uint8_t channel, csw_telemetry_value_t value);
+#if defined(CPUARM)
+getvalue_t convert16bitsTelemValue(uint8_t channel, csw_telemetry_value_t value);
+csw_telemetry_value_t max8bitsTelemValue(uint8_t channel);
+#endif
+
+getvalue_t convert8bitsTelemValue(uint8_t channel, csw_telemetry_value_t value);
getvalue_t convertCswTelemValue(CustomSwData * cs);
+#if defined(CPUARM)
+ #define convertTelemValue(channel, value) convert16bitsTelemValue(channel, value)
+ #define convertBarTelemValue(channel, value) convert8bitsTelemValue(channel, value)
+ #define maxBarTelemValue(channel) max8bitsTelemValue(channel)
+#else
+ #define convertTelemValue(channel, value) convert8bitsTelemValue(channel, value)
+ #define convertBarTelemValue(channel, value) convert8bitsTelemValue(channel, value)
+ #define maxBarTelemValue(channel) maxTelemValue(channel)
+#endif
+
#if defined(FRSKY) || defined(CPUARM)
lcdint_t applyChannelRatio(uint8_t channel, lcdint_t val);
#endif
diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp
index 7702d5dfec..f031ba40bb 100644
--- a/radio/src/translations.cpp
+++ b/radio/src/translations.cpp
@@ -490,8 +490,8 @@ const pm_char STR_VIEW_TEXT[] PROGMEM = "View text";
const pm_char STR_CLEAR[] PROGMEM = "Clear";
const pm_char STR_RESET[] PROGMEM = "Reset";
const pm_char STR_COPY_TRIMS_TO_OFFSET[] = "Copy Trims To Offset";
- const pm_char STR_TOP_BAR[] PROGMEM = "Top Bar";
- const pm_char STR_ALTITUDE[] PROGMEM = INDENT "Altitude";
+ const pm_char STR_TOP_BAR[] PROGMEM = TR_TOP_BAR;
+ const pm_char STR_ALTITUDE[] PROGMEM = TR_ALTITUDE;
const pm_char STR_SCALE[] PROGMEM = "Scale";
const pm_char STR_VIEW_CHANNELS[] PROGMEM = "View Channels";
const pm_char STR_VIEW_NOTES[] PROGMEM = "View Notes";
diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt
index 9255897971..c012bb2078 100644
--- a/radio/src/translations/pl.h.txt
+++ b/radio/src/translations/pl.h.txt
@@ -234,7 +234,7 @@
#define TR_VFSWRESET TR("Tmr1""Tmr2""All\0" TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC, "Timer 1\0 ""Timer 2\0 ""All\0 " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC)
#define LEN_FUNCSOUNDS TR("\004", "\006")
-#define TR_FUNCSOUNDS TR("Bp1\0""Bp2\0""Bp3\0""Wrn1""Wrn2""Chee""Rata""Tick""Sirn""Ring""SciF""Robt""Chrp""Tada""Crck""Alrm", "Beep1 ""Beep2 ""Beep3 ""Warn1 ""Warn2 ""Cheep ""Ratata""Tick ""Siren ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""AlmClk")
+#define TR_FUNCSOUNDS TR("Bp1\0""Bp2\0""Bp3\0""Ost1""Ost2""Chee""Rata""Tik\0""Syre""Dzwo""SciF""Robt""Chrp""Tada""Crck""Alrm", "Beep1\0""Beep2\0""Beep3\0""Ostrz1""Ostrz1""Cheep\0""Ratata""Tick\0 ""Syrena""Dzwone""SciFi\0""Robot\0""Chirp\0""Tada\0 ""Krytcz""AlmZeg")
#define LEN_VTELEMCHNS "\004"
#if defined(PCBTARANIS)
@@ -244,7 +244,7 @@
#define TR_RSSI_0 "Tx\0 "
#define TR_RSSI_1 "Rx\0 "
#endif
-#define TR_VTELEMCHNS "---\0""Bat\0""Tmr1""Tmr2" TR_RSSI_0 TR_RSSI_1 "A1\0 ""A2\0 ""Alt\0""Rpm\0""Pali""T1\0 ""T2\0 ""Spd\0""Dyst""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Cur+""Pwr+""Acc\0""Time"
+#define TR_VTELEMCHNS "---\0""Bat\0""Tmr1""Tmr2" TR_RSSI_0 TR_RSSI_1 "A1\0 ""A2\0 ""Wys\0""Rpm\0""Pali""T1\0 ""T2\0 ""Spd\0""Dyst""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Moc\0""AccX""AccY""AccZ""Hdg\0""VSpd""A1-\0""A2-\0""Wys-""Wys+""Rpm+""T1+\0""T2+\0""Spd+""Dst+""Cur+""Moc+""Acc\0""Time"
#if defined(CPUARM)
#define LEN_VUNITSSYSTEM TR("\006", "\012")
@@ -284,7 +284,7 @@
#if defined(FRSKY_SPORT)
#define TR_VARIOSRC "Vario""A1\0 ""A2\0"
#else
- #define TR_VARIOSRC "Alti\0""Alti+""Vario""A1\0 ""A2\0"
+ #define TR_VARIOSRC "Wys.\0""Wys.+""Vario""A1\0 ""A2\0"
#endif
#define LEN_VSCREEN "\006"
@@ -295,13 +295,13 @@
#define LEN2_VTEMPLATES 17
#define LEN_VTEMPLATES "\021"
-#define TR_VTEMPLATES "Wyczyść miksery\0 ""Prosty. 4kanal\0 ""Przełącznik-T-Cut""V-Tail \0 ""Elevon-Delta\0 ""eCCPM \0 ""Heli Setup \0 ""Test serwa \0 "
+#define TR_VTEMPLATES "Wyczyść miksery\0 ""Prosty. 4kanal\0 ""Przełącznik-T-Cut""V-Tail \0 ""Elevon-Delta\0 ""eCCPM \0 ""Ustaw. Heli \0 ""Test serwa \0 "
#define LEN_VSWASHTYPE "\004"
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
#define LEN_VKEYS "\005"
-#define TR_VKEYS TR(" Menu"" Exit""W dół""Wgórę""Wpraw""Wlewo", " Menu"" Exit""W dół""Wgórę""Wpraw""Wlewo")
+#define TR_VKEYS TR(" Menu""Wyjdź""W dół""Wgórę""Wpraw""Wlewo", " Menu""Wyjdź""W dół""Wgórę""Wpraw""Wlewo")
#define LEN_VRENCODERS "\003"
#define TR_VRENCODERS "REa""REb"
@@ -383,7 +383,7 @@
#define TR_ENTER "[MENU]"
#endif
-#define TR_POPUPS TR_ENTER"\010[EXIT]"
+#define TR_POPUPS TR_ENTER"\010[WYJŚCIE]"
#define OFS_EXIT sizeof(TR_ENTER)
#define TR_MENUWHENDONE CENTER "\007"TR_ENTER" > DALEJ"
@@ -396,9 +396,9 @@
#define TR_MODELNAME "Nazwa modelu"
#define TR_PHASENAME "Nazwa"
#define TR_MIXNAME "Nazwa"
-#define TR_INPUTNAME "Input Name"
+#define TR_INPUTNAME "Wpisz Nazw"
#if defined(PCBTARANIS)
- #define TR_EXPONAME "Line Name"
+ #define TR_EXPONAME "Linia Nazw"
#else
#define TR_EXPONAME "Nazwa"
#endif
@@ -411,21 +411,21 @@
#define TR_TTRIM TR("Trymer gazu", "Trymer gazu")
#define TR_BEEPCTR "(\043)Pikanie środka"
#define TR_PROTO INDENT"Protokól"
-#define TR_PPMFRAME "PPM frame"
+#define TR_PPMFRAME "Ramka PPM"
#define TR_MS "ms"
#define TR_SWITCH "Przełącznik"
#define TR_TRIMS "Trymery"
#define TR_FADEIN "Pojawianie"
#define TR_FADEOUT "Zanikanie"
#define TR_DEFAULT "(Bazowa)"
-#define TR_CHECKTRIMS "\006Sprawdź \012 Trymery"
+#define TR_CHECKTRIMS "\006Spr \012 Trymery"
#define OFS_CHECKTRIMS (9*FW)
#define TR_SWASHTYPE "Typ tarczy"
#define TR_COLLECTIVE "Kolektyw"
#define TR_SWASHRING "Tarcza"
#define TR_ELEDIRECTION "Ster Wysokości"
#define TR_AILDIRECTION "\012Lotki"
-#define TR_COLDIRECTION "\012Kolektwy"
+#define TR_COLDIRECTION "\012Kolektyw"
#define TR_MODE INDENT"Tryb"
#define TR_NOFREEEXPO "Brak wolnych expo!"
#define TR_NOFREEMIXER "Brak wolnych mix!"
@@ -516,7 +516,7 @@
#define TR_MENUTORESET CENTER TR_ENTER" >> Reset"
#define TR_PPM "PPM"
-#define TR_CH "Kn"
+#define TR_CH "KN"
#define TR_MODEL "MODEL"
#define TR_FP "FL"
#define TR_MIX "MIX"
@@ -556,8 +556,8 @@
#define TR_MENUCURVES "KRZYWE"
#define TR_MENUCURVE "KRZYWA"
-#define TR_MENUCUSTOMSWITCH "PRZEŁĄCZNIK LOGICZNY"
-#define TR_MENUCUSTOMSWITCHES "Przełączniki logiczne"
+#define TR_MENUCUSTOMSWITCH "PRZEŁ. LOGICZNY"
+#define TR_MENUCUSTOMSWITCHES TR("PRZEŁ. LOG.", "PRZEŁ. LOGICZNE")
#define TR_MENUCUSTOMFUNC "FUNKCJE SPECJALNE"
#define TR_MENUTELEMETRY "TELEMETRIA"
#define TR_MENUTEMPLATES "SZABLONY"
@@ -635,7 +635,7 @@
#define TR_GLOBAL_VARS "Zmienne globalne"
#define TR_GLOBAL_VAR "Zmienna globalna"
#define TR_MENUGLOBALVARS "ZMIENNE GLOBALNE"
-#define TR_OWN " Własność "
+#define TR_OWN "Własność"
#define TR_DATE "Data"
#define TR_ROTARY_ENCODER "R.Encs"
#define TR_CHANNELS_MONITOR "MONITOR KANAŁÓW"
@@ -666,28 +666,28 @@
#define TR_BUZZER INDENT"Brzęczyk"
#define TR_BYTES "[B]"
#define TR_MODULE_BIND "[Bind]"
-#define TR_MODULE_RANGE "[Zasieg]"
+#define TR_MODULE_RANGE "Zasięg"
#define TR_RESET_BTN "[Reset]"
#define TR_SET "[Ustaw]"
#define TR_TRAINER "Trener"
#define TR_ANTENNAPROBLEM CENTER "Problem z anteną TX"
-#define TR_MODELIDUSED TR("ID już użyte","ID modelu już użyte")
+#define TR_MODELIDUSED TR("ID zajęte","ID modelu zajęte")
#define TR_MODULE INDENT "Moduł"
#define TR_CHANNELRANGE INDENT "Zakres kanału"
#define TR_LOWALARM INDENT "Alarm niski"
#define TR_CRITICALALARM INDENT "Alarm krytyczny"
-#define TR_PERSISTENT_MAH INDENT "Store mAh"
+#define TR_PERSISTENT_MAH INDENT "Zapisz mAh"
#define TR_FAS_OFFSET TR(INDENT "FAS Ofs", INDENT "FAS Offset")
-#define TR_UART3MODE "Serial port"
+#define TR_UART3MODE "Port szreg."
#if defined(MAVLINK)
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
#define TR_MAVLINK_PC_RSSI_EN_LABEL "PC RSSI EN"
#define TR_MAVMENUSETUP_TITLE "Mavlink Setup"
#define TR_MAVLINK_BAUD_LABEL "Baudrate"
- #define TR_MAVLINK_INFOS "INFOS"
- #define TR_MAVLINK_MODE "MODE"
- #define TR_MAVLINK_CUR_MODE "Current Mode"
+ #define TR_MAVLINK_INFOS "INFO"
+ #define TR_MAVLINK_MODE "TRYB"
+ #define TR_MAVLINK_CUR_MODE "Aktualy Tryb"
#define TR_MAVLINK_ARMED "Armed"
#define TR_MAVLINK_BAT_MENU_TITLE "BAT RSSI"
#define TR_MAVLINK_BATTERY_LABEL "Status baterii "
@@ -702,8 +702,8 @@
#define TR_MAVLINK_NO_FIX "NO Fix"
#define TR_MAVLINK_SAT "SAT"
#define TR_MAVLINK_HDOP "HDOP"
- #define TR_MAVLINK_LAT "LAT"
- #define TR_MAVLINK_LON "LON"
+ #define TR_MAVLINK_LAT "SZER"
+ #define TR_MAVLINK_LON "DLUG"
#endif
// Taranis column headers
@@ -721,8 +721,8 @@
#define TR_ABOUT_OPENTX_5 TR("is welcome!", "donations is welcome!")
#define TR_ABOUT_BERTRAND_1 "Bertrand Songis"
-#define TR_ABOUT_BERTRAND_2 "OpenTX main author"
-#define TR_ABOUT_BERTRAND_3 "Companion9x co-author"
+#define TR_ABOUT_BERTRAND_2 "OpenTX główny autor"
+#define TR_ABOUT_BERTRAND_3 "Companion9x współ-autor"
#define TR_ABOUT_MIKE_1 "Mike Blandford"
#define TR_ABOUT_MIKE_2 "Guru kodu i driwerów"
@@ -730,12 +730,12 @@
#define TR_ABOUT_MIKE_4 "Inspirational"
#define TR_ABOUT_ROMOLO_1 "Romolo Manfredini"
-#define TR_ABOUT_ROMOLO_2 "Companion9x co-author"
+#define TR_ABOUT_ROMOLO_2 "Companion9x współ-autor"
#define TR_ABOUT_ROMOLO_3 ""
#define TR_ABOUT_ANDRE_1 "Andre Bernet"
-#define TR_ABOUT_ANDRE_2 "Functionality, usability,"
-#define TR_ABOUT_ANDRE_3 "debugging, documentation"
+#define TR_ABOUT_ANDRE_2 "Funkcjonalność, użytkowość,"
+#define TR_ABOUT_ANDRE_3 "debugging, documentacja"
#define TR_ABOUT_ROB_1 "Rob Thomson"
#define TR_ABOUT_ROB_2 "openrcforums webmaster"