2 #include "ErrorHandler/MessageAnalyzer/ma_cell.h"
3 #include "ErrorHandler/MessageAnalyzer/ma_condition.h"
7 using namespace novadaq::errorhandler;
21 bool ma_cell::hit(
qt_mf_msg const& msg, boost::smatch
const& w,
ma_condition& cond,
size_t s_idx,
size_t t_idx)
27 time_t latest = msg.
time().tv_sec;
30 if (on && cond.persistent())
37 while (latest - msgs.front().time().tv_sec > cond.timespan())
41 while (msgs.size() > (size_t)cond.trigger_count())
45 bool new_state =
false;
47 if (msgs.size() == (size_t)cond.trigger_count())
49 new_state = cond.at_least() ?
true :
false;
52 boost::mutex::scoped_lock lock(cond.timing_events().lock);
58 time_t t0 = msgs.front().time().tv_sec;
59 t_event = t0 + cond.timespan() + 1;
60 cond.timing_events().event_queue().push(
ma_timing_event(t_event, cond, s_idx, t_idx));
62 else if (cond.at_most())
65 boost::mutex::scoped_lock lock(cond.timing_events().lock);
73 time_t t0 = msgs.front().time().tv_sec;
74 t_event = t0 + cond.timespan() + 1;
75 cond.timing_events().event_queue().push(
ma_timing_event(t_event, cond, s_idx, t_idx));
93 bool new_status = cond.at_most() ?
true : (cond.persistent() ?
true :
false);
104 void ma_cell::reset()
timeval time() const
Get the message timestamp
Qt wrapper around MessageFacility message