Hi,
I'm working on a time lapse script for the total solar eclipse 22nd July in China. The script consits of two separate loops with different settings for partial and total phases of the eclipse (so I can change the interval for totality and maybe alter bracketing settings). I switch between the loops by pressing the "set" key. The shoot-functions in the script are still bare-boned and I start to think about them after I get everything else working.
As a bonus I also log luminance values and temperatures to a file. At this time the script takes two different input parameters for the interval of the luminance + temp sampling in the two loops, and two more parameters that define how often a pic should be taken (e.g. every third sampling, take a picture).
I have a strange problem with the current code. The script starts with the first loop for the partial phase. When I press SET and change the loop, the interval doesn't change! Everything else does, for example the pic-taking step (totstep). But the totloop() still uses exactly the same interval as partloop(). Can anyone spot the problem?
--[[
@title Solar Eclipse lapse + lum-log.
@param a Part. sampl. intv. min
@param b Part. sampl. intv. sec
@default b 5
@param c Part. shoot step
@default c 2
@param d Tot. sampl. intv. min
@param e Tot. sampl. intv. sec
@default e 2
@param f Tot. shoot step
@default f 10
]]
partintv = a*60000+b*1000
partstep = c
totintv = d*60000+b*1000
totstep = f
start = get_tick_count()
x = 0
function partshoot()
shoot()
repeat
sleep(50)
until get_shooting() == false
end
function totshoot()
shoot()
repeat
sleep(50)
until get_shooting() == false
end
function partloop()
repeat
parttick = get_tick_count()
x = x+1
press("shoot_half")
sleep(1000)
print("part" .. x .. "," .. (get_tick_count()-start) .. "," .. get_bv96() .. "," .. get_temperature(0))
if (x%partstep==0) then
partshoot()
end
release("shoot_half")
wait_click(partintv - (get_tick_count()-parttick))
if is_pressed "set" then
print("switch to totality")
totloop()
end
until false
end
function totloop()
repeat
tottick = get_tick_count()
x = x+1
press("shoot_half")
sleep(1000)
print("tot" .. x .. "," .. (get_tick_count()-start) .. "," .. get_bv96() .. "," .. get_temperature(0))
if (x%totstep==0) then
totshoot()
end
release("shoot_half")
wait_click(totintv - (get_tick_count()-tottick))
if is_pressed "set" then
print("switch to partial")
partloop()
end
until false
end
partloop()
Furthermore, can anyone confirm this being a smart way to switch between loops? Would something like "exit this function and start running the other one" be better? How is it done?