Go to documentation repository
Page History
...
Section | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
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","");
}
} |
Overview
Content Tools