23
The param argument can take the following values: Type – String, range – available parameters of the event. The value argument can take the following values: Type – String, range
– depends on the parameter.
Usage examples
Problem. When an alarm is received, send the “panic lock” event corresponding to the camera region. For camera identification numbers from 1 to 4, use region 1; for camera numbers
from 5 to 10, use region 2.
if (Event.SourceType == "CAM" && Event.Action == "MD_START")
{
var regionid;
if (Event.SourceId <=4)
{
regionid = "1";
}
if ((Event.SourceId > 4) && (Event.SourceId <= 10))
{
regionid = "2";
}
NotifyEventStr("REGION", regionid, "PANIC_LOCK", "");
}
The NotifyEvent method
The NotifyEvent method generates system events. The event is sent to all kernels connected to the local kernel. The event is specified using the MsgObject object.
Method call syntax
function NotifyEvent(msgevent : MsgObject)
Note
Two types of system messages are available in the Intellect system: events and actions.
The events usually contain some information and are used as notifications sent to all Intellect kernels connected to each other during the system setup.
The actions are the control commands sent to specific objects. An action is transmitted only to the kernel where
the related object belongs, and not to the whole system.
The
and
methods are used to generate actions. The
and
methods are used to generate events.
DoReactStr
DoReact
NotifyEventStr
NotifyEvent
24
Method arguments:
msgevent - Required argument. The event sent to the system. It takes the following values: MsgObject objects created earlier in the script.
Example. When the Backup Archive 1 module starts archiving video recordings, the analog output 1 of the Video Capture Device 2 is disabled. Send the command as an event to be
registered in the Events Log.
if (Event.SourceType == "ARCH" && Event.SourceId == "1" && Event.Action == "ACTIVE ")
{
var msgevent = CreateMsg();
msgevent.SourceType = " GRABBER ";
msgevent.SourceId = "2";
msgevent.Action = "MUX1_OFF";
NotifyEvent(msgevent);
}
The NotifyEventGlobal method
The NotifyEventGlobal method is used to generate system events. The generated event is transmitted to all system kernels connected via the net. For the NotifyEventGlobal method
the event is specified using the MsgObject object.
Method call syntax
Note
Two types of system messages are available in Intellect system: events and reactions.
The events usually contain some information and are used as notifications sent to all Intellect kernels connected to each other during the system configuration.
The reactions are the control commands sent to specific objects.
The reactions are transmitted only to the kernel
where the object belongs, and not to the whole system.
The
and
methods are used to generate reactions. The
and
methods are used to generate events.
DoReactStr
DoReact
NotifyEventStr
NotifyEvent
Note
While executing this script, the analog output 1 of the Video Capture Device 2 is not disabled