I am working on cycling 3 cameras each for 10 minutes, during daylight hours. I am using Webcam32 on dial-up to serve the resulting pictures. I need some advice and guidance on the best and most efficient way to control the cameras. I have 2 setups that I am tring - both work, and I can't perceive any performance difference...but I want to make it as efficient as possible. Here are the two alternatives I have setup:
1) I built 3 events (one for each camera)that use the conditional triggers, detecting when the camera has been "on" for 10 minutes, and then turning it "off" and the next one "on" through the device actions. This results in each camera being "chained" to the next one. Seems to work well. It also uses a second conditional trigger that makes sure it only does so during daylight hours.
2) I built a VB script that performs the same functions using the "DeviceTime" and "isON" functions. This script is launched using an event that is triggered during daylight hours. Here's the script. Please critique!
Question: Which approach is best? (most reliable, efficient, etc.)
THANKS FOR ANY POINTERS!.....Jeff
here's the script for #2 above: (sorry, I can't get it to show the paragraph indenting - makes it tough to read)
sub main()
dim time_cycle
dim dt2
dim dt3
dim dt4
' set time_cycle to # of minutes of cycle time between cameras
time_cycle = 2
if (hs.isON("a2")) then
if (hs.DeviceTime("a2") > (time_cycle-1)) then
hs.speak "living room camera has been on allotted minutes"
hs.speak "switching to office camera"
hs.execX10 "a2","OFF"
hs.execX10 "a4","OFF"
hs.execX10 "a3","ON"
else
hs.speak "living room camera is on, but for less than allotted minutes"
end if
else
if (hs.isON("a3")) then
if (hs.DeviceTime("a3") > (time_cycle-1)) then
hs.speak "office camera has been on allotted minutes"
hs.speak "switching to family room camera"
hs.execX10 "a2","OFF"
hs.execX10 "a3","OFF"
hs.execX10 "a4","ON"
else
hs.speak "office camera is on, but for less than allotted minutes"
end if
else
if (hs.isON("a4")) then
if (hs.DeviceTime("a4") > (time_cycle-1)) then
hs.speak "family room camera has been on allotted minutes"
hs.speak "switching to living room camera"
hs.execX10 "a3","OFF"
hs.execX10 "a4","OFF"
hs.execX10 "a2","ON"
else
hs.speak "office camera is on, but for less than allotted minutes"
end if
else
' last sofar
hs.speak "all cameras are off, switching living room camera on"
hs.execX10 "a2","ON"
end if
end if
end if
end sub
1) I built 3 events (one for each camera)that use the conditional triggers, detecting when the camera has been "on" for 10 minutes, and then turning it "off" and the next one "on" through the device actions. This results in each camera being "chained" to the next one. Seems to work well. It also uses a second conditional trigger that makes sure it only does so during daylight hours.
2) I built a VB script that performs the same functions using the "DeviceTime" and "isON" functions. This script is launched using an event that is triggered during daylight hours. Here's the script. Please critique!
Question: Which approach is best? (most reliable, efficient, etc.)
THANKS FOR ANY POINTERS!.....Jeff
here's the script for #2 above: (sorry, I can't get it to show the paragraph indenting - makes it tough to read)
sub main()
dim time_cycle
dim dt2
dim dt3
dim dt4
' set time_cycle to # of minutes of cycle time between cameras
time_cycle = 2
if (hs.isON("a2")) then
if (hs.DeviceTime("a2") > (time_cycle-1)) then
hs.speak "living room camera has been on allotted minutes"
hs.speak "switching to office camera"
hs.execX10 "a2","OFF"
hs.execX10 "a4","OFF"
hs.execX10 "a3","ON"
else
hs.speak "living room camera is on, but for less than allotted minutes"
end if
else
if (hs.isON("a3")) then
if (hs.DeviceTime("a3") > (time_cycle-1)) then
hs.speak "office camera has been on allotted minutes"
hs.speak "switching to family room camera"
hs.execX10 "a2","OFF"
hs.execX10 "a3","OFF"
hs.execX10 "a4","ON"
else
hs.speak "office camera is on, but for less than allotted minutes"
end if
else
if (hs.isON("a4")) then
if (hs.DeviceTime("a4") > (time_cycle-1)) then
hs.speak "family room camera has been on allotted minutes"
hs.speak "switching to living room camera"
hs.execX10 "a3","OFF"
hs.execX10 "a4","OFF"
hs.execX10 "a2","ON"
else
hs.speak "office camera is on, but for less than allotted minutes"
end if
else
' last sofar
hs.speak "all cameras are off, switching living room camera on"
hs.execX10 "a2","ON"
end if
end if
end if
end sub