Compare commits
206 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 99fedb081e | |||
| cc934c3ac0 | |||
| c1d789d004 | |||
| 4d945b5d95 | |||
| 28c900e3f7 | |||
| b41ba50b53 | |||
| 2d22c18758 | |||
| 8ce05b3284 | |||
| 6d18820b53 | |||
| 58ed329ac2 | |||
| 2e0858bc0c | |||
| 7c9636c58c | |||
| 9dbd1326da | |||
| 4c82d12c1a | |||
| 972685bc15 | |||
| 00f8b97ee4 | |||
| 0b7bbbbdbd | |||
| 47bc3e896c | |||
| 904249b2dc | |||
| 3700047d2c | |||
| d44e851648 | |||
| 1be75735be | |||
| 7da72240a3 | |||
| 9357c951f1 | |||
| 1afeb9f977 | |||
| 000e55725c | |||
| 38e342b27b | |||
| 3e9064e2e2 | |||
| 2d764e73fd | |||
| f8efcf420a | |||
| cf546a2341 | |||
| 87a4f3526b | |||
| 6b49119af7 | |||
| 4c6314331d | |||
| 55ab067a0c | |||
| 3fc18b1cf7 | |||
| f2f8419da1 | |||
| 365c2f9e34 | |||
| 01fde3db27 | |||
| d743ed9645 | |||
| dd67811638 | |||
| ebe4f6a365 | |||
| b4e816b784 | |||
| 2798fa7ba9 | |||
| ee077a06e6 | |||
| 8f73e9bde0 | |||
| 45d8fca125 | |||
| 2bc6c1e754 | |||
| 39a0feae3b | |||
| ad7da779c7 | |||
| 23cafa84f2 | |||
| a20e5aee3b | |||
| fa3c50df8e | |||
| 81eb9326eb | |||
| 7c71d56383 | |||
| 5109a2d7c1 | |||
| 82cc799afe | |||
| 88bb28e3f1 | |||
| f4fdc233c0 | |||
| 7130e48089 | |||
| ed094f89e8 | |||
| 58f81b193b | |||
| 50122d4ee1 | |||
| f66388c1d3 | |||
| 838190ce80 | |||
| 1bc04db9cd | |||
| 30a68cf170 | |||
| ec8c207631 | |||
| 9337080307 | |||
| 8200164797 | |||
| 7d85d40f68 | |||
| 5d23135b0d | |||
| be6f1587ed | |||
| c184ddd996 | |||
| c903bbcb13 | |||
| 9b008ded21 | |||
| 6f79de6cae | |||
| 711b54c98e | |||
| 6876718d72 | |||
| 4ffb9f69c6 | |||
| b8a6548686 | |||
| 8c010277c9 | |||
| f30e3db1ef | |||
| d675ab1578 | |||
| b6cbde48be | |||
| 1fef79ce80 | |||
| 4f03ae75c5 | |||
| 34850fb73d | |||
| ee05f7f80e | |||
| 83614359aa | |||
| 17a2865070 | |||
| e3866fda45 | |||
| 81ed325830 | |||
| 36e78b9315 | |||
| 6716482ae4 | |||
| 7e758ce7ad | |||
| 63fe996ebc | |||
| 038365e639 | |||
| c3aebfa239 | |||
| e6370ebb2a | |||
| 1e25e368d2 | |||
| 645350a1a2 | |||
| dd927e6761 | |||
| 713b2e2cf5 | |||
| 7a02e57dcf | |||
| 724949b8fc | |||
| 1f5295db9c | |||
| 72ef865c10 | |||
| be0ebe833c | |||
| 57b08fb064 | |||
| 7162ab5399 | |||
| 4eb44837f3 | |||
| 194a635800 | |||
| e4314004a8 | |||
| 74534b74c2 | |||
| 59eb020eb1 | |||
| 1d1a815ef7 | |||
| 4088abaafb | |||
| 9333f3778f | |||
| 070a133cd5 | |||
| 74f4f99280 | |||
| 66848156a8 | |||
| 74dfd64e29 | |||
| ef0b81cd2d | |||
| 09842fe531 | |||
| 3c93699f8f | |||
| a9dd0d0dfb | |||
| 013e6925dc | |||
| 591ccfd25f | |||
| b0bdaf6b65 | |||
| f77e6370cf | |||
| ce70efa31d | |||
| 3a7fe01950 | |||
| 3f39352d95 | |||
| d38c02f847 | |||
| 2dddd76320 | |||
| 391e6a867f | |||
| 1df8b5f5c1 | |||
| 6913c8e7e5 | |||
| aab03a2b9f | |||
| a83c6c8a0c | |||
| b5cdd60367 | |||
| 5453ff5678 | |||
| 7b69fb2f79 | |||
| 19ac5d3038 | |||
| 4b64862cf2 | |||
| f643f0be85 | |||
| 0e0b1792e4 | |||
| f81c31510b | |||
| 5c3bd1faf9 | |||
| 90cf98465b | |||
| 1dd47484d4 | |||
| bd4a85c6a7 | |||
| b6520e2db6 | |||
| 0ea114b219 | |||
| e36f54eda5 | |||
| d983404656 | |||
| 677b50d39c | |||
| e5ae504bae | |||
| ce302aae60 | |||
| b0869fccfc | |||
| 17ab12f7bf | |||
| 816f9ce8a0 | |||
| 5fb41eb32f | |||
| c687e20fff | |||
| c5aa691467 | |||
| a3d7c694ef | |||
| 2c8b51c9d6 | |||
| a518a34055 | |||
| 4d3ca7e82e | |||
| 98c756a6d2 | |||
| 84d5c6c4b0 | |||
| 935458caa4 | |||
| dcec97411e | |||
| 91032483c8 | |||
| 9e40708f7c | |||
| 54902a5a00 | |||
| 927a9b9f38 | |||
| bfdb3a9da7 | |||
| 63269ac35a | |||
| 113deb6b75 | |||
| c48f4a51a6 | |||
| 3cd2f709fc | |||
| d2df4af67d | |||
| 67177aed42 | |||
| 5879ca2fb6 | |||
| 77a7f13507 | |||
| 2a794e2ae3 | |||
| 090f659dca | |||
| ca79fabdc7 | |||
| 693f232f01 | |||
| 8c33914cbb | |||
| a8e594e54c | |||
| 17f7d90dbf | |||
| 7ad3d5d317 | |||
| 3d37b0d397 | |||
| e8fc7c4c89 | |||
| 405fd802d5 | |||
| 5d1e9a1701 | |||
| d09b85ddc4 | |||
| a4aa0eb7c8 | |||
| d105325dd7 | |||
| 1fb9e57c62 | |||
| 576d9d6d9d | |||
| b7f3d1674d | |||
| f7b009a9be |
@@ -493,3 +493,28 @@ Heinrich Illig
|
||||
Portstate Pty Ltd
|
||||
Jens Hoffmann
|
||||
Ricardo Santos
|
||||
Jean-Francois Le Breton
|
||||
Michael Deasy
|
||||
Anindya Mukerjee
|
||||
Emay Toha
|
||||
Kamco Enterprises
|
||||
Peter Mueller
|
||||
Giovanni Trentini
|
||||
Cecil Porter
|
||||
Robert Canavan
|
||||
Greg Higginbottom
|
||||
Tim Walker
|
||||
Thos. O'Meara Photography
|
||||
Spis Ltd/TurboNote
|
||||
Patricia Cox
|
||||
Matthew Lukes
|
||||
Sabine Witte
|
||||
Phillip Perry
|
||||
Beat Zurflueh
|
||||
Russell Stutzman
|
||||
Dietmar Drees
|
||||
Kenneth Ward
|
||||
Jens Lochmüller
|
||||
Anthony Witham
|
||||
Peter Hauke
|
||||
Arizona Action Photos
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
<h2>Version 2.0.6</h2>
|
||||
<ul>
|
||||
<li>Fix Mix curves bug on Sky9x boards</li>
|
||||
<li>Channels 17-32 are displayed in the simulator</li>
|
||||
<li>Backlight simulation bugfix</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.5</h2>
|
||||
<ul>
|
||||
<li>Fix crash on startup</li>
|
||||
<li>Fix version number in simu</li>
|
||||
<li>9XR-Pro now supported on Mac</li>
|
||||
<li>Fix loss of settings in telemetry custom screens</li>
|
||||
<li>Fix 10000% bug when using GVs in mixer weithg or offset</li>
|
||||
<li>Fix Cnsp range in logical switches (up to 30000mAh)</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.4</h2>
|
||||
<ul>
|
||||
<li>Sound should be ok on all platforms</li>
|
||||
|
||||
@@ -2,7 +2,7 @@ PROJECT( companion )
|
||||
|
||||
SET( C9X_VERSION_MAJOR "2" )
|
||||
SET( C9X_VERSION_MINOR "0" )
|
||||
SET( C9X_VERSION_REVISION "4" )
|
||||
SET( C9X_VERSION_REVISION "6" )
|
||||
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
||||
|
||||
@@ -95,6 +95,9 @@ int main(int argc, char *argv[])
|
||||
app.installTranslator(&qtTranslator);
|
||||
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
RegisterEepromInterfaces();
|
||||
registerOpenTxFirmwares();
|
||||
|
||||
if (g.profile[g.id()].fwType().isEmpty()){
|
||||
g.profile[g.id()].fwType(default_firmware_variant->getId());
|
||||
@@ -110,9 +113,6 @@ int main(int argc, char *argv[])
|
||||
QPixmap pixmap = QPixmap(splashScreen);
|
||||
QSplashScreen *splash = new QSplashScreen(pixmap);
|
||||
|
||||
RegisterEepromInterfaces();
|
||||
registerOpenTxFirmwares();
|
||||
|
||||
current_firmware_variant = GetFirmware(g.profile[g.id()].fwType());
|
||||
|
||||
MainWindow *mainWin = new MainWindow();
|
||||
|
||||
@@ -256,8 +256,8 @@ void CompareDialog::printSetup()
|
||||
str.append(fv(tr("Timer2"), getTimerStr(g_model1->timers[1]), color)); //value, mode, count up/down
|
||||
color=getColor1(getProtocol(g_model1),getProtocol(g_model2));
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model1), color)); //proto, numch, delay,
|
||||
color=getColor1(g_model1->moduleData[0].ppmPulsePol,g_model2->moduleData[0].ppmPulsePol);
|
||||
str.append(fv(tr("Pulse Polarity"), g_model1->moduleData[0].ppmPulsePol ? "NEG" : "POS", color));
|
||||
color=getColor1(g_model1->moduleData[0].ppmPulsePol, g_model2->moduleData[0].ppmPulsePol);
|
||||
str.append(fv(tr("Pulse Polarity"), g_model1->moduleData[0].polarityToString(), color));
|
||||
color=getColor1(g_model1->thrTrim,g_model2->thrTrim);
|
||||
str.append(fv(tr("Throttle Trim"), g_model1->thrTrim ? tr("Enabled") : tr("Disabled"), color));
|
||||
color=getColor1(g_model1->thrExpo,g_model2->thrExpo);
|
||||
@@ -279,8 +279,8 @@ void CompareDialog::printSetup()
|
||||
str.append(fv(tr("Timer2"), getTimerStr(g_model2->timers[1]),color)); //value, mode, count up/down
|
||||
color=getColor2(getProtocol(g_model1),getProtocol(g_model2));
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model2), color)); //proto, numch, delay,
|
||||
color=getColor2(g_model1->moduleData[0].ppmPulsePol,g_model2->moduleData[0].ppmPulsePol);
|
||||
str.append(fv(tr("Pulse Polarity"), g_model2->moduleData[0].ppmPulsePol ? "NEG" : "POS", color));
|
||||
color=getColor2(g_model1->moduleData[0].ppmPulsePol, g_model2->moduleData[0].ppmPulsePol);
|
||||
str.append(fv(tr("Pulse Polarity"), g_model2->moduleData[0].polarityToString(), color));
|
||||
color=getColor2(g_model1->thrTrim,g_model2->thrTrim);
|
||||
str.append(fv(tr("Throttle Trim"), g_model2->thrTrim ? tr("Enabled") : tr("Disabled"), color));
|
||||
color=getColor2(g_model1->thrExpo,g_model2->thrExpo);
|
||||
|
||||
@@ -186,6 +186,20 @@ RawSourceRange RawSource::getRange(const ModelData & model, const GeneralSetting
|
||||
break;
|
||||
case TELEMETRY_SOURCE_ASPEED:
|
||||
case TELEMETRY_SOURCE_ASPEED_MAX:
|
||||
result.decimals = 1;
|
||||
result.step = singleprec ? 2.0 : 0.1;
|
||||
result.max = singleprec ? (2*255) : 2000;
|
||||
if (firmware->getCapability(Imperial) || settings.imperial) {
|
||||
result.step *= 1.150779;
|
||||
result.max *= 1.150779;
|
||||
result.unit = QObject::tr("mph");
|
||||
}
|
||||
else {
|
||||
result.step *= 1.852;
|
||||
result.max *= 1.852;
|
||||
result.unit = QObject::tr("km/h");
|
||||
}
|
||||
break;
|
||||
case TELEMETRY_SOURCE_SPEED:
|
||||
case TELEMETRY_SOURCE_SPEED_MAX:
|
||||
result.step = singleprec ? 2 : 1;
|
||||
@@ -242,7 +256,7 @@ RawSourceRange RawSource::getRange(const ModelData & model, const GeneralSetting
|
||||
break;
|
||||
case TELEMETRY_SOURCE_CONSUMPTION:
|
||||
result.step = singleprec ? 100 : 1;
|
||||
result.max = singleprec ? 25500 : 10000;
|
||||
result.max = singleprec ? 25500 : 30000;
|
||||
result.unit = QObject::tr("mAh");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_POWER:
|
||||
@@ -698,92 +712,13 @@ QString LogicalSwitchData::toString(const ModelData & model, const GeneralSettin
|
||||
return result;
|
||||
}
|
||||
|
||||
#if 0
|
||||
QStringList FuncSwData::toStringList()
|
||||
void FuncSwData::clear()
|
||||
{
|
||||
QStringList result;
|
||||
QStringList qs;
|
||||
|
||||
result << swtch.toString();
|
||||
result << funcToString();
|
||||
|
||||
if (func < FuncInstantTrim) {
|
||||
result << QString("%1").arg(param);
|
||||
memset(this, 0, sizeof(FuncSwData));
|
||||
if (!GetCurrentFirmware()->getCapability(SafetyChannelCustomFunction)) {
|
||||
func = FuncTrainer;
|
||||
}
|
||||
else if (func==FuncPlaySound) {
|
||||
qs <<"Beep 1" << "Beep 2" << "Beep 3" << "Warn1" << "Warn2" << "Cheep" << "Ratata" << "Tick" << "Siren" << "Ring" ;
|
||||
qs << "SciFi" << "Robot" << "Chirp" << "Tada" << "Crickt" << "AlmClk" ;
|
||||
if (param>=0 && param<(int)qs.count())
|
||||
result << qs.at(param);
|
||||
else
|
||||
result << QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
|
||||
}
|
||||
else if (func==FuncPlayHaptic) {
|
||||
qs << "0" << "1" << "2" << "3";
|
||||
if (param>=0 && param<(int)qs.count())
|
||||
result << qs.at(param);
|
||||
else
|
||||
result << QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
|
||||
}
|
||||
else if (func==FuncReset) {
|
||||
qs.append( QObject::tr("Timer1"));
|
||||
qs.append( QObject::tr("Timer2"));
|
||||
qs.append( QObject::tr("All"));
|
||||
qs.append( QObject::tr("Telemetry"));
|
||||
if (param>=0 && param<(int)qs.count())
|
||||
result << qs.at(param);
|
||||
else
|
||||
result << QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
|
||||
}
|
||||
else if ((func==FuncVolume)|| (func==FuncPlayValue)) {
|
||||
RawSource item(param);
|
||||
result << item.toString();
|
||||
}
|
||||
else if ((func==FuncPlayPrompt) || (func==FuncPlayBoth)) {
|
||||
if ( GetCurrentFirmware()->getCapability(VoicesAsNumbers)) {
|
||||
result << QString("%1").arg(param);
|
||||
} else {
|
||||
result << paramarm;
|
||||
}
|
||||
}
|
||||
else if ((func>FuncBackgroundMusicPause) && (func<FuncCount)) {
|
||||
switch (adjustMode) {
|
||||
case 0:
|
||||
result << QObject::tr("Value ")+QString("%1").arg(param);
|
||||
break;
|
||||
case 1:
|
||||
result << RawSource(param).toString();
|
||||
break;
|
||||
case 2:
|
||||
result << RawSource(param).toString();
|
||||
break;
|
||||
case 3:
|
||||
if (param==0) {
|
||||
result << QObject::tr("Decr:")+QString(" -1");
|
||||
}
|
||||
else {
|
||||
result << QObject::tr("Incr:")+QString(" +1");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (func==FuncPlaySound || func==FuncPlayHaptic || func==FuncPlayValue || func==FuncPlayPrompt || func==FuncPlayBoth || func==FuncBackgroundMusic) {
|
||||
str.append(doTC(QString("%1").arg(g_model->funcSw[i].repeatParam),"green"));
|
||||
} else {
|
||||
str.append(doTC( " ","green"));
|
||||
}
|
||||
if ((index<=FuncInstantTrim) || (index>FuncBackgroundMusicPause)) {
|
||||
str.append(doTC((g_model->funcSw[i].enabled ? "ON" : "OFF"),"green"));
|
||||
} else {
|
||||
str.append(doTC( "---","green"));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
QString FuncSwData::funcToString()
|
||||
{
|
||||
@@ -1201,6 +1136,8 @@ void ModelData::clear()
|
||||
expoData[i].clear();
|
||||
for (int i=0; i<C9X_NUM_CSW; i++)
|
||||
customSw[i].clear();
|
||||
for (int i=0; i<C9X_MAX_CUSTOM_FUNCTIONS; i++)
|
||||
funcSw[i].clear();
|
||||
for (int i=0; i<C9X_MAX_CURVES; i++)
|
||||
curves[i].clear(5);
|
||||
for (int i=0; i<2; i++)
|
||||
|
||||
@@ -760,7 +760,7 @@ class FuncSwData { // Function Switches data
|
||||
unsigned int enabled; // TODO perhaps not any more the right name
|
||||
unsigned int adjustMode;
|
||||
int repeatParam;
|
||||
void clear() { memset(this, 0, sizeof(FuncSwData)); }
|
||||
void clear();
|
||||
QString funcToString();
|
||||
QString paramToString();
|
||||
QString repeatToString();
|
||||
@@ -918,7 +918,7 @@ class TimerData {
|
||||
unsigned int countdownBeep;
|
||||
bool dir; // 0=>Count Down, 1=>Count Up
|
||||
unsigned int val;
|
||||
bool persistent;
|
||||
unsigned int persistent;
|
||||
int pvalue;
|
||||
void clear() { memset(this, 0, sizeof(TimerData)); mode = RawSwitch(SWITCH_TYPE_TIMER_MODE, 0); }
|
||||
};
|
||||
@@ -954,6 +954,7 @@ class ModuleData {
|
||||
bool ppmPulsePol; // false = positive
|
||||
int ppmFrameLength;
|
||||
void clear() { memset(this, 0, sizeof(ModuleData)); }
|
||||
QString polarityToString() { return ppmPulsePol ? QObject::tr("Positive") : QObject::tr("Negative"); }
|
||||
};
|
||||
|
||||
#define C9X_MAX_SCRIPTS 7
|
||||
@@ -1063,6 +1064,7 @@ enum Capability {
|
||||
Timers,
|
||||
TimeDivisions,
|
||||
CustomFunctions,
|
||||
SafetyChannelCustomFunction,
|
||||
VoicesAsNumbers,
|
||||
VoicesMaxLength,
|
||||
ModelVoice,
|
||||
|
||||
@@ -76,9 +76,10 @@ namespace Open9xGruvin9x {
|
||||
#include "radio/src/gui/view_main.cpp"
|
||||
#include "radio/src/gui/view_statistics.cpp"
|
||||
#include "radio/src/gui/view_telemetry.cpp"
|
||||
#include "radio/src/lcd.cpp"
|
||||
#include "radio/src/lcd_common.cpp"
|
||||
#include "radio/src/lcd_default.cpp"
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/simpgmspace.cpp"
|
||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
|
||||
@@ -77,9 +77,10 @@ namespace OpenTxM128 {
|
||||
#include "radio/src/gui/view_main.cpp"
|
||||
#include "radio/src/gui/view_statistics.cpp"
|
||||
#include "radio/src/gui/view_telemetry.cpp"
|
||||
#include "radio/src/lcd.cpp"
|
||||
#include "radio/src/lcd_common.cpp"
|
||||
#include "radio/src/lcd_default.cpp"
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/simpgmspace.cpp"
|
||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
|
||||
@@ -81,9 +81,10 @@ namespace OpenTxM64 {
|
||||
#include "radio/src/gui/view_main.cpp"
|
||||
#include "radio/src/gui/view_statistics.cpp"
|
||||
#include "radio/src/gui/view_telemetry.cpp"
|
||||
#include "radio/src/lcd.cpp"
|
||||
#include "radio/src/lcd_common.cpp"
|
||||
#include "radio/src/lcd_default.cpp"
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/simpgmspace.cpp"
|
||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#include "radio/src/telemetry/frsky_d.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
|
||||
@@ -92,11 +92,12 @@ namespace Open9xSky9x {
|
||||
#include "radio/src/gui/view_telemetry.cpp"
|
||||
#include "radio/src/gui/view_about.cpp"
|
||||
#include "radio/src/gui/view_text.cpp"
|
||||
#include "radio/src/lcd.cpp"
|
||||
#include "radio/src/lcd_common.cpp"
|
||||
#include "radio/src/lcd_default.cpp"
|
||||
#include "radio/src/logs.cpp"
|
||||
#include "radio/src/targets/sky9x/keys_driver.cpp"
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/simpgmspace.cpp"
|
||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
|
||||
@@ -99,7 +99,8 @@ inline int geteepromsize() {
|
||||
#include "radio/src/gui/view_telemetry.cpp"
|
||||
#include "radio/src/gui/view_text.cpp"
|
||||
#include "radio/src/gui/view_about.cpp"
|
||||
#include "radio/src/lcd.cpp"
|
||||
#include "radio/src/lcd_common.cpp"
|
||||
#include "radio/src/lcd_taranis.cpp"
|
||||
#include "radio/src/logs.cpp"
|
||||
#include "radio/src/rtc.cpp"
|
||||
#include "radio/src/targets/taranis/keys_driver.cpp"
|
||||
@@ -109,7 +110,7 @@ inline int geteepromsize() {
|
||||
#include "radio/src/targets/taranis/haptic_driver.cpp"
|
||||
// TODO Because FatFS in not C++ there cannot be namespaces there and the functions are defined several times!
|
||||
#undef SDCARD
|
||||
#include "radio/src/simpgmspace.cpp"
|
||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||
#define SDCARD
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#define MAX_MIXERS(board, version) (IS_ARM(board) ? 64 : 32)
|
||||
#define MAX_CHANNELS(board, version) (IS_ARM(board) ? 32 : 16)
|
||||
#define MAX_EXPOS(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 64 : 32) : (IS_DBLRAM(board, version) ? 16 : 14))
|
||||
#define MAX_CUSTOM_SWITCHES(board, version) (IS_ARM(board) ? 32 : (IS_DBLEEPROM(board, version) ? 15 : 12))
|
||||
#define MAX_CUSTOM_SWITCHES(board, version) (IS_ARM(board) ? 32 : ((IS_DBLEEPROM(board, version) && version<217) ? 15 : 12))
|
||||
#define MAX_CUSTOM_FUNCTIONS(board, version) (IS_ARM(board) ? (version >= 216 ? 64 : 32) : (IS_DBLEEPROM(board, version) ? 24 : 16))
|
||||
#define MAX_CURVES(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 32 : 16) : O9X_MAX_CURVES)
|
||||
#define MAX_GVARS(board, version) ((IS_ARM(board) && version >= 216) ? 9 : 5)
|
||||
@@ -867,8 +867,8 @@ class MixField: public TransformedField {
|
||||
internalField.Append(new SpareBitsField<8>());
|
||||
}
|
||||
else if (IS_ARM(board) && version >= 216) {
|
||||
internalField.Append(new UnsignedField<4>(_destCh));
|
||||
internalField.Append(new UnsignedField<4>(mix.mixWarn));
|
||||
internalField.Append(new UnsignedField<5>(_destCh));
|
||||
internalField.Append(new UnsignedField<3>(mix.mixWarn));
|
||||
internalField.Append(new UnsignedField<16>(mix.phases));
|
||||
internalField.Append(new BoolField<1>(_curveMode));
|
||||
internalField.Append(new BoolField<1>(mix.noExpo));
|
||||
@@ -1016,7 +1016,7 @@ class MixField: public TransformedField {
|
||||
|
||||
if (mix.srcRaw.type != SOURCE_TYPE_NONE) {
|
||||
mix.destCh = _destCh + 1;
|
||||
if (!IS_ARM(board) || version < 216) {
|
||||
if (!IS_TARANIS(board) || version < 216) {
|
||||
if (!_curveMode)
|
||||
mix.curve = CurveReference(CurveReference::CURVE_REF_DIFF, smallGvarToC9x(_curveParam));
|
||||
else if (_curveParam > 6)
|
||||
@@ -2061,6 +2061,10 @@ class AvrCustomFunctionField: public TransformedField {
|
||||
if (version >= 216) {
|
||||
fn.func = AssignFunc(fn.func + (_union_param >> 2));
|
||||
fn.adjustMode = (_union_param & 0x03);
|
||||
if (fn.adjustMode == 1)
|
||||
sourcesConversionTable->importValue(_param, (int &)fn.param);
|
||||
else if (fn.adjustMode == 2)
|
||||
fn.param = RawSource(SOURCE_TYPE_GVAR, _param).toValue();
|
||||
}
|
||||
else if (version >= 213) {
|
||||
fn.adjustMode = ((_active >> 1) & 0x03);
|
||||
@@ -2395,8 +2399,8 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
internalField.Append(new UnsignedField<16>(modelData.timers[i].val));
|
||||
internalField.Append(new UnsignedField<2>(modelData.timers[i].countdownBeep));
|
||||
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
|
||||
internalField.Append(new BoolField<1>(modelData.timers[i].persistent));
|
||||
internalField.Append(new SpareBitsField<4>());
|
||||
internalField.Append(new UnsignedField<2>(modelData.timers[i].persistent));
|
||||
internalField.Append(new SpareBitsField<3>());
|
||||
internalField.Append(new SignedField<16>(modelData.timers[i].pvalue));
|
||||
}
|
||||
else if (afterrelease21March2013) {
|
||||
@@ -2404,7 +2408,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
internalField.Append(new BoolField<1>((bool &)modelData.timers[i].countdownBeep));
|
||||
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
|
||||
if (HAS_PERSISTENT_TIMERS(board)) {
|
||||
internalField.Append(new BoolField<1>(modelData.timers[i].persistent));
|
||||
internalField.Append(new UnsignedField<1>(modelData.timers[i].persistent));
|
||||
internalField.Append(new SpareBitsField<1>());
|
||||
internalField.Append(new SignedField<16>(modelData.timers[i].pvalue));
|
||||
}
|
||||
@@ -2415,7 +2419,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
else {
|
||||
internalField.Append(new UnsignedField<16>(modelData.timers[i].val));
|
||||
if (HAS_PERSISTENT_TIMERS(board)) {
|
||||
internalField.Append(new BoolField<1>(modelData.timers[i].persistent));
|
||||
internalField.Append(new UnsignedField<1>(modelData.timers[i].persistent));
|
||||
internalField.Append(new SpareBitsField<15>());
|
||||
}
|
||||
}
|
||||
@@ -2800,10 +2804,12 @@ void OpenTxGeneralData::beforeExport()
|
||||
sum += generalData.calibSpanPos[i];
|
||||
if (++count == 12) break;
|
||||
}
|
||||
for (int i=0; i<4; i++) {
|
||||
potsType[i] = generalData.potsType[i];
|
||||
if (i<2 && potsType[i] == 1)
|
||||
potsType[i] = 0;
|
||||
if (IS_TARANIS(board)) {
|
||||
for (int i=0; i<4; i++) {
|
||||
potsType[i] = generalData.potsType[i];
|
||||
if (i<2 && potsType[i] == 1)
|
||||
potsType[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -2817,9 +2823,11 @@ void OpenTxGeneralData::beforeExport()
|
||||
|
||||
void OpenTxGeneralData::afterImport()
|
||||
{
|
||||
for (int i=0; i<4; i++) {
|
||||
generalData.potsType[i] = potsType[i];
|
||||
if (i<2 && potsType[i] == 0)
|
||||
generalData.potsType[i] = 1;
|
||||
if (IS_TARANIS(board)) {
|
||||
for (int i=0; i<4; i++) {
|
||||
generalData.potsType[i] = potsType[i];
|
||||
if (i<2 && potsType[i] == 0)
|
||||
generalData.potsType[i] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -369,10 +369,10 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
|
||||
break;
|
||||
case BOARD_GRUVIN9X:
|
||||
case BOARD_MEGA2560:
|
||||
version = 216;
|
||||
version = 217;
|
||||
break;
|
||||
case BOARD_M128:
|
||||
version = 216;
|
||||
version = 217;
|
||||
break;
|
||||
case BOARD_STOCK:
|
||||
version = 216;
|
||||
@@ -556,11 +556,11 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
return 24;
|
||||
else
|
||||
return 16;
|
||||
case SafetyChannelCustomFunction:
|
||||
return id.contains("nosafetych") ? 0 : 1;
|
||||
case LogicalSwitches:
|
||||
if (IS_ARM(board))
|
||||
return 32;
|
||||
else if (board==BOARD_GRUVIN9X||board==BOARD_M128)
|
||||
return 15;
|
||||
else
|
||||
return 12;
|
||||
case CustomAndSwitches:
|
||||
@@ -621,7 +621,10 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
case HasCvNames:
|
||||
return (IS_TARANIS(board) ? 1 : 0);
|
||||
case Telemetry:
|
||||
return TM_HASTELEMETRY|TM_HASOFFSET|TM_HASWSHH;
|
||||
if (board == BOARD_GRUVIN9X || IS_ARM(board) || id.contains("frsky"))
|
||||
return TM_HASTELEMETRY|TM_HASOFFSET|TM_HASWSHH;
|
||||
else
|
||||
return 0;
|
||||
case TelemetryBars:
|
||||
return 1;
|
||||
case TelemetryCustomScreens:
|
||||
@@ -871,6 +874,9 @@ bool OpenTxEepromInterface::checkVersion(unsigned int version)
|
||||
case 216:
|
||||
// A lot of things (first github release)
|
||||
break;
|
||||
case 217:
|
||||
// 3 logical switches removed on M128 / gruvin9x boards
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -997,6 +1003,15 @@ SimulatorInterface * OpenTxFirmware::getSimulator()
|
||||
}
|
||||
}
|
||||
|
||||
void addOpenTxCommonOptions(OpenTxFirmware * firmware)
|
||||
{
|
||||
firmware->addOption("ppmus", QObject::tr("Channel values displayed in us"));
|
||||
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
|
||||
firmware->addOption("nosafetych", QObject::tr("No SafetyCH functions available"));
|
||||
Option fai_options[] = { { "faichoice", QObject::tr("Possibility to enable FAI MODE at field") }, { "faimode", QObject::tr("FAI MODE always enabled") }, { NULL } };
|
||||
firmware->addOptions(fai_options);
|
||||
}
|
||||
|
||||
void registerOpenTxFirmwares()
|
||||
{
|
||||
OpenTxFirmware * openTx;
|
||||
@@ -1004,7 +1019,6 @@ void registerOpenTxFirmwares()
|
||||
Option ext_options[] = { { "frsky", QObject::tr("Support for frsky telemetry mod"), FRSKY_VARIANT }, { "telemetrez", QObject::tr("Support for telemetry easy board"), FRSKY_VARIANT }, { "jeti", QObject::tr("Support for jeti telemetry mod"), 0 }, { "ardupilot", QObject::tr("Support for receiving ardupilot data"), 0 }, { "nmea", QObject::tr("Support for receiving NMEA data"), 0 }, { "mavlink", QObject::tr("Support for MAVLINK devices"), MAVLINK_VARIANT }, { NULL } };
|
||||
Option nav_options[] = { { "rotenc", QObject::tr("Rotary Encoder use in menus navigation") }, { "potscroll", QObject::tr("Pots use in menus navigation") }, { NULL } };
|
||||
Option extr_options[] = { { "frsky", QObject::tr("Support for frsky telemetry mod"), FRSKY_VARIANT }, { "jeti", QObject::tr("Support for jeti telemetry mod"), 0 }, { "ardupilot", QObject::tr("Support for receiving ardupilot data"), 0 }, { "nmea", QObject::tr("Support for receiving NMEA data"), 0 }, { "mavlink", QObject::tr("Support for MAVLINK devices"), MAVLINK_VARIANT }, { NULL } };
|
||||
Option fai_options[] = { { "faichoice", QObject::tr("Possibility to enable FAI MODE at field") }, { "faimode", QObject::tr("FAI MODE always enabled") }, { NULL } };
|
||||
|
||||
/* 9x board */
|
||||
openTx = new OpenTxFirmware("opentx-9x", QObject::tr("OpenTX for 9X board"), BOARD_STOCK);
|
||||
@@ -1020,7 +1034,6 @@ void registerOpenTxFirmwares()
|
||||
// NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
|
||||
openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
|
||||
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
|
||||
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
openTx->addOptions(nav_options);
|
||||
@@ -1031,7 +1044,6 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
openTx->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
|
||||
openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
|
||||
openTx->addOption("pgbar", QObject::tr("EEprom write progress bar"));
|
||||
openTx->addOption("imperial", QObject::tr("Imperial units"));
|
||||
@@ -1039,9 +1051,10 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("novario", QObject::tr("No vario support"));
|
||||
openTx->addOption("nogps", QObject::tr("No GPS support"));
|
||||
openTx->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
|
||||
openTx->addOption("nosafetych", QObject::tr("No SafetyCH functions available"));
|
||||
openTx->addOption("fasoffset", QObject::tr("Allow compensating for offset errors in FrSky FAS current sensors"));
|
||||
openTx->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
|
||||
openTx->addOptions(fai_options);
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
/* 9x board with M128 chip */
|
||||
@@ -1058,7 +1071,6 @@ void registerOpenTxFirmwares()
|
||||
// NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
|
||||
openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
|
||||
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
|
||||
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
openTx->addOptions(nav_options);
|
||||
@@ -1069,11 +1081,10 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
openTx->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
|
||||
openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
|
||||
openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
|
||||
openTx->addOption("imperial", QObject::tr("Imperial units"));
|
||||
openTx->addOptions(fai_options);
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
/* 9XR board */
|
||||
@@ -1090,7 +1101,6 @@ void registerOpenTxFirmwares()
|
||||
// NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
|
||||
openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
|
||||
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
|
||||
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
@@ -1099,7 +1109,6 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
openTx->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
|
||||
openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
|
||||
openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
|
||||
openTx->addOption("imperial", QObject::tr("Imperial units"));
|
||||
@@ -1108,7 +1117,7 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("nogps", QObject::tr("No GPS support"));
|
||||
openTx->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
|
||||
openTx->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
|
||||
openTx->addOptions(fai_options);
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
/* 9XR board with M128 chip */
|
||||
@@ -1125,7 +1134,6 @@ void registerOpenTxFirmwares()
|
||||
// NOT TESTED openTx->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
|
||||
openTx->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
|
||||
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
|
||||
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
@@ -1134,11 +1142,10 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
openTx->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
|
||||
openTx->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
|
||||
openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
|
||||
openTx->addOption("imperial", QObject::tr("Imperial units"));
|
||||
openTx->addOptions(fai_options);
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
/* Gruvin9x board */
|
||||
@@ -1153,7 +1160,6 @@ void registerOpenTxFirmwares()
|
||||
Option dsm2_options[] = { { "DSM2", QObject::tr("Support for DSM2 modules"), 0 }, { "DSM2PPM", QObject::tr("Support for DSM2 modules using ppm instead of true serial"), 0 }, { NULL } };
|
||||
openTx->addOptions(dsm2_options);
|
||||
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
|
||||
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
@@ -1163,21 +1169,18 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
openTx->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
|
||||
openTx->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
|
||||
openTx->addOption("imperial", QObject::tr("Imperial units"));
|
||||
openTx->addOptions(fai_options);
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
#ifndef __APPLE__
|
||||
/* SKY9X board */
|
||||
/* Sky9x board */
|
||||
openTx = new OpenTxFirmware("opentx-sky9x", QObject::tr("OpenTX for Sky9x board / 9X"), BOARD_SKY9X);
|
||||
openTx->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
openTx->addOption("nofp", QObject::tr("No flight modes"));
|
||||
openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
|
||||
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
@@ -1187,10 +1190,8 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
openTx->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
|
||||
openTx->addOption("tsticks", QObject::tr("Use FrSky Taranis sticks in a 9X/9XR"));
|
||||
openTx->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
openTx->addOptions(fai_options);
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
/* 9XR-Pro */
|
||||
@@ -1200,22 +1201,17 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("nofp", QObject::tr("No flight modes"));
|
||||
openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
|
||||
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
openTx->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
openTx->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
openTx->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
|
||||
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
openTx->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
|
||||
openTx->addOption("tsticks", QObject::tr("Use FrSky Taranis sticks in a 9X/9XR"));
|
||||
openTx->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
openTx->addOptions(fai_options);
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
#endif
|
||||
|
||||
/* Taranis board */
|
||||
openTx = new OpenTxFirmware("opentx-taranis", QObject::tr("OpenTX for FrSky Taranis"), BOARD_TARANIS);
|
||||
@@ -1223,9 +1219,7 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
|
||||
openTx->addOption("haptic", QObject::tr("Haptic module installed"));
|
||||
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
|
||||
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
|
||||
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
|
||||
openTx->addOptions(fai_options);
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
/* Taranis Plus board */
|
||||
@@ -1233,9 +1227,7 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
|
||||
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
|
||||
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
|
||||
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
|
||||
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
|
||||
openTx->addOptions(fai_options);
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
default_firmware_variant = GetFirmware("opentx-9x-heli-templates-en");
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "eeprominterface.h"
|
||||
|
||||
#define OPENTX_COMPANION_DOWNLOADS "http://downloads-20.open-tx.org/companion"
|
||||
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-20.open-tx.org/firmware"
|
||||
|
||||
class RleFile;
|
||||
|
||||
@@ -219,21 +219,13 @@ bool FlashInterface::setSplash(const QImage & newsplash)
|
||||
QColor color;
|
||||
QByteArray splash;
|
||||
if (splash_format == QImage::Format_Indexed8) {
|
||||
unsigned int idx = 0;
|
||||
for (unsigned int y=0; y<splash_height; y+=8) {
|
||||
for (unsigned int x=0; x<splash_width; x++) {
|
||||
unsigned int values[] = { 255, 255, 255, 255 };
|
||||
for (unsigned int z=0; z<8; z++) {
|
||||
if (y+z < splash_height) {
|
||||
QRgb gray = qGray(newsplash.pixel(x, y+z));
|
||||
for (unsigned int i=0; i<4; i++) {
|
||||
if (gray & (1<<(4+i)))
|
||||
values[i] -= 1 << z;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<4; i++)
|
||||
b[idx++] = values[i];
|
||||
for (unsigned int y=0; y<splash_height; y++) {
|
||||
unsigned int idx = (y/2)*splash_width;
|
||||
for (unsigned int x=0; x<splash_width; x++, idx++) {
|
||||
QRgb gray = qGray(newsplash.pixel(x, y));
|
||||
uint8_t z = ((255-gray)*15)/255;
|
||||
if (y & 1) z <<= 4;
|
||||
b[idx] |= z;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,7 +235,7 @@ bool FlashInterface::setSplash(const QImage & newsplash)
|
||||
for (uint y=0; y<splash_height; y++) {
|
||||
for (uint x=0; x<splash_width; x++) {
|
||||
color = QColor(blackNwhite.pixel(x,y));
|
||||
b[splash_width*(y/8) + x] |=((color==black ? 1: 0)<<(y % 8));
|
||||
b[splash_width*(y/8) + x] |= ((color==black ? 1: 0)<<(y % 8));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -278,10 +270,10 @@ QImage FlashInterface::getSplash()
|
||||
QImage image(splash_width, splash_height, QImage::Format_RGB888);
|
||||
if (splash_offset > 0) {
|
||||
for (unsigned int y=0; y<splash_height; y++) {
|
||||
unsigned int idx = (y/8)*splash_width*4;
|
||||
unsigned int mask = (1 << (y%8));
|
||||
for (unsigned int x=0; x<splash_width; x++, idx+=4) {
|
||||
unsigned int z = ((flash.at(splash_offset+idx) & mask) ? 0x1 : 0) + ((flash.at(splash_offset+idx+1) & mask) ? 0x2 : 0) + ((flash.at(splash_offset+idx+2) & mask) ? 0x4 : 0) + ((flash.at(splash_offset+idx+3) & mask) ? 0x8 : 0);
|
||||
unsigned int idx = (y/2)*splash_width;
|
||||
for (unsigned int x=0; x<splash_width; x++, idx++) {
|
||||
uint8_t byte = flash.at(splash_offset+idx);
|
||||
unsigned int z = (y & 1) ? (byte >> 4) : (byte & 0x0F);
|
||||
z = 255-(z*255)/15;
|
||||
QRgb rgb = qRgb(z, z, z);
|
||||
image.setPixel(x, y, rgb);
|
||||
@@ -293,9 +285,11 @@ QImage FlashInterface::getSplash()
|
||||
else {
|
||||
QImage image(splash_width, splash_height, QImage::Format_Mono);
|
||||
if (splash_offset > 0) {
|
||||
for (unsigned int y=0; y<splash_height; y++)
|
||||
for(unsigned int x=0; x<splash_width; x++)
|
||||
for (unsigned int y=0; y<splash_height; y++) {
|
||||
for(unsigned int x=0; x<splash_width; x++) {
|
||||
image.setPixel(x, y, (flash.at(splash_offset+(splash_width*(y/8)+x)) & (1<<(y % 8))) ? 0 : 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return image;
|
||||
}
|
||||
|
||||
@@ -316,6 +316,7 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
ui->switchesDelay->hide();
|
||||
ui->switchesDelayLabel->hide();
|
||||
}
|
||||
ui->blAlarm_ChkB->setChecked(g_eeGeneral.flashBeep);
|
||||
|
||||
disableMouseScrolling();
|
||||
}
|
||||
@@ -325,6 +326,12 @@ GeneralEdit::~GeneralEdit()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void GeneralEdit::on_blAlarm_ChkB_stateChanged()
|
||||
{
|
||||
g_eeGeneral.flashBeep = ui->blAlarm_ChkB->isChecked();
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::stickReverseEdited()
|
||||
{
|
||||
g_eeGeneral.stickReverse = ((int)ui->stickReverse1->isChecked()) | ((int)ui->stickReverse2->isChecked()<<1) | ((int)ui->stickReverse3->isChecked()<<2) | ((int)ui->stickReverse4->isChecked()<<3);
|
||||
|
||||
@@ -137,6 +137,7 @@ class GeneralEdit : public QDialog
|
||||
void shrink();
|
||||
void stickReverseEdited();
|
||||
void on_switchesDelay_valueChanged();
|
||||
void on_blAlarm_ChkB_stateChanged();
|
||||
};
|
||||
|
||||
#endif // GENERALEDIT_H
|
||||
|
||||
@@ -113,17 +113,31 @@ These will be relevant for all models in the same EEPROM.</string>
|
||||
<string>Setup</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="1,0,0,0,0">
|
||||
<item row="34" column="4">
|
||||
<item row="34" column="3">
|
||||
<widget class="QLabel" name="gpsFormatLabel">
|
||||
<property name="text">
|
||||
<string>GPS Coordinates</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLabel" name="label_speakerPitch">
|
||||
<property name="text">
|
||||
<string>Speaker Pitch (spkr only)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="36" column="4">
|
||||
<widget class="QComboBox" name="voiceLang_CB"/>
|
||||
</item>
|
||||
<item row="31" column="3">
|
||||
<item row="33" column="3">
|
||||
<widget class="QLabel" name="units_label">
|
||||
<property name="text">
|
||||
<string>Measurement Units</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="32" column="4">
|
||||
<item row="34" column="4">
|
||||
<widget class="QComboBox" name="gpsFormatCB">
|
||||
<item>
|
||||
<property name="text">
|
||||
@@ -137,7 +151,7 @@ These will be relevant for all models in the same EEPROM.</string>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="33" column="4">
|
||||
<item row="35" column="4">
|
||||
<widget class="QSpinBox" name="timezoneSB">
|
||||
<property name="minimum">
|
||||
<number>-14</number>
|
||||
@@ -150,28 +164,21 @@ These will be relevant for all models in the same EEPROM.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="34" column="3">
|
||||
<item row="36" column="3">
|
||||
<widget class="QLabel" name="VoiceLang_label">
|
||||
<property name="text">
|
||||
<string>Voice Language</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="32" column="3">
|
||||
<widget class="QLabel" name="gpsFormatLabel">
|
||||
<property name="text">
|
||||
<string>GPS Coordinates</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="33" column="3">
|
||||
<item row="35" column="3">
|
||||
<widget class="QLabel" name="label_timezone">
|
||||
<property name="text">
|
||||
<string>Timeshift from UTC</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="31" column="4">
|
||||
<item row="33" column="4">
|
||||
<widget class="QComboBox" name="units_CB">
|
||||
<item>
|
||||
<property name="text">
|
||||
@@ -185,14 +192,14 @@ These will be relevant for all models in the same EEPROM.</string>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="29" column="3">
|
||||
<item row="31" column="3">
|
||||
<widget class="QLabel" name="countrycode_label">
|
||||
<property name="text">
|
||||
<string>Country Code</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="29" column="4">
|
||||
<item row="31" column="4">
|
||||
<widget class="QComboBox" name="countrycode_CB">
|
||||
<item>
|
||||
<property name="text">
|
||||
@@ -256,14 +263,7 @@ These will be relevant for all models in the same EEPROM.</string>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLabel" name="label_speakerPitch">
|
||||
<property name="text">
|
||||
<string>Speaker Pitch (spkr only)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="4">
|
||||
<item row="16" column="4">
|
||||
<layout class="QHBoxLayout" name="backlightColor_Layout">
|
||||
<item>
|
||||
<widget class="QLabel" name="backlightColor1_label">
|
||||
@@ -298,7 +298,7 @@ These will be relevant for all models in the same EEPROM.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="3">
|
||||
<item row="17" column="3">
|
||||
<widget class="QLabel" name="re_label">
|
||||
<property name="text">
|
||||
<string>RotEnc Navigation</string>
|
||||
@@ -333,7 +333,7 @@ These will be relevant for all models in the same EEPROM.</string>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="27" column="0">
|
||||
<item row="29" column="0">
|
||||
<widget class="QLabel" name="ro_label">
|
||||
<property name="text">
|
||||
<string>Readonly Unlock</string>
|
||||
@@ -343,7 +343,7 @@ These will be relevant for all models in the same EEPROM.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="36" column="0" colspan="2">
|
||||
<item row="38" column="0" colspan="2">
|
||||
<spacer name="verticalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -426,7 +426,7 @@ These will be relevant for all models in the same EEPROM.</string>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="2">
|
||||
<item row="14" column="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -526,7 +526,7 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="27" column="1" colspan="3">
|
||||
<item row="29" column="1" colspan="3">
|
||||
<layout class="QGridLayout" name="TaranisReadOnlyUnlock" rowstretch="0,0" columnstretch="0,0,0,0,0,0,0,0,0">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMinimumSize</enum>
|
||||
@@ -1199,7 +1199,7 @@ Acceptable values are 5v..10v</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="3">
|
||||
<item row="14" column="3">
|
||||
<widget class="QLabel" name="label_BLBright">
|
||||
<property name="text">
|
||||
<string>Backlight Brightness</string>
|
||||
@@ -1220,17 +1220,17 @@ Acceptable values are 5v..10v</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="4">
|
||||
<item row="14" column="4">
|
||||
<widget class="QSpinBox" name="BLBright_SB">
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="4">
|
||||
<item row="17" column="4">
|
||||
<widget class="QComboBox" name="re_CB"/>
|
||||
</item>
|
||||
<item row="14" column="3">
|
||||
<item row="16" column="3">
|
||||
<widget class="QLabel" name="backlightColor_label">
|
||||
<property name="text">
|
||||
<string>Backlight color</string>
|
||||
@@ -1272,7 +1272,7 @@ Acceptable values are 5v..10v</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="1">
|
||||
<item row="17" column="1">
|
||||
<widget class="QComboBox" name="mavbaud_CB">
|
||||
<item>
|
||||
<property name="text">
|
||||
@@ -1374,7 +1374,7 @@ Acceptable values are 5v..10v</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1">
|
||||
<item row="16" column="1">
|
||||
<widget class="QCheckBox" name="memwarnChkB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
@@ -1409,7 +1409,7 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="0">
|
||||
<item row="17" column="0">
|
||||
<widget class="QLabel" name="mavbaud_label">
|
||||
<property name="text">
|
||||
<string>MAVLink Baud Rate</string>
|
||||
@@ -1465,7 +1465,7 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<item row="14" column="1">
|
||||
<widget class="QCheckBox" name="alarmwarnChkB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
@@ -1579,14 +1579,14 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<item row="14" column="0">
|
||||
<widget class="QLabel" name="label_27">
|
||||
<property name="text">
|
||||
<string>"No Sound" Warning</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<item row="16" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Low Memory Warning</string>
|
||||
@@ -1696,14 +1696,14 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="29" column="0">
|
||||
<item row="31" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Stick Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="31" column="0">
|
||||
<item row="33" column="0">
|
||||
<widget class="QLabel" name="stickReverseLB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
@@ -1716,7 +1716,7 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="32" column="0">
|
||||
<item row="34" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
@@ -1729,14 +1729,14 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="33" column="0">
|
||||
<item row="35" column="0">
|
||||
<widget class="QLabel" name="label_faimode">
|
||||
<property name="text">
|
||||
<string>FAI Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="29" column="1">
|
||||
<item row="31" column="1">
|
||||
<widget class="QComboBox" name="stickmodeCB">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
@@ -1790,7 +1790,7 @@ Mode 4:
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="31" column="1">
|
||||
<item row="33" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="stickReverse1">
|
||||
@@ -1822,7 +1822,7 @@ Mode 4:
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="32" column="1">
|
||||
<item row="34" column="1">
|
||||
<widget class="QComboBox" name="channelorderCB">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
@@ -1958,7 +1958,7 @@ Mode 4:
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="33" column="1">
|
||||
<item row="35" column="1">
|
||||
<widget class="QCheckBox" name="faimode_CB">
|
||||
<property name="toolTip">
|
||||
<string>If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio.</string>
|
||||
@@ -1968,7 +1968,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="34" column="0">
|
||||
<item row="36" column="0">
|
||||
<widget class="QLabel" name="switchesDelayLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
@@ -1981,7 +1981,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="34" column="1">
|
||||
<item row="36" column="1">
|
||||
<widget class="QSpinBox" name="switchesDelay">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
@@ -2014,6 +2014,20 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="3">
|
||||
<widget class="QLabel" name="blAlarm_LB">
|
||||
<property name="text">
|
||||
<string>Backlight flash on alarm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="4">
|
||||
<widget class="QCheckBox" name="blAlarm_ChkB">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabTrainer">
|
||||
|
||||
@@ -290,7 +290,7 @@ void CurveGroup::gvarCBChanged(int state)
|
||||
{
|
||||
if (!lock) {
|
||||
if (state) {
|
||||
curve.value = 10000; // TODO constant in EEpromInterface ...
|
||||
curve.value = 10000+1; // TODO constant in EEpromInterface ...
|
||||
}
|
||||
else {
|
||||
curve.value = 0; // TODO could be better
|
||||
@@ -404,6 +404,10 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
|
||||
|
||||
for (int i=-GetCurrentFirmware()->getCapability(SwitchesPositions); i<0; i++) {
|
||||
item = RawSwitch(SWITCH_TYPE_SWITCH, i);
|
||||
if (IS_TARANIS(GetCurrentFirmware()->getBoard())) {
|
||||
//hide up and down for !SH and !SF, because they are redundant (!SFup == SFdown)
|
||||
if (item.toString().contains("H") || item.toString().contains("F")) continue;
|
||||
}
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
if (item == value) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
|
||||
@@ -64,8 +64,8 @@
|
||||
#include "helpers.h"
|
||||
#include "appdata.h"
|
||||
#include "radionotfound.h"
|
||||
#include "firmwares/opentx/opentxinterface.h" // TODO get rid of this include
|
||||
|
||||
#define OPENTX_COMPANION_DOWNLOADS "http://downloads-20.open-tx.org/companion"
|
||||
#define DONATE_STR "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QUZ48K4SEXDP2"
|
||||
|
||||
#ifdef __APPLE__
|
||||
@@ -632,7 +632,6 @@ void MainWindow::loadProfile() //TODO Load all variables - Also HW!
|
||||
int profnum=action->data().toInt();
|
||||
g.id( profnum );
|
||||
|
||||
// TODO Get rid of this global variable - The profile.firmware is the real source
|
||||
current_firmware_variant = GetFirmware(g.profile[g.id()].fwType());
|
||||
|
||||
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
|
||||
@@ -1328,7 +1327,7 @@ void MainWindow::writeFlash(QString fileToFlash)
|
||||
}
|
||||
|
||||
if (readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"))) {
|
||||
sleep(1);
|
||||
sleep(2);
|
||||
int res = writeFirmwareToRadio(fileName);
|
||||
if (res) {
|
||||
QString restoreFile = tempDir + "/restore.bin";
|
||||
@@ -1336,7 +1335,7 @@ void MainWindow::writeFlash(QString fileToFlash)
|
||||
QMessageBox::warning(this, tr("Conversion failed"), tr("Cannot convert Models and Settings for use with this firmware, original data will be used"));
|
||||
restoreFile = backupFile;
|
||||
}
|
||||
sleep(1);
|
||||
sleep(2);
|
||||
if (!writeEepromToRadio(restoreFile, tr("Restore Models and Settings To Radio"))) {
|
||||
QMessageBox::warning(this, tr("Restore failed"), tr("Could not restore Models and Settings to Radio. The models and settings data file can be found at: %1").arg(backupFile));
|
||||
}
|
||||
@@ -1362,6 +1361,7 @@ void MainWindow::writeFlash(QString fileToFlash)
|
||||
QDateTime datetime;
|
||||
QString backupFile = backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
|
||||
readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"));
|
||||
sleep(2);
|
||||
}
|
||||
|
||||
writeFirmwareToRadio(fileName);
|
||||
|
||||
@@ -190,16 +190,19 @@ void Channels::maxEdited()
|
||||
|
||||
void Channels::refreshExtendedLimits()
|
||||
{
|
||||
int channelMax = model.getChannelsMax();
|
||||
int channelMaxValue = channelMax * 10;
|
||||
|
||||
for (int i=0; i<firmware->getCapability(Outputs); i++) {
|
||||
QDoubleSpinBox * minDSB = minSpins[i];
|
||||
QDoubleSpinBox * maxDSB = maxSpins[i];
|
||||
|
||||
minDSB->setMinimum(-model.getChannelsMax());
|
||||
maxDSB->setMaximum(model.getChannelsMax());
|
||||
minDSB->setMinimum(-channelMax);
|
||||
maxDSB->setMaximum(+channelMax);
|
||||
|
||||
//reset any limit that is bigger than current maximum (dependent on extended limits setting)
|
||||
if ( model.limitData[i].min < -model.getChannelsMax() ) model.limitData[i].min = -model.getChannelsMax();
|
||||
if ( model.limitData[i].max > +model.getChannelsMax() ) model.limitData[i].max = +model.getChannelsMax();
|
||||
if ( model.limitData[i].min < -channelMaxValue ) model.limitData[i].min = -channelMaxValue;
|
||||
if ( model.limitData[i].max > +channelMaxValue ) model.limitData[i].max = +channelMaxValue;
|
||||
}
|
||||
emit modified();
|
||||
}
|
||||
|
||||
@@ -147,6 +147,13 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet
|
||||
}
|
||||
|
||||
for (int i=0; i<C9X_MAX_POINTS; i++) {
|
||||
spnx[i] = new QSpinBox(this);
|
||||
spnx[i]->setProperty("index", i);
|
||||
spnx[i]->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
spnx[i]->setAccelerated(true);
|
||||
connect(spnx[i], SIGNAL(valueChanged(int)), this, SLOT(onPointEdited()));
|
||||
ui->pointsLayout->addWidget(spnx[i], i, 0, 1, 1);
|
||||
|
||||
spny[i] = new QSpinBox(this);
|
||||
spny[i]->setProperty("index", i);
|
||||
spny[i]->setMinimum(-100);
|
||||
@@ -154,14 +161,7 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet
|
||||
spny[i]->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
spny[i]->setAccelerated(true);
|
||||
connect(spny[i], SIGNAL(valueChanged(int)), this, SLOT(onPointEdited()));
|
||||
ui->pointsLayout->addWidget(spny[i], i, 0, 1, 1);
|
||||
|
||||
spnx[i] = new QSpinBox(this);
|
||||
spnx[i]->setProperty("index", i);
|
||||
spnx[i]->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
spnx[i]->setAccelerated(true);
|
||||
connect(spnx[i], SIGNAL(valueChanged(int)), this, SLOT(onPointEdited()));
|
||||
ui->pointsLayout->addWidget(spnx[i], i, 1, 1, 1);
|
||||
ui->pointsLayout->addWidget(spny[i], i, 1, 1, 1);
|
||||
|
||||
bool insert;
|
||||
if (firmware->getCapability(EnhancedCurves)) {
|
||||
|
||||
@@ -590,7 +590,8 @@ void CustomFunctionsPanel::populateFuncCB(QComboBox *b, unsigned int value)
|
||||
b->clear();
|
||||
for (unsigned int i=0; i<FuncCount; i++) {
|
||||
b->addItem(FuncSwData(AssignFunc(i)).funcToString());
|
||||
if (((i==FuncVolume || i==FuncBackgroundMusic || i==FuncBackgroundMusicPause) && !firmware->getCapability(HasVolume)) ||
|
||||
if (((i>=FuncSafetyCh1 && i<=FuncSafetyCh32) && !firmware->getCapability(SafetyChannelCustomFunction)) ||
|
||||
((i==FuncVolume || i==FuncBackgroundMusic || i==FuncBackgroundMusicPause) && !firmware->getCapability(HasVolume)) ||
|
||||
((i==FuncPlayHaptic) && !firmware->getCapability(Haptic)) ||
|
||||
((i==FuncPlayBoth) && !firmware->getCapability(HasBeeper)) ||
|
||||
((i==FuncLogs) && !firmware->getCapability(HasSDLogs)) ||
|
||||
|
||||
@@ -7,6 +7,10 @@ InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & g
|
||||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
expoInserted(false)
|
||||
{
|
||||
inputsCount = firmware->getCapability(VirtualInputs);
|
||||
if (inputsCount == 0)
|
||||
inputsCount = NUM_STICKS;
|
||||
|
||||
QGridLayout * exposLayout = new QGridLayout(this);
|
||||
|
||||
ExposlistWidget = new MixersList(this, true);
|
||||
@@ -47,10 +51,6 @@ void InputsPanel::update()
|
||||
{
|
||||
lock = true;
|
||||
|
||||
int inputsCount = firmware->getCapability(VirtualInputs);
|
||||
if (inputsCount == 0)
|
||||
inputsCount = NUM_STICKS;
|
||||
|
||||
// curDest -> destination channel
|
||||
// i -> mixer number
|
||||
QByteArray qba;
|
||||
@@ -446,6 +446,7 @@ void InputsPanel::expolistWidget_KeyPress(QKeyEvent *event)
|
||||
|
||||
int InputsPanel::gm_moveExpo(int idx, bool dir) //true=inc=down false=dec=up
|
||||
{
|
||||
|
||||
if(idx>C9X_MAX_EXPOS || (idx==C9X_MAX_EXPOS && dir)) return idx;
|
||||
|
||||
int tdx = dir ? idx+1 : idx-1;
|
||||
@@ -456,22 +457,27 @@ int InputsPanel::gm_moveExpo(int idx, bool dir) //true=inc=down false=dec=up
|
||||
if (!dir && tdx<0 && src.chn>0) {
|
||||
src.chn--;
|
||||
return idx;
|
||||
} else if (!dir && tdx<0) {
|
||||
}
|
||||
else if (!dir && tdx<0) {
|
||||
return idx;
|
||||
}
|
||||
|
||||
if(memcmp(&src,&temp,sizeof(ExpoData))==0) return idx;
|
||||
bool tgtempty=(memcmp(&tgt,&temp,sizeof(ExpoData))==0 ? 1:0);
|
||||
if(tgt.chn!=src.chn || tgtempty) {
|
||||
if ((dir) && (src.chn<(NUM_STICKS-1))) src.chn++;
|
||||
if ((!dir) && (src.chn>0)) src.chn--;
|
||||
return idx;
|
||||
if (memcmp(&src, &temp, sizeof(ExpoData)) == 0) {
|
||||
return idx;
|
||||
}
|
||||
|
||||
//flip between idx and tgt
|
||||
memcpy(&temp,&src,sizeof(ExpoData));
|
||||
memcpy(&src,&tgt,sizeof(ExpoData));
|
||||
memcpy(&tgt,&temp,sizeof(ExpoData));
|
||||
bool tgtempty = (memcmp(&tgt, &temp, sizeof(ExpoData)) == 0);
|
||||
|
||||
if (tgt.chn!=src.chn || tgtempty) {
|
||||
if ((dir) && (src.chn<unsigned(inputsCount-1))) src.chn++;
|
||||
if ((!dir) && (src.chn>0)) src.chn--;
|
||||
return idx;
|
||||
}
|
||||
|
||||
// flip between idx and tgt
|
||||
memcpy(&temp, &src, sizeof(ExpoData));
|
||||
memcpy(&src, &tgt, sizeof(ExpoData));
|
||||
memcpy(&tgt, &temp, sizeof(ExpoData));
|
||||
return tdx;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ class InputsPanel : public ModelPanel
|
||||
bool expoInserted;
|
||||
MixersList *ExposlistWidget;
|
||||
bool firstLine;
|
||||
int inputsCount;
|
||||
|
||||
int getExpoIndex(unsigned int dch);
|
||||
bool gm_insertExpo(int idx);
|
||||
|
||||
@@ -25,8 +25,14 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge
|
||||
ui->countdownBeep->setField(&timer.countdownBeep, this);
|
||||
ui->countdownBeep->addItem(tr("Silent"), 0);
|
||||
ui->countdownBeep->addItem(tr("Beeps"), 1);
|
||||
if (IS_ARM(GetEepromInterface()->getBoard()) || IS_2560(GetEepromInterface()->getBoard()))
|
||||
if (IS_ARM(GetEepromInterface()->getBoard()) || IS_2560(GetEepromInterface()->getBoard())) {
|
||||
ui->countdownBeep->addItem(tr("Voice"), 2);
|
||||
}
|
||||
|
||||
ui->persistent->setField(&timer.persistent, this);
|
||||
ui->persistent->addItem(tr("Not persistent"), 0);
|
||||
ui->persistent->addItem(tr("Persistent (flight)"), 1);
|
||||
ui->persistent->addItem(tr("Persistent (manual reset)"), 2);
|
||||
|
||||
disableMouseScrolling();
|
||||
|
||||
@@ -55,7 +61,6 @@ void TimerPanel::update()
|
||||
pvalue -= hours * 3600;
|
||||
int minutes = pvalue / 60;
|
||||
int seconds = pvalue % 60;
|
||||
ui->persistent->setChecked(timer.persistent);
|
||||
ui->persistentValue->setText(QString(" %1(%2:%3:%4)").arg(sign<0 ? "-" :" ").arg(hours, 2, 10, QLatin1Char('0')).arg(minutes, 2, 10, QLatin1Char('0')).arg(seconds, 2, 10, QLatin1Char('0')));
|
||||
}
|
||||
|
||||
@@ -76,12 +81,6 @@ void TimerPanel::on_mode_currentIndexChanged(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void TimerPanel::on_persistent_toggled(bool checked)
|
||||
{
|
||||
timer.persistent = checked;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TimerPanel::on_minuteBeep_toggled(bool checked)
|
||||
{
|
||||
timer.minuteBeep = checked;
|
||||
|
||||
@@ -28,7 +28,6 @@ class TimerPanel : public ModelPanel
|
||||
private slots:
|
||||
void on_mode_currentIndexChanged(int index);
|
||||
void on_value_editingFinished();
|
||||
void on_persistent_toggled(bool checked);
|
||||
void on_minuteBeep_toggled(bool checked);
|
||||
|
||||
private:
|
||||
|
||||
@@ -51,11 +51,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="persistent">
|
||||
<property name="text">
|
||||
<string>Persistent</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QUnsignedAutoComboBox" name="persistent"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="persistentValue">
|
||||
|
||||
@@ -28,7 +28,7 @@ TelemetryAnalog::TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog, Mod
|
||||
update();
|
||||
|
||||
ui->UnitCB->setCurrentIndex(analog.type);
|
||||
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
if (!IS_TARANIS(firmware->getBoard())) {
|
||||
ui->alarm1LevelCB->setCurrentIndex(analog.alarms[0].level);
|
||||
ui->alarm1GreaterCB->setCurrentIndex(analog.alarms[0].greater);
|
||||
ui->alarm2LevelCB->setCurrentIndex(analog.alarms[1].level);
|
||||
@@ -332,7 +332,6 @@ TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model,
|
||||
|
||||
void TelemetryCustomScreen::populateTelemetrySourceCB(QComboBox *b, unsigned int value, bool last, int hubproto)
|
||||
{
|
||||
int telem_hub[] = {0,0,0,0,0,0,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,0,2,2,1,1,1,1,1,1};
|
||||
b->clear();
|
||||
|
||||
b->addItem(RawSource(SOURCE_TYPE_NONE, 0).toString(model));
|
||||
@@ -340,24 +339,14 @@ void TelemetryCustomScreen::populateTelemetrySourceCB(QComboBox *b, unsigned int
|
||||
for (unsigned int i = 0; i < (last ? TELEMETRY_SOURCES_STATUS_COUNT : TELEMETRY_SOURCES_DISPLAY_COUNT); i++) {
|
||||
b->addItem(RawSource(SOURCE_TYPE_TELEMETRY, i).toString(model));
|
||||
if (!firmware->isTelemetrySourceAvailable(i)) {
|
||||
//disable item
|
||||
// disable item
|
||||
QModelIndex index = b->model()->index(i+1, 0);
|
||||
QVariant v(0);
|
||||
b->model()->setData(index, v, Qt::UserRole - 1);
|
||||
}
|
||||
if (!(i>=sizeof(telem_hub)/sizeof(int) || telem_hub[i]==0 || ((telem_hub[i]>=hubproto) && hubproto!=0))) {
|
||||
QModelIndex index = b->model()->index(i, 0);
|
||||
QVariant v(0);
|
||||
b->model()->setData(index, v, Qt::UserRole - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (value>=sizeof(telem_hub)/sizeof(int))
|
||||
b->setCurrentIndex(0);
|
||||
else if (telem_hub[value]==0 || ((telem_hub[value]>=hubproto) && hubproto!=0)) {
|
||||
b->setCurrentIndex(value);
|
||||
}
|
||||
|
||||
b->setCurrentIndex(value);
|
||||
b->setMaxVisibleItems(10);
|
||||
}
|
||||
|
||||
@@ -445,9 +434,11 @@ void TelemetryCustomScreen::on_screenType_currentIndexChanged(int index)
|
||||
|
||||
void TelemetryCustomScreen::customFieldChanged(int value)
|
||||
{
|
||||
int index = sender()->property("index").toInt();
|
||||
screen.body.lines[index/256].source[index%256] = value;
|
||||
emit modified();
|
||||
if (!lock) {
|
||||
int index = sender()->property("index").toInt();
|
||||
screen.body.lines[index/256].source[index%256] = value;
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void TelemetryCustomScreen::barSourceChanged(int index)
|
||||
@@ -496,6 +487,11 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
|
||||
}
|
||||
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
ui->telemetryProtocol->addItem(tr("FrSky S.PORT"), 0);
|
||||
ui->telemetryProtocol->addItem(tr("FrSky D"), 1);
|
||||
if (IS_9XRPRO(firmware->getBoard())) {
|
||||
ui->telemetryProtocol->addItem(tr("FrSky D (cable)"), 2);
|
||||
}
|
||||
ui->telemetryProtocol->setCurrentIndex(model.telemetryProtocol);
|
||||
}
|
||||
else {
|
||||
@@ -511,7 +507,7 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
|
||||
ui->A2Layout->addWidget(analogs[1]);
|
||||
connect(analogs[1], SIGNAL(modified()), this, SLOT(onAnalogModified()));
|
||||
|
||||
if (IS_ARM(GetEepromInterface()->getBoard())) {
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
analogs[2] = new TelemetryAnalog(this, model.frsky.channels[2], model, generalSettings, firmware);
|
||||
ui->A3Layout->addWidget(analogs[2]);
|
||||
connect(analogs[2], SIGNAL(modified()), this, SLOT(onAnalogModified()));
|
||||
@@ -531,7 +527,7 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
|
||||
telemetryCustomScreens[i] = tab;
|
||||
}
|
||||
|
||||
if (IS_ARM(GetEepromInterface()->getBoard())) {
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
ui->bladesCount->setMinimum(1);
|
||||
ui->bladesCount->setMaximum(128);
|
||||
}
|
||||
@@ -546,6 +542,19 @@ TelemetryPanel::~TelemetryPanel()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TelemetryPanel::update()
|
||||
{
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
if (model.moduleData[0].protocol == OFF && model.moduleData[1].protocol == PPM) {
|
||||
ui->telemetryProtocol->setEnabled(true);
|
||||
}
|
||||
else {
|
||||
ui->telemetryProtocol->setEnabled(false);
|
||||
ui->telemetryProtocol->setCurrentIndex(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TelemetryPanel::setup()
|
||||
{
|
||||
QString firmware_id = g.profile[g.id()].fwType();
|
||||
@@ -554,7 +563,7 @@ void TelemetryPanel::setup()
|
||||
|
||||
ui->rssiAlarm1SB->setValue(model.frsky.rssiAlarms[0].value);
|
||||
ui->rssiAlarm2SB->setValue(model.frsky.rssiAlarms[1].value);
|
||||
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
if (!IS_TARANIS(firmware->getBoard())) {
|
||||
ui->rssiAlarm1CB->setCurrentIndex(model.frsky.rssiAlarms[0].level);
|
||||
ui->rssiAlarm2CB->setCurrentIndex(model.frsky.rssiAlarms[1].level);
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ class TelemetryPanel : public ModelPanel
|
||||
public:
|
||||
TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware);
|
||||
virtual ~TelemetryPanel();
|
||||
virtual void update();
|
||||
|
||||
private slots:
|
||||
void on_telemetryProtocol_currentIndexChanged(int index);
|
||||
|
||||
@@ -46,16 +46,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>FrSky S.PORT</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>FrSky D</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -119,7 +119,7 @@ void PrintDialog::printSetup()
|
||||
str.append(fv(tr("Timer1"), getTimerStr(g_model->timers[0]))); //value, mode, count up/down
|
||||
str.append(fv(tr("Timer2"), getTimerStr(g_model->timers[1]))); //value, mode, count up/down
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model))); //proto, numch, delay,
|
||||
str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].ppmPulsePol ? "NEG" : "POS"));
|
||||
str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].polarityToString()));
|
||||
str.append(fv(tr("Throttle Trim"), g_model->thrTrim ? tr("Enabled") : tr("Disabled")));
|
||||
str.append(fv(tr("Throttle Expo"), g_model->thrExpo ? tr("Enabled") : tr("Disabled")));
|
||||
// TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw)));
|
||||
|
||||
@@ -59,16 +59,18 @@ class lcdWidget : public QWidget {
|
||||
QPixmap buffer(2*lcdWidth, 2*lcdHeight);
|
||||
QPainter p(&buffer);
|
||||
doPaint(p);
|
||||
bool toclipboard=g.snapToClpbrd();
|
||||
QApplication::clipboard()->setPixmap( buffer );
|
||||
if (!toclipboard) {
|
||||
QString Path=g.snapshotDir();
|
||||
if (Path.isEmpty() || !QDir(Path).exists()) {
|
||||
Path=".";
|
||||
bool toclipboard = g.snapToClpbrd();
|
||||
if (toclipboard) {
|
||||
QApplication::clipboard()->setPixmap( buffer );
|
||||
}
|
||||
else {
|
||||
QString path = g.snapshotDir();
|
||||
if (path.isEmpty() || !QDir(path).exists()) {
|
||||
path = ".";
|
||||
}
|
||||
Path.append(QDir::separator()+fileName);
|
||||
qDebug() << "Screenshot" << Path;
|
||||
buffer.toImage().save(Path);
|
||||
path.append(QDir::separator() + fileName);
|
||||
qDebug() << "Screenshot" << path;
|
||||
buffer.toImage().save(path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,18 +122,18 @@ class lcdWidget : public QWidget {
|
||||
}
|
||||
|
||||
unsigned int previousDepth = 0xFF;
|
||||
const int planSize = (lcdWidth * ((lcdHeight+7) / 8));
|
||||
|
||||
for (int y=0; y<lcdHeight; y++) {
|
||||
unsigned int idx = (y/8)*lcdWidth;
|
||||
unsigned int idx = (y*lcdDepth/8)*lcdWidth;
|
||||
unsigned int mask = (1 << (y%8));
|
||||
for (int x=0; x<lcdWidth; x++, idx++) {
|
||||
if (lcdDepth == 1) {
|
||||
if (lcdBuf[idx] & mask)
|
||||
if (lcdBuf[idx] & mask) {
|
||||
p.drawRect(2*x, 2*y, 1, 1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
unsigned int z = (((lcdBuf[idx] & mask) ? 0x1 : 0) + ((lcdBuf[planSize+idx] & mask) ? 0x2 : 0) + ((lcdBuf[2*planSize+idx] & mask) ? 0x4 : 0) + ((lcdBuf[3*planSize+idx] & mask) ? 0x8 : 0));
|
||||
unsigned int z = (y & 1) ? (lcdBuf[idx] >> 4) : (lcdBuf[idx] & 0x0F);
|
||||
if (z) {
|
||||
if (z != previousDepth) {
|
||||
previousDepth = z;
|
||||
|
||||
@@ -1232,7 +1232,7 @@ QPushButton:checked {
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="simu">
|
||||
<attribute name="title">
|
||||
@@ -1440,6 +1440,19 @@ QPushButton:checked {
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="outputs2">
|
||||
<attribute name="title">
|
||||
<string>Outputs2</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="logicalSwitchesLayout2"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="channelsLayout2"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Gvars</string>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="simu">
|
||||
<attribute name="title">
|
||||
@@ -240,6 +240,19 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="outputs2">
|
||||
<attribute name="title">
|
||||
<string>Outputs2</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="logicalSwitchesLayout2"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="channelsLayout2"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="misc">
|
||||
<attribute name="title">
|
||||
<string>Gvars</string>
|
||||
|
||||
@@ -282,9 +282,6 @@ void SimulatorDialog::initUi(T * ui)
|
||||
trimHRight = ui->trimHRight;
|
||||
trimVRight = ui->trimVRight;
|
||||
tabWidget = ui->tabWidget;
|
||||
logicalSwitchesLayout = ui->logicalSwitchesLayout;
|
||||
channelsLayout = ui->channelsLayout;
|
||||
gvarsLayout = ui->gvarsLayout;
|
||||
leftXPerc = ui->leftXPerc;
|
||||
leftYPerc = ui->leftYPerc;
|
||||
rightXPerc = ui->rightXPerc;
|
||||
@@ -356,14 +353,28 @@ void SimulatorDialog::initUi(T * ui)
|
||||
|
||||
setTrims();
|
||||
|
||||
int outputs = std::min(16, GetCurrentFirmware()->getCapability(Outputs));
|
||||
int outputs = std::min(32,GetCurrentFirmware()->getCapability(Outputs));
|
||||
if (outputs <= 16) {
|
||||
// hide second Outputs tab
|
||||
tabWidget->removeTab(tabWidget->indexOf(ui->outputs2));
|
||||
}
|
||||
else {
|
||||
tabWidget->setTabText(tabWidget->indexOf(ui->outputs), tr("Outputs") + QString(" 1-%1").arg(16));
|
||||
tabWidget->setTabText(tabWidget->indexOf(ui->outputs2), tr("Outputs") + QString(" 17-%1").arg(outputs));
|
||||
}
|
||||
for (int i=0; i<outputs; i++) {
|
||||
int column = i / (outputs/2);
|
||||
int line = i % (outputs/2);
|
||||
QGridLayout * outputTab = ui->channelsLayout;
|
||||
int column = i / (std::min(16,outputs)/2);
|
||||
int line = i % (std::min(16,outputs)/2);
|
||||
if (i >= 16 ) {
|
||||
outputTab = ui->channelsLayout2;
|
||||
column = (i-16) / (std::min(16,outputs-16)/2);
|
||||
line = (i-16) % (std::min(16,outputs-16)/2);
|
||||
}
|
||||
QLabel * label = new QLabel(tabWidget);
|
||||
ModelData model;
|
||||
label->setText(RawSource(SOURCE_TYPE_CH, i).toString(model));
|
||||
channelsLayout->addWidget(label, line, column == 0 ? 0 : 5, 1, 1);
|
||||
outputTab->addWidget(label, line, column == 0 ? 0 : 5, 1, 1);
|
||||
|
||||
QSlider * slider = new QSlider(tabWidget);
|
||||
slider->setEnabled(false);
|
||||
@@ -389,30 +400,24 @@ void SimulatorDialog::initUi(T * ui)
|
||||
slider->setInvertedAppearance(false);
|
||||
slider->setTickPosition(QSlider::TicksBelow);
|
||||
channelSliders << slider;
|
||||
channelsLayout->addWidget(slider, line, column == 0 ? 1 : 4, 1, 1);
|
||||
outputTab->addWidget(slider, line, column == 0 ? 1 : 4, 1, 1);
|
||||
|
||||
QLabel * value = new QLabel(tabWidget);
|
||||
value->setMinimumSize(QSize(50, 0));
|
||||
value->setAlignment(Qt::AlignCenter);
|
||||
channelValues << value;
|
||||
channelsLayout->addWidget(value, line, column == 0 ? 2 : 3, 1, 1);
|
||||
outputTab->addWidget(value, line, column == 0 ? 2 : 3, 1, 1);
|
||||
}
|
||||
|
||||
int switches = GetCurrentFirmware()->getCapability(LogicalSwitches);
|
||||
for (int i=0; i<switches; i++) {
|
||||
QFrame * swtch = new QFrame(tabWidget);
|
||||
swtch->setAutoFillBackground(true);
|
||||
swtch->setFrameShape(QFrame::Panel);
|
||||
swtch->setFrameShadow(QFrame::Raised);
|
||||
swtch->setLineWidth(2);
|
||||
QVBoxLayout * layout = new QVBoxLayout(swtch);
|
||||
layout->setContentsMargins(2, 2, 2, 2);
|
||||
QLabel * label = new QLabel(swtch);
|
||||
label->setText(RawSwitch(SWITCH_TYPE_VIRTUAL, i+1).toString());
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
logicalSwitchLabels << label;
|
||||
layout->addWidget(label);
|
||||
logicalSwitchesLayout->addWidget(swtch, i / (switches/2), i % (switches/2), 1, 1);
|
||||
QFrame * swtch = createLogicalSwitch(tabWidget, i, logicalSwitchLabels);
|
||||
ui->logicalSwitchesLayout->addWidget(swtch, i / (switches/2), i % (switches/2), 1, 1);
|
||||
if (outputs > 16) {
|
||||
// repeat logical switches on second outputs tab
|
||||
swtch = createLogicalSwitch(tabWidget, i, logicalSwitchLabels2);
|
||||
ui->logicalSwitchesLayout2->addWidget(swtch, i / (switches/2), i % (switches/2), 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
int fmodes = GetCurrentFirmware()->getCapability(FlightModes);
|
||||
@@ -421,16 +426,16 @@ void SimulatorDialog::initUi(T * ui)
|
||||
for (int fm=0; fm<fmodes; fm++) {
|
||||
QLabel * label = new QLabel(tabWidget);
|
||||
label->setText(QString("FM%1").arg(fm));
|
||||
gvarsLayout->addWidget(label, 0, fm+1);
|
||||
ui->gvarsLayout->addWidget(label, 0, fm+1);
|
||||
}
|
||||
for (int i=0; i<gvars; i++) {
|
||||
QLabel * label = new QLabel(tabWidget);
|
||||
label->setText(QString("GV%1").arg(i+1));
|
||||
gvarsLayout->addWidget(label, i+1, 0);
|
||||
ui->gvarsLayout->addWidget(label, i+1, 0);
|
||||
for (int fm=0; fm<fmodes; fm++) {
|
||||
QLabel * value = new QLabel(tabWidget);
|
||||
gvarValues << value;
|
||||
gvarsLayout->addWidget(value, i+1, fm+1);
|
||||
ui->gvarsLayout->addWidget(value, i+1, fm+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -443,6 +448,23 @@ void SimulatorDialog::initUi(T * ui)
|
||||
}
|
||||
}
|
||||
|
||||
QFrame * SimulatorDialog::createLogicalSwitch(QWidget * parent, int switchNo, QVector<QLabel *> & labels)
|
||||
{
|
||||
QFrame * swtch = new QFrame(parent);
|
||||
swtch->setAutoFillBackground(true);
|
||||
swtch->setFrameShape(QFrame::Panel);
|
||||
swtch->setFrameShadow(QFrame::Raised);
|
||||
swtch->setLineWidth(2);
|
||||
QVBoxLayout * layout = new QVBoxLayout(swtch);
|
||||
layout->setContentsMargins(2, 2, 2, 2);
|
||||
QLabel * label = new QLabel(swtch);
|
||||
label->setText(RawSwitch(SWITCH_TYPE_VIRTUAL, switchNo+1).toString());
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
labels << label;
|
||||
layout->addWidget(label);
|
||||
return swtch;
|
||||
}
|
||||
|
||||
void SimulatorDialog::onButtonPressed(int value)
|
||||
{
|
||||
if (value == Qt::Key_Print) {
|
||||
@@ -814,9 +836,11 @@ void SimulatorDialog::setValues()
|
||||
Trims trims;
|
||||
simulator->getTrims(trims);
|
||||
|
||||
for (int i=0; i<std::min(16, GetCurrentFirmware()->getCapability(Outputs)); i++) {
|
||||
channelSliders[i]->setValue(chVal(outputs.chans[i]));
|
||||
channelValues[i]->setText(QString("%1").arg((qreal)outputs.chans[i]*100/1024, 0, 'f', 1));
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(Outputs); i++) {
|
||||
if (i < channelSliders.size()) {
|
||||
channelSliders[i]->setValue(chVal(outputs.chans[i]));
|
||||
channelValues[i]->setText(QString("%1").arg((qreal)outputs.chans[i]*100/1024, 0, 'f', 1));
|
||||
}
|
||||
}
|
||||
|
||||
leftXPerc->setText(QString("X %1%").arg((qreal)nodeLeft->getX()*100+trims.values[0]/5, 2, 'f', 0));
|
||||
@@ -830,6 +854,9 @@ void SimulatorDialog::setValues()
|
||||
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(LogicalSwitches); i++) {
|
||||
logicalSwitchLabels[i]->setStyleSheet(outputs.vsw[i] ? CSWITCH_ON : CSWITCH_OFF);
|
||||
if (!logicalSwitchLabels2.isEmpty()) {
|
||||
logicalSwitchLabels2[i]->setStyleSheet(outputs.vsw[i] ? CSWITCH_ON : CSWITCH_OFF);
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned int gv=0; gv<numGvars; gv++) {
|
||||
|
||||
@@ -51,10 +51,8 @@ class SimulatorDialog : public QDialog
|
||||
mySlider * trimHLeft, * trimVLeft, * trimHRight, * trimVRight;
|
||||
QLabel * leftXPerc, * rightXPerc, * leftYPerc, * rightYPerc;
|
||||
QTabWidget * tabWidget;
|
||||
QGridLayout * logicalSwitchesLayout;
|
||||
QGridLayout * channelsLayout;
|
||||
QGridLayout * gvarsLayout;
|
||||
QVector<QLabel *> logicalSwitchLabels;
|
||||
QVector<QLabel *> logicalSwitchLabels2;
|
||||
QVector<QSlider *> channelSliders;
|
||||
QVector<QLabel *> channelValues;
|
||||
QVector<QLabel *> gvarValues;
|
||||
@@ -91,6 +89,7 @@ class SimulatorDialog : public QDialog
|
||||
int getValue(qint8 i);
|
||||
bool getSwitch(int swtch, bool nc, qint8 level=0);
|
||||
void setTrims();
|
||||
QFrame * createLogicalSwitch(QWidget * parent, int switchNo, QVector<QLabel *> & labels);
|
||||
|
||||
int beepVal;
|
||||
|
||||
|
||||
@@ -115,6 +115,7 @@ int main(int argc, char *argv[])
|
||||
QAbstractButton *taranisButton = msgBox.addButton("Taranis", QMessageBox::ActionRole);
|
||||
QAbstractButton *sky9xButton = msgBox.addButton("9X-Sky9X", QMessageBox::ActionRole);
|
||||
QAbstractButton *gruvinButton = msgBox.addButton("9X-Gruvin9X", QMessageBox::ActionRole);
|
||||
QAbstractButton *proButton = msgBox.addButton("9XR-Pro", QMessageBox::ActionRole);
|
||||
msgBox.addButton("9X-M128", QMessageBox::ActionRole);
|
||||
QPushButton *exitButton = msgBox.addButton(QMessageBox::Close);
|
||||
|
||||
@@ -149,6 +150,13 @@ int main(int argc, char *argv[])
|
||||
eepromFileName = path.data();
|
||||
dialog = new SimulatorDialog9X();
|
||||
}
|
||||
else if (msgBox.clickedButton() == proButton) {
|
||||
current_firmware_variant = GetFirmware("opentx-9xrpro-heli-templates-ppmca-gvars-symlimits-autosource-autoswitch-battgraph-en");
|
||||
fileName = eedir.filePath("eeprom-9xrpro.bin");
|
||||
path = fileName.toAscii();
|
||||
eepromFileName = path.data();
|
||||
dialog = new SimulatorDialog9X();
|
||||
}
|
||||
else {
|
||||
current_firmware_variant = GetFirmware("opentx-9x128-frsky-heli-templates-audio-voice-haptic-DSM2-ppmca-gvars-symlimits-autosource-autoswitch-battgraph-thrtrace-en");
|
||||
fileName = eedir.filePath("eeprom-9x128.bin");
|
||||
|
||||
|
Before Width: | Height: | Size: 876 B After Width: | Height: | Size: 876 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 405 B After Width: | Height: | Size: 472 B |
|
Before Width: | Height: | Size: 401 B After Width: | Height: | Size: 470 B |
|
Before Width: | Height: | Size: 975 B After Width: | Height: | Size: 975 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 661 B After Width: | Height: | Size: 591 B |
|
Before Width: | Height: | Size: 877 B After Width: | Height: | Size: 877 B |
|
Before Width: | Height: | Size: 961 B After Width: | Height: | Size: 961 B |
|
Before Width: | Height: | Size: 947 B After Width: | Height: | Size: 947 B |
|
Before Width: | Height: | Size: 792 B After Width: | Height: | Size: 792 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1015 B After Width: | Height: | Size: 1015 B |
|
Before Width: | Height: | Size: 783 B After Width: | Height: | Size: 1020 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 930 B After Width: | Height: | Size: 930 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 924 B After Width: | Height: | Size: 924 B |
|
Before Width: | Height: | Size: 998 B After Width: | Height: | Size: 998 B |
|
Before Width: | Height: | Size: 891 B After Width: | Height: | Size: 891 B |
|
Before Width: | Height: | Size: 739 B After Width: | Height: | Size: 739 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 660 B After Width: | Height: | Size: 826 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 371 B After Width: | Height: | Size: 423 B |
|
Before Width: | Height: | Size: 1001 B After Width: | Height: | Size: 1001 B |
|
Before Width: | Height: | Size: 665 B After Width: | Height: | Size: 665 B |
|
Before Width: | Height: | Size: 911 B After Width: | Height: | Size: 911 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 812 B After Width: | Height: | Size: 812 B |
|
Before Width: | Height: | Size: 873 B After Width: | Height: | Size: 873 B |
|
Before Width: | Height: | Size: 935 B After Width: | Height: | Size: 935 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 312 B After Width: | Height: | Size: 332 B |
|
Before Width: | Height: | Size: 1003 B After Width: | Height: | Size: 1003 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 904 B After Width: | Height: | Size: 904 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 489 B After Width: | Height: | Size: 591 B |
|
Before Width: | Height: | Size: 479 B After Width: | Height: | Size: 587 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |