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

andrei zavada johnhommer at gmail.com
Fri Nov 16 00:50:24 UTC 2012


The following commit has been merged in the master branch:
commit 5faaa2d1899f09653241df715ffe0ad38f3b2880
Author: andrei zavada <johnhommer at gmail.com>
Date:   Sat Oct 20 21:02:03 2012 +0300

    WIP

diff --git a/data/dialogs.glade.in b/data/dialogs.glade.in
index 4efa03e..e80091d 100644
--- a/data/dialogs.glade.in
+++ b/data/dialogs.glade.in
@@ -1624,7 +1624,7 @@ GPL-2+</property>
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="bGADApply">
+              <object class="GtkButton" id="bGlobalADOK">
                 <property name="label">gtk-ok</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
@@ -1651,7 +1651,7 @@ GPL-2+</property>
     </child>
     <action-widgets>
       <action-widget response="-6">button7</action-widget>
-      <action-widget response="-5">bGADApply</action-widget>
+      <action-widget response="-5">bGlobalADOK</action-widget>
     </action-widgets>
   </object>
   <object class="GtkDialog" id="wMontageDefaults">
diff --git a/data/sf.glade b/data/sf.glade
index b4b5548..e8d4c71 100644
--- a/data/sf.glade
+++ b/data/sf.glade
@@ -1,6 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkMenu" id="iiSFAccept">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <child>
+      <object class="GtkMenuItem" id="iSFAcceptAndTakeNext">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">_Accept and proceed to next episode</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+  </object>
   <object class="GtkAdjustment" id="jHighPassCutoff">
     <property name="upper">100</property>
     <property name="step_increment">0.25</property>
@@ -98,18 +110,6 @@
     <property name="step_increment">0.25</property>
     <property name="page_increment">1</property>
   </object>
-  <object class="GtkMenu" id="iiSFAccept">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <child>
-      <object class="GtkMenuItem" id="iSFAcceptAndTakeNext">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">_Accept and proceed to next episode</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-  </object>
   <object class="GtkAdjustment" id="jSFADBackpolate">
     <property name="upper">1</property>
     <property name="value">0.5</property>
@@ -2924,15 +2924,15 @@ on individual parameters:</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkButton" id="bScoreClear">
-                        <property name="label" translatable="yes">⌫</property>
+                      <object class="GtkButton" id="bScoreWake">
+                        <property name="label" translatable="yes">☺</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
-                        <property name="tooltip_markup" translatable="yes">Clear (<b>q</b>)</property>
+                        <property name="tooltip_markup" translatable="yes">Wake (<b>w</b>)</property>
                         <property name="valign">center</property>
                         <property name="focus_on_click">False</property>
-                        <accelerator key="q" signal="activate"/>
+                        <accelerator key="w" signal="activate"/>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -2941,15 +2941,15 @@ on individual parameters:</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkButton" id="bScoreWake">
-                        <property name="label" translatable="yes">☺</property>
+                      <object class="GtkButton" id="bScoreClear">
+                        <property name="label" translatable="yes">⌫</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
-                        <property name="tooltip_markup" translatable="yes">Wake (<b>w</b>)</property>
+                        <property name="tooltip_markup" translatable="yes">Clear (<b>q</b>)</property>
                         <property name="valign">center</property>
                         <property name="focus_on_click">False</property>
-                        <accelerator key="w" signal="activate"/>
+                        <accelerator key="q" signal="activate"/>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -3184,18 +3184,17 @@ on individual parameters:</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkToggleButton" id="bSFShowFindDialog">
-                        <property name="label" translatable="yes">_Find</property>
+                      <object class="GtkToggleButton" id="bSFShowPhaseDiffDialog">
+                        <property name="label" translatable="yes">Δφ</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
                         <property name="has_tooltip">True</property>
-                        <property name="tooltip_markup" translatable="yes">Find/manage patterns (<b>F3</b>)</property>
-                        <property name="tooltip_text" translatable="yes">Find/manage patterns (F3)</property>
+                        <property name="tooltip_markup" translatable="yes">Interchannel signal shift (<b>F4</b>)</property>
+                        <property name="tooltip_text" translatable="yes">Interchannel signal shift (F4)</property>
                         <property name="valign">center</property>
-                        <property name="use_underline">True</property>
                         <property name="focus_on_click">False</property>
-                        <accelerator key="F3" signal="activate"/>
+                        <accelerator key="F4" signal="activate"/>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -3205,17 +3204,18 @@ on individual parameters:</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkToggleButton" id="bSFShowPhaseDiffDialog">
-                        <property name="label" translatable="yes">Δφ</property>
+                      <object class="GtkToggleButton" id="bSFShowFindDialog">
+                        <property name="label" translatable="yes">_Find</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
                         <property name="has_tooltip">True</property>
-                        <property name="tooltip_markup" translatable="yes">Interchannel signal shift (<b>F4</b>)</property>
-                        <property name="tooltip_text" translatable="yes">Interchannel signal shift (F4)</property>
+                        <property name="tooltip_markup" translatable="yes">Find/manage patterns (<b>F3</b>)</property>
+                        <property name="tooltip_text" translatable="yes">Find/manage patterns (F3)</property>
                         <property name="valign">center</property>
+                        <property name="use_underline">True</property>
                         <property name="focus_on_click">False</property>
-                        <accelerator key="F4" signal="activate"/>
+                        <accelerator key="F3" signal="activate"/>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -4009,9 +4009,6 @@ skew:	𝑔(𝑢) = 𝑢2</property>
     <property name="title" translatable="yes">Artifact Autodetect</property>
     <property name="type_hint">dialog</property>
     <property name="transient_for">wScoringFacility</property>
-    <signal name="close" handler="gtk_widget_hide" swapped="no"/>
-    <signal name="delete-event" handler="gtk_widget_hide_on_delete" swapped="no"/>
-    <signal name="response" handler="gtk_widget_hide" swapped="no"/>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox9">
         <property name="can_focus">False</property>
@@ -4924,7 +4921,17 @@ skew:	𝑔(𝑢) = 𝑢2</property>
               </packing>
             </child>
             <child>
-              <placeholder/>
+              <object class="GtkLabel" id="lSFADDirtyPercent">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">13</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
             </child>
             <child>
               <placeholder/>
@@ -4951,17 +4958,7 @@ skew:	𝑔(𝑢) = 𝑢2</property>
               <placeholder/>
             </child>
             <child>
-              <object class="GtkLabel" id="lSFADDirtyPercent">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">label</property>
-              </object>
-              <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">13</property>
-                <property name="width">1</property>
-                <property name="height">1</property>
-              </packing>
+              <placeholder/>
             </child>
           </object>
           <packing>
@@ -5343,4 +5340,10 @@ skew:	𝑔(𝑢) = 𝑢2</property>
       <widget name="label39"/>
     </widgets>
   </object>
+  <object class="GtkSizeGroup" id="zButton">
+    <widgets>
+      <widget name="bSFADProfileSave"/>
+      <widget name="bSFADProfileDelete"/>
+    </widgets>
+  </object>
 </interface>
diff --git a/src/expdesign/primaries.cc b/src/expdesign/primaries.cc
index b17611f..d5cc114 100644
--- a/src/expdesign/primaries.cc
+++ b/src/expdesign/primaries.cc
@@ -135,6 +135,7 @@ for_all_subjects( const TSubjectOpFun& F, const TSubjectReportFun& report, const
 		}
 		F( *get<1>(v[i]));
 	}
+#pragma omp barrier
 }
 
 
@@ -162,6 +163,7 @@ for_all_episodes( const TEpisodeOpFun& F, const TEpisodeReportFun& report, const
 		}
 		F( *get<3>(v[i]));
 	}
+#pragma omp barrier
 }
 
 
@@ -194,6 +196,7 @@ for_all_recordings( const TRecordingOpFun& F, const TRecordingReportFun& report,
 		}
 		F( *get<4>(v[i]));
 	}
+#pragma omp barrier
 }
 
 void
@@ -231,6 +234,7 @@ for_all_modruns( const TModelRunOpFun& F, const TModelRunReportFun& report, cons
 		}
 		F( *get<6>(v[i]));
 	}
+#pragma omp barrier
 }
 
 
diff --git a/src/ui/ed-construct.cc b/src/ui/ed-construct.cc
index b755a9e..583849f 100644
--- a/src/ui/ed-construct.cc
+++ b/src/ui/ed-construct.cc
@@ -746,7 +746,8 @@ SExpDesignUIWidgets ()
       // ------------- artifact detection profiles
 	if ( !AGH_GBGETOBJ (GtkDialog,		wGlobalArtifactDetection) ||
 	     !AGH_GBGETOBJ (GtkComboBox,	eGlobalADProfiles) ||
-	     !AGH_GBGETOBJ (GtkCheckButton,	eGlobalADKeepExisting) )
+	     !AGH_GBGETOBJ (GtkCheckButton,	eGlobalADKeepExisting) ||
+	     !AGH_GBGETOBJ (GtkButton,		bGlobalADOK) )
 		throw runtime_error ("Failed to construct widgets");
 
 	gtk_combo_box_set_model( eGlobalADProfiles,
diff --git a/src/ui/ed-populate.cc b/src/ui/ed-populate.cc
index e5f0f96..0999358 100644
--- a/src/ui/ed-populate.cc
+++ b/src/ui/ed-populate.cc
@@ -59,6 +59,7 @@ populate( bool do_load)
 		printf( "* single common EEG samplerate: %zu\n", used_eeg_samplerates.front());
 	else
 		printf( "* multiple EEG samplerates (%zu)\n", used_eeg_samplerates.size());
+	printf( "* global AD profils: %zu\n", global_artifact_detection_profiles.size());
 
 	if ( do_load ) {
 		if ( load_settings() )
diff --git a/src/ui/ed.cc b/src/ui/ed.cc
index d8188b0..4fa3f4d 100644
--- a/src/ui/ed.cc
+++ b/src/ui/ed.cc
@@ -283,8 +283,7 @@ load_artifact_detection_profiles()
 				break;
 		}
 		fclose( domien);
-	} else
-		fprintf( stderr, "failed to open $EXPROOT/.AD_profiles for reading\n");
+	}
 }
 
 void
@@ -294,6 +293,9 @@ save_artifact_detection_profiles() const
 	// libconfig::Config conf;
 	// auto&	root = conf.getRoot();
 	// auto&	profiles = root.add("profiles", libconfig::Setting::Type::TypeArray);
+	if ( global_artifact_detection_profiles.size() == 0 )
+		return;
+
 	FILE *domien = fopen( (ED->session_dir() + "/.AD_profiles").c_str(), "w");
 	if ( domien ) {
 		for ( auto &P : global_artifact_detection_profiles ) {
diff --git a/src/ui/sf-artifacts_cb.cc b/src/ui/sf-artifacts_cb.cc
index be091f4..51cfcf6 100644
--- a/src/ui/sf-artifacts_cb.cc
+++ b/src/ui/sf-artifacts_cb.cc
@@ -73,7 +73,7 @@ bSFADProfileDelete_clicked_cb( GtkButton*, gpointer userdata)
 	     deleting > SF._p.global_artifact_detection_profiles.size()-1 )
 		gtk_combo_box_set_active( SF.eSFADProfiles, deleting-1);
 
-	g_signal_emit_by_name( SF.eSFADProfiles, "clicked");
+	g_signal_emit_by_name( SF.eSFADProfiles, "changed");
 }
 
 
@@ -159,8 +159,12 @@ bSFADPreview_toggled_cb( GtkToggleButton *b, gpointer userdata)
 
 	if ( gtk_toggle_button_get_active(b) ) {
 		aghui::SBusyBlock bb (SF.wSFArtifactDetection);
+
+		AD.orig_signal_visible_backup = SF.using_channel->draw_original_signal;
 		AD.artifacts_backup = SF.using_channel->artifacts;
+
 		SF.using_channel -> detect_artifacts( (AD.W_V.down(), AD.P));
+		SF.using_channel -> draw_original_signal = true;
 		gtk_widget_set_sensitive( (GtkWidget*)SF.bSFADApply, TRUE);
 
 		if ( gtk_toggle_button_get_active( (GtkToggleButton*)SF.eSFADSingleChannelPreview) ) {
@@ -178,6 +182,7 @@ bSFADPreview_toggled_cb( GtkToggleButton *b, gpointer userdata)
 		SF.using_channel->artifacts = AD.artifacts_backup;
 		for ( auto& H : AD.channels_visible_backup )
 			H.first->hidden = H.second;
+		SF.using_channel->draw_original_signal = AD.orig_signal_visible_backup;
 		gtk_widget_set_sensitive( (GtkWidget*)SF.bSFADApply, FALSE);
 	}
 
@@ -194,10 +199,16 @@ bSFADPreview_toggled_cb( GtkToggleButton *b, gpointer userdata)
 gboolean
 wSFArtifactDetection_delete_event_cb(GtkWidget*, GdkEvent*, gpointer userdata)
 {
-	auto& SF = *(SScoringFacility*)userdata;
-	auto& AD = SF.artifact_detection_dialog;
-
+	bSFADCancel_clicked_cb( NULL, userdata);
+	FAFA;
 	return FALSE;
 }
 
+void
+wSFArtifactDetection_close_cb(GtkWidget*, gpointer userdata)
+{
+	bSFADCancel_clicked_cb( NULL, userdata);
+	FAFA;
+}
+
 // eof
diff --git a/src/ui/sf-construct.cc b/src/ui/sf-construct.cc
index 0ed2c04..a237aed 100644
--- a/src/ui/sf-construct.cc
+++ b/src/ui/sf-construct.cc
@@ -579,6 +579,12 @@ SScoringFacilityWidgets (SExpDesignUI& _p)
 					"text", 0,
 					NULL);
 
+	g_signal_connect( wSFArtifactDetection, "close",
+			  (GCallback)wSFArtifactDetection_close_cb,
+			  this);
+	g_signal_connect( wSFArtifactDetection, "delete-event",
+			  (GCallback)wSFArtifactDetection_delete_event_cb,
+			  this);
 	eSFADProfiles_changed_cb_handler_id =
 		g_signal_connect( eSFADProfiles, "changed",
 				  (GCallback)eSFADProfiles_changed_cb,
diff --git a/src/ui/sf-montage_cb.cc b/src/ui/sf-montage_cb.cc
index 7d15551..bbba682 100644
--- a/src/ui/sf-montage_cb.cc
+++ b/src/ui/sf-montage_cb.cc
@@ -639,6 +639,7 @@ iSFPageDetectArtifacts_activate_cb( GtkMenuItem*, gpointer userdata)
 
 	AD.W_V.up();
 	SF.populate_mSFADProfiles();
+	g_signal_emit_by_name( SF.eSFADProfiles, "changed");
 
 	g_signal_emit_by_name( SF.eSFADEstimateE, "toggled");
 	g_signal_emit_by_name( SF.eSFADEstimateE, "toggled");
@@ -652,6 +653,9 @@ iSFPageDetectArtifacts_activate_cb( GtkMenuItem*, gpointer userdata)
 
 	snprintf_buf( "Artifact detection in channel %s", SF.using_channel->name);
 	gtk_label_set_text( SF.lSFADInfo, __buf__);
+	snprintf_buf( "%4.2f%% marked", SF.using_channel->calculate_dirty_percent() * 100);
+	gtk_label_set_text( SF.lSFADDirtyPercent, __buf__);
+
 	gtk_widget_show_all( (GtkWidget*)SF.wSFArtifactDetection);
 }
 
diff --git a/src/ui/sf.hh b/src/ui/sf.hh
index 6cd8d7b..97ae746 100644
--- a/src/ui/sf.hh
+++ b/src/ui/sf.hh
@@ -625,6 +625,7 @@ class SScoringFacility
 			P;
 		sigfile::SArtifacts
 			artifacts_backup;
+		bool	orig_signal_visible_backup;
 		list<pair<SChannel*, bool>>
 			channels_visible_backup;
 		bool	suppress_preview_handler;
diff --git a/src/ui/sf_cb.hh b/src/ui/sf_cb.hh
index 6f388ca..43598c5 100644
--- a/src/ui/sf_cb.hh
+++ b/src/ui/sf_cb.hh
@@ -110,6 +110,7 @@ void iSFPageSelectionDrawDzxdf_toggled_cb( GtkCheckMenuItem*, gpointer);
 
 
 gboolean wSFArtifactDetection_delete_event_cb(GtkWidget*, GdkEvent*, gpointer);
+void wSFArtifactDetection_close_cb(GtkWidget*, gpointer);
 void eSFADProfiles_changed_cb( GtkComboBox*, gpointer);
 void bSFADProfileSave_clicked_cb( GtkButton*, gpointer);
 void bSFADProfileDelete_clicked_cb( GtkButton*, gpointer);

-- 
Sleep experiment manager



More information about the debian-med-commit mailing list