Skip to content

Commit a296786

Browse files
authored
Merge pull request #3184 from jeonghanlee/latched_enabled_to_command_alarmLogTable
Add the missing Latch status into the Alarm Logger History
2 parents 7ce4a9d + e98ae67 commit a296786

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

app/alarm/logging-ui/src/main/java/org/phoebus/applications/alarm/logging/ui/AlarmLogTableController.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.phoebus.applications.alarm.logging.ui;
22

33
import com.fasterxml.jackson.core.JsonProcessingException;
4+
import com.fasterxml.jackson.databind.JsonNode;
45
import com.fasterxml.jackson.databind.ObjectMapper;
56
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
67
import com.sun.jersey.api.client.WebResource;
@@ -40,6 +41,7 @@
4041
import org.phoebus.applications.alarm.AlarmSystem;
4142
import org.phoebus.applications.alarm.logging.ui.AlarmLogTableQueryUtil.Keys;
4243
import org.phoebus.applications.alarm.model.SeverityLevel;
44+
import org.phoebus.applications.alarm.model.json.JsonModelReader;
4345
import org.phoebus.applications.alarm.ui.AlarmUI;
4446
import org.phoebus.framework.jobs.Job;
4547
import org.phoebus.framework.selection.SelectionService;
@@ -249,7 +251,17 @@ protected void updateItem(String item, boolean empty) {
249251
if (!en) {
250252
return new SimpleStringProperty("Disabled");
251253
} else {
252-
return new SimpleStringProperty("Enabled");
254+
try {
255+
final JsonNode jsonNode = (JsonNode) JsonModelReader.parseJsonText(alarmMessage.getValue().getConfig_msg());
256+
if (jsonNode == null) {
257+
logger.log(Level.WARNING, "There is no JasonNode");
258+
return null;
259+
}
260+
final boolean latching = jsonNode.get("latching").asBoolean();
261+
return new SimpleStringProperty(latching ? "Enabled:Latched" : "Enabled:Unlatch");
262+
} catch (Exception e) {
263+
logger.log(Level.SEVERE, "Unexpected error in alarmMessage" + e);
264+
}
253265
}
254266
}
255267
return null;

0 commit comments

Comments
 (0)