Skip to content

Commit

Permalink
prep work for configurable launchmode (#91)
Browse files Browse the repository at this point in the history
* add i18n
* increase eeprom
* add configurable launchmode
  • Loading branch information
lichtl authored Oct 22, 2019
1 parent 07f2db9 commit 7546e13
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 4 deletions.
10 changes: 9 additions & 1 deletion content/advanced.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@
</dt>
</dl>
</div>

<div id="launchMode" class="wrapper-full">
<div class="groupTitle" id="LaunchModeTitle" data-i18n="title.launchMode">Launchmode</div>
<dl class="general-settings">
<dt style="width:280px">
<input class="unsafe" type="checkbox" name="launchMode" /> &nbsp;
<span data-i18n="column.launchMode" style="width:200px" id="launchModeText">Enable launchmode</span>
</dt>
</dl>
</div>
<div class="wrapper-full">

<div class="groupTitle" data-i18n="title.rx-deadbands">RX deadbands</div>
Expand Down
15 changes: 15 additions & 0 deletions content/advanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ CONTENT.advanced.initialize = function (callback) {
if (data['adaptiveFilter'] == "1") {
$('input[name="adaptiveFilter"]').prop('checked', 1);
}
if (data['launchMode'] == "1") {
$('input[name="launchMode"]').prop('checked', 1);
}
$('input[name="ledBrightness"]').val(+data['ledBrightness']);
} else {
$("select[name='vtxType'] option[value='3']").remove(); // no unify on 108
Expand Down Expand Up @@ -80,6 +83,11 @@ CONTENT.advanced.initialize = function (callback) {
$("#vtxType > option[value='4']").remove();
}

if (data['ver'] < 119) { // Hide Launchmode
$("#launchMode").hide();
}


$('select[name="loggerConfig"]').on('change', function () {
var tmp = +$(this).val();
if (tmp < 11) {
Expand Down Expand Up @@ -518,6 +526,13 @@ CONTENT.advanced.initialize = function (callback) {
} else {
data['adaptiveFilter'] = 0;
}

if ($('input[name="launchMode"]').prop('checked') ? 1 : 0 == 1) {
data['launchMode'] = 1;
} else {
data['launchMode'] = 0;
}

data['ledBrightness'] = +$('input[name="ledBrightness"]').val();
}

Expand Down
4 changes: 3 additions & 1 deletion i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"column.i": "I",
"column.idle": "Leerl.:",
"column.influence-percentage": "Einfluss [%]",
"column.launchMode": "aktiviere Startrampenmodus",
"column.lap-timer-type": "Typ und Verbindung",
"column.led": "LED",
"column.led-brightness": "LED Helligkeit",
Expand All @@ -82,7 +83,7 @@
"column.rc-expo": "Rate",
"column.rc-rate": "RC Rate",
"column.RealPit": "Real Pit modus",
"column.reverse-motors": "Gier Steuerung umkehren (Invertierte Motorlaufrichtung)",
"column.reverse-motors": "Umkehren (Invertierte Motorlaufrichtung)",
"column.roll": "Roll",
"column.runcam-split": "RunCam Split",
"column.rx-deadband": "RX Totband",
Expand Down Expand Up @@ -301,6 +302,7 @@
"title.filter": "Filter",
"title.general-settings": "Allg. Einstell.",
"title.kiss": "KISS FC Benutzeroberfläche",
"title.launchMode": "Startrampenmodus",
"title.lap-timer": "Rundenzeitgeber Konfiguration",
"title.led-color": "LED Farbe",
"title.lipo-alarm": "LiPo Alarm",
Expand Down
2 changes: 2 additions & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"column.i": "I",
"column.idle": "Idle:",
"column.influence-percentage": "Influence [%]",
"column.launchMode": "Launchmode enabled",
"column.lap-timer-type": "Type and connection",
"column.led": "LED",
"column.led-brightness": "LED Brightness",
Expand Down Expand Up @@ -316,6 +317,7 @@
"title.filter": "Filter",
"title.general-settings": "General settings",
"title.kiss": "KISS Flight Control GUI",
"title.launchMode": "Launchmode",
"title.lap-timer": "Lap timer configuration",
"title.led-color": "LED color",
"title.lipo-alarm": "LiPo alarm",
Expand Down
10 changes: 9 additions & 1 deletion js/protocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ kissProtocol.processPacket = function (code, obj) {
obj.NFCO = [];
obj.ver = 0;
obj.reverseMotors = 0;
obj.launchMode = 0;
}

obj.G_P[0] = data.getUint16(0, 0) / 1000;
Expand Down Expand Up @@ -541,7 +542,10 @@ kissProtocol.processPacket = function (code, obj) {
if (obj.ver >= 117) {
obj.AUX[12] = data.getUint8(181, 0); // realpit
}
// next free 182
if (obj.ver >= 119) {
obj.launchMode = data.getUint8(182, 0); // launchmode
}
// next free 183



Expand Down Expand Up @@ -807,6 +811,10 @@ kissProtocol.preparePacket = function (code, obj) {
data.setUint8(170, obj.AUX[12]); //realpit
blen = 179;
}
if (obj.ver >= 119) {
data.setUint8(171, obj.launchMode); //Launchmode
blen = 180;
}

break;

Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const MIN_CONFIG_VERSION = 108; // this gui can manage versions in this range
const MAX_CONFIG_VERSION = 118;
const MAX_CONFIG_VERSION = 119;

function getLanguage(callback) {
if (typeof chromeSerial !== 'undefined') {
Expand Down

0 comments on commit 7546e13

Please sign in to comment.