Go to documentation repository
The GetObjectParentId method returns the identification (registration)number of the parent object of the specified object.
Method call syntaxSyntax for method invocation:
| Code Block | ||
|---|---|---|
| ||
function GetObjectParentId(objtype : String, id : String, parent : String) : String |
Method arguments:
Usage examples
ProblemExample. If a camera turns off or stops transmitting a video signal, send an e-mail message with the following 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.
| Info | ||
|---|---|---|
| ||
The The Short Messages Service is supposed to must be installed and working work properly. |
| Code Block | ||
|---|---|---|
| ||
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", "");
}
|
...