When transitioning from ALERT to IDLE, close the event if CLOSE_MODE is IDLE as well as ALARM.

This commit is contained in:
Isaac Connor 2022-01-10 14:44:52 -05:00
parent 701045393c
commit 947132284d
1 changed files with 5 additions and 2 deletions

View File

@ -2132,8 +2132,11 @@ bool Monitor::Analyse() {
((timestamp - event->StartTime()) >= min_section_length)) { ((timestamp - event->StartTime()) >= min_section_length)) {
Info("%s: %03d - Left alarm state (%" PRIu64 ") - %d(%d) images", Info("%s: %03d - Left alarm state (%" PRIu64 ") - %d(%d) images",
name.c_str(), analysis_image_count, event->Id(), event->Frames(), event->AlarmFrames()); name.c_str(), analysis_image_count, event->Id(), event->Frames(), event->AlarmFrames());
//if ( function != MOCORD || event_close_mode == CLOSE_ALARM || event->Cause() == SIGNAL_CAUSE ) if (
if ( (function != RECORD && function != MOCORD ) || event_close_mode == CLOSE_ALARM ) { (function != RECORD && function != MOCORD)
||
(event_close_mode == CLOSE_ALARM || event_close_mode=CLOSE_IDLE)
) {
shared_data->state = state = IDLE; shared_data->state = state = IDLE;
Info("%s: %03d - Closing event %" PRIu64 ", alarm end%s", Info("%s: %03d - Closing event %" PRIu64 ", alarm end%s",
name.c_str(), analysis_image_count, event->Id(), (function==MOCORD)?", section truncated":"" ); name.c_str(), analysis_image_count, event->Id(), (function==MOCORD)?", section truncated":"" );