Skip to content

Commit

Permalink
Merge pull request #1876 from iNavFlight/release_7.0.0
Browse files Browse the repository at this point in the history
Release 7.0.0
  • Loading branch information
DzikuVx authored Dec 6, 2023
2 parents 650001c + 3a26db0 commit a659b09
Show file tree
Hide file tree
Showing 27 changed files with 222 additions and 191 deletions.
6 changes: 3 additions & 3 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@
"message": "Pitch trim for self-leveling flight modes. In degrees. +5 means airplane nose should be raised 5 deg from level"
},
"pidTuning_ButtonSave": {
"message": "Save"
"message": "Save and Reboot"
},
"pidTuning_ButtonRefresh": {
"message": "Refresh"
Expand Down Expand Up @@ -2220,7 +2220,7 @@
"message": "Blackbox configuration"
},
"blackboxButtonSave": {
"message": "Save and reboot"
"message": "Save and Reboot"
},
"serialLogging": {
"message": "Outboard serial logging device"
Expand Down Expand Up @@ -4452,7 +4452,7 @@
"message": "Confirm"
},
"mixerButtonSaveAndReboot": {
"message": "Save and reboot"
"message": "Save and Reboot"
},
"mixerApplyDescription": {
"message": "This action overrides all current mixer settings and replaces them with default values. There is no 'Undo' option!"
Expand Down
39 changes: 11 additions & 28 deletions js/defaults_dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ helper.defaultsDialog = (function () {
key: "dterm_lpf_type",
value: "PT3"
},
{
key: "dterm_lpf2_hz",
value: 0
},
{
key: "dterm_lpf2_type",
value: "PT1"
},
{
key: "dynamic_gyro_notch_enabled",
value: "ON"
Expand Down Expand Up @@ -270,14 +262,6 @@ helper.defaultsDialog = (function () {
key: "dterm_lpf_type",
value: "PT3"
},
{
key: "dterm_lpf2_hz",
value: 0
},
{
key: "dterm_lpf2_type",
value: "PT1"
},
{
key: "dynamic_gyro_notch_enabled",
value: "ON"
Expand Down Expand Up @@ -461,14 +445,6 @@ helper.defaultsDialog = (function () {
key: "dterm_lpf_type",
value: "PT3"
},
{
key: "dterm_lpf2_hz",
value: 0
},
{
key: "dterm_lpf2_type",
value: "PT1"
},
{
key: "dynamic_gyro_notch_enabled",
value: "ON"
Expand Down Expand Up @@ -1169,6 +1145,7 @@ helper.defaultsDialog = (function () {
privateScope.setSettings = function (selectedDefaultPreset) {
var currentControlProfile = parseInt($("#profilechange").val());
var currentBatteryProfile = parseInt($("#batteryprofilechange").val());

//Save analytics
googleAnalytics.sendEvent('Setting', 'Defaults', selectedDefaultPreset.title);
Promise.mapSeries(selectedDefaultPreset.settings, function (input, ii) {
Expand Down Expand Up @@ -1205,21 +1182,27 @@ helper.defaultsDialog = (function () {
mspHelper.sendServoMixer(function () {
mspHelper.sendMotorMixer(function () {
MSP.send_message(MSPCodes.MSP_SELECT_SETTING, [currentControlProfile], false, function() {
MSP.send_message(MSPCodes.MSP2_INAV_SELECT_BATTERY_PROFILE, [currentBatteryProfile], false, privateScope.finalize(selectedDefaultPreset));
MSP.send_message(MSPCodes.MSP2_INAV_SELECT_BATTERY_PROFILE, [currentBatteryProfile], false, function() {
privateScope.setOriginalProfile(selectedDefaultPreset, currentBatteryProfile, currentControlProfile)
});
});
});
});
});

} else {
MSP.send_message(MSPCodes.MSP_SELECT_SETTING, [currentControlProfile], false, function() {
MSP.send_message(MSPCodes.MSP2_INAV_SELECT_BATTERY_PROFILE, [currentBatteryProfile], false, privateScope.finalize(selectedDefaultPreset));
});
privateScope.setOriginalProfile(selectedDefaultPreset, currentBatteryProfile, currentControlProfile);
}
})
});
};

privateScope.setOriginalProfile = function (selectedDefaultPreset, currentBatteryProfile, currentControlProfile) {
MSP.send_message(MSPCodes.MSP_SELECT_SETTING, [currentControlProfile], false, function() {
MSP.send_message(MSPCodes.MSP2_INAV_SELECT_BATTERY_PROFILE, [currentBatteryProfile], false, privateScope.finalize(selectedDefaultPreset));
});
};

privateScope.setSettingForAllControlProfiles = function (key, value) {
MSP.send_message(MSPCodes.MSP_SELECT_SETTING, [0], false, function () {
mspHelper.setSetting(key, value, function() {
Expand Down
8 changes: 3 additions & 5 deletions js/fc.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ var FC = {
i2cError: 0,
activeSensors: 0,
mode: [],
mixer_profile: 0,
profile: 0,
battery_profile: 0,
mixer_profile: -1,
profile: -1,
battery_profile: -1,
uid: [0, 0, 0],
accelerometerTrims: [0, 0],
armingFlags: 0,
Expand Down Expand Up @@ -1439,8 +1439,6 @@ var FC = {
'max_angle_inclination_pit',
'dterm_lpf_hz',
'dterm_lpf_type',
'dterm_lpf2_hz',
'dterm_lpf2_type',
'yaw_lpf_hz',
'fw_iterm_throw_limit',
'fw_reference_airspeed',
Expand Down
8 changes: 7 additions & 1 deletion js/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,16 @@ GUI_control.prototype.updateStatusBar = function() {
$('span.arming-flags').text(activeArmFlags.length ? activeArmFlags.join(', ') : '-');
};

GUI_control.prototype.updateProfileChange = function() {
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]));
updateActivatedTab();
}
};

GUI_control.prototype.fillSelect = function ($element, values, currentValue, unit) {
Expand Down
28 changes: 21 additions & 7 deletions js/msp/MSPHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ var mspHelper = (function (gui) {
color;
if (!dataHandler.unsupported || dataHandler.unsupported) switch (dataHandler.code) {
case MSPCodes.MSPV2_INAV_STATUS:
let profile_changed = false;
CONFIG.cycleTime = data.getUint16(offset, true);
offset += 2;
CONFIG.i2cError = data.getUint16(offset, true);
Expand All @@ -76,15 +77,28 @@ var mspHelper = (function (gui) {
offset += 2;
CONFIG.cpuload = data.getUint16(offset, true);
offset += 2;

profile_byte = data.getUint8(offset++)
CONFIG.profile = profile_byte & 0x0F;
CONFIG.battery_profile = (profile_byte & 0xF0) >> 4;
profile_byte = data.getUint8(offset++)
CONFIG.mixer_profile = profile_byte & 0x0F;
let profile = profile_byte & 0x0F;
profile_changed |= (profile !== CONFIG.profile) && (CONFIG.profile !==-1);
CONFIG.profile = profile;

let battery_profile = (profile_byte & 0xF0) >> 4;
profile_changed |= (battery_profile !== CONFIG.battery_profile) && (CONFIG.battery_profile !==-1);
CONFIG.battery_profile = battery_profile;

CONFIG.armingFlags = data.getUint32(offset, true);
offset += 4;

//As there are 8 bytes for mspBoxModeFlags (number of bytes is actually variable)
//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);
CONFIG.mixer_profile = mixer_profile;

gui.updateStatusBar();
gui.updateProfileChange();
gui.updateProfileChange(profile_changed);
break;

case MSPCodes.MSP_ACTIVEBOXES:
Expand Down Expand Up @@ -2910,7 +2924,7 @@ var mspHelper = (function (gui) {
MSP.send_message(MSPCodes.MSP2_INAV_TIMER_OUTPUT_MODE, false, false, callback);
}

self.sendTimerOutputModes = function(callback) {
self.sendTimerOutputModes = function(onCompleteCallback) {
var nextFunction = send_next_output_mode;
var idIndex = 0;

Expand All @@ -2935,7 +2949,7 @@ var mspHelper = (function (gui) {
// prepare for next iteration
idIndex++;
if (idIndex == overrideIds.length) {
nextFunction = callback;
nextFunction = onCompleteCallback;

}
MSP.send_message(MSPCodes.MSP2_INAV_SET_TIMER_OUTPUT_MODE, buffer, false, nextFunction);
Expand Down
1 change: 1 addition & 0 deletions js/serial_backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ function onValidFirmware()

$('#tabs ul.mode-connected .tab_setup a').click();

updateEzTuneTabVisibility(true);
updateFirmwareVersion();
});
});
Expand Down
27 changes: 25 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,6 @@ $(document).ready(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]));
updateActivatedTab();
});
});

Expand All @@ -577,7 +576,6 @@ $(document).ready(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();
});
});
});
Expand Down Expand Up @@ -717,3 +715,28 @@ function updateFirmwareVersion() {
globalSettings.docsTreeLocation = 'https://github.com/iNavFlight/inav/blob/master/docs/';
}
}

function updateEzTuneTabVisibility(loadMixerConfig) {
let useEzTune = true;
if (CONFIGURATOR.connectionValid) {
if (loadMixerConfig) {
mspHelper.loadMixerConfig(function() {
if (MIXER_CONFIG.platformType == PLATFORM_MULTIROTOR || MIXER_CONFIG.platformType == PLATFORM_TRICOPTER) {
$('.tab_ez_tune').removeClass("is-hidden");
} else {
$('.tab_ez_tune').addClass("is-hidden");
useEzTune = false;
}
});
} else {
if (MIXER_CONFIG.platformType == PLATFORM_MULTIROTOR || MIXER_CONFIG.platformType == PLATFORM_TRICOPTER) {
$('.tab_ez_tune').removeClass("is-hidden");
} else {
$('.tab_ez_tune').addClass("is-hidden");
useEzTune = false;
}
}
}

return useEzTune;
}
36 changes: 18 additions & 18 deletions resources/osd/analogue/bold.mcm
Original file line number Diff line number Diff line change
Expand Up @@ -16068,34 +16068,37 @@ MAX7456
01010101
01010101
01010101
01010101
01010101
01010101
01010101
00010101
01010101
01010100
01010101
10000101
01010101
01010010
00010101
10100001
01010101
01001010
10101000
01010101
01010000
10000001
01010101
01010100
10000101
01010101
00101010
10100001
01010000
10000001
01010101
01000010
00000101
01001010
10101000
01010100
01010010
00010101
10100001
01010010
00010010
00010101
00010100
10000101
01010010
10000100
01010101
10000101
00010101
01001010
10000101
01000101
Expand Down Expand Up @@ -16130,9 +16133,6 @@ MAX7456
01010101
01010101
01010101
01010101
01010101
01010101
01010100
00010000
00010101
Expand Down
Binary file modified resources/osd/analogue/bold.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 18 additions & 18 deletions resources/osd/analogue/clarity.mcm
Original file line number Diff line number Diff line change
Expand Up @@ -16068,34 +16068,37 @@ MAX7456
01010101
01010101
01010101
01010101
01010101
01010101
01010101
00010101
01010101
01010100
01010101
10000101
01010101
01010010
00010101
10100001
01010101
01001010
10101000
01010101
01010000
10000001
01010101
01010100
10000101
01010101
00101010
10100001
01010000
10000001
01010101
01000010
00000101
01001010
10101000
01010100
01010010
00010101
10100001
01010010
00010010
00010101
00010100
10000101
01010010
10000100
01010101
10000101
00010101
01001010
10000101
01000101
Expand Down Expand Up @@ -16130,9 +16133,6 @@ MAX7456
01010101
01010101
01010101
01010101
01010101
01010101
01010100
00010000
00010101
Expand Down
Binary file modified resources/osd/analogue/clarity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a659b09

Please sign in to comment.