Skip to content

Commit

Permalink
Little cleanup (#4088)
Browse files Browse the repository at this point in the history
* Little cleanup

* colspan attr is always 6
  • Loading branch information
haslinghuis authored Jul 8, 2024
1 parent 659d535 commit dc1e862
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/js/tabs/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ configuration.initialize = function (callback) {
}

$('input[name="fpvCamAngleDegrees"]').val(FC.RX_CONFIG.fpvCamAngleDegrees);
$('input[name="fpvCamAngleDegrees"]').attr("max", 90);

// fill board alignment
$('input[name="board_align_roll"]').val(FC.BOARD_ALIGNMENT_CONFIG.roll);
Expand Down
13 changes: 1 addition & 12 deletions src/js/tabs/pid_tuning.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ pid_tuning.initialize = function (callback) {
$('.pid_filter input[name="dTermNotchFrequency"]').val(FC.FILTER_CONFIG.dterm_notch_hz);
$('.pid_filter input[name="dTermNotchCutoff"]').val(FC.FILTER_CONFIG.dterm_notch_cutoff);

const dtermSetpointTransitionNumberElement = $('input[name="dtermSetpointTransition-number"]');
dtermSetpointTransitionNumberElement.attr('min', 0.00);
dtermSetpointTransitionNumberElement.val(FC.ADVANCED_TUNING.dtermSetpointTransition / 100);
$('input[name="dtermSetpointTransition-number"]').val(FC.ADVANCED_TUNING.dtermSetpointTransition / 100);

$('input[name="dtermSetpoint-number"]').val(FC.ADVANCED_TUNING.dtermSetpointWeight / 100);

Expand Down Expand Up @@ -218,12 +216,6 @@ pid_tuning.initialize = function (callback) {
$('.pid_filter input[name="dtermLowpass2Frequency"]').val(FC.FILTER_CONFIG.dterm_lowpass2_hz);
$('.pid_filter select[name="dtermLowpass2Type"]').val(FC.FILTER_CONFIG.dterm_lowpass2_type);

// We load it again because the limits are now bigger than in 1.16.0
$('.pid_filter input[name="gyroLowpassFrequency"]').attr("max","16000");
$('.pid_filter input[name="gyroLowpassFrequency"]').val(FC.FILTER_CONFIG.gyro_lowpass_hz);
//removes 5th column which is Feedforward
$('#pid_main .pid_titlebar2 th').attr('colspan', 4);

// I Term Rotation
$('input[id="itermrotation"]').prop('checked', FC.ADVANCED_TUNING.itermRotation !== 0);

Expand Down Expand Up @@ -269,7 +261,6 @@ pid_tuning.initialize = function (callback) {
$('.pid_tuning .ROLL input[name="f"]').val(FC.ADVANCED_TUNING.feedforwardRoll);
$('.pid_tuning .PITCH input[name="f"]').val(FC.ADVANCED_TUNING.feedforwardPitch);
$('.pid_tuning .YAW input[name="f"]').val(FC.ADVANCED_TUNING.feedforwardYaw);
$('#pid_main .pid_titlebar2 th').attr('colspan', 5);

const feedforwardTransitionNumberElement = $('input[name="feedforwardTransition-number"]');
feedforwardTransitionNumberElement.val(Number.parseFloat(FC.ADVANCED_TUNING.feedforwardTransition / 100).toFixed(2));
Expand Down Expand Up @@ -306,8 +297,6 @@ pid_tuning.initialize = function (callback) {
$('.dminGroup input[name="dMinAdvance"]').val(FC.ADVANCED_TUNING.dMinAdvance);

$('input[id="useIntegratedYaw"]').prop('checked', FC.ADVANCED_TUNING.useIntegratedYaw !== 0);
//dmin column
$('#pid_main .pid_titlebar2 th').attr('colspan', 6);

$('.smartfeedforward').hide();

Expand Down
2 changes: 1 addition & 1 deletion src/tabs/configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
</div>
<div class="spacer_box">
<div class="number fpvCamAngleDegrees">
<label> <input type="number" name="fpvCamAngleDegrees" step="1" min="0" max="50" /> <span
<label> <input type="number" name="fpvCamAngleDegrees" step="1" min="0" max="90" /> <span
i18n="configurationFpvCamAngleDegrees"></span>
</label>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/tabs/pid_tuning.html
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@
</td>
</tr>
<tr class="dtermSetpointTransition">
<td><input type="number" name="dtermSetpointTransition-number" step="0.01" min="0.01" max="1.00"/></td>
<td><input type="number" name="dtermSetpointTransition-number" step="0.01" min="0.00" max="1.00"/></td>
<td colspan="1">
<div>
<label>
Expand Down Expand Up @@ -1250,7 +1250,7 @@
</span>

<span class="suboption static">
<input type="number" class="nonProfile" name="gyroLowpassFrequency" step="1" min="1" max="255"/>
<input type="number" class="nonProfile" name="gyroLowpassFrequency" step="1" min="1" max="1000"/>
<label>
<span i18n="pidTuningStaticCutoffFrequency"></span>
</label>
Expand Down Expand Up @@ -1291,7 +1291,7 @@
<span i18n="pidTuningGyroLowpass2"></span>

<span class="suboption">
<input type="number" class="nonProfile" name="gyroLowpass2Frequency" step="1" min="1" max="16000"/>
<input type="number" class="nonProfile" name="gyroLowpass2Frequency" step="1" min="1" max="1000"/>
<label>
<span i18n="pidTuningStaticCutoffFrequency"></span>
</label>
Expand Down

0 comments on commit dc1e862

Please sign in to comment.