- Altered the timing for setting defaults
- Only show messages for profile changes that happen
pull/2195/head
Mr D - RC 6 days ago
parent 8fbe25c296
commit 780ab3b950

@ -1596,6 +1596,15 @@
"loadedBatteryProfile": {
"message": "Loaded Battery Profile: <strong style=\"color: #37a8db\">$1</strong>"
},
"setControlProfile" : {
"message": "Set Control Profile: <strong style=\"color: #37a8db\">$1</strong>"
},
"setMixerProfile": {
"message": "Setting Mixer Profile: <strong style=\"color: #37a8db\">$1</strong>"
},
"setBatteryProfile": {
"message": "Setting Battery Profile: <strong style=\"color: #37a8db\">$1</strong>"
},
"pidTuningDataRefreshed": {
"message": "PID data <strong>refreshed</strong>"
},

@ -1250,11 +1250,11 @@ helper.defaultsDialog = (function () {
privateScope.finalize(selectedDefaultPreset);
});
let timeout = (miscChain.length * 150) + 2000;
let timeout = (miscChain.length * 250) + 7000;
let timeOut0 = setTimeout(profileChainer[0].execute, timeout);
timeout+= (profileChain[0].length * 150) + 4000;
timeout+= (profileChain[0].length * 250) + 5000;
let timeOut1 = setTimeout(profileChainer[1].execute, timeout);
timeout+= (profileChain[1].length * 150) + 4000;
timeout+= (profileChain[1].length * 250) + 5000;
let timeOut2 = setTimeout(profileChainer[2].execute, timeout);
}

@ -264,10 +264,16 @@ GUI_control.prototype.updateProfileChange = function(refresh) {
$('#mixerprofilechange').val(CONFIG.mixer_profile);
$('#profilechange').val(CONFIG.profile);
$('#batteryprofilechange').val(CONFIG.battery_profile);
if (refresh) {
GUI.log(chrome.i18n.getMessage('loadedMixerProfile', [CONFIG.mixer_profile + 1]));
GUI.log(chrome.i18n.getMessage('pidTuning_LoadedProfile', [CONFIG.profile + 1]));
GUI.log(chrome.i18n.getMessage('loadedBatteryProfile', [CONFIG.battery_profile + 1]));
if (refresh > 0) {
if (refresh & mspHelper.PROFILES_CHANGED.MIXER) {
GUI.log(chrome.i18n.getMessage('loadedMixerProfile', [CONFIG.mixer_profile + 1]));
}
if (refresh & mspHelper.PROFILES_CHANGED.CONTROL) {
GUI.log(chrome.i18n.getMessage('pidTuning_LoadedProfile', [CONFIG.profile + 1]));
}
if (refresh & mspHelper.PROFILES_CHANGED.BATTERY) {
GUI.log(chrome.i18n.getMessage('loadedBatteryProfile', [CONFIG.battery_profile + 1]));
}
updateActivatedTab();
}
};

@ -4,6 +4,12 @@
var mspHelper = (function (gui) {
var self = {};
self.PROFILES_CHANGED = {
'CONTROL' : 1,
'BATTERY' : 2,
'MIXER' : 4
};
self.BAUD_RATES_post1_6_3 = [
'AUTO',
'1200',
@ -69,7 +75,7 @@ var mspHelper = (function (gui) {
color;
if (!dataHandler.unsupported || dataHandler.unsupported) switch (dataHandler.code) {
case MSPCodes.MSPV2_INAV_STATUS:
let profile_changed = false;
let profile_changed = 0;
CONFIG.cycleTime = data.getUint16(offset, true);
offset += 2;
CONFIG.i2cError = data.getUint16(offset, true);
@ -81,11 +87,15 @@ var mspHelper = (function (gui) {
profile_byte = data.getUint8(offset++)
let profile = profile_byte & 0x0F;
profile_changed |= (profile !== CONFIG.profile) && (CONFIG.profile !==-1);
if ((profile !== CONFIG.profile) && (CONFIG.profile !==-1)) {
profile_changed |= this.PROFILES_CHANGED.CONTROL;
}
CONFIG.profile = profile;
let battery_profile = (profile_byte & 0xF0) >> 4;
profile_changed |= (battery_profile !== CONFIG.battery_profile) && (CONFIG.battery_profile !==-1);
if ((battery_profile !== CONFIG.battery_profile) && (CONFIG.battery_profile !==-1)) {
profile_changed |= this.PROFILES_CHANGED.BATTERY;
}
CONFIG.battery_profile = battery_profile;
CONFIG.armingFlags = data.getUint32(offset, true);
@ -95,7 +105,9 @@ var mspHelper = (function (gui) {
//read mixer profile as the last byte in the the message
profile_byte = data.getUint8(dataHandler.message_length_expected - 1);
let mixer_profile = profile_byte & 0x0F;
profile_changed |= (mixer_profile !== CONFIG.mixer_profile) && (CONFIG.mixer_profile !==-1);
if ((mixer_profile !== CONFIG.mixer_profile) && (CONFIG.mixer_profile !==-1)) {
profile_changed |= this.PROFILES_CHANGED.MIXER;
}
CONFIG.mixer_profile = mixer_profile;
gui.updateStatusBar();

@ -575,7 +575,7 @@ $(document).ready(function () {
mixerprofile_e.change(function () {
var mixerprofile = parseInt($(this).val());
MSP.send_message(MSPCodes.MSP2_INAV_SELECT_MIXER_PROFILE, [mixerprofile], false, function () {
GUI.log(chrome.i18n.getMessage('loadedMixerProfile', [mixerprofile + 1]));
GUI.log(chrome.i18n.getMessage('setMixerProfile', [mixerprofile + 1]));
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false, function () {
GUI.log(chrome.i18n.getMessage('deviceRebooting'));
GUI.handleReconnect();
@ -588,7 +588,7 @@ $(document).ready(function () {
profile_e.change(function () {
var profile = parseInt($(this).val());
MSP.send_message(MSPCodes.MSP_SELECT_SETTING, [profile], false, function () {
GUI.log(chrome.i18n.getMessage('pidTuning_LoadedProfile', [profile + 1]));
GUI.log(chrome.i18n.getMessage('setControlProfile', [profile + 1]));
});
});
@ -597,7 +597,7 @@ $(document).ready(function () {
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]));
GUI.log(chrome.i18n.getMessage('setBatteryProfile', [batteryprofile + 1]));
});
});
});

Loading…
Cancel
Save