Revert "Alarm cause fix (#2580)" (#2581)

This reverts commit 6923382485.
pull/2584/head
Isaac Connor 2019-04-17 13:53:11 -04:00 committed by GitHub
parent 6923382485
commit eb76cd87bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 14 deletions

View File

@ -1550,19 +1550,6 @@ bool Monitor::Analyse() {
Info("%s: %03d - Gone into alarm state PreAlarmCount: %u > AlarmFrameCount:%u",
name, image_count, Event::PreAlarmCount(), alarm_frame_count);
shared_data->state = state = ALARM;
// lets construct alarm cause. It will contain cause + names of zones alarmed
std::string alarm_cause="";
for ( int i=0; i < n_zones; i++) {
if (zones[i]->Alarmed()) {
alarm_cause += std::string(zones[i]->Label());
if (i < n_zones-1) {
alarm_cause +=",";
}
}
}
alarm_cause = cause+" "+alarm_cause;
strncpy(shared_data->alarm_cause,alarm_cause.c_str(), sizeof(shared_data->alarm_cause)-1);
Info ("Recorded alarm cause as: %s", alarm_cause.c_str());
if ( signal_change || (function != MOCORD && state != ALERT) ) {
int pre_index;
int pre_event_images = pre_event_count;
@ -1607,7 +1594,18 @@ bool Monitor::Analyse() {
event = new Event(this, *(image_buffer[pre_index].timestamp), cause, noteSetMap);
}
shared_data->last_event = event->Id();
// lets construct alarm cause. It will contain cause + names of zones alarmed
std::string alarm_cause="";
for ( int i=0; i < n_zones; i++) {
if (zones[i]->Alarmed()) {
alarm_cause += std::string(zones[i]->Label());
if (i < n_zones-1) {
alarm_cause +=",";
}
}
}
alarm_cause = cause+" "+alarm_cause;
strncpy(shared_data->alarm_cause,alarm_cause.c_str(), sizeof(shared_data->alarm_cause)-1);
//set up video store data
snprintf(video_store_data->event_file, sizeof(video_store_data->event_file), "%s", event->getEventFile());
video_store_data->recording = event->StartTime();