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

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


The following commit has been merged in the master branch:
commit 9fc26466abff9be8a04076c0fee5bea47651785b
Author: andrei zavada <johnhommer at gmail.com>
Date:   Thu Oct 18 02:47:23 2012 +0300

    complete migration of ED settings to SUIVarCollection

diff --git a/data/main.glade b/data/main.glade
index 2324b22..ccc085b 100644
--- a/data/main.glade
+++ b/data/main.glade
@@ -6224,7 +6224,7 @@ EEG microcontinuity algorithm. Read more <a href="http://johnhommer.com/acade
                                 <property name="shadow_type">none</property>
                                 <property name="primary_icon_activatable">False</property>
                                 <property name="secondary_icon_activatable">False</property>
-                                <property name="digits">2</property>
+                                <property name="digits">3</property>
                                 <property name="numeric">True</property>
                               </object>
                               <packing>
@@ -6246,7 +6246,7 @@ EEG microcontinuity algorithm. Read more <a href="http://johnhommer.com/acade
                                 <property name="shadow_type">none</property>
                                 <property name="primary_icon_activatable">False</property>
                                 <property name="secondary_icon_activatable">False</property>
-                                <property name="digits">2</property>
+                                <property name="digits">3</property>
                                 <property name="numeric">True</property>
                               </object>
                               <packing>
@@ -6329,7 +6329,7 @@ EEG microcontinuity algorithm. Read more <a href="http://johnhommer.com/acade
                                 <property name="shadow_type">none</property>
                                 <property name="primary_icon_activatable">False</property>
                                 <property name="secondary_icon_activatable">False</property>
-                                <property name="digits">2</property>
+                                <property name="digits">3</property>
                                 <property name="numeric">True</property>
                               </object>
                               <packing>
@@ -6686,6 +6686,12 @@ EEG microcontinuity algorithm. Read more <a href="http://johnhommer.com/acade
                             <child>
                               <placeholder/>
                             </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
                           </object>
                         </child>
                         <child>
diff --git a/src/common/libcommon.cc b/src/common/libcommon.cc
index 3a15b65..3f2ca43 100644
--- a/src/common/libcommon.cc
+++ b/src/common/libcommon.cc
@@ -80,12 +80,12 @@ tokens( const string& s_, const char* sep)
 
 void
 agh::str::
-decompose_double( double value, float *mantissa, int *exponent)
+decompose_double( double value, double *mantissa, int *exponent)
 {
 	char buf[32];
 	snprintf( buf, 31, "%e", value);
 	*strchr( buf, 'e') = '|';
-	sscanf( buf, "%f|%d", mantissa, exponent);
+	sscanf( buf, "%lf|%d", mantissa, exponent);
 }
 
 
diff --git a/src/common/string.hh b/src/common/string.hh
index 6f16f9c..a5d58e1 100644
--- a/src/common/string.hh
+++ b/src/common/string.hh
@@ -47,7 +47,7 @@ join( const C& l, const char* sep)
 list<string> tokens( const string& s_, const char* sep);
 
 
-void decompose_double( double value, float *mantissa, int *exponent);
+void decompose_double( double value, double *mantissa, int *exponent);
 
 
 
diff --git a/src/ui/ed-settings_cb.cc b/src/ui/ed-settings_cb.cc
index bb68ac4..dfa1b25 100644
--- a/src/ui/ed-settings_cb.cc
+++ b/src/ui/ed-settings_cb.cc
@@ -23,10 +23,7 @@ using namespace aghui;
 
 extern "C"
 void
-tDesign_switch_page_cb( GtkNotebook     *notebook,
-			gpointer	 unused,
-			guint            page_num,
-			gpointer         userdata)
+tDesign_switch_page_cb( GtkNotebook*, gpointer, guint page_num, gpointer userdata)
 {
 	using namespace sigfile;
 	auto& ED = *(SExpDesignUI*)userdata;
@@ -35,7 +32,7 @@ tDesign_switch_page_cb( GtkNotebook     *notebook,
 	if ( page_num == 0 ) {  // switching back from settings tab
 
 	      // collect values from widgets
-		ED.W_V.down();
+		ED.W_V1.down();
 
 		// Profile tab
 
@@ -84,7 +81,7 @@ tDesign_switch_page_cb( GtkNotebook     *notebook,
 		ED.pagesize_item = ED.figure_pagesize_item();
 		ED.binsize_item = ED.figure_binsize_item();
 
-		ED.W_V.up();
+		ED.W_V1.up();
 
 		// colours are served specially elsewhere
 	}
@@ -101,30 +98,12 @@ tDesign_switch_page_cb( GtkNotebook     *notebook,
 
 
 inline namespace {
-void
-__widgets_to_tunables( SExpDesignUI& ED)
-{
-	using namespace agh::ach;
-	// don't mess with classed enums!
-	for ( size_t t = 0; t < (size_t)TTunable::_basic_tunables; ++t ) {
-		ED.ED->tunables0 [t] = gtk_spin_button_get_value( ED.eTunable[t][0]) / stock[t].display_scale_factor;
-		ED.ED->tlo       [t] = gtk_spin_button_get_value( ED.eTunable[t][1]) / stock[t].display_scale_factor;
-		ED.ED->thi       [t] = gtk_spin_button_get_value( ED.eTunable[t][2]) / stock[t].display_scale_factor;
-		ED.ED->tstep     [t] = gtk_spin_button_get_value( ED.eTunable[t][3]) / stock[t].display_scale_factor;
-	}
-}
-
 
 void
-__tunables_to_widgets( SExpDesignUI& ED)
+__adjust_adjustments( SExpDesignUI& ED)
 {
 	using namespace agh::ach;
 	for ( size_t t = 0; t < (size_t)TTunable::_basic_tunables; ++t ) {
-		// gtk_spin_button_set_value( ED.eTunable[t][(size_t)TTIdx::val ],	STunableSet::stock[t].display_scale_factor * ED.ED->tunables0.value[t]);
-		// gtk_spin_button_set_value( ED.eTunable[t][(size_t)TTIdx::min ],	STunableSet::stock[t].display_scale_factor * ED.ED->tunables0.lo   [t]);
-		// gtk_spin_button_set_value( ED.eTunable[t][(size_t)TTIdx::max ],	STunableSet::stock[t].display_scale_factor * ED.ED->tunables0.hi   [t]);
-		// gtk_spin_button_set_value( ED.eTunable[t][(size_t)TTIdx::step],	STunableSet::stock[t].display_scale_factor * ED.ED->tunables0.step [t]);
-
 		gtk_adjustment_configure( ED.jTunable[t][0],
 					  stock[t].display_scale_factor * ED.ED->tunables0[t],
 					  stock[t].display_scale_factor * ED.ED->tlo[t],
@@ -152,77 +131,62 @@ __tunables_to_widgets( SExpDesignUI& ED)
 	}
 }
 
+void
+__adjust_tunables_up( SExpDesignUI& ED)
+{
+	using namespace agh::ach;
+	for ( size_t t = 0; t < TTunable::_basic_tunables; ++t ) {
+		ED.ED->tunables0 [t] *= stock[t].display_scale_factor;
+		ED.ED->tlo       [t] *= stock[t].display_scale_factor;
+		ED.ED->thi       [t] *= stock[t].display_scale_factor;
+		ED.ED->tstep     [t] *= stock[t].display_scale_factor;
+	}
+}
+
+void
+__adjust_tunables_down( SExpDesignUI& ED)
+{
+	using namespace agh::ach;
+	for ( size_t t = 0; t < TTunable::_basic_tunables; ++t ) {
+		ED.ED->tunables0 [t] /= stock[t].display_scale_factor;
+		ED.ED->tlo       [t] /= stock[t].display_scale_factor;
+		ED.ED->thi       [t] /= stock[t].display_scale_factor;
+		ED.ED->tstep     [t] /= stock[t].display_scale_factor;
+	}
+}
+
 } // inline namespace
 
 extern "C"
 void
-tSimulations_switch_page_cb( GtkNotebook     *notebook,
-			     gpointer	      page,
-			     guint            page_num,
-			     gpointer         userdata)
+tSimulations_switch_page_cb( GtkNotebook*, gpointer, guint page_num, gpointer userdata)
 {
 	auto& ED = *(SExpDesignUI*)userdata;
 
 	if ( page_num == 1 ) {  // switching to display parameters tab
-	      // Controlling parameters frame
-		gtk_spin_button_set_value( ED.eCtlParamAnnlNTries,	ED.ED->ctl_params0.siman_params.n_tries);
-		gtk_spin_button_set_value( ED.eCtlParamAnnlItersFixedT,	ED.ED->ctl_params0.siman_params.iters_fixed_T);
-		gtk_spin_button_set_value( ED.eCtlParamAnnlStepSize,	ED.ED->ctl_params0.siman_params.step_size);
-		gtk_spin_button_set_value( ED.eCtlParamAnnlBoltzmannk,	ED.ED->ctl_params0.siman_params.k);
-		gtk_spin_button_set_value( ED.eCtlParamAnnlDampingMu,	ED.ED->ctl_params0.siman_params.mu_t);
-		float mantissa;
-		int exponent;
-		agh::str::decompose_double( ED.ED->ctl_params0.siman_params.t_min, &mantissa, &exponent);
-		gtk_spin_button_set_value( ED.eCtlParamAnnlTMinMantissa,	mantissa);
-		gtk_spin_button_set_value( ED.eCtlParamAnnlTMinExponent,	exponent);
-		agh::str::decompose_double( ED.ED->ctl_params0.siman_params.t_initial, &mantissa, &exponent);
-		gtk_spin_button_set_value( ED.eCtlParamAnnlTInitialMantissa,	mantissa);
-		gtk_spin_button_set_value( ED.eCtlParamAnnlTInitialExponent,	exponent);
-
-	      // Achermann parameters
-		gtk_toggle_button_set_active( (GtkToggleButton*)ED.eCtlParamDBAmendment1, !ED.ED->ctl_params0.DBAmendment1); // force emission of the toggle signal
-		gtk_toggle_button_set_active( (GtkToggleButton*)ED.eCtlParamDBAmendment2, !ED.ED->ctl_params0.DBAmendment2);
-		gtk_toggle_button_set_active( (GtkToggleButton*)ED.eCtlParamAZAmendment1, !ED.ED->ctl_params0.AZAmendment1);
-		gtk_toggle_button_set_active( (GtkToggleButton*)ED.eCtlParamAZAmendment2, !ED.ED->ctl_params0.AZAmendment2);
-
-		gtk_toggle_button_set_active( (GtkToggleButton*)ED.eCtlParamDBAmendment1, ED.ED->ctl_params0.DBAmendment1);
-		gtk_toggle_button_set_active( (GtkToggleButton*)ED.eCtlParamDBAmendment2, ED.ED->ctl_params0.DBAmendment2);
-		gtk_toggle_button_set_active( (GtkToggleButton*)ED.eCtlParamAZAmendment1, ED.ED->ctl_params0.AZAmendment1);
-		gtk_toggle_button_set_active( (GtkToggleButton*)ED.eCtlParamAZAmendment2, ED.ED->ctl_params0.AZAmendment2);
-		gtk_spin_button_set_value( ED.eCtlParamNSWAPpBeforeSimStart, ED.ED->ctl_params0.swa_laden_pages_before_SWA_0);
-		gtk_spin_button_set_value( ED.eCtlParamReqScoredPercent, ED.ED->ctl_params0.req_percent_scored);
-
-	      // Unconventional scores frame
-		gtk_toggle_button_set_active( (GtkToggleButton*)ED.eCtlParamScoreUnscoredAsWake,
-					      ED.ED->ctl_params0.ScoreUnscoredAsWake);
-
-	      // Tunables tab
-		__tunables_to_widgets( ED);
+		agh::str::decompose_double(
+			ED.ED->ctl_params0.siman_params.t_min,
+			&ED.ctl_params0_siman_params_t_min_mantissa,
+			&ED.ctl_params0_siman_params_t_min_exponent);
+		agh::str::decompose_double(
+			ED.ED->ctl_params0.siman_params.t_initial,
+			&ED.ctl_params0_siman_params_t_initial_mantissa,
+			&ED.ctl_params0_siman_params_t_initial_exponent);
+		__adjust_adjustments( ED);
+		__adjust_tunables_up( ED);
+		ED.W_Vtunables.up();
+		ED.W_V2.up();
 
 	} else {
-	      // Controlling parameters frame
-		ED.ED->ctl_params0.siman_params.n_tries       = gtk_spin_button_get_value( ED.eCtlParamAnnlNTries);
-		ED.ED->ctl_params0.siman_params.iters_fixed_T = gtk_spin_button_get_value( ED.eCtlParamAnnlItersFixedT);
-		ED.ED->ctl_params0.siman_params.step_size     = gtk_spin_button_get_value( ED.eCtlParamAnnlStepSize);
-		ED.ED->ctl_params0.siman_params.k             = gtk_spin_button_get_value( ED.eCtlParamAnnlBoltzmannk);
-		ED.ED->ctl_params0.siman_params.mu_t          = gtk_spin_button_get_value( ED.eCtlParamAnnlDampingMu);
-		ED.ED->ctl_params0.siman_params.t_initial     = gtk_spin_button_get_value( ED.eCtlParamAnnlTInitialMantissa)
-			* pow(10, gtk_spin_button_get_value( ED.eCtlParamAnnlTInitialExponent));
-		ED.ED->ctl_params0.siman_params.t_min	     = gtk_spin_button_get_value( ED.eCtlParamAnnlTMinMantissa)
-			* pow(10, gtk_spin_button_get_value( ED.eCtlParamAnnlTMinExponent));
-	      // Achermann parameters
-		ED.ED->ctl_params0.DBAmendment1 = gtk_toggle_button_get_active( (GtkToggleButton*)ED.eCtlParamDBAmendment1);
-		ED.ED->ctl_params0.DBAmendment2 = gtk_toggle_button_get_active( (GtkToggleButton*)ED.eCtlParamDBAmendment2);
-		ED.ED->ctl_params0.AZAmendment1 = gtk_toggle_button_get_active( (GtkToggleButton*)ED.eCtlParamAZAmendment1);
-		ED.ED->ctl_params0.AZAmendment2 = gtk_toggle_button_get_active( (GtkToggleButton*)ED.eCtlParamAZAmendment2);
-		ED.ED->ctl_params0.swa_laden_pages_before_SWA_0	= gtk_spin_button_get_value( ED.eCtlParamNSWAPpBeforeSimStart);
-		ED.ED->ctl_params0.req_percent_scored		= gtk_spin_button_get_value( ED.eCtlParamReqScoredPercent);
-
-	      // Unconventional scores frame
-		ED.ED->ctl_params0.ScoreUnscoredAsWake = gtk_toggle_button_get_active( (GtkToggleButton*)ED.eCtlParamScoreUnscoredAsWake);
-
-	      // Tunables tab
-		__widgets_to_tunables( ED);
+		ED.W_V2.down();
+		ED.W_Vtunables.down();
+		__adjust_tunables_down( ED);
+		ED.ED->ctl_params0.siman_params.t_min =
+			ED.ctl_params0_siman_params_t_min_mantissa
+			* pow(10, ED.ctl_params0_siman_params_t_min_exponent);
+		ED.ED->ctl_params0.siman_params.t_initial =
+			ED.ctl_params0_siman_params_t_initial_mantissa
+			* pow(10, ED.ctl_params0_siman_params_t_initial_exponent);
 
 	      // for ctlparam changes to take effect on virgin modruns
 		ED.populate_2();
@@ -232,29 +196,19 @@ tSimulations_switch_page_cb( GtkNotebook     *notebook,
 
 
 
-
-
-	// // possibly for some live validation; unused for now
-	// void eCtlParamAnnlNTries_value_changed_cb( GtkSpinButton *e, gpointer u)	{ }
-	// void eCtlParamAnnlItersFixedT_value_changed_cb( GtkSpinButton *e, gpointer u)	{ }
-	// void eCtlParamAnnlStepSize_value_changed_cb( GtkSpinButton *e, gpointer u)	{ }
-	// void eCtlParamAnnlBoltzmannk_value_changed_cb( GtkSpinButton *e, gpointer u)	{ }
-	// void eCtlParamAnnlTInitial_value_changed_cb( GtkSpinButton *e, gpointer u)	{ }
-	// void eCtlParamAnnlDampingMu_value_changed_cb( GtkSpinButton *e, gpointer u)	{ }
-	// void eCtlParamAnnlTMinMantissa_value_changed_cb( GtkSpinButton *e, gpointer u)	{ }
-	// void eCtlParamAnnlTMinExponent_value_changed_cb( GtkSpinButton *e, gpointer u)	{ }
-	// void eCtlParamScoreMVTAs_toggled_cb( GtkToggleButton *e, gpointer u)		{ }
-	// void eCtlParamScoreUnscoredAs_toggled_cb( GtkToggleButton *e, gpointer u)	{ }
-
-
-
 extern "C"
 void
-bSimParamRevertTunables_clicked_cb( GtkButton *button, gpointer userdata)
+bSimParamRevertTunables_clicked_cb( GtkButton*, gpointer userdata)
 {
 	auto& ED = *(SExpDesignUI*)userdata;
+
 	ED.ED->tunables0.set_defaults();
-	__tunables_to_widgets( ED);
+	ED.ED->tlo.set_defaults();
+	ED.ED->thi.set_defaults();
+	ED.ED->tstep.set_defaults();
+
+	__adjust_tunables_up( ED);
+	ED.W_Vtunables.up();
 }
 
 
diff --git a/src/ui/ed.cc b/src/ui/ed.cc
index 2fbe498..e56e3be 100644
--- a/src/ui/ed.cc
+++ b/src/ui/ed.cc
@@ -190,38 +190,63 @@ SExpDesignUI (aghui::SSessionChooser *parent,
 	nodestroy_by_cb = false;
 
 	// bind fields to widgets
-	W_V.reg( eUltradianCycleDetectionAccuracy, &uc_accuracy_factor);
-	W_V.reg( eArtifDampenWindowType, (int*)&ED->af_dampen_window_type);
-	W_V.reg( eArtifDampenFactor, &ED->af_dampen_factor);
-	W_V.reg( eFFTParamsPageSize, &pagesize_item);
-	W_V.reg( eFFTParamsBinSize, &binsize_item);
-	W_V.reg( eFFTParamsWindowType, (int*)&ED->fft_params.welch_window_type);
+	// tab 1
+	W_V1.reg( eUltradianCycleDetectionAccuracy, &uc_accuracy_factor);
+	W_V1.reg( eArtifDampenWindowType, (int*)&ED->af_dampen_window_type);
+	W_V1.reg( eArtifDampenFactor, &ED->af_dampen_factor);
+	W_V1.reg( eFFTParamsPageSize, &pagesize_item);
+	W_V1.reg( eFFTParamsBinSize, &binsize_item);
+	W_V1.reg( eFFTParamsWindowType, (int*)&ED->fft_params.welch_window_type);
 	for ( size_t i = 0; i < sigfile::SPage::TScore::_total; ++i )
-		W_V.reg( eScoreCode[i], &ext_score_codes[i]);
-	W_V.reg( eMCParamIIRBackpolate, &ED->mc_params.iir_backpolate);
-	W_V.reg( eMCParamMCGain, &ED->mc_params.mc_gain);
-	W_V.reg( eMCParamBandWidth, &ED->mc_params.bandwidth);
+		W_V1.reg( eScoreCode[i], &ext_score_codes[i]);
+	W_V1.reg( eMCParamIIRBackpolate, &ED->mc_params.iir_backpolate);
+	W_V1.reg( eMCParamMCGain, &ED->mc_params.mc_gain);
+	W_V1.reg( eMCParamBandWidth, &ED->mc_params.bandwidth);
 	for ( size_t i = 0; i < sigfile::TBand::_total; ++i ) {
-		W_V.reg( eBand[i][0], &freq_bands[i][0]);
-		W_V.reg( eBand[i][1], &freq_bands[i][1]);
+		W_V1.reg( eBand[i][0], &freq_bands[i][0]);
+		W_V1.reg( eBand[i][1], &freq_bands[i][1]);
 	}
-	W_V.reg( eDAMsmtPPH, (int*)&timeline_pph);
-	W_V.reg( eDAMsmtTLHeight, (int*)&timeline_height);
-	W_V.reg( eDAPageHeight, (int*)&SScoringFacility::IntersignalSpace);
-	W_V.reg( eDAHypnogramHeight, (int*)&SScoringFacility::HypnogramHeight);
-	W_V.reg( eDAEMGHeight, (int*)&SScoringFacility::EMGProfileHeight);
-	W_V.reg( eBrowseCommand, &browse_command);
+	W_V1.reg( eDAMsmtPPH, (int*)&timeline_pph);
+	W_V1.reg( eDAMsmtTLHeight, (int*)&timeline_height);
+	W_V1.reg( eDAPageHeight, (int*)&SScoringFacility::IntersignalSpace);
+	W_V1.reg( eDAHypnogramHeight, (int*)&SScoringFacility::HypnogramHeight);
+	W_V1.reg( eDAEMGHeight, (int*)&SScoringFacility::EMGProfileHeight);
+	W_V1.reg( eBrowseCommand, &browse_command);
 
 	// set _saved, too
 	fft_params_welch_window_type_saved	= ED->fft_params.welch_window_type;
 	af_dampen_window_type_saved		= ED->af_dampen_window_type;
 	af_dampen_factor_saved			= ED->af_dampen_factor;
 	mc_params_saved				= ED->mc_params;
-
-	pagesize_item_saved = pagesize_item =
-		figure_pagesize_item();
-	binsize_item_saved = binsize_item =
-		figure_binsize_item();
+	pagesize_item_saved = pagesize_item	= figure_pagesize_item();
+	binsize_item_saved = binsize_item 	= figure_binsize_item();
+
+	// tab 2
+	W_V2.reg( eCtlParamAnnlNTries,		&ED->ctl_params0.siman_params.n_tries);
+	W_V2.reg( eCtlParamAnnlItersFixedT,	&ED->ctl_params0.siman_params.iters_fixed_T);
+	W_V2.reg( eCtlParamAnnlStepSize,	&ED->ctl_params0.siman_params.step_size);
+	W_V2.reg( eCtlParamAnnlBoltzmannk,	&ED->ctl_params0.siman_params.k);
+	W_V2.reg( eCtlParamAnnlDampingMu,	&ED->ctl_params0.siman_params.mu_t);
+	W_V2.reg( eCtlParamAnnlTMinMantissa,	&ctl_params0_siman_params_t_min_mantissa);
+	W_V2.reg( eCtlParamAnnlTMinExponent,	&ctl_params0_siman_params_t_min_exponent);
+	W_V2.reg( eCtlParamAnnlTInitialMantissa,&ctl_params0_siman_params_t_initial_mantissa);
+	W_V2.reg( eCtlParamAnnlTInitialExponent,&ctl_params0_siman_params_t_initial_exponent);
+
+	W_V2.reg( eCtlParamDBAmendment1, &ED->ctl_params0.DBAmendment1);
+	W_V2.reg( eCtlParamDBAmendment2, &ED->ctl_params0.DBAmendment2);
+	W_V2.reg( eCtlParamAZAmendment1, &ED->ctl_params0.AZAmendment1);
+	W_V2.reg( eCtlParamAZAmendment2, &ED->ctl_params0.AZAmendment2);
+	W_V2.reg( eCtlParamNSWAPpBeforeSimStart, (int*)&ED->ctl_params0.swa_laden_pages_before_SWA_0);
+	W_V2.reg( eCtlParamReqScoredPercent, &ED->ctl_params0.req_percent_scored);
+	W_V2.reg( eCtlParamScoreUnscoredAsWake, &ED->ctl_params0.ScoreUnscoredAsWake);
+
+	// tunables are isolated so they can be reset separately
+	for ( size_t t = 0; t < agh::ach::TTunable::_basic_tunables; ++t ) {
+		W_Vtunables.reg( eTunable[t][0], &ED->tunables0 [t]);
+		W_Vtunables.reg( eTunable[t][1], &ED->tlo       [t]);
+		W_Vtunables.reg( eTunable[t][2], &ED->thi       [t]);
+		W_Vtunables.reg( eTunable[t][3], &ED->tstep     [t]);
+	}
 
 	populate( true);
 
diff --git a/src/ui/ed.hh b/src/ui/ed.hh
index b9e6e48..6d9130d 100644
--- a/src/ui/ed.hh
+++ b/src/ui/ed.hh
@@ -309,7 +309,12 @@ class SExpDesignUI
 	sigfile::SMCParamSet
 		mc_params_saved;
 	SUIVarCollection
-		W_V;
+		W_V1,
+		W_V2, W_Vtunables;
+	double	ctl_params0_siman_params_t_min_mantissa;
+	double	ctl_params0_siman_params_t_initial_mantissa;
+	int	ctl_params0_siman_params_t_min_exponent;
+	int	ctl_params0_siman_params_t_initial_exponent;
 
       // status bar bits
 	void sb_main_progress_indicator( const char*, size_t n, size_t i);
diff --git a/src/ui/ed_cb.cc b/src/ui/ed_cb.cc
index d820e98..201f7ed 100644
--- a/src/ui/ed_cb.cc
+++ b/src/ui/ed_cb.cc
@@ -42,6 +42,11 @@ wMainWindow_delete_event_cb( GtkWidget*, GdkEvent*, gpointer userdata)
 	if ( ED.nodestroy_by_cb )
 		return TRUE;
 
+	// if the user closes the main window while in a settings tab,
+	// ensure we switch away from it and trigger any saving callbacks
+	gtk_notebook_set_current_page( ED.tDesign, 0);
+	gtk_notebook_set_current_page( ED.tSimulations, 0);
+
 	iExpClose_activate_cb( NULL, userdata);
 
 	return TRUE; // whatever

-- 
Sleep experiment manager



More information about the debian-med-commit mailing list