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 * (callback) functions for Piv validation window/tabulator
31 * $Log: pivvalid.c,v $
32 * Revision 1.16 2008-04-28 12:00:57 gerber
33 * hdf-formatted files are now with .hdf extension (previously: .gpi)
35 * Revision 1.15 2007-12-19 08:42:35 gerber
38 * Revision 1.14 2007-11-23 16:24:08 gerber
39 * release 0.5.0: Kafka
41 * Revision 1.13 2007-06-06 17:00:48 gerber
42 * Retreives images/data from URI using Gnome Virtual File System.
44 * Revision 1.12 2007-03-22 16:00:32 gerber
45 * Added image processing tabulator
47 * Revision 1.11 2007-01-29 11:27:44 gerber
48 * added image formats png, gif, tif png, bmp, improved buffer display
50 * Revision 1.10 2006/01/31 14:28:12 gerber
53 * Revision 1.9 2005/06/15 09:40:40 gerber
56 * Revision 1.8 2005/02/26 09:43:31 gerber
57 * parameter flags (parameter_logic) defined as gboolean
59 * Revision 1.7 2004/10/15 19:24:05 gerber
60 * GPIV_ and Gpiv prefix to defines and structure names of libgpiv
62 * Revision 1.6 2004/06/14 21:19:23 gerber
63 * Image depth up to 16 bits.
64 * Improvement "single int" and "drag int" in Eval tab.
65 * Viewer's pop-up menu.
66 * Adaption for gpiv_matrix_* and gpiv_vector_*.
68 * See Changelog for further info.
70 * Revision 1.5 2003/07/13 14:38:18 gerber
71 * changed error handling of libgpiv
73 * Revision 1.4 2003/07/12 21:21:16 gerber
74 * changed error handling libgpiv
76 * Revision 1.2 2003/07/10 11:56:07 gerber
79 * Revision 1.1.1.1 2003/06/17 17:10:52 gerber
92 * Public piv validation functions
98 /* ----------------------------------------------------------------------------
99 * Testing on gradient of displacements/veocity within Int. Area
102 if (display_act
->pida
->exist_piv
&& !cancel_process
) {
104 gpiv_valid_gradient (gl_piv_par
,
105 display_act
->pida
->piv_data
);
106 update_all_vectors (display_act
->pida
);
107 exec_process
= FALSE
;
109 warning_gpiv(_("no PIV data"));
116 exec_errvec (PivValid
* valid
118 /*-----------------------------------------------------------------------------
119 * Calculates histogram of residus and resulting threshold displacement
122 char *err_msg
= NULL
;
125 GnomeCanvasItem
*bg
, *bar
, *fitline
;
126 GnomeCanvasPoints
*points
;
127 double canvas_margin
= 20.;
129 double canvas_startx
= -50.;
130 double canvas_endx
= 150.;
131 double disp_width
= canvas_endx
- canvas_startx
- 2 * canvas_margin
;
133 double canvas_starty
= -50.;
134 double canvas_endy
= 150.;
135 double disp_height
= canvas_endy
- canvas_starty
- 2 * canvas_margin
;
137 double canvas_x1
= canvas_startx
+ canvas_margin
;
138 double canvas_y1
= canvas_starty
+ canvas_margin
+ disp_height
;
140 double x_val
, y_val
, x_normf
, y_normf
;
144 points
= gnome_canvas_points_new (2);
146 if (display_act
->pida
->exist_piv
&& !cancel_process
) {
149 if (gpiv_var
->residu_stats
== TRUE
) {
151 * Calculate histogram
152 * normalizing histo between 0 and 1 and displaying histo and estimated
155 GpivBinData
*klass
= NULL
;
156 GpivLinRegData
*linreg
= g_new0 (GpivLinRegData
, 1);
157 double centre_max
= -10.0E+9;
161 gpiv_valid_residu (display_act
->pida
->piv_data
, gl_valid_par
,
164 gpiv_error ("exec_errvec: failing gpiv_valid_residu");
168 gpiv_valid_residu_stats (display_act
->pida
->piv_data
,
169 display_act
->pida
->piv_data
->nx
170 * display_act
->pida
->piv_data
->ny
171 / GPIV_NBINS_DEFAULT
,
174 gpiv_error ("exec_errvec: failing gpiv_valid_residu_stats");
178 for (i
= 0; i
< klass
->nbins
; i
++) {
179 if (klass
->centre
[i
] > centre_max
)
180 centre_max
= klass
->centre
[i
];
183 x_normf
= (double) disp_width
/ (klass
->max
- klass
->min
);
184 y_normf
= (double) centre_max
;
187 bg
= gnome_canvas_item_new (gnome_canvas_root
188 (GNOME_CANVAS(valid
->canvas_histo
)),
189 gnome_canvas_rect_get_type(),
190 "x1", (double) canvas_startx
,
191 "y1", (double) canvas_starty
,
192 "x2", (double) canvas_endx
,
193 "y2", (double) canvas_endy
,
194 "fill_color", "darkblue",
195 "outline_color", "red",
199 for (i
= 0; i
< klass
->nbins
- 1; i
++) {
200 x_val
= (double) (klass
->bound
[i
]) / x_normf
;
201 y_val
= (double) klass
->centre
[i
] / y_normf
;
203 gnome_canvas_item_new (gnome_canvas_root
204 (GNOME_CANVAS (valid
->canvas_histo
)),
205 gnome_canvas_rect_get_type(),
207 (double) klass
->bound
[i
] * x_normf
,
209 (double) disp_height
* y_val
,
211 (double) klass
->bound
[i
+ 1] * x_normf
,
212 "y2", (double) canvas_y1
,
213 "fill_color", "darkgreen",
214 "outline_color", "blue",
219 gl_valid_par
->residu_max
=
220 gpiv_valid_threshold (display_act
->pida
->piv_par
,
221 gl_valid_par
, linreg
);
222 gtk_spin_button_set_value (GTK_SPIN_BUTTON
223 (valid
->spinbutton_errvec_res
),
224 gl_valid_par
->residu_max
);
226 g_message("gpiv_valid_errvec:: c1 = %f int_size_f = %d yield = %f residu_max = %f",
228 gl_piv_par
->int_size_f
,
229 gl_valid_par
->data_yield
,
230 gl_valid_par
->residu_max
);
233 points
->coords
[0] = (double) canvas_x1
;
234 points
->coords
[1] = (double) canvas_y1
235 - (double) linreg
->c0
/ y_normf
* (double) disp_height
237 points
->coords
[2] = (double) canvas_x1
238 + (double) disp_width
;
239 points
->coords
[3] = (double) canvas_y1
240 - (double) linreg
->c0
/ y_normf
* (double) disp_height
241 - (double) linreg
->c1
* (double) (disp_width
) * (double) (disp_height
)
242 / ( x_normf
* y_normf
)
247 gnome_canvas_item_new (gnome_canvas_root
248 (GNOME_CANVAS(valid
->canvas_histo
)),
249 gnome_canvas_line_get_type(),
252 "width_units", (double) 2.0,
255 gpiv_free_bindata (klass
);
260 gpiv_valid_errvec (display_act
->pida
->piv_data
,
261 display_act
->img
->image
,
265 != NULL
) gpiv_error ("%s: %s", RCSID
, err_msg
);
266 update_all_vectors (display_act
->pida
);
270 display_act
->pida
->exist_valid
= TRUE
;
273 * Copy parameters in Buffer structure for saving and, eventual,
276 display_act
->pida
->valid_par
->residu_max
= gl_valid_par
->residu_max
;
277 display_act
->pida
->valid_par
->data_yield
= gl_valid_par
->data_yield
;
278 display_act
->pida
->valid_par
->residu_type
= gl_valid_par
->residu_type
;
279 display_act
->pida
->valid_par
->subst_type
= gl_valid_par
->subst_type
;
280 display_act
->pida
->valid_par
->histo_type
= gl_valid_par
->histo_type
;
282 display_act
->pida
->valid_par
->residu_max__set
= TRUE
;
283 display_act
->pida
->valid_par
->data_yield__set
=
284 gl_valid_par
->data_yield__set
;
285 display_act
->pida
->valid_par
->residu_type__set
= TRUE
;
286 display_act
->pida
->valid_par
->subst_type__set
= TRUE
;
287 display_act
->pida
->valid_par
->histo_type__set
= TRUE
;
288 exec_process
= FALSE
;
291 warning_gpiv(_("no PIV data"));
294 gnome_canvas_points_free(points
);
301 exec_peaklock (PivValid
* valid
303 /*-----------------------------------------------------------------------------
304 * Calculates and displays peaklocking histogram of a single PIV data set
309 GnomeCanvasItem
*bg
, *bar
;
310 double canvas_margin
= 20.;
312 double canvas_startx
= -50.;
313 double canvas_endx
= 150.;
314 double d_width
= canvas_endx
- canvas_startx
- 2 * canvas_margin
;
316 double canvas_starty
= -50.;
317 double canvas_endy
= 150.;
318 double d_height
= canvas_endy
- canvas_starty
- 2 * canvas_margin
;
320 double canvas_x1
= canvas_startx
+ canvas_margin
;
321 double canvas_y1
= canvas_starty
+ canvas_margin
+ d_height
;
324 gint count_max
= -10000;
325 GpivBinData
*klass
= NULL
;
329 if (display_act
->pida
->exist_piv
&& !cancel_process
) {
333 * Calculates and normalizes klass data between 0 and 1
335 if ((klass
= gpiv_valid_peaklck (display_act
->pida
->piv_data
,
336 gpiv_par
->console__nbins
))
338 gpiv_error ("exec_peaklock: failing gpiv_valid_peaklck");
342 for (i
= 0; i
< klass
->nbins
; i
++) {
343 if ((double) klass
->count
[i
] > count_max
) {
344 count_max
= klass
->count
[i
];
350 * Displaying background and histogram
353 gnome_canvas_item_new (gnome_canvas_root
354 (GNOME_CANVAS(valid
->canvas_histo
)),
355 gnome_canvas_rect_get_type(),
356 "x1", (double) canvas_startx
,
357 "y1", (double) canvas_starty
,
358 "x2", (double) canvas_endx
,
359 "y2", (double) canvas_endy
,
360 "fill_color", "darkgreen",
361 "outline_color", "red",
365 for (i
= 0; i
< klass
->nbins
; i
++) {
366 if (count_max
!= 0) {
367 y_val
= (double) klass
->count
[i
] / (double) count_max
;
374 gnome_canvas_item_new (gnome_canvas_root
375 (GNOME_CANVAS(valid
->canvas_histo
)),
376 gnome_canvas_rect_get_type(),
378 (double) klass
->bound
[i
] * d_width
,
380 (double) d_height
* y_val
,
382 (double) klass
->bound
[i
+1] * d_width
,
384 "fill_color", "yellow",
385 "outline_color", "blue",
390 gpiv_free_bindata (klass
);
391 exec_process
= FALSE
;
394 warning_gpiv (_("no PIV data"));
402 exec_uvhisto (PivValid
* valid
,
403 enum GpivVelComponent velcomp
405 /*-----------------------------------------------------------------------------
409 GnomeCanvasItem
*bg
, *bar
;
410 double canvas_margin
= 20.;
412 double canvas_startx
= -50.;
413 double canvas_endx
= 150.;
414 double d_width
= canvas_endx
- canvas_startx
- 2 * canvas_margin
;
416 double canvas_starty
= -50.;
417 double canvas_endy
= 150.;
418 double d_height
= canvas_endy
- canvas_starty
- 2 * canvas_margin
;
420 double canvas_x1
= canvas_startx
+ canvas_margin
;
421 double canvas_y1
= canvas_starty
+ canvas_margin
+ d_height
;
424 gint count_max
= -10000;
425 /* char c_line[GPIV_MAX_LINES_C][GPIV_MAX_CHARS]; */
429 if (display_act
->pida
->exist_histo
== TRUE
) {
430 /* g_message("exec_uvhisto:: calling gpiv_free_bindata"); */
431 gpiv_free_bindata (display_act
->pida
->klass
);
434 if (display_act
->pida
->exist_piv
&& !cancel_process
) {
438 /* BUGFIX: quick hack to display u velocities */
439 /* g_message("::will process uhisto"); */
441 if ((display_act
->pida
->klass
=
442 gpiv_post_uvhisto (display_act
->pida
->piv_data
,
443 gpiv_par
->console__nbins
,
446 gpiv_error ("exec_uvhisto: failing gpiv_post_uvhisto");
448 /* gpiv_print_histo(display_act->pida->klass, */
451 /* display_act->pida->scaled_piv, */
455 * normalizing data between 0 and 1
457 for (i
= 0; i
< display_act
->pida
->klass
->nbins
; i
++) {
458 if ((double) display_act
->pida
->klass
->count
[i
] > count_max
) {
459 count_max
= display_act
->pida
->klass
->count
[i
];
467 gnome_canvas_item_new(gnome_canvas_root
468 (GNOME_CANVAS(valid
->canvas_histo
)),
469 gnome_canvas_rect_get_type(),
470 "x1", (double) canvas_startx
,
471 "y1", (double) canvas_starty
,
472 "x2", (double) canvas_endx
,
473 "y2", (double) canvas_endy
,
474 "fill_color", "darkgreen",
475 "outline_color", "red",
479 for (i
= 0; i
< display_act
->pida
->klass
->nbins
; i
++) {
480 if (count_max
!= 0) {
481 y_val
= (double) display_act
->pida
->klass
->count
[i
] / (double) count_max
;
487 gnome_canvas_item_new(gnome_canvas_root
488 (GNOME_CANVAS(valid
->canvas_histo
)),
489 gnome_canvas_rect_get_type(),
491 (double) (d_width
/ display_act
->pida
->klass
->nbins
* i
),
493 (double) d_height
* y_val
,
495 (double) (d_width
/ display_act
->pida
->klass
->nbins
* (i
+1)),
497 "fill_color", "yellow",
498 "outline_color", "blue",
505 /* gpiv_free_bindata(display_act->pida->klass); */
506 display_act
->pida
->exist_histo
= TRUE
;
507 display_act
->pida
->saved_histo
= FALSE
;
508 exec_process
= FALSE
;
511 warning_gpiv(_("no PIV data"));
519 * Piv validation window/tabulator callbacks
523 on_button_valid_gradient_enter (GtkWidget
* widget
,
526 /*-----------------------------------------------------------------------------
529 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
530 gchar
*msg
= _("Examines PIV data on velocity gradients");
531 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
538 on_button_valid_gradient (GtkWidget
* widget
,
540 /*-----------------------------------------------------------------------------
543 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
546 cancel_process
= FALSE
;
548 for (row
= gpiv
->first_selected_row
; row
<= gpiv
->last_selected_row
;
550 display_act
= gtk_clist_get_row_data (GTK_CLIST (gpiv
->clist_buf
),
553 ibuf
= display_act
->id
;
554 if (display
[ibuf
] != NULL
555 && display_act
->mwin
!= NULL
556 && GTK_WIDGET_VISIBLE (GTK_WIDGET (display_act
->mwin
)) ) {
557 gdk_window_show (GTK_WIDGET (display_act
->mwin
)->window
);
558 gdk_window_raise (GTK_WIDGET (display_act
->mwin
)->window
);
569 on_radiobutton_valid_disable_0_enter (GtkWidget
* widget
,
572 /*-----------------------------------------------------------------------------
575 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
576 gchar
*msg
= _("No mouse activity within displayer");
577 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
584 on_radiobutton_valid_disable_1_enter (GtkWidget
* widget
,
587 /*-----------------------------------------------------------------------------
590 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
591 gchar
*msg
= _("Enables a single PIV data-point");
592 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
599 on_radiobutton_valid_disable_2_enter (GtkWidget
* widget
,
602 /*-----------------------------------------------------------------------------
605 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
606 gchar
*msg
= _("Disables a single PIV data-point");
607 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
614 on_radiobutton_valid_disable_3_enter (GtkWidget
* widget
,
617 /*-----------------------------------------------------------------------------
620 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
621 gchar
*msg
= _("Enables an area containing PIV data");
622 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
629 on_radiobutton_valid_disable_4_enter (GtkWidget
* widget
,
632 /*-----------------------------------------------------------------------------
635 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
636 gchar
*msg
= _("Disables an area containing PIV data");
637 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
644 on_radiobutton_valid_disable (GtkWidget
* widget
,
647 /*-----------------------------------------------------------------------------
650 m_select
= atoi (gtk_object_get_data (GTK_OBJECT (widget
),
657 on_radiobutton_valid_errvec_residu_enter (GtkWidget
* widget
,
660 /*-----------------------------------------------------------------------------
663 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
664 gchar
*msg
= _("Defines residu type to examine data on");
665 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
671 on_radiobutton_valid_errvec_residu (GtkWidget
* widget
,
674 /*-----------------------------------------------------------------------------
677 gl_valid_par
->residu_type
= atoi (gtk_object_get_data (GTK_OBJECT (widget
),
684 on_button_valid_errvec_resstats_enter (GtkWidget
* widget
,
687 /*-----------------------------------------------------------------------------
690 GpivConsole
* gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
691 gchar
*msg
= _("Displays inverse cumulative histogram of residus");
692 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
698 on_button_valid_errvec_resstats (GtkWidget
* widget
,
701 /*-----------------------------------------------------------------------------
704 PivValid
* valid
= gtk_object_get_data (GTK_OBJECT (widget
), "valid");
705 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
708 cancel_process
= FALSE
;
709 gpiv_var
->residu_stats
= TRUE
;
712 for (row
= gpiv
->first_selected_row
; row
<= gpiv
->last_selected_row
;
714 display_act
= gtk_clist_get_row_data (GTK_CLIST (gpiv
->clist_buf
),
717 ibuf
= display_act
->id
;
718 if (display
[ibuf
] != NULL
719 && display_act
->mwin
!= NULL
720 && GTK_WIDGET_VISIBLE (GTK_WIDGET (display_act
->mwin
)) ) {
721 gdk_window_show (GTK_WIDGET (display_act
->mwin
)->window
);
722 gdk_window_raise (GTK_WIDGET (display_act
->mwin
)->window
);
727 gpiv_var
->residu_stats
= FALSE
;
734 on_spinbutton_valid_errvec_neighbors (GtkSpinButton
*widget
,
737 /*-----------------------------------------------------------------------------
740 gl_valid_par
->neighbors
= gtk_spin_button_get_value_as_int (widget
);
746 on_spinbutton_valid_errvec_yield (GtkSpinButton
*widget
,
749 /*-----------------------------------------------------------------------------
752 gl_valid_par
->data_yield
= gtk_spin_button_get_value_as_float (widget
);
758 on_spinbutton_valid_errvec_res (GtkSpinButton
*widget
,
761 /*-----------------------------------------------------------------------------
764 gl_valid_par
->residu_max
= gtk_spin_button_get_value_as_float (widget
);
765 if (v_color
== SHOW_SNR
&& display_act
->pida
->exist_piv
) {
766 update_all_vectors (display_act
->pida
);
773 on_checkbutton_valid_errvec_disres_enter (GtkWidget
* widget
,
776 /*-----------------------------------------------------------------------------
779 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
780 gchar
*msg
= _("Display PIV vector colors related to residu or SNR value");
781 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
787 on_checkbutton_valid_errvec_disres (GtkSpinButton
*widget
,
790 /*-----------------------------------------------------------------------------
793 if (GTK_TOGGLE_BUTTON (widget
)->active
) {
796 v_color
= SHOW_PEAKNR
;
800 if (display_act
->pida
->exist_piv
&& display_act
->display_piv
) {
801 update_all_vectors (display_act
->pida
);
808 on_radiobutton_valid_errvec_subst_enter (GtkWidget
* widget
,
811 /*-----------------------------------------------------------------------------
814 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
816 gint ltype
= atoi (gtk_object_get_data (GTK_OBJECT (widget
), "substitute"));
818 if (ltype
== GPIV_VALID_SUBSTYPE__NONE
) {
819 msg
= _("Only sets peak_no (flag) to zero");
820 } else if (ltype
== GPIV_VALID_SUBSTYPE__L_MEAN
) {
821 msg
= _("mean from surroundings");
822 } else if (ltype
== GPIV_VALID_SUBSTYPE__MEDIAN
) {
823 msg
= _("Median (middle value) from surroundings");
824 } else if (ltype
== GPIV_VALID_SUBSTYPE__COR_PEAK
) {
825 msg
= _("Re-interrogates and uses next corr. peak as estimator");
827 g_error ("NO valid ltype\n");
830 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
836 on_radiobutton_valid_errvec_subst (GtkWidget
* widget
,
839 /*-----------------------------------------------------------------------------
842 gl_valid_par
->subst_type
= atoi (gtk_object_get_data (GTK_OBJECT (widget
),
849 on_button_valid_errvec_enter (GtkWidget
* widget
,
852 /*-----------------------------------------------------------------------------
855 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
856 gchar
*msg
= _("Examines PIV data on outliers and substitutes");
857 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
863 on_button_valid_errvec (GtkWidget
* widget
,
866 /*-----------------------------------------------------------------------------
869 PivValid
* valid
= gtk_object_get_data (GTK_OBJECT (widget
), "valid");
870 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
873 cancel_process
= FALSE
;
874 gpiv_var
->residu_stats
= FALSE
;
877 for (row
= gpiv
->first_selected_row
; row
<= gpiv
->last_selected_row
;
879 display_act
= gtk_clist_get_row_data (GTK_CLIST (gpiv
->clist_buf
),
882 ibuf
= display_act
->id
;
883 if (display
[ibuf
] != NULL
884 && display_act
->mwin
!= NULL
885 && GTK_WIDGET_VISIBLE (GTK_WIDGET (display_act
->mwin
)) ) {
886 gdk_window_show (GTK_WIDGET (display_act
->mwin
)->window
);
887 gdk_window_raise (GTK_WIDGET (display_act
->mwin
)->window
);
898 on_spinbutton_valid_peaklck_bins (GtkSpinButton
* widget
,
901 /*-----------------------------------------------------------------------------
904 gpiv_par
->console__nbins
= gtk_spin_button_get_value_as_int (widget
);
911 on_button_valid_peaklck_enter (GtkWidget
* widget
,
914 /*-----------------------------------------------------------------------------
917 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
918 gchar
*msg
= _("Calculates a histogram of sub-pixel displacements");
919 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
925 on_button_valid_peaklck (GtkWidget
* widget
,
928 /*-----------------------------------------------------------------------------
931 PivValid
* valid
= gtk_object_get_data (GTK_OBJECT (widget
), "valid");
932 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
935 cancel_process
= FALSE
;
937 for (row
= gpiv
->first_selected_row
; row
<= gpiv
->last_selected_row
;
939 display_act
= gtk_clist_get_row_data (GTK_CLIST (gpiv
->clist_buf
),
942 ibuf
= display_act
->id
;
943 if (display
[ibuf
] != NULL
944 && display_act
->mwin
!= NULL
945 && GTK_WIDGET_VISIBLE (GTK_WIDGET (display_act
->mwin
)) ) {
946 gdk_window_show (GTK_WIDGET (display_act
->mwin
)->window
);
947 gdk_window_raise (GTK_WIDGET (display_act
->mwin
)->window
);
950 exec_peaklock (valid
);
958 on_button_valid_uhisto_enter (GtkWidget
* widget
,
961 /*-----------------------------------------------------------------------------
964 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
965 gchar
*msg
= _ ("Calculates a histogram of horizontal displacements.");
966 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
972 on_button_valid_uhisto (GtkWidget
* widget
,
975 /*-----------------------------------------------------------------------------
978 PivValid
* valid
= gtk_object_get_data (GTK_OBJECT (widget
), "valid");
979 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
982 cancel_process
= FALSE
;
984 for (row
= gpiv
->first_selected_row
; row
<= gpiv
->last_selected_row
;
986 display_act
= gtk_clist_get_row_data (GTK_CLIST (gpiv
->clist_buf
),
989 ibuf
= display_act
->id
;
990 if (display
[ibuf
] != NULL
991 && display_act
->mwin
!= NULL
992 && GTK_WIDGET_VISIBLE (GTK_WIDGET (display_act
->mwin
)) ) {
993 gdk_window_show (GTK_WIDGET (display_act
->mwin
)->window
);
994 gdk_window_raise (GTK_WIDGET (display_act
->mwin
)->window
);
997 exec_uvhisto (valid
, GPIV_U
);
1005 on_button_valid_vhisto_enter (GtkWidget
* widget
,
1008 /*-----------------------------------------------------------------------------
1011 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
1012 gchar
*msg
= _("Calculates a histogram of vertical displacements.");
1013 gnome_appbar_set_status (GNOME_APPBAR (gpiv
->appbar
), msg
);
1019 on_button_valid_vhisto (GtkWidget
* widget
,
1022 /*-----------------------------------------------------------------------------
1025 PivValid
* valid
= gtk_object_get_data (GTK_OBJECT (widget
), "valid");
1026 GpivConsole
*gpiv
= gtk_object_get_data (GTK_OBJECT (widget
), "gpiv");
1029 cancel_process
= FALSE
;
1031 for (row
= gpiv
->first_selected_row
; row
<= gpiv
->last_selected_row
;
1033 display_act
= gtk_clist_get_row_data (GTK_CLIST (gpiv
->clist_buf
),
1036 ibuf
= display_act
->id
;
1037 if (display
[ibuf
] != NULL
1038 && display_act
->mwin
!= NULL
1039 && GTK_WIDGET_VISIBLE (GTK_WIDGET (display_act
->mwin
)) ) {
1040 gdk_window_show (GTK_WIDGET (display_act
->mwin
)->window
);
1041 gdk_window_raise (GTK_WIDGET (display_act
->mwin
)->window
);
1044 exec_uvhisto (valid
, GPIV_V
);