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:
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.

...

Settings of the font, color and position of text is configured on the settings panel of the Captioner object.

Info
titleNote.

When page<BEGIN> and page<END> parameters are in use, the corresponding fields of the subtitles database are filled in – this enables data search using the Search by titles interface object.

Example 2. Visualisation of operating the People Counter detection in the Video Surveillance monitor

...

As a result the text message about number of entering and exiting people will be imposed on the video image while displaying the corresponding camera in the Video Surveillance monitor.

Info
titleNote.

When page<BEGIN> and page<END> parameters are in use, the corresponding fields of the subtitles database are filled in – this enables data search using the Search by titles interface object.

Settings of the font, color and position of text is configured on the settings panel of the Captioner object (see the Configuring captions display on a video image section of the Administrator’s Guide document).

...

Code Block
if (Event.SourceType=="TIMER" && Event.SourceId=="1" && Event.Action=="TRIGGER")
{
  mon="1";
  DebugLogString("on monitor "+ Itv_var("cam"));
  DoReactStr("MONITOR",mon,"ACTIVATE_CAM","cam<"+Itv_var("cam")+">");
  Itv_var("cam")="";
}
 
if (Event.GetParam("source_type")=="TELEMETRY" && Event.GetParam("action")=="GO_PRESET")
{
  DoReactStr("TIMER","1","START","bound<2>");
  var key=Event.GetParam("param4_val");
  DebugLogString("Key:"+key);
  Itv_var("cam")=Itv_var("cam")+key;
  DebugLogString(Itv_var("cam"));
}

 


Example 5. Sending command to camera using the camera HTTPAPI

...

Code Block
function DoPreset(preset)
{
    xmlhttp=new ActiveXObject("MSXML2.XMLHTTP");
    if(xmlhttp == null)
    {
           return;
    }
    xmlhttp.open("GET", "http://192.168.0.13/httpapi/SendPTZ?action=sendptz&PTZ_PRESETSET="+preset, false,"admin","1234");
 
    xmlhttp.send();
    DebugLogString(xmlhttp.status);
}
if (Event.SourceType == "MACRO" && Event.SourceId == "6" && Event.Action == "RUN") 
{
 DoPreset("85");
}
 
if (Event.SourceType == "MACRO" && Event.SourceId == "7" && Event.Action == "RUN") 
{
 DoPreset("86");
}

...


Example 6. Script for framing abandoned objects in live video

...