diff --git a/DONATIONS.txt b/DONATIONS.txt index 0fdc100eb..4726c31f0 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -296,3 +296,5 @@ Harvest Lane Ville Kuvaja DK-System Heinz Vogel +Heung Jin Choi +MMJS van der Helm diff --git a/companion/src/companion.qrc b/companion/src/companion.qrc index 7ef4edb27..34831d7c6 100644 --- a/companion/src/companion.qrc +++ b/companion/src/companion.qrc @@ -293,6 +293,7 @@ images/library/30002.png images/library/30003.png images/library/30004.png + themes/monochrome/16/paintbrush.png themes/monochrome/16/open.png themes/monochrome/16/edit.png themes/monochrome/16/information.png @@ -336,6 +337,7 @@ themes/monochrome/16/contributors.png themes/monochrome/16/stop.png themes/monochrome/16/write_eeprom.png + themes/monochrome/24/paintbrush.png themes/monochrome/24/open.png themes/monochrome/24/edit.png themes/monochrome/24/information.png @@ -379,6 +381,7 @@ themes/monochrome/24/contributors.png themes/monochrome/24/stop.png themes/monochrome/24/write_eeprom.png + themes/monochrome/32/paintbrush.png themes/monochrome/32/open.png themes/monochrome/32/edit.png themes/monochrome/32/information.png @@ -422,6 +425,7 @@ themes/monochrome/32/contributors.png themes/monochrome/32/stop.png themes/monochrome/32/write_eeprom.png + themes/monochrome/48/paintbrush.png themes/monochrome/48/open.png themes/monochrome/48/edit.png themes/monochrome/48/information.png @@ -465,6 +469,7 @@ themes/monochrome/48/contributors.png themes/monochrome/48/stop.png themes/monochrome/48/write_eeprom.png + themes/classic/16/paintbrush.png themes/classic/16/open.png themes/classic/16/edit.png themes/classic/16/information.png @@ -508,6 +513,7 @@ themes/classic/16/contributors.png themes/classic/16/stop.png themes/classic/16/write_eeprom.png + themes/classic/24/paintbrush.png themes/classic/24/open.png themes/classic/24/edit.png themes/classic/24/information.png @@ -551,6 +557,7 @@ themes/classic/24/contributors.png themes/classic/24/stop.png themes/classic/24/write_eeprom.png + themes/classic/32/paintbrush.png themes/classic/32/open.png themes/classic/32/edit.png themes/classic/32/information.png @@ -594,6 +601,7 @@ themes/classic/32/contributors.png themes/classic/32/stop.png themes/classic/32/write_eeprom.png + themes/classic/48/paintbrush.png themes/classic/48/open.png themes/classic/48/edit.png themes/classic/48/information.png @@ -637,6 +645,7 @@ themes/classic/48/contributors.png themes/classic/48/stop.png themes/classic/48/write_eeprom.png + themes/monoblue/16/paintbrush.png themes/monoblue/16/open.png themes/monoblue/16/edit.png themes/monoblue/16/information.png @@ -680,6 +689,7 @@ themes/monoblue/16/contributors.png themes/monoblue/16/stop.png themes/monoblue/16/write_eeprom.png + themes/monoblue/24/paintbrush.png themes/monoblue/24/open.png themes/monoblue/24/edit.png themes/monoblue/24/information.png @@ -723,6 +733,7 @@ themes/monoblue/24/contributors.png themes/monoblue/24/stop.png themes/monoblue/24/write_eeprom.png + themes/monoblue/32/paintbrush.png themes/monoblue/32/open.png themes/monoblue/32/edit.png themes/monoblue/32/information.png @@ -766,6 +777,7 @@ themes/monoblue/32/contributors.png themes/monoblue/32/stop.png themes/monoblue/32/write_eeprom.png + themes/monoblue/48/paintbrush.png themes/monoblue/48/open.png themes/monoblue/48/edit.png themes/monoblue/48/information.png @@ -809,6 +821,8 @@ themes/monoblue/48/contributors.png themes/monoblue/48/stop.png themes/monoblue/48/write_eeprom.png + themes/monowhite/16/paintbrush.png + themes/monowhite/16/open.png themes/monowhite/16/edit.png themes/monowhite/16/information.png themes/monowhite/16/configure.png @@ -851,6 +865,7 @@ themes/monowhite/16/contributors.png themes/monowhite/16/stop.png themes/monowhite/16/write_eeprom.png + themes/monowhite/24/paintbrush.png themes/monowhite/24/open.png themes/monowhite/24/edit.png themes/monowhite/24/information.png @@ -894,6 +909,7 @@ themes/monowhite/24/contributors.png themes/monowhite/24/stop.png themes/monowhite/24/write_eeprom.png + themes/monowhite/32/paintbrush.png themes/monowhite/32/open.png themes/monowhite/32/edit.png themes/monowhite/32/information.png @@ -937,6 +953,7 @@ themes/monowhite/32/contributors.png themes/monowhite/32/stop.png themes/monowhite/32/write_eeprom.png + themes/monowhite/48/paintbrush.png themes/monowhite/48/open.png themes/monowhite/48/edit.png themes/monowhite/48/information.png diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index 1b8ec876f..43ef03a5a 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -646,7 +646,7 @@ class FuncSwData { // Function Switches data char paramarm[10]; unsigned int enabled; // TODO perhaps not any more the right name unsigned int adjustMode; - unsigned int repeatParam; + int repeatParam; void clear() { memset(this, 0, sizeof(FuncSwData)); } }; @@ -788,14 +788,13 @@ enum TimerMode { class TimerData { public: TimerData() { clear(); } - TimerMode mode; // timer trigger source -> off, abs, THs, TH%, THt, sw/!sw, !m_sw/!m_sw - int8_t modeB; - bool minuteBeep; - bool countdownBeep; - bool dir; // 0=>Count Down, 1=>Count Up + TimerMode mode; // timer trigger source -> off, abs, THs, TH%, THt, sw/!sw, !m_sw/!m_sw + bool minuteBeep; + unsigned int countdownBeep; + bool dir; // 0=>Count Down, 1=>Count Up unsigned int val; - bool persistent; - int pvalue; + bool persistent; + int pvalue; void clear() { memset(this, 0, sizeof(TimerData)); } }; @@ -915,8 +914,6 @@ enum Capability { MixesWithoutExpo, Timers, TimeDivisions, - minuteBeep, - countdownBeep, CustomFunctions, VoicesAsNumbers, VoicesMaxLength, diff --git a/companion/src/firmwares/er9x/er9xeeprom.cpp b/companion/src/firmwares/er9x/er9xeeprom.cpp index f07716e72..4fa122677 100644 --- a/companion/src/firmwares/er9x/er9xeeprom.cpp +++ b/companion/src/firmwares/er9x/er9xeeprom.cpp @@ -366,9 +366,7 @@ t_Er9xModelData::operator ModelData () c9x.timers[0].mode = getEr9xTimerMode(tmrMode); c9x.timers[0].dir = tmrDir; c9x.timers[0].val = tmrVal; - c9x.timers[0].modeB = tmrModeB; - - switch(protocol) { + switch(protocol) { case 1: c9x.moduleData[0].protocol = PXX_DJT; break; diff --git a/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp b/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp index 1247c795a..994a75d7d 100644 --- a/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp +++ b/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp @@ -508,7 +508,6 @@ t_Ersky9xModelData_v10::operator ModelData () getEEPROMString(c9x.name, name, sizeof(name)); for (int i=0; i<2; i++) { c9x.timers[i].mode = getErSky9xTimerMode(timer[i].tmrModeA); - c9x.timers[i].modeB = timer[i].tmrModeB; c9x.timers[i].dir = timer[i].tmrDir; c9x.timers[i].val = timer[i].tmrVal; } @@ -630,7 +629,6 @@ t_Ersky9xModelData_v11::operator ModelData () getEEPROMString(c9x.name, name, sizeof(name)); for (int i=0; i<2; i++) { c9x.timers[i].mode = getErSky9xTimerMode(timer[i].tmrModeA); - c9x.timers[i].modeB = timer[i].tmrModeB; c9x.timers[i].dir = timer[i].tmrDir; c9x.timers[i].val = timer[i].tmrVal; } diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 0bd5d7528..672400fe1 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -1338,10 +1338,10 @@ class CustomFunctionField: public TransformedField { internalField.Append(new CharField<6>(_arm_param)); if (version >= 214) { internalField.Append(new UnsignedField<2>(_mode)); - internalField.Append(new UnsignedField<6>(_delay)); + internalField.Append(new SignedField<6>(_delay)); } else { - internalField.Append(new UnsignedField<8>(_delay)); + internalField.Append(new UnsignedField<8>((unsigned int &)_delay)); } if (version < 214) internalField.Append(new SpareBitsField<8>()); @@ -1364,7 +1364,7 @@ class CustomFunctionField: public TransformedField { if (IS_ARM(board)) { _mode = 0; if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue) - _delay = fn.repeatParam / 5; + _delay = (version >= 216 ? fn.repeatParam : (fn.repeatParam/5)); else _delay = (fn.enabled ? 1 : 0); if (fn.func <= FuncInstantTrim) { @@ -1439,7 +1439,7 @@ class CustomFunctionField: public TransformedField { { if (IS_ARM(board)) { if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue) - fn.repeatParam = _delay * 5; + fn.repeatParam = (version >= 216 ? _delay : (_delay*5)); else fn.enabled = (_delay & 0x01); @@ -1529,7 +1529,7 @@ class CustomFunctionField: public TransformedField { SourcesConversionTable * sourcesConversionTable; char _arm_param[10]; unsigned int _param; - unsigned int _delay; + int _delay; unsigned int _mode; unsigned int _union_param; }; @@ -1688,8 +1688,7 @@ class FrskyField: public StructField { Append(new UnsignedField<8>(frsky.usrProto)); if (version >= 216) { Append(new UnsignedField<7>(frsky.voltsSource)); - // TODO altitude displayed - Append(new SpareBitsField<1>()); + Append(new BoolField<1>(frsky.altitudeDisplayed)); } else { Append(new UnsignedField<8>(frsky.voltsSource)); @@ -1812,7 +1811,7 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u internalField.Append(new TimerModeField(modelData.timers[i].mode, board, version)); if ((IS_ARM(board) || IS_2560(board)) && version >= 216) { internalField.Append(new UnsignedField<16>(modelData.timers[i].val)); - internalField.Append(new BoolField<2>(modelData.timers[i].countdownBeep)); + 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>()); @@ -1820,7 +1819,7 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u } else if (release21March2013) { internalField.Append(new UnsignedField<12>(modelData.timers[i].val)); - internalField.Append(new BoolField<1>(modelData.timers[i].countdownBeep)); + 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)); diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index a2bcc4df4..47ac1b8a8 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -513,10 +513,6 @@ int Open9xInterface::getCapability(const Capability capability) return 1; else return 0; - case minuteBeep: - return 1; - case countdownBeep: - return 1; case Pots: return (IS_TARANIS(board) ? 4 : 3); case Switches: diff --git a/companion/src/helpers.cpp b/companion/src/helpers.cpp index d5904a77e..dc1046582 100644 --- a/companion/src/helpers.cpp +++ b/companion/src/helpers.cpp @@ -12,7 +12,8 @@ QString getPhaseName(int val, char * phasename) phaseName.append(phasename); if (phaseName.isEmpty()) { return QString(val < 0 ? "!" : "") + QObject::tr("FM%1").arg(abs(val) - 1); - } else { + } + else { return QString(val < 0 ? "!" : "") + phaseName; } } @@ -449,17 +450,6 @@ void populateFuncParamCB(QComboBox *b, const ModelData & model, uint function, u } } -void populateRepeatCB(QComboBox *b, unsigned int value) -{ - b->clear(); - b->addItem(QObject::tr("No repeat", 0)); - unsigned int step = IS_ARM(GetEepromInterface()->getBoard()) ? 5 : 10; - for (unsigned int i=step; i<=60; i+=step) { - b->addItem(QObject::tr("%1s").arg(i), i); - if (i==value) b->setCurrentIndex(b->count()-1); - } -} - void populateGVmodeCB(QComboBox *b, unsigned int value) { b->clear(); diff --git a/companion/src/helpers.h b/companion/src/helpers.h index f62e9b39e..d3141083d 100644 --- a/companion/src/helpers.h +++ b/companion/src/helpers.h @@ -84,7 +84,6 @@ class CurveGroup : public QObject { #define POPULATE_AND_SWITCHES 0x04 void populateSwitchCB(QComboBox *b, const RawSwitch & value, unsigned long attr=0, UseContext context=DefaultContext); void populateFuncCB(QComboBox *b, unsigned int value); -void populateRepeatCB(QComboBox *b, unsigned int value); void populateGVmodeCB(QComboBox *b, unsigned int value); QString FuncParam(uint function, int value, QString paramT="",unsigned int adjustmode=0); void populateFuncParamCB(QComboBox *b, const ModelData & model, uint function, unsigned int value, unsigned int adjustmode=0); diff --git a/companion/src/icon.ico b/companion/src/icon.ico index bb088b1ae..e81c703b7 100644 Binary files a/companion/src/icon.ico and b/companion/src/icon.ico differ diff --git a/companion/src/icon.png b/companion/src/icon.png index 6ceee4f23..2936917c7 100644 Binary files a/companion/src/icon.png and b/companion/src/icon.png differ diff --git a/companion/src/images/companion-title.png b/companion/src/images/companion-title.png index cbaa0d13b..05f3b8709 100644 Binary files a/companion/src/images/companion-title.png and b/companion/src/images/companion-title.png differ diff --git a/companion/src/images/iconmac.icns b/companion/src/images/iconmac.icns index 0e20c9fe3..579b285c1 100644 Binary files a/companion/src/images/iconmac.icns and b/companion/src/images/iconmac.icns differ diff --git a/companion/src/images/linuxicons/128x128/companion.png b/companion/src/images/linuxicons/128x128/companion.png index 6f1616ca2..9b4ad31a2 100644 Binary files a/companion/src/images/linuxicons/128x128/companion.png and b/companion/src/images/linuxicons/128x128/companion.png differ diff --git a/companion/src/images/linuxicons/256x256/companion.png b/companion/src/images/linuxicons/256x256/companion.png index 684517666..1ed7a9ae9 100644 Binary files a/companion/src/images/linuxicons/256x256/companion.png and b/companion/src/images/linuxicons/256x256/companion.png differ diff --git a/companion/src/images/linuxicons/32x32/companion.png b/companion/src/images/linuxicons/32x32/companion.png index df79707a5..0b7375c0c 100644 Binary files a/companion/src/images/linuxicons/32x32/companion.png and b/companion/src/images/linuxicons/32x32/companion.png differ diff --git a/companion/src/images/linuxicons/48x48/companion.png b/companion/src/images/linuxicons/48x48/companion.png index 99357930d..d591f97d2 100644 Binary files a/companion/src/images/linuxicons/48x48/companion.png and b/companion/src/images/linuxicons/48x48/companion.png differ diff --git a/companion/src/images/linuxicons/512x512/companion.png b/companion/src/images/linuxicons/512x512/companion.png index 7e9078b2e..6938b2c42 100644 Binary files a/companion/src/images/linuxicons/512x512/companion.png and b/companion/src/images/linuxicons/512x512/companion.png differ diff --git a/companion/src/images/linuxicons/scalable/companion.svg b/companion/src/images/linuxicons/scalable/companion.svg index 40a99a3b0..95f040b15 100644 --- a/companion/src/images/linuxicons/scalable/companion.svg +++ b/companion/src/images/linuxicons/scalable/companion.svg @@ -1,104 +1,340 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - COMPANION - - - - - - O - - - - - P - - - - - E - - - - - N - - - - - - - - - \ No newline at end of file + +image/svg+xml +O +P +E +N + \ No newline at end of file diff --git a/companion/src/images/originals/logotypes/open_companion_logo.png b/companion/src/images/originals/logotypes/open_companion_logo.png deleted file mode 100644 index 2080d783d..000000000 Binary files a/companion/src/images/originals/logotypes/open_companion_logo.png and /dev/null differ diff --git a/companion/src/images/originals/logotypes/opentx_2_logo.png b/companion/src/images/originals/logotypes/opentx_2_logo.png index 9f5aa12fe..aae169a8a 100644 Binary files a/companion/src/images/originals/logotypes/opentx_2_logo.png and b/companion/src/images/originals/logotypes/opentx_2_logo.png differ diff --git a/companion/src/images/originals/logotypes/opentx_2_logo.svg b/companion/src/images/originals/logotypes/opentx_2_logo.svg index 604964897..41b597ebe 100644 --- a/companion/src/images/originals/logotypes/opentx_2_logo.svg +++ b/companion/src/images/originals/logotypes/opentx_2_logo.svg @@ -2,11 +2,13 @@ + id="defs78"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + transform="matrix(0.03543311,0,0,0.03543311,0,86.000062)" + style="fill-opacity:1;fill:url(#linearGradient3793);stroke:url(#linearGradient3799)"> + d="m 17400,4800 -2600,0 -1800,3100 -1900,-3100 -2600,0 3000,5000 -3100,5000 2500,0 2100,-3300 2000,3300 2600,0 -3200,-5000 3000,-5000 z" + style="stroke:url(#linearGradient3787);fill:#009000;fill-opacity:1" /> @@ -132,17 +256,19 @@ + transform="matrix(0.03543311,0,0,0.03543311,-0.5005,-0.50049)" + style="stroke:url(#linearGradient3805);fill-opacity:1;fill:url(#linearGradient3811)"> + transform="translate(-155.20944,2159.0131)" + style="stroke:url(#linearGradient3805);fill-opacity:1;fill:url(#linearGradient3811)"> @@ -151,13 +277,14 @@ + transform="translate(-493.87614,2159.0131)" + style="stroke:url(#linearGradient3805);fill-opacity:1;fill:url(#linearGradient3811)"> @@ -166,13 +293,14 @@ + transform="translate(-832.54284,2159.0131)" + style="stroke:url(#linearGradient3805);fill-opacity:1;fill:url(#linearGradient3811)"> @@ -181,13 +309,14 @@ + transform="translate(-1227.6538,2159.0131)" + style="stroke:url(#linearGradient3805);fill-opacity:1;fill:url(#linearGradient3811)"> @@ -195,34 +324,38 @@ + d="M 9500,19000 0,19000 0,0 H 19000 V 19000 H 9500 z" + style="stroke:url(#linearGradient3825);fill:#009000;fill-opacity:1" /> + d="M 9500,19000 0,19000 0,0 H 19000 V 19000 H 9500 z" + style="stroke:url(#linearGradient3825);fill:#009000;fill-opacity:1" /> + transform="matrix(1.1733935,0,0,1.0743315,1501.2227,81.174002)"> + height="354.56" + style="stroke:url(#linearGradient3819)" /> + height="354.56" + style="stroke:url(#linearGradient3819)" /> diff --git a/companion/src/images/originals/logotypes/opentx_2_logo_v2.png b/companion/src/images/originals/logotypes/opentx_2_logo_v2.png deleted file mode 100644 index eede30674..000000000 Binary files a/companion/src/images/originals/logotypes/opentx_2_logo_v2.png and /dev/null differ diff --git a/companion/src/images/originals/logotypes/opentx_2_logo_v2.svg b/companion/src/images/originals/logotypes/opentx_2_logo_v2.svg deleted file mode 100644 index 3dad40fc8..000000000 --- a/companion/src/images/originals/logotypes/opentx_2_logo_v2.svg +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/companion/src/images/originals/logotypes/opentx_companion_logo.png b/companion/src/images/originals/logotypes/opentx_companion_logo.png new file mode 100644 index 000000000..a7c3a9032 Binary files /dev/null and b/companion/src/images/originals/logotypes/opentx_companion_logo.png differ diff --git a/companion/src/images/originals/logotypes/opentx_companion_logo.svg b/companion/src/images/originals/logotypes/opentx_companion_logo.svg index 42a984a80..90a78b883 100644 --- a/companion/src/images/originals/logotypes/opentx_companion_logo.svg +++ b/companion/src/images/originals/logotypes/opentx_companion_logo.svg @@ -2,31 +2,81 @@ + sodipodi:docname="opentx_companion_logo.svg" + inkscape:export-filename="/home/kernen/github/opentx/companion/src/images/originals/logotypes/opentx_companion_logo.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"> + id="defs3090"> + + + + + + + + @@ -55,7 +105,27 @@ inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" - transform="translate(1429.9602,109.96665)"> + transform="translate(1428.6413,109.23949)"> + + + + + + @@ -63,22 +133,6 @@ class="Master_Slide" id="g35" /> - - - - @@ -218,9 +272,9 @@ inkscape:connector-curvature="0" id="path105" d="M 9500,19000 0,19000 0,0 H 19000 V 19000 H 9500 z" - style="stroke:none;fill:#009100" /> + style="fill:#009100;stroke:none" /> diff --git a/companion/src/images/originals/logotypes/opentx_logo.png b/companion/src/images/originals/logotypes/opentx_logo.png index 5bd8add0c..f1af0cdb4 100644 Binary files a/companion/src/images/originals/logotypes/opentx_logo.png and b/companion/src/images/originals/logotypes/opentx_logo.png differ diff --git a/companion/src/images/originals/logotypes/opentx_logo.svg b/companion/src/images/originals/logotypes/opentx_logo.svg index b635294a9..95f040b15 100644 --- a/companion/src/images/originals/logotypes/opentx_logo.svg +++ b/companion/src/images/originals/logotypes/opentx_logo.svg @@ -1,11 +1,13 @@ image/svg+xml + style="fill:#ffffff;stroke:url(#linearGradient3824)" /> O + style="font-size:5080px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;stroke:url(#linearGradient3836);font-family:Sans;-inkscape-font-specification:Sans Bold">O P + style="font-size:5080px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;stroke:url(#linearGradient3834);font-family:Sans;-inkscape-font-specification:Sans Bold">P E + style="font-size:5080px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;stroke:url(#linearGradient3832);font-family:Sans;-inkscape-font-specification:Sans Bold">E N + style="font-size:5080px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;stroke:url(#linearGradient3830);font-family:Sans;-inkscape-font-specification:Sans Bold">N \ No newline at end of file diff --git a/companion/src/images/originals/logotypes/opentx_logo_128x128.png b/companion/src/images/originals/logotypes/opentx_logo_128x128.png new file mode 100644 index 000000000..9b4ad31a2 Binary files /dev/null and b/companion/src/images/originals/logotypes/opentx_logo_128x128.png differ diff --git a/companion/src/images/originals/logotypes/opentx_logo_16x16.png b/companion/src/images/originals/logotypes/opentx_logo_16x16.png new file mode 100644 index 000000000..7fa027e14 Binary files /dev/null and b/companion/src/images/originals/logotypes/opentx_logo_16x16.png differ diff --git a/companion/src/images/originals/logotypes/opentx_logo_24x24.png b/companion/src/images/originals/logotypes/opentx_logo_24x24.png new file mode 100644 index 000000000..0ae5ffe17 Binary files /dev/null and b/companion/src/images/originals/logotypes/opentx_logo_24x24.png differ diff --git a/companion/src/images/originals/logotypes/opentx_logo_256x256.png b/companion/src/images/originals/logotypes/opentx_logo_256x256.png new file mode 100644 index 000000000..1ed7a9ae9 Binary files /dev/null and b/companion/src/images/originals/logotypes/opentx_logo_256x256.png differ diff --git a/companion/src/images/originals/logotypes/opentx_logo_32x32.png b/companion/src/images/originals/logotypes/opentx_logo_32x32.png new file mode 100644 index 000000000..0b7375c0c Binary files /dev/null and b/companion/src/images/originals/logotypes/opentx_logo_32x32.png differ diff --git a/companion/src/images/originals/logotypes/opentx_logo_48x48.png b/companion/src/images/originals/logotypes/opentx_logo_48x48.png new file mode 100644 index 000000000..d591f97d2 Binary files /dev/null and b/companion/src/images/originals/logotypes/opentx_logo_48x48.png differ diff --git a/companion/src/images/originals/logotypes/opentx_logo_512x512.png b/companion/src/images/originals/logotypes/opentx_logo_512x512.png new file mode 100644 index 000000000..6938b2c42 Binary files /dev/null and b/companion/src/images/originals/logotypes/opentx_logo_512x512.png differ diff --git a/companion/src/images/originals/logotypes/opentx_logo_64x64.png b/companion/src/images/originals/logotypes/opentx_logo_64x64.png new file mode 100644 index 000000000..0ae7c8682 Binary files /dev/null and b/companion/src/images/originals/logotypes/opentx_logo_64x64.png differ diff --git a/companion/src/images/originals/logotypes/opentx_logo_96x96.png b/companion/src/images/originals/logotypes/opentx_logo_96x96.png new file mode 100644 index 000000000..2936917c7 Binary files /dev/null and b/companion/src/images/originals/logotypes/opentx_logo_96x96.png differ diff --git a/companion/src/images/originals/logotypes/opentx_logo_red_1.svg b/companion/src/images/originals/logotypes/opentx_logo_red_1.svg deleted file mode 100644 index b2c2df8e4..000000000 --- a/companion/src/images/originals/logotypes/opentx_logo_red_1.svg +++ /dev/null @@ -1,239 +0,0 @@ - -image/svg+xml -O -P -E -N - \ No newline at end of file diff --git a/companion/src/images/originals/logotypes/opentx_logo_red_2.svg b/companion/src/images/originals/logotypes/opentx_logo_red_2.svg deleted file mode 100644 index 265bc774f..000000000 --- a/companion/src/images/originals/logotypes/opentx_logo_red_2.svg +++ /dev/null @@ -1,239 +0,0 @@ - -image/svg+xml -O -P -E -N - \ No newline at end of file diff --git a/companion/src/images/originals/logotypes/opentx_logo_red_3.svg b/companion/src/images/originals/logotypes/opentx_logo_red_3.svg deleted file mode 100644 index ee4af4951..000000000 --- a/companion/src/images/originals/logotypes/opentx_logo_red_3.svg +++ /dev/null @@ -1,239 +0,0 @@ - -image/svg+xml -O -P -E -N - \ No newline at end of file diff --git a/companion/src/images/originals/logotypes/opentx_logo_red_4.svg b/companion/src/images/originals/logotypes/opentx_logo_red_4.svg deleted file mode 100644 index 7f0fed3bb..000000000 --- a/companion/src/images/originals/logotypes/opentx_logo_red_4.svg +++ /dev/null @@ -1,239 +0,0 @@ - -image/svg+xml -O -P -E -N - \ No newline at end of file diff --git a/companion/src/images/originals/logotypes/opentx_logo_red_5.svg b/companion/src/images/originals/logotypes/opentx_logo_red_5.svg deleted file mode 100644 index e54248c71..000000000 --- a/companion/src/images/originals/logotypes/opentx_logo_red_5.svg +++ /dev/null @@ -1,239 +0,0 @@ - -image/svg+xml -O -P -E -N - \ No newline at end of file diff --git a/companion/src/images/originals/logotypes/opentx_logo_red_6.svg b/companion/src/images/originals/logotypes/opentx_logo_red_6.svg deleted file mode 100644 index ba99f8839..000000000 --- a/companion/src/images/originals/logotypes/opentx_logo_red_6.svg +++ /dev/null @@ -1,239 +0,0 @@ - -image/svg+xml -O -P -E -N - \ No newline at end of file diff --git a/companion/src/images/originals/logotypes/opentx_logo_red_7.svg b/companion/src/images/originals/logotypes/opentx_logo_red_7.svg deleted file mode 100644 index ff2880892..000000000 --- a/companion/src/images/originals/logotypes/opentx_logo_red_7.svg +++ /dev/null @@ -1,239 +0,0 @@ - -image/svg+xml -O -P -E -N - \ No newline at end of file diff --git a/companion/src/images/splash.png b/companion/src/images/splash.png index 8c55b1551..e9aa7e601 100644 Binary files a/companion/src/images/splash.png and b/companion/src/images/splash.png differ diff --git a/companion/src/images/splasht.png b/companion/src/images/splasht.png index 25cdc0871..22a942ac5 100644 Binary files a/companion/src/images/splasht.png and b/companion/src/images/splasht.png differ diff --git a/companion/src/mainwindow.cpp b/companion/src/mainwindow.cpp index b26829384..72a7d0c11 100644 --- a/companion/src/mainwindow.cpp +++ b/companion/src/mainwindow.cpp @@ -1544,7 +1544,10 @@ void MainWindow::about() aboutStr.append(tr("Version %1, %3").arg(C9X_VERSION).arg(__DATE__)); aboutStr.append("

"); aboutStr.append(tr("Copyright") + " Bertrand Songis & Romolo Manfredini
© 2011-2014
"); - QMessageBox::about(this, tr("About Companion"), aboutStr); + QMessageBox msgBox(this); + msgBox.setWindowTitle(tr("About Companion")); + msgBox.setText(aboutStr); + msgBox.exec(); } void MainWindow::updateMenus() @@ -1686,12 +1689,12 @@ void MainWindow::createActions() fwchangelogAct->setStatusTip(tr("Show firmware changelog")); connect(fwchangelogAct, SIGNAL(triggered()), this, SLOT(fwchangelog())); - compareAct = new QAction(CompanionIcon("customize.png"), tr("Compare..."), this); + compareAct = new QAction(CompanionIcon("compare.png"), tr("Compare..."), this); compareAct->setStatusTip(tr("Compare models")); compareAct->setEnabled(false); connect(compareAct, SIGNAL(triggered()), this, SLOT(compare())); - customizeSplashAct = new QAction(CompanionIcon("customize.png"), tr("Customize your &TX..."), this); + customizeSplashAct = new QAction(CompanionIcon("paintbrush.png"), tr("Customize your &TX..."), this); customizeSplashAct->setStatusTip(tr("Customize the splash screen of your TX")); connect(customizeSplashAct, SIGNAL(triggered()), this, SLOT(customizeSplash())); diff --git a/companion/src/modeledit/curves.cpp b/companion/src/modeledit/curves.cpp index 612ca60d9..fe54f3d7d 100644 --- a/companion/src/modeledit/curves.cpp +++ b/companion/src/modeledit/curves.cpp @@ -8,8 +8,6 @@ #include #include -// TODO Capability CustomCurves to be removed - #define GFX_MARGIN 16 static const QColor colors[C9X_MAX_CURVES] = { @@ -76,9 +74,11 @@ Curves::Curves(QWidget * parent, ModelData & model): { ui->setupUi(this); + lock = true; + if (!GetEepromInterface()->getCapability(HasCvNames)) { - ui->cname_LE->hide(); - ui->cname_label->hide(); + ui->curveName->hide(); + ui->curveNameLabel->hide(); } QGraphicsScene *scene = new QGraphicsScene(ui->curvePreview); @@ -132,7 +132,20 @@ Curves::Curves(QWidget * parent, ModelData & model): spnx[i]->setAccelerated(true); connect(spnx[i], SIGNAL(valueChanged(int)), this, SLOT(onPointEdited())); ui->pointsLayout->addWidget(spnx[i], i, 1, 1, 1); + + bool insert; + if (GetEepromInterface()->getCapability(EnhancedCurves)) { + insert = (i >= 1); + } + else { + insert = (i==2 || i==4 || i==8 || i==16); + } + if (insert) { + ui->curvePoints->addItem(tr("%1 points").arg(i+1), i+1); + } } + + lock = false; } Curves::~Curves() @@ -173,7 +186,7 @@ void Curves::update() lock = true; if (GetEepromInterface()->getCapability(HasCvNames)) { - ui->cname_LE->setText(model.curves[currentCurve].name); + ui->curveName->setText(model.curves[currentCurve].name); } int count = model.curves[currentCurve].count; @@ -215,14 +228,27 @@ void Curves::setCurrentCurve(int index) void Curves::updateCurveType() { - int index = (model.curves[currentCurve].type == CurveData::CURVE_TYPE_CUSTOM ? 1 : 0); - if (model.curves[currentCurve].count==5) - index += 2; - else if (model.curves[currentCurve].count==9) - index += 4; - else if (model.curves[currentCurve].count==17) - index += 6; - ui->curvetype_CB->setCurrentIndex(index); + lock = true; + + int index = 0; + + if (GetEepromInterface()->getCapability(EnhancedCurves)) { + index = model.curves[currentCurve].count - 2; + } + else { + if (model.curves[currentCurve].count == 5) + index += 2; + else if (model.curves[currentCurve].count == 9) + index += 4; + else if (model.curves[currentCurve].count == 17) + index += 6; + } + + ui->curvePoints->setCurrentIndex(index); + ui->curveCustom->setCurrentIndex(model.curves[currentCurve].type); + ui->curveSmooth->setCurrentIndex(model.curves[currentCurve].smooth); + + lock = false; } void Curves::updateCurve() @@ -333,61 +359,83 @@ void Curves::onNodeUnfocus() updateCurve(); } -void Curves::on_curvetype_CB_currentIndexChanged(int index) +bool Curves::allowCurveType(int points, CurveData::CurveType type) { - static const int numpoint[] = {3,3,5,5,9,9,17,17}; - static const CurveData::CurveType types[] = {CurveData::CURVE_TYPE_STANDARD, CurveData::CURVE_TYPE_CUSTOM, CurveData::CURVE_TYPE_STANDARD, CurveData::CURVE_TYPE_CUSTOM, CurveData::CURVE_TYPE_STANDARD, CurveData::CURVE_TYPE_CUSTOM, CurveData::CURVE_TYPE_STANDARD, CurveData::CURVE_TYPE_CUSTOM}; + int numcurves = GetEepromInterface()->getCapability(NumCurves); - if (!lock) { - lock = true; + int totalpoints = 0; + for (int i=0; igetCapability(NumCurves); - // int currpoints = model.curves[currentCurve].count; - // bool currcustom = model.curves[currentCurve].custom; - - int totalpoints=0; - for (int i=0; igetCapability(NumCurvePoints); - if (fwpoints!=0) { - if (fwpoints < totalpoints) { - QMessageBox::warning(this, "companion", tr("Not enough free points in EEPROM to store the curve.")); - updateCurveType(); - lock = false; - return; - } - } - - model.curves[currentCurve].count = numpoint[index]; - model.curves[currentCurve].type = types[index]; - - // TODO something better! - for (int i=0; i= model.curves[currentCurve].count-1 ? +100 : -100 + (200*i)/(numpoint[index]-1)); - model.curves[currentCurve].points[i].y = 0; - } - - update(); - emit modified(); - lock = false; + int fwpoints = GetEepromInterface()->getCapability(NumCurvePoints); + if (totalpoints > fwpoints) { + QMessageBox::warning(this, "companion", tr("Not enough free points in EEPROM to store the curve.")); + return false; + } + else { + return true; } } -void Curves::on_cname_LE_editingFinished() +void Curves::on_curvePoints_currentIndexChanged(int index) +{ + if (!lock) { + int numpoints = ((QComboBox *)sender())->itemData(index).toInt(); + + if (allowCurveType(numpoints, model.curves[currentCurve].type)) { + model.curves[currentCurve].count = numpoints; + + // TODO something better + reuse! + for (int i=0; i= model.curves[currentCurve].count-1 ? +100 : -100 + (200*i)/(numpoints-1)); + model.curves[currentCurve].points[i].y = 0; + } + + update(); + emit modified(); + } + else { + updateCurveType(); + } + } +} + +void Curves::on_curveCustom_currentIndexChanged(int index) +{ + if (!lock) { + CurveData::CurveType type = (CurveData::CurveType)index; + int numpoints = ui->curvePoints->itemData(ui->curvePoints->currentIndex()).toInt(); + if (allowCurveType(model.curves[currentCurve].count, type)) { + model.curves[currentCurve].type = type; + + // TODO something better + reuse! + for (int i=0; i= model.curves[currentCurve].count-1 ? +100 : -100 + (200*i)/(numpoints-1)); + model.curves[currentCurve].points[i].y = 0; + } + + update(); + emit modified(); + } + else { + updateCurveType(); + } + } +} + +void Curves::on_curveSmooth_currentIndexChanged(int index) +{ + model.curves[currentCurve].smooth = index; + update(); +} + +void Curves::on_curveName_editingFinished() { memset(model.curves[currentCurve].name, 0, sizeof(model.curves[currentCurve].name)); - strcpy(model.curves[currentCurve].name, ui->cname_LE->text().toAscii()); + strcpy(model.curves[currentCurve].name, ui->curveName->text().toAscii()); emit modified(); } @@ -621,47 +669,11 @@ void ModelEdit::clearCurves(bool ask) currentCurve=0; curvesLock=false; ui->curvetype_CB->setCurrentIndex(2); - ui->cname_LE->clear(); + ui->curveName->clear(); updateSettings(); drawCurve(); } -void ModelEdit::setCurve(uint8_t c, int8_t ar[]) -{ - int len=sizeof(ar)/sizeof(int8_t); - if (GetEepromInterface()->getCapability(CustomCurves)) { - if (GetEepromInterface()->getCapability(NumCurves)>c) { - if (len<9) { - model.curves[c].count=5; - model.curves[c].custom=false; - for (int i=0; i< 5; i++) { - model.curves[c].points[i].y=ar[i]; - } - } else { - model.curves[c].count=5; - model.curves[c].custom=false; - for (int i=0; i< 5; i++) { - model.curves[c].points[i].y=ar[i]; - } - } - } - } else { - if (len<9) { - model.curves[c].count=5; - model.curves[c].custom=false; - for (int i=0; i< 5; i++) { - model.curves[c].points[i].y=ar[i]; - } - } else { - model.curves[c+8].count=5; - model.curves[c+8].custom=false; - for (int i=0; i< 5; i++) { - model.curves[c+8].points[i].y=ar[i]; - } - } - } -} - void ModelEdit::ControlCurveSignal(bool flag) { foreach(QSpinBox *sb, findChildren(QRegExp("curvePt[0-9]+"))) { diff --git a/companion/src/modeledit/curves.h b/companion/src/modeledit/curves.h index a1086dde0..e8915cf65 100644 --- a/companion/src/modeledit/curves.h +++ b/companion/src/modeledit/curves.h @@ -22,8 +22,10 @@ class Curves : public ModelPanel void resetCurve(); void editCurve(); void plotCurve(bool checked); - void on_cname_LE_editingFinished(); - void on_curvetype_CB_currentIndexChanged(int index); + void on_curveName_editingFinished(); + void on_curvePoints_currentIndexChanged(int index); + void on_curveCustom_currentIndexChanged(int index); + void on_curveSmooth_currentIndexChanged(int index); void onPointEdited(); void onNodeMoved(int x, int y); void onNodeFocus(); @@ -41,6 +43,7 @@ class Curves : public ModelPanel void setCurrentCurve(int index); void updateCurve(); void updateCurveType(); + bool allowCurveType(int points, CurveData::CurveType type); }; diff --git a/companion/src/modeledit/curves.ui b/companion/src/modeledit/curves.ui index 17ad1d39a..ed9800e89 100644 --- a/companion/src/modeledit/curves.ui +++ b/companion/src/modeledit/curves.ui @@ -20,9 +20,47 @@ - + + + + + 0 + + + + + + + + + Standard + + + + + Custom + + + + + + + + + Lines + + + + + Smooth + + + + + + - + Curve type @@ -31,52 +69,8 @@ - - - - - 3 points - - - - - 3 points custom - - - - - 5 points - - - - - 5 points custom - - - - - 9 points - - - - - 9 points custom - - - - - 17 points - - - - - 17 points custom - - - - - + Curve name @@ -86,7 +80,7 @@ - + 6 @@ -129,7 +123,7 @@ - + Qt::Vertical diff --git a/companion/src/modeledit/customfunctions.cpp b/companion/src/modeledit/customfunctions.cpp index 0dc818581..0f2466b4b 100644 --- a/companion/src/modeledit/customfunctions.cpp +++ b/companion/src/modeledit/customfunctions.cpp @@ -7,6 +7,35 @@ #include #include "helpers.h" +RepeatComboBox::RepeatComboBox(QWidget *parent, int & repeatParam): + QComboBox(parent), + repeatParam(repeatParam) +{ + unsigned int step = IS_ARM(GetEepromInterface()->getBoard()) ? 1 : 10; + int value = repeatParam/step; + + if (step == 1) { + addItem(QObject::tr("Played once, not during startup"), -1); + value++; + } + + addItem(QObject::tr("No repeat"), 0); + + for (unsigned int i=step; i<=60; i+=step) { + addItem(QObject::tr("%1s").arg(i), i); + } + + setCurrentIndex(value); + + connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(onIndexChanged(int))); +} + +void RepeatComboBox::onIndexChanged(int index) +{ + repeatParam = itemData(index).toInt(); + emit modified(); +} + CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings): ModelPanel(parent, model), generalSettings(generalSettings), @@ -132,12 +161,9 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model, QHBoxLayout *repeatLayout = new QHBoxLayout(); gridLayout->addLayout(repeatLayout, i+1, 4); - - fswtchRepeat[i] = new QComboBox(this); - fswtchRepeat[i]->setProperty("index", i); - connect(fswtchRepeat[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited())); + fswtchRepeat[i] = new RepeatComboBox(this, model.funcSw[i].repeatParam); repeatLayout->addWidget(fswtchRepeat[i], i+1); - populateRepeatCB(fswtchRepeat[i], model.funcSw[i].repeatParam); + connect(fswtchRepeat[i], SIGNAL(modified()), this, SLOT(onChildModified())); fswtchEnable[i] = new QCheckBox(this); fswtchEnable[i]->setProperty("index", i); @@ -252,6 +278,11 @@ void CustomFunctionsPanel::customFunctionEdited() } } +void CustomFunctionsPanel::onChildModified() +{ + emit modified(); +} + void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified) { unsigned int widgetsMask = 0; @@ -259,7 +290,6 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified) model.funcSw[i].swtch = RawSwitch(fswtchSwtch[i]->itemData(fswtchSwtch[i]->currentIndex()).toInt()); model.funcSw[i].func = (AssignFunc)fswtchFunc[i]->currentIndex(); model.funcSw[i].enabled = fswtchEnable[i]->isChecked(); - model.funcSw[i].repeatParam = (AssignFunc)fswtchRepeat[i]->currentIndex(); model.funcSw[i].adjustMode = (AssignFunc)fswtchGVmode[i]->currentIndex(); } @@ -314,11 +344,8 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified) widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM + CUSTOM_FUNCTION_ENABLE; } else if (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic) { - if (modified) model.funcSw[i].repeatParam = fswtchRepeat[i]->itemData(fswtchRepeat[i]->currentIndex()).toInt(); - if (index != FuncBackgroundMusic) { - if (GetEepromInterface()->getCapability(HasFuncRepeat)) { - widgetsMask |= CUSTOM_FUNCTION_REPEAT; - } + if (index != FuncBackgroundMusic && GetEepromInterface()->getCapability(HasFuncRepeat)) { + widgetsMask |= CUSTOM_FUNCTION_REPEAT; } if (index==FuncPlayValue) { if (modified) model.funcSw[i].param = fswtchParamT[i]->itemData(fswtchParamT[i]->currentIndex()).toInt(); @@ -422,9 +449,11 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified) void CustomFunctionsPanel::update() { + lock = true; for (int i=0; igetCapability(CustomFunctions); i++) { refreshCustomFunction(i); } + lock = false; } void CustomFunctionsPanel::fswPaste() diff --git a/companion/src/modeledit/customfunctions.h b/companion/src/modeledit/customfunctions.h index e6729da6a..ccb73582e 100644 --- a/companion/src/modeledit/customfunctions.h +++ b/companion/src/modeledit/customfunctions.h @@ -13,6 +13,23 @@ #include #endif +class RepeatComboBox: public QComboBox +{ + Q_OBJECT + + public: + RepeatComboBox(QWidget *parent, int & repeatParam); + + signals: + void modified(); + + private slots: + void onIndexChanged(int); + + protected: + int & repeatParam; +}; + class CustomFunctionsPanel : public ModelPanel { Q_OBJECT @@ -28,6 +45,7 @@ class CustomFunctionsPanel : public ModelPanel void fsw_customContextMenuRequested(QPoint pos); void refreshCustomFunction(int index, bool modified=false); void playMusic(); + void onChildModified(); #ifdef PHONON void mediaPlayer_state(Phonon::State newState, Phonon::State oldState); #endif diff --git a/companion/src/modeledit/expodialog.cpp b/companion/src/modeledit/expodialog.cpp index 00387720a..921e916bc 100644 --- a/companion/src/modeledit/expodialog.cpp +++ b/companion/src/modeledit/expodialog.cpp @@ -62,6 +62,10 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, i ui->trimCB->hide(); } + ui->trimCB->addItem(tr("Rud"), 1); + ui->trimCB->addItem(tr("Ele"), 2); + ui->trimCB->addItem(tr("Thr"), 3); + ui->trimCB->addItem(tr("Ail"), 4); ui->trimCB->setCurrentIndex(1 - ed->carryTrim); int expolength = GetEepromInterface()->getCapability(HasExpoNames); @@ -81,12 +85,13 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, i valuesChanged(); - connect(ui->lineName,SIGNAL(editingFinished()),this,SLOT(valuesChanged())); - connect(ui->sourceCB,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->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())); + connect(cb_fp[i], SIGNAL(toggled(bool)), this, SLOT(valuesChanged())); } QTimer::singleShot(0, this, SLOT(shrink())); } @@ -115,6 +120,7 @@ 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()); + ed->carryTrim = 1 - ui->trimCB->currentIndex(); ed->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt()); ed->mode = ui->sideCB->currentIndex() + 1; diff --git a/companion/src/modeledit/inputs.cpp b/companion/src/modeledit/inputs.cpp index 2ffbcdd66..1376abb68 100644 --- a/companion/src/modeledit/inputs.cpp +++ b/companion/src/modeledit/inputs.cpp @@ -88,6 +88,12 @@ void InputsPanel::update() if (GetEepromInterface()->getCapability(VirtualInputs)) { str += " " + tr("Source(%1)").arg(md->srcRaw.toString()); + if (md->carryTrim>0) { + str += " " + tr("No Trim"); + } + else if (md->carryTrim<0) { + str += " " + RawSource(SOURCE_TYPE_TRIM, (-(md->carryTrim)-1)).toString(); + } } else { switch (md->mode) { diff --git a/companion/src/modeledit/mixerdialog.cpp b/companion/src/modeledit/mixerdialog.cpp index 85a9c4a90..4dc69cd12 100644 --- a/companion/src/modeledit/mixerdialog.cpp +++ b/companion/src/modeledit/mixerdialog.cpp @@ -45,7 +45,6 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, i ui->trimCB->addItem(tr("Ele"), 2); ui->trimCB->addItem(tr("Thr"), 3); ui->trimCB->addItem(tr("Ail"), 4); - ui->trimCB->setCurrentIndex(1 - md->carryTrim); int namelength = GetEepromInterface()->getCapability(HasMixerNames); diff --git a/companion/src/modeledit/mixes.cpp b/companion/src/modeledit/mixes.cpp index 5e1fb7769..ed6016e57 100644 --- a/companion/src/modeledit/mixes.cpp +++ b/companion/src/modeledit/mixes.cpp @@ -112,11 +112,13 @@ void MixesPanel::update() if (md->swtch.type != SWITCH_TYPE_NONE) str += " " + tr("Switch(%1)").arg(md->swtch.toString()); - if (md->carryTrim>0) { - str += " " + tr("No Trim"); - } - else if (md->carryTrim<0) { - str += " " + RawSource(SOURCE_TYPE_TRIM, (-(md->carryTrim)-1)).toString(); + if (!GetEepromInterface()->getCapability(VirtualInputs)) { + if (md->carryTrim>0) { + str += " " + tr("No Trim"); + } + else if (md->carryTrim<0) { + str += " " + RawSource(SOURCE_TYPE_TRIM, (-(md->carryTrim)-1)).toString(); + } } if (md->noExpo) str += " " + tr("No DR/Expo"); diff --git a/companion/src/modeledit/setup.cpp b/companion/src/modeledit/setup.cpp index b663f577a..2a27bb7cf 100644 --- a/companion/src/modeledit/setup.cpp +++ b/companion/src/modeledit/setup.cpp @@ -19,13 +19,10 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer): ui->persistentValue->hide(); } - if (!GetEepromInterface()->getCapability(minuteBeep)) { - ui->minuteBeep->hide(); - } - - if (!GetEepromInterface()->getCapability(countdownBeep)) { - ui->countdownBeep->hide(); - } + ui->countdownBeep->addItem(tr("None")); + ui->countdownBeep->addItem(tr("Beeps")); + if (IS_ARM(GetEepromInterface()->getBoard()) || IS_2560(GetEepromInterface()->getBoard())) + ui->countdownBeep->addItem(tr("Countdown")); } TimerPanel::~TimerPanel() @@ -54,13 +51,8 @@ void TimerPanel::update() 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'))); } - if (GetEepromInterface()->getCapability(minuteBeep)) { - ui->minuteBeep->setChecked(timer.minuteBeep); - } - - if (GetEepromInterface()->getCapability(countdownBeep)) { - ui->countdownBeep->setChecked(timer.countdownBeep); - } + ui->countdownBeep->setCurrentIndex(timer.countdownBeep); + ui->minuteBeep->setChecked(timer.minuteBeep); } void TimerPanel::on_value_editingFinished() @@ -81,15 +73,15 @@ void TimerPanel::on_persistent_toggled(bool checked) emit modified(); } -void TimerPanel::on_minuteBeep_toggled(bool checked) +void TimerPanel::on_countdownBeep_currentIndexChanged(int index) { - timer.minuteBeep = checked; + timer.countdownBeep = index; emit modified(); } -void TimerPanel::on_countdownBeep_toggled(bool checked) +void TimerPanel::on_minuteBeep_toggled(bool checked) { - timer.countdownBeep = checked; + timer.minuteBeep = checked; emit modified(); } @@ -224,14 +216,18 @@ void ModulePanel::update() ui->label_failsafeMode->setVisible(mask & MASK_FAILSAFES); ui->failsafeMode->setVisible(mask & MASK_FAILSAFES); ui->failsafeMode->setCurrentIndex(module.failsafeMode); - ui->label_failsafeFrame->setVisible(mask & MASK_FAILSAFES); - ui->failsafesFrame->setVisible(mask & MASK_FAILSAFES); ui->failsafesFrame->setEnabled(module.failsafeMode == 1); for (int i=0; isetValue(module.failsafeChannels[i]); failsafeSpins[i]->setValue(module.failsafeChannels[i]); } } + else { + mask = 0; + } + + ui->failsafesLayoutLabel->setVisible(mask & MASK_FAILSAFES); + ui->failsafesFrame->setVisible(mask & MASK_FAILSAFES); } void ModulePanel::on_trainerMode_currentIndexChanged(int index) diff --git a/companion/src/modeledit/setup.h b/companion/src/modeledit/setup.h index 7b33ffe5a..d1392e1dd 100644 --- a/companion/src/modeledit/setup.h +++ b/companion/src/modeledit/setup.h @@ -28,7 +28,7 @@ class TimerPanel : public ModelPanel void on_value_editingFinished(); void on_persistent_toggled(bool checked); void on_minuteBeep_toggled(bool checked); - void on_countdownBeep_toggled(bool checked); + void on_countdownBeep_currentIndexChanged(int index); private: TimerData & timer; diff --git a/companion/src/modeledit/setup_module.ui b/companion/src/modeledit/setup_module.ui index 500ea2fe8..406488f96 100644 --- a/companion/src/modeledit/setup_module.ui +++ b/companion/src/modeledit/setup_module.ui @@ -443,7 +443,7 @@ - + 16777215 diff --git a/companion/src/modeledit/setup_timer.ui b/companion/src/modeledit/setup_timer.ui index 96ed9370f..e87ed86b8 100644 --- a/companion/src/modeledit/setup_timer.ui +++ b/companion/src/modeledit/setup_timer.ui @@ -6,8 +6,8 @@ 0 0 - 726 - 54 + 586 + 38 @@ -33,6 +33,23 @@ + + + + Countdown + + + + + + + + + + MinuteBeep + + + @@ -47,20 +64,6 @@ - - - - MinuteBeep - - - - - - - CountDownBeep - - - diff --git a/companion/src/modeledit/telemetry.cpp b/companion/src/modeledit/telemetry.cpp index 3a2c63660..5a429b8b1 100644 --- a/companion/src/modeledit/telemetry.cpp +++ b/companion/src/modeledit/telemetry.cpp @@ -371,16 +371,19 @@ void TelemetryPanel::setup() if (!GetEepromInterface()->getCapability(HasAltitudeSel)) { ui->AltitudeGPS_ChkB->hide(); - } else { + } + else { ui->AltitudeGPS_ChkB->setChecked(model.frsky.FrSkyGpsAlt); } - int varioCap=GetEepromInterface()->getCapability(HasVario); - // if (IS_TARANIS(GetEepromInterface()->getBoard())) { - if (false) { + + if (IS_TARANIS(GetEepromInterface()->getBoard())) { ui->AltitudeToolbar_ChkB->setChecked(model.frsky.altitudeDisplayed); - } else { + } + else { ui->AltitudeToolbar_ChkB->hide(); } + + int varioCap = GetEepromInterface()->getCapability(HasVario); if (!varioCap) { ui->varioLimitMax_DSB->hide(); ui->varioLimitMinOff_ChkB->hide(); @@ -649,7 +652,6 @@ void TelemetryPanel::on_AltitudeGPS_ChkB_toggled(bool checked) if (lock) return; model.frsky.FrSkyGpsAlt = checked; emit modified(); - //AltitudeGPS_CB } void TelemetryPanel::on_AltitudeToolbar_ChkB_toggled(bool checked) diff --git a/companion/src/modeledit/templates.cpp b/companion/src/modeledit/templates.cpp index c45b920bf..6bfb52247 100644 --- a/companion/src/modeledit/templates.cpp +++ b/companion/src/modeledit/templates.cpp @@ -2,6 +2,28 @@ #include #include +void ModelEdit::setCurve(uint8_t c, int8_t ar[]) +{ + int len=sizeof(ar)/sizeof(int8_t); + + if (GetEepromInterface()->getCapability(NumCurves)>c) { + if (len<9) { + model.curves[c].count=5; + model.curves[c].custom=false; + for (int i=0; i< 5; i++) { + model.curves[c].points[i].y=ar[i]; + } + } + else { + model.curves[c].count=5; + model.curves[c].custom=false; + for (int i=0; i< 5; i++) { + model.curves[c].points[i].y=ar[i]; + } + } + } +} + Templates::Templates(QWidget * parent, ModelData & model): QWidget(parent), model(model)