Programming Guide (JScript)



Yüklə 6,96 Mb.
Pdf görüntüsü
səhifə20/22
tarix07.11.2018
ölçüsü6,96 Mb.
#78683
1   ...   14   15   16   17   18   19   20   21   22

85
 DebugLogString(result); 
}
Example 4. Displaying camera on the monitor by clicking the button on the remote control
The following example is valid only for cameras in configuration of which there is PTZ control panel. When configuring Video surveillance monitor select the 
action with 
Go to preset 
1,2,3...,0 parameters for ten joystick buttons (see 
 section of 
).
Assigning commands to joystick buttons using the Monitor
Installing and configuring security system components guide
 
Example. When the button is clicked on the control panel, display corresponding camera in the active monitor. The script is to timer trigger with ID=1.  
After each button click on the control panel wait for 2 seconds until clicking another button. If there is no button click, then the camera with dialed number is to be displayed.
Note.
The 
 object is to be created and configured beforehand and the current year is to be set. Information on how to configure the Timer object can be found in 
Timer
Creating and 
 section of 
configuring the Timer object
 
Administrator's Guide


86
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
Example. Camera IP address is 192.168.0.13.
The command enables the camera wiper:
192.168.10.101/httpapi/SendPTZ?action=sendptz&PTZ_PRESETSET=85
The command disables the camera wiper:
192.168.10.101/httpapi/SendPTZ?action=sendptz&PTZ_PRESETSET=86
These commands are to be sent to camera using the Jscript script.
function DoPreset(preset)
{
    xmlhttp=new ActiveXObject("MSXML2.XMLHTTP");
    if(xmlhttp == null)
    {


87
           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
If the object tracking function is in use (see 
 section of 
), then detected objects will be framed in video when viewing the 
Creating and configuring the Timer object
Administrator's Guide
archive. To frame abandoned objects in live video use the script aimed to frame an abandoned object when receiving alarm from VMDA detection tool:
if (Event.SourceType=="CAM_VMDA_DETECTOR")
{
 cam=GetObjectParentId("CAM_VMDA_DETECTOR",Event.SourceId,"CAM");
 if (Event.Action=="ALARM")
 {
   var x1,x2,y1,y2;
   x1=Event.GetParam("x");
   x2=Event.GetParam("w");
   y1=Event.GetParam("y");
   y2=Event.GetParam("h");
   x2=parseInt(x1)+parseInt(x2);


88
   y2=parseInt(y1)+parseInt(y2);
   DoReactStr("MONITOR","","SET_MARKRECT","cam<"+cam+">,color<255>,id<"+cam+">,x1<"+x1+">,x2<"+x2+">,y1<"+y1+">,
y2<"+y2+">");
   DebugLogString("x1:"+x1+" x2:"+x2+" y1:"+y1+" y2:"+y2);
 }
 else
 {
   DoReactStr("MONITOR","","DEL_MARKRECT","cam<"+cam+">,id<"+cam+">");
 }
}
Example 7. Using START and STOP events for Failove
Objects from more than one main Server are not to be moved to the Backup Server. For this when moving objects from some main Server to the Backup Server all other 
 
Failover
objects are to be disabled on this Backup Server.
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    {
     pid=msg.GetParam("id."+i);
  
     if (!(id==pid)) {
       DoReactStr("FAILOVER",pid,action,"");
     }
  } 
}


89
1.  
2.  
3.  
1.  
2.  
3.  
1.  
2.  
3.  
4.  
5.  
6.  
Programming Guide (JScript). Conclusion
More detailed information on the Intellect software package is presented in the documents titled:
Installing and configuring security system components guide
;

 
Operator’s Guide
Administrator’s Guide.
If while operating the given software product you have faced difficulties and problems, you are welcome to contact us. However before addressing us, we kindly ask you to answer the 
following questions:
What is the problem?
When did the problem occurr and what had happened before it occurred?
Which conditions gave rise to the problem?
Remember, that the more detailed and precise information you give us, the faster our experts will resolve your problem.
We are striving to improve the quality of our products, and hence welcome any proposals and suggestions how to improve our software and documentation.
Please forward your suggestions to the following e-mail addresses: 
documentation@axxonsoft.com
Appendix 1. Description of the Editor-Debugger utility
The purpose of the Editor-Debugger utility
The 
 utility is designed for creating, debugging and editing scripts in the Intellect software package.
Editor-Debugger
The
 utility provides the following functionality:
 Editor-Debugger
Creating and editing scripts using the built-in text editor;
Debugging scripts using the built-in debugger window;
Filtering the information to be displayed in the debugger window;
Creating and using test events for debugging;
Saving scripts to the hard drive;
Opening scripts from the hard drive.
The interface of the Editor-Debugger utility
The Editor-Debugger window
The 
 window contains the main menu, the toolbar ( ), the object list ( ) and the viewing/editing panel ( ).
Editor-Debugger
1
2
3


Yüklə 6,96 Mb.

Dostları ilə paylaş:
1   ...   14   15   16   17   18   19   20   21   22




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə