Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/iNavFlight/inav-configurator.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Pastor <shellixyz@gmail.com>2018-06-15 17:42:00 +0300
committerMichel Pastor <shellixyz@gmail.com>2018-06-16 05:26:35 +0300
commite945c0749cb521d57723e6ec1c2005b61c0c46d6 (patch)
treec9210101fec6793dc650455407a4ee55cfb1a5ed /main.js
parenta1b807fc4b593341bcfe49897e49e56219ea6318 (diff)
Add support for battery profiles
Diffstat (limited to 'main.js')
-rw-r--r--main.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/main.js b/main.js
index 6e665fad..57f2d40f 100644
--- a/main.js
+++ b/main.js
@@ -109,6 +109,12 @@ $(document).ready(function () {
var tab = tabClass.substring(4);
var tabName = $(self).text();
+ if (CONFIGURATOR.connectionValid && semver.lt(CONFIG.flightControllerVersion, "2.0.0")) {
+ $('#battery_profile_change').hide();
+ $('#profile_change').css('width', '125px');
+ $('#dataflash_wrapper_global').css('width', '125px');
+ }
+
if (tabRequiresConnection && !CONFIGURATOR.connectionValid) {
GUI.log(chrome.i18n.getMessage('tabSwitchConnectionRequired'));
return;
@@ -412,6 +418,16 @@ $(document).ready(function () {
updateActivatedTab();
});
});
+
+ var batteryprofile_e = $('#batteryprofilechange');
+
+ batteryprofile_e.change(function () {
+ var batteryprofile = parseInt($(this).val());
+ MSP.send_message(MSPCodes.MSP2_INAV_SELECT_BATTERY_PROFILE, [batteryprofile], false, function () {
+ GUI.log(chrome.i18n.getMessage('loadedBatteryProfile', [batteryprofile + 1]));
+ updateActivatedTab();
+ });
+ });
});
function catch_startup_time(startTime) {