Go to documentation repository
The GetObjectName method returns the name of the object that it was given upon creation.during registration in the program.
Syntax for method invocation:Method call syntax
| Code Block | ||
|---|---|---|
| ||
function GetObjectName(objtype : String, id : String) : String |
Method arguments:
Usage examples
Problem. In case of Example. On alarm in any sensor, open the information window with the following text: "Alarm in the <alarmed sensor name> sensor . Sensor connected to the <server name Server <name of the section to which the sensor is connected to> server”connected>”.
| Info | ||
|---|---|---|
| ||
Create You must create the information dialog window beforehand using the Arpedit.exe utility and save it as in the test.dlg file in the <Axxon PSIM><Axxon PSIM installation directory>\Program folder. |
| Code Block | ||
|---|---|---|
| ||
if (Event.SourceType == "GRAY" && Event.Action == "ALARM")
{
var grayid = Event.SourceId;
var grayname = GetObjectName("GRAY", grayid);
var compname = GetObjectParentId("GRAY", grayid, "COMPUTER");
DoReactStr("DIALOG", "test", "CLOSE_ALL","");
DoReactStr("DIALOG", "test", "RUN","Alarm in the '" + grayname + "' sensor connected to the '" + compname + "' server.");
} |