rem Susi2Stack von gehtnix 22.09.10
rem nur mit CHDK-DE ab Revision v305 verwenden
rem Näheres im PDF
@title Susi2Stack
@param i Blendenprüfung 0=aus/1=ein
@default i 0
@param f Fokus = 0 / Ende = 1
@default f 0
@param c Sleep-Time (x100)
@default c 5
@param y Taste Down=0/Left=1/S5=2/SX20=3
@default y 0
@param o Menüwartezeit x Sek
@default o 3
@param g Kl. Fokus-Distanz (mm)
@default g 10
rem Taste für den manuellen Weißabgleich
@param n WB auf Menü=0 Disp.=1
@default n 0
c=c*100
o=o*1000
q=0
if get_nd_present<>0 then goto "sprung2"
b=0
gosub "schalten"
:sprung2
l=0
D=get_orientation_sensor
Z=0
:neufok
press "shoot_half"
do
until get_shooting=1
A=get_min_stack_dist
E=A
if get_focus_ok=1 then goto "sprung1"
release "shoot_half"
cls
Z=Z+1
if q=0 then print "*** Fokus nicht OK ***" else print "Fokus nicht OK zum", Z; ". mal"
print "* Makro = Right"
print "* Normal = Down"
rem S5
if get_zoom_steps>50 then print "* Supermakro = Up"
print "* Neuer Fokus = Set"
if Z=5 then gosub "restore"
wait_click q
is_key k "right"
if k=1 then b=4
if k=1 then gosub "schalten"
if k=1 then l=1
is_key k "down"
if k=1 then b=0
if k=1 then gosub "schalten"
if k=1 then l=0
is_key k "up"
if get_zoom_steps>50 then
if k=1 then b=5
if k=1 then gosub "schalten"
if k=1 then l=1
endif
q=o
goto "neufok"
:sprung1
get_focus G
sleep 200
release "shoot_half"
b=1
if get_nd_present=0 then gosub "schalten"
:wait
cls
if GF then f=1
rem Fokusende
if f=0 then C=G*2 else C=G
set_focus E
sleep c*2
do
z=z+1
if i=0 then
shoot
get_focus G
get_dof H
else
press "shoot_half"
do
until get_shooting=1
get_focus G
get_dof H
press "shoot_full"
do
until get_shooting=1
release "shoot_full"
release "shoot_half"
do
until get_shooting=0
endif
cls
print "Bild = "z
print "Fokus = "G
print "DOF = "H
if H<1 then H=1
set_focus G+H
sleep c
if get_focus=G or get_focus>(G+H) then
set_focus G+(H*80/100)
sleep c
endif
until (G+H)>C or G>get_hyp_dist
:restore
cls
b=0
gosub "schalten"
if x=1 then gosub "Weissabgleich"
exit_alt
end
rem ---------------------- Subroutinen
:addcm
select E
case g to 99 ; E=E+10
case 100 to 199 ; E=E+20
case 200 to 499 ; E=E+50
case 500 to 5000 ; E=E+100
end_select
return
:subcm
select E
case g to 99 ; E=E-10
case 100 to 249 ; E=E-20
case 250 to 599 ; E=E-50
case 600 to 5000 ; E=E-100
end_select
if Eb
select y
case 0; click "down"
case 1; click "left"
case 2; click "macro"
case 3; gosub "SX20"
end_select
sleep c
wend
endif
return
:Weissabgleich
cls
sleep c
click "set"
sleep c*2
click "down"
sleep c*2
if get_nd_present<>0 then
click "down"
sleep c*2
endif
if x<>0 then goto "sprung5"
do
click "left"
sleep c
if get_propset=1 then until 7=get_prop 5 else until 7=get_prop 268
x=1
if n=0 then
click "menu"
else
click "display"
endif
sleep 1000
goto "sprung6"
:sprung5
do
click "right"
sleep c
if get_propset=1 then until 0=get_prop 5 else until 0=get_prop 268
x=0
:sprung6
click "up"
sleep c*2
if get_nd_present<>0 then
click "up"
sleep c*2
endif
click "set"
sleep c
return
:SX20
if get_focus_mode=1 and b=0 then
click "up"
else
if get_focus_mode=4 and b=0 then
click "left"
sleep 300
click "right"
sleep 300
click "set"
sleep 300
endif
else
if get_focus_mode=5 and b=0 then
click "left"
sleep 300
click "left"
sleep 300
click "set"
sleep 300
endif
endif
return