source: trunk/lib/ubasic/camera_functions.c @ 846

Revision 846, 8.5 KB checked in by reyalp, 3 years ago (diff)

fix ubasic test program

  • Property svn:eol-style set to native
Line 
1#ifdef UBASIC_TEST
2
3#include <stdio.h>
4
5static int tv=0, av=0, zoom=0, focus=0, iso=0, raw=0, raw_nr=0,autostart=0;
6int movie_status=0;
7int shot_histogram_enabled=0;
8int state_kbd_script_run=1;
9int zoom_points = 3;
10#define MODE_REC                0x0100
11
12void ubasic_camera_press(const char *s)
13{
14    printf("*** button press '%s' ***\n",s);
15}
16
17void ubasic_camera_release(const char *s)
18{
19    printf("*** button release '%s' ***\n",s);
20}
21
22void ubasic_camera_click(const char *s)
23{
24    printf("*** button click '%s' ***\n",s);
25}
26
27void ubasic_camera_sleep(int v)
28{
29    printf("*** sleep %d ***\n",v);
30}
31
32void ubasic_camera_shoot()
33{
34    printf("*** shoot ***\n");
35}
36
37void ubasic_camera_wait_click(int t)
38{
39    printf("*** wait_click %d ***\n", t);
40}
41
42int ubasic_camera_is_clicked(const char *s)
43{
44    printf("*** is_key '%s' ***\n", s);
45    return 1;
46}
47
48int shooting_get_tv()
49{
50    return tv;
51}
52
53void shooting_set_tv(int v)
54{
55    tv = v;
56    printf("*** set tv %d ***\n",v);
57}
58
59void shooting_set_tv_rel(int v)
60{
61    tv += v;
62    printf("*** set tv rel %d ***\n",v);
63}
64
65int shooting_get_av()
66{
67    return av;
68}
69
70void shooting_set_av(int v)
71{
72    av = v;
73    printf("*** set av %d ***\n",v);
74}
75
76void shooting_set_av_rel(int v)
77{
78    av += v;
79    printf("*** set av rel %d ***\n",v);
80}
81
82int shooting_get_zoom()
83{
84    return zoom;
85}
86
87void shooting_set_zoom(int v)
88{
89    zoom = v;
90    printf("*** set zoom %d ***\n",v);
91}
92
93void shooting_set_zoom_rel(int v)
94{
95    zoom += v;
96    printf("*** set zoom rel %d ***\n",v);
97}
98
99void shooting_set_zoom_speed(int v)
100{
101    printf("*** set zoom speed %d ***\n",v);
102}
103
104int shooting_get_focus()
105{
106    return focus;
107}
108
109void shooting_set_focus(int v)
110{
111    focus = v;
112    printf("*** set focus %d ***\n",v);
113}
114
115int shooting_get_iso()
116{
117    return iso;
118}
119
120void shooting_set_iso(int v)
121{
122    iso = v;
123    printf("*** set iso %d ***\n",v);
124}
125//ARM Begin
126int shooting_get_iso_real()
127{
128  return iso;
129}
130//ARM End
131void script_console_add_line(const char *str) {
132    printf(">>> %s\n", str);
133}
134
135void script_console_clear() {
136    printf("*** clear console ***\n");
137}
138int md_detect_motion(void)
139{
140    printf("*** md_detect_motion ***\n");
141        return 0;
142}
143int md_get_cell_diff(int column, int row)
144{
145    printf("*** md_get_sell_diff %d %d ***\n", column, row);
146        return 0;
147}
148int md_init_motion_detector()
149{
150    printf("*** md_init_motion_detector ***\n");
151        return 0;
152}
153void ubasic_camera_set_nr(to)
154{
155        raw_nr = to;
156    printf("*** set raw nr %d ***\n",raw_nr);
157};
158
159int ubasic_camera_get_nr(to)
160{
161    printf("*** get raw nr ***\n");
162        return raw_nr;
163};
164
165void ubasic_camera_set_raw(int mode)
166{
167        raw = mode;
168    printf("*** set raw %d ***\n",raw);
169}
170
171int ubasic_camera_get_raw()
172{
173        return raw;
174}
175void shooting_set_prop(int id, int v)
176{
177    printf("*** set prop %d %d ***\n",id, v);
178}
179int shooting_get_prop(int id)
180{
181        return 0;
182}
183long stat_get_vbatt()
184{
185        return 4085;
186}
187void ubasic_set_led(int led, int state, int bright)
188{
189    printf("*** set led %d %d %d ***\n",led, state, bright);
190}
191int shooting_get_day_seconds()
192{
193        return 0;
194}
195
196int shooting_get_tick_count()
197{
198        return 0;
199}
200int ubasic_camera_script_autostart()
201{
202        return 0;
203}
204void ubasic_camera_set_script_autostart(int state)
205{
206        autostart = state;
207    printf("*** set autostart %d ***\n",autostart);
208}
209int get_usb_power(int edge)
210{
211        return 0;
212}
213int GetTotalCardSpaceKb()
214{
215        return 0;
216}
217int GetFreeCardSpaceKb()
218{
219        return 0;
220}
221
222int GetJpgCount()
223{
224    printf("*** GetJpgCount ***\n");
225    return 0;
226}
227
228int GetRawCount()
229{
230    printf("*** GetRawCount ***\n");
231    return 0;
232}
233
234void exit_alt()
235{
236    printf("*** exit alt ***\n");
237
238}
239
240void shooting_set_user_tv_by_id(int v)
241{
242    printf("*** shooting_set_user_tv_by_id %d ***\n", v);
243}
244
245void shooting_set_user_tv_by_id_rel(int v)
246{
247    printf("*** shooting_set_user_tv_by_id_rel %d ***\n", v);
248}
249
250void shooting_set_sv96(short sv96, short is_now)
251{
252    printf("*** shooting_set_sv96 %d %d ***\n", sv96, is_now);
253}
254
255short shooting_get_av96()
256{
257    printf("*** shooting_get_av96 ***\n");
258    return 0;
259}
260
261short shooting_get_user_av96()
262{
263    printf("*** shooting_get_user_av96 ***\n");
264    return 0;
265}
266
267int shooting_get_user_av_id()
268{
269    printf("*** shooting_get_user_av_id ***\n");
270    return 0;
271}
272
273void shooting_set_av96(short v,short is_now)
274{
275    printf("*** shooting_set_av96 %d %d ***\n", v, is_now);
276}
277
278void shooting_set_av96_direct(short v, short is_now)
279{
280    printf("*** shooting_set_av96_direct %d %d ***\n", v, is_now);
281}
282
283void shooting_set_user_av96(short v)
284{
285    printf("*** shooting_set_user_av96 %d ***\n", v);
286}
287
288void shooting_set_user_av_by_id(int v)
289{
290    printf("*** shooting_set_user_av_by_id %d ***\n", v);
291}
292
293void shooting_set_user_av_by_id_rel(int v)
294{
295    printf("*** shooting_set_user_av_by_id_rel %d ***\n", v);
296}
297
298int shooting_get_subject_distance()
299{
300    printf("*** shooting_get_subject_distance ***\n");
301    return 1000;
302}
303
304int shooting_get_near_limit_of_acceptable_sharpness()
305{
306    printf("*** shooting_get_near_limit_of_acceptable_sharpness ***\n");
307    return 500;
308}
309
310int shooting_get_far_limit_of_acceptable_sharpness()
311{
312    printf("*** shooting_get_far_limit_of_acceptable_sharpness ***\n");
313    return 1500;
314}
315
316int shooting_get_depth_of_field()
317{
318    printf("*** shooting_get_depth_of_field ***\n");
319    return 1000;
320}
321
322int shooting_get_hyperfocal_distance()
323{
324    printf("*** shooting_get_hyperfocal_distance ***\n");
325    return 1000;
326}
327
328int mode_get()
329{
330    printf("*** mode_get ***\n");
331    return MODE_REC;
332}
333
334short shooting_get_focus_mode()
335{
336    printf("*** shooting_get_focus_mode ***\n");
337    return 0;
338}
339
340short shooting_get_iso_market()
341{
342    printf("*** shooting_get_iso_market ***\n");
343    return 100;
344}
345
346short shooting_get_bv96()
347{
348    printf("*** shooting_get_bv96 ***\n");
349    return 32;
350}
351
352short shooting_get_sv96()
353{
354    printf("*** shooting_get_sv96 ***\n");
355    return 32;
356}
357
358void shooting_set_iso_real(short iso, short is_now)
359{
360    printf("*** shooting_set_iso_real %d %d ***\n", iso, is_now);
361}
362
363int shooting_get_iso_mode()
364{
365    printf("*** shooting_get_iso_mode ***\n");
366    return 0;
367}
368
369void shooting_set_iso_mode(int v)
370{
371    printf("*** shooting_set_iso_mode %d ***\n", v);
372}
373
374void shooting_set_nd_filter_state(short v, short is_now)
375{
376    printf("*** shooting_set_nd_filter_state %d %d ***\n", v, is_now);
377}
378
379void camera_shutdown_in_a_second()
380{
381    printf("*** camera_shutdown_in_a_second ***\n");
382}
383
384short shooting_get_tv96()
385{
386    printf("*** shooting_get_tv96 ***\n");
387    return 0;
388}
389
390short shooting_get_user_tv96()
391{
392    printf("*** shooting_get_user_tv96 ***\n");
393    return 0;
394}
395
396int shooting_get_user_tv_id()
397{
398    printf("*** shooting_get_user_tv_id ***\n");
399    return 0;
400}
401
402void shooting_set_tv96(short v, short is_now)
403{
404    printf("*** shooting_set_tv96 %d %d ***\n", v, is_now);
405}
406
407void shooting_set_shutter_speed_ubasic(int t, short is_now)
408{
409    printf("*** shooting_set_shutter_speed_ubasic %d %d ***\n", t, is_now);
410}
411
412void shooting_set_tv96_direct(short v, short is_now)
413{
414    printf("*** shooting_set_tv96_direct %d %d ***\n", v, is_now);
415}
416
417void shooting_set_user_tv96(short v)
418{
419    printf("*** shooting_set_user_tv96 %d ***\n", v);
420}
421
422int get_exposure_counter(void)
423{
424    printf("*** get_exposure_counter ***\n");
425        return 123;
426}
427
428
429int ubasic_camera_is_pressed(const char *v)
430{
431    printf("*** ubasic_camera_is_pressed %s ***\n", v);
432        return 0;
433}
434
435
436int shot_histogram_get_range(int from, int to)
437{
438    printf("*** shot_histogram_get_range %d,%d ***\n", from,to);
439        return 100;
440}
441
442void script_print_screen_statement(int v)
443{
444    printf("*** script_print_screensatement %d ***\n", v);
445}
446
447int get_tick_count(void)
448{
449    printf("*** get_tick_count ***\n");
450        // what should it return ?
451        return 10;
452}
453
454short shooting_get_drive_mode()
455{
456    printf("*** shooting_get_drive_mode ***\n");
457        // what should it return ?
458        return 10;
459}
460
461int shot_histogram_isenabled()
462{
463    printf("*** shot_histogram_isenabled ***\n");
464        return shot_histogram_enabled;
465}
466
467int get_ccd_temp()
468{
469    printf("*** get_ccd_temp ***\n");
470        return 69;
471}
472int get_optical_temp()
473{
474    printf("*** get_optical_temp ***\n");
475        return 69;
476}
477
478int get_battery_temp()
479{
480    printf("*** get_battery_temp ***\n");
481        return 69;
482}
483
484void play_sound()
485{
486    printf("*** play_sound ***\n");
487}       
488
489void TurnOnBackLight()
490{
491    printf("*** TurOnBackLight ***\n");
492}
493
494void TurnOffBackLight()
495{
496    printf("*** TurnOffBackLight ***\n");
497}
498
499void DoAFLock()
500{
501    printf("*** DoAFLock ***\n");
502}
503
504void UnlockAF()
505{
506    printf("*** UnlockAF ***\n");
507}
508
509int shot_histogram_set(int x)
510{
511    printf("*** shot_histogram_set ***\n");
512        return 1;
513}
514
515void levent_set_record()
516{
517    printf("*** levent_set_record ***\n");
518}
519
520void levent_set_play()
521{
522    printf("*** levent_set_play ***\n");
523}
524
525
526#endif
Note: See TracBrowser for help on using the repository browser.