84
C H A P T E R 5
Scripting
The subroutine
display
asks the camera for the current display state. The
necessary clicks are performed only if it differs from the desired state. It
then sleeps for a while to let the camera adjust to the new settings. This is
done repeatedly until the desired result is reached.
:mode
r = get_prop 49
while r <> e
click "set"
sleep 1250
click "right"
sleep 1250
click "set"
sleep 1250
p = p + 1
r = get_prop 49
wend
return
The subroutine
mode
works in a similar way. The main difference is that it
has to perform a whole series of clicks to switch to the next mode (
FUNC/
SET
,
RIGHT
,
FUNC/SET
). It also counts the number of mode switches in
variable
p
. There are many
sleep
instructions in this subroutine. Switching
modes is quite hard work for the camera; in some cases lenses have to be
shifted, and so on. Depending on the camera, some tweaking may be nec-
essary for the necessary sleep intervals.
Because there is no direct
uBasic
command for obtaining the current
camera mode, we need to retrieve the mode in a different way. Here we
read out the value of
Property Case 49
(section 5.6) that reflects the current
camera mode. It should be mentioned that this part of the script runs only
under the
DryOS
operating system
( Digic III
and
Digic IV)
because property
IDs and mode values differ between
VxWorks
and
DryOS
. We will see later
that the script language
Lua
provides the necessary capabilities to write
platform-independent scripts.
:restor
click "set"
sleep 1250
for r = 1 to p
click "left"
next r
sleep 1250
click "set"
sleep 1250
return
Содержание Camera
Страница 1: ......
Страница 2: ...The Canon Camera Hackers Manual ...
Страница 3: ......
Страница 4: ...Berthold Daum The Canon Camera Hackers Manual Teach Your Camera New Tricks ...
Страница 19: ...10 CH APTER 2 Cameras and Operating Systems ...
Страница 25: ...16 CH APTER 3 ...
Страница 85: ...76 CH APTER 4 Teach Your Camera New Tricks ...
Страница 213: ...204 CH APTER 6 ...
Страница 253: ...244 AP PENDIX ...