1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8 c-style: "K&R" -*- */
4 /*----------------------------------------------------------------------
6 gpiv - Graphic program for Particle Image Velocimetry, based on gtk/gnome
9 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
10 Gerber van der Graaf <gerber_graaf@users.sourceforge.net>
12 This file is part of gpiv.
14 Gpiv is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2, or (at your option)
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 ----------------------------------------------------------------------*/
31 * $Log: console_interface.c,v $
32 * Revision 1.20 2007-12-19 08:42:35 gerber
35 * Revision 1.19 2007-11-23 16:24:07 gerber
36 * release 0.5.0: Kafka
38 * Revision 1.18 2007-06-06 17:00:48 gerber
39 * Retreives images/data from URI using Gnome Virtual File System.
41 * Revision 1.17 2007-03-22 16:00:32 gerber
42 * Added image processing tabulator
44 * Revision 1.16 2007-02-16 17:09:48 gerber
45 * added Gauss weighting on I.A. and SPOF filtering (on correlation function)
47 * Revision 1.15 2007-01-29 11:27:43 gerber
48 * added image formats png, gif, tif png, bmp, improved buffer display
50 * Revision 1.14 2006-09-18 07:27:05 gerber
51 * *** empty log message ***
53 * Revision 1.13 2006/01/31 14:28:11 gerber
56 * Revision 1.11 2005/03/05 17:38:51 gerber
57 * repaired documantation and About
59 * Revision 1.10 2005/02/12 14:12:12 gerber
60 * Changed tabular names and titles
62 * Revision 1.9 2005/01/19 15:53:41 gerber
63 * Initiation of Data Acquisition (DAC); trigerring of lasers and camera
64 * by using RTAI and Realtime Linux, recording images from IEEE1394
65 * (Firewire) IIDC compliant camera's
67 * Revision 1.8 2004/06/14 21:19:23 gerber
68 * Image depth up to 16 bits.
69 * Improvement "single int" and "drag int" in Eval tab.
70 * Viewer's pop-up menu.
71 * Adaption for gpiv_matrix_* and gpiv_vector_*.
73 * See Changelog for further info.
75 * Revision 1.7 2003/09/04 13:31:55 gerber
76 * init of printing (unfinished)
78 * Revision 1.6 2003/09/01 11:17:14 gerber
79 * improved monitoring of interrogation process
81 * Revision 1.5 2003/08/22 15:24:52 gerber
82 * interactive spatial scaling
84 * Revision 1.4 2003/07/20 18:16:37 gerber
87 * Revision 1.3 2003/07/05 13:14:57 gerber
88 * drag and drop of a _series_ of filenames from NAUTILUS
90 * Revision 1.2 2003/06/27 13:47:26 gerber
91 * display ruler, line/point evaluation
93 * Revision 1.1.1.1 2003/06/17 17:10:52 gerber
102 #include "gpiv_gui.h"
104 #include "console_interface.h"
105 #include "console_menus.h"
108 #endif /* ENABLE_CAM */
110 #include "dac_trig.h"
111 #endif /* ENABLE_TRIG */
112 #ifdef ENABLE_IMGPROC
114 #endif /* ENABLE_IMGPROC */
117 #include "pivvalid.h"
124 create_menu_gpiv_popup(GpivConsole
*gpiv
126 /*-----------------------------------------------------------------------------
129 GnomeApp
*console
= gpiv
->console
;
130 GtkWidget
*menu_gpiv_popup
= NULL
;
132 menu_gpiv_popup
= gtk_menu_new();
133 gtk_object_set_data (GTK_OBJECT (console
),
136 gnome_app_fill_menu (GTK_MENU_SHELL (menu_gpiv_popup
),
142 gtk_widget_ref (menubar_gpiv_popup
[0].widget
);
143 gtk_object_set_data_full (GTK_OBJECT (console
),
145 menubar_gpiv_popup
[0].widget
,
146 (GtkDestroyNotify
) gtk_widget_unref
);
149 gtk_widget_ref (menubar_gpiv_popup
[1].widget
);
150 gtk_object_set_data_full (GTK_OBJECT (console
),
152 menubar_gpiv_popup
[1].widget
,
153 (GtkDestroyNotify
) gtk_widget_unref
);
156 gtk_widget_ref (menubar_gpiv_popup
[2].widget
);
157 gtk_object_set_data_full (GTK_OBJECT (console
),
159 menubar_gpiv_popup
[2].widget
,
160 (GtkDestroyNotify
) gtk_widget_unref
);
162 gtk_widget_ref (help_menu_gpiv_popup
[0].widget
);
163 gtk_object_set_data_full (GTK_OBJECT (console
),
165 help_menu_gpiv_popup
[0].widget
,
166 (GtkDestroyNotify
) gtk_widget_unref
);
167 gtk_object_set_data (GTK_OBJECT (help_menu_gpiv_popup
[0].widget
),
170 gtk_object_set_data (GTK_OBJECT (gpiv
->console
),
171 "help_menu_gpiv_popup0",
172 help_menu_gpiv_popup
[0].widget
);
176 gtk_widget_ref (file_menu_gpiv_popup
[0].widget
);
177 gtk_object_set_data (GTK_OBJECT (file_menu_gpiv_popup
[0].widget
),
183 gtk_widget_ref (file_menu_gpiv_popup
[1].widget
);
184 gtk_object_set_data (GTK_OBJECT (file_menu_gpiv_popup
[1].widget
),
190 gtk_widget_ref (file_menu_gpiv_popup
[2].widget
);
191 gtk_object_set_data (GTK_OBJECT (file_menu_gpiv_popup
[2].widget
),
197 gtk_widget_ref (file_menu_gpiv_popup
[3].widget
);
198 gtk_object_set_data (GTK_OBJECT (file_menu_gpiv_popup
[3].widget
),
204 gtk_widget_ref (file_menu_gpiv_popup
[4].widget
);
205 gtk_object_set_data (GTK_OBJECT (file_menu_gpiv_popup
[4].widget
),
211 gtk_widget_ref (file_menu_gpiv_popup
[5].widget
);
212 gtk_object_set_data (GTK_OBJECT (file_menu_gpiv_popup
[5].widget
),
218 gtk_widget_ref (settings_menu_gpiv_popup
[0].widget
);
219 gtk_object_set_data_full (GTK_OBJECT (console
),
221 settings_menu_gpiv_popup
[0].widget
,
222 (GtkDestroyNotify
) gtk_widget_unref
);
223 gtk_object_set_data (GTK_OBJECT (settings_menu_gpiv_popup
[0].widget
),
226 if (gpiv_par
->console__view_gpivbuttons
) {
227 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
228 (settings_menu_gpiv_popup
[0].
232 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
233 (settings_menu_gpiv_popup
[0].
240 gtk_widget_ref (settings_menu_gpiv_popup
[1].widget
);
241 gtk_object_set_data_full (GTK_OBJECT (console
),
243 settings_menu_gpiv_popup
[1].widget
,
244 (GtkDestroyNotify
) gtk_widget_unref
);
245 gtk_object_set_data (GTK_OBJECT (settings_menu_gpiv_popup
[1].widget
),
248 if (gpiv_par
->console__view_tabulator
) {
249 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
250 (settings_menu_gpiv_popup
[1].
254 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
255 (settings_menu_gpiv_popup
[1].
261 * settings_menu_gpiv_popup[2] represents NOMEUIINFO_SEPARATOR
264 gtk_widget_ref(settings_menu_gpiv_popup
[3].widget
);
265 gtk_object_set_data_full(GTK_OBJECT(console
),
267 settings_menu_gpiv_popup
[3].widget
,
268 (GtkDestroyNotify
) gtk_widget_unref
);
269 gtk_object_set_data(GTK_OBJECT(settings_menu_gpiv_popup
[3].widget
),
276 if (gpiv_par
->console__show_tooltips
) {
277 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
278 (help_menu_gpiv_popup
[0].
282 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
283 (help_menu_gpiv_popup
[0].
290 return menu_gpiv_popup
;
298 /*-----------------------------------------------------------------------------
301 GpivConsole
*gpiv
= g_new0 (GpivConsole
, 1);
302 GdkPixbuf
*logo
= NULL
;
305 gpiv
->tooltips
= gtk_tooltips_new ();
308 * Gnome2: from book Official dev.Guide
310 logo
= gdk_pixbuf_new_from_file(PIXMAPSDIR
"gpiv_logo.png", NULL
);
312 gpiv
->console
= g_object_new(GNOME_TYPE_APP
,
313 "title", "gpiv console",
315 "default-width", CONSOLE_WIDTH
,
316 "default-height", CONSOLE_HEIGHT
,
319 if (logo
!= NULL
) g_object_unref (logo
);
323 gtk_object_set_data (GTK_OBJECT (gpiv
->console
),
326 g_signal_connect (GTK_OBJECT (gpiv
->console
),
328 G_CALLBACK (delete_console
),
333 gpiv
->dock1
= GNOME_APP (gpiv
->console
)->dock
;
334 gtk_widget_ref (gpiv
->dock1
);
335 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
338 (GtkDestroyNotify
) gtk_widget_unref
);
339 gtk_widget_show (gpiv
->dock1
);
344 * Menu bar with gnome_app_create_menus
347 gnome_app_create_menus (GNOME_APP (gpiv
->console
),
351 gtk_widget_ref (menubar_gpiv
[0].widget
);
352 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
354 menubar_gpiv
[0].widget
,
355 (GtkDestroyNotify
) gtk_widget_unref
);
358 gtk_widget_ref (file_menu_gpiv
[0].widget
);
359 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
361 file_menu_gpiv
[0].widget
,
362 (GtkDestroyNotify
) gtk_widget_unref
);
363 gtk_object_set_data (GTK_OBJECT (file_menu_gpiv
[0].widget
),
368 gtk_widget_ref (file_menu_gpiv
[1].widget
);
369 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
371 file_menu_gpiv
[1].widget
,
372 (GtkDestroyNotify
) gtk_widget_unref
);
373 gtk_object_set_data (GTK_OBJECT (file_menu_gpiv
[1].widget
),
377 gtk_widget_ref (file_menu_gpiv
[2].widget
);
378 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
380 file_menu_gpiv
[2].widget
,
381 (GtkDestroyNotify
) gtk_widget_unref
);
382 gtk_object_set_data (GTK_OBJECT (file_menu_gpiv
[2].widget
),
387 gtk_widget_ref (file_menu_gpiv
[3].widget
);
388 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
390 file_menu_gpiv
[3].widget
,
391 (GtkDestroyNotify
) gtk_widget_unref
);
392 gtk_object_set_data (GTK_OBJECT (file_menu_gpiv
[3].widget
),
397 gtk_widget_ref (file_menu_gpiv
[4].widget
);
398 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
400 file_menu_gpiv
[4].widget
,
401 (GtkDestroyNotify
) gtk_widget_unref
);
402 gtk_object_set_data (GTK_OBJECT (file_menu_gpiv
[4].widget
),
407 gtk_widget_ref (file_menu_gpiv
[5].widget
);
408 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
410 file_menu_gpiv
[5].widget
,
411 (GtkDestroyNotify
) gtk_widget_unref
);
414 gtk_widget_ref (file_menu_gpiv
[6].widget
);
415 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
417 file_menu_gpiv
[6].widget
,
418 (GtkDestroyNotify
) gtk_widget_unref
);
421 gtk_widget_ref (menubar_gpiv
[1].widget
);
422 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
424 menubar_gpiv
[1].widget
,
425 (GtkDestroyNotify
) gtk_widget_unref
);
428 gtk_widget_ref (settings_menu_gpiv
[0].widget
);
429 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
431 settings_menu_gpiv
[0].widget
,
432 (GtkDestroyNotify
) gtk_widget_unref
);
433 gtk_object_set_data (GTK_OBJECT (settings_menu_gpiv
[0].widget
),
436 gtk_object_set_data (GTK_OBJECT (gpiv
->console
),
437 "settings_menu_gpiv0",
438 settings_menu_gpiv
[0].widget
);
441 gtk_widget_ref (settings_menu_gpiv
[1].widget
);
442 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
444 settings_menu_gpiv
[1].widget
,
445 (GtkDestroyNotify
) gtk_widget_unref
);
446 gtk_object_set_data (GTK_OBJECT (settings_menu_gpiv
[1].widget
),
449 gtk_object_set_data (GTK_OBJECT (gpiv
->console
),
450 "settings_menu_gpiv1",
451 settings_menu_gpiv
[1].widget
);
454 gtk_widget_ref (settings_menu_gpiv
[3].widget
);
455 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
457 settings_menu_gpiv
[3].widget
,
458 (GtkDestroyNotify
) gtk_widget_unref
);
459 gtk_object_set_data (GTK_OBJECT (settings_menu_gpiv
[3].widget
),
462 gtk_object_set_data (GTK_OBJECT (gpiv
->console
),
463 "settings_menu_gpiv3",
464 settings_menu_gpiv
[3].widget
);
467 gtk_widget_ref (menubar_gpiv
[2].widget
);
468 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
470 menubar_gpiv
[2].widget
,
471 (GtkDestroyNotify
) gtk_widget_unref
);
474 gtk_widget_ref (help_menu_gpiv
[0].widget
);
475 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
477 help_menu_gpiv
[0].widget
,
478 (GtkDestroyNotify
) gtk_widget_unref
);
479 gtk_object_set_data (GTK_OBJECT (help_menu_gpiv
[0].widget
),
482 gtk_object_set_data (GTK_OBJECT (gpiv
->console
),
484 help_menu_gpiv
[0].widget
);
487 gtk_widget_ref (help_menu_gpiv
[1].widget
);
488 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
490 help_menu_gpiv
[1].widget
,
491 (GtkDestroyNotify
) gtk_widget_unref
);
492 gtk_object_set_data (GTK_OBJECT (help_menu_gpiv
[1].widget
),
497 gtk_widget_ref (help_menu_gpiv
[2].widget
);
498 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
500 help_menu_gpiv
[2].widget
,
501 (GtkDestroyNotify
) gtk_widget_unref
);
502 gtk_object_set_data (GTK_OBJECT (help_menu_gpiv
[2].widget
),
511 /* gnome_app_create_toolbar (GNOME_APP (gpiv->console),
514 gpiv
->toolbar1
= gtk_toolbar_new ();
515 gtk_widget_show (gpiv
->toolbar1
);
516 gnome_app_add_toolbar (GNOME_APP (gpiv
->console
),
517 GTK_TOOLBAR (gpiv
->toolbar1
),
519 BONOBO_DOCK_ITEM_BEH_EXCLUSIVE
,
524 gtk_toolbar_set_style (GTK_TOOLBAR (gpiv
->toolbar1
),
526 gpiv
->tmp_toolbar_icon_size
= gtk_toolbar_get_icon_size (GTK_TOOLBAR
533 (GtkWidget
*) gtk_tool_button_new_from_stock ("gtk-open");
534 gtk_widget_show (gpiv
->button_open
);
535 gtk_container_add (GTK_CONTAINER (gpiv
->toolbar1
),
537 gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (gpiv
->button_open
),
539 _("Open a PIV image or data-file"), NULL
);
541 gtk_object_set_data (GTK_OBJECT (gpiv
->button_open
),
544 g_signal_connect ((gpointer
) gpiv
->button_open
,
546 G_CALLBACK (on_button_open_clicked
),
553 (GtkWidget
*) gtk_tool_button_new_from_stock ("gtk-save");
554 gtk_widget_show (gpiv
->button_save
);
555 gtk_container_add (GTK_CONTAINER (gpiv
->toolbar1
),
557 gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (gpiv
->button_save
),
559 _("Save data"), NULL
);
561 gtk_object_set_data (GTK_OBJECT (gpiv
->button_save
),
564 g_signal_connect (GTK_OBJECT (gpiv
->button_save
),
566 G_CALLBACK (on_save_activate
),
572 /* gpiv->button_print = */
573 /* (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-print"); */
574 /* gtk_widget_show (gpiv->button_print); */
575 /* gtk_container_add (GTK_CONTAINER (gpiv->toolbar1), */
576 /* gpiv->button_print); */
577 /* gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (gpiv->button_print), */
578 /* gpiv->tooltips, */
579 /* _("Print the displayed data of active buffer(s)"), */
582 /* gtk_object_set_data (GTK_OBJECT (gpiv->button_print), */
585 /* g_signal_connect (GTK_OBJECT (gpiv->button_print), */
587 /* G_CALLBACK (on_print_activate), */
589 /* gtk_widget_hide (GTK_WIDGET (gpiv->button_print)); */
594 gpiv
->button_execute
=
595 (GtkWidget
*) gtk_tool_button_new_from_stock ("gtk-execute");
596 gtk_widget_show (gpiv
->button_execute
);
597 gtk_container_add (GTK_CONTAINER (gpiv
->toolbar1
),
598 gpiv
->button_execute
);
599 gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (gpiv
->button_execute
),
601 _("Execute the enabled chain process(es)"),
604 gtk_object_set_data (GTK_OBJECT (gpiv
->button_execute
),
607 g_signal_connect (GTK_OBJECT (gpiv
->button_execute
),
609 G_CALLBACK (on_execute_activate
),
616 (GtkWidget
*) gtk_tool_button_new_from_stock ("gtk-stop");
617 gtk_widget_show (gpiv
->button_stop
);
618 gtk_container_add (GTK_CONTAINER (gpiv
->toolbar1
),
620 gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (gpiv
->button_stop
),
622 _("Cancels all running processes"), NULL
);
624 gtk_object_set_data (GTK_OBJECT (gpiv
->button_stop
),
627 g_signal_connect ((gpointer
) gpiv
->button_stop
, "clicked",
628 G_CALLBACK (on_button_stop_press
),
630 g_signal_connect (GTK_OBJECT (gpiv
->button_stop
),
631 "button_press_event",
632 G_CALLBACK (on_button_stop_press
),
634 g_signal_connect (GTK_OBJECT (gpiv
->button_stop
),
635 "button_release_event",
636 G_CALLBACK (on_button_stop_release
),
642 gpiv
->button_close
= (GtkWidget
*) gtk_tool_button_new_from_stock
644 gtk_widget_show (gpiv
->button_close
);
645 gtk_container_add (GTK_CONTAINER (gpiv
->toolbar1
),
647 gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (gpiv
->button_close
),
649 _("Close active buffer(s).\nA warning message will be issued for unsaved data"),
652 gtk_object_set_data (GTK_OBJECT (gpiv
->button_close
),
655 g_signal_connect (GTK_OBJECT (gpiv
->button_close
),
657 G_CALLBACK (on_close_activate
),
663 /* gpiv->vseparator = gtk_vseparator_new (); */
664 /* gtk_widget_show (gpiv->vseparator); */
665 /* gtk_container_add (GTK_CONTAINER (gpiv->toolbar1), gpiv->vseparator); */
667 /* gnome_app_add_docked (GNOME_APP (gpiv->console), */
668 /* GTK_CONTAINER (gpiv->toolbar1), */
669 /* gpiv->vseparator, */
671 /* BONOBO_DOCK_ITEM_BEH_NORMAL, */
672 /* BONOBO_DOCK_TOP, 2, 0, 0); */
678 (GtkWidget
*) gtk_tool_button_new_from_stock ("gtk-quit");
679 gtk_widget_show (gpiv
->button_exit
);
680 gtk_container_add (GTK_CONTAINER (gpiv
->toolbar1
),
682 gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (gpiv
->button_exit
),
684 _("Exit GPIV.\nA warning message will be issued for unsaved data"),
687 gtk_object_set_data (GTK_OBJECT (gpiv
->button_exit
),
690 g_signal_connect (GTK_OBJECT (gpiv
->button_exit
),
692 G_CALLBACK (on_exit_activate
),
696 * vbox_main contains handleboxes for toolbar, gpiv toolbar, tabulator
699 gpiv
->vbox_main
= gtk_vbox_new (FALSE
,
701 gtk_widget_ref (gpiv
->vbox_main
);
702 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
705 (GtkDestroyNotify
) gtk_widget_unref
);
706 gtk_widget_show (gpiv
->vbox_main
);
707 gnome_app_set_contents (GNOME_APP (gpiv
->console
),
713 * handlebox and toolbar for gpiv chain processes buttons
715 gpiv
->handlebox1
= gtk_handle_box_new ();
716 gtk_widget_ref (gpiv
->handlebox1
);
717 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
720 (GtkDestroyNotify
) gtk_widget_unref
);
721 gtk_box_pack_start (GTK_BOX (gpiv
->vbox_main
),
731 gpiv
->scrolledwindow_handbox1
= gtk_scrolled_window_new (NULL
,
733 gtk_widget_ref (gpiv
->scrolledwindow_handbox1
);
734 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
735 "scrolledwindow_handbox1",
736 gpiv
->scrolledwindow_handbox1
,
737 (GtkDestroyNotify
) gtk_widget_unref
);
738 gtk_widget_show (gpiv
->scrolledwindow_handbox1
);
739 gtk_container_add (GTK_CONTAINER (gpiv
->handlebox1
),
740 gpiv
->scrolledwindow_handbox1
);
741 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW
742 (gpiv
->scrolledwindow_handbox1
),
743 GTK_POLICY_AUTOMATIC
,
747 gpiv
->viewport_handbox1
=
748 gtk_viewport_new (NULL
,
750 gtk_widget_ref (gpiv
->viewport_handbox1
);
751 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
753 gpiv
->viewport_handbox1
,
754 (GtkDestroyNotify
) gtk_widget_unref
);
755 gtk_widget_show (gpiv
->viewport_handbox1
);
756 gtk_container_add (GTK_CONTAINER (gpiv
->scrolledwindow_handbox1
),
757 gpiv
->viewport_handbox1
);
758 gtk_widget_set_size_request (GTK_WIDGET (gpiv
->viewport_handbox1
),
764 * toolbar with buttons for enabling processes
769 gtk_widget_ref (gpiv
->toolbar2
);
770 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
773 (GtkDestroyNotify
) gtk_widget_unref
);
775 * BUGFIX: Gnome2: disable?
777 /* gtk_toolbar_set_space_style (GTK_TOOLBAR (gpiv->toolbar2), */
778 /* GTK_TOOLBAR_SPACE_LINE); */
779 gtk_widget_show (gpiv
->toolbar2
);
780 gtk_container_add (GTK_CONTAINER (gpiv
->viewport_handbox1
),
785 gpiv
->hbox_toolbar2
= gtk_hbox_new (FALSE
,
787 gtk_widget_ref (gpiv
->vbox_main
);
788 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
791 (GtkDestroyNotify
) gtk_widget_unref
);
792 gtk_widget_show (gpiv
->hbox_toolbar2
);
793 gtk_container_add (GTK_CONTAINER (gpiv
->toolbar2
),
794 gpiv
->hbox_toolbar2
);
800 * camera process button
802 gpiv
->button_toolbar_cam
= gtk_check_button_new_with_label(_("camera"));
803 gtk_widget_ref(gpiv
->button_toolbar_cam
);
804 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
805 "button_toolbar_cam",
806 gpiv
->button_toolbar_cam
,
807 (GtkDestroyNotify
) gtk_widget_unref
);
808 gtk_widget_show(gpiv
->button_toolbar_cam
);
809 gtk_box_pack_start(GTK_BOX(gpiv
->hbox_toolbar2
),
810 gpiv
->button_toolbar_cam
,
814 gtk_tooltips_set_tip(gpiv
->tooltips
,
815 gpiv
->button_toolbar_cam
,
816 _("Enables camera for image recording within the chain process. \n\
817 The process will be executed by clicking the Execute button"),
820 gtk_object_set_data(GTK_OBJECT(gpiv
->button_toolbar_cam
),
823 gtk_signal_connect(GTK_OBJECT(gpiv
->button_toolbar_cam
),
825 G_CALLBACK (on_button_dac_camstart_enter
),
827 gtk_signal_connect(GTK_OBJECT(gpiv
->button_toolbar_cam
),
829 G_CALLBACK (on_widget_leave
),
831 gtk_signal_connect(GTK_OBJECT(gpiv
->button_toolbar_cam
),
833 G_CALLBACK (on_toolbar_checkbutton_cam
),
835 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
836 (gpiv
->button_toolbar_cam
),
837 gpiv_par
->process__cam
);
839 #endif /* ENABLE_CAM */
844 * trigger process button
846 gpiv
->button_toolbar_trig
= gtk_check_button_new_with_label(_("trigger"));
847 gtk_widget_ref(gpiv
->button_toolbar_trig
);
848 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
849 "button_toolbar_trig",
850 gpiv
->button_toolbar_trig
,
851 (GtkDestroyNotify
) gtk_widget_unref
);
852 gtk_widget_show(gpiv
->button_toolbar_trig
);
853 gtk_box_pack_start(GTK_BOX(gpiv
->hbox_toolbar2
),
854 gpiv
->button_toolbar_trig
,
858 gtk_tooltips_set_tip(gpiv
->tooltips
,
859 gpiv
->button_toolbar_trig
,
860 _("Enables (RTAI) camera and laser triggering within the chain process. \n\
861 The process will be executed by clicking the Execute button"),
864 gtk_object_set_data(GTK_OBJECT(gpiv
->button_toolbar_trig
),
867 gtk_signal_connect(GTK_OBJECT(gpiv
->button_toolbar_trig
),
869 G_CALLBACK (on_button_dac_triggerstart_enter
),
871 gtk_signal_connect(GTK_OBJECT(gpiv
->button_toolbar_trig
),
873 G_CALLBACK (on_widget_leave
),
875 gtk_signal_connect(GTK_OBJECT(gpiv
->button_toolbar_trig
),
877 G_CALLBACK (on_toolbar_checkbutton_trig
),
879 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
880 (gpiv
->button_toolbar_trig
),
881 gpiv_par
->process__trig
);
883 #endif /* ENABLE_TRIG */
886 #ifdef ENABLE_IMGPROC
888 * Image processing button
890 gpiv
->button_toolbar_imgproc
= gtk_check_button_new_with_label(_("image"));
891 gtk_widget_ref(gpiv
->button_toolbar_imgproc
);
892 gtk_object_set_data_full(GTK_OBJECT(gpiv
->console
),
893 "button_toolbar_imgproc",
894 gpiv
->button_toolbar_imgproc
,
895 (GtkDestroyNotify
) gtk_widget_unref
);
896 gtk_widget_show(gpiv
->button_toolbar_imgproc
);
897 gtk_box_pack_start(GTK_BOX(gpiv
->hbox_toolbar2
),
898 gpiv
->button_toolbar_imgproc
,
902 gtk_tooltips_set_tip(gpiv
->tooltips
,
903 gpiv
->button_toolbar_imgproc
,
904 _("Enables image processing within the chain process. \n\
905 The process will be executed by clicking the Execute button"),
908 gtk_object_set_data(GTK_OBJECT(gpiv
->button_toolbar_imgproc
),
911 g_signal_connect(GTK_OBJECT(gpiv
->button_toolbar_imgproc
),
913 G_CALLBACK (on_button_imgproc_enter
),
915 g_signal_connect(GTK_OBJECT(gpiv
->button_toolbar_imgproc
),
917 G_CALLBACK (on_widget_leave
),
919 g_signal_connect(GTK_OBJECT(gpiv
->button_toolbar_imgproc
),
921 G_CALLBACK (on_toolbar_checkbutton_imgproc
),
923 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON
924 (gpiv
->button_toolbar_imgproc
),
925 gpiv_par
->process__imgproc
);
927 #endif /* ENABLE_IMGPROC */
931 gpiv
->button_toolbar_piv
= gtk_check_button_new_with_label ( _("piv"));
932 gtk_widget_ref (gpiv
->button_toolbar_piv
);
933 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
934 "button_toolbar_piv",
935 gpiv
->button_toolbar_piv
,
936 (GtkDestroyNotify
) gtk_widget_unref
);
937 gtk_widget_show (gpiv
->button_toolbar_piv
);
938 gtk_box_pack_start (GTK_BOX (gpiv
->hbox_toolbar2
),
939 gpiv
->button_toolbar_piv
,
943 gtk_tooltips_set_tip (gpiv
->tooltips
,
944 gpiv
->button_toolbar_piv
,
945 _("Enables PIV image interrogation for chain processing: analysing of a PIV image \
946 (pair), resulting into the mean displacements of the particle images within \
947 each interrogation area. \n\
948 The process will be executed by clicking the Execute button"),
951 gtk_object_set_data (GTK_OBJECT (gpiv
->button_toolbar_piv
),
954 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_piv
),
956 G_CALLBACK (on_button_piv_enter
),
958 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_piv
),
960 G_CALLBACK (on_widget_leave
),
962 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_piv
),
964 G_CALLBACK (on_toolbar_checkbutton_piv
),
966 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
967 (gpiv
->button_toolbar_piv
),
968 gpiv_par
->process__piv
);
972 gpiv
->button_toolbar_gradient
=
973 gtk_check_button_new_with_label ( _("gradient"));
974 gtk_widget_ref (gpiv
->button_toolbar_gradient
);
975 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
976 "button_toolbar_gradient",
977 gpiv
->button_toolbar_gradient
,
978 (GtkDestroyNotify
) gtk_widget_unref
);
979 gtk_widget_show (gpiv
->button_toolbar_gradient
);
980 gtk_box_pack_start (GTK_BOX (gpiv
->hbox_toolbar2
),
981 gpiv
->button_toolbar_gradient
,
985 gtk_tooltips_set_tip (gpiv
->tooltips
,
986 gpiv
->button_toolbar_gradient
,
987 _("Enables gradient for chain processing: Disables velocities with gradients larger than \
988 0.05 over the interrogation area. \
989 \nThe process will be executed by clicking the \"Execute\" button"),
992 gtk_object_set_data (GTK_OBJECT (gpiv
->button_toolbar_gradient
),
995 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_gradient
),
997 G_CALLBACK (on_button_valid_gradient_enter
),
999 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_gradient
),
1001 G_CALLBACK (on_widget_leave
),
1003 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_gradient
),
1005 G_CALLBACK (on_toolbar_checkbutton_gradient
),
1007 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1008 (gpiv
->button_toolbar_gradient
),
1009 gpiv_par
->process__gradient
);
1013 gpiv
->button_toolbar_resstats
= gtk_check_button_new_with_label ( _("residu"));
1014 gtk_widget_ref (gpiv
->button_toolbar_resstats
);
1015 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1016 "button_toolbar_resstats",
1017 gpiv
->button_toolbar_resstats
,
1018 (GtkDestroyNotify
) gtk_widget_unref
);
1019 gtk_widget_show (gpiv
->button_toolbar_resstats
);
1020 gtk_box_pack_start (GTK_BOX (gpiv
->hbox_toolbar2
),
1021 gpiv
->button_toolbar_resstats
,
1025 gtk_tooltips_set_tip (gpiv
->tooltips
,
1026 gpiv
->button_toolbar_resstats
,
1027 _("Enables residu statistics for chain processing: calculates \
1028 the residus of displacements for detection of outliers and shows an histogram \
1029 of them. The histogram will be displayed in the Piv Validation tab. \n\
1030 The process will be executed by clicking the Execute button"),
1033 gtk_object_set_data (GTK_OBJECT (gpiv
->button_toolbar_resstats
),
1036 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_resstats
),
1038 G_CALLBACK (on_button_valid_errvec_resstats_enter
),
1040 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_resstats
),
1042 G_CALLBACK (on_widget_leave
),
1044 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_resstats
),
1046 G_CALLBACK (on_toolbar_checkbutton_resstats
),
1048 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1049 (gpiv
->button_toolbar_resstats
),
1050 gpiv_par
->process__resstats
);
1054 gpiv
->button_toolbar_errvec
= gtk_check_button_new_with_label
1056 gtk_widget_ref (gpiv
->button_toolbar_errvec
);
1057 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1058 "button_toolbar_errvec",
1059 gpiv
->button_toolbar_errvec
,
1060 (GtkDestroyNotify
) gtk_widget_unref
);
1061 gtk_widget_show (gpiv
->button_toolbar_errvec
);
1062 gtk_box_pack_start (GTK_BOX (gpiv
->hbox_toolbar2
),
1063 gpiv
->button_toolbar_errvec
,
1067 gtk_tooltips_set_tip (gpiv
->tooltips
,
1068 gpiv
->button_toolbar_errvec
,
1069 _("Enables validation for chain processing: detects \
1070 outliers of PIV data by testing on median residu or by Signal to Noise \
1071 Ratio magnitudes and, eventually, substitutes. \n\
1072 The process will be executed by clicking the Execute button"),
1075 gtk_object_set_data (GTK_OBJECT (gpiv
->button_toolbar_errvec
),
1078 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_errvec
),
1080 G_CALLBACK (on_button_valid_errvec_enter
),
1082 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_errvec
),
1084 G_CALLBACK (on_widget_leave
), NULL
);
1085 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_errvec
),
1087 G_CALLBACK (on_toolbar_checkbutton_errvec
),
1089 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1090 (gpiv
->button_toolbar_errvec
),
1091 gpiv_par
->process__errvec
);
1095 gpiv
->button_toolbar_peaklock
=
1096 gtk_check_button_new_with_label ( _("sub-pixel"));
1097 gtk_widget_ref (gpiv
->button_toolbar_peaklock
);
1098 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1099 "button_toolbar_peaklock",
1100 gpiv
->button_toolbar_peaklock
,
1101 (GtkDestroyNotify
) gtk_widget_unref
);
1102 gtk_widget_show (gpiv
->button_toolbar_peaklock
);
1103 gtk_box_pack_start (GTK_BOX (gpiv
->hbox_toolbar2
),
1104 gpiv
->button_toolbar_peaklock
,
1108 gtk_tooltips_set_tip (gpiv
->tooltips
,
1109 gpiv
->button_toolbar_peaklock
,
1110 _("Enables peak-lock for chain processing: shows an histogram \
1111 of sub-pixel displacements to check on peak-locking effects. \
1112 The histogram will be displayed in the Piv Validation tab. \n\
1113 The process will be executed by clicking the \"Execute\" button"),
1116 gtk_object_set_data (GTK_OBJECT (gpiv
->button_toolbar_peaklock
),
1119 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_peaklock
),
1121 G_CALLBACK (on_button_valid_peaklck_enter
),
1123 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_peaklock
),
1125 G_CALLBACK (on_widget_leave
),
1127 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_peaklock
),
1129 G_CALLBACK (on_toolbar_checkbutton_peaklck
),
1131 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1132 (gpiv
->button_toolbar_peaklock
),
1133 gpiv_par
->process__peaklock
);
1136 gpiv
->button_toolbar_scale
=
1137 gtk_check_button_new_with_label ( _("scale"));
1138 gtk_widget_ref (gpiv
->button_toolbar_scale
);
1139 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1140 "button_toolbar_scale",
1141 gpiv
->button_toolbar_scale
,
1142 (GtkDestroyNotify
) gtk_widget_unref
);
1143 gtk_widget_show (gpiv
->button_toolbar_scale
);
1144 gtk_box_pack_start (GTK_BOX (gpiv
->hbox_toolbar2
),
1145 gpiv
->button_toolbar_scale
, FALSE
,
1148 gtk_tooltips_set_tip (gpiv
->tooltips
,
1149 gpiv
->button_toolbar_scale
,
1150 _("Enables scaling for chain processing: scales spatial displacements \
1152 \nThe process will be executed by clicking the \"Execute\" button"),
1155 gtk_object_set_data (GTK_OBJECT (gpiv
->button_toolbar_scale
),
1158 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_scale
),
1160 G_CALLBACK (on_button_post_scale_enter
),
1162 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_scale
),
1164 G_CALLBACK (on_widget_leave
),
1166 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_scale
),
1168 G_CALLBACK (on_toolbar_checkbutton_scale
),
1170 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1171 (gpiv
->button_toolbar_scale
),
1172 gpiv_par
->process__scale
);
1175 gpiv
->button_toolbar_average
=
1176 gtk_check_button_new_with_label ( _("average"));
1177 gtk_widget_ref (gpiv
->button_toolbar_average
);
1178 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1179 "button_toolbar_average",
1180 gpiv
->button_toolbar_average
,
1181 (GtkDestroyNotify
) gtk_widget_unref
);
1182 gtk_widget_show (gpiv
->button_toolbar_average
);
1183 gtk_box_pack_start (GTK_BOX (gpiv
->hbox_toolbar2
),
1184 gpiv
->button_toolbar_average
, FALSE
,
1187 gtk_tooltips_set_tip (gpiv
->tooltips
,
1188 gpiv
->button_toolbar_average
,
1189 _("Enables average for chain processing: Calculates spatial average displacements \
1191 \nThe process will be executed by clicking the \"Execute\" button"),
1194 gtk_object_set_data (GTK_OBJECT (gpiv
->button_toolbar_average
),
1197 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_average
),
1199 G_CALLBACK (on_button_post_savg_enter
),
1201 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_average
),
1203 G_CALLBACK (on_widget_leave
),
1205 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_average
),
1207 G_CALLBACK (on_toolbar_checkbutton_average
),
1209 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1210 (gpiv
->button_toolbar_average
),
1211 gpiv_par
->process__average
);
1214 gpiv
->button_toolbar_subavg
=
1215 gtk_check_button_new_with_label ( _("subtract"));
1216 gtk_widget_ref (gpiv
->button_toolbar_subavg
);
1217 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1218 "button_toolbar_subavg",
1219 gpiv
->button_toolbar_subavg
,
1220 (GtkDestroyNotify
) gtk_widget_unref
);
1221 gtk_widget_show (gpiv
->button_toolbar_subavg
);
1222 gtk_box_pack_start (GTK_BOX (gpiv
->hbox_toolbar2
),
1223 gpiv
->button_toolbar_subavg
,
1227 gtk_tooltips_set_tip (gpiv
->tooltips
,
1228 gpiv
->button_toolbar_subavg
,
1229 _("Enables subtract for chain processing: subtracts spatial average displacements \
1231 \nThe process will be executed by clicking the \"Execute\" button"),
1234 gtk_object_set_data (GTK_OBJECT (gpiv
->button_toolbar_subavg
),
1237 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_subavg
),
1239 G_CALLBACK (on_button_post_subavg_enter
),
1241 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_subavg
),
1243 G_CALLBACK (on_widget_leave
),
1245 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_subavg
),
1247 G_CALLBACK (on_toolbar_checkbutton_subavg
),
1249 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1250 (gpiv
->button_toolbar_subavg
),
1251 gpiv_par
->process__subtract
);
1254 gpiv
->button_toolbar_vorstra
=
1255 gtk_check_button_new_with_label ( _("vorticity"));
1256 gtk_widget_ref (gpiv
->button_toolbar_vorstra
);
1257 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1258 "button_toolbar_vorstra",
1259 gpiv
->button_toolbar_vorstra
,
1260 (GtkDestroyNotify
) gtk_widget_unref
);
1261 gtk_widget_show (gpiv
->button_toolbar_vorstra
);
1262 gtk_box_pack_start (GTK_BOX (gpiv
->hbox_toolbar2
),
1263 gpiv
->button_toolbar_vorstra
,
1267 gtk_tooltips_set_tip (gpiv
->tooltips
,
1268 gpiv
->button_toolbar_vorstra
,
1269 _("Enables vorticity for chain processing: calculates \
1270 vorticity or strain magnitudes from a velocity field.\n\
1271 The process will be executed by clicking the Execute button"),
1274 gtk_object_set_data (GTK_OBJECT (gpiv
->button_toolbar_vorstra
),
1277 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_vorstra
),
1279 G_CALLBACK (on_button_post_vorstra_enter
),
1281 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_vorstra
),
1283 G_CALLBACK (on_widget_leave
),
1285 g_signal_connect (GTK_OBJECT (gpiv
->button_toolbar_vorstra
),
1287 G_CALLBACK (on_toolbar_checkbutton_vorstra
),
1289 gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON
1290 (gpiv
->button_toolbar_vorstra
),
1291 gpiv_par
->process__vorstra
);
1296 * gpiv->hbox_main contains a handlebox with buffer list and tabulator
1298 gpiv
->hbox_main
= gtk_hbox_new (FALSE
,
1300 gtk_widget_ref (gpiv
->hbox_main
);
1301 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1304 (GtkDestroyNotify
) gtk_widget_unref
);
1305 gtk_widget_show (gpiv
->hbox_main
);
1306 gtk_box_pack_start (GTK_BOX (gpiv
->vbox_main
),
1314 * Notebook (tabulator)
1316 gpiv
->notebook
= gtk_notebook_new ();
1317 gtk_widget_ref (gpiv
->notebook
);
1318 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1321 (GtkDestroyNotify
) gtk_widget_unref
);
1322 gtk_widget_show (gpiv
->notebook
);
1323 gtk_box_pack_start (GTK_BOX (gpiv
->hbox_main
),
1332 * Tabulator for Data Acquisition
1334 gpiv
->dac
= create_dac (GNOME_APP(gpiv
->console
),
1337 gpiv
->tablabel_dac
= gtk_label_new ( _("Record"));
1338 gtk_widget_ref (gpiv
->tablabel_dac
);
1339 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1342 (GtkDestroyNotify
) gtk_widget_unref
);
1343 gtk_widget_show (gpiv
->tablabel_dac
);
1344 gtk_notebook_set_tab_label
1345 (GTK_NOTEBOOK (gpiv
->notebook
),
1346 GTK_WIDGET (gtk_notebook_get_nth_page (GTK_NOTEBOOK
1349 GTK_WIDGET(gpiv
->tablabel_dac
));
1350 #endif /* ENABLE_DAC */
1353 * Tabulator for Image header
1355 gpiv
->imgh
= create_imgh (GNOME_APP(gpiv
->console
),
1358 gpiv
->tablabel_imgh
= gtk_label_new ( _("Image"));
1359 gtk_widget_ref (gpiv
->tablabel_imgh
);
1360 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1362 gpiv
->tablabel_imgh
,
1363 (GtkDestroyNotify
) gtk_widget_unref
);
1364 gtk_widget_show (gpiv
->tablabel_imgh
);
1365 gtk_notebook_set_tab_label
1366 (GTK_NOTEBOOK (gpiv
->notebook
),
1367 GTK_WIDGET (gtk_notebook_get_nth_page (GTK_NOTEBOOK
1370 GTK_WIDGET (gpiv
->tablabel_imgh
));
1374 gtk_object_set_data (GTK_OBJECT (gpiv
->imgh
->radiobutton_mouse_1
),
1379 #ifdef ENABLE_IMGPROC
1381 * Tabulator for Image processing
1383 gpiv
->imgproc
= create_imgproc (GNOME_APP(gpiv
->console
),
1386 gpiv
->tablabel_imgproc
= gtk_label_new ( _("Process"));
1387 gtk_widget_ref (gpiv
->tablabel_imgproc
);
1388 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1390 gpiv
->tablabel_imgproc
,
1391 (GtkDestroyNotify
) gtk_widget_unref
);
1392 gtk_widget_show (gpiv
->tablabel_imgproc
);
1393 gtk_notebook_set_tab_label
1394 (GTK_NOTEBOOK (gpiv
->notebook
),
1395 GTK_WIDGET (gtk_notebook_get_nth_page (GTK_NOTEBOOK
1398 GTK_WIDGET (gpiv
->tablabel_imgproc
));
1401 for (i
= 0; i
< IMG_FILTERS
; i
++) {
1402 gtk_object_set_data (GTK_OBJECT (gpiv
->imgproc
->imf_inf
[i
]->button_filter
),
1407 gtk_object_set_data (GTK_OBJECT (gpiv
->imgproc
->button
),
1414 * Tabulator for Interrogation
1416 gpiv
->piveval
= create_piveval (GNOME_APP(gpiv
->console
),
1418 gpiv
->tablabel_piveval
= gtk_label_new ( _("Interrogate"));
1419 gtk_widget_ref (gpiv
->tablabel_piveval
);
1420 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1422 gpiv
->tablabel_piveval
,
1423 (GtkDestroyNotify
) gtk_widget_unref
);
1424 gtk_widget_show (gpiv
->tablabel_piveval
);
1425 gtk_notebook_set_tab_label
1426 (GTK_NOTEBOOK (gpiv
->notebook
),
1427 GTK_WIDGET (gtk_notebook_get_nth_page (GTK_NOTEBOOK
1430 GTK_WIDGET (gpiv
->tablabel_piveval
));
1434 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_mouse_0
),
1437 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_mouse_1
),
1440 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_mouse_2
),
1443 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_mouse_3
),
1446 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_mouse_4
),
1449 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_mouse_5
),
1452 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_mouse_6
),
1455 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->checkbutton_monitor
),
1458 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_fit_none
),
1461 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_fit_gauss
),
1464 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_fit_power
),
1467 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_fit_gravity
),
1470 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_peak_1
),
1473 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_peak_2
),
1476 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_peak_3
),
1479 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_weightkernel
),
1482 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_zerooff
),
1485 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_centraldiff
),
1488 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->radiobutton_imgdeform
),
1491 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->checkbutton_weight_ia
),
1494 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->checkbutton_spof
),
1497 /* gtk_object_set_data (GTK_OBJECT (gpiv->piveval->spinbutton_monitor_zoom), */
1500 /* gtk_object_set_data (GTK_OBJECT (gpiv->piveval->spinbutton_monitor_vectorscale), */
1503 gtk_object_set_data (GTK_OBJECT (gpiv
->piveval
->button
),
1509 * Tabulator for PIV-data validation
1511 gpiv
->pivvalid
= create_pivvalid (GNOME_APP(gpiv
->console
),
1514 gpiv
->tablabel_pivvalid
= gtk_label_new ( _("Validate"));
1515 gtk_widget_ref (gpiv
->tablabel_pivvalid
);
1516 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1517 "tablabel_pivvalid",
1518 gpiv
->tablabel_pivvalid
,
1519 (GtkDestroyNotify
) gtk_widget_unref
);
1520 gtk_widget_show (gpiv
->tablabel_pivvalid
);
1521 gtk_notebook_set_tab_label
1522 (GTK_NOTEBOOK (gpiv
->notebook
),
1523 GTK_WIDGET (gtk_notebook_get_nth_page (GTK_NOTEBOOK
1526 GTK_WIDGET (gpiv
->tablabel_pivvalid
));
1530 gtk_object_set_data (GTK_OBJECT (gpiv
->pivvalid
->button_gradient
),
1533 gtk_object_set_data (GTK_OBJECT (gpiv
->pivvalid
->radiobutton_disable_0
),
1536 gtk_object_set_data (GTK_OBJECT (gpiv
->pivvalid
->radiobutton_disable_1
),
1539 gtk_object_set_data (GTK_OBJECT (gpiv
->pivvalid
->radiobutton_disable_2
),
1542 gtk_object_set_data (GTK_OBJECT (gpiv
->pivvalid
->radiobutton_disable_3
),
1545 gtk_object_set_data (GTK_OBJECT (gpiv
->pivvalid
->radiobutton_disable_4
),
1548 gtk_object_set_data (GTK_OBJECT (gpiv
->pivvalid
->button_gradient
),
1551 gtk_object_set_data (GTK_OBJECT (gpiv
->pivvalid
->button_errvec_resstats
),
1554 gtk_object_set_data (GTK_OBJECT (gpiv
->pivvalid
->button_peaklck
),
1557 gtk_object_set_data (GTK_OBJECT (gpiv
->pivvalid
->button_uhisto
),
1560 gtk_object_set_data (GTK_OBJECT (gpiv
->pivvalid
->button_vhisto
),
1563 gtk_object_set_data (GTK_OBJECT
1564 (gpiv
->pivvalid
->radiobutton_errvec_residu_snr
),
1567 gtk_object_set_data (GTK_OBJECT
1568 (gpiv
->pivvalid
->radiobutton_errvec_residu_median
),
1571 gtk_object_set_data (GTK_OBJECT
1572 (gpiv
->pivvalid
->radiobutton_errvec_residu_normmedian
),
1575 gtk_object_set_data (GTK_OBJECT
1576 (gpiv
->pivvalid
->checkbutton_errvec_disres
),
1579 gtk_object_set_data (GTK_OBJECT
1580 (gpiv
->pivvalid
->radiobutton_errvec_subst_0
),
1583 gtk_object_set_data (GTK_OBJECT
1584 (gpiv
->pivvalid
->radiobutton_errvec_subst_1
),
1587 gtk_object_set_data (GTK_OBJECT
1588 (gpiv
->pivvalid
->radiobutton_errvec_subst_2
),
1591 gtk_object_set_data (GTK_OBJECT
1592 (gpiv
->pivvalid
->radiobutton_errvec_subst_3
),
1595 gtk_object_set_data (GTK_OBJECT
1596 (gpiv
->pivvalid
->button_errvec
),
1601 * Tabulator for PIV-data post-processing
1604 /* pivpost->checkbutton_scale */
1605 gpiv
->pivpost
= create_pivpost (GNOME_APP(gpiv
->console
),
1607 /* gtk_object_set_data (GTK_OBJECT (gpiv->console), */
1611 gpiv
->tablabel_pivpost
= gtk_label_new ( _("Post process"));
1612 gtk_widget_ref (gpiv
->tablabel_pivpost
);
1613 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1615 gpiv
->tablabel_pivpost
,
1616 (GtkDestroyNotify
) gtk_widget_unref
);
1617 gtk_widget_show (gpiv
->tablabel_pivpost
);
1618 gtk_notebook_set_tab_label
1619 (GTK_NOTEBOOK (gpiv
->notebook
),
1620 GTK_WIDGET (gtk_notebook_get_nth_page (GTK_NOTEBOOK
1623 GTK_WIDGET (gpiv
->tablabel_pivpost
));
1627 gtk_object_set_data (GTK_OBJECT (gpiv
->pivpost
->button_scale
),
1630 gtk_object_set_data (GTK_OBJECT (gpiv
->pivpost
->button_savg
),
1633 gtk_object_set_data (GTK_OBJECT (gpiv
->pivpost
->button_subavg
),
1636 gtk_object_set_data (GTK_OBJECT (gpiv
->pivpost
->
1637 radiobutton_vorstra_output_1
),
1640 gtk_object_set_data (GTK_OBJECT (gpiv
->pivpost
->
1641 radiobutton_vorstra_output_2
),
1644 gtk_object_set_data (GTK_OBJECT (gpiv
->pivpost
->
1645 radiobutton_vorstra_output_3
),
1648 gtk_object_set_data (GTK_OBJECT (gpiv
->pivpost
->
1649 radiobutton_vorstra_diffscheme_1
),
1652 gtk_object_set_data (GTK_OBJECT (gpiv
->pivpost
->
1653 radiobutton_vorstra_diffscheme_2
),
1656 gtk_object_set_data (GTK_OBJECT (gpiv
->pivpost
->
1657 radiobutton_vorstra_diffscheme_3
),
1660 gtk_object_set_data (GTK_OBJECT (gpiv
->pivpost
->
1661 radiobutton_vorstra_diffscheme_4
),
1664 gtk_object_set_data (GTK_OBJECT (gpiv
->pivpost
->button_vorstra
),
1669 g_signal_connect (GTK_OBJECT (gpiv
->notebook
),
1671 G_CALLBACK (on_notebook_switch_page
),
1673 gtk_notebook_set_page (GTK_NOTEBOOK (gpiv
->notebook
),
1677 * handlebox of buffer list
1679 gpiv
->handlebox_buf
= gtk_handle_box_new ();
1680 gtk_widget_ref (gpiv
->handlebox_buf
);
1681 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1683 gpiv
->handlebox_buf
,
1684 (GtkDestroyNotify
) gtk_widget_unref
);
1685 gtk_widget_show (gpiv
->handlebox_buf
);
1686 gtk_box_pack_start (GTK_BOX (gpiv
->hbox_main
),
1687 gpiv
->handlebox_buf
,
1691 gtk_handle_box_set_handle_position (GTK_HANDLE_BOX (gpiv
->handlebox_buf
),
1693 gtk_tooltips_set_tip (gpiv
->tooltips
,
1694 gpiv
->handlebox_buf
,
1695 _("buffer names and numbers"),
1699 gpiv
->alignment_buf
= gtk_alignment_new (0.0,
1703 gtk_widget_ref (gpiv
->alignment_buf
);
1704 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1706 gpiv
->alignment_buf
,
1707 (GtkDestroyNotify
) gtk_widget_unref
);
1708 gtk_widget_show (gpiv
->alignment_buf
);
1709 gtk_container_add (GTK_CONTAINER (gpiv
->handlebox_buf
),
1710 gpiv
->alignment_buf
);
1713 gpiv
->eventbox_buf
= gtk_event_box_new ();
1714 gtk_widget_ref (gpiv
->eventbox_buf
);
1715 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1716 "gpiv->eventbox_buf",
1718 (GtkDestroyNotify
) gtk_widget_unref
);
1719 gtk_widget_show (gpiv
->eventbox_buf
);
1720 gtk_container_add (GTK_CONTAINER (gpiv
->alignment_buf
),
1721 gpiv
->eventbox_buf
);
1724 gpiv
->scrolledwindow_buf
= gtk_scrolled_window_new (NULL
,
1726 gtk_widget_ref (gpiv
->scrolledwindow_buf
);
1727 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1728 "scrolledwindow_buf",
1729 gpiv
->scrolledwindow_buf
,
1730 (GtkDestroyNotify
) gtk_widget_unref
);
1731 gtk_widget_show (gpiv
->scrolledwindow_buf
);
1732 gtk_container_add (GTK_CONTAINER (gpiv
->eventbox_buf
),
1733 gpiv
->scrolledwindow_buf
);
1734 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW
1735 (gpiv
->scrolledwindow_buf
),
1736 /* GTK_POLICY_NEVER */
1737 GTK_POLICY_AUTOMATIC
,
1738 GTK_POLICY_AUTOMATIC
);
1739 /* gpiv->scrolledwindow_buf_adj = gtk_adjustment_new (0.0, 500.0, 100.0, 5.0, 50.0, 2500.0); */
1740 /* gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (gpiv->scrolledwindow_buf), */
1741 /* GTK_ADJUSTMENT (gpiv->scrolledwindow_buf_adj)); */
1742 /* gnome_canvas_set_scroll_region ( GNOME_CANVAS (canvas_display ()->display_act->gpd.display), */
1743 /* 0.0, 0.0, IMAGE_WIDTH, IMAGE_HEIGHT); */
1746 gpiv
->viewport_buf
=
1747 gtk_viewport_new (NULL
,
1749 gtk_widget_ref (gpiv
->viewport_buf
);
1750 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1753 (GtkDestroyNotify
) gtk_widget_unref
);
1754 gtk_widget_show (gpiv
->viewport_buf
);
1755 gtk_container_add (GTK_CONTAINER (gpiv
->scrolledwindow_buf
),
1756 gpiv
->viewport_buf
);
1757 gtk_widget_set_size_request (gpiv
->viewport_buf
,
1774 gtk_treelist_store_new (N_COLUMNS
, /* Total number of columns */
1775 G_TYPE_INT
, /* Buffer number */
1776 G_TYPE_STRING
, /* Buffer name */
1777 G_TYPE_BOOLEAN
, /* PIV data? */
1778 G_TYPE_BOOLEAN
, /* Validated PIV data? */
1779 G_TYPE_BOOLEAN
, /* Stored PIV data? */
1783 gpiv
->clist_buf
= gtk_clist_new (2);
1784 gtk_widget_ref (gpiv
->clist_buf
);
1785 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1788 (GtkDestroyNotify
) gtk_widget_unref
);
1789 gtk_widget_show (gpiv
->clist_buf
);
1790 gtk_container_add (GTK_CONTAINER (gpiv
->viewport_buf
/* scrolledwindow_buf */ ),
1792 gtk_tooltips_set_tip (gpiv
->tooltips
, gpiv
->clist_buf
,
1795 gtk_clist_set_column_width (GTK_CLIST (gpiv
->clist_buf
),
1798 gtk_clist_set_column_width (GTK_CLIST (gpiv
->clist_buf
),
1801 gtk_clist_set_selection_mode (GTK_CLIST (gpiv
->clist_buf
),
1802 GTK_SELECTION_EXTENDED
/* MULTIPLE */);
1803 gtk_clist_column_titles_show (GTK_CLIST (gpiv
->clist_buf
));
1805 gtk_object_set_data (GTK_OBJECT (gpiv
->clist_buf
),
1808 g_signal_connect (GTK_OBJECT (gpiv
->clist_buf
),
1810 G_CALLBACK (on_clist_buf_rowselect
),
1814 gpiv
->label_buf_1
= gtk_label_new ( _("#"));
1815 gtk_widget_ref (gpiv
->label_buf_1
);
1816 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1819 (GtkDestroyNotify
) gtk_widget_unref
);
1820 gtk_widget_show (gpiv
->label_buf_1
);
1821 gtk_clist_set_column_widget (GTK_CLIST (gpiv
->clist_buf
),
1826 gpiv
->label_buf_2
= gtk_label_new ( _("buffer name"));
1827 gtk_widget_ref (gpiv
->label_buf_2
);
1828 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1831 (GtkDestroyNotify
) gtk_widget_unref
);
1832 gtk_widget_show (gpiv
->label_buf_2
);
1833 gtk_clist_set_column_widget (GTK_CLIST (gpiv
->clist_buf
),
1836 gtk_misc_set_alignment (GTK_MISC (gpiv
->label_buf_2
),
1839 gtk_clist_column_titles_passive (GTK_CLIST (gpiv
->clist_buf
));
1840 /* gtk_clist_set_policy (GTK_CLIST (gpiv->clist_buf), */
1841 /* GTK_POLICY_ALWAYS, */
1842 /* GTK_POLICY_ALWAYS); */
1845 gtk_clist_set_column_auto_resize (GTK_CLIST (gpiv
->clist_buf
),
1849 gpiv
->scrolledwindow_buf_adj
=
1850 gtk_adjustment_new (0.0,
1855 250.0 /* 2500.0 */);
1856 gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW
1857 (gpiv
->scrolledwindow_buf
),
1859 (gpiv
->scrolledwindow_buf_adj
));
1862 gtk_drag_dest_set (GTK_WIDGET (gpiv
->clist_buf
),
1863 GTK_DEST_DEFAULT_ALL
,
1865 G_N_ELEMENTS (target_table
),
1867 g_signal_connect (GTK_OBJECT (gpiv
->clist_buf
),
1868 "drag_data_received",
1869 G_CALLBACK (on_clist_buf_drag_data_received
),
1873 * Application bar buttons
1875 gpiv
->appbar
= gnome_appbar_new (TRUE
,
1877 GNOME_PREFERENCES_ALWAYS
);
1878 gtk_widget_ref (gpiv
->appbar
);
1879 gtk_object_set_data_full (GTK_OBJECT (gpiv
->console
),
1882 (GtkDestroyNotify
) gtk_widget_unref
);
1883 gtk_widget_show (gpiv
->appbar
);
1884 gnome_app_set_statusbar (GNOME_APP (gpiv
->console
),
1886 /* gtk_widget_set_sensitive (gpiv->appbar, FALSE); */
1893 * set gpiv->menubars after definition of all console widgets
1895 if (gpiv_par
->console__view_gpivbuttons
) {
1896 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1897 (settings_menu_gpiv
[0].widget
),
1900 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1901 (settings_menu_gpiv
[0].widget
),
1906 if (gpiv_par
->console__view_tabulator
) {
1907 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1908 (settings_menu_gpiv
[1].widget
),
1911 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1912 (settings_menu_gpiv
[1].widget
),
1917 if (gpiv_par
->console__show_tooltips
) {
1918 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1919 (help_menu_gpiv
[0].widget
),
1922 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1923 (help_menu_gpiv
[0].widget
),
1928 gnome_app_install_menu_hints (GNOME_APP (gpiv
->console
),