Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page The StringToMsg method  The Clone method Next page


The StringToParams method converts a String variable into the list of parameters and overwrites the existing list of parameters of the MsgObject object.

Syntax for method invocation:

 function StringToParams(params: String)

Method arguments:

  1. params is a required argument. It specifies a variable of the String type that you want to convert into a list of parameters of the MsgObject object. Possible values: variables of the String type that match the syntax of the MsgObject objects parameter list representation:

“param1<value1>,param2<value2>…”, where

param1<value1>,param2<value2> is a list of parameters with their values. Elements of the list are separated by commas without spaces. If no parameters need to be specified, an empty string is used after the vertical line (|), for example: “CAM|1|MD_START|”

Example. When registering an Attach event for any of the cameras, re-initiate the Attach event in the system with changed values of the Number of the PTZ device (telemetry_id) and Number of the microphone for synchronous recording (audio_id) parameters. The values must be equal to the corresponding camera numbers plus 1.

if (Event.SourceType == "CAM" && Event.Action == "ATTACH") 
 {
var i;
for (i=1,i<=4;i=i+1)
{
 var msg = Event.Clone(); 
 var str = "telemetry_id<" + (i+1) +">,audio_id<" + (i+1) + ">"; 
 msg.StringToParams(str); 
 NotifyEvent(msg); 
 }
}