From f62c68afc260bdb462785929cb51734067ed6c44 Mon Sep 17 00:00:00 2001 From: kx1t Date: Tue, 9 Apr 2024 12:34:52 +0200 Subject: [PATCH] fix bug related to showing individual spectrograms --- rootfs/usr/share/planefence/planefence.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/rootfs/usr/share/planefence/planefence.sh b/rootfs/usr/share/planefence/planefence.sh index 3eb6743..630d559 100755 --- a/rootfs/usr/share/planefence/planefence.sh +++ b/rootfs/usr/share/planefence/planefence.sh @@ -240,13 +240,18 @@ EOF 10 min avg 1 hr avg EOF - # If there are spectrograms for today, then also make a column for these: - if compgen -G "$OUTFILEDIR/noisecapt-spectro-$FENCEDATE*.png" >/dev/null; then - printf " Spectrogram\n" >&3 - SPECTROPRINT="true" - else - SPECTROPRINT="false" - fi + # # If there are spectrograms for today, then also make a column for these: + # if compgen -G "$OUTFILEDIR/noisecapt-spectro-$FENCEDATE*.png" >/dev/null; then + # printf " Spectrogram\n" >&3 + # SPECTROPRINT="true" + # else + # SPECTROPRINT="false" + # fi + # ^^^ this doesn't really work - there won't be any spectrograms at the beginning of the day, and + # it will never create any, because SPECTROPRINT stays FALSE forever. + # Instead, we'll set SPECTROPRINT=true always when HASNOISE=true. This may cause an empty column, but that's + # preferred over not printing any spectrograms. + SPECTROPRINT="true" fi if [[ "$HASTWEET" == "true" ]]