From aed72ab0e93e8a80603c8a1b0dd3b9267d7bf042 Mon Sep 17 00:00:00 2001 From: j-w9 <295470691+j-w9@users.noreply.github.com> Date: Sat, 17 Oct 2026 11:59:44 -0400 Subject: [PATCH] PIDReview: explain how the step response is found and when it is empty --- PIDReview/PIDReview.js | 9 +++++++++ PIDReview/index.html | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/PIDReview/PIDReview.js b/PIDReview/PIDReview.js index d8c50ada..7cd7efb1 100644 --- a/PIDReview/PIDReview.js +++ b/PIDReview/PIDReview.js @@ -132,6 +132,7 @@ function reset() { step_plot.data[i].x = [] step_plot.data[i].y = [] } + document.getElementById("step_note").hidden = true for (let i = 0; i < Spectrogram.data.length; i++) { Spectrogram.data[i].x = [] Spectrogram.data[i].y = [] @@ -1048,6 +1049,7 @@ function redraw_step() { step_plot.data[plot_index].x = [] step_plot.data[plot_index].y = [] } + document.getElementById("step_note").hidden = true if (valid_sets == 0) { Plotly.redraw("step_plot") return @@ -1105,6 +1107,9 @@ function redraw_step() { // Pre-calculate inverse sn = array_inverse(sn) + // Count of sets with at least one step estimate + let sets_with_steps = 0 + // For each data set for (let j = 0; j < num_sets; j++) { if (PID.sets[j] == null) { @@ -1189,6 +1194,7 @@ function redraw_step() { // No good steps, skip this set continue } + sets_with_steps += 1 // Plot mean step_plot.data[plot_index+1].x = time @@ -1201,6 +1207,9 @@ function redraw_step() { } + // Explain an empty plot + document.getElementById("step_note").hidden = (sets_with_steps > 0) + step_plot.layout.yaxis.range = [0, 2] step_plot.layout.yaxis.autorange = false diff --git a/PIDReview/index.html b/PIDReview/index.html index c6b5cae8..6092bb77 100644 --- a/PIDReview/index.html +++ b/PIDReview/index.html @@ -248,8 +248,10 @@

Step Response

@@ -257,6 +259,7 @@

+