[med-svn] [SCM] aghermann branch, master, updated. 4f7a3b774136ffffbaf9b05d90bd568347bc5461

Andrei Zavada johnhommer at gmail.com
Fri Nov 16 00:50:06 UTC 2012


The following commit has been merged in the master branch:
commit f18835ce3af7739e462af7e91663a9ce06364fc1
Author: Andrei Zavada <johnhommer at gmail.com>
Date:   Fri Oct 5 23:29:01 2012 +0300

    move SF artifact detection bits into own files

diff --git a/src/ui/Makefile.am b/src/ui/Makefile.am
index 2230685..5eaa051 100644
--- a/src/ui/Makefile.am
+++ b/src/ui/Makefile.am
@@ -33,6 +33,8 @@ libaghui_a_SOURCES = \
 	scoring-facility.cc \
 	scoring-facility-construct.cc \
 	scoring-facility-channel.cc \
+	scoring-facility-artifacts.cc \
+	scoring-facility-artifacts_cb.cc \
 	scoring-facility-ica.cc \
 	scoring-facility-ica_cb.cc \
 	scoring-facility_cb.cc \
diff --git a/src/ui/scoring-facility-artifacts.cc b/src/ui/scoring-facility-artifacts.cc
new file mode 100644
index 0000000..3680eb2
--- /dev/null
+++ b/src/ui/scoring-facility-artifacts.cc
@@ -0,0 +1,48 @@
+// ;-*-C++-*-
+/*
+ *       File name:  ui/scoring-facility-artifacts.cc
+ *         Project:  Aghermann
+ *          Author:  Andrei Zavada <johnhommer at gmail.com>
+ * Initial version:  2012-10-05
+ *
+ *         Purpose:  scoring facility: artifact detection dialog
+ *
+ *         License:  GPL
+ */
+
+
+#include "scoring-facility.hh"
+
+using namespace std;
+using namespace aghui;
+
+
+aghui::SScoringFacility::SChannel::SDetectArtifactsParams
+SScoringFacility::get_mc_params_from_SFAD_widgets() const
+{
+	return SChannel::SDetectArtifactsParams {
+		(float)gtk_spin_button_get_value( eSFADScope),
+			(float)gtk_spin_button_get_value( eSFADUpperThr),
+			(float)gtk_spin_button_get_value( eSFADLowerThr),
+			(float)gtk_spin_button_get_value( eSFADF0),
+			(float)gtk_spin_button_get_value( eSFADFc),
+			(float)gtk_spin_button_get_value( eSFADBandwidth),
+			(float)gtk_spin_button_get_value( eSFADMCGain),
+			(float)gtk_spin_button_get_value( eSFADBackpolate),
+
+			gtk_toggle_button_get_active( (GtkToggleButton*)eSFADEstimateE)
+			? INFINITY
+			: (float)gtk_spin_button_get_value( eSFADEValue),
+
+			(float)gtk_spin_button_get_value( eSFADHistRangeMin),
+			(float)gtk_spin_button_get_value( eSFADHistRangeMax),
+			(size_t)round(gtk_spin_button_get_value( eSFADHistBins)),
+
+			(size_t)round(gtk_spin_button_get_value( eSFADSmoothSide)),
+
+			(bool)gtk_toggle_button_get_active( (GtkToggleButton*)eSFADClearOldArtifacts),
+			(bool)gtk_toggle_button_get_active( (GtkToggleButton*)eSFADUseThisRange)
+		};
+}
+
+// eof
diff --git a/src/ui/scoring-facility-artifacts_cb.cc b/src/ui/scoring-facility-artifacts_cb.cc
new file mode 100644
index 0000000..4c11db5
--- /dev/null
+++ b/src/ui/scoring-facility-artifacts_cb.cc
@@ -0,0 +1,105 @@
+// ;-*-C++-*-
+/*
+ *       File name:  ui/scoring-facility-artifacts_cb.cc
+ *         Project:  Aghermann
+ *          Author:  Andrei Zavada <johnhommer at gmail.com>
+ * Initial version:  2012-10-05
+ *
+ *         Purpose:  scoring facility: artifact detection dialog callbacks
+ *
+ *         License:  GPL
+ */
+
+#include "scoring-facility.hh"
+#include "scoring-facility_cb.hh"
+
+
+using namespace std;
+using namespace aghui;
+
+
+
+void
+eSFADEstimateE_toggled_cb( GtkToggleButton *b, gpointer userdata)
+{
+	auto& SF = *(SScoringFacility*)userdata;
+	auto state = gtk_toggle_button_get_active( b);
+	gtk_widget_set_visible(
+		(GtkWidget*)SF.cSFADWhenEstimateEOn,
+		state);
+	gtk_widget_set_visible(
+		(GtkWidget*)SF.cSFADWhenEstimateEOff,
+		!state);
+}
+
+void
+eSFADUseThisRange_toggled_cb( GtkToggleButton *b, gpointer userdata)
+{
+	auto& SF = *(SScoringFacility*)userdata;
+	auto state = gtk_toggle_button_get_active( b);
+	gtk_widget_set_sensitive(
+		(GtkWidget*)SF.eSFADHistRangeMin,
+		state);
+	gtk_widget_set_sensitive(
+		(GtkWidget*)SF.eSFADHistRangeMax,
+		state);
+
+	// if ( state ) {
+	// 	snprintf_buf( "Estimated <i>E</i> = %4.2f",
+	// 		      SF.using_channel -> estimate_E( P));
+	// }
+}
+
+
+
+void
+bSFADApply_clicked_cb( GtkButton*, gpointer userdata)
+{
+	auto& SF = *(SScoringFacility*)userdata;
+
+	gtk_widget_hide( (GtkWidget*)SF.wSFArtifactDetectionSetup);
+
+	SF.artifacts_backup.clear_all();
+}
+
+void
+bSFADCancel_clicked_cb( GtkButton*, gpointer userdata)
+{
+	auto& SF = *(SScoringFacility*)userdata;
+
+	gtk_widget_hide( (GtkWidget*)SF.wSFArtifactDetectionSetup);
+
+	if ( gtk_toggle_button_get_active(SF.bSFADPreview) ) {
+		SF.using_channel -> artifacts = SF.artifacts_backup;
+		SF.using_channel -> get_signal_filtered();
+
+		gtk_widget_queue_draw( (GtkWidget*)SF.daSFMontage);
+		gtk_widget_queue_draw( (GtkWidget*)SF.daSFHypnogram);
+	}
+	SF.artifacts_backup.clear_all();
+}
+
+void
+bSFADPreview_toggled_cb( GtkToggleButton *b, gpointer userdata)
+{
+	auto& SF = *(SScoringFacility*)userdata;
+	if ( SF.suppress_preview_handler )
+		return;
+
+	if ( gtk_toggle_button_get_active(b) ) {
+		aghui::SBusyBlock bb (SF.wSFArtifactDetectionSetup);
+		SF.artifacts_backup = SF.using_channel->artifacts;
+		SF.using_channel -> detect_artifacts(
+			SF.get_mc_params_from_SFAD_widgets());
+		gtk_widget_set_sensitive( (GtkWidget*)SF.bSFADApply, TRUE);
+	} else {
+		SF.using_channel->artifacts = SF.artifacts_backup;
+		gtk_widget_set_sensitive( (GtkWidget*)SF.bSFADApply, FALSE);
+	}
+
+	SF.using_channel -> get_signal_filtered();
+	gtk_widget_queue_draw( (GtkWidget*)SF.daSFMontage);
+	gtk_widget_queue_draw( (GtkWidget*)SF.daSFHypnogram);
+}
+
+// eof
diff --git a/src/ui/scoring-facility-montage.cc b/src/ui/scoring-facility-montage.cc
index a344aaa..8850ddf 100644
--- a/src/ui/scoring-facility-montage.cc
+++ b/src/ui/scoring-facility-montage.cc
@@ -11,8 +11,6 @@
  */
 
 
-
-
 #include <cairo/cairo-svg.h>
 
 #include "../common/lang.hh"
@@ -1050,35 +1048,5 @@ draw_montage( cairo_t* cr)
 
 
 
-
-
-aghui::SScoringFacility::SChannel::SDetectArtifactsParams
-SScoringFacility::get_mc_params_from_SFAD_widgets() const
-{
-	return SChannel::SDetectArtifactsParams {
-		(float)gtk_spin_button_get_value( eSFADScope),
-			(float)gtk_spin_button_get_value( eSFADUpperThr),
-			(float)gtk_spin_button_get_value( eSFADLowerThr),
-			(float)gtk_spin_button_get_value( eSFADF0),
-			(float)gtk_spin_button_get_value( eSFADFc),
-			(float)gtk_spin_button_get_value( eSFADBandwidth),
-			(float)gtk_spin_button_get_value( eSFADMCGain),
-			(float)gtk_spin_button_get_value( eSFADBackpolate),
-
-			gtk_toggle_button_get_active( (GtkToggleButton*)eSFADEstimateE)
-			? INFINITY
-			: (float)gtk_spin_button_get_value( eSFADEValue),
-
-			(float)gtk_spin_button_get_value( eSFADHistRangeMin),
-			(float)gtk_spin_button_get_value( eSFADHistRangeMax),
-			(size_t)round(gtk_spin_button_get_value( eSFADHistBins)),
-
-			(size_t)round(gtk_spin_button_get_value( eSFADSmoothSide)),
-
-			(bool)gtk_toggle_button_get_active( (GtkToggleButton*)eSFADClearOldArtifacts),
-			(bool)gtk_toggle_button_get_active( (GtkToggleButton*)eSFADUseThisRange)
-		};
-}
-
 // eof
 
diff --git a/src/ui/scoring-facility-montage_cb.cc b/src/ui/scoring-facility-montage_cb.cc
index 4a7f382..fe23ebc 100644
--- a/src/ui/scoring-facility-montage_cb.cc
+++ b/src/ui/scoring-facility-montage_cb.cc
@@ -651,88 +651,6 @@ iSFPageDetectArtifacts_activate_cb( GtkMenuItem*, gpointer userdata)
 	gtk_widget_show_all( (GtkWidget*)SF.wSFArtifactDetectionSetup);
 }
 
-void
-bSFADApply_clicked_cb( GtkButton*, gpointer userdata)
-{
-	auto& SF = *(SScoringFacility*)userdata;
-
-	gtk_widget_hide( (GtkWidget*)SF.wSFArtifactDetectionSetup);
-
-	SF.artifacts_backup.clear_all();
-}
-
-void
-bSFADCancel_clicked_cb( GtkButton*, gpointer userdata)
-{
-	auto& SF = *(SScoringFacility*)userdata;
-
-	gtk_widget_hide( (GtkWidget*)SF.wSFArtifactDetectionSetup);
-
-	if ( gtk_toggle_button_get_active(SF.bSFADPreview) ) {
-		SF.using_channel -> artifacts = SF.artifacts_backup;
-		SF.using_channel -> get_signal_filtered();
-
-		gtk_widget_queue_draw( (GtkWidget*)SF.daSFMontage);
-		gtk_widget_queue_draw( (GtkWidget*)SF.daSFHypnogram);
-	}
-	SF.artifacts_backup.clear_all();
-}
-
-void
-bSFADPreview_toggled_cb( GtkToggleButton *b, gpointer userdata)
-{
-	auto& SF = *(SScoringFacility*)userdata;
-	if ( SF.suppress_preview_handler )
-		return;
-
-	if ( gtk_toggle_button_get_active(b) ) {
-		aghui::SBusyBlock bb (SF.wSFArtifactDetectionSetup);
-		SF.artifacts_backup = SF.using_channel->artifacts;
-		SF.using_channel -> detect_artifacts(
-			SF.get_mc_params_from_SFAD_widgets());
-		gtk_widget_set_sensitive( (GtkWidget*)SF.bSFADApply, TRUE);
-	} else {
-		SF.using_channel->artifacts = SF.artifacts_backup;
-		gtk_widget_set_sensitive( (GtkWidget*)SF.bSFADApply, FALSE);
-	}
-
-	SF.using_channel -> get_signal_filtered();
-	gtk_widget_queue_draw( (GtkWidget*)SF.daSFMontage);
-	gtk_widget_queue_draw( (GtkWidget*)SF.daSFHypnogram);
-}
-
-
-void
-eSFADEstimateE_toggled_cb( GtkToggleButton *b, gpointer userdata)
-{
-	auto& SF = *(SScoringFacility*)userdata;
-	auto state = gtk_toggle_button_get_active( b);
-	gtk_widget_set_visible(
-		(GtkWidget*)SF.cSFADWhenEstimateEOn,
-		state);
-	gtk_widget_set_visible(
-		(GtkWidget*)SF.cSFADWhenEstimateEOff,
-		!state);
-}
-
-void
-eSFADUseThisRange_toggled_cb( GtkToggleButton *b, gpointer userdata)
-{
-	auto& SF = *(SScoringFacility*)userdata;
-	auto state = gtk_toggle_button_get_active( b);
-	gtk_widget_set_sensitive(
-		(GtkWidget*)SF.eSFADHistRangeMin,
-		state);
-	gtk_widget_set_sensitive(
-		(GtkWidget*)SF.eSFADHistRangeMax,
-		state);
-
-	// if ( state ) {
-	// 	snprintf_buf( "Estimated <i>E</i> = %4.2f",
-	// 		      SF.using_channel -> estimate_E( P));
-	// }
-}
-
 
 
 void

-- 
Sleep experiment manager



More information about the debian-med-commit mailing list