From e5525049ce35278fee4b9d6664fb031f21fb1f43 Mon Sep 17 00:00:00 2001 From: mikeller Date: Thu, 22 Mar 2018 00:37:11 +1300 Subject: [PATCH] Re-allow 0 as value for DTerm Setpoint Transition. --- src/js/tabs/pid_tuning.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/js/tabs/pid_tuning.js b/src/js/tabs/pid_tuning.js index 1b81ac4a..ca2ee5f5 100755 --- a/src/js/tabs/pid_tuning.js +++ b/src/js/tabs/pid_tuning.js @@ -236,8 +236,18 @@ TABS.pid_tuning.initialize = function (callback) { $('.pid_filter input[name="dTermNotchFrequency"]').val(FILTER_CONFIG.dterm_notch_hz); $('.pid_filter input[name="dTermNotchCutoff"]').val(FILTER_CONFIG.dterm_notch_cutoff); - $('input[name="dtermSetpointTransition-number"]').val(ADVANCED_TUNING.dtermSetpointTransition / 100); - $('input[name="dtermSetpointTransition-range"]').val(ADVANCED_TUNING.dtermSetpointTransition / 100); + var dtermSetpointTransitionNumberElement = $('input[name="dtermSetpointTransition-number"]'); + var dtermSetpointTransitionRangeElement = $('input[name="dtermSetpointTransition-range"]'); + if (semver.gte(CONFIG.apiVersion, "1.38.0")) { + dtermSetpointTransitionNumberElement.attr('min', 0.00); + dtermSetpointTransitionRangeElement.attr('min', 0.00); + } else { + dtermSetpointTransitionNumberElement.attr('min', 0.01); + dtermSetpointTransitionRangeElement.attr('min', 0.01); + } + + dtermSetpointTransitionNumberElement.val(ADVANCED_TUNING.dtermSetpointTransition / 100); + dtermSetpointTransitionRangeElement.val(ADVANCED_TUNING.dtermSetpointTransition / 100); $('input[name="dtermSetpoint-number"]').val(ADVANCED_TUNING.dtermSetpointWeight / 100); $('input[name="dtermSetpoint-range"]').val(ADVANCED_TUNING.dtermSetpointWeight / 100);