Promotic
WikipediaLinkedInYoutubeTwitterFacebook

onStateChange - event of object PmaAlarmGroup

Description:
The event is triggered when alarm item state change.
Parameters:
pMe(Object) Reference to the PmaAlarmGroup object where the event rises.
pEvent(Object) Reference to object describing detailed information about the specific event.
pEvent.Item - (Object) The reference to the alarm item (to the PmAlarmItem object) that was changed.
pEvent.Action - (Long) Indication of the change type
0 - alarm was activated (see PmAlarmItem.Activate method)
1 - alarm was inactivated (see PmAlarmItem.Inactivate method)
2 - alarm was acknowledged (see PmAlarmItem.Acknowledge method)
3 - alarm has been changed by the system to NEW non-initialized inactive acknowledged (green) alarm. See "Change inactive confirmed (green) CEASED to NEW non-initialized alarms in [s] (-1=never)" configurator.
pEvent.Context - (Object) Reference to the object containig additional information about the user, that executed the action followed by calling this event. The creation and demise of the alarm is always done by the local user. The alarm acknowledgement can be executed both by local and network application user (e.g. from the Web). The user info can be used, for example, for enabling/disabling the action (if possible), or for entering the user info into the alarms/events.
pEvent.Context.User - Reference to the PmUser object, containing detailed information about the user (local or network), that executed the action that called the method.

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 "PmaRoot > Application > Main language of runtime" configurator.
See also:
Example:
Into the Debug_info item of the INFO system we'll write every change of each item:
JavaScriptVBScriptSelect and copy to clipboard

var sAction;
switch (pEvent.Action)
{
case 0:
sAction = "ACTIVATE";
break;
case 1:
sAction = "INACTIVATE";
break;
case 2:
sAction = "ACKNOWLEDGE";
break;
default:
sAction = "??";
break;
}

Pm.Debug("Event onStateChange:");
Pm.Debug("Action = " + sAction);
Pm.Debug("Description = " + pEvent.Item.Description);
PROMOTIC 9.0.4 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice