clean up signal change code a bit, using new event notesetmap update function. So now when we lose signal, the event will close but it will have signal change :Lost added to it's notes. A new event will only be created if in RECORD/MOCORD.
This commit is contained in:
parent
7215756fed
commit
b1353823cf
|
@ -1769,29 +1769,25 @@ bool Monitor::Analyse() {
|
|||
// FIXME this snap might not be the one that caused the signal change. Need to store that in the packet.
|
||||
if (signal_change) {
|
||||
Debug(2, "Signal change, new signal is %d", signal);
|
||||
const char *signalText = "Unknown";
|
||||
if (!signal) {
|
||||
signalText = "Lost";
|
||||
if (event) {
|
||||
event->addNote(SIGNAL_CAUSE, "Lost");
|
||||
Info("%s: %03d - Closing event %" PRIu64 ", signal loss", name.c_str(), analysis_image_count, event->Id());
|
||||
closeEvent();
|
||||
last_section_mod = 0;
|
||||
}
|
||||
} else {
|
||||
signalText = "Reacquired";
|
||||
score += 100;
|
||||
}
|
||||
} else if (function == MOCORD or function == RECORD) {
|
||||
if (!event) {
|
||||
if (cause.length()) cause += ", ";
|
||||
cause += SIGNAL_CAUSE;
|
||||
cause += SIGNAL_CAUSE + std::string(": Reacquired");
|
||||
} else {
|
||||
event->addNote(SIGNAL_CAUSE, "Reacquired");
|
||||
}
|
||||
if (snap->image)
|
||||
ref_image.Assign(*(snap->image));
|
||||
}
|
||||
Event::StringSet noteSet;
|
||||
noteSet.insert(signalText);
|
||||
noteSetMap[SIGNAL_CAUSE] = noteSet;
|
||||
shared_data->state = state = IDLE;
|
||||
shared_data->active = signal;
|
||||
if ((function == MODECT or function == MOCORD) and snap->image)
|
||||
ref_image.Assign(*(snap->image));
|
||||
} // end if signal change
|
||||
|
||||
if (signal) {
|
||||
|
|
Loading…
Reference in New Issue