Hi Dojo,
We know we can get/set a parameter's value in QAction.
My question is, can we get the alarm status in QAction ?
Regards,
Hi Greisen,
You'll need to use an SLNet call to get the alarm level, since the SLProtocol object itself gives you access to the information in the SLProtocol process, while alarms are created and stored in the SLElement process and made available through SLNet.
There are libraries available that should make this interaction easier, but right now, I haven't found the right request in the Skyline.DataMiner.Core.DataMinerSystem.Protocol library.
So, the GetAlarmStateMessage should give you the parameter or cell alarm level you are looking for.
I'm sure one of my peers will let us know during business hours if there's a library that puts this in a neater package.
Hi Greisen,
Another approach could be processing alarms through a correlation rule/automation script. It is true that processing alarms in a QAction will implies less development, however we try to avoid that approach since we will need to implement a custom logic in the connector.
In the class library, the alarm level of a standalone parameter can be obtained as follows :
IDms myDms = protocol.GetDms();
var element = myDms.GetElement(“myElement”);
int parameterId = 10;
var parameter = element.GetStandaloneParameter(parameterId);
var alarmLevel =parameter.GetAlarmLevel();
(https://docs.dataminer.services/develop/api/types/Skyline.DataMiner.Core.DataMinerSystem.Common.IDmsStandaloneParameter.GetAlarmLevel.html#Skyline_DataMiner_Core_DataMinerSystem_Common_IDmsStandaloneParameter_GetAlarmLevel)
For a table cell:
var table = element.GetTable(1000);
var column = table.GetColumn(1002);
var alarmLevelCell = column.GetAlarmLevel(“pk”, KeyType.PrimaryKey);
(https://docs.dataminer.services/develop/api/types/Skyline.DataMiner.Core.DataMinerSystem.Common.IDmsColumn.GetAlarmLevel.html#Skyline_DataMiner_Core_DataMinerSystem_Common_IDmsColumn_GetAlarmLevel_System_String_Skyline_DataMiner_Core_DataMinerSystem_Common_KeyType_)