Format of events procedure for the Video capture device:
...
Code Block |
---|
DoReact("MONITOR","_id_","_command_"[,"_parameters_"]); |
Examples
Examples of using events and reactions of the Video capture device object:
...
Play record from camera 1 on the monitor 4 with the specified date and time when running the first macro.
Code Block |
---|
OnEvent("MACRO","1","RUN")
{
DoReact("MONITOR","4","ARCH_FRAME_TIME","cam<1>,date<"+date+">,time<11:00:00>");
DoReact("MONITOR","4","KEY_PRESSED","key<PLAY>");
} |
Switch to the mode of video archive viewing on the first camera of monitor 4 when printing the frame from the first camera and then go on 10 frames further starting from the specified date and time.
Code Block |
---|
OnEvent("CAM", "1", "PRINT")
{
DoReact("MONITOR","4","ARCH_FRAME_TIME","cam<1>,date<"+date+">,time <11:00:00>");
for(i=0;i<10;i=i+1)
{
DoReact ("MONITOR","4","KEY_PRESSED","key<FF>");
}
} |
Zoom in the video image on the monitor screen if camera is in the alarm state and reset it when alarm is finished.
Code Block |
---|
OnEvent("CAM","1","MD_START")
{
DoReact("MONITOR","1","KEY_PRESSED","key<ZOOM_IN>");
}
OnEvent("CAM", "1", "MD_STOP");
{
DoReact("MONITOR","1","KEY_PRESSED","key<ZOOM_OUT>");
} |
Display the layout number one on the monitor screen when running a macro.
Code Block |
---|
OnEvent("MACRO","1","RUN")
{
DoReact("MONITOR","1","KEY_PRESSED","key<SELECT_LAYOUT>,number<1>");
} |
- Command of starting the video export from Camera 1 in the Monitor 1, starting from 24-10-14 17:10:38 and to 24-10-14 17:10:80 to the c:\aaa.avi file.
Examples of export starting in three ways: using the IIDK (port 900 and 1030) and using script:- IIDK (port 900)
MONITOR|1|START_AVI_EXPORT|start<24-10-14 17:10:38>,finish<24-10-14 17:10:50>,avi_path<c:\aaa.avi>,cam<1> - IIDK (port 1030)
CORE||DO_REACT|source_type<MONITOR>,source_id<1>,action<START_AVI_EXPORT>,params<4>,param0_name<avi_path>,param0_val<c:\aaa.avi>,param1_name<cam>,param1_val<1>,param2_name<finish>,param2_val<24-10-14 17:10:50>,param3_name<start>,param3_val<24-10-14 17:10:38> Script (start on Macro 1)
Code Block |
---|
OnEvent("MACRO","1","RUN")
{
DoReact("CORE","","DO_REACT","source_type<MONITOR>,source_id<1>,action<START_AVI_EXPORT>,params<4>,param0_name<avi_path>,param0_val<c:\aaa.avi>,param1_name<cam>,param1_val<1>,param2_name<finish>,param2_val<24-10-14
17:10:50>,param3_name<start>,param3_val<24-10-14 17:10:38");
} |
When macro 1 is run, enable mouse PTZ control on Camera 4 at Monitor 10. Disable it on Macro 2.
Code Block |
---|
OnEvent("MACRO","1","RUN")
{
DoReact("MONITOR","10","CONTROL_TELEMETRY","cam<4>,on<1>");
}
OnEvent("MACRO","2","RUN")
{
DoReact("MONITOR","10","CONTROL_TELEMETRY","cam<4>,on<0>");
} |
- Display an active camera on an analog monitor.
Code Block |
---|
OnEvent ("MONITOR","1","ACTIVATE_CAM")
{
DoReact ("CAM",cam,"MUX1");
} |
- Display an alarmed camera in the one-fold mode.
Code Block |
---|
OnEvent ("CAM",N,"MD_START")
{
DoReact ("MONITOR","1","ACTIVATE_CAM","cam<"+N+">");
DoReact ("MONITOR","1","KEY_PRESSED","key<SCREEN.1>");
} |
- An alarm monitor that always displays a video from the last alarmed camera.
Code Block |
---|
OnInit()
{
counter=0;
}
OnEvent("CAM",T,"MD_START")
{
if(strequal(counter,"0"))
{
DoReact("MONITOR","2","REMOVE_ALL");
DoReact("MONITOR","2","ADD_SHOW","cam<"+T+">");
}
counter=str(counter+1);
}
OnEvent("CAM",M,"MD_STOP")
{
counter=str(counter-1);
if(strequal(counter,"0"))
{
DoReact("MONITOR","2","ADD_SHOW","cam<"+M+">");
}
}
|
- When macro 1 is run, enable layout scrolling on all servers in the Video surveillance monitor (Monitor 1). When macro 2 is run, disable layout scrolling on all servers.
Code Block |
---|
|
if(Event.SourceType == "MACRO" && Event.SourceId=="1" && Event.Action=="RUN")
{
DoReactStr("MONITOR", "1","START_PAGING_LAYOUTS","");
}
if (Event.SourceType == "MACRO" && Event.SourceId == "2" && Event.Action == "RUN")
{
DoReactStr("MONITOR", "1", "STOP_PAGING_LAYOUTS","");
} |