From a52dc04d2e2fb9f4be05924c3efbd58fc6193cac Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 6 Nov 2023 12:49:44 -0500 Subject: [PATCH] Add debug in Ready(). Reset image_count in Reload so that Ready() works after a reload. --- src/zm_monitor.cpp | 1 + src/zm_monitor.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index fbac7843f..faad9e6fe 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -562,6 +562,7 @@ void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) { // How many frames we need to have before we start analysing ready_count = std::max(warmup_count, pre_event_count); + image_count = 0; last_alarm_count = 0; state = IDLE; last_signal = true; // Defaulting to having signal so that we don't get a signal change on the first frame. diff --git a/src/zm_monitor.h b/src/zm_monitor.h index 15400440d..e626187ad 100644 --- a/src/zm_monitor.h +++ b/src/zm_monitor.h @@ -709,6 +709,7 @@ public: return false; } if (image_count >= ready_count) { + Debug(2, "Ready because image_count(%d) >= ready_count(%d)", image_count, ready_count); return true; } Debug(2, "Not ready because image_count(%d) <= ready_count(%d)", image_count, ready_count);