mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-19 06:15:13 +03:00
Added expert mode. Moved FAILSAFE feature back into failsafe tab.
This commit is contained in:
parent
af3903c8d6
commit
eafbaa5d06
10 changed files with 496 additions and 323 deletions
|
@ -11,10 +11,6 @@
|
||||||
"options_receive_app_notifications": {
|
"options_receive_app_notifications": {
|
||||||
"message": "Receive desktop <strong>notification</strong> when application updates"
|
"message": "Receive desktop <strong>notification</strong> when application updates"
|
||||||
},
|
},
|
||||||
"options_improve_configurator": {
|
|
||||||
"message": "Send anonymous usage data to the developer team"
|
|
||||||
},
|
|
||||||
|
|
||||||
"connect": {
|
"connect": {
|
||||||
"message": "Connect"
|
"message": "Connect"
|
||||||
},
|
},
|
||||||
|
@ -33,6 +29,12 @@
|
||||||
"autoConnectDisabled": {
|
"autoConnectDisabled": {
|
||||||
"message": "Auto-Connect: Disabled - User needs to select the correct serial port and click \"Connect\" button on its own"
|
"message": "Auto-Connect: Disabled - User needs to select the correct serial port and click \"Connect\" button on its own"
|
||||||
},
|
},
|
||||||
|
"expertMode": {
|
||||||
|
"message": "Enable Expert Mode"
|
||||||
|
},
|
||||||
|
"permanentExpertMode": {
|
||||||
|
"message": "Permanently enable Expert Mode"
|
||||||
|
},
|
||||||
"deviceRebooting": {
|
"deviceRebooting": {
|
||||||
"message": "Device - <span style=\"color: red\">Rebooting</span>"
|
"message": "Device - <span style=\"color: red\">Rebooting</span>"
|
||||||
},
|
},
|
||||||
|
@ -544,10 +546,16 @@
|
||||||
"message": "On Screen Display"
|
"message": "On Screen Display"
|
||||||
},
|
},
|
||||||
"featureFAILSAFE": {
|
"featureFAILSAFE": {
|
||||||
"message": "Override failsafe behaviour on RX signal loss"
|
"message": "Enable Failsafe Stage 2"
|
||||||
|
},
|
||||||
|
"featureFAILSAFEOld": {
|
||||||
|
"message": "Enable Failsafe"
|
||||||
},
|
},
|
||||||
"featureFAILSAFETip": {
|
"featureFAILSAFETip": {
|
||||||
"message": "<strong>Warning:</strong> Use this only if you know what you are doing. The default behaviour on RX signal loss (deactivate all motors to bring craft to the ground) is the safest option in most situations."
|
"message": "<strong>Note:</strong> When Stage 2 is DISABLED, the fallback setting <strong>Auto</strong> is used instead of the user settings for all flightchannels (Roll, Pitch, Yaw and Throttle)."
|
||||||
|
},
|
||||||
|
"featureFAILSAFEOldTip": {
|
||||||
|
"message": "Apply Failsafe settings on RX signal loss"
|
||||||
},
|
},
|
||||||
"configurationFeatureEnabled": {
|
"configurationFeatureEnabled": {
|
||||||
"message": "Enabled"
|
"message": "Enabled"
|
||||||
|
|
|
@ -12,7 +12,6 @@ var Features = function (config) {
|
||||||
{bit: 5, group: 'other', name: 'SERVO_TILT'},
|
{bit: 5, group: 'other', name: 'SERVO_TILT'},
|
||||||
{bit: 6, group: 'other', name: 'SOFTSERIAL', haveTip: true},
|
{bit: 6, group: 'other', name: 'SOFTSERIAL', haveTip: true},
|
||||||
{bit: 7, group: 'gps', name: 'GPS', haveTip: true},
|
{bit: 7, group: 'gps', name: 'GPS', haveTip: true},
|
||||||
{bit: 8, group: 'other', name: 'FAILSAFE', haveTip: true},
|
|
||||||
{bit: 9, group: 'other', name: 'SONAR'},
|
{bit: 9, group: 'other', name: 'SONAR'},
|
||||||
{bit: 10, group: 'other', name: 'TELEMETRY'},
|
{bit: 10, group: 'other', name: 'TELEMETRY'},
|
||||||
{bit: 11, group: 'batteryCurrent', name: 'CURRENT_METER'},
|
{bit: 11, group: 'batteryCurrent', name: 'CURRENT_METER'},
|
||||||
|
@ -31,6 +30,16 @@ var Features = function (config) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (semver.gte(config.apiVersion, "1.15.0")) {
|
||||||
|
features.push(
|
||||||
|
{bit: 8, group: 'rxFailsafe', name: 'FAILSAFE', haveTip: true}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
features.push(
|
||||||
|
{bit: 8, group: 'rxFailsafe', name: 'FAILSAFE', haveTip: true}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (semver.gte(config.apiVersion, "1.16.0")) {
|
if (semver.gte(config.apiVersion, "1.16.0")) {
|
||||||
features.push(
|
features.push(
|
||||||
{bit: 21, group: 'other', name: 'TRANSPONDER', haveTip: true}
|
{bit: 21, group: 'other', name: 'TRANSPONDER', haveTip: true}
|
||||||
|
|
|
@ -1,7 +1,28 @@
|
||||||
|
Number.prototype.clamp = function(min, max) {
|
||||||
|
return Math.min(Math.max(this, min), max);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* String formatting now supports currying (partial application).
|
||||||
|
* For a format string with N replacement indices, you can call .format
|
||||||
|
* with M <= N arguments. The result is going to be a format string
|
||||||
|
* with N-M replacement indices, properly counting from 0 .. N-M.
|
||||||
|
* The following Example should explain the usage of partial applied format:
|
||||||
|
* "{0}:{1}:{2}".format("a","b","c") === "{0}:{1}:{2}".format("a","b").format("c")
|
||||||
|
* "{0}:{1}:{2}".format("a").format("b").format("c") === "{0}:{1}:{2}".format("a").format("b", "c")
|
||||||
|
**/
|
||||||
|
String.prototype.format = function () {
|
||||||
|
var args = arguments;
|
||||||
|
return this.replace(/\{(\d+)\}/g, function (t, i) {
|
||||||
|
return args[i] !== void 0 ? args[i] : "{"+(i-args.length)+"}";
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
Array.prototype.push8 = function(val) {
|
Array.prototype.push8 = function(val) {
|
||||||
this.push(0xFF & val);
|
this.push(0xFF & val);
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
Array.prototype.push16 = function(val) {
|
Array.prototype.push16 = function(val) {
|
||||||
// low byte
|
// low byte
|
||||||
this.push(0x00FF & val);
|
this.push(0x00FF & val);
|
||||||
|
@ -10,13 +31,15 @@ Array.prototype.push16 = function(val) {
|
||||||
// chainable
|
// chainable
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
Array.prototype.push32 = function(val) {
|
Array.prototype.push32 = function(val) {
|
||||||
this.push8(val)
|
this.push8(val)
|
||||||
.push8(val >> 8)
|
.push8(val >> 8)
|
||||||
.push8(val >> 16)
|
.push8(val >> 16)
|
||||||
.push8(val >> 24);
|
.push8(val >> 24);
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
DataView.prototype.offset = 0;
|
DataView.prototype.offset = 0;
|
||||||
DataView.prototype.readU8 = function() {
|
DataView.prototype.readU8 = function() {
|
||||||
if (this.byteLength >= this.offset+1) {
|
if (this.byteLength >= this.offset+1) {
|
||||||
|
@ -24,28 +47,32 @@ DataView.prototype.readU8 = function() {
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
DataView.prototype.readU16 = function() {
|
DataView.prototype.readU16 = function() {
|
||||||
if (this.byteLength >= this.offset+2) {
|
if (this.byteLength >= this.offset+2) {
|
||||||
return this.readU8() + this.readU8()*256;
|
return this.readU8() + this.readU8()*256;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
DataView.prototype.readU32 = function() {
|
DataView.prototype.readU32 = function() {
|
||||||
if (this.byteLength >= this.offset+4) {
|
if (this.byteLength >= this.offset+4) {
|
||||||
return this.readU16() + this.readU16()*65536;
|
return this.readU16() + this.readU16()*65536;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
DataView.prototype.read8 = function() {
|
DataView.prototype.read8 = function() {
|
||||||
if (this.byteLength >= this.offset+1) {
|
if (this.byteLength >= this.offset+1) {
|
||||||
return this.getInt8(this.offset++, 1);
|
return this.getInt8(this.offset++, 1);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
DataView.prototype.read16 = function() {
|
DataView.prototype.read16 = function() {
|
||||||
this.offset += 2;
|
this.offset += 2;
|
||||||
if (this.byteLength >= this.offset) {
|
if (this.byteLength >= this.offset) {
|
||||||
|
@ -53,7 +80,8 @@ DataView.prototype.read16 = function() {
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
DataView.prototype.read32 = function() {
|
DataView.prototype.read32 = function() {
|
||||||
this.offset += 4;
|
this.offset += 4;
|
||||||
if (this.byteLength >= this.offset) {
|
if (this.byteLength >= this.offset) {
|
||||||
|
@ -61,4 +89,4 @@ DataView.prototype.read32 = function() {
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
};
|
8
main.css
8
main.css
|
@ -1581,6 +1581,14 @@ dialog {
|
||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#expertMode {
|
||||||
|
color: #ddd;
|
||||||
|
margin-top: 16px;
|
||||||
|
width:125px;
|
||||||
|
float: right;
|
||||||
|
margin-right: 0px;
|
||||||
|
line-height: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Battery element styling*/
|
/* Battery element styling*/
|
||||||
|
|
||||||
|
|
48
main.html
48
main.html
|
@ -146,6 +146,12 @@
|
||||||
<div class="legend">Dataflash: free space</div>
|
<div class="legend">Dataflash: free space</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<div id="expertMode" align="center">
|
||||||
|
<label>
|
||||||
|
<input name="expertModeCheckbox" class="togglesmall" type="checkbox"/>
|
||||||
|
<span i18n="expertMode"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="sensor-status" class="sensor_state mode-connected">
|
<div id="sensor-status" class="sensor_state mode-connected">
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -195,28 +201,42 @@
|
||||||
<div class="tab_container">
|
<div class="tab_container">
|
||||||
<div id="tabs">
|
<div id="tabs">
|
||||||
<ul class="mode-disconnected">
|
<ul class="mode-disconnected">
|
||||||
<li class="tab_landing"><a href="#" i18n="tabLanding" class="tabicon ic_welcome" title="Welcome"></a></li>
|
<li class="tab_landing"><a href="#" i18n="tabLanding" class="tabicon ic_welcome" title="Welcome"></a>
|
||||||
<li class="tab_help"><a href="#" i18n="tabHelp" class="tabicon ic_help" title="Documentation & Support"></a></li>
|
</li>
|
||||||
<li class="tab_firmware_flasher"><a href="#" i18n="tabFirmwareFlasher" class="tabicon ic_flasher" title="Firmware Flasher"></a></li>
|
<li class="tab_help"><a href="#" i18n="tabHelp" class="tabicon ic_help"
|
||||||
|
title="Documentation & Support"></a></li>
|
||||||
|
<li class="tab_firmware_flasher"><a href="#" i18n="tabFirmwareFlasher" class="tabicon ic_flasher"
|
||||||
|
title="Firmware Flasher"></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="mode-connected">
|
<ul class="mode-connected">
|
||||||
<li class="tab_setup"><a href="#" i18n="tabSetup" class="tabicon ic_setup" title="Setup"></a></li>
|
<li class="tab_setup"><a href="#" i18n="tabSetup" class="tabicon ic_setup" title="Setup"></a></li>
|
||||||
<li class="tab_ports"><a href="#" i18n="tabPorts" class="tabicon ic_ports" title="Ports"></a></li>
|
<li class="tab_ports"><a href="#" i18n="tabPorts" class="tabicon ic_ports" title="Ports"></a></li>
|
||||||
<li class="tab_configuration"><a href="#" i18n="tabConfiguration" class="tabicon ic_config" title="Configuration"></a></li>
|
<li class="tab_configuration"><a href="#" i18n="tabConfiguration" class="tabicon ic_config"
|
||||||
<li class="tab_failsafe"><a href="#" i18n="tabFailsafe" class="tabicon ic_failsafe" title="Failsafe"></a></li>
|
title="Configuration"></a></li>
|
||||||
<li class="tab_pid_tuning"><a href="#" i18n="tabPidTuning" class="tabicon ic_pid" title="PID Tuning"></a></li>
|
<li class="tab_failsafe"><a href="#" i18n="tabFailsafe" class="tabicon ic_failsafe"
|
||||||
|
title="Failsafe"></a></li>
|
||||||
|
<li class="tab_pid_tuning"><a href="#" i18n="tabPidTuning" class="tabicon ic_pid"
|
||||||
|
title="PID Tuning"></a></li>
|
||||||
<li class="tab_receiver"><a href="#" i18n="tabReceiver" class="tabicon ic_rx" title="Receiver"></a></li>
|
<li class="tab_receiver"><a href="#" i18n="tabReceiver" class="tabicon ic_rx" title="Receiver"></a></li>
|
||||||
<li class="tab_auxiliary"><a href="#" i18n="tabAuxiliary" class="tabicon ic_modes" title="Modes"></a></li>
|
<li class="tab_auxiliary"><a href="#" i18n="tabAuxiliary" class="tabicon ic_modes" title="Modes"></a>
|
||||||
<li class="tab_adjustments"><a href="#" i18n="tabAdjustments" class="tabicon ic_adjust" title="Adjustments"></a></li>
|
</li>
|
||||||
|
<li class="tab_adjustments"><a href="#" i18n="tabAdjustments" class="tabicon ic_adjust"
|
||||||
|
title="Adjustments"></a></li>
|
||||||
<li class="tab_servos"><a href="#" i18n="tabServos" class="tabicon ic_servo" title="Servos"></a></li>
|
<li class="tab_servos"><a href="#" i18n="tabServos" class="tabicon ic_servo" title="Servos"></a></li>
|
||||||
<li class="tab_gps"><a href="#" i18n="tabGPS" class="tabicon ic_gps" title="GPS"></a></li>
|
<li class="tab_gps"><a href="#" i18n="tabGPS" class="tabicon ic_gps" title="GPS"></a></li>
|
||||||
<li class="tab_motors"><a href="#" i18n="tabMotorTesting" class="tabicon ic_motor" title="Motors"></a></li>
|
<li class="tab_motors"><a href="#" i18n="tabMotorTesting" class="tabicon ic_motor" title="Motors"></a>
|
||||||
|
</li>
|
||||||
<li class="tab_osd"><a href="#" i18n="tabOsd" class="tabicon ic_osd" title="Osd"></a></li>
|
<li class="tab_osd"><a href="#" i18n="tabOsd" class="tabicon ic_osd" title="Osd"></a></li>
|
||||||
<li class="tab_transponder"><a href="#" i18n="tabTransponder" class="tabicon ic_transponder" title="Transponder"></a></li>
|
<li class="tab_transponder"><a href="#" i18n="tabTransponder" class="tabicon ic_transponder"
|
||||||
<li class="tab_led_strip"><a href="#" i18n="tabLedStrip" class="tabicon ic_led" title="LED Strip"></a></li>
|
title="Transponder"></a></li>
|
||||||
<li class="tab_sensors"><a href="#" i18n="tabRawSensorData" class="tabicon ic_sensors" title="Sensors"></a></li>
|
<li class="tab_led_strip"><a href="#" i18n="tabLedStrip" class="tabicon ic_led" title="LED Strip"></a>
|
||||||
<li class="tab_logging"><a href="#" i18n="tabLogging" class="tabicon ic_log" title="Tethered Logging"></a></li>
|
</li>
|
||||||
<li class="tab_onboard_logging"><a href="#" i18n="tabOnboardLogging" class="tabicon ic_data" title="Onboard Logging"></a></li>
|
<li class="tab_sensors"><a href="#" i18n="tabRawSensorData" class="tabicon ic_sensors"
|
||||||
|
title="Sensors"></a></li>
|
||||||
|
<li class="tab_logging"><a href="#" i18n="tabLogging" class="tabicon ic_log"
|
||||||
|
title="Tethered Logging"></a></li>
|
||||||
|
<li class="tab_onboard_logging"><a href="#" i18n="tabOnboardLogging" class="tabicon ic_data"
|
||||||
|
title="Onboard Logging"></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="mode-connected-cli">
|
<ul class="mode-connected-cli">
|
||||||
<li class="tab_cli"><a href="#" i18n="tabCLI" class="tabicon ic_cli" title="CLI"></a></li>
|
<li class="tab_cli"><a href="#" i18n="tabCLI" class="tabicon ic_cli" title="CLI"></a></li>
|
||||||
|
|
87
main.js
87
main.js
|
@ -41,7 +41,10 @@ $(document).ready(function () {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
chrome.storage.local.set({'lastVersionChecked': $.now(), 'lastVersionAvailableOnline': versions[0].name}, function(result) {
|
chrome.storage.local.set({
|
||||||
|
'lastVersionChecked': $.now(),
|
||||||
|
'lastVersionAvailableOnline': versions[0].name
|
||||||
|
}, function (result) {
|
||||||
console.log("Latest version available online: " + versions[0].name);
|
console.log("Latest version available online: " + versions[0].name);
|
||||||
});
|
});
|
||||||
notifyOutdatedVersion(versions[0].name);
|
notifyOutdatedVersion(versions[0].name);
|
||||||
|
@ -206,13 +209,31 @@ $(document).ready(function () {
|
||||||
if (typeof result.update_notify === 'undefined' || result.update_notify) {
|
if (typeof result.update_notify === 'undefined' || result.update_notify) {
|
||||||
$('div.notifications input').prop('checked', true);
|
$('div.notifications input').prop('checked', true);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
$('div.notifications input').change(function () {
|
$('div.notifications input').change(function () {
|
||||||
var check = $(this).is(':checked');
|
var check = $(this).is(':checked');
|
||||||
|
|
||||||
chrome.storage.local.set({'update_notify': check});
|
chrome.storage.local.set({'update_notify': check});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
chrome.storage.local.get('permanentExpertMode', function (result) {
|
||||||
|
if (result.permanentExpertMode) {
|
||||||
|
$('div.permanentExpertMode input').prop('checked', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$('div.permanentExpertMode input').change(function () {
|
||||||
|
var checked = $(this).is(':checked');
|
||||||
|
|
||||||
|
chrome.storage.local.set({'permanentExpertMode': checked});
|
||||||
|
|
||||||
|
$('input[name="expertModeCheckbox"]').prop('checked', checked).change();
|
||||||
|
if (BF_CONFIG) {
|
||||||
|
updateTabList(BF_CONFIG.features);
|
||||||
|
}
|
||||||
|
|
||||||
|
}).change();
|
||||||
|
});
|
||||||
|
|
||||||
function close_and_cleanup(e) {
|
function close_and_cleanup(e) {
|
||||||
if (e.type == 'click' && !$.contains($('div#options-window')[0], e.target) || e.type == 'keyup' && e.keyCode == 27) {
|
if (e.type == 'click' && !$.contains($('div#options-window')[0], e.target) || e.type == 'keyup' && e.keyCode == 27) {
|
||||||
|
@ -333,7 +354,18 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
$(this).text(state ? 'Hide Log' : 'Show Log');
|
$(this).text(state ? 'Hide Log' : 'Show Log');
|
||||||
$(this).data('state', state);
|
$(this).data('state', state);
|
||||||
|
});
|
||||||
|
|
||||||
|
chrome.storage.local.get('permanentExpertMode', function (result) {
|
||||||
|
if (result.permanentExpertMode) {
|
||||||
|
$('input[name="expertModeCheckbox"]').prop('checked', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$('input[name="expertModeCheckbox"]').change(function () {
|
||||||
|
if (BF_CONFIG) {
|
||||||
|
updateTabList(BF_CONFIG.features);
|
||||||
|
}
|
||||||
|
}).change();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -379,45 +411,52 @@ function bytesToSize(bytes) {
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
Number.prototype.clamp = function(min, max) {
|
function isExpertModeEnabled() {
|
||||||
return Math.min(Math.max(this, min), max);
|
return $('input[name="expertModeCheckbox"]').is(':checked');
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* String formatting now supports currying (partial application).
|
|
||||||
* For a format string with N replacement indices, you can call .format
|
|
||||||
* with M <= N arguments. The result is going to be a format string
|
|
||||||
* with N-M replacement indices, properly counting from 0 .. N-M.
|
|
||||||
* The following Example should explain the usage of partial applied format:
|
|
||||||
* "{0}:{1}:{2}".format("a","b","c") === "{0}:{1}:{2}".format("a","b").format("c")
|
|
||||||
* "{0}:{1}:{2}".format("a").format("b").format("c") === "{0}:{1}:{2}".format("a").format("b", "c")
|
|
||||||
**/
|
|
||||||
String.prototype.format = function () {
|
|
||||||
var args = arguments;
|
|
||||||
return this.replace(/\{(\d+)\}/g, function (t, i) {
|
|
||||||
return args[i] !== void 0 ? args[i] : "{"+(i-args.length)+"}";
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
function updateTabList(features) {
|
function updateTabList(features) {
|
||||||
if (features.isEnabled('GPS')) {
|
if (features.isEnabled('GPS') && isExpertModeEnabled()) {
|
||||||
$('#tabs ul.mode-connected li.tab_gps').show();
|
$('#tabs ul.mode-connected li.tab_gps').show();
|
||||||
} else {
|
} else {
|
||||||
$('#tabs ul.mode-connected li.tab_gps').hide();
|
$('#tabs ul.mode-connected li.tab_gps').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (features.isEnabled('FAILSAFE')) {
|
if (isExpertModeEnabled()) {
|
||||||
$('#tabs ul.mode-connected li.tab_failsafe').show();
|
$('#tabs ul.mode-connected li.tab_failsafe').show();
|
||||||
} else {
|
} else {
|
||||||
$('#tabs ul.mode-connected li.tab_failsafe').hide();
|
$('#tabs ul.mode-connected li.tab_failsafe').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isExpertModeEnabled()) {
|
||||||
|
$('#tabs ul.mode-connected li.tab_adjustments').show();
|
||||||
|
} else {
|
||||||
|
$('#tabs ul.mode-connected li.tab_adjustments').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isExpertModeEnabled()) {
|
||||||
|
$('#tabs ul.mode-connected li.tab_servos').show();
|
||||||
|
} else {
|
||||||
|
$('#tabs ul.mode-connected li.tab_servos').hide();
|
||||||
|
}
|
||||||
|
|
||||||
if (features.isEnabled('LED_STRIP')) {
|
if (features.isEnabled('LED_STRIP')) {
|
||||||
$('#tabs ul.mode-connected li.tab_led_strip').show();
|
$('#tabs ul.mode-connected li.tab_led_strip').show();
|
||||||
} else {
|
} else {
|
||||||
$('#tabs ul.mode-connected li.tab_led_strip').hide();
|
$('#tabs ul.mode-connected li.tab_led_strip').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isExpertModeEnabled()) {
|
||||||
|
$('#tabs ul.mode-connected li.tab_sensors').show();
|
||||||
|
} else {
|
||||||
|
$('#tabs ul.mode-connected li.tab_sensors').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isExpertModeEnabled()) {
|
||||||
|
$('#tabs ul.mode-connected li.tab_logging').show();
|
||||||
|
} else {
|
||||||
|
$('#tabs ul.mode-connected li.tab_logging').hide();
|
||||||
|
}
|
||||||
|
|
||||||
if (features.isEnabled('BLACKBOX')) {
|
if (features.isEnabled('BLACKBOX')) {
|
||||||
$('#tabs ul.mode-connected li.tab_onboard_logging').show();
|
$('#tabs ul.mode-connected li.tab_onboard_logging').show();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -252,6 +252,37 @@
|
||||||
height: 90px;
|
height: 90px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tab-failsafe .featuresNew {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-failsafe .featuresNew tr {
|
||||||
|
width: 100%;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
float: left;
|
||||||
|
padding: 0px;
|
||||||
|
padding-bottom: 6px;
|
||||||
|
margin-bottom: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-failsafe .featuresNew td:first-child {
|
||||||
|
width: 52px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-failsafe .featuresNew td:last-child {
|
||||||
|
width: calc(100% - 125px);
|
||||||
|
margin-right: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-failsafe .featuresNew td {
|
||||||
|
float: left;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-failsafe .featuresNew .helpicon {
|
||||||
|
margin-right: -2px;
|
||||||
|
}
|
||||||
|
|
||||||
.tab-failsafe table {
|
.tab-failsafe table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,11 @@
|
||||||
<div class="spacer_box_title" i18n="failsafePaneTitleOld"></div>
|
<div class="spacer_box_title" i18n="failsafePaneTitleOld"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="spacer_box">
|
<div class="spacer_box">
|
||||||
|
<table>
|
||||||
|
<tbody class="featuresOld rxFailsafe">
|
||||||
|
<!-- table generated here -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
<div class="number">
|
<div class="number">
|
||||||
<label> <input type="number" name="failsafe_throttle_old" min="0" max="2000" /> <span
|
<label> <input type="number" name="failsafe_throttle_old" min="0" max="2000" /> <span
|
||||||
i18n="failsafeThrottleItemOld"></span>
|
i18n="failsafeThrottleItemOld"></span>
|
||||||
|
@ -65,6 +70,11 @@
|
||||||
<div class="spacer_box_title" i18n="failsafeStageTwoSettingsTitle"></div>
|
<div class="spacer_box_title" i18n="failsafeStageTwoSettingsTitle"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="spacer_box">
|
<div class="spacer_box">
|
||||||
|
<table>
|
||||||
|
<tbody class="featuresNew rxFailsafe">
|
||||||
|
<!-- table generated here -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
<div class="checkbox stage2">
|
<div class="checkbox stage2">
|
||||||
<div class="numberspacer" >
|
<div class="numberspacer" >
|
||||||
<input type="checkbox" name="failsafe_kill_switch" class="toggle" id="failsafe_kill_switch" />
|
<input type="checkbox" name="failsafe_kill_switch" class="toggle" id="failsafe_kill_switch" />
|
||||||
|
|
|
@ -63,6 +63,15 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_html() {
|
function process_html() {
|
||||||
|
// fill stage 2 fields
|
||||||
|
function toggleStage2(doShow) {
|
||||||
|
if (doShow) {
|
||||||
|
$('div.stage2').show();
|
||||||
|
} else {
|
||||||
|
$('div.stage2').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Conditionally hide the old or the new control pane's
|
// Conditionally hide the old or the new control pane's
|
||||||
if(apiVersionGte1_15_0) {
|
if(apiVersionGte1_15_0) {
|
||||||
var oldPane = $('div.oldpane');
|
var oldPane = $('div.oldpane');
|
||||||
|
@ -199,6 +208,14 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
|
||||||
channel_mode_array[i].change();
|
channel_mode_array[i].change();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BF_CONFIG.features.generateElements($('.tab-failsafe .featuresNew'));
|
||||||
|
|
||||||
|
var failsafeFeature = $('input[name="FAILSAFE"]');
|
||||||
|
failsafeFeature.change(function () {
|
||||||
|
toggleStage2($(this).is(':checked'));
|
||||||
|
});
|
||||||
|
toggleStage2(BF_CONFIG.features.isEnabled('FAILSAFE'));
|
||||||
|
|
||||||
$('input[name="failsafe_throttle"]').val(FAILSAFE_CONFIG.failsafe_throttle);
|
$('input[name="failsafe_throttle"]').val(FAILSAFE_CONFIG.failsafe_throttle);
|
||||||
$('input[name="failsafe_off_delay"]').val(FAILSAFE_CONFIG.failsafe_off_delay);
|
$('input[name="failsafe_off_delay"]').val(FAILSAFE_CONFIG.failsafe_off_delay);
|
||||||
$('input[name="failsafe_throttle_low_delay"]').val(FAILSAFE_CONFIG.failsafe_throttle_low_delay);
|
$('input[name="failsafe_throttle_low_delay"]').val(FAILSAFE_CONFIG.failsafe_throttle_low_delay);
|
||||||
|
@ -244,6 +261,7 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
|
||||||
$('input[name="failsafe_kill_switch"]').prop('checked', FAILSAFE_CONFIG.failsafe_kill_switch);
|
$('input[name="failsafe_kill_switch"]').prop('checked', FAILSAFE_CONFIG.failsafe_kill_switch);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
BF_CONFIG.features.generateElements($('.tab-failsafe .featuresOld'));
|
||||||
// fill failsafe_throttle field (pre API 1.15.0)
|
// fill failsafe_throttle field (pre API 1.15.0)
|
||||||
$('input[name="failsafe_throttle_old"]').val(MISC.failsafe_throttle);
|
$('input[name="failsafe_throttle_old"]').val(MISC.failsafe_throttle);
|
||||||
}
|
}
|
||||||
|
@ -251,6 +269,8 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
|
||||||
$('a.save').click(function () {
|
$('a.save').click(function () {
|
||||||
// gather data that doesn't have automatic change event bound
|
// gather data that doesn't have automatic change event bound
|
||||||
|
|
||||||
|
BF_CONFIG.features.updateData($('input[name="FAILSAFE"]'));
|
||||||
|
|
||||||
if(apiVersionGte1_15_0) {
|
if(apiVersionGte1_15_0) {
|
||||||
RX_CONFIG.rx_min_usec = parseInt($('input[name="rx_min_usec"]').val());
|
RX_CONFIG.rx_min_usec = parseInt($('input[name="rx_min_usec"]').val());
|
||||||
RX_CONFIG.rx_max_usec = parseInt($('input[name="rx_max_usec"]').val());
|
RX_CONFIG.rx_max_usec = parseInt($('input[name="rx_max_usec"]').val());
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="notifications">
|
<div class="notifications">
|
||||||
<label><input type="checkbox" /><span i18n="options_receive_app_notifications"></span></label>
|
<label><input type="checkbox" /><span i18n="options_receive_app_notifications"></span></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="statistics">
|
<div class="permanentExpertMode">
|
||||||
<label><input type="checkbox" /><span i18n="options_improve_configurator"></span></label>
|
<label><input type="checkbox" /><span i18n="permanentExpertMode"></span></label>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue