Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page The NotifyEventGlobalStr method  The SetObjectState method Next page


The SetObjectParam method is used to set the values to system object parameters.

Syntax for method invocation:

function SetObjectParam(objtype: String, id: String, param : String, value : String)

Method arguments:

  1. objtype is a required argument. It corresponds to the type of system object which parameter values you want to set. 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, the range is limited by the identification numbers of objects of the specified type registered in the system.
  3. param is a required argument. It corresponds to the parameter of the system object. Possible values: String type, range is limited by the parameters available for the given object.
  4. value is a required argument. It corresponds to the value set to the param parameter of the system object. Possible values: String type, range depends on the set parameter.

Example. On Macro 1, check if cameras 1 to 4 are set to transmit color video. If a camera is set for black-and-white video transmission, switch it to the color mode (set the true ("1") value to the Color (“color”) parameter).

if (Event.SourceType == "MACRO" && Event.SourceId == "1" && Event.Action == "RUN")
{
 var i;
 for(i=1; i<=4; i=i+1)
 {
 if (GetObjectParam("CAM", i , "color") == "0")
 {
  SetObjectParam("CAM", i, "color", "1");
 }
 }
}

 

Note

If the object is active when the script is started (that is the settings panel of this object is open), then object parameters can not be changed by the SetObjectParam method. For example, if the settings panel for the Camera 1 object is open and the script above is started, the operation mode of Camera 1 will not be changed for the color one.