diff --git a/src/AlarmHandler.cpp b/src/AlarmHandler.cpp index 94f2af3c89811535766be9c8f2d016945e42422a..d1ac6026237386e3672c7a0a8973da86206b48b2 100644 --- a/src/AlarmHandler.cpp +++ b/src/AlarmHandler.cpp @@ -4454,7 +4454,7 @@ formula_res_t AlarmHandler::eval_formula(tree_parse_info_t tree, string &attr_va { formula_res_t res = eval_expression(tree.trees.begin(), attr_values); #ifdef _DEBUG_FORMULA - DEBUG_STREAM << __func__ << ": finally value=" << res.value << " valid=" << (int)res.valid << " error='" << res.error << "' ex_desc='" << res.ex_desc<<"'" << endl; + DEBUG_STREAM << __func__ << ": finally value=" << res.value << " valid=" << (int)res.valid << " error='" << res.error << "' ex_desc='" << res.ex_desc<<"' quality=" << res.quality << endl; #endif if(res.valid) { @@ -4719,7 +4719,7 @@ formula_res_t AlarmHandler::eval_expression(iter_t const& i, string &attr_values res.ex_origin = it->ex_origin; res.error = err.str(); #ifdef _DEBUG_FORMULA - DEBUG_STREAM << " attribute -> " << string(i->value.begin(), i->value.end()) << " value not valid, desc=" << res.ex_desc << endl; + DEBUG_STREAM << " attribute -> " << string(i->value.begin(), i->value.end()) << " value not valid, desc=" << res.ex_desc << " quality=" << res.quality << endl; #endif events->veclock.readerOut(); //throw err.str(); @@ -4739,7 +4739,7 @@ formula_res_t AlarmHandler::eval_expression(iter_t const& i, string &attr_values res.ex_origin = it->ex_origin; res.error = err.str(); #ifdef _DEBUG_FORMULA - DEBUG_STREAM << " attribute -> " << string(i->value.begin(), i->value.end()) << " value empty, desc=" << res.ex_desc << endl; + DEBUG_STREAM << " attribute -> " << string(i->value.begin(), i->value.end()) << " value empty, desc=" << res.ex_desc << " quality=" << res.quality << endl; #endif events->veclock.readerOut(); //throw err.str(); diff --git a/src/alarm_table.cpp b/src/alarm_table.cpp index 64f1badd7fd0bf274691e6272b16b63daf4c65a6..9ca66f8418e388b79015a8490b925c5387934c5c 100644 --- a/src/alarm_table.cpp +++ b/src/alarm_table.cpp @@ -359,6 +359,9 @@ bool alarm_table::update(const string& alm_name, Tango::TimeVal ts, formula_res_ status_err_delay = (!res.valid) && (found->second.err_counter >= 1) && ((now.tv_sec - err_delay) > found->second.ts_err_delay.tv_sec); //error is present and err delay has passed else status_err_delay = (!res.valid); + found->second.ex_reason = res.ex_reason; + found->second.ex_desc = res.ex_desc; + found->second.ex_origin = res.ex_origin; if(!status_err_delay && !res.valid) //formula result not valid, waiting for err_delay { found->second.attr_values_delay = attr_values; //save last attr_values to be used in timer_update if this alarm pass over on or off delay @@ -369,9 +372,6 @@ bool alarm_table::update(const string& alm_name, Tango::TimeVal ts, formula_res_ return ret_changed; } found->second.quality = res.quality; - found->second.ex_reason = res.ex_reason; - found->second.ex_desc = res.ex_desc; - found->second.ex_origin = res.ex_origin; bool status_on_delay; if(found->second.on_delay > 0) //if enabled on delay status_on_delay = ((bool)(res.value != 0)) && (found->second.on_counter >= 1) && ((ts.tv_sec - found->second.on_delay) > found->second.ts_on_delay.tv_sec); //formula gives true and on delay has passed diff --git a/src/event_table.h b/src/event_table.h index d33b7f2ef4e6f14b76db6d57d1caf7c3a02f03e6..3c5980ee11e63ebf36fd7f5ca886026961981fa7 100644 --- a/src/event_table.h +++ b/src/event_table.h @@ -58,7 +58,7 @@ class event { string attname; value_t value; /* event value */ string value_string; //added for DevString attributes - int quality; + int quality{Tango::ATTR_INVALID}; string ex_reason; string ex_desc; string ex_origin;