Add was_alarmed property and WasAlarmed method to Zone

This commit is contained in:
Isaac Connor 2015-02-18 16:34:35 -05:00
parent 22b73c1610
commit 2c1a02ade6
2 changed files with 5 additions and 2 deletions

View File

@ -51,6 +51,7 @@ void Zone::Setup( Monitor *p_monitor, int p_id, const char *p_label, ZoneType p_
Debug( 1, "Initialised zone %d/%s - %d - %dx%d - Rgb:%06x, CM:%d, MnAT:%d, MxAT:%d, MnAP:%d, MxAP:%d, FB:%dx%d, MnFP:%d, MxFP:%d, MnBS:%d, MxBS:%d, MnB:%d, MxB:%d, OF: %d, AF: %d", id, label, type, polygon.Width(), polygon.Height(), alarm_rgb, check_method, min_pixel_threshold, max_pixel_threshold, min_alarm_pixels, max_alarm_pixels, filter_box.X(), filter_box.Y(), min_filter_pixels, max_filter_pixels, min_blob_pixels, max_blob_pixels, min_blobs, max_blobs, overload_frames, extend_alarm_frames );
alarmed = false;
was_alarmed = false;
pixel_diff = 0;
alarm_pixels = 0;
alarm_filter_pixels = 0;

View File

@ -126,14 +126,16 @@ public:
inline const Image *AlarmImage() const { return( image ); }
inline const Polygon &GetPolygon() const { return( polygon ); }
inline bool Alarmed() const { return( alarmed ); }
inline void SetAlarm() { alarmed = true; }
inline void ClearAlarm() { alarmed = false; }
inline bool WasAlarmed() const { return( was_alarmed ); }
inline void SetAlarm() { was_alarmed = alarmed; alarmed = true; }
inline void ClearAlarm() { was_alarmed = alarmed; alarmed = false; }
inline Coord GetAlarmCentre() const { return( alarm_centre ); }
inline unsigned int Score() const { return( score ); }
inline void ResetStats()
{
alarmed = false;
was_alarmed = false;
pixel_diff = 0;
alarm_pixels = 0;
alarm_filter_pixels = 0;