store event stats regardless of savejpegs or image availability

This commit is contained in:
Isaac Connor 2021-04-21 14:59:57 -04:00
parent 7c70c26fbd
commit 8ca93d2f0b
1 changed files with 11 additions and 14 deletions

View File

@ -2205,20 +2205,17 @@ bool Monitor::Analyse() {
//have_pre_alarmed_frames ++;
Event::AddPreAlarmFrame(snap->image, *timestamp, score, nullptr);
} else if (state == ALARM) {
if ((savejpegs > 1 ) and snap->image) {
for (Zone zone : zones) {
if (zone.Alarmed()) {
if (zone.AlarmImage()) {
if (!snap->analysis_image)
snap->analysis_image = new Image(*(snap->image));
snap->analysis_image->Overlay(*(zone.AlarmImage()));
}
if (config.record_event_stats)
zone.RecordStats(event);
} // end if zone is alarmed
} // end foreach zone
}
for (Zone zone : zones) {
if (zone.Alarmed()) {
if (zone.AlarmImage() and (savejpegs > 1) and snap->image) {
if (!snap->analysis_image)
snap->analysis_image = new Image(*(snap->image));
snap->analysis_image->Overlay(*(zone.AlarmImage()));
}
if (config.record_event_stats)
zone.RecordStats(event);
} // end if zone is alarmed
} // end foreach zone
if (event) {
if (noteSetMap.size() > 0)
event->updateNotes(noteSetMap);