Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page Next page


You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

The GetObjectIdByParam method allows receiving of object ID at which some parameter is equal to the specified value. The first found object ID is receiving if there are several such objects. The null is receiving if such objects are not found

Syntax of method invocation:

function GetObjectIdByParam (obj_type : String, obj_param : String, param_value : String)

Method arguments:

  1. obj_type – required argument. Specifies type of system object, ID of which is required to get.
  2. obj_param - required argument. Specifies the name of parameter in database on value of which the object is to be found.
  3. param_value – required argument. Specifies the required value of object parameter.

Example. Find cameras from which black-and-white image is receiving and set the Color parameter equals to 1 for them.

if (Event.SourceType == "MACRO" && Event.SourceId== "1" && Event.Action == "RUN")
 
{
 var id = GetObjectIdByParam("CAM","color","0"); //receiving the first object ID
 while (id){ //while exist the Camera objects from which black-and-white image is receiving
  SetObjectParam ("CAM", id, "color", "1"); //change the Color parameter for found object
  id = GetObjectIdByParam("CAM","color","0"); //receiving the next object ID
 }
}
  • No labels