/** * Set maintenance mode. * * @param maintenance_mode * @see AlarmLogic#getMaintenanceMode() */ public void setMaintenanceMode(final boolean maintenance_mode) { // Any change? if (maintenance_mode == AlarmLogic.getMaintenanceMode()) return; // Configure alarm logic AlarmLogic.setMaintenanceMode(maintenance_mode); // Send update to clients messenger.sendIdleMessage(); // Entering maintenance mode: Ack' all INVALID alarms if (maintenance_mode) { synchronized (this) { for (AlarmPV pv : pv_list) { final AlarmLogic logic = pv.getAlarmLogic(); if (logic.getAlarmState().getSeverity() == SeverityLevel.INVALID) logic.acknowledge(true); } } } }
/** * (Un-)acknowledge alarm. * * @param pv_name PV to acknowledge * @param acknowledge Acknowledge, or un-acknowledge? */ public void acknowledge(final String pv_name, final boolean acknowledge) { resetNagTimer(); final AlarmPV pv = findPV(pv_name); if (pv != null) pv.getAlarmLogic().acknowledge(acknowledge); }