1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-13 11:29:53 +03:00

Fix profile change not working

Initially, I thought that the profiles were not changing when you selected a new profile from the select box. It turns out that this was only happening after setting up from the defaults dialog. The problem was that the `periodicStatusUpdater` was being stopped to perform the parameter upload. But not re-started. I added a function to resume the updater, and everything works as it should. I made a few other changes:
- Tidied up the setting of the parameters for each profile
- Added specific `set` profile messages, rather than `loaded` being repeated
- Only show messages for the profiles that have changed, not all of them
This commit is contained in:
Mr D - RC 2024-09-21 10:11:22 +01:00
parent 45e7e41b96
commit c0e02494f6
7 changed files with 60 additions and 64 deletions

View file

@ -532,7 +532,7 @@ $(function() {
mixerprofile_e.on('change', function () {
var mixerprofile = parseInt($(this).val());
MSP.send_message(MSPCodes.MSP2_INAV_SELECT_MIXER_PROFILE, [mixerprofile], false, function () {
GUI.log(i18n.getMessage('loadedMixerProfile', [mixerprofile + 1]));
GUI.log(i18n.getMessage('setMixerProfile', [mixerprofile + 1]));
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false, function () {
GUI.log(i18n.getMessage('deviceRebooting'));
GUI.handleReconnect();
@ -545,7 +545,7 @@ $(function() {
profile_e.on('change', function () {
var profile = parseInt($(this).val());
MSP.send_message(MSPCodes.MSP_SELECT_SETTING, [profile], false, function () {
GUI.log(i18n.getMessage('pidTuning_LoadedProfile', [profile + 1]));
GUI.log(i18n.getMessage('setControlProfile', [profile + 1]));
});
});
@ -554,7 +554,7 @@ $(function() {
batteryprofile_e.on('change', function () {
var batteryprofile = parseInt($(this).val());
MSP.send_message(MSPCodes.MSP2_INAV_SELECT_BATTERY_PROFILE, [batteryprofile], false, function () {
GUI.log(i18n.getMessage('loadedBatteryProfile', [batteryprofile + 1]));
GUI.log(i18n.getMessage('setBatteryProfile', [batteryprofile + 1]));
});
});