widgets/implementations/alarms/alarm-widget.service.ts
Methods |
constructor(alarmsViewService: AlarmsViewService)
|
||||||
Parameters :
|
addAllMissingSeverityTypes | ||||||||
addAllMissingSeverityTypes(severity: SeverityFilter)
|
||||||||
Adds any missing severity types to the provided severity object with a default value of
Parameters :
Returns :
SeverityFilter
The modified severity object, which includes all predefined severity types, adding any
that were missing with a value of |
allValuesFalse | ||||||||
allValuesFalse(obj: literal type)
|
||||||||
Determines if all values in the given object are false. This function checks every value in the provided object to see if they are all false.
Parameters :
Returns :
boolean
|
extractFilterParams | ||||||||
extractFilterParams(obj: SeverityFilter | AlarmStatusSettings)
|
||||||||
Extracts and concatenates filter parameters from a given object. This function takes an object containing filter settings (either SeverityFilter or AlarmStatusSettings) and returns a string of all keys where the corresponding value is true. If the object is empty or null, an empty string is returned.
Parameters :
Returns :
string
|
filterAlarmsByStatusSeverityAndType | ||||||||||||||||
filterAlarmsByStatusSeverityAndType(alarm: number | IAlarm, alarms: IAlarm[], config?: AlarmListWidgetConfig)
|
||||||||||||||||
Filters alarms based on their status, severity, and type. This method determines if a given alarm, identified either by a numeric ID or an
Parameters :
Returns :
boolean
|
getOrderParameters | ||||||||
getOrderParameters(order: AlarmOrderType)
|
||||||||
Constructs a string of order parameters for a query based on the specified alarm order. This function takes an alarm order and maps it to a corresponding set of order parameters. It supports different ordering types, such as BY_ACTIVE, BY_SEVERITY, and BY_DATE_ASCENDING. The order parameters are used to construct a query string that determines the order in which alarms are retrieved or displayed.
Parameters :
Returns :
string
|
getPredefinedConfiguration | ||||||||||||
getPredefinedConfiguration(isIntervalRefresh: boolean, widgetId?: string)
|
||||||||||||
Creates predefined widget configuration object. This method creates a new configuration object based on a widgets ID (that determines if is a legacy Recent or Critical alarms widget).
Parameters :
Returns :
AlarmListWidgetConfig
The new, predefined configuration object. |
hasExistingAlarmChangedStatus | ||||||||||||
hasExistingAlarmChangedStatus(existingAlarms: IAlarm[], incomingRealtimeAlarm: IAlarm)
|
||||||||||||
Determines if an incoming real-time alarm has a different status than an existing alarm. This function checks if the provided incoming real-time alarm's status differs from that of an existing alarm with the same ID in the given array of alarms.
Parameters :
Returns :
boolean
|
isContainingAllSeverityTypes | ||||||||
isContainingAllSeverityTypes(severity: SeverityFilter)
|
||||||||
Checks if the provided severity object contains all the predefined severity types. Example :
Parameters :
Returns :
boolean
|
isOldAlarmConfigStructure | ||||||||
isOldAlarmConfigStructure(data: LegacyAlarmListConfig | AlarmListWidgetConfig)
|
||||||||
Checks if the provided data follows the LegacyAlarmConfig structure. This function determines if a given data object is an instance of LegacyAlarmConfig by checking for the presence of the 'options' property.
Parameters :
Returns :
LegacyAlarmListConfig
|
isTypesMatching | ||||||||||||
isTypesMatching(config: AlarmListWidgetConfig, alarm: IAlarm)
|
||||||||||||
Checks if the configuration's types array contains only empty string or includes a specific alarm type.
Parameters :
Returns :
boolean
|
mapConfigToQueryFilter | ||||||||||||
mapConfigToQueryFilter(config: AlarmListWidgetConfig, pageSize?: number)
|
||||||||||||
Maps an AlarmListWidgetConfig object to an AlarmQueryFilter. This function converts the provided AlarmListWidgetConfig into a format suitable for querying alarms.
Parameters :
Returns :
AlarmQueryFilter
|
mapToNewConfigStructure | ||||||||||||
mapToNewConfigStructure(oldConfig: LegacyAlarmListConfig, isIntervalRefresh: boolean)
|
||||||||||||
Transforms a LegacyAlarmConfig object into an AlarmListWidgetConfig object. This function maps the properties from an old configuration structure (LegacyAlarmConfig) to a new configuration structure (AlarmListWidgetConfig).
Parameters :
Returns :
AlarmListWidgetConfig
|