Fix additional tabs

pull/2063/head
Pawel Spychalski (DzikuVx) 5 months ago
parent a4c3490d38
commit 07600e1fa6

@ -618,7 +618,7 @@ var Settings = (function () {
var input = inputs.shift();
var settingPair = self.processInput(input);
return mspHelper.setSetting(settingPair.setting, settingPair.value, function() {
return self.pickAndSaveSingleInput(inputs);
return self.pickAndSaveSingleInput(inputs, finalCallback);
});
} else {
if (finalCallback) {

@ -1714,7 +1714,9 @@
"auxiliaryEepromSaved": {
"message": "EEPROM <span style=\"color: #37a8db\">saved</span>"
},
"eepromSaved": {
"message": "EEPROM <span style=\"color: #37a8db\">saved</span>"
},
"adjustmentsHelp": {
"message": "Configure adjustment switches. See the 'in-flight adjustments' section of the manual for details. The changes that adjustment functions make are not saved automatically. There are 4 slots. Each switch used to concurrently make adjustments requires exclusive use of a slot."
},

@ -216,7 +216,7 @@
</div>
<div class="number">
<input type="number" id="cruiseYawRate" data-setting="nav_fw_cruise_yaw_rate" data-setting-multiplier="1" step="1" min="0" max="60" />
<input type="number" id="cruiseYawRate" data-setting="nav_cruise_yaw_rate" data-setting-multiplier="1" step="1" min="0" max="60" />
<label for="cruiseYawRate"><span data-i18n="cruiseYawRateLabel"></span></label>
<div for="cruiseYawRate" class="helpicon cf_tip" data-i18n_title="cruiseYawRateHelp"></div>
</div>

@ -19,6 +19,20 @@ TABS.advanced_tuning.initialize = function (callback) {
loadHtml();
function save_to_eeprom() {
console.log('save_to_eeprom');
MSP.send_message(MSPCodes.MSP_EEPROM_WRITE, false, false, function () {
GUI.log(i18n.getMessage('eepromSaved'));
GUI.tab_switch_cleanup(function () {
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false, function () {
GUI.log(i18n.getMessage('deviceRebooting'));
GUI.handleReconnect($('.tab_advanced_tuning a'));
});
});
});
}
function loadHtml() {
GUI.load(path.join(__dirname, "advanced_tuning.html"), Settings.processHtml(function () {
@ -68,35 +82,12 @@ TABS.advanced_tuning.initialize = function (callback) {
TABS.advanced_tuning.checkRequirements_LinearDescent();
$('a.save').on('click', function () {
Settings.saveInputs().then(function () {
var self = this;
MSP.promise(MSPCodes.MSP_EEPROM_WRITE);
var oldText = $(this).text();
$(this).html("Saved");
setTimeout(function () {
$(self).html(oldText);
}, 2000);
reboot();
});
Settings.saveInputs(save_to_eeprom);
});
GUI.content_ready(callback);
}));
}
function reboot() {
//noinspection JSUnresolvedVariable
GUI.log(i18n.getMessage('configurationEepromSaved'));
GUI.tab_switch_cleanup(function () {
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false, reinitialize);
});
}
function reinitialize() {
//noinspection JSUnresolvedVariable
GUI.log(i18n.getMessage('deviceRebooting'));
GUI.handleReconnect($('.tab_advanced_tuning a'));
}
};

@ -52,7 +52,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
];
function saveSettings(onComplete) {
Settings.saveInputs().then(onComplete);
Settings.saveInputs(onComplete);
}
saveChainer.setChain(saveChain);

@ -127,29 +127,22 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
load_failssafe_config();
function savePhaseTwo() {
Settings.saveInputs().then(function () {
var self = this;
MSP.promise(MSPCodes.MSP_EEPROM_WRITE);
setTimeout(function () {
$(self).html('');
}, 2000);
reboot();
});
}
function save_to_eeprom() {
console.log('save_to_eeprom');
MSP.send_message(MSPCodes.MSP_EEPROM_WRITE, false, false, function () {
GUI.log(i18n.getMessage('eepromSaved'));
function reboot() {
//noinspection JSUnresolvedVariable
GUI.log(i18n.getMessage('configurationEepromSaved'));
GUI.tab_switch_cleanup(function () {
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false, reinitialize);
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false, function () {
GUI.log(i18n.getMessage('deviceRebooting'));
GUI.handleReconnect($('.tab_failsafe a'));
});
});
});
}
function reinitialize() {
//noinspection JSUnresolvedVariable
GUI.log(i18n.getMessage('deviceRebooting'));
GUI.handleReconnect($('.tab_failsafe a'));
function savePhaseTwo() {
Settings.saveInputs(save_to_eeprom);
}
};

@ -73,7 +73,7 @@ TABS.gps.initialize = function (callback) {
];
function saveSettings(onComplete) {
Settings.saveInputs().then(onComplete);
Settings.saveInputs(onComplete);
}
saveChainer.setChain(saveChain);

@ -58,7 +58,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
saveChainer.setExitPoint(reboot);
function saveSettings(onComplete) {
Settings.saveInputs().then(onComplete);
Settings.saveInputs(onComplete);
}
function reboot() {

@ -3256,6 +3256,20 @@ TABS.osd.initialize = function (callback) {
GUI.active_tab = 'osd';
}
function save_to_eeprom() {
console.log('save_to_eeprom');
MSP.send_message(MSPCodes.MSP_EEPROM_WRITE, false, false, function () {
GUI.log(i18n.getMessage('eepromSaved'));
GUI.tab_switch_cleanup(function () {
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false, function () {
GUI.log(i18n.getMessage('deviceRebooting'));
GUI.handleReconnect($('.tab_osd a'));
});
});
});
}
GUI.load(path.join(__dirname, "osd.html"), Settings.processHtml(function () {
// translate to user-selected language
i18n.localize();
@ -3274,16 +3288,7 @@ TABS.osd.initialize = function (callback) {
});
$('a.save').on('click', function () {
Settings.saveInputs().then(function () {
var self = this;
MSP.promise(MSPCodes.MSP_EEPROM_WRITE);
GUI.log(i18n.getMessage('osdSettingsSaved'));
var oldText = $(this).text();
$(this).html("Saved");
setTimeout(function () {
$(self).html(oldText);
}, 2000);
});
Settings.saveInputs(save_to_eeprom);
});
// Initialise guides checkbox

@ -79,7 +79,7 @@ TABS.outputs.initialize = function (callback) {
}
function saveSettings(onComplete) {
Settings.saveInputs().then(onComplete);
Settings.saveInputs(onComplete);
}
function onLoad() {

@ -44,7 +44,7 @@ TABS.receiver.initialize = function (callback) {
}
function saveSettings(onComplete) {
Settings.saveInputs().then(onComplete);
Settings.saveInputs(onComplete);
}
function drawRollPitchExpo() {

Loading…
Cancel
Save