1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 c-style: "K&R" -*- */
3 /*----------------------------------------------------------------------
5 gpiv - Graphic program for Particle Image Velocimetry, based on gtk/gnome
8 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
11 This file is part of gpiv.
13 Gpiv is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2, or (at your option)
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software Foundation,
25 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 ----------------------------------------------------------------------*/
30 * Data acquisition header interface
31 * $Log: dac_interface.c,v $
32 * Revision 1.6 2008-09-16 11:17:42 gerber
33 * Updated because of cvs conflict
35 * Revision 1.4 2005/03/01 14:43:46 gerber
36 * updated documentation
38 * Revision 1.3 2005/02/26 09:17:13 gerber
39 * structured of interrogate function by using gpiv_piv_isiadapt
41 * Revision 1.2 2005/02/12 13:09:22 gerber
42 * Changing some structure and constant names for DAC
44 * Revision 1.1 2005/01/19 15:53:41 gerber
45 * Initiation of Data Acquisition (DAC); trigerring of lasers and camera
46 * by using RTAI and Realtime Linux, recording images from IEEE1394
47 * (Firewire) IIDC compliant camera's
56 #include "dac_interface.h"
74 create_camera_menu(GnomeApp
*main_window
,
77 /*-----------------------------------------------------------------------------
78 * From coriander: build_menus.c BuildCameraMenu
82 char tmp
[GPIV_MAX_CHARS
];
85 * remove previous menu
87 if (cam
->camera_select
!= NULL
) {
88 gtk_widget_destroy(GTK_WIDGET (cam
->camera_select
));
91 cam
->camera_select
= gtk_option_menu_new ();
92 gtk_widget_ref (cam
->camera_select
);
93 gtk_object_set_data_full (GTK_OBJECT (main_window
),
96 (GtkDestroyNotify
) gtk_widget_unref
);
97 gtk_widget_show (cam
->camera_select
);
98 gtk_container_add(GTK_CONTAINER (cam
->vbox_cam
),
101 if (cam_var
->numCameras
>= 1) {
102 gtk_widget_set_sensitive (cam
->camera_select
, TRUE
);
104 gtk_widget_set_sensitive (cam
->camera_select
, FALSE
);
109 cam
->camera_select_menu
= gtk_menu_new ();
110 if (cam_var
->numCameras
> 0) {
111 for (i
= 0; i
< cam_var
->numCameras
; i
++) {
115 cam_var
->camera
[i
].id
,
116 cam_var
->camera
[i
].vendor
,
117 cam_var
->camera
[i
].model
);
118 cam
->menu_item
= gtk_menu_item_new_with_label (_(tmp
));
119 gtk_widget_show (cam
->menu_item
);
120 gtk_menu_append (GTK_MENU (cam
->camera_select_menu
),
122 gtk_option_menu_set_menu (GTK_OPTION_MENU (cam
->camera_select
),
123 cam
->camera_select_menu
);
124 g_signal_connect (GTK_OBJECT (cam
->menu_item
),
126 GTK_SIGNAL_FUNC (on_menu_camera_select
),
129 * BUGFIX apply last camera to img_par.source
131 g_snprintf(gl_image_par
->source
, GPIV_MAX_CHARS
, "%s %s",
132 cam_var
->camera
[i
].vendor
,
133 cam_var
->camera
[i
].model
);
134 gl_image_par
->source__set
= TRUE
;
140 cam
->menu_item
= gtk_menu_item_new_with_label (_(tmp
));
141 gtk_widget_show (cam
->menu_item
);
142 gtk_menu_append (GTK_MENU (cam
->camera_select_menu
),
144 gtk_option_menu_set_menu (GTK_OPTION_MENU (cam
->camera_select
),
145 cam
->camera_select_menu
);
147 g_snprintf(gl_image_par
->source
, GPIV_MAX_CHARS
, "No camera");
148 gl_image_par
->source__set
= TRUE
;
153 /* gtk_option_menu_set_menu (GTK_OPTION_MENU (cam->camera_select), */
154 /* cam->camera_select_menu); */
157 * sets the active menu item:
159 gtk_option_menu_set_history (GTK_OPTION_MENU (cam
->camera_select
) ,
167 create_format_menu(GnomeApp
*main_window
,
171 /*-----------------------------------------------------------------------------
172 * From coriander: build_menus.c BuildCameraMenu
176 char tmp
[GPIV_MAX_CHARS
];
177 quadlet_t modes
, formats
;
179 if (cam_var
->numCameras
> 0) {
180 dc1394_query_supported_formats(cam_var
->camera
[0].handle
,
181 cam_var
->camera
[0].id
,
183 dc1394_query_supported_modes(cam_var
->camera
[0].handle
,
184 cam_var
->camera
[0].id
,
185 FORMAT_VGA_NONCOMPRESSED
,
189 * remove previous menu
191 if (cam
->format_menu
!= NULL
) {
192 gtk_widget_destroy(GTK_WIDGET (cam
->format_menu
));
195 cam
->format_menu
= gtk_option_menu_new ();
196 gtk_widget_ref (cam
->format_menu
);
197 gtk_object_set_data_full (GTK_OBJECT (main_window
),
200 (GtkDestroyNotify
) gtk_widget_unref
);
201 gtk_widget_show (cam
->format_menu
);
202 gtk_container_add(GTK_CONTAINER (cam
->vbox_cam
),
206 cam
->format_menu_menu
= gtk_menu_new ();
207 if (cam_var
->numCameras
> 0) {
211 if (formats
& (0x1 << 31)) {
212 for (i
= 0; i
< NUM_FORMAT0_MODES
; i
++) {
213 if ( modes
& (0x1 << (31-i
))) {
218 cam
->menu_item
= gtk_menu_item_new_with_label (_(tmp
));
219 gtk_widget_show (cam
->menu_item
);
220 gtk_menu_append (GTK_MENU (cam
->format_menu_menu
),
222 gtk_option_menu_set_menu (GTK_OPTION_MENU (cam
->format_menu
),
223 cam
->format_menu_menu
);
225 gtk_widget_set_sensitive(cam
->menu_item
,
226 modes
& (0x1 << (31-i
)) );
229 gtk_object_set_data(GTK_OBJECT (cam
->menu_item
),
232 g_signal_connect (GTK_OBJECT (cam
->menu_item
),
234 GTK_SIGNAL_FUNC (on_menu_format
),
235 (int*)(i
+ MODE_FORMAT0_MIN
));
244 if (formats
& (0x1 << 30)) {
245 for (i
= 0; i
< NUM_FORMAT1_MODES
; i
++) {
246 if ( modes
& (0x1 << (30-i
))) {
251 cam
->menu_item
= gtk_menu_item_new_with_label (_(tmp
));
252 gtk_widget_show (cam
->menu_item
);
253 gtk_menu_append (GTK_MENU (cam
->format_menu_menu
),
255 gtk_option_menu_set_menu (GTK_OPTION_MENU (cam
->format_menu
),
256 cam
->format_menu_menu
);
258 gtk_widget_set_sensitive(cam
->menu_item
,
259 modes
& (0x1 << (30-i
)) );
260 g_signal_connect (GTK_OBJECT (cam
->menu_item
),
262 GTK_SIGNAL_FUNC (on_menu_format
),
263 (int*)(i
+ MODE_FORMAT1_MIN
));
273 if (formats
& (0x1 << 29)) {
274 for (i
= 0; i
< NUM_FORMAT2_MODES
; i
++) {
275 if ( modes
& (0x1 << (29-i
))) {
280 cam
->menu_item
= gtk_menu_item_new_with_label (_(tmp
));
281 gtk_widget_show (cam
->menu_item
);
282 gtk_menu_append (GTK_MENU (cam
->format_menu_menu
),
284 gtk_option_menu_set_menu (GTK_OPTION_MENU (cam
->format_menu
),
285 cam
->format_menu_menu
);
287 gtk_widget_set_sensitive(cam
->menu_item
,
288 modes
& (0x1 << (29-i
)) );
290 g_signal_connect (GTK_OBJECT (cam
->menu_item
),
292 GTK_SIGNAL_FUNC (on_menu_format
),
293 (int*)(i
+ MODE_FORMAT2_MIN
));
302 if (formats
& (0x1 << 25)) {
303 for (i
= 0; i
< NUM_FORMAT6_MODES
; i
++) {
304 if ( modes
& (0x1 << (25-i
))) {
309 cam
->menu_item
= gtk_menu_item_new_with_label (_(tmp
));
310 gtk_widget_show (cam
->menu_item
);
311 gtk_menu_append (GTK_MENU (cam
->format_menu_menu
),
313 gtk_option_menu_set_menu (GTK_OPTION_MENU (cam
->format_menu
),
314 cam
->format_menu_menu
);
316 gtk_widget_set_sensitive(cam
->menu_item
,
317 modes
& (0x1 << (25-i
)) );
319 g_signal_connect (GTK_OBJECT (cam
->menu_item
),
321 GTK_SIGNAL_FUNC (on_menu_format
),
322 (int*)(i
+ MODE_FORMAT6_MIN
));
332 cam
->menu_item
= gtk_menu_item_new_with_label (_(tmp
));
333 gtk_widget_show (cam
->menu_item
);
334 gtk_menu_append (GTK_MENU (cam
->format_menu_menu
),
336 gtk_option_menu_set_menu (GTK_OPTION_MENU (cam
->format_menu
),
337 cam
->format_menu_menu
);
342 /* gtk_option_menu_set_menu (GTK_OPTION_MENU (cam->format_menu), */
343 /* cam->format_menu_menu); */
346 * sets the active menu item:
348 gtk_option_menu_set_history (GTK_OPTION_MENU (cam
->format_menu
) ,
358 create_fps_menu(GnomeApp
*main_window
,
361 /*-----------------------------------------------------------------------------
362 * From coriander: build_menus.c BuildCameraMenu
365 dc1394bool_t cont
=DC1394_TRUE
;
366 gint new_framerate
= 0;
367 gint index
[NUM_FRAMERATES
];
369 gint i
, f
, k
= 0, err
;
370 gchar tmp
[GPIV_MAX_CHARS
];
373 if (cam_var
->numCameras
> 0) {
374 if (cam_var
->misc_info
[0].format
== FORMAT_SCALABLE_IMAGE_SIZE
) {
375 value
= 0; /* format 7 has no fixed framerates */
377 err
=dc1394_query_supported_framerates(cam_var
->camera
[0].handle
,
378 cam_var
->camera
[0].id
,
379 cam_var
->misc_info
[0].format
,
380 cam_var
->misc_info
[0].mode
,
382 if (!err
) g_warning("Could not query supported framerates");
388 * remove previous menu
390 if (cam
->fps_menu
!= NULL
) {
391 gtk_widget_destroy(GTK_WIDGET (cam
->fps_menu
));
394 cam
->fps_menu
= gtk_option_menu_new ();
395 gtk_widget_ref (cam
->fps_menu
);
396 gtk_object_set_data_full (GTK_OBJECT (main_window
),
399 (GtkDestroyNotify
) gtk_widget_unref
);
400 gtk_widget_show (cam
->fps_menu
);
401 gtk_container_add(GTK_CONTAINER (cam
->vbox_cam
),
405 cam
->fps_menu_menu
= gtk_menu_new ();
406 if (cam_var
->numCameras
> 0) {
408 for (f
=FRAMERATE_MIN
, i
=0; f
<= FRAMERATE_MAX
; i
++, f
++) {
410 * 31 to 31-num_framerates
412 if (value
& (0x1 << (31-i
) ) ) {
415 cam
->menu_item
= gtk_menu_item_new_with_label (_(fps_label_list
[i
]));
416 gtk_widget_show (cam
->menu_item
);
417 gtk_menu_append (GTK_MENU (cam
->fps_menu_menu
),
420 /* gtk_object_set_data(GTK_OBJECT (cam->menu_item), */
423 g_signal_connect (GTK_OBJECT (cam
->menu_item
),
425 GTK_SIGNAL_FUNC (on_menu_fps
),
426 /* (int*)(i + MODE_FPS0_MIN)); */
430 index
[i
] = -1; // framerate not supported
432 gtk_option_menu_set_menu (GTK_OPTION_MENU (cam
->fps_menu
),
435 if (index
[cam_var
->misc_info
[0].framerate
-FRAMERATE_MIN
] < 0 ) {
436 // previously selected framerate unsupported!!
437 // automatically switch to nearest fps available
438 for (i
= 1; i
<= ((NUM_FRAMERATES
>>1) +1); i
++) {
439 // search radius is num_framerates/2 +1 for safe rounding
440 if (((cam_var
->misc_info
[0].framerate
-FRAMERATE_MIN
-i
)>=0) && cont
) {
441 if (index
[cam_var
->misc_info
[0].framerate
- FRAMERATE_MIN
-i
]
444 new_framerate
=cam_var
->misc_info
[0].framerate
- i
;
448 if (((cam_var
->misc_info
[0].framerate
- FRAMERATE_MIN
+ i
)
451 if (index
[cam_var
->misc_info
[0].framerate
- FRAMERATE_MIN
+ i
]
454 new_framerate
=cam_var
->misc_info
[0].framerate
+ i
;
459 snprintf(tmp
, GPIV_MAX_CHARS
,
460 "create_fps_menu: Invalid framerate. Updating to nearest: %s\n",
461 fps_label_list
[new_framerate
-FRAMERATE_MIN
]);
463 err
= dc1394_set_video_framerate(cam_var
->camera
[0].handle
,
464 cam_var
->camera
[0].id
,
467 warning_gpiv("create_fps_menu: Cannot set video framerate");
468 cam_var
->misc_info
[0].framerate
= new_framerate
;
470 gtk_option_menu_set_history (GTK_OPTION_MENU (cam
->fps_menu
),
471 index
[cam_var
->misc_info
[0].framerate
-
482 create_trigger_mode(GnomeApp
*main_window
,
485 /*-----------------------------------------------------------------------------
486 * From coriander: build_menus.c BuildCameraMenu
489 gint err
, i
, f
, modes
= 0;
492 gint index
[NUM_TRIGGER_MODE
];
495 if (cam_var
->numCameras
> 0) {
496 err
= dc1394_query_feature_characteristics(cam_var
->camera
[0].handle
,
497 cam_var
->camera
[0].id
,
500 if (!err
) g_warning("Could not query trigger feature characteristics");
501 modes
= ( (value
& (0xF << 12))>>12 );
507 * remove previous menu
509 if (cam
->trigger_mode
!= NULL
) {
510 gtk_widget_destroy(GTK_WIDGET (cam
->trigger_mode
));
513 cam
->trigger_mode
= gtk_option_menu_new ();
514 gtk_widget_ref (cam
->trigger_mode
);
515 gtk_object_set_data_full (GTK_OBJECT (main_window
),
518 (GtkDestroyNotify
) gtk_widget_unref
);
519 gtk_widget_show (cam
->trigger_mode
);
520 gtk_container_add(GTK_CONTAINER (cam
->vbox_cam
),
524 cam
->trigger_mode_menu
= gtk_menu_new ();
525 if (cam_var
->numCameras
> 0) {
528 * at least one mode present
529 * external trigger available:
531 for (f
= TRIGGER_MODE_MIN
, i
= 0; f
<= TRIGGER_MODE_MAX
; i
++, f
++) {
532 if (modes
& (0x1<<(TRIGGER_MODE_MAX
-f
))) {
536 gtk_menu_item_new_with_label (_(trigger_mode_desc
[i
]));
537 gtk_widget_show (cam
->menu_item
);
538 gtk_menu_append (GTK_MENU (cam
->trigger_mode_menu
),
540 g_signal_connect (GTK_OBJECT (cam
->menu_item
),
542 GTK_SIGNAL_FUNC (on_trigger_mode_activate
),
549 gtk_option_menu_set_menu (GTK_OPTION_MENU (cam
->trigger_mode
),
550 cam
->trigger_mode_menu
);
552 * sets the active menu item:
554 gtk_option_menu_set_history (GTK_OPTION_MENU (cam
->trigger_mode
),
555 index
[cam_var
->feature_set
[0].feature
556 [FEATURE_TRIGGER
- FEATURE_MIN
]
565 create_camera_feature_menu_scale(GnomeApp
*main_window
,
572 GtkWidget
*option_menu
,
573 GtkWidget
*menu_item_option_man
,
574 GtkWidget
*menu_item_option_auto
,
575 GtkWidget
*menu_item_option_na
,
576 GtkObject
*adj_scale
,
579 /*-----------------------------------------------------------------------------
585 label
= gtk_label_new(_(description
));
586 gtk_widget_ref(label
);
587 gtk_object_set_data_full(GTK_OBJECT (main_window
),
590 (GtkDestroyNotify
) gtk_widget_unref
);
591 gtk_widget_show(label
);
595 if (cam_var
->numCameras
> 0
596 && cam_var
->feature_set
[0].feature
[FEATURE
- FEATURE_MIN
].
599 gtk_adjustment_new(0,
600 cam_var
->feature_set
[0].
601 feature
[FEATURE
- FEATURE_MIN
].min
,
602 cam_var
->feature_set
[0].
603 feature
[FEATURE
- FEATURE_MIN
].max
,
609 gtk_adjustment_new(0,
616 scale
= gtk_hscale_new (GTK_ADJUSTMENT
618 gtk_widget_ref (scale
);
619 gtk_object_set_data_full (GTK_OBJECT (main_window
),
622 (GtkDestroyNotify
) gtk_widget_unref
);
623 gtk_widget_show (scale
);
624 gtk_widget_set_sensitive (scale
,
626 gtk_scale_set_digits (GTK_SCALE (scale
),
629 if (cam_var
->numCameras
> 0) {
630 if (cam_var
->feature_set
[0].feature
[FEATURE
- FEATURE_MIN
].
632 gtk_adjustment_set_value(GTK_ADJUSTMENT (adj_scale
),
633 cam_var
->feature_set
[0].
634 feature
[FEATURE
- FEATURE_MIN
].value
);
637 if (cam_var
->feature_set
[0].feature
[FEATURE
- FEATURE_MIN
].
640 * set glider active and connect
642 gtk_widget_set_sensitive (scale
, TRUE
);
643 g_signal_connect (GTK_OBJECT (adj_scale
),
645 GTK_SIGNAL_FUNC (on_scale_changed
),
652 option
= gtk_option_menu_new ();
653 gtk_widget_ref (option
);
654 gtk_object_set_data_full (GTK_OBJECT (main_window
),
657 (GtkDestroyNotify
) gtk_widget_unref
);
658 gtk_widget_show (option
);
659 gtk_widget_set_sensitive (option
, FALSE
);
660 /* gtk_object_set_data(GTK_OBJECT (option), */
666 option_menu
= gtk_menu_new ();
667 if (cam_var
->numCameras
> 0) {
668 if (cam_var
->feature_set
[0].feature
[FEATURE
- FEATURE_MIN
].
673 gtk_widget_set_sensitive (option
,
675 menu_item_option_man
=
676 gtk_menu_item_new_with_label (_("Man"));
677 gtk_widget_show (menu_item_option_man
);
678 gtk_menu_append (GTK_MENU (option_menu
),
679 menu_item_option_man
);
680 gtk_object_set_data(GTK_OBJECT (menu_item_option_man
),
683 gtk_object_set_data(GTK_OBJECT (menu_item_option_man
),
686 g_signal_connect (GTK_OBJECT (menu_item_option_man
),
688 GTK_SIGNAL_FUNC (on_man_auto_menu
),
692 if (cam_var
->feature_set
[0].feature
[FEATURE
- FEATURE_MIN
].
697 gtk_widget_set_sensitive (option
, TRUE
);
698 menu_item_option_auto
= gtk_menu_item_new_with_label (_("Auto"));
699 gtk_widget_show (menu_item_option_auto
);
700 gtk_menu_append (GTK_MENU (option_menu
),
701 menu_item_option_auto
);
702 gtk_object_set_data(GTK_OBJECT (menu_item_option_auto
),
705 gtk_object_set_data(GTK_OBJECT (menu_item_option_auto
),
708 g_signal_connect (GTK_OBJECT (menu_item_option_auto
),
710 GTK_SIGNAL_FUNC (on_man_auto_menu
),
714 * add menu non avail.
716 if (!cam_var
->feature_set
[0].feature
[FEATURE
- FEATURE_MIN
].auto_capable
717 && !cam_var
->feature_set
[0].feature
[FEATURE
- FEATURE_MIN
].
720 gtk_widget_set_sensitive (option
,
722 menu_item_option_na
= gtk_menu_item_new_with_label (_("N/A"));
723 gtk_widget_show (menu_item_option_na
);
724 gtk_menu_append (GTK_MENU (option_menu
),
725 menu_item_option_na
);
728 gtk_option_menu_set_menu (GTK_OPTION_MENU (option
),
734 gtk_table_attach(GTK_TABLE(cam
->table_cam
),
740 (GtkAttachOptions
) 0,
741 (GtkAttachOptions
) 0,
747 gtk_table_attach(GTK_TABLE(cam
->table_cam
),
753 (GtkAttachOptions
) 0,
754 (GtkAttachOptions
) (0),
759 gtk_table_attach(GTK_TABLE(cam
->table_cam
),
765 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
766 (GtkAttachOptions
) (GTK_FILL
),
771 #endif /* ENABLE_CAM */
775 create_dac (GnomeApp
*main_window
,
778 /*-----------------------------------------------------------------------------
779 * Image Info window with data from header
782 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT (main_window
), "gpiv");
783 Dac
*dac
= g_new0 (Dac
, 1);
785 gchar
*fname_last_base
= NULL
;
788 /* #ifdef ENABLE_TRIG */
789 dac
->trig
= g_new0 (Trig
, 1);
793 dac
->cam
= g_new0 (Cam
, 1);
798 dac
->vbox_label
= gtk_vbox_new(FALSE
,
800 gtk_widget_ref(dac
->vbox_label
);
801 gtk_object_set_data_full(GTK_OBJECT (main_window
),
804 (GtkDestroyNotify
) gtk_widget_unref
);
805 gtk_widget_show(dac
->vbox_label
);
806 gtk_container_add(GTK_CONTAINER (container
),
810 /* Data Acquisition */
813 dac
->label_title
= gtk_label_new(_("Camera-laser trigger settings and image recording"));
815 dac
->label_title
= gtk_label_new(_("Camera settings and image recording"));
816 #endif /* ENABLE_TRIG */
817 #else /* ENABLE_CAM */
818 dac
->label_title
= gtk_label_new(_("Trigger settings"));
819 #endif /* ENABLE_CAM */
820 gtk_widget_ref(dac
->label_title
);
821 gtk_object_set_data_full(GTK_OBJECT (main_window
),
824 (GtkDestroyNotify
) gtk_widget_unref
);
825 gtk_widget_show(dac
->label_title
);
826 gtk_box_pack_start(GTK_BOX(dac
->vbox_label
),
837 dac
->vbox_scroll
= gtk_vbox_new(FALSE
,
839 gtk_widget_ref(dac
->vbox_scroll
);
840 gtk_object_set_data_full(GTK_OBJECT (main_window
),
843 (GtkDestroyNotify
) gtk_widget_unref
);
844 gtk_widget_show(dac
->vbox_scroll
);
845 gtk_box_pack_start(GTK_BOX(dac
->vbox_label
),
853 dac
->scrolledwindow
= gtk_scrolled_window_new(NULL
,
855 gtk_widget_ref(dac
->scrolledwindow
);
856 gtk_object_set_data_full(GTK_OBJECT (main_window
),
857 "dac_scrolledwindow",
859 (GtkDestroyNotify
) gtk_widget_unref
);
860 gtk_widget_show(dac
->scrolledwindow
);
861 gtk_box_pack_start(GTK_BOX(dac
->vbox_scroll
),
866 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
867 (dac
->scrolledwindow
),
869 GTK_POLICY_AUTOMATIC
);
873 dac
->viewport
= gtk_viewport_new(NULL
,
875 gtk_widget_ref(dac
->viewport
);
876 gtk_object_set_data_full(GTK_OBJECT (main_window
),
879 (GtkDestroyNotify
) gtk_widget_unref
);
880 gtk_widget_show(dac
->viewport
);
881 gtk_container_add(GTK_CONTAINER (dac
->scrolledwindow
),
885 * main table for dac tabulator
888 dac
->table
= gtk_table_new(3,
891 gtk_widget_ref(dac
->table
);
892 gtk_object_set_data_full(GTK_OBJECT (main_window
),
895 (GtkDestroyNotify
) gtk_widget_unref
);
896 gtk_widget_show(dac
->table
);
897 gtk_container_add(GTK_CONTAINER (dac
->viewport
),
902 * frame, table, mouse for file base name
904 dac
->frame_fname
= gtk_frame_new(_("File & buffer naming"));
905 gtk_widget_ref(dac
->frame_fname
);
906 gtk_object_set_data_full(GTK_OBJECT (main_window
),
909 (GtkDestroyNotify
) gtk_widget_unref
);
910 gtk_widget_show(dac
->frame_fname
);
911 gtk_table_attach(GTK_TABLE(dac
->table
),
917 (GtkAttachOptions
) (GTK_FILL
),
918 (GtkAttachOptions
) (0),
924 dac
->table_fname
= gtk_table_new(2,
927 gtk_widget_ref(dac
->table_fname
);
928 gtk_object_set_data_full(GTK_OBJECT (main_window
),
931 (GtkDestroyNotify
) gtk_widget_unref
);
932 gtk_widget_show(dac
->table_fname
);
933 gtk_container_add(GTK_CONTAINER (dac
->frame_fname
),
939 dac
->label_fname
= gtk_label_new(_("Base-name: "));
940 gtk_widget_ref(dac
->label_fname
);
941 gtk_object_set_data_full(GTK_OBJECT (main_window
),
944 (GtkDestroyNotify
) gtk_widget_unref
);
945 gtk_widget_show(dac
->label_fname
);
946 gtk_table_attach(GTK_TABLE(dac
->table_fname
),
952 (GtkAttachOptions
) (GTK_FILL
),
953 (GtkAttachOptions
) (0),
956 gtk_misc_set_padding(GTK_MISC(dac
->label_fname
),
961 dac
->combo_fname
= gtk_combo_new ();
962 gtk_widget_ref (dac
->combo_fname
);
963 gtk_object_set_data_full (GTK_OBJECT (main_window
),
966 (GtkDestroyNotify
) gtk_widget_unref
);
967 gtk_widget_show (dac
->combo_fname
);
968 gtk_table_attach(GTK_TABLE(dac
->table_fname
),
974 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
975 (GtkAttachOptions
) (0),
982 dac
->combo_fname_items
= NULL
;
983 /* dac->combo_fname_items = g_list_append (dac->combo_fname_items, */
984 /* (gpointer) dac_par.fname); */
986 for (i
= 0; i
< gpiv_var
->number_fnames_last
; i
++) {
987 fname_last_base
= g_strdup(g_basename(gpiv_var
->fn_last
[i
]));
988 strtok(fname_last_base
, ".");
989 dac
->combo_fname_items
= g_list_append (dac
->combo_fname_items
,
990 (gpointer
) g_basename
992 /* g_free(fname_last_base); */
994 gtk_combo_set_popdown_strings (GTK_COMBO (dac
->combo_fname
),
995 dac
->combo_fname_items
);
996 g_list_free (dac
->combo_fname_items
);
997 g_free(fname_last_base
);
1002 dac
->entry_fname
= GTK_COMBO (dac
->combo_fname
)->entry
;
1003 gtk_widget_ref (dac
->entry_fname
);
1004 gtk_object_set_data_full (GTK_OBJECT (main_window
),
1007 (GtkDestroyNotify
) gtk_widget_unref
);
1008 gtk_widget_show (dac
->entry_fname
);
1009 /* gtk_entry_set_text (GTK_ENTRY (dac->entry_fname), */
1010 /* (gpointer) dac_par.fname); */
1012 gtk_object_set_data(GTK_OBJECT (GTK_COMBO (dac
->combo_fname
)->entry
),
1015 g_signal_connect(GTK_OBJECT (GTK_COMBO (dac
->combo_fname
)->entry
),
1016 "activate" /* "changed" */,
1017 GTK_SIGNAL_FUNC (on_entry_dac_fname
),
1024 dac
->checkbutton_fname_date
=
1025 gtk_check_button_new_with_label(_("date"));
1026 gtk_widget_ref(dac
->checkbutton_fname_date
);
1027 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1028 "button_fname_date",
1029 dac
->checkbutton_fname_date
,
1030 (GtkDestroyNotify
) gtk_widget_unref
);
1031 gtk_widget_show(dac
->checkbutton_fname_date
);
1032 gtk_table_attach(GTK_TABLE(dac
->table_fname
),
1033 dac
->checkbutton_fname_date
,
1038 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
1039 (GtkAttachOptions
) (0),
1042 gtk_tooltips_set_tip(gpiv
->tooltips
,
1043 dac
->checkbutton_fname_date
,
1044 _("Extends the current date, obtained from the system, to the name."),
1047 gtk_object_set_data(GTK_OBJECT (dac
->checkbutton_fname_date
),
1050 g_signal_connect(GTK_OBJECT (dac
->checkbutton_fname_date
),
1052 GTK_SIGNAL_FUNC (on_checkbutton_fname_date_enter
),
1054 g_signal_connect(GTK_OBJECT (dac
->checkbutton_fname_date
),
1056 GTK_SIGNAL_FUNC (on_widget_leave
),
1058 g_signal_connect(GTK_OBJECT (dac
->checkbutton_fname_date
),
1060 GTK_SIGNAL_FUNC (on_checkbutton_fname_date
),
1062 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1063 (dac
->checkbutton_fname_date
),
1064 gpiv_var
->fname_date
);
1069 dac
->checkbutton_fname_time
=
1070 gtk_check_button_new_with_label(_("time"));
1071 gtk_widget_ref(dac
->checkbutton_fname_time
);
1072 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1073 "button_fname_time",
1074 dac
->checkbutton_fname_time
,
1075 (GtkDestroyNotify
) gtk_widget_unref
);
1076 gtk_widget_show(dac
->checkbutton_fname_time
);
1077 gtk_table_attach(GTK_TABLE(dac
->table_fname
),
1078 dac
->checkbutton_fname_time
,
1083 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
1084 (GtkAttachOptions
) (0),
1087 gtk_tooltips_set_tip(gpiv
->tooltips
,
1088 dac
->checkbutton_fname_time
,
1089 _("Extends the current time, obtained from the system, to the name."),
1092 gtk_object_set_data(GTK_OBJECT (dac
->checkbutton_fname_time
),
1095 g_signal_connect(GTK_OBJECT (dac
->checkbutton_fname_time
),
1097 GTK_SIGNAL_FUNC (on_checkbutton_fname_time_enter
),
1099 g_signal_connect(GTK_OBJECT (dac
->checkbutton_fname_time
),
1101 GTK_SIGNAL_FUNC (on_widget_leave
),
1103 g_signal_connect(GTK_OBJECT (dac
->checkbutton_fname_time
),
1105 GTK_SIGNAL_FUNC (on_checkbutton_fname_time
),
1107 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1108 (dac
->checkbutton_fname_time
),
1109 gpiv_var
->fname_time
);
1115 * frame, table, mouse selection and spinners for triggering"
1119 dac
->trig
->frame_trigger
= gtk_frame_new(_("Trigger and timing"));
1121 dac
->trig
->frame_trigger
= gtk_frame_new(_("Timing"));
1122 #endif /* ENABLE_TRIG */
1124 dac
->trig
->frame_trigger
= gtk_frame_new(_("Trigger"));
1125 #endif /* ENABLE_CAM */
1126 gtk_widget_ref(dac
->trig
->frame_trigger
);
1127 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1128 "dac_frame_trigger",
1129 dac
->trig
->frame_trigger
,
1130 (GtkDestroyNotify
) gtk_widget_unref
);
1131 gtk_widget_show(dac
->trig
->frame_trigger
);
1132 gtk_table_attach(GTK_TABLE(dac
->table
),
1133 dac
->trig
->frame_trigger
,
1138 (GtkAttachOptions
) (GTK_FILL
),
1139 (GtkAttachOptions
) (0),
1145 dac
->trig
->table_trigger
= gtk_table_new(6,
1148 gtk_widget_ref(dac
->trig
->table_trigger
);
1149 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1150 "dac_table_trigger",
1151 dac
->trig
->table_trigger
,
1152 (GtkDestroyNotify
) gtk_widget_unref
);
1153 gtk_widget_show(dac
->trig
->table_trigger
);
1154 gtk_container_add(GTK_CONTAINER (dac
->trig
->frame_trigger
),
1155 dac
->trig
->table_trigger
);
1160 dac
->trig
->vbox_trigger
= gtk_vbox_new(FALSE
,
1162 gtk_widget_ref(dac
->trig
->vbox_trigger
);
1163 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1165 dac
->trig
->vbox_trigger
,
1166 (GtkDestroyNotify
) gtk_widget_unref
);
1167 gtk_widget_show(dac
->trig
->vbox_trigger
);
1168 gtk_table_attach(GTK_TABLE(dac
->trig
->table_trigger
),
1169 dac
->trig
->vbox_trigger
,
1174 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
1175 (GtkAttachOptions
) 0,
1181 /* g_warning("::ttime.mode = %d", dac_par.ttime.mode); */
1182 dac
->trig
->radiobutton_mouse_1
=
1183 gtk_radio_button_new_with_label(dac
->trig
->mouse_trigger_group
,
1184 _("Indefinite periodic"));
1185 dac
->trig
->mouse_trigger_group
=
1186 gtk_radio_button_group(GTK_RADIO_BUTTON (dac
->trig
->radiobutton_mouse_1
));
1187 gtk_widget_ref(dac
->trig
->radiobutton_mouse_1
);
1188 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1189 "radiobutton_mouse_1",
1190 dac
->trig
->radiobutton_mouse_1
,
1191 (GtkDestroyNotify
) gtk_widget_unref
);
1192 gtk_widget_show(dac
->trig
->radiobutton_mouse_1
);
1193 gtk_box_pack_start(GTK_BOX(dac
->trig
->vbox_trigger
),
1194 dac
->trig
->radiobutton_mouse_1
,
1199 gtk_object_set_data(GTK_OBJECT (dac
->trig
->radiobutton_mouse_1
),
1202 gtk_object_set_data(GTK_OBJECT (dac
->trig
->radiobutton_mouse_1
),
1204 "1" /* GPIV_TIMER_MODE__PERIODIC */);
1205 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_1
),
1207 GTK_SIGNAL_FUNC (on_radiobutton_dac_mouse_1_enter
),
1209 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_1
),
1211 GTK_SIGNAL_FUNC (on_widget_leave
),
1213 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_1
),
1215 GTK_SIGNAL_FUNC (on_radiobutton_dac_mouse
),
1220 dac
->trig
->radiobutton_mouse_2
=
1221 gtk_radio_button_new_with_label(dac
->trig
->mouse_trigger_group
,
1223 dac
->trig
->mouse_trigger_group
=
1224 gtk_radio_button_group(GTK_RADIO_BUTTON (dac
->trig
->radiobutton_mouse_2
));
1225 gtk_widget_ref(dac
->trig
->radiobutton_mouse_2
);
1226 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1227 "radiobutton_mouse_2",
1228 dac
->trig
->radiobutton_mouse_2
,
1229 (GtkDestroyNotify
) gtk_widget_unref
);
1230 gtk_widget_show(dac
->trig
->radiobutton_mouse_2
);
1231 gtk_box_pack_start(GTK_BOX(dac
->trig
->vbox_trigger
),
1232 dac
->trig
->radiobutton_mouse_2
,
1237 gtk_object_set_data(GTK_OBJECT (dac
->trig
->radiobutton_mouse_2
),
1240 gtk_object_set_data(GTK_OBJECT (dac
->trig
->radiobutton_mouse_2
),
1242 "2" /* GPIV_TIMER_MODE__DURATION */);
1243 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_2
),
1245 GTK_SIGNAL_FUNC (on_radiobutton_dac_mouse_2_enter
),
1247 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_2
),
1249 GTK_SIGNAL_FUNC (on_widget_leave
),
1251 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_2
),
1253 GTK_SIGNAL_FUNC (on_radiobutton_dac_mouse
),
1259 dac
->trig
->radiobutton_mouse_3
=
1260 gtk_radio_button_new_with_label(dac
->trig
->mouse_trigger_group
,
1261 _("Interrupt one shot"));
1262 dac
->trig
->mouse_trigger_group
=
1263 gtk_radio_button_group(GTK_RADIO_BUTTON (dac
->trig
->radiobutton_mouse_3
));
1264 gtk_widget_ref(dac
->trig
->radiobutton_mouse_3
);
1265 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1266 "radiobutton_mouse_3",
1267 dac
->trig
->radiobutton_mouse_3
,
1268 (GtkDestroyNotify
) gtk_widget_unref
);
1269 gtk_widget_show(dac
->trig
->radiobutton_mouse_3
);
1270 gtk_box_pack_start(GTK_BOX(dac
->trig
->vbox_trigger
),
1271 dac
->trig
->radiobutton_mouse_3
,
1276 gtk_object_set_data(GTK_OBJECT (dac
->trig
->radiobutton_mouse_3
),
1279 gtk_object_set_data(GTK_OBJECT (dac
->trig
->radiobutton_mouse_3
),
1281 "3" /* GPIV_TIMER_MODE__ONE_SHOT_IRQ */);
1282 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_3
),
1284 GTK_SIGNAL_FUNC (on_radiobutton_dac_mouse_3_enter
),
1286 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_3
),
1288 GTK_SIGNAL_FUNC (on_widget_leave
),
1290 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_3
),
1292 GTK_SIGNAL_FUNC (on_radiobutton_dac_mouse
),
1297 dac
->trig
->radiobutton_mouse_4
=
1298 gtk_radio_button_new_with_label(dac
->trig
->mouse_trigger_group
,
1299 _("Interrupt periodic"));
1300 dac
->trig
->mouse_trigger_group
=
1301 gtk_radio_button_group(GTK_RADIO_BUTTON (dac
->trig
->radiobutton_mouse_4
));
1302 gtk_widget_ref(dac
->trig
->radiobutton_mouse_4
);
1303 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1304 "radiobutton_mouse_4",
1305 dac
->trig
->radiobutton_mouse_4
,
1306 (GtkDestroyNotify
) gtk_widget_unref
);
1307 gtk_widget_show(dac
->trig
->radiobutton_mouse_4
);
1308 gtk_box_pack_start(GTK_BOX(dac
->trig
->vbox_trigger
),
1309 dac
->trig
->radiobutton_mouse_4
,
1314 gtk_object_set_data(GTK_OBJECT (dac
->trig
->radiobutton_mouse_4
),
1317 gtk_object_set_data(GTK_OBJECT (dac
->trig
->radiobutton_mouse_4
),
1319 "4" /* GPIV_TIMER_MODE__TRIGGER_IRQ */);
1320 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_4
),
1322 GTK_SIGNAL_FUNC (on_radiobutton_dac_mouse_4_enter
),
1324 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_4
),
1326 GTK_SIGNAL_FUNC (on_widget_leave
),
1328 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_4
),
1330 GTK_SIGNAL_FUNC (on_radiobutton_dac_mouse
),
1335 dac
->trig
->radiobutton_mouse_5
=
1336 gtk_radio_button_new_with_label(dac
->trig
->mouse_trigger_group
,
1337 _("Incremented dt"));
1338 dac
->trig
->mouse_trigger_group
=
1339 gtk_radio_button_group(GTK_RADIO_BUTTON (dac
->trig
->radiobutton_mouse_5
));
1340 gtk_widget_ref(dac
->trig
->radiobutton_mouse_5
);
1341 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1342 "radiobutton_mouse_5",
1343 dac
->trig
->radiobutton_mouse_5
,
1344 (GtkDestroyNotify
) gtk_widget_unref
);
1345 gtk_widget_show(dac
->trig
->radiobutton_mouse_5
);
1346 gtk_box_pack_start(GTK_BOX(dac
->trig
->vbox_trigger
),
1347 dac
->trig
->radiobutton_mouse_5
,
1352 gtk_object_set_data(GTK_OBJECT (dac
->trig
->radiobutton_mouse_5
),
1355 gtk_object_set_data(GTK_OBJECT (dac
->trig
->radiobutton_mouse_5
),
1357 "5" /* GPIV_TIMER_MODE__INCREMENT */);
1358 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_5
),
1360 GTK_SIGNAL_FUNC (on_radiobutton_dac_mouse_5_enter
),
1362 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_5
),
1364 GTK_SIGNAL_FUNC (on_widget_leave
),
1366 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_5
),
1368 GTK_SIGNAL_FUNC (on_radiobutton_dac_mouse
),
1373 dac
->trig
->radiobutton_mouse_6
=
1374 gtk_radio_button_new_with_label(dac
->trig
->mouse_trigger_group
,
1375 _("double exposure"));
1376 dac
->trig
->mouse_trigger_group
=
1377 gtk_radio_button_group(GTK_RADIO_BUTTON (dac
->trig
->radiobutton_mouse_6
));
1378 gtk_widget_ref(dac
->trig
->radiobutton_mouse_6
);
1379 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1380 "radiobutton_mouse_6",
1381 dac
->trig
->radiobutton_mouse_6
,
1382 (GtkDestroyNotify
) gtk_widget_unref
);
1383 gtk_widget_show(dac
->trig
->radiobutton_mouse_6
);
1384 gtk_box_pack_start(GTK_BOX(dac
->trig
->vbox_trigger
),
1385 dac
->trig
->radiobutton_mouse_6
,
1390 gtk_object_set_data(GTK_OBJECT (dac
->trig
->radiobutton_mouse_6
),
1393 gtk_object_set_data(GTK_OBJECT (dac
->trig
->radiobutton_mouse_6
),
1395 "6" /* GPIV_TIMER_MODE__DOUBLE */);
1396 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_6
),
1398 GTK_SIGNAL_FUNC (on_radiobutton_dac_mouse_6_enter
),
1400 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_6
),
1402 GTK_SIGNAL_FUNC (on_widget_leave
),
1404 g_signal_connect(GTK_OBJECT (dac
->trig
->radiobutton_mouse_6
),
1406 GTK_SIGNAL_FUNC (on_radiobutton_dac_mouse
),
1412 * spinner for dt; separation time between two laser pulses
1414 dac
->trig
->label_trigger_dt
= gtk_label_new(_("dt (ms): "));
1415 gtk_widget_ref(dac
->trig
->label_trigger_dt
);
1416 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1417 "dac_label_trigger_dt",
1418 dac
->trig
->label_trigger_dt
,
1419 (GtkDestroyNotify
) gtk_widget_unref
);
1420 gtk_widget_show(dac
->trig
->label_trigger_dt
);
1421 gtk_table_attach(GTK_TABLE(dac
->trig
->table_trigger
),
1422 dac
->trig
->label_trigger_dt
,
1427 (GtkAttachOptions
) (GTK_FILL
),
1428 (GtkAttachOptions
) (0),
1434 dac
->trig
->spinbutton_adj_trigger_dt
=
1435 gtk_adjustment_new(trig_par
.ttime
.dt
* GPIV_NANO2MILI
,
1436 GPIV_TRIGPAR_TTIME_DT_MIN
,
1437 GPIV_TRIGPAR_TTIME_DT_MAX
,
1444 dac
->trig
->spinbutton_trigger_dt
=
1445 gtk_spin_button_new(GTK_ADJUSTMENT(dac
->trig
->spinbutton_adj_trigger_dt
),
1448 gtk_widget_ref(dac
->trig
->spinbutton_trigger_dt
);
1449 gtk_widget_show(dac
->trig
->spinbutton_trigger_dt
);
1450 gtk_table_attach(GTK_TABLE(dac
->trig
->table_trigger
),
1451 dac
->trig
->spinbutton_trigger_dt
,
1456 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
1457 (GtkAttachOptions
) (0),
1460 gtk_entry_set_editable(GTK_ENTRY(dac
->trig
->spinbutton_trigger_dt
),
1462 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON (dac
->trig
->spinbutton_trigger_dt
),
1464 g_signal_connect(GTK_OBJECT (dac
->trig
->spinbutton_trigger_dt
),
1466 G_CALLBACK (on_spinbutton_dac_trigger_dt
),
1467 dac
->trig
->spinbutton_trigger_dt
);
1472 * spinner for incdt; incremention of separation time between two laser pulses
1474 dac
->trig
->label_trigger_incrdt
= gtk_label_new(_("incr. dt (ms): "));
1475 gtk_widget_ref(dac
->trig
->label_trigger_incrdt
);
1476 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1477 "dac_label_trigger_incrdt",
1478 dac
->trig
->label_trigger_incrdt
,
1479 (GtkDestroyNotify
) gtk_widget_unref
);
1480 gtk_widget_show(dac
->trig
->label_trigger_incrdt
);
1481 gtk_table_attach(GTK_TABLE(dac
->trig
->table_trigger
),
1482 dac
->trig
->label_trigger_incrdt
,
1487 (GtkAttachOptions
) (GTK_FILL
),
1488 (GtkAttachOptions
) (0),
1494 dac
->trig
->spinbutton_adj_trigger_incrdt
=
1495 gtk_adjustment_new(trig_par
.ttime
.dt
* GPIV_NANO2MILI
,
1496 GPIV_TRIGPAR_TTIME_INCR_DT_MIN
,
1497 GPIV_TRIGPAR_TTIME_INCR_DT_MAX
,
1504 dac
->trig
->spinbutton_trigger_incrdt
=
1505 gtk_spin_button_new(GTK_ADJUSTMENT(dac
->trig
->spinbutton_adj_trigger_incrdt
),
1508 gtk_widget_ref(dac
->trig
->spinbutton_trigger_incrdt
);
1509 gtk_widget_show(dac
->trig
->spinbutton_trigger_incrdt
);
1510 gtk_table_attach(GTK_TABLE(dac
->trig
->table_trigger
),
1511 dac
->trig
->spinbutton_trigger_incrdt
,
1516 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
1517 (GtkAttachOptions
) (0),
1520 gtk_entry_set_editable(GTK_ENTRY(dac
->trig
->spinbutton_trigger_incrdt
),
1522 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON (dac
->trig
->spinbutton_trigger_incrdt
),
1524 g_signal_connect(GTK_OBJECT (dac
->trig
->spinbutton_trigger_incrdt
),
1526 G_CALLBACK (on_spinbutton_dac_trigger_incrdt
),
1527 dac
->trig
->spinbutton_trigger_incrdt
);
1532 * spinner for cap; camera acquisition period"
1534 dac
->trig
->label_trigger_cap
= gtk_label_new(_("period (ms): "));
1535 gtk_widget_ref(dac
->trig
->label_trigger_cap
);
1536 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1537 "dac_label_trigger_cap",
1538 dac
->trig
->label_trigger_cap
,
1539 (GtkDestroyNotify
) gtk_widget_unref
);
1540 gtk_widget_show(dac
->trig
->label_trigger_cap
);
1541 gtk_table_attach(GTK_TABLE(dac
->trig
->table_trigger
),
1542 dac
->trig
->label_trigger_cap
,
1547 (GtkAttachOptions
) (GTK_FILL
),
1548 (GtkAttachOptions
) (0),
1555 dac
->trig
->spinbutton_adj_trigger_cap
=
1556 gtk_adjustment_new(trig_par
.ttime
.cam_acq_period
* GPIV_NANO2MILI
,
1557 GPIV_TRIGPAR_TTIME_CAP_MIN
,
1558 GPIV_TRIGPAR_TTIME_CAP_MAX
,
1561 ADJ_IPAGE
/* ADJ_MAX */);
1563 dac
->trig
->spinbutton_trigger_cap
=
1564 gtk_spin_button_new(GTK_ADJUSTMENT(dac
->trig
->spinbutton_adj_trigger_cap
),
1567 gtk_widget_ref(dac
->trig
->spinbutton_trigger_cap
);
1568 gtk_widget_show(dac
->trig
->spinbutton_trigger_cap
);
1569 gtk_table_attach(GTK_TABLE(dac
->trig
->table_trigger
),
1570 dac
->trig
->spinbutton_trigger_cap
,
1575 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
1576 (GtkAttachOptions
) (0),
1579 gtk_entry_set_editable(GTK_ENTRY(dac
->trig
->spinbutton_trigger_cap
),
1581 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON (dac
->trig
->spinbutton_trigger_cap
),
1583 g_signal_connect(GTK_OBJECT (dac
->trig
->spinbutton_trigger_cap
),
1585 G_CALLBACK (on_spinbutton_dac_trigger_cap
),
1586 dac
->trig
->spinbutton_trigger_cap
);
1587 #endif /* ENABLE_TRIG */
1592 * spinner for nf; number of frames or cycles
1594 dac
->trig
->label_trigger_nf
= gtk_label_new(_("frames (N): "));
1595 gtk_widget_ref(dac
->trig
->label_trigger_nf
);
1596 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1597 "dac_label_trigger_nf",
1598 dac
->trig
->label_trigger_nf
,
1599 (GtkDestroyNotify
) gtk_widget_unref
);
1600 gtk_widget_show(dac
->trig
->label_trigger_nf
);
1601 gtk_table_attach(GTK_TABLE(dac
->trig
->table_trigger
),
1602 dac
->trig
->label_trigger_nf
,
1607 (GtkAttachOptions
) (GTK_FILL
),
1608 (GtkAttachOptions
) (0),
1616 dac
->trig
->spinbutton_adj_trigger_nf
=
1617 gtk_adjustment_new(gl_cam_par
->cycles
,
1618 GPIV_CAMPAR_CYCLES_MIN
,
1619 MAX_BUFS
, /* GPIV_CAMPAR_CYCLES_MAX */
1623 #else /* ENABLE_CAM */
1625 dac
->trig
->spinbutton_adj_trigger_nf
=
1626 gtk_adjustment_new(trig_par
.ttime
.cycles
,
1627 GPIV_TRIGPAR_TTIME_CYCLES_MIN
,
1628 MAX_BUFS
, /* GPIV_TRIGPAR_CYCLES_MAX */
1632 #endif /* ENABLE_TRIG */
1633 #endif /* ENABLE_CAM */
1634 dac
->trig
->spinbutton_trigger_nf
=
1635 gtk_spin_button_new(GTK_ADJUSTMENT(dac
->trig
->spinbutton_adj_trigger_nf
),
1638 gtk_widget_ref(dac
->trig
->spinbutton_trigger_nf
);
1639 gtk_widget_show(dac
->trig
->spinbutton_trigger_nf
);
1640 gtk_table_attach(GTK_TABLE(dac
->trig
->table_trigger
),
1641 dac
->trig
->spinbutton_trigger_nf
,
1646 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
1647 (GtkAttachOptions
) (0),
1650 gtk_entry_set_editable(GTK_ENTRY(dac
->trig
->spinbutton_trigger_nf
),
1652 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON (dac
->trig
->spinbutton_trigger_nf
),
1654 g_signal_connect(GTK_OBJECT (dac
->trig
->spinbutton_trigger_nf
),
1656 G_CALLBACK (on_spinbutton_dac_trigger_nf
),
1657 dac
->trig
->spinbutton_trigger_nf
);
1661 * Trigger starting button
1664 dac
->trig
->button_trigger_start
=
1665 gtk_button_new_with_label(_("start trigger"));
1666 gtk_widget_ref(dac
->trig
->button_trigger_start
);
1667 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1668 "button_trigger_start",
1669 dac
->trig
->button_trigger_start
,
1670 (GtkDestroyNotify
) gtk_widget_unref
);
1671 gtk_widget_show(dac
->trig
->button_trigger_start
);
1672 gtk_table_attach(GTK_TABLE(dac
->trig
->table_trigger
),
1673 dac
->trig
->button_trigger_start
,
1678 (GtkAttachOptions
) (GTK_FILL
),
1679 (GtkAttachOptions
) (GTK_FILL
),
1682 gtk_tooltips_set_tip(gpiv
->tooltips
,
1683 dac
->trig
->button_trigger_start
,
1684 _("Timings and settings will be written to the kernel module, which uses RealTimeLinux and RTAI and will be started.\n"
1685 "In case the parameters are not uplodaed here, it will"
1686 "be done automatically before images will be recorded,"
1687 "though without a warning message."),
1690 gtk_object_set_data(GTK_OBJECT (dac
->trig
->button_trigger_start
),
1693 g_signal_connect(GTK_OBJECT (dac
->trig
->button_trigger_start
),
1695 G_CALLBACK (on_button_dac_triggerstart_enter
),
1697 g_signal_connect(GTK_OBJECT (dac
->trig
->button_trigger_start
),
1699 G_CALLBACK (on_widget_leave
),
1701 g_signal_connect(GTK_OBJECT (dac
->trig
->button_trigger_start
),
1703 G_CALLBACK (on_button_dac_triggerstart
),
1708 * Trigger stop button
1710 dac
->trig
->button_trigger_stop
= gtk_button_new_with_label(_("stop trigger"));
1711 gtk_widget_ref(dac
->trig
->button_trigger_stop
);
1712 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1713 "button_trigger_stop",
1714 dac
->trig
->button_trigger_stop
,
1715 (GtkDestroyNotify
) gtk_widget_unref
);
1716 gtk_widget_show(dac
->trig
->button_trigger_stop
);
1717 gtk_table_attach(GTK_TABLE(dac
->trig
->table_trigger
),
1718 dac
->trig
->button_trigger_stop
,
1723 (GtkAttachOptions
) (GTK_FILL
),
1724 (GtkAttachOptions
) (GTK_FILL
),
1727 gtk_tooltips_set_tip(gpiv
->tooltips
,
1728 dac
->trig
->button_trigger_stop
,
1729 _("Timings and settings will stopped."),
1732 gtk_object_set_data(GTK_OBJECT (dac
->trig
->button_trigger_stop
),
1735 g_signal_connect(GTK_OBJECT (dac
->trig
->button_trigger_stop
),
1737 G_CALLBACK (on_button_dac_triggerstop_enter
),
1739 g_signal_connect(GTK_OBJECT (dac
->trig
->button_trigger_stop
),
1741 G_CALLBACK (on_widget_leave
),
1743 g_signal_connect(GTK_OBJECT (dac
->trig
->button_trigger_stop
),
1745 G_CALLBACK (on_button_dac_triggerstop
),
1747 #endif /* ENABLE_TRIG */
1751 * frame, table, for camera settings"
1753 /* BUGFIX: splitting up interface of cam and trig */
1754 /* #ifdef ENABLE_CAM2 */
1755 /* dac->cam = create_cam(GNOME_APP(gpiv->console), */
1756 /* GTK_TABLE(dac->table) */
1757 /* #endif */ /* ENABLE_CAM2 */
1759 dac
->cam
->frame_cam
= gtk_frame_new(_("Camera"));
1760 gtk_widget_ref(dac
->cam
->frame_cam
);
1761 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1763 dac
->cam
->frame_cam
,
1764 (GtkDestroyNotify
) gtk_widget_unref
);
1765 gtk_widget_show(dac
->cam
->frame_cam
);
1766 gtk_table_attach(GTK_TABLE(dac
->table
),
1767 dac
->cam
->frame_cam
,
1772 (GtkAttachOptions
) (GTK_FILL
),
1773 (GtkAttachOptions
) (0),
1779 dac
->cam
->vbox_cam
= gtk_vbox_new(FALSE
,
1781 gtk_widget_ref(dac
->cam
->vbox_cam
);
1782 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1785 (GtkDestroyNotify
) gtk_widget_unref
);
1786 gtk_widget_show(dac
->cam
->vbox_cam
);
1787 gtk_container_add(GTK_CONTAINER (dac
->cam
->frame_cam
),
1788 dac
->cam
->vbox_cam
);
1789 /* gtk_table_attach(GTK_TABLE(dac->cam->table_cam), */
1790 /* dac->cam->vbox_cam, */
1795 /* (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), */
1796 /* (GtkAttachOptions) 0, */
1800 /* gtk_container_add(GTK_CONTAINER (hbox), */
1807 * Camera Shutter menu's and adjuster
1810 create_camera_menu(main_window
,
1813 create_format_menu(main_window
,
1817 create_fps_menu(main_window
,
1823 /* dac->cam->frame_trigger = gtk_frame_new(_("Trigger")); */
1824 /* gtk_widget_ref(dac->cam->frame_trigger); */
1825 /* gtk_object_set_data_full(GTK_OBJECT (main_window), */
1826 /* "dac_frame_trigger", */
1827 /* dac->cam->frame_trigger, */
1828 /* (GtkDestroyNotify) gtk_widget_unref); */
1829 /* gtk_widget_show(dac->cam->frame_trigger); */
1830 /* gtk_container_add(GTK_CONTAINER (dac->cam->vbox_cam), */
1831 /* dac->cam->frame_trigger); */
1836 /* dac->cam->vbox_trigger = gtk_vbox_new(FALSE, */
1838 /* gtk_widget_ref(dac->cam->vbox_trigger); */
1839 /* gtk_object_set_data_full(GTK_OBJECT (main_window), */
1840 /* "vbox_trigger", */
1841 /* dac->cam->vbox_trigger, */
1842 /* (GtkDestroyNotify) gtk_widget_unref); */
1843 /* gtk_widget_show(dac->cam->vbox_trigger); */
1844 /* gtk_container_add(GTK_CONTAINER (dac->cam->frame_trigger), */
1845 /* dac->cam->vbox_trigger); */
1850 dac
->cam
->hbox_trigger
= gtk_hbox_new(FALSE
,
1852 gtk_widget_ref(dac
->cam
->hbox_trigger
);
1853 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1855 dac
->cam
->hbox_trigger
,
1856 (GtkDestroyNotify
) gtk_widget_unref
);
1857 gtk_widget_show(dac
->cam
->hbox_trigger
);
1858 gtk_container_add(GTK_CONTAINER (dac
->cam
->vbox_cam
),
1859 dac
->cam
->hbox_trigger
);
1864 dac
->cam
->trigger_external
= gtk_toggle_button_new_with_label (_("External trigger"));
1865 gtk_widget_ref (dac
->cam
->trigger_external
);
1866 gtk_object_set_data_full (GTK_OBJECT (main_window
),
1868 dac
->cam
->trigger_external
,
1869 (GtkDestroyNotify
) gtk_widget_unref
);
1870 gtk_widget_show (dac
->cam
->trigger_external
);
1871 gtk_container_add(GTK_CONTAINER (dac
->cam
->hbox_trigger
),
1872 dac
->cam
->trigger_external
);
1873 gtk_widget_set_sensitive (dac
->cam
->trigger_external
,
1875 g_signal_connect (GTK_OBJECT (dac
->cam
->trigger_external
), "toggled",
1876 GTK_SIGNAL_FUNC (on_trigger_external_toggled
),
1882 dac
->cam
->trigger_polarity
= gtk_toggle_button_new_with_label (_("Polarity"));
1883 gtk_widget_ref (dac
->cam
->trigger_polarity
);
1884 gtk_object_set_data_full (GTK_OBJECT (main_window
),
1886 dac
->cam
->trigger_polarity
,
1887 (GtkDestroyNotify
) gtk_widget_unref
);
1888 gtk_widget_show (dac
->cam
->trigger_polarity
);
1889 gtk_container_add(GTK_CONTAINER (dac
->cam
->hbox_trigger
),
1890 dac
->cam
->trigger_polarity
);
1891 gtk_widget_set_sensitive (dac
->cam
->trigger_polarity
,
1893 g_signal_connect (GTK_OBJECT (dac
->cam
->trigger_polarity
), "toggled",
1894 GTK_SIGNAL_FUNC (on_trigger_polarity_toggled
),
1899 create_trigger_mode(main_window
,
1902 * Enable triggering with the cam
1905 dac
->cam
->checkbutton_camera_trigger
=
1906 gtk_check_button_new_with_label(_("RTAI triggering"));
1907 gtk_widget_ref(dac
->cam
->checkbutton_camera_trigger
);
1908 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1909 "button_camera_trigger",
1910 dac
->cam
->checkbutton_camera_trigger
,
1911 (GtkDestroyNotify
) gtk_widget_unref
);
1912 gtk_widget_show(dac
->cam
->checkbutton_camera_trigger
);
1913 gtk_container_add(GTK_CONTAINER (dac
->cam
->vbox_cam
),
1914 dac
->cam
->checkbutton_camera_trigger
);
1915 gtk_tooltips_set_tip(gpiv
->tooltips
,
1916 dac
->cam
->checkbutton_camera_trigger
,
1917 _("Enables triggering of the camera and laser. "
1918 "Else, the camera will 'free run', mostly at "
1919 "30 frames per second."),
1922 gtk_object_set_data(GTK_OBJECT (dac
->cam
->checkbutton_camera_trigger
),
1925 g_signal_connect(GTK_OBJECT (dac
->cam
->checkbutton_camera_trigger
),
1927 G_CALLBACK (on_checkbutton_camera_trigger_enter
),
1929 g_signal_connect(GTK_OBJECT (dac
->cam
->checkbutton_camera_trigger
),
1931 G_CALLBACK (on_widget_leave
),
1933 g_signal_connect(GTK_OBJECT (dac
->cam
->checkbutton_camera_trigger
),
1935 G_CALLBACK (on_checkbutton_camera_trigger
),
1937 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
1938 (dac
->cam
->checkbutton_camera_trigger
),
1939 gpiv_par
.trigger_cam
);
1940 #endif /* ENABLE_TRIG */
1944 dac
->cam
->table_cam
= gtk_table_new(9,
1947 gtk_widget_ref(dac
->cam
->table_cam
);
1948 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1950 dac
->cam
->table_cam
,
1951 (GtkDestroyNotify
) gtk_widget_unref
);
1952 gtk_widget_show(dac
->cam
->table_cam
);
1953 gtk_container_add(GTK_CONTAINER (dac
->cam
->vbox_cam
),
1954 dac
->cam
->table_cam
);
1959 * Report Camera temperature
1964 dac
->cam
->label_label_temp
= gtk_label_new(_("temp (C): "));
1965 gtk_widget_ref(dac
->cam
->label_label_temp
);
1966 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1967 "dac_label_label_temp",
1968 dac
->cam
->label_label_temp
,
1969 (GtkDestroyNotify
) gtk_widget_unref
);
1970 gtk_widget_show(dac
->cam
->label_label_temp
);
1971 gtk_table_attach(GTK_TABLE(dac
->cam
->table_cam
),
1972 dac
->cam
->label_label_temp
,
1977 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
1978 (GtkAttachOptions
) 0,
1985 dac
->cam
->label_temp
= gtk_label_new("");
1986 gtk_widget_ref(dac
->cam
->label_temp
);
1987 gtk_object_set_data_full(GTK_OBJECT (main_window
),
1989 dac
->cam
->label_temp
,
1990 (GtkDestroyNotify
) gtk_widget_unref
);
1991 gtk_widget_show(dac
->cam
->label_temp
);
1992 gtk_table_attach(GTK_TABLE(dac
->cam
->table_cam
),
1993 dac
->cam
->label_temp
,
1998 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
1999 (GtkAttachOptions
) 0,
2003 /* g_warning("cr_dac:: feature T; %s", */
2004 /* dc1394_feature_desc[FEATURE_TEMPERATURE - FEATURE_MIN]); */
2009 * Camera Exposure menu's and adjuster
2011 * First define the scale as its data are set for the menu items
2013 create_camera_feature_menu_scale(main_window
,
2018 dac
->cam
->camera_exposure
,
2019 dac
->cam
->camera_exposure_menu
,
2020 dac
->cam
->menu_item_camera_exposure_man
,
2021 dac
->cam
->menu_item_camera_exposure_auto
,
2022 dac
->cam
->menu_item_camera_exposure_na
,
2023 dac
->cam
->adj_exposure_scale
,
2024 dac
->cam
->exposure_scale
2027 * Camera Iris menu's and adjuster
2029 create_camera_feature_menu_scale(main_window
,
2034 dac
->cam
->camera_iris
,
2035 dac
->cam
->camera_iris_menu
,
2036 dac
->cam
->menu_item_camera_iris_man
,
2037 dac
->cam
->menu_item_camera_iris_auto
,
2038 dac
->cam
->menu_item_camera_iris_na
,
2039 dac
->cam
->adj_iris_scale
,
2040 dac
->cam
->iris_scale
2044 * Camera Shutter menu's and adjuster
2046 create_camera_feature_menu_scale(main_window
,
2051 dac
->cam
->camera_shutter
,
2052 dac
->cam
->camera_shutter_menu
,
2053 dac
->cam
->menu_item_camera_shutter_man
,
2054 dac
->cam
->menu_item_camera_shutter_auto
,
2055 dac
->cam
->menu_item_camera_shutter_na
,
2056 dac
->cam
->adj_shutter_scale
,
2057 dac
->cam
->shutter_scale
2061 * Camera Gain menu's and adjuster
2063 create_camera_feature_menu_scale(main_window
,
2068 dac
->cam
->camera_gain
,
2069 dac
->cam
->camera_gain_menu
,
2070 dac
->cam
->menu_item_camera_gain_man
,
2071 dac
->cam
->menu_item_camera_gain_auto
,
2072 dac
->cam
->menu_item_camera_gain_na
,
2073 dac
->cam
->adj_gain_scale
,
2074 dac
->cam
->gain_scale
2078 * Camera Temperature menu's and adjuster
2080 create_camera_feature_menu_scale(main_window
,
2082 FEATURE_TEMPERATURE
,
2085 dac
->cam
->camera_temp
,
2086 dac
->cam
->camera_temp_menu
,
2087 dac
->cam
->menu_item_camera_temp_man
,
2088 dac
->cam
->menu_item_camera_temp_auto
,
2089 dac
->cam
->menu_item_camera_temp_na
,
2090 dac
->cam
->adj_temp_scale
,
2091 dac
->cam
->temp_scale
2095 * Camera Zoom menu's and adjuster
2097 create_camera_feature_menu_scale(main_window
,
2102 dac
->cam
->camera_zoom
,
2103 dac
->cam
->camera_zoom_menu
,
2104 dac
->cam
->menu_item_camera_zoom_man
,
2105 dac
->cam
->menu_item_camera_zoom_auto
,
2106 dac
->cam
->menu_item_camera_zoom_na
,
2107 dac
->cam
->adj_zoom_scale
,
2108 dac
->cam
->zoom_scale
2112 * Camera Pan menu's and adjuster
2114 create_camera_feature_menu_scale(main_window
,
2119 dac
->cam
->camera_pan
,
2120 dac
->cam
->camera_pan_menu
,
2121 dac
->cam
->menu_item_camera_pan_man
,
2122 dac
->cam
->menu_item_camera_pan_auto
,
2123 dac
->cam
->menu_item_camera_pan_na
,
2124 dac
->cam
->adj_pan_scale
,
2129 * Camera Tilt menu's and adjuster
2131 create_camera_feature_menu_scale(main_window
,
2136 dac
->cam
->camera_tilt
,
2137 dac
->cam
->camera_tilt_menu
,
2138 dac
->cam
->menu_item_camera_tilt_man
,
2139 dac
->cam
->menu_item_camera_tilt_auto
,
2140 dac
->cam
->menu_item_camera_tilt_na
,
2141 dac
->cam
->adj_tilt_scale
,
2142 dac
->cam
->tilt_scale
2146 * Record activating button
2148 dac
->cam
->button_cam_start
= gtk_button_new_with_label(_("start camera"));
2149 gtk_widget_ref(dac
->cam
->button_cam_start
);
2150 gtk_object_set_data_full(GTK_OBJECT (main_window
),
2152 dac
->cam
->button_cam_start
,
2153 (GtkDestroyNotify
) gtk_widget_unref
);
2154 gtk_widget_show(dac
->cam
->button_cam_start
);
2155 gtk_table_attach(GTK_TABLE(dac
->table
),
2156 dac
->cam
->button_cam_start
,
2161 (GtkAttachOptions
) (GTK_FILL
),
2162 (GtkAttachOptions
) (GTK_FILL
),
2165 gtk_tooltips_set_tip(gpiv
->tooltips
,
2166 dac
->cam
->button_cam_start
,
2167 _("Starts camera to record PIV images of an area that is illuminated "
2168 "by a (double cavity Nd-YAG) laser and is observed "
2169 "by a CCD camera. Camera and lasers are eventually "
2170 "triggered by TTL pulses from the (parallel) output "
2174 gtk_object_set_data(GTK_OBJECT (dac
->cam
->button_cam_start
),
2177 g_signal_connect(GTK_OBJECT (dac
->cam
->button_cam_start
),
2179 G_CALLBACK (on_button_dac_camstart_enter
),
2181 g_signal_connect(GTK_OBJECT (dac
->cam
->button_cam_start
),
2183 G_CALLBACK (on_widget_leave
),
2185 g_signal_connect(GTK_OBJECT (dac
->cam
->button_cam_start
),
2189 G_CALLBACK (on_button_dac_camstart
),
2194 * Record de-activating button
2196 dac
->cam
->button_cam_stop
= gtk_button_new_with_label(_("stop camera"));
2197 gtk_widget_ref(dac
->cam
->button_cam_stop
);
2198 gtk_object_set_data_full(GTK_OBJECT (main_window
),
2200 dac
->cam
->button_cam_stop
,
2201 (GtkDestroyNotify
) gtk_widget_unref
);
2202 gtk_widget_show(dac
->cam
->button_cam_stop
);
2203 gtk_table_attach(GTK_TABLE(dac
->table
),
2204 dac
->cam
->button_cam_stop
,
2209 (GtkAttachOptions
) (GTK_FILL
),
2210 (GtkAttachOptions
) (GTK_FILL
),
2213 gtk_tooltips_set_tip(gpiv
->tooltips
,
2214 dac
->cam
->button_cam_stop
,
2215 _("Stops camera to record of PIV images "
2216 "and, eventually, cancels sending of trigger pulses"),
2219 gtk_object_set_data(GTK_OBJECT (dac
->cam
->button_cam_stop
),
2222 g_signal_connect(GTK_OBJECT (dac
->cam
->button_cam_stop
),
2224 G_CALLBACK (on_button_dac_camstop_enter
),
2226 g_signal_connect(GTK_OBJECT (dac
->cam
->button_cam_stop
),
2228 G_CALLBACK (on_widget_leave
),
2230 g_signal_connect(GTK_OBJECT (dac
->cam
->button_cam_stop
),
2232 G_CALLBACK (on_button_dac_camstop
),
2234 #endif /* ENABLE_CAM */
2237 * Setting initial values
2240 if (gl_cam_par
->mode
== GPIV_CAM_MODE__PERIODIC
) {
2241 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2242 (dac
->trig
->radiobutton_mouse_1
),
2245 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2246 (dac
->trig
->radiobutton_mouse_1
),
2250 if (gl_cam_par
->mode
== GPIV_CAM_MODE__DURATION
) {
2251 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2252 (dac
->trig
->radiobutton_mouse_2
),
2258 if (trig_par
.ttime
.mode
== GPIV_TIMER_MODE__PERIODIC
) {
2259 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2260 (dac
->trig
->radiobutton_mouse_1
),
2263 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2264 (dac
->trig
->radiobutton_mouse_1
),
2268 if (trig_par
.ttime
.mode
== GPIV_TIMER_MODE__DURATION
) {
2269 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2270 (dac
->trig
->radiobutton_mouse_2
),
2274 if (trig_par
.ttime
.mode
== GPIV_TIMER_MODE__ONE_SHOT_IRQ
) {
2275 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2276 (dac
->trig
->radiobutton_mouse_3
),
2280 if (trig_par
.ttime
.mode
== GPIV_TIMER_MODE__TRIGGER_IRQ
) {
2281 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2282 (dac
->trig
->radiobutton_mouse_4
),
2286 if (trig_par
.ttime
.mode
== GPIV_TIMER_MODE__INCREMENT
) {
2287 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2288 (dac
->trig
->radiobutton_mouse_5
),
2292 if (trig_par
.ttime
.mode
== GPIV_TIMER_MODE__DOUBLE
) {
2293 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
2294 (dac
->trig
->radiobutton_mouse_6
),
2297 #endif /* ENABLE_TRIG */
2298 #endif /* ENABLE_CAM */
2303 #endif /* ENABLE_DAC */