Bracketing universal - LUA Scripting - CHDK Forum

Bracketing universal

  • 0 Replies
  • 3841 Views
*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Bracketing universal
« on: 20 / December / 2008, 19:00:55 »
Advertisements
Here is a little bracketing script.  :)

It's not bad, but even not brilliant.  8) The script is older script. Today, you can write some functions better.

You can make ev and tv series. For control is a log function integrated.

A fix focus mode is also available. But this mode is not optimal working.

You can make more than one shoot pro bracketing value.


Code: (lua) [Select]
--[[
@title Bracketing universal
@param a Steps [x*1/3Ev][Tv]
@default a 3
@param b Count of diff. values
@default b 5
@param c start delay in [s]
@default c 1
@param d Count pro value
@default d 1
@param e fix Fokus [0=off][1=on]
@default e 1
@param f Mode      [0=Ev]  [1=Tv]
@default f 0
@param g Log [-1=off][x=file-nr.]
@default g 0
]]
 
function shooting()
press "shoot_half"
repeat
    until get_shooting() == true
if e == 1 then
if get_propset() == 2 then
set_prop(65,focus)
set_prop(245,focus)
else
set_prop(65,focus)
set_prop(66,focus)
end
end      
if f == 1 then     
if get_propset() == 2 then
set_prop(262,TV)
else
set_prop(69,TV)
end
else
set_ev(EV)
end
press "shoot_full"
release "shoot_full"
release "shoot_half"
  repeat
      until get_shooting() == true
repeat
      until get_shooting() == false
end
 
function multi_shooting(count)
  print("Focus:", get_focus())
  if count>1 then print("shoot 1 of",count) end
  shooting()
  if count>1 then
    for n=2,count do
      print("shoot",n,"of",count)
      shooting()
    end
  end
end

function print_Tv()
tv_output = {"64s","50s","40s","32s","25s","20s","15s","13s","10s","8s","6s",
"5s","4s","3.2s","2.5s","2s","1.6s","1.3s","1s","0.8s","0.6s","0.5s","0.4s",
"0.3s","1/4s","1/5s","1/6s","1/8s","1/10s","1/13s","1/15s","1/20s","1/25s",
"1/30s","1/40s","1/50s","1/60s","1/80s","1/100s","1/125s","1/160s","1/200s",
"1/250s","1/320s","1/400s","1/500s","1/640s","1/800s","1/1000s","1/1250s",
"1/1600s","1/2000s","1/2500s","1/3200s","1/4000s","1/5000s","1/6400s",
"1/8000s","1/10000s"}
print_tv = "Tv="..tv_output[tv+19]
end

function EV_hdr()
x=0
for s=1,b do
if x>0 then x=-1 else x=1 end
EV = Ev_is + (s/2*x) * a * 32
z=EV/32/3
if z<0 then zz=z*-1 else zz=z end
if x == -1 then
zzz = "-"..zz..","
else
zzz = zz..","
end
cls()
print("shoot",s,"of",b,"with",zzz..(EV*10/32/3-z*10)*x,"Ev")
    multi_shooting(d)
  end
end
 
function TV_hdr()
x=0
for s=1,b do
if x>0 then x=-1 else x=1 end
TV = Tv_is + (s/2*x) * a * 32
tv = TV / 32
cls()
print_Tv()
print("Shoot",s,"of",b,print_tv)
    multi_shooting(d)
  end
end

--start script
 
if a<1 then a=1 end
if b<3 then b=3 end
if c<0 then c=0 end
if d<1 then d=1 end
if e<0 or e>1 then e=0 end
if f<0 or f>1 then f=0 end
 
time01 = get_tick_count()

press("shoot_half")
repeat
  until get_shooting() == true
release("shoot_half")

Ev_is  = get_ev()
Tv_is  = get_tv96()
tv     = Tv_is / 32
focus  = get_focus()
flash  = get_flash_mode()
EV     = 0
TV = 0

if flash ~= 2 then
print("Flash off!")
sleep(3000)
exit_alt()
sleep(2000)
end

if c>0 then
  print("Wait",c,"second(s)")
  sleep(c*1000)
end

if g>-1 then print_screen(100+g) end
 
if f==0 then
  EV_hdr()
else
  TV_hdr()
end
 
set_ev(Ev_is)
set_tv96(Tv_is)
cls()
time02 = get_tick_count()
time03 = (time02 - time01)/1000
print(b*d,"shoots in",time03,"sec.")
print(os.date("at %d.%m.%y um %X"))
if g>-1 then print_screen(-10000) end

 :xmas
« Last Edit: 21 / December / 2008, 03:42:56 by msl »
CHDK-DE:  CHDK-DE links

 

Related Topics