mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-15 04:15:28 +03:00
Add support for battery profiles
This commit is contained in:
parent
a1b807fc4b
commit
e945c0749c
11 changed files with 131 additions and 8 deletions
16
main.js
16
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue