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
9 Gerber van der Graaf <gerber_graaf@users.sourceforge.net>
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 ----------------------------------------------------------------------*/
31 * $Id: dac.c,v 1.7 2008-09-16 11:13:09 gerber Exp $
44 * BUGFIX: Put somwhere to update on regular basis:
45 gtk_label_set_text(GTK_LABEL(gpiv->dac->label_temp),
49 static int init
, start
, stop
, error
;
52 /* pthread_mutex_t mutex_rec = PTHREAD_MUTEX_INITIALIZER; */
64 on_entry_dac_fname (GtkSpinButton
*widget
,
67 /*-----------------------------------------------------------------------------
71 Dac
* dac
= gtk_object_get_data (GTK_OBJECT (widget
), "dac");
73 push_list_lastfnames ((gchar
*) gtk_entry_get_text( GTK_ENTRY( dac
->entry_fname
)));
74 dac
->combo_fname_items
= NULL
;
75 for (i
= 0; i
< gpiv_var
->number_fnames_last
; i
++) {
76 dac
->combo_fname_items
= g_list_append (dac
->combo_fname_items
,
77 gpiv_var
->fn_last
[i
]);
79 gtk_combo_set_popdown_strings (GTK_COMBO (dac
->combo_fname
),
80 dac
->combo_fname_items
);
81 g_list_free (dac
->combo_fname_items
);
85 * dac_par.fname__set = TRUE;
91 on_checkbutton_fname_date_enter (GtkWidget
*widget
,
94 /* ----------------------------------------------------------------------------
97 GpivConsole
* gpiv
= gtk_object_get_data(GTK_OBJECT(widget
), "gpiv");
98 gchar
*msg
= _("Extends the name with current date");
99 gnome_appbar_set_status(GNOME_APPBAR(gpiv
->appbar
), msg
);
105 on_checkbutton_fname_date(GtkWidget
*widget
,
108 /* ----------------------------------------------------------------------------
111 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
112 gpiv_var
->fname_date
= TRUE
;
114 gpiv_var
->fname_date
= FALSE
;
116 gnome_config_push_prefix("/gpiv/RuntimeVariables/");
117 gnome_config_set_bool("fname_date", gpiv_var
->fname_date
);
118 gnome_config_pop_prefix();
125 on_checkbutton_fname_time_enter(GtkWidget
*widget
,
128 /* ----------------------------------------------------------------------------
131 GpivConsole
* gpiv
= gtk_object_get_data(GTK_OBJECT(widget
), "gpiv");
132 gchar
*msg
= _("Extends the name with current time");
133 gnome_appbar_set_status(GNOME_APPBAR(gpiv
->appbar
), msg
);
139 on_checkbutton_fname_time(GtkWidget
*widget
,
142 /* ----------------------------------------------------------------------------
145 if (GTK_TOGGLE_BUTTON(widget
)->active
) {
146 gpiv_var
->fname_time
= TRUE
;
148 gpiv_var
->fname_time
= FALSE
;
150 gnome_config_push_prefix("/gpiv/RuntimeVariables/");
151 gnome_config_set_bool("fname_time", gpiv_var
->fname_time
);
152 gnome_config_pop_prefix();
159 on_radiobutton_dac_mouse_1_enter(GtkWidget
* widget
,
162 /*-----------------------------------------------------------------------------
165 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT(widget
), "gpiv");
166 gchar
*msg
= _("indefinite periodic recording");
167 gnome_appbar_set_status(GNOME_APPBAR(gpiv
->appbar
), msg
);
173 on_radiobutton_dac_mouse_2_enter(GtkWidget
* widget
,
176 /*-----------------------------------------------------------------------------
179 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT(widget
), "gpiv");
180 gchar
*msg
= _("with pre-defined number of images");
181 gnome_appbar_set_status(GNOME_APPBAR(gpiv
->appbar
), msg
);
187 on_radiobutton_dac_mouse_3_enter(GtkWidget
* widget
,
190 /*-----------------------------------------------------------------------------
193 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT(widget
), "gpiv");
194 gchar
*msg
= _("one shot with interrupd");
195 gnome_appbar_set_status(GNOME_APPBAR(gpiv
->appbar
), msg
);
201 on_radiobutton_dac_mouse_4_enter(GtkWidget
* widget
,
204 /*-----------------------------------------------------------------------------
207 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT(widget
), "gpiv");
208 gchar
*msg
= _("periodic with interrupt");
209 gnome_appbar_set_status(GNOME_APPBAR(gpiv
->appbar
), msg
);
215 on_radiobutton_dac_mouse_5_enter(GtkWidget
* widget
,
218 /*-----------------------------------------------------------------------------
221 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT(widget
), "gpiv");
222 gchar
*msg
= _("with incremental separation time dt");
223 gnome_appbar_set_status(GNOME_APPBAR(gpiv
->appbar
), msg
);
229 on_radiobutton_dac_mouse_6_enter(GtkWidget
* widget
,
232 /*-----------------------------------------------------------------------------
235 GpivConsole
*gpiv
= gtk_object_get_data(GTK_OBJECT(widget
), "gpiv");
236 gchar
*msg
= _("double exposure");
237 gnome_appbar_set_status(GNOME_APPBAR(gpiv
->appbar
), msg
);
244 on_radiobutton_dac_mouse(GtkWidget
* widget
,
247 /*-----------------------------------------------------------------------------
250 gint mouse_select
= atoi(gtk_object_get_data(GTK_OBJECT(widget
),
252 gl_cam_par
->mode
= mouse_select
;
253 /* g_warning("on_radiobutton_dac_mouse:: mode = %d", */
254 /* gl_cam_par.mode); */
256 if (mouse_select
== GPIV_CAM_MODE__PERIODIC
) {}
257 if (mouse_select
== GPIV_CAM_MODE__DURATION
) {}
258 if (mouse_select
== GPIV_CAM_MODE__ONE_SHOT_IRQ
) {}
259 if (mouse_select
== GPIV_CAM_MODE__TRIGGER_IRQ
) {}
260 if (mouse_select
== GPIV_CAM_MODE__INCREMENT
) {}
261 if (mouse_select
== GPIV_CAM_MODE__DOUBLE
) {}
264 #else /* ENABLE_CAM */
268 on_radiobutton_dac_mouse(GtkWidget
* widget
,
271 /*-----------------------------------------------------------------------------
274 gint mouse_select
= atoi(gtk_object_get_data(GTK_OBJECT(widget
),
276 trig_par
.ttime
.mode
= mouse_select
;
277 /* g_warning("on_radiobutton_dac_mouse:: ttime.mode = %d", */
278 /* dac_par.ttime.mode); */
280 if (mouse_select
== GPIV_TIMER_MODE__PERIODIC
) {}
281 if (mouse_select
== GPIV_TIMER_MODE__DURATION
) {}
282 if (mouse_select
== GPIV_TIMER_MODE__ONE_SHOT_IRQ
) {}
283 if (mouse_select
== GPIV_TIMER_MODE__TRIGGER_IRQ
) {}
284 if (mouse_select
== GPIV_TIMER_MODE__INCREMENT
) {}
285 if (mouse_select
== GPIV_TIMER_MODE__DOUBLE
) {}
289 #endif /* ENABLE_TRIG */
290 #endif /* ENABLE_CAM */
293 #endif /* ENABLE_TRIG */
298 on_spinbutton_dac_trigger_nf(GtkSpinButton
* widget
,
301 /*-----------------------------------------------------------------------------
304 gl_cam_par
->cycles
= gtk_spin_button_get_value_as_int(widget
);
307 #else /* ENABLE_CAM */
310 on_spinbutton_dac_trigger_nf(GtkSpinButton
* widget
,
313 /*-----------------------------------------------------------------------------
316 trig_par
.ttime
.cycles
= gtk_spin_button_get_value_as_int(widget
);
319 #endif /* ENABLE_TRIG */
320 #endif /* ENABLE_CAM */
323 #endif /* ENABLE_DAC */