pMe | (Object) Reference to the PmaAlarmGroup object where the event rises. |
---|---|
pEvent | (Object) Reference to an object describing detailed information about the specific event.
pEvent.Action - (String) [for reading] Specifies the selected action over the alarm item.
ack - The user selected the acknowledgment of the selected alarm in the alarm state viewer.
ackall - The user selected the acknowledgment of all alarms in the alarm state viewer. pEvent.ItemId - (String) [for reading] The identifier of the selected alarm item (if it doesn't go about multiple operation).
pEvent.TimeOn - (Date) [for reading] The rise time of the selected alarm item (if it doesn't go about multiple operation). It goes about supplementary information to the identifier of the alarm item, that allows unambiguous idenfication of the selected alarm item.
If it is allowed to store inactive, unacknowledged (blue) alarms in the "Number of inactive, unacknowledged older copies of the (blue) alarm" configurator, then more alarm items can have the same identifier. pEvent.Context - (Object) [for reading] The reference to the object containing additional information about the user, that executed the action followed by triggering this event. The creation and termination of the alarm is always done by the local user. The alarm acknowledgment can be executed both by local and network application user (e.g. from the Web). The user information can be used, for example, either for enabling/disabling the action (if possible), or for entering the user information into the alarms.
pEvent.Context.User - The reference to the PmUser object, containing detailed information about the user (local or network), that executed the action that triggered this event.
Caution! In order to keep the subobject User value trustworthy it is necessary to exclude the pseudo-groups $ANY and $ANY_NET from the appropriate "WebRead" permission (i.e. to ensure that the user is logged in when opening the Web pages). pEvent.Context.Language - Returns the information about the national language. Language is determined with a text identifier, e.g. "en", "de", "ru" etc. - see Fully supported languages in the PROMOTIC system. See the "PmaRoot > Application > Main language of runtime" configurator. pEvent.Enabled - (Boolean) [for read and write] Specifies whether the required action is performed over the selected alarm item or not.
true (default) - Alarm system performs the selected action over the selected alarm item.
false - Alarm system doesn't perform the selected action over the selected alarm item. |
Pm.Debug("Alarm - Action=" + pEvent.Action + ", itemId=" + pEvent.ItemId + ", -> user=" + pEvent.Context.User.Id + ", Time=" + Now());
var sVarName, sUserName;
var oItem = pMe.Item(pEvent.ItemId);
var oExt = oItem.Extension();
if (oExt)
{
sVarName = oExt.Var.Name;
sUserName = pEvent.Context.User.Name;
}