Optionalretain: booleanWhat the alarm does when the value of its input node changes. Assign to it to give an alarm a behaviour of its own, without deriving from an implementation class:
alarm.onInputDataValueChange = (newValue) => {
const tooHot = newValue.value.value > 80;
if (tooHot !== alarm.activeState.getValue()) {
alarm.signalNewCondition(tooHot ? "Active" : "Inactive", tooHot, `${newValue.value.value}`);
}
};
The default does nothing: a plain AlarmConditionType cannot know what its input means. Alarm types that do know (limit alarms, off-normal alarms) already define it, so assigning to one of those replaces the behaviour it came with.
The old name _onInputDataValueChange still works and is deprecated.
How the alarm turns the value of its input node into limit states. Assign to it to give a limit alarm a rule of its own:
alarm.setStateBasedOnInputValue = (value) => {
const isActive = value > alarm.getHighLimit();
alarm.signalNewCondition(isActive ? "High" : null, isActive, value.toFixed(3));
};
Every concrete limit alarm type already defines this, so assigning to one replaces the rule it came with; the base LimitAlarmType has no limit states of its own and throws.
The old name _setStateBasedOnInputValue still works and is deprecated.
Raise a new condition event for this alarm, moving it to the given state.
Call this only when the condition has actually changed: it throws when the ConditionInfo it computes is equal to the current one, because an event that reports nothing new is a bug in the caller rather than a state the alarm can represent.
The old name _signalNewCondition still works and is deprecated.
What the alarm reports when its state changes. Assign to it to give an alarm a message and a severity of its own:
The default returns the previous ConditionInfo unchanged, so an alarm that does not assign one reports nothing new.
This has been the documented way to give an alarm its own message for years, but under the name
_calculateConditionInfoand only on the implementation class, so following the documentation meant importing from inside the package. That name still works and is deprecated.