The following commit has been merged in the master branch:
commit 849128b5bab83dee4397af493342b56ed45929c4
Author: Andrei Zavada <[email protected]>
Date:   Tue Apr 30 20:37:08 2013 +0300

    regression related to SScoringFacility::SChannel::type getting unused

diff --git a/src/ui/mw/mainmenu_cb.cc b/src/ui/mw/mainmenu_cb.cc
index 5137a77..5e0ba6f 100644
--- a/src/ui/mw/mainmenu_cb.cc
+++ b/src/ui/mw/mainmenu_cb.cc
@@ -309,7 +309,7 @@ iExpGloballyDetectArtifacts_activate_cb(
 
        for ( auto& SF : ED.open_scoring_facilities ) {
                for ( auto& H : SF->channels )
-                       if ( H.type == sigfile::SChannel::TType::eeg )
+                       if ( H.schannel().type() == 
sigfile::SChannel::TType::eeg )
                                H.get_signal_filtered();
                SF->queue_redraw_all();
        }
@@ -374,7 +374,7 @@ iExpGloballySetFilters_activate_cb(
 
                for ( auto& SF : ED.open_scoring_facilities ) {
                        for ( auto& H : SF->channels )
-                               if ( H.type == sigfile::SChannel::TType::eeg )
+                               if ( H.schannel().type() == 
sigfile::SChannel::TType::eeg )
                                        H.get_signal_filtered();
                        SF->queue_redraw_all();
                }
diff --git a/src/ui/sf/channel.cc b/src/ui/sf/channel.cc
index a443a46..ef1ce26 100644
--- a/src/ui/sf/channel.cc
+++ b/src/ui/sf/channel.cc
@@ -144,7 +144,7 @@ SChannel (agh::CRecording& r,
                // don't: interchannel_gap is rubbish yet
                psd.focused_band = metrics::psd::TBand::delta;
 
-       } else if ( type == sigfile::SChannel::TType::emg )
+       } else if ( schannel().type() == sigfile::SChannel::TType::emg )
                get_raw_profile();
 
       // let it be so to avoid libconfig::readFile throwing exceptions
@@ -297,7 +297,7 @@ tuple<metrics::TType, valarray<TFloat>&>
 aghui::SScoringFacility::SChannel::
 which_profile( const metrics::TType metric)
 {
-       switch ( type ) {
+       switch ( schannel().type() ) {
        case sigfile::SChannel::TType::eeg:
                switch ( metric ) {
                case metrics::TType::mc:
@@ -388,7 +388,7 @@ detect_artifacts( const metrics::mc::SArtifactDetectionPP& 
P)
 
        calculate_dirty_percent();
        get_signal_filtered();
-       if ( type == sigfile::SChannel::TType::eeg ) {
+       if ( schannel().type() == sigfile::SChannel::TType::eeg ) {
                get_psd_course();
                get_psd_in_bands();
                get_spectrum( _p.cur_page());
@@ -430,7 +430,7 @@ mark_flat_regions_as_artifacts( const double minsize, const 
double pad)
 
        calculate_dirty_percent();
        get_signal_filtered();
-       if ( type == sigfile::SChannel::TType::eeg ) {
+       if ( schannel().type() == sigfile::SChannel::TType::eeg ) {
                get_psd_course();
                get_psd_in_bands();
                get_spectrum( _p.cur_page());
@@ -466,7 +466,7 @@ mark_region_as_artifact( const bool do_mark)
 
        get_signal_filtered();
 
-       if ( type == sigfile::SChannel::TType::eeg ) {
+       if ( schannel().type() == sigfile::SChannel::TType::eeg ) {
                get_psd_course();
                get_psd_in_bands();
                get_spectrum( _p.cur_page());
@@ -531,8 +531,8 @@ update_channel_menu_items( const double x)
        gtk_check_menu_item_set_active( _p.iSFPageSelectionDrawEnvelope, 
draw_selection_envelope);
        gtk_check_menu_item_set_active( _p.iSFPageSelectionDrawDzxdf,    
draw_selection_dzcdf);
 
-       bool    is_eeg = (type == sigfile::SChannel::TType::eeg),
-               is_emg = (type == sigfile::SChannel::TType::emg),
+       bool    is_eeg = (schannel().type() == sigfile::SChannel::TType::eeg),
+               is_emg = (schannel().type() == sigfile::SChannel::TType::emg),
                have_profile = is_eeg or is_emg;
        gtk_widget_set_visible( (GtkWidget*)_p.iSFPageProfilesSubmenuSeparator, 
have_profile);
        gtk_widget_set_visible( (GtkWidget*)_p.iiSFPageProfiles,                
have_profile);
@@ -569,7 +569,7 @@ update_power_menu_items()
        gtk_check_menu_item_set_active( _p.iSFPowerAutoscale,     
(gboolean)autoscale_profile);
 
        gtk_widget_set_visible( (GtkWidget*)_p.iSFPowerDrawBands,
-                               (type == sigfile::SChannel::TType::eeg &&
+                               (schannel().type() == 
sigfile::SChannel::TType::eeg &&
                                 draw_psd));
        _p.suppress_redraw = false;
 }
diff --git a/src/ui/sf/d/phasediff-construct.cc 
b/src/ui/sf/d/phasediff-construct.cc
index 89d2c78..8b9a6b8 100644
--- a/src/ui/sf/d/phasediff-construct.cc
+++ b/src/ui/sf/d/phasediff-construct.cc
@@ -36,7 +36,7 @@ SPhasediffDialogWidgets (SScoringFacility& SF)
 
        // filter channels we don't have
        for ( auto &H : SF.channels )
-               if ( H.type == sigfile::SChannel::TType::eeg ) {
+               if ( H.schannel().type() == sigfile::SChannel::TType::eeg ) {
                        GtkTreeIter iter;
                        gtk_list_store_append( mSFPDChannels, &iter);
                        gtk_list_store_set( mSFPDChannels, &iter,
diff --git a/src/ui/sf/ica.cc b/src/ui/sf/ica.cc
index 49cb581..75ceedd 100644
--- a/src/ui/sf/ica.cc
+++ b/src/ui/sf/ica.cc
@@ -278,7 +278,7 @@ apply_remix( const bool do_backup)
                H.signal_reconstituted = valarray<TFloat> (0);
                H.get_signal_original();
                H.get_signal_filtered();
-               if ( H.type ==  sigfile::SChannel::TType::eeg ) {
+               if ( H.schannel().type() ==  sigfile::SChannel::TType::eeg ) {
                        H.get_psd_course();
                        H.get_psd_in_bands();
                        H.get_mc_course();
diff --git a/src/ui/sf/montage-overlays.cc b/src/ui/sf/montage-overlays.cc
index 4858143..0174827 100644
--- a/src/ui/sf/montage-overlays.cc
+++ b/src/ui/sf/montage-overlays.cc
@@ -31,7 +31,7 @@ draw_overlays( cairo_t* cr,
        bool    overlay = false;
 
        // PSD profile
-       if ( draw_psd and type == sigfile::SChannel::TType::eeg ) {
+       if ( draw_psd and schannel().type() == sigfile::SChannel::TType::eeg ) {
                overlay = true;
 
                cairo_set_line_width( cr, 1.);
@@ -175,7 +175,7 @@ draw_overlays( cairo_t* cr,
                }
        }
 
-       if ( draw_mc and type == sigfile::SChannel::TType::eeg ) {
+       if ( draw_mc and schannel().type() == sigfile::SChannel::TType::eeg ) {
                overlay = true;
 
                cairo_set_line_width( cr, 1.);
@@ -222,7 +222,7 @@ draw_overlays( cairo_t* cr,
 
        }
 
-       if ( draw_swu and type == sigfile::SChannel::TType::eeg ) {
+       if ( draw_swu and schannel().type() == sigfile::SChannel::TType::eeg ) {
                overlay = true;
 
                cairo_set_line_width( cr, 1.);
@@ -296,7 +296,7 @@ draw_overlays( cairo_t* cr,
 
       // EMG profile
        if ( draw_emg and
-            type == sigfile::SChannel::TType::emg ) {
+            schannel().type() == sigfile::SChannel::TType::emg ) {
                overlay = true;
 
                cairo_pattern_t *cp = cairo_pattern_create_linear( 0., 
pbot-EMGProfileHeight, 0., pbot);
diff --git a/src/ui/sf/montage.cc b/src/ui/sf/montage.cc
index af1bd39..6973e2e 100644
--- a/src/ui/sf/montage.cc
+++ b/src/ui/sf/montage.cc
@@ -357,7 +357,7 @@ draw_page( cairo_t *cr,
 
                        // MC metrics
                        if ( _p.mode != SScoringFacility::TMode::marking &&
-                            type == sigfile::SChannel::TType::eeg &&
+                            schannel().type() == sigfile::SChannel::TType::eeg 
&&
                             selection_end_time - selection_start_time > 2. ) {
 
                                cairo_set_font_size( cr, 12);
diff --git a/src/ui/sf/montage_cb.cc b/src/ui/sf/montage_cb.cc
index ce054ce..bcb871d 100644
--- a/src/ui/sf/montage_cb.cc
+++ b/src/ui/sf/montage_cb.cc
@@ -125,7 +125,7 @@ daSFMontage_button_press_event_cb(
 
        auto Ch = SF.using_channel = SF.channel_near( event->y);
 
-       if ( Ch->type == sigfile::SChannel::TType::eeg &&
+       if ( Ch->schannel().type() == sigfile::SChannel::TType::eeg &&
             (Ch->draw_psd || Ch->draw_mc) && event->y > Ch->zeroy ) {
                switch ( event->button ) {
                case 1:
@@ -146,7 +146,7 @@ daSFMontage_button_press_event_cb(
                    break;
                }
 
-       } else if ( Ch->type == sigfile::SChannel::TType::emg &&
+       } else if ( Ch->schannel().type() == sigfile::SChannel::TType::emg &&
                    Ch->draw_emg && event->y > Ch->zeroy ) {
                switch ( event->button ) {
                case 1:
@@ -324,7 +324,7 @@ daSFMontage_button_release_event_cb(
                                gtk_menu_popup( SF.iiSFPageSelection,
                                                NULL, NULL, NULL, NULL, 3, 
event->time);
                        }
-               } else if ( Ch->type == sigfile::SChannel::TType::eeg &&
+               } else if ( Ch->schannel().type() == 
sigfile::SChannel::TType::eeg &&
                            (Ch->draw_psd || Ch->draw_mc) && event->y > 
Ch->zeroy )
                        SF.set_cur_vpage( (event->x / SF.da_wd) * 
SF.total_vpages());
                else {
@@ -440,13 +440,13 @@ daSFMontage_scroll_event_cb(
                        }
                        if ( event->state & GDK_CONTROL_MASK )
                                for ( auto& H : SF.channels ) {
-                                       if ( Ch->type == 
sigfile::SChannel::TType::eeg &&
-                                            H.type == 
sigfile::SChannel::TType::eeg ) {
+                                       if ( Ch->schannel().type() == 
sigfile::SChannel::TType::eeg &&
+                                            H.schannel().type() == 
sigfile::SChannel::TType::eeg ) {
                                                H.psd.display_scale = 
Ch->psd.display_scale;
                                                H.mc.display_scale  = 
Ch->mc.display_scale;
                                                H.swu.display_scale = 
Ch->swu.display_scale;
-                                       } else if ( Ch->type == 
sigfile::SChannel::TType::emg &&
-                                            H.type == 
sigfile::SChannel::TType::emg )
+                                       } else if ( Ch->schannel().type() == 
sigfile::SChannel::TType::emg &&
+                                            H.schannel().type() == 
sigfile::SChannel::TType::emg )
                                                H.signal_display_scale = 
Ch->signal_display_scale;
                                }
                        gtk_widget_queue_draw( wid);
@@ -727,7 +727,7 @@ iSFPageFilter_activate_cb(
                H.filters = FD.P;
                H.get_signal_filtered();
 
-               if ( H.type == sigfile::SChannel::TType::eeg ) {
+               if ( H.schannel().type() == sigfile::SChannel::TType::eeg ) {
                        H.get_psd_course();
                        H.get_psd_in_bands();
                        H.get_spectrum( SF.cur_page());
@@ -793,7 +793,7 @@ iSFPageArtifactsClear_activate_cb(
                SF.using_channel->artifacts().clear();
                SF.using_channel->get_signal_filtered();
 
-               if ( SF.using_channel->type == sigfile::SChannel::TType::eeg ) {
+               if ( SF.using_channel->schannel().type() == 
sigfile::SChannel::TType::eeg ) {
                        SF.using_channel->get_psd_course();
                        SF.using_channel->get_psd_in_bands();
                        SF.using_channel->get_spectrum();
@@ -1258,7 +1258,7 @@ iSFPowerSmooth_toggled_cb(
        auto& SF = *(SScoringFacility*)userdata;
        if ( SF.suppress_redraw )
                return;
-       if ( likely (SF.using_channel->type == sigfile::SChannel::TType::eeg ) 
) {
+       if ( likely (SF.using_channel->schannel().type() == 
sigfile::SChannel::TType::eeg ) ) {
                SF.using_channel->resample_power = 
(bool)gtk_check_menu_item_get_active( menuitem);
                SF.using_channel->get_psd_course();
                SF.using_channel->get_psd_in_bands();
diff --git a/src/ui/sf/sf.cc b/src/ui/sf/sf.cc
index 7a74c50..b32bac8 100644
--- a/src/ui/sf/sf.cc
+++ b/src/ui/sf/sf.cc
@@ -155,7 +155,7 @@ SScoringFacility (agh::CSubject& J,
        n_eeg_channels =
                count_if( channels.begin(), channels.end(),
                          [] (const SChannel& h)
-                         { return h.type == sigfile::SChannel::TType::eeg; });
+                         { return h.schannel().type() == 
sigfile::SChannel::TType::eeg; });
 
       // load montage, recalibrate display scales as necessary
        load_montage();
@@ -171,7 +171,7 @@ SScoringFacility (agh::CSubject& J,
                                        interchannel_gap / 2);
                agh::alg::ensure_within( h.signal_display_scale, 1e-9, 1e9);
 
-               if ( h.type == sigfile::SChannel::TType::eeg ) {
+               if ( h.schannel().type() == sigfile::SChannel::TType::eeg ) {
                      // calibrate profile display scales
                        if ( not isfinite(h.psd.display_scale) )
                                h.psd.display_scale =
@@ -472,7 +472,7 @@ set_cur_vpage( size_t p, const bool touch_self)
        if ( ap2p(p) != _cur_page ) { // vpage changed but page is same
                _cur_page = ap2p(p);
                for ( auto& H : channels )
-                       if ( H.type == sigfile::SChannel::TType::eeg && 
H.draw_spectrum )
+                       if ( H.schannel().type() == 
sigfile::SChannel::TType::eeg && H.draw_spectrum )
                                H.get_spectrum( _cur_page);
 
                gtk_widget_set_sensitive( (GtkWidget*)bSFForward, _cur_vpage < 
total_vpages()-1);
@@ -693,9 +693,9 @@ load_montage()
                h.selection_end = h.selection_end_time * h.samplerate();
 
              // make sure these won't cause any confusion later
-               if ( h.type == sigfile::SChannel::TType::eeg )
+               if ( h.schannel().type() == sigfile::SChannel::TType::eeg )
                        h.draw_emg = false;
-               if ( h.type == sigfile::SChannel::TType::emg )
+               if ( h.schannel().type() == sigfile::SChannel::TType::emg )
                        h.draw_psd = h.draw_swu = h.draw_mc = false;
        }
 
diff --git a/src/ui/sf/sf.hh b/src/ui/sf/sf.hh
index 00cbcbf..354fde7 100644
--- a/src/ui/sf/sf.hh
+++ b/src/ui/sf/sf.hh
@@ -73,8 +73,6 @@ class SScoringFacility
                DELETE_DEFAULT_METHODS (SChannel);
 
                string  name;
-               sigfile::SChannel::TType
-                       type;
                bool operator==( const string&) const;
                bool operator==( const SChannel&) const;
 

-- 
Sleep experiment manager

_______________________________________________
debian-med-commit mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to