source: trunk/CHDK/SCRIPTS/TEST/MD_Tune.bas @ 3421

Revision 2576, 2.0 KB checked in by philmoz, 14 months ago (diff)

Rename function for controlling AF LED in MD test script.

Line 
1rem MD tuning - for use with MD AF assist LED tuning
2@title MD Tune
3
4@param a Columns
5@default a 6
6@range a 1 32
7@param b Rows
8@default b 4
9@range b 1 32
10@param c Threshold (0-255)
11@default c 10
12@range c 0 255
13@param d Compare Interval (ms)
14@default d 7
15@param h Pixel Step (pixels)
16@default h 6
17@param f Channel (U,Y,V,R,G,B)
18@default f 1
19@values f U Y V R G B
20@param n Timeout (10s of seconds)
21@default n 30
22@param e Trigger Delay (0.1 sec)
23@default e 5
24@param i Masking (0=No 1=Mask 2=Use)
25@default i 0
26@range i 0 2
27@param j -      Mask Columns Left
28@default j 0
29@range j 0 32
30@param k -      Mask Columns Right
31@default k 0
32@range k 0 32
33@param l -      Mask Rows    Top
34@default l 0
35@range l 0 32
36@param m -      Mask Rows    Bottom
37@default m 0
38@range m 0 32
39@param o Shoot enabled?
40@default o 0
41@range o 0 1
42@param v Grid?
43@default v 0
44@range v 0 3
45@param w AF on delay (x10ms)
46@default w 10
47@param z AF on time (x10ms)
48@default z 2
49
50if j>a then j=a
51if k>a then k=a
52if l>b then l=b
53if m>b then m=b
54if g<0 then g=0
55if f=0 then print "Channel: U chroma"
56if f=1 then print "Channel: Luminance"
57if f=2 then print "Channel: V chroma"
58if f=3 then print "Channel: Red"
59if f=4 then print "Channel: Green"
60if f=5 then print "Channel: Blue"
61if n<1 then n=1
62e=e*100
63g=g*1000
64n=n*10000
65
66rem turn on AF LED testing
67md_af_led_control w*10 z*10
68
69P=get_mode
70if P=1 then goto "PlayModeError"
71
72if o=0 then goto "test_md"
73
74print "MD test, shooting"
75N=0
76do
77  t=0
78  do
79    press "shoot_half"
80    do
81      P=get_shooting
82    until P=1
83    md_detect_motion a, b, f, n, d, c, v, t, i, j+1, l+1, a-k, b-m, 9, h, e
84  until t>0
85  release "shoot_full" 
86  do
87    P=get_shooting
88  until P<>1
89  N=N+1
90  print t, "cells, trigger ", N
91until 0
92
93:test_md
94print "MD test, no shooting."
95N=0
96do
97  t=0
98  do
99    md_detect_motion a, b, f, n, d, c, v, t, i, j+1, l+1, a-k, b-m, 0, h, e
100  until t>0
101  N=N+1
102  print t, "cells, trigger ", N
103until 0
104
105:PlayModeError
106  print "Not in REC mode, exiting."
107end
108
109:restore
110  rem turn off AF LED testing
111  md_af_led_control 0 0
112end
Note: See TracBrowser for help on using the repository browser.