Versions Compared

Key

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

...

Example. When the button is clicked on the control panel, display the corresponding camera in on the active Monitor. The script must be triggered by a timer with ID=1.  

...

After each button click on the control panel, wait for two seconds until clicking another button. If there is no button click, then the camera with a dialed number must be displayed.

...

Example 5. Displaying a video camera with a stream of the selected type in the Video surveillance monitor

On macro command, display a video camera with a stream of the selected type or with the required stream ID on Monitor 2.

Code Block
if (Event.SourceType == "MACRO" && Event.SourceId == "1" && Event.Action == "RUN") //by stream type
{
    DoReactStr("MONITOR","2","REMOVE","cam<5>");
    DoReactStr("MONITOR","2","ADD_SHOW","cam<5>,stream_id<stream_client_flag>");
}
 
if (Event.SourceType == "MACRO" && Event.SourceId == "2" && Event.Action == "RUN") //by stream type
{
    DoReactStr("MONITOR","2","REMOVE","cam<5>");
    DoReactStr("MONITOR","2","ADD_SHOW","cam<5>,stream_id<stream_analytics_flag>");
}
  
if (Event.SourceType == "MACRO" && Event.SourceId == "3" && Event.Action == "RUN") //by stream type
{
    DoReactStr("MONITOR","2","REMOVE","cam<5>");
    DoReactStr("MONITOR","2","ADD_SHOW","cam<5>,stream_id<stream_archive_flag>");
}
 
if (Event.SourceType == "MACRO" && Event.SourceId == "4" && Event.Action == "RUN") //by stream type
{
    DoReactStr("MONITOR","2","REMOVE","cam<5>");
    DoReactStr("MONITOR","2","ADD_SHOW","cam<5>,stream_id<stream_alarm_flag>");
}
 
if (Event.SourceType == "MACRO" && Event.SourceId == "5" && Event.Action == "RUN") //by stream ID
{
    DoReactStr("MONITOR","2","REMOVE","cam<5>");
    DoReactStr("MONITOR","2","ADD_SHOW","cam<5>,stream_id<5.1>");
}

Example 6. Starting and stopping the layout scrolling in the Video surveillance monitor

On macro 1, enable layout scrolling on all servers in the Video surveillance monitor (Monitor 1). On macro 2, disable layout scrolling on all servers.

Code Block
languagebash
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","");
}