Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

Method call syntaxSyntax for method invocation:

Code Block
languagejavascript
 StringToParams(String params function StringToParams(params: String)

Method arguments:

  1. params

...

  1. is a required argument.

...

  1. It specifies a variable of the String type

...

  1. that you want to convert into a list of parameters

...

  1. of the MsgObject object.

...

  1.  Possible values:

...

  1. variables of the String type that match the syntax

...

  1. of the MsgObject objects parameter list representation:

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

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

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

Code Block
languagejavascript
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); 
 }
}