Versions Compared

Key

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

...

Section


Column
width35%


Panel
borderColor#CCCCCC
bgColor#FFFFFF
titleBGColor#F0F0F0
borderStylesolid
titleOn the page:borderStylesolid
Table of Contents



Column
 


To illustrate available fields of application of scripts in Jscript see the following examples which can be used to create additional functions in the system on the basis of the Script object.

...

Code Block
if (Event.SourceType  == "FAILOVER" )
{
  if (Event.Action == "START") {action="DISABLE";}
  if (Event.Action == "STOP") {action="ENABLE";}
  id=Event.SourceId;
  msg=CreateMsg();
  msg.StringToMsg(GetObjectIds("FAILOVER"));
  var
  objCount=msg.GetParam("id.count");
    for (i=0;i<objCount;i++)
    {
     pid=msg.GetParam("id."+i);
  
     if (!(id==pid)) {
       DoReactStr("FAILOVER",pid,action,"");
     }
  } 
}

Example 8. Using the embedded visitors counter on Bosch FLEXIDOME IP dynamic 7000 VR IP camera

Upon reaching the number of visitors equal to 20 on the embedded visitors counter of the Bosch FLEXIDOME IP dynamic 7000 VR IP camera (with ID 1), call the macro 1.

Code Block
n=20;
if(Event.SourceType == "CAM_IP_DETECTOR" && Event.SourceId=="1" && Event.Action == "DETECTED")
{
 v=Event.GetParam("param0").split(";")[1];
 if (parseInt(v.split(":")[1])==n)
 {
     DoReactStr("MACRO","1","RUN","");
 } 
}