Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page The GetObjectParam method  The GetObjectState method Next page


The GetObjectParentId method returns the identification (registration) number of the parent object of the specified object.

Syntax for method invocation:

 function GetObjectParentId(objtype : String, id : String, parent : String) : String

Method arguments:

  1. objtype is a required argument. It specifies the type of the system object, for which you want to return the type of parent object. Possible values: String type, range is limited by object types registered in the system.
  2. id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argument. Possible values: String type, range is limited by the identification numbers of objects of the specified type registered in the system.
  3. parent is a required argument. It specifies the type of the system object that is the parent object (main object in the system hierarchy of objects) of the object specified by the objtype argument. Possible values: String type, range is limited by object types registered in the system.

Example. If a camera turns off or stops transmitting a video signal, send an email message registered in Axxon PSIM under number 1. The message must include the subject: "Warning! Camera turned off" and, in the message body, the number of the camera and of the server it is connected to.

Note

The Short Messages Service must be installed and work properly.

if (Event.SourceType == "CAM" && Event.Action == "DETACH")
{
 var cam_id = Event.SourceId;
 var parent_comp_id = GetObjectParentId("CAM", cam_id, "SLAVE");
 DoReactStr("MAIL_MESSAGE","1","SETUP","from<***@mail.com>,to<***@mail.com>,body<Camera disabling "+cam_id+" on the Server"+parent_comp_id+">,parent_id<1>,subject<Attention! Camera disabling>,name<Message 1>,objname<Message 1>");
 DoReactStr("MAIL_MESSAGE", "1", "SEND", "");
}