private void processConditionChange(DynamicValueCondition condition, Timestamp timestamp) { if (condition != null) { // ... characteristic "timestamp" doForwardCharacteristic( condition.getTimestamp(), timestamp, CharacteristicInfo.C_TIMESTAMP.getName()); // ... characteristic "status" doForwardCharacteristic( EpicsUtil.extratStatus(condition), timestamp, CharacteristicInfo.C_STATUS.getName()); // ... characteristic "severity" doForwardCharacteristic( EpicsUtil.toEPICSFlavorSeverity(condition), timestamp, CharacteristicInfo.C_SEVERITY.getName()); } }
protected void checkAndFireConditionEvents( DynamicValueCondition oldCond, DynamicValueCondition newCond) { fireDynamicValueEvent(DVE_CONDITIONCHANGE); if (newCond == null) return; if (oldCond == null) { if (newCond.containsAllStates(DynamicValueState.TIMELAG)) fireDynamicValueEvent(DVE_TIMELAGSTARTS); if (newCond.containsAllStates(DynamicValueState.TIMEOUT)) fireDynamicValueEvent(DVE_TIMEOUTSTARTS); if (newCond.containsAllStates(DynamicValueState.ERROR)) fireDynamicValueEvent(DVE_ERRORRESPONSE); } else { // timelag checks if (newCond.containsAllStates(DynamicValueState.TIMELAG) && !oldCond.containsAllStates(DynamicValueState.TIMELAG)) fireDynamicValueEvent(DVE_TIMELAGSTARTS); else if (oldCond.containsAllStates(DynamicValueState.TIMELAG) && !newCond.containsAllStates(DynamicValueState.TIMELAG)) fireDynamicValueEvent(DVE_TIMELAGSTOPS); // timeout checks if (newCond.containsAllStates(DynamicValueState.TIMEOUT) && !oldCond.containsAllStates(DynamicValueState.TIMEOUT)) fireDynamicValueEvent(DVE_TIMEOUTSTARTS); else if (oldCond.containsAllStates(DynamicValueState.TIMEOUT) && !newCond.containsAllStates(DynamicValueState.TIMEOUT)) fireDynamicValueEvent(DVE_TIMEOUTSTOPS); // error checks if (newCond.containsAllStates(DynamicValueState.ERROR) && !oldCond.containsAllStates(DynamicValueState.ERROR)) fireDynamicValueEvent(DVE_ERRORRESPONSE); } }