From 9f97baf0560ba94fd2bf36defba5137b1eafa672 Mon Sep 17 00:00:00 2001
From: gscalamera <graziano.scalamera@elettra.eu>
Date: Thu, 28 Oct 2021 15:51:07 +0200
Subject: [PATCH] Fix alarm state of disabled alarms in GetAlarmInfo

---
 src/AlarmHandler.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/AlarmHandler.cpp b/src/AlarmHandler.cpp
index 043a77d..3387c7d 100644
--- a/src/AlarmHandler.cpp
+++ b/src/AlarmHandler.cpp
@@ -3033,8 +3033,13 @@ Tango::DevVarStringArray *AlarmHandler::get_alarm_info(const Tango::DevVarString
 	if(it->second.error)
 	{
 		tmp_ex << "{\"Reason\":\"" << it->second.ex_reason << "\",\"Desc\":\"" << it->second.ex_desc << "\",\"Origin\":\"" << it->second.ex_origin << "\"}";
-		info.insert(make_pair(VALUE_KEY,string("ERROR")));
-		complete.push_back(KEY(VALUE_KEY)+string("ERROR"));
+		string almstate(tmp_val.str());
+		if(almstate != "SHLVD" && almstate != "OOSRV")
+		{
+			almstate = S_ERROR;
+		}
+		info.insert(make_pair(VALUE_KEY,almstate));
+		complete.push_back(KEY(VALUE_KEY)+almstate);
 		info.insert(make_pair(MESSAGE_KEY,tmp.str()));
 		complete.push_back(KEY(MESSAGE_KEY)+tmp.str());
 		info.insert(make_pair(URL_KEY,it->second.url));
-- 
GitLab