Skip to content

Commit 103c924

Browse files
authored
Merge pull request #2297 from breadoven/abo_fw_alt_cont_adj
Fixed wing altitude control response setting support
2 parents 95268b1 + 3627dc9 commit 103c924

File tree

4 files changed

+50
-29
lines changed

4 files changed

+50
-29
lines changed

locale/en/messages.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"language_ja": {
1818
"message": "日本語",
1919
"_comment": "Don't translate!"
20-
},
20+
},
2121
"language_zh_CN": {
2222
"message": "简体中文",
2323
"_comment": "Don't translate!"
@@ -2068,6 +2068,9 @@
20682068
"adjustmentsFunction59": {
20692069
"message": "Multi Mission Index Adjustment"
20702070
},
2071+
"adjustmentsFunction60": {
2072+
"message": "Fixed Wing Alt Control Response Adjustment"
2073+
},
20712074
"adjustmentsSave": {
20722075
"message": "Save"
20732076
},
@@ -3505,6 +3508,12 @@
35053508
"soarPitchDeadbandHelp": {
35063509
"message": "Pitch Angle deadband when soaring mode enabled (deg). Angle mode inactive within deadband allowing pitch to free float whilst soaring."
35073510
},
3511+
"altControlResponse": {
3512+
"message": "Altitude Control Response Factor"
3513+
},
3514+
"altControlResponseHelp": {
3515+
"message": "Adjusts the response of fixed wing altitude control as the target altitude is approached. Higher values will sharpen altitude control response but may also cause excessive overshoot or pitch instability if set too high."
3516+
},
35083517
"waypointRadiusHelp": {
35093518
"message": "This sets the distance away from a waypoint that triggers the waypoint as reached."
35103519
},

tabs/adjustments.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
<option value="49" i18n="adjustmentsFunction49"></option> <!-- VEL Z P -->
130130
<option value="50" i18n="adjustmentsFunction50"></option> <!-- VEL Z I -->
131131
<option value="51" i18n="adjustmentsFunction51"></option> <!-- VEL Z D -->
132+
<option value="60" i18n="adjustmentsFunction60"></option> <!-- FW Alt Cont Response -->
132133
</optgroup>
133134

134135
<optgroup i18n_label="adjustmentsGroupMisc">

tabs/advanced_tuning.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,12 @@
255255
<div for="soarPitchDeadband" class="helpicon cf_tip" data-i18n_title="soarPitchDeadbandHelp"></div>
256256
</div>
257257

258+
<div class="number">
259+
<input type="number" id="altControlResponse" data-unit="deg" data-setting="nav_fw_alt_control_response" data-setting-multiplier="1" step="1" min="5" max="100" />
260+
<label for="altControlResponse"><span data-i18n="altControlResponse"></span></label>
261+
<div for="altControlResponse" class="helpicon cf_tip" data-i18n_title="altControlResponseHelp"></div>
262+
</div>
263+
258264
</div>
259265
</div>
260266
</div>
@@ -509,7 +515,7 @@
509515
<label for="fsMissionDelay"><span data-i18n="fsMissionDelay"></span></label>
510516
<div for="fsMissionDelay" class="helpicon cf_tip" data-i18n_title="fsMissionDelayHelp"></div>
511517
</div>
512-
<!--
518+
<!--
513519
<div class="checkbox">
514520
<input type="checkbox" class="toggle update_preview" id="drNavigation" data-setting="inav_allow_dead_reckoning" data-live="true" />
515521
<label for="drNavigation"><span data-i18n="drNavigation"></span></label>
@@ -557,7 +563,7 @@
557563
<select id="geozoneNoWayHomeAction" data-setting="geozone_no_way_home_action"></select>
558564
<label for="geozoneNoWayHomeAction"><span data-i18n="geozoneNoWayHomeAction"></span></label>
559565
<div for="geozoneNoWayHomeAction" class="helpicon cf_tip" data-i18n_title="geozoneNoWayHomeActionHelp"></div>
560-
</div>
566+
</div>
561567
</div>
562568
</div>
563569

tabs/osd.js

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ FONT.parseMCMFontFile = function (data) {
262262
FONT.openFontFile = function ($preview) {
263263
return new Promise(function (resolve) {
264264
var options = {
265-
filters: [
265+
filters: [
266266
{ name: 'Font file', extensions: ['mcm'] }
267267
],
268268
};
@@ -271,7 +271,7 @@ FONT.openFontFile = function ($preview) {
271271
console.log('No file selected');
272272
return;
273273
}
274-
274+
275275
if (result.filePaths.length == 1) {
276276
const fontData = fs.readFileSync(result.filePaths[0], {flag: "r"});
277277
FONT.parseMCMFontFile(fontData.toString());
@@ -2227,6 +2227,11 @@ OSD.constants = {
22272227
id: 139,
22282228
preview: 'WP NO 7'
22292229
},
2230+
{
2231+
name: 'FW_ALT_CONTROL_RESPONSE',
2232+
id: 166,
2233+
preview: 'ACR 40'
2234+
},
22302235
]
22312236
},
22322237
{
@@ -3447,7 +3452,7 @@ HARDWARE.update = function(callback) {
34473452
callback();
34483453
}
34493454
});
3450-
});
3455+
});
34513456
});
34523457
};
34533458

@@ -3472,10 +3477,10 @@ TABS.osd.initialize = function (callback) {
34723477
GUI.load(path.join(__dirname, "osd.html"), Settings.processHtml(function () {
34733478
// translate to user-selected language
34743479
i18n.localize();
3475-
3480+
34763481
// Open modal window
34773482
OSD.GUI.jbox = new jBox('Modal', {
3478-
width: 750,
3483+
width: 750,
34793484
height: 300,
34803485
position: {y:'bottom'},
34813486
offset: {y:-50},
@@ -3485,13 +3490,13 @@ TABS.osd.initialize = function (callback) {
34853490
title: 'OSD Font Manager',
34863491
content: $('#fontmanagercontent')
34873492
});
3488-
3493+
34893494
$('a.save').on('click', function () {
34903495
Settings.saveInputs(save_to_eeprom);
34913496
});
3492-
3497+
34933498
// Initialise guides checkbox
3494-
isGuidesChecked = store.get('showOSDGuides', false);
3499+
isGuidesChecked = store.get('showOSDGuides', false);
34953500

34963501
// Setup switch indicators
34973502
$(".osdSwitchInd_channel option").each(function() {
@@ -3517,18 +3522,18 @@ TABS.osd.initialize = function (callback) {
35173522
$("#switchIndicators_alignLeft").on('change', function() {
35183523
refreshOSDSwitchIndicators();
35193524
});
3520-
3525+
35213526
// Functions for when pan servo settings change
35223527
$('#osdPanServoIndicatorShowDegrees').on('change', function() {
35233528
// Update the OSD preview
35243529
updatePanServoPreview();
35253530
});
3526-
3531+
35273532
$('#panServoOutput').on('change', function() {
35283533
// Update the OSD preview
35293534
updatePanServoPreview();
35303535
});
3531-
3536+
35323537
// Function for when text for craft name changes
35333538
$('#craft_name').on('keyup', function() {
35343539
// Make sure that the craft name only contains A to Z, 0-9, spaces, and basic ASCII symbols
@@ -3539,11 +3544,11 @@ TABS.osd.initialize = function (callback) {
35393544
} else {
35403545
$(this).val(testText.slice(0, -1));
35413546
}
3542-
3547+
35433548
// Update the OSD preview
35443549
updatePilotAndCraftNames();
35453550
});
3546-
3551+
35473552
$('#pilot_name').on('keyup', function() {
35483553
// Make sure that the pilot name only contains A to Z, 0-9, spaces, and basic ASCII symbols
35493554
let testExp = new RegExp('^[A-Za-z0-9 !_,:;=@#\\%\\&\\-\\*\\^\\(\\)\\.\\+\\<\\>\\[\\]]');
@@ -3553,17 +3558,17 @@ TABS.osd.initialize = function (callback) {
35533558
} else {
35543559
$(this).val(testText.slice(0, -1));
35553560
}
3556-
3561+
35573562
// Update the OSD preview
35583563
updatePilotAndCraftNames();
35593564
});
3560-
3565+
35613566
// font preview window
35623567
var $preview = $('.font-preview');
3563-
3568+
35643569
// init structs once, also clears current font
35653570
FONT.initData();
3566-
3571+
35673572
var $fontPicker = $('.fontbuttons button');
35683573
$fontPicker.on('click', function () {
35693574
if (!$(this).data('font-file')) {
@@ -3578,30 +3583,30 @@ TABS.osd.initialize = function (callback) {
35783583
});
35793584
store.set('osd_font', $(this).data('font-file'));
35803585
});
3581-
3586+
35823587
// load the last selected font when we change tabs
35833588
var osd_font = store.get('osd_font', false);
35843589
var previous_font_button;
35853590
if (osd_font) {
35863591
previous_font_button = $('.fontbuttons button[data-font-file="' + osd_font + '"]');
35873592
if (previous_font_button.attr('data-font-file') == undefined) previous_font_button = undefined;
35883593
}
3589-
3594+
35903595
if (typeof previous_font_button == "undefined") {
35913596
$fontPicker.first().trigger( "click" );
35923597
} else {
35933598
previous_font_button.trigger( "click" );
35943599
}
3595-
3596-
3600+
3601+
35973602
$('button.load_font_file').on('click', function () {
35983603
$fontPicker.removeClass('active');
35993604
FONT.openFontFile().then(function () {
36003605
FONT.preview($preview);
36013606
OSD.GUI.update();
36023607
});
36033608
});
3604-
3609+
36053610
// font upload
36063611
$('a.flash_font').on('click', function () {
36073612
if (!GUI.connect_lock) { // button disabled while flashing is in progress
@@ -3620,7 +3625,7 @@ TABS.osd.initialize = function (callback) {
36203625
FONT.upload(progressCallback);
36213626
}
36223627
});
3623-
3628+
36243629
$('.update_preview').on('change', function () {
36253630
if (OSD.data) {
36263631
// Force an OSD redraw by saving any element
@@ -3633,11 +3638,11 @@ TABS.osd.initialize = function (callback) {
36333638
}, 100);
36343639
}
36353640
});
3636-
3641+
36373642
$('#useCraftnameForMessages').on('change', function() {
36383643
OSD.GUI.updateDjiMessageElements(this.checked);
36393644
});
3640-
3645+
36413646
if(semver.gte(FC.CONFIG.flightControllerVersion, '7.1.0')) {
36423647
mspHelper.loadOsdCustomElements(createCustomElements);
36433648
}
@@ -3664,7 +3669,7 @@ function createCustomElements(){
36643669
var customElementTable = $('<table>').addClass('osdCustomElement_main_table');
36653670
var customElementRowType = $('<tr>').data('row', i);
36663671
var customElementRowValue = $('<tr>').data('row', i);
3667-
3672+
36683673
var customElementLabel = $('<tr>');
36693674
customElementLabel.append($('<td>').attr('colspan', 2).append($('<span>').html(i18n.getMessage("custom_element") + ' ' + (i + 1))));
36703675

0 commit comments

Comments
 (0)