Package com.storedobject.iot
Class DataSet.LimitStatus
-
Method Summary
Modifier and TypeMethodDescriptionint
alarm()
Evaluates the current value against predefined limits and returns an alarm status based on the value range.getValue()
Retrieves the value associated with this instance.Retrieves the value definition associated with the current limit status.Provides a textual representation of the current status based on the alarm level.unit()
value()
Provides the current value as a formatted string.value
(double value, boolean showUnit) Formats a given numeric value into a string representation.Retrieves the formatted value of the specified attribute for the current status.Methods inherited from class com.storedobject.iot.DataSet.DataStatus
alert, caption, dailyStatistics, display, equals, getAlarmMessage, getId, getUnit, hashCode, hourlyStatistics, label, monthlyStatistics, ordinality, significance, tooltip, weeklyStatistics, yearlyStatistics
-
Method Details
-
getValueDefinition
Retrieves the value definition associated with the current limit status.- Overrides:
getValueDefinition
in classDataSet.DataStatus<Double>
- Returns:
- the
ValueLimit
object representing the value definition specific to limit status.
-
getValue
Retrieves the value associated with this instance.- Specified by:
getValue
in classDataSet.DataStatus<Double>
- Returns:
- the value as a Double
-
alarm
public int alarm()Evaluates the current value against predefined limits and returns an alarm status based on the value range.The method first checks whether the value is considered "unlimited". If so, it returns 0 to indicate no alarm. Otherwise, it compares the current value to specific threshold values provided by
ValueLimit
, determining the severity of the alarm as follows:- Returns 3 if the value exceeds or equals the highest or higher thresholds. - Returns 1 if the value exceeds or equals the high threshold. - Returns 0 if the value lies between the high and low thresholds. - Returns -1 if the value is below the low threshold but above the lower threshold. - Returns -2 if the value is below the lower threshold but above the lowest threshold. - Returns -3 if the value is below the lowest threshold.
- Specified by:
alarm
in classDataSet.DataStatus<Double>
- Returns:
- An integer representing the alarm level:
0: No alarm for unlimited or normal range values, 3: Severe high-level alarm, 1: Low-level high alarm, -1: Low-level low alarm, -2: Moderate low-level alarm, -3: Critical low-level alarm.
-
statusLabel
Provides a textual representation of the current status based on the alarm level.- Specified by:
statusLabel
in classDataSet.DataStatus<Double>
- Returns:
- A string representing the status label. Possible values are: "highest", "higher", "high", "normal", "low", "lower", or "lowest".
-
value
Provides the current value as a formatted string. This method internally calls thevalue(double, boolean)
method with the instance's default value and a flag to indicate whether the unit should be shown.- Specified by:
value
in classDataSet.DataStatus<Double>
- Returns:
- A string representation of the current value, potentially including the unit based on the internal configuration.
-
value
Formats a given numeric value into a string representation. If the input value is not a finite number (e.g., infinity, NaN, or extreme double limits), it returns "N/A". Otherwise, the value is formatted based on the number of decimals defined in the associatedValueLimit
and optionally includes a unit suffix.- Overrides:
value
in classDataSet.DataStatus<Double>
- Parameters:
value
- The numeric value to be formatted.showUnit
- A boolean flag indicating whether the unit suffix should be included in the formatted string.- Returns:
- A string representation of the value, formatted to the specified number of decimals and optionally including the unit suffix. Returns "N/A" for invalid values.
-
value
Retrieves the formatted value of the specified attribute for the current status. If the attribute is null or empty, it falls back to the default value method. The method dynamically resolves and applies appropriate display logic for the attribute if not available in the cached custom functions.- Overrides:
value
in classDataSet.DataStatus<Double>
- Parameters:
attribute
- the name of the attribute whose value is to be retrieved. It can be null or empty, in which case the default value is returned.- Returns:
- a string representing the formatted value of the specified attribute, or "None" if the corresponding value object is unavailable.
-
unit
-