[med-svn] [SCM] aghermann branch, master, updated. f0d4c0fd35bf09e7dff56ddb9a2d798ae916c2ef
andrei zavada
jh at johnhommer.com
Sun Feb 3 12:52:53 UTC 2013
The following commit has been merged in the master branch:
commit 58adc3deeef7cfb1fce593cfd2f1543eb6dc4bcd
Author: andrei zavada <jh at johnhommer.com>
Date: Thu Jan 24 11:17:06 2013 +0000
splitting sf child dialogs WIP
diff --git a/src/ui/sf/Makefile.am b/src/ui/sf/Makefile.am
index 4dc15b3..5591e87 100644
--- a/src/ui/sf/Makefile.am
+++ b/src/ui/sf/Makefile.am
@@ -21,6 +21,7 @@ liba_a_SOURCES := \
sf-montage.cc \
sf-montage-overlays.cc \
sf-montage_cb.cc \
+ sf-patterns.hh \
sf-patterns.cc \
sf-patterns-draw.cc \
sf-patterns-enumerate.cc \
diff --git a/src/ui/sf/sf-channel.cc b/src/ui/sf/sf-channel.cc
index 77112ca..2316a4f 100644
--- a/src/ui/sf/sf-channel.cc
+++ b/src/ui/sf/sf-channel.cc
@@ -463,6 +463,9 @@ void
aghui::SScoringFacility::SChannel::
mark_region_as_pattern()
{
+ if ( not _p.find_dialog )
+ _p.find_dialog =
+ new aghui::SScoringFacility::SFindDialog (_p);
_p.find_dialog.import_from_selection( *this);
gtk_widget_show( (GtkWidget*)_p.wSFFD);
}
diff --git a/src/ui/sf/sf-construct.cc b/src/ui/sf/sf-construct.cc
index ed4499d..7d6bd44 100644
--- a/src/ui/sf/sf-construct.cc
+++ b/src/ui/sf/sf-construct.cc
@@ -378,84 +378,6 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
throw runtime_error ("Failed to construct SF widgets (8)");
- // find/manage patterns
- mSFFDPatterns =
- gtk_list_store_new( 1, G_TYPE_STRING);
-
- if ( !AGH_GBGETOBJ (GtkDialog, wSFFD) ||
- !AGH_GBGETOBJ (GtkDrawingArea, daSFFDThing) ||
- !AGH_GBGETOBJ (GtkScrolledWindow, swSFFDThing) ||
- !AGH_GBGETOBJ (GtkDrawingArea, daSFFDField) ||
- !AGH_GBGETOBJ (GtkMenu, iiSFFDField) ||
- !AGH_GBGETOBJ (GtkScrolledWindow, swSFFDField) ||
- !AGH_GBGETOBJ (GtkTable, cSFFDSearchButton) ||
- !AGH_GBGETOBJ (GtkTable, cSFFDAgainButton) ||
- !AGH_GBGETOBJ (GtkBox, cSFFDSearching) ||
- !AGH_GBGETOBJ (GtkTable, cSFFDParameters) ||
- !AGH_GBGETOBJ (GtkTable, cSFFDCriteria) ||
- !AGH_GBGETOBJ (GtkButton, bSFFDSearch) ||
- !AGH_GBGETOBJ (GtkButton, bSFFDAgain) ||
- !AGH_GBGETOBJ (GtkButton, bSFFDProfileSave) ||
- !AGH_GBGETOBJ (GtkButton, bSFFDProfileDiscard) ||
- !AGH_GBGETOBJ (GtkButton, bSFFDProfileRevert) ||
- !AGH_GBGETOBJ (GtkSpinButton, eSFFDEnvTightness) ||
- !AGH_GBGETOBJ (GtkSpinButton, eSFFDBandPassOrder) ||
- !AGH_GBGETOBJ (GtkSpinButton, eSFFDBandPassFrom) ||
- !AGH_GBGETOBJ (GtkSpinButton, eSFFDBandPassUpto) ||
- !AGH_GBGETOBJ (GtkSpinButton, eSFFDDZCDFStep) ||
- !AGH_GBGETOBJ (GtkSpinButton, eSFFDDZCDFSigma) ||
- !AGH_GBGETOBJ (GtkSpinButton, eSFFDDZCDFSmooth) ||
- !AGH_GBGETOBJ (GtkSpinButton, eSFFDParameterA) ||
- !AGH_GBGETOBJ (GtkSpinButton, eSFFDParameterB) ||
- !AGH_GBGETOBJ (GtkSpinButton, eSFFDParameterC) ||
- !AGH_GBGETOBJ (GtkSpinButton, eSFFDParameterD) ||
- !AGH_GBGETOBJ (GtkHBox, cSFFDLabelBox) ||
- !AGH_GBGETOBJ (GtkLabel, lSFFDParametersBrief) ||
- !AGH_GBGETOBJ (GtkLabel, lSFFDFoundInfo) ||
- !AGH_GBGETOBJ (GtkComboBox, eSFFDPatternList) ||
- !AGH_GBGETOBJ (GtkComboBox, eSFFDChannel) ||
- !AGH_GBGETOBJ (GtkDialog, wSFFDPatternSave) ||
- !AGH_GBGETOBJ (GtkEntry, eSFFDPatternSaveName) ||
- !AGH_GBGETOBJ (GtkToggleButton, eSFFDPatternSaveOriginSubject) ||
- !AGH_GBGETOBJ (GtkToggleButton, eSFFDPatternSaveOriginExperiment) ||
- !AGH_GBGETOBJ (GtkToggleButton, eSFFDPatternSaveOriginUser) )
- throw runtime_error ("Failed to construct SF widgets (9)");
-
- gtk_combo_box_set_model_properly( eSFFDPatternList, mSFFDPatterns);
- eSFFDPatternList_changed_cb_handler_id =
- G_CONNECT_1 (eSFFDPatternList, changed);
-
- gtk_combo_box_set_model_properly( eSFFDChannel, _p.mAllChannels);
- eSFFDChannel_changed_cb_handler_id =
- G_CONNECT_1 (eSFFDChannel, changed);
-
- G_CONNECT_2 (wSFFD, configure, event);
- G_CONNECT_1 (daSFFDThing, draw);
- G_CONNECT_2 (daSFFDThing, scroll, event);
- G_CONNECT_1 (daSFFDField, draw);
- G_CONNECT_2 (daSFFDField, scroll, event);
- G_CONNECT_3 (daSFFDField, motion, notify, event);
- G_CONNECT_3 (daSFFDField, button, press, event);
- G_CONNECT_1 (bSFFDProfileSave, clicked);
- G_CONNECT_1 (bSFFDProfileDiscard, clicked);
- G_CONNECT_1 (bSFFDProfileRevert, clicked);
- G_CONNECT_1 (bSFFDSearch, clicked);
- G_CONNECT_1 (bSFFDAgain, clicked);
-
- for ( auto& W : {eSFFDEnvTightness,
- eSFFDBandPassFrom, eSFFDBandPassUpto, eSFFDBandPassOrder,
- eSFFDDZCDFStep, eSFFDDZCDFSigma, eSFFDDZCDFSmooth} )
- g_signal_connect( W, "value-changed",
- (GCallback)eSFFD_any_pattern_value_changed_cb,
- this);
- for ( auto& W : {eSFFDParameterA, eSFFDParameterB, eSFFDParameterC, eSFFDParameterD} )
- g_signal_connect( W, "value-changed",
- (GCallback)eSFFD_any_criteria_value_changed_cb,
- this);
-
- G_CONNECT_1 (wSFFD, show);
- G_CONNECT_1 (wSFFD, hide);
-
// aghui::SScoringFacility::SFiltersDialog::
diff --git a/src/ui/sf/sf-patterns-construct.cc b/src/ui/sf/sf-patterns-construct.cc
new file mode 100644
index 0000000..97712fc
--- /dev/null
+++ b/src/ui/sf/sf-patterns-construct.cc
@@ -0,0 +1,93 @@
+// ;-*-C++-*-
+/*
+ * File name: ui/sf/sf-patterns-construct.cc
+ * Project: Aghermann
+ * Author: Andrei Zavada <johnhommer at gmail.com>
+ * Initial version: 2013-01-24
+ *
+ * Purpose: scoring facility Patterns widget construction
+ *
+ * License: GPL
+ */
+
+#include <stdexcept>
+
+
+ mSFFDPatterns =
+ gtk_list_store_new( 1, G_TYPE_STRING);
+
+ if ( !AGH_GBGETOBJ (GtkDialog, wSFFD) ||
+ !AGH_GBGETOBJ (GtkDrawingArea, daSFFDThing) ||
+ !AGH_GBGETOBJ (GtkScrolledWindow, swSFFDThing) ||
+ !AGH_GBGETOBJ (GtkDrawingArea, daSFFDField) ||
+ !AGH_GBGETOBJ (GtkMenu, iiSFFDField) ||
+ !AGH_GBGETOBJ (GtkScrolledWindow, swSFFDField) ||
+ !AGH_GBGETOBJ (GtkTable, cSFFDSearchButton) ||
+ !AGH_GBGETOBJ (GtkTable, cSFFDAgainButton) ||
+ !AGH_GBGETOBJ (GtkBox, cSFFDSearching) ||
+ !AGH_GBGETOBJ (GtkTable, cSFFDParameters) ||
+ !AGH_GBGETOBJ (GtkTable, cSFFDCriteria) ||
+ !AGH_GBGETOBJ (GtkButton, bSFFDSearch) ||
+ !AGH_GBGETOBJ (GtkButton, bSFFDAgain) ||
+ !AGH_GBGETOBJ (GtkButton, bSFFDProfileSave) ||
+ !AGH_GBGETOBJ (GtkButton, bSFFDProfileDiscard) ||
+ !AGH_GBGETOBJ (GtkButton, bSFFDProfileRevert) ||
+ !AGH_GBGETOBJ (GtkSpinButton, eSFFDEnvTightness) ||
+ !AGH_GBGETOBJ (GtkSpinButton, eSFFDBandPassOrder) ||
+ !AGH_GBGETOBJ (GtkSpinButton, eSFFDBandPassFrom) ||
+ !AGH_GBGETOBJ (GtkSpinButton, eSFFDBandPassUpto) ||
+ !AGH_GBGETOBJ (GtkSpinButton, eSFFDDZCDFStep) ||
+ !AGH_GBGETOBJ (GtkSpinButton, eSFFDDZCDFSigma) ||
+ !AGH_GBGETOBJ (GtkSpinButton, eSFFDDZCDFSmooth) ||
+ !AGH_GBGETOBJ (GtkSpinButton, eSFFDParameterA) ||
+ !AGH_GBGETOBJ (GtkSpinButton, eSFFDParameterB) ||
+ !AGH_GBGETOBJ (GtkSpinButton, eSFFDParameterC) ||
+ !AGH_GBGETOBJ (GtkSpinButton, eSFFDParameterD) ||
+ !AGH_GBGETOBJ (GtkHBox, cSFFDLabelBox) ||
+ !AGH_GBGETOBJ (GtkLabel, lSFFDParametersBrief) ||
+ !AGH_GBGETOBJ (GtkLabel, lSFFDFoundInfo) ||
+ !AGH_GBGETOBJ (GtkComboBox, eSFFDPatternList) ||
+ !AGH_GBGETOBJ (GtkComboBox, eSFFDChannel) ||
+ !AGH_GBGETOBJ (GtkDialog, wSFFDPatternSave) ||
+ !AGH_GBGETOBJ (GtkEntry, eSFFDPatternSaveName) ||
+ !AGH_GBGETOBJ (GtkToggleButton, eSFFDPatternSaveOriginSubject) ||
+ !AGH_GBGETOBJ (GtkToggleButton, eSFFDPatternSaveOriginExperiment) ||
+ !AGH_GBGETOBJ (GtkToggleButton, eSFFDPatternSaveOriginUser) )
+ throw runtime_error ("Failed to construct SF widgets (9)");
+
+ gtk_combo_box_set_model_properly( eSFFDPatternList, mSFFDPatterns);
+ eSFFDPatternList_changed_cb_handler_id =
+ G_CONNECT_1 (eSFFDPatternList, changed);
+
+ gtk_combo_box_set_model_properly( eSFFDChannel, _p.mAllChannels);
+ eSFFDChannel_changed_cb_handler_id =
+ G_CONNECT_1 (eSFFDChannel, changed);
+
+ G_CONNECT_2 (wSFFD, configure, event);
+ G_CONNECT_1 (daSFFDThing, draw);
+ G_CONNECT_2 (daSFFDThing, scroll, event);
+ G_CONNECT_1 (daSFFDField, draw);
+ G_CONNECT_2 (daSFFDField, scroll, event);
+ G_CONNECT_3 (daSFFDField, motion, notify, event);
+ G_CONNECT_3 (daSFFDField, button, press, event);
+ G_CONNECT_1 (bSFFDProfileSave, clicked);
+ G_CONNECT_1 (bSFFDProfileDiscard, clicked);
+ G_CONNECT_1 (bSFFDProfileRevert, clicked);
+ G_CONNECT_1 (bSFFDSearch, clicked);
+ G_CONNECT_1 (bSFFDAgain, clicked);
+
+ for ( auto& W : {eSFFDEnvTightness,
+ eSFFDBandPassFrom, eSFFDBandPassUpto, eSFFDBandPassOrder,
+ eSFFDDZCDFStep, eSFFDDZCDFSigma, eSFFDDZCDFSmooth} )
+ g_signal_connect( W, "value-changed",
+ (GCallback)eSFFD_any_pattern_value_changed_cb,
+ this);
+ for ( auto& W : {eSFFDParameterA, eSFFDParameterB, eSFFDParameterC, eSFFDParameterD} )
+ g_signal_connect( W, "value-changed",
+ (GCallback)eSFFD_any_criteria_value_changed_cb,
+ this);
+
+ G_CONNECT_1 (wSFFD, show);
+ G_CONNECT_1 (wSFFD, hide);
+
+}
diff --git a/src/ui/sf/sf-patterns.hh b/src/ui/sf/sf-patterns.hh
new file mode 100644
index 0000000..2a74536
--- /dev/null
+++ b/src/ui/sf/sf-patterns.hh
@@ -0,0 +1,113 @@
+// ;-*-C++-*-
+/*
+ * File name: ui/sf/sf-patterns.hh
+ * Project: Aghermann
+ * Author: Andrei Zavada <johnhommer at gmail.com>
+ * Initial version: 2013-01-24
+ *
+ * Purpose: scoring facility Patterns child dialog
+ *
+ * License: GPL
+ */
+
+#ifndef _AGH_UI_SF_PATTERNS_H
+#define _AGH_UI_SF_PATTERNS_H
+
+#include "patterns/patterns.hh"
+#include "sf.hh"
+
+#if HAVE_CONFIG_H && !defined(VERSION)
+# include "config.h"
+#endif
+
+using namespace std;
+
+namespace aghui {
+
+struct SScoringFacility::SFindDialog {
+ DELETE_DEFAULT_METHODS (SFindDialog);
+
+ // ctor, dtor
+ SFindDialog (SScoringFacility& parent);
+ ~SFindDialog ();
+
+ // saved patterns
+ list<pattern::SPattern<TFloat>>
+ patterns;
+ list<pattern::SPattern<TFloat>>::iterator
+ current_pattern;
+ list<pattern::SPattern<TFloat>>::iterator
+ pattern_by_idx( size_t);
+
+ void import_from_selection( SScoringFacility::SChannel&);
+ void load_patterns();
+ void save_patterns();
+ void discard_current_pattern();
+ void populate_combo();
+
+ // finding tool
+ pattern::SPatternPPack<TFloat>
+ Pp2;
+ pattern::CPatternTool<TFloat>
+ *cpattern;
+ double increment; // in seconds
+
+ // matches
+ pattern::CMatch<TFloat>
+ criteria;
+ vector<pattern::CMatch<TFloat>>
+ diff_line;
+ vector<size_t>
+ occurrences;
+ size_t highlighted_occurrence;
+ void search();
+ size_t find_occurrences();
+ size_t nearest_occurrence( double) const;
+
+ // field
+ SScoringFacility::SChannel
+ *field_channel,
+ *field_channel_saved;
+ list<sigfile::SAnnotation>
+ saved_annotations;
+ void occurrences_to_annotations();
+ void save_annotations();
+ void restore_annotations();
+
+ metrics::TType
+ field_profile_type; // where appropriate; otherwise draw compressed raw
+
+ // draw
+ bool draw_details:1,
+ suppress_w_v:1;
+ void draw_thing( cairo_t*);
+ void draw_field( cairo_t*);
+ float thing_display_scale,
+ field_display_scale;
+
+ // widgets
+ SUIVarCollection
+ W_V;
+
+ void preselect_channel( const char*);
+
+ void setup_controls_for_find();
+ void setup_controls_for_wait();
+ void setup_controls_for_tune();
+ void set_profile_manage_buttons_visibility();
+
+ static const int
+ da_thing_ht = 200,
+ da_field_ht = 130;
+ int da_thing_wd,
+ da_field_wd;
+ void set_thing_da_width( int);
+ void set_field_da_width( int);
+
+ aghui::SScoringFacility&
+ _p;
+};
+
+} // namespace aghui
+
+// eof
diff --git a/src/ui/sf/sf-patterns_cb.cc b/src/ui/sf/sf-patterns_cb.cc
index 2e1ae5b..10b172b 100644
--- a/src/ui/sf/sf-patterns_cb.cc
+++ b/src/ui/sf/sf-patterns_cb.cc
@@ -25,7 +25,7 @@ gboolean
daSFFDThing_draw_cb( GtkWidget *wid, cairo_t *cr, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
FD.draw_thing( cr);
@@ -36,7 +36,7 @@ gboolean
daSFFDField_draw_cb( GtkWidget *wid, cairo_t *cr, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
FD.draw_field( cr);
@@ -50,7 +50,7 @@ gboolean
daSFFDThing_scroll_event_cb( GtkWidget *wid, GdkEventScroll *event, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
switch ( event->direction ) {
case GDK_SCROLL_UP:
@@ -79,7 +79,7 @@ gboolean
daSFFDField_scroll_event_cb( GtkWidget *wid, GdkEventScroll *event, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
switch ( event->direction ) {
case GDK_SCROLL_UP:
@@ -108,7 +108,7 @@ gboolean
daSFFDField_button_press_event_cb( GtkWidget *wid, GdkEventButton *event, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
switch ( event->button ) {
case 1:
@@ -131,7 +131,7 @@ gboolean
daSFFDField_motion_notify_event_cb( GtkWidget *wid, GdkEventMotion *event, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
FD.highlighted_occurrence = FD.nearest_occurrence( event->x);
@@ -146,7 +146,7 @@ void
bSFFDSearch_clicked_cb( GtkButton *button, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
aghui::SBusyBlock bb (SF.wSFFD);
@@ -183,7 +183,7 @@ void
bSFFDAgain_clicked_cb( GtkButton *button, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
FD.restore_annotations();
FD.occurrences.clear();
@@ -196,7 +196,7 @@ void
eSFFD_any_pattern_value_changed_cb( GtkSpinButton *spinbutton, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
if ( FD.suppress_w_v )
return;
@@ -221,7 +221,7 @@ void
eSFFD_any_criteria_value_changed_cb( GtkSpinButton *spinbutton, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
if ( FD.suppress_w_v )
return;
@@ -253,7 +253,7 @@ void
eSFFDPatternList_changed_cb( GtkComboBox *combo, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
if ( FD.current_pattern != FD.patterns.end() ) {
FD.current_pattern->Pp = FD.Pp2;
@@ -279,7 +279,7 @@ void
bSFFDProfileSave_clicked_cb( GtkButton *button, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
assert (FD.current_pattern->origin == pattern::TOrigin::transient );
@@ -304,7 +304,7 @@ void
bSFFDProfileDiscard_clicked_cb( GtkButton *button, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
gint ci = gtk_combo_box_get_active( SF.eSFFDPatternList);
@@ -333,7 +333,7 @@ void
bSFFDProfileRevert_clicked_cb( GtkButton *button, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
assert ( FD.current_pattern != FD.patterns.end() );
assert ( FD.current_pattern->origin != pattern::TOrigin::transient );
@@ -354,7 +354,7 @@ void
eSFFDChannel_changed_cb( GtkComboBox *combo, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
GtkTreeIter iter;
if ( gtk_combo_box_get_active_iter( combo, &iter) == FALSE )
@@ -378,7 +378,7 @@ void
wSFFD_show_cb( GtkWidget *widget, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
FD.setup_controls_for_find();
FD.populate_combo();
@@ -395,7 +395,7 @@ void
wSFFD_hide_cb( GtkWidget *widget, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
- auto& FD = SF.find_dialog;
+ auto& FD = *SF.find_dialog;
if ( not FD.occurrences.empty() ) // closing while dialog is in matching state
if ( GTK_RESPONSE_YES !=
diff --git a/src/ui/sf/sf.cc b/src/ui/sf/sf.cc
index f8657fc..3e56b97 100644
--- a/src/ui/sf/sf.cc
+++ b/src/ui/sf/sf.cc
@@ -80,7 +80,7 @@ SScoringFacility (agh::CSubject& J,
confval::SValidator<float>("montage.interchannel_gap", &interchannel_gap, confval::SValidator<float>::SVFRangeIn (0., 400.)),
confval::SValidator<float>("montage.height", &da_ht, confval::SValidator<float>::SVFRangeIn (10., 4000.)),
}),
- find_dialog (*this),
+ find_dialog (nullptr),
filters_dialog (*this),
phasediff_dialog (*this),
artifact_detection_dialog (*this),
@@ -265,6 +265,9 @@ aghui::SScoringFacility::
if ( ica )
delete ica;
+ if ( find_dialog )
+ delete find_dialog;
+
// put scores
put_hypnogram();
diff --git a/src/ui/sf/sf.hh b/src/ui/sf/sf.hh
index d048e8f..47c735e 100644
--- a/src/ui/sf/sf.hh
+++ b/src/ui/sf/sf.hh
@@ -17,14 +17,12 @@
#include <list>
#include <cairo/cairo.h>
-#include <cairo/cairo-svg.h>
#include <gtk/gtk.h>
#include "common/alg.hh"
#include "common/config-validate.hh"
#include "sigproc/winfun.hh"
#include "sigproc/sigproc.hh"
-#include "patterns/patterns.hh"
#include "metrics/phasic-events.hh"
#include "expdesign/primaries.hh"
#include "ica/ica.hh"
@@ -497,92 +495,9 @@ class SScoringFacility
void set_tooltip( TTipIdx i) const;
// child dialogs:
- // pattern find dialog
- struct SFindDialog {
- DELETE_DEFAULT_METHODS (SFindDialog);
-
- // ctor, dtor
- SFindDialog (SScoringFacility& parent);
- ~SFindDialog ();
-
- // saved patterns
- list<pattern::SPattern<TFloat>>
- patterns;
- list<pattern::SPattern<TFloat>>::iterator
- current_pattern;
- list<pattern::SPattern<TFloat>>::iterator
- pattern_by_idx( size_t);
-
- void import_from_selection( SScoringFacility::SChannel&);
- void load_patterns();
- void save_patterns();
- void discard_current_pattern();
- void populate_combo();
-
- // finding tool
- pattern::SPatternPPack<TFloat>
- Pp2;
- pattern::CPatternTool<TFloat>
- *cpattern;
- double increment; // in seconds
-
- // matches
- pattern::CMatch<TFloat>
- criteria;
- vector<pattern::CMatch<TFloat>>
- diff_line;
- vector<size_t>
- occurrences;
- size_t highlighted_occurrence;
- void search();
- size_t find_occurrences();
- size_t nearest_occurrence( double) const;
-
- // field
- SScoringFacility::SChannel
- *field_channel,
- *field_channel_saved;
- list<sigfile::SAnnotation>
- saved_annotations;
- void occurrences_to_annotations();
- void save_annotations();
- void restore_annotations();
-
- metrics::TType
- field_profile_type; // where appropriate; otherwise draw compressed raw
-
- // draw
- bool draw_details:1,
- suppress_w_v:1;
- void draw_thing( cairo_t*);
- void draw_field( cairo_t*);
- float thing_display_scale,
- field_display_scale;
-
- // widgets
- SUIVarCollection
- W_V;
-
- void preselect_channel( const char*);
-
- void setup_controls_for_find();
- void setup_controls_for_wait();
- void setup_controls_for_tune();
- void set_profile_manage_buttons_visibility();
-
- static const int
- da_thing_ht = 200,
- da_field_ht = 130;
- int da_thing_wd,
- da_field_wd;
- void set_thing_da_width( int);
- void set_field_da_width( int);
-
- SScoringFacility&
- _p;
- };
+ struct SFindDialog;
SFindDialog
- find_dialog;
+ *find_dialog;
struct SFiltersDialog {
DELETE_DEFAULT_METHODS (SFiltersDialog);
diff --git a/src/ui/sf/sf_cb.cc b/src/ui/sf/sf_cb.cc
index b282803..31b60e9 100644
--- a/src/ui/sf/sf_cb.cc
+++ b/src/ui/sf/sf_cb.cc
@@ -193,7 +193,10 @@ bSFShowFindDialog_toggled_cb( GtkToggleButton *togglebutton, gpointer userdata)
{
auto& SF = *(SScoringFacility*)userdata;
if ( gtk_toggle_button_get_active( togglebutton) ) {
- SF.find_dialog.setup_controls_for_find();
+ if ( not SF.find_dialog )
+ SF.find_dialog =
+ new aghui::SScoringFacility::SFindDialog (SF);
+ SF.find_dialog->setup_controls_for_find();
gtk_widget_show( (GtkWidget*)SF.wSFFD);
} else
gtk_widget_hide( (GtkWidget*)SF.wSFFD);
--
Sleep experiment manager
More information about the debian-med-commit
mailing list