Skip to content

Commit

Permalink
Merge branch 'master' into MrD_Changes-for-PR-8401
Browse files Browse the repository at this point in the history
  • Loading branch information
MrD-RC committed Oct 1, 2022
2 parents 47bf242 + 1f8b2bc commit 91da0f6
Show file tree
Hide file tree
Showing 139 changed files with 447 additions and 105 deletions.
18 changes: 15 additions & 3 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1166,8 +1166,8 @@
"portsFunction_DJI_FPV": {
"message": "DJI FPV VTX"
},
"portsFunction_HDZERO_VTX": {
"message": "HDZero VTX"
"portsFunction_MSP_DISPLAYPORT": {
"message": "MSP Displayport"
},
"portsFunction_IMU2": {
"message": "Secondary IMU"
Expand Down Expand Up @@ -1745,6 +1745,9 @@
"adjustmentsFunction58": {
"message": "Fixed Wing Level Trim"
},
"adjustmentsFunction59": {
"message": "Multi Mission Index Adjustment"
},
"adjustmentsSave": {
"message": "Save"
},
Expand Down Expand Up @@ -2176,6 +2179,9 @@
"firmwareFlasherOptionLabelSelectFirmwareVersionFor": {
"message": "Choose a Firmware version for"
},
"firmwareFlasherButtonAutoSelect": {
"message": "Auto-select Target"
},
"firmwareFlasherButtonLoadLocal": {
"message": "Load Firmware [Local]"
},
Expand Down Expand Up @@ -2210,7 +2216,7 @@
"message": "Warning"
},
"firmwareFlasherWarningText": {
"message": "Please do <span style=\"color: red\">not</span> try to flash <strong>non-iNAV</strong> hardware with this firmware flasher.<br />Do <span style=\"color: red\">not</span> <strong>disconnect</strong> the board or <strong>turn off</strong> your computer while flashing.<br /><br /><strong>Note: </strong>STM32 bootloader is stored in ROM, it cannot be bricked.<br /><strong>Note: </strong><span style=\"color: red\">Auto-Connect</span> is always disabled while you are inside firmware flasher.<br /><strong>Note: </strong>Make sure you have a backup; some upgrades/downgrades will wipe your configuration.<br /><strong>Note:</strong> If you have problems flashing try disconnecting all cables from your FC first, try rebooting, upgrade chrome, upgrade drivers.<br /><strong>Note:</strong> When flashing boards that have directly connected USB sockets (SPRacingF3Mini, Sparky, ColibriRace, etc) ensure you have read the USB Flashing section of the INAV manual and have the correct software and drivers installed"
"message": "Please do <span style=\"color: red\">not</span> try to flash <strong>non-iNAV</strong> hardware with this firmware flasher.<br />Do <span style=\"color: red\">not</span> <strong>disconnect</strong> the board or <strong>turn off</strong> your computer while flashing.<br /><br /><strong>Note: </strong>STM32 bootloader is stored in ROM, it cannot be bricked.<br /><!--strong>Note: </strong><span style=\"color: red\">Auto-Connect</span> is always disabled while you are inside firmware flasher.<br / --><strong>Note: </strong>Make sure you have a backup; some upgrades/downgrades will wipe your configuration.<br /><strong>Note:</strong> If you have problems flashing try disconnecting all cables from your FC first, try rebooting, upgrade chrome, upgrade drivers.<br /><strong>Note:</strong> When flashing boards that have directly connected USB sockets (Matek H743-SLIM, Holybro Kakute etc) ensure you have read the USB Flashing section of the INAV manual and have the correct software and drivers installed"
},
"firmwareFlasherRecoveryHead": {
"message": "<strong>Recovery / Lost communication<strong>"
Expand Down Expand Up @@ -4328,5 +4334,11 @@
},
"rcSmoothing": {
"message": "RC Smoothing"
},
"throttle_scale": {
"message": "Throttle scale"
},
"throttle_scale_help": {
"message": "Allow to limit effective power fed to the motors. Throttle Scale 1 mean there is no power limiting. Throttle Scale 0.5 means throttle position will be cut in half before passed to the motors."
}
}
135 changes: 116 additions & 19 deletions js/defaults_dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,19 +287,23 @@ helper.defaultsDialog = (function () {
},
{
key: "nav_fw_pos_z_p",
value: 15
value: 25
},
{
key: "nav_fw_pos_z_d",
key: "nav_fw_pos_z_i",
value: 5
},
{
key: "nav_fw_pos_z_d",
value: 8
},
{
key: "nav_fw_pos_xy_p",
value: 60
value: 55
},
{
key: "fw_turn_assist_pitch_gain",
value: 0.5
value: 0.4
},
{
key: "max_angle_inclination_rll",
Expand Down Expand Up @@ -359,11 +363,19 @@ helper.defaultsDialog = (function () {
},
{
key: "imu_acc_ignore_rate",
value: 9
value: 7
},
{
key: "imu_acc_ignore_slope",
value: 5
value: 4
},
{
key: "imu_dcm_kp",
value: 1000
},
{
key: "imu_dcm_ki",
value: 0
},
{
key: "airmode_type",
Expand Down Expand Up @@ -393,6 +405,22 @@ helper.defaultsDialog = (function () {
key: "nav_wp_radius",
value: 5000
},
{
key: "nav_fw_launch_max_angle",
value: 45
},
{
key: "nav_fw_launch_motor_delay",
value: 100
},
{
key: "nav_fw_launch_max_altitude",
value: 5000
},
{
key: "nav_fw_launch_climb_angle",
value: 25
},
],
"features": [
{
Expand All @@ -404,7 +432,7 @@ helper.defaultsDialog = (function () {
{
"title": 'Airplane without a Tail (Wing, Delta, etc)',
"notRecommended": false,
"id": 3,
"id": 4,
"reboot": true,
"mixerToApply": 8,
"settings": [
Expand All @@ -418,7 +446,7 @@ helper.defaultsDialog = (function () {
},
{
key: "applied_defaults",
value: 3
value: 4
},
{
key: "gyro_hardware_lpf",
Expand Down Expand Up @@ -486,19 +514,23 @@ helper.defaultsDialog = (function () {
},
{
key: "nav_fw_pos_z_p",
value: 15
value: 35
},
{
key: "nav_fw_pos_z_d",
key: "nav_fw_pos_z_i",
value: 5
},
{
key: "nav_fw_pos_z_d",
value: 10
},
{
key: "nav_fw_pos_xy_p",
value: 60
value: 70
},
{
key: "fw_turn_assist_pitch_gain",
value: 0.2
value: 0.3
},
{
key: "max_angle_inclination_rll",
Expand Down Expand Up @@ -564,6 +596,14 @@ helper.defaultsDialog = (function () {
key: "imu_acc_ignore_slope",
value: 5
},
{
key: "imu_dcm_kp",
value: 1000
},
{
key: "imu_dcm_ki",
value: 0
},
{
key: "airmode_type",
value: "STICK_CENTER_ONCE"
Expand Down Expand Up @@ -592,6 +632,22 @@ helper.defaultsDialog = (function () {
key: "nav_wp_radius",
value: 5000
},
{
key: "nav_fw_launch_max_angle",
value: 75
},
{
key: "nav_fw_launch_motor_delay",
value: 100
},
{
key: "nav_fw_launch_max_altitude",
value: 5000
},
{
key: "nav_fw_launch_climb_angle",
value: 25
},
],
"features": [
{
Expand Down Expand Up @@ -718,7 +774,9 @@ helper.defaultsDialog = (function () {
GUI.tab_switch_cleanup(function () {
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false, function () {
//noinspection JSUnresolvedVariable
savingDefaultsModal.close();
if (typeof savingDefaultsModal !== 'undefined') {
savingDefaultsModal.close();
}
GUI.log(chrome.i18n.getMessage('deviceRebooting'));
GUI.handleReconnect();
});
Expand All @@ -728,13 +786,21 @@ 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) {
return mspHelper.getSetting(input.key);
}).then(function () {
Promise.mapSeries(selectedDefaultPreset.settings, function (input, ii) {
return mspHelper.setSetting(input.key, input.value);
if (FC.isControlProfileParameter(input.key)) {
return privateScope.setSettingForAllControlProfiles(input.key, input.value);
} else if (FC.isBatteryProfileParameter(input.key)) {
return privateScope.setSettingForAllBatteryProfiles(input.key, input.value);
} else {
return mspHelper.setSetting(input.key, input.value);
}
}).then(function () {

// If default preset is associated to a mixer, apply the mixer as well
Expand All @@ -751,17 +817,48 @@ helper.defaultsDialog = (function () {

mspHelper.sendServoMixer(function () {
mspHelper.sendMotorMixer(function () {
privateScope.finalize(selectedDefaultPreset);
})
MSP.send_message(MSPCodes.MSP_SELECT_SETTING, [currentControlProfile], false, function() {
MSP.send_message(MSPCodes.MSP2_INAV_SELECT_BATTERY_PROFILE, [currentBatteryProfile], false, privateScope.finalize(selectedDefaultPreset));
});
});
});
} else {
privateScope.finalize(selectedDefaultPreset);
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() {
MSP.send_message(MSPCodes.MSP_SELECT_SETTING, [1], false, function () {
mspHelper.setSetting(key, value, function() {
MSP.send_message(MSPCodes.MSP_SELECT_SETTING, [2], false, function () {
mspHelper.setSetting(key, value);
});
});
});
});
});
return;
};

})
privateScope.setSettingForAllBatteryProfiles = function (key, value) {
MSP.send_message(MSPCodes.MSP2_INAV_SELECT_BATTERY_PROFILE, [0], false, function () {
mspHelper.setSetting(key, value, function() {
MSP.send_message(MSPCodes.MSP2_INAV_SELECT_BATTERY_PROFILE, [1], false, function () {
mspHelper.setSetting(key, value, function() {
MSP.send_message(MSPCodes.MSP2_INAV_SELECT_BATTERY_PROFILE, [2], false, function () {
mspHelper.setSetting(key, value);
});
});
});
});
});
return;
};

privateScope.onPresetClick = function (event) {
Expand Down
2 changes: 1 addition & 1 deletion js/fc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ var FC = {
4: {
name: "Logic Condition",
type: "range",
range: [0, 31],
range: [0, (LOGIC_CONDITIONS.getMaxLogicConditionCount()-1)],
default: 0
},
5: {
Expand Down
15 changes: 13 additions & 2 deletions js/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,16 +316,27 @@ GUI_control.prototype.renderOperandValue = function ($container, operandMetadata
* @param {function} onChange
* @param {boolean} withAlways
*/
GUI_control.prototype.renderLogicConditionSelect = function ($container, logicConditions, current, onChange, withAlways) {
GUI_control.prototype.renderLogicConditionSelect = function ($container, logicConditions, current, onChange, withAlways, onlyEnabled) {

let $select = $container.append('<select class="mix-rule-condition">').find("select"),
lcCount = logicConditions.getCount();
option = "";

if (withAlways) {
$select.append('<option value="-1">Always</option>')
}
for (let i = 0; i < lcCount ; i++) {
$select.append('<option value="' + i + '">Logic Condition ' + i + ' </option>');
if (!onlyEnabled || i === current || (logicConditions.isEnabled(i))) {
option = '<option';

if (i === current && !logicConditions.isEnabled(i)) {
option+= ' class="lc_disabled"';
}

option+= ' value="' + i + '">Logic Condition ' + i + ' </option>';

$select.append(option);
}
}

$select.val(current).change(onChange);
Expand Down
3 changes: 2 additions & 1 deletion js/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ function generateFilename(prefix, suffix) {

if (CONFIG) {
if (CONFIG.flightControllerIdentifier) {
filename = CONFIG.flightControllerIdentifier + '_' + filename;
filename = CONFIG.flightControllerIdentifier + '_' + CONFIG.flightControllerVersion + "_" + filename;
}

if (CONFIG.name && CONFIG.name.trim() !== '') {
filename = filename + '_' + CONFIG.name.trim().replace(' ', '_');
}
Expand Down
3 changes: 2 additions & 1 deletion js/logicCondition.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,10 @@ let LogicCondition = function (enabled, activatorId, operation, operandAType, op
if (self.getEnabled()) {
GUI.renderLogicConditionSelect(
$e,
LOGIC_CONDITIONS,
LOGIC_CONDITIONS,
self.getActivatorId,
self.onActivatorChange,
true,
true
);
} else {
Expand Down
4 changes: 4 additions & 0 deletions js/logicConditionsCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ let LogicConditionsCollection = function () {
return data.length
};

self.isEnabled = function (lcID) {
return data[lcID].getEnabled();
}

self.open = function () {
self.render();
$container.show();
Expand Down
Loading

0 comments on commit 91da0f6

Please sign in to comment.