17.2.5.3        Rotate Multiple Cameras

This script is designed to rotate the Cameras displayed in Video Display windows named a1 every 60 seconds. Pushbuttons set Toggle (VideoOff) to turn off the display of video and VideoHold to pause the rotation between cameras. Use Dynamic ->Video and name it a1.

 

proc switchvideo {arg1} {

   switch $arg1 \

     "1"       {SENDVDO a1=axiscam#ip=sprout.warwick.ac.uk&cgi=cgi-bin/mjpg/video.cgi} \

     "2"       { SENDVDO a1=mplayer#ip=67.94.27.130&port=8080} \

     "3"       { SENDVDO a1=atoplc#ip=67.94.27.161&port=0} \

     "4"       {SENDVDO a1=atoplc#ip=202.178.230.25&port=0} \

     "default" {SENDVDO "a1=videooff#msg=Press Rotate Cameras button to rotate thru cameras."}

}

 

if {[GETVAL toggle] > 0} then {

   SETVAL "toggle=0"

 

   if {[GETVAL videooff] == 0} then {

      SETVAL "videooff=1"

      SETVAL "countold=@count"

      SETVAL "pageold=@page"

      SENDVDO "a1=videooff#msg=Press 'Video On' button to show video."

   } else {

      SETVAL "videooff=0"

      SETVAL "count=@countold"

      SETVAL "page=@pageold"

      switchvideo [GETVAL page]

   }

}

 

if {[GETVAL videooff] == 0 && [GETVAL videohold] == 0} then {

   SETVAL "count=%PLUS 1"

 

   if {[GETVAL count] > 60} then {

      SETVAL "page=%LOOPPLUS 1"

      switchvideo [GETVAL page]

      SETVAL count=0

   }

}