Skip to content

Commit

Permalink
Merge pull request #2892 from ControlSystemStudio/alarm_patches
Browse files Browse the repository at this point in the history
Handle alarm actions to show error message
  • Loading branch information
georgweiss authored Dec 16, 2023
2 parents 79e51d2 + 4b4539d commit 2fac707
Show file tree
Hide file tree
Showing 13 changed files with 408 additions and 370 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,14 @@ public static synchronized void acknowledgePV(AlarmPV alarmPV, boolean ack)
}
if (node != null)
{
try {
alarmModels.get(alarmPV.getInfo().getRoot()).acknowledge(node, ack);
} catch (Exception e) {
logger.log(Level.WARNING, "Failed to acknowledge alarm", e);
}
AlarmTreeItem<?> alarmClientNode = node;
JobManager.schedule("Acknowledge/unacknowledge alarm", monitor -> {
try {
alarmModels.get(alarmPV.getInfo().getRoot()).acknowledge(alarmClientNode, ack);
} catch (Exception e) {
logger.log(Level.WARNING, "Failed to acknowledge alarm", e);
}
});
}
}
}
Expand Down Expand Up @@ -153,8 +156,14 @@ public static synchronized void enablePV(AlarmPV alarmPV, boolean enable)
for (AlarmClientLeaf pv : pvs)
{
final AlarmClientLeaf copy = pv.createDetachedCopy();
if (copy.setEnabled(enable))
alarmModels.get(alarmPV.getInfo().getRoot()).sendItemConfigurationUpdate(pv.getPathName(), copy);
if (copy.setEnabled(enable)){
try {
alarmModels.get(alarmPV.getInfo().getRoot()).sendItemConfigurationUpdate(pv.getPathName(), copy);
} catch (Exception e) {
logger.log(Level.WARNING, "Failed to send item configuration update to " + alarmPV.getInfo().getRoot(), e);
throw e;
}
}
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ public class AlarmSystem extends AlarmSystemConstants
/** "Disable until.." shortcuts */
@Preference public static String[] shelving_options;

@Preference public static int max_block_ms;

/** Macros used in UI display/command/web links */
public static MacroValueProvider macros;

Expand Down
Loading

0 comments on commit 2fac707

Please sign in to comment.