Go to documentation repository
...
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.
...
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>");
} |
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 | ||
---|---|---|
| ||
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","");
} |