--[[ @title Intervall universal @param a Intervall [s] @default a 10 @param b Anzahl [Bilder] @default b 5 @param c Disp.aus ab [Nr.][0=nicht] @default c 0 @param e Fokus [0=auto][1=fix] @default e 1 @param h Bildgröße [0,1,2,3,4,6,8] @default h 0 @param i Log [0=aus][x=Datei-Nr.] @default i 1 ]] function get_resolution() if get_propset() == 2 then size=get_prop(218) else size=get_prop(24) end end function set_resolution(set_size) if get_propset() == 2 then set_prop(218,set_size) else set_prop(24,set_size) end end function get_size_name() size_name = {"L","M1","M2","M3","S","","Postcard","","Wide"} name_size = size_name[h+1] end function fix_focus() press("shoot_half") repeat sleep(1) until get_shooting() == true release("shoot_half") repeat sleep(1) until get_shooting() ~= true set_aflock(1) end function Tv() tv = get_tv96()/32 tv_output = {"64","50","40","32","25","20","15","13","10","8","6", "5","4","3.2","2.5","2","1.6","1.3","1","0.8","0.6","0.5","0.4", "0.3","1/4","1/5","1/6","1/8","1/10","1/13","1/15","1/20","1/25", "1/30","1/40","1/50","1/60","1/80","1/100","1/125","1/160","1/200", "1/250","1/320","1/400","1/500","1/640","1/800","1/1000","1/1250", "1/1600","1/2000","1/2500","1/3200","1/4000","1/5000","1/6400", "1/8000","1/10000"} print_tv = tv_output[tv + 19] return print_tv end function log(...) io.write(...) io.write("\n") end --start script if a<2 then a=2 end if b<2 then b=2 end if c<0 then c=0 end if e<0 or e>1 then e=0 end if h<0 then h=0 end if h==5 then h=6 end if h==7 then h=8 end if h>8 then h=8 end wait = a num = b disp = c sd_card_01 = get_free_disk_space() get_resolution() if size ~= h then set_resolution(h) end z=0 t1=os.time() + wait print("akt. Zeit:",os.date("%X")) get_size_name() if e == 1 then fix_focus() end if i > 0 then file_name = "A/CHDK/LOGS/iv_"..i..".log" logfile=io.open(file_name,"wb") io.output(logfile) log("Aufnahmetag: ", os.date("%x"), "\tFormat: ", name_size, "\tAnzahl Bilder: ", num) log(" ") log("Bild-Nr.\tZeit\t\tDauer in ms\tAkku in mV\tFokus in mm\t\tTv in s") end repeat if disp > 0 and z >= disp then set_backlight(0) end wait_click(10) if is_pressed "shoot_half" then if i>=0 then log("\nBenutzer-Abbruch!!!") end z = num end if os.difftime(os.time(),t1)==0 then t1=os.time() + wait cls() z=z+1 print("Bild-Nr:",z,"von",num) print("akt. Zeit: ", os.date("%X")) t1_shoot = get_tick_count() shoot() t2_shoot = get_tick_count() timeout = t2_shoot - t1_shoot print("Auslösedauer:",timeout,"ms") if i > 0 then log(z, "\t\t", os.date("%X"), "\t", timeout, "\t\t", get_vbatt(), "\t\t", get_focus(), "\t\t\t", Tv()) end if timeout / 1000 >= wait then print("Intervallabstand zu klein") if i >= 0 then log("\nAbbruch - Intervallabstand zu klein.") end z = num end if z == num - 1 then set_backlight(1) end end until z == num sd_card_02 = get_free_disk_space() set_backlight(1) if e == 1 then set_aflock(0) end if size ~= h then set_resolution(size) end if i> 0 then log("\nverbrauchter Speicherplatz: ", (sd_card_01 - sd_card_02)/1024, " MB, noch frei: ", sd_card_02/1024, " MB von ", get_disk_size()/1024, " MB") logfile:close() end print("fertig") sleep(1000)