Builds the message, severity, quality and retain flag that a condition reports.
alarm.calculateConditionInfo = (state, isActive, value, oldConditionInfo) => newConditionInfo({ message:`Tank is almost ${Math.ceil(value*100)}% full`, severity:100, quality:StatusCodes.Good, retain:true });
The interface of the same name above is the shape of the result; this is the constructor
for it. A type and a value may share a name, which is what lets both live here - and one
module has to own the name, or export * from two of them is ambiguous.
The documentation for the alarm override point has called new ConditionInfo({...}) for
years while only the type was exported and the sole constructor was an internal class, so
the example did not run as written and code following it had to reach into the
implementation to find one.
Builds the message, severity, quality and retain flag that a condition reports.
The interface of the same name above is the shape of the result; this is the constructor for it. A type and a value may share a name, which is what lets both live here - and one module has to own the name, or
export *from two of them is ambiguous.The documentation for the alarm override point has called
new ConditionInfo({...})for years while only the type was exported and the sole constructor was an internal class, so the example did not run as written and code following it had to reach into the implementation to find one.