clean up some logic in Analyse

pull/2618/head
Isaac Connor 2019-05-12 09:35:48 -04:00
parent 4c8a29e8d3
commit aada171440
1 changed files with 100 additions and 98 deletions

View File

@ -1432,7 +1432,8 @@ bool Monitor::Analyse() {
shared_data->active = signal; shared_data->active = signal;
} // end if signal change } // end if signal change
if ( (!signal_change && signal) && n_linked_monitors > 0 ) { if ( (!signal_change) && signal) {
if ( n_linked_monitors > 0 ) {
bool first_link = true; bool first_link = true;
Event::StringSet noteSet; Event::StringSet noteSet;
for ( int i = 0; i < n_linked_monitors; i++ ) { for ( int i = 0; i < n_linked_monitors; i++ ) {
@ -1453,13 +1454,13 @@ bool Monitor::Analyse() {
} else { } else {
linked_monitors[i]->connect(); linked_monitors[i]->connect();
} }
} } // end foreach linked_monit
if ( noteSet.size() > 0 ) if ( noteSet.size() > 0 )
noteSetMap[LINKED_CAUSE] = noteSet; noteSetMap[LINKED_CAUSE] = noteSet;
} } // end if linked_monitors
//TODO: What happens is the event closes and sets recording to false then recording to true again so quickly that our capture daemon never picks it up. Maybe need a refresh flag? //TODO: What happens is the event closes and sets recording to false then recording to true again so quickly that our capture daemon never picks it up. Maybe need a refresh flag?
if ( (!signal_change && signal) && (function == RECORD || function == MOCORD) ) { if ( function == RECORD || function == MOCORD ) {
if ( event ) { if ( event ) {
Debug(3, "Have signal and recording with open event at (%d.%d)", timestamp->tv_sec, timestamp->tv_usec); Debug(3, "Have signal and recording with open event at (%d.%d)", timestamp->tv_sec, timestamp->tv_usec);
@ -1543,7 +1544,8 @@ bool Monitor::Analyse() {
} }
} // end if false or config.overlap_timed_events } // end if false or config.overlap_timed_events
} // end if ! event } // end if ! event
} // end if ( (!signal_change && signal) && (function == RECORD || function == MOCORD) ) { } // end if function == RECORD || function == MOCORD)
} // end if !signal_change && signal
if ( score ) { if ( score ) {
if ( state == IDLE || state == TAPE || state == PREALARM ) { if ( state == IDLE || state == TAPE || state == PREALARM ) {