From 79778360cd206ccbd18813a2636f7ab9600f925f Mon Sep 17 00:00:00 2001
From: amichelo <andrea.michelotti@lnf.infn.it>
Date: Thu, 11 Nov 2021 21:41:20 +0100
Subject: [PATCH] powersupply no multiple logs

---
 chaos/cu_toolkit/control_manager/AbstractControlUnit.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/chaos/cu_toolkit/control_manager/AbstractControlUnit.cpp b/chaos/cu_toolkit/control_manager/AbstractControlUnit.cpp
index 6b42a0026..3d9bf2422 100644
--- a/chaos/cu_toolkit/control_manager/AbstractControlUnit.cpp
+++ b/chaos/cu_toolkit/control_manager/AbstractControlUnit.cpp
@@ -2100,6 +2100,7 @@ int AbstractControlUnit::checkFn(double sval, double rval, const chaos::common::
   //  checkLimFn(rval,i);
 
   double res = fabs(sval - rval);
+ // ACULAPP_ << i.name << " CHECK :" << rval << " setpoint :" << sval << " threshold:" << atof(i.errorThreshold.c_str()) << " res:" << res;
 
   if (i.errorThreshold.size()) {
     if (i.errorThreshold.c_str() == "0") {
@@ -2134,6 +2135,8 @@ int AbstractControlUnit::checkFn(double sval, double rval, const chaos::common::
       return err;
     }
   }
+  //ACULAPP_ << i.name << " CLEAR CHECK :" << rval << " setpoint :" << sval << " threshold:" << atof(i.errorThreshold.c_str()) << " res:" << res;
+
   setStateVariableSeverity(StateVariableTypeAlarmCU, alrm, chaos::common::alarm::MultiSeverityAlarmLevelClear);
 
   return err;
@@ -3362,7 +3365,7 @@ void AbstractControlUnit::alarmChanged(const std::string& state_variable_tag,
   //update alarm log
   if ((log_maxupdate_ms == 0) ||
       (alarm_logging_channel && (log_maxupdate_ms > 0) && ((alarm->getLastUpdateTimestamp() - alarm_ms->last_log_ms) > log_maxupdate_ms))) {
-    // ACULDBG_ << "State "<<state_variable_name<<" last modified:"<<( alarm->getLastUpdateTimestamp() -alarm_ms->last_log_ms)<<" ms freq:"<<alarm_ms->max_freq_log_ms;
+    ACULDBG_ << "Log State "<<state_variable_name<<" severity:"<<(int32_t)state_variable_severity<<" last modified:"<<( alarm->getLastUpdateTimestamp() -alarm_ms->last_log_ms)<<" ms freq:"<<alarm_ms->max_freq_log_ms;
 
     alarm_logging_channel->logAlarm(getCUID(),
                                     "AbstractControlUnit",
-- 
GitLab