diff options
author | Michel Pastor <shellixyz@gmail.com> | 2018-06-15 17:42:00 +0300 |
---|---|---|
committer | Michel Pastor <shellixyz@gmail.com> | 2018-06-16 05:26:35 +0300 |
commit | e945c0749cb521d57723e6ec1c2005b61c0c46d6 (patch) | |
tree | c9210101fec6793dc650455407a4ee55cfb1a5ed /main.js | |
parent | a1b807fc4b593341bcfe49897e49e56219ea6318 (diff) |
Add support for battery profiles
Diffstat (limited to 'main.js')
-rw-r--r-- | main.js | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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) { |