The GetObjectName method returns the name of the object that it was given upon creation.
Method call syntax
function GetObjectName(objtype : String, id : String) : String |
Method arguments:
Usage examples
Problem. In case of alarm in any sensor, open the information window with the following text - "Alarm in the <alarmed sensor name> sensor connected to the <server name which the sensor is connected to> server”.
Create the information dialog window beforehand using the Arpedit.exe utility and save it as test.dlg in the <Intellect>\Program folder. |
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.");
} |