[med-svn] [aghermann] 01/31: rename improperly named CRecording::full_pages() and total_pages()

andrei zavada hmmr-guest at alioth.debian.org
Sun Nov 10 00:34:14 UTC 2013


This is an automated email from the git hooks/post-receive script.

hmmr-guest pushed a commit to branch WIP
in repository aghermann.

commit d71d88677a134390b478b7c4b43ec0b88838be42
Author: Andrei Zavada <hmmr at ra>
Date:   Wed Nov 6 00:16:04 2013 +0200

    rename improperly named CRecording::full_pages() and total_pages()
---
 upstream/src/aghermann/expdesign/recording.cc    |   24 +++++++++++-----------
 upstream/src/aghermann/expdesign/recording.hh    |    4 ++--
 upstream/src/aghermann/rk1968/rk1968.cc          |    4 ++--
 upstream/src/aghermann/ui/mw/measurements.cc     |    3 ++-
 upstream/src/aghermann/ui/sf/controls_cb.cc      |    3 ++-
 upstream/src/aghermann/ui/sf/montage-overlays.cc |    2 +-
 upstream/src/aghermann/ui/sf/montage_cb.cc       |    2 +-
 upstream/src/aghermann/ui/sf/sf.cc               |    2 +-
 8 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/upstream/src/aghermann/expdesign/recording.cc b/upstream/src/aghermann/expdesign/recording.cc
index d9703b6..d46e83d 100644
--- a/upstream/src/aghermann/expdesign/recording.cc
+++ b/upstream/src/aghermann/expdesign/recording.cc
@@ -126,14 +126,14 @@ CProfile (CSubject& J, const string& d, const sigfile::SChannel& h,
                         pz = pa + M.hypnogram().n_pages();
               // anchor zero page, get pagesize from edf^W CBinnedPower^W either goes
                 time_t dima = F.start_time();
-                APPLOG_INFO ("adding %s of [%s, %s, %s] %zu pages (%zu full, %zu in hypnogram) recorded %s",
+                APPLOG_INFO ("adding %s of [%s, %s, %s] %zu full pages (%zu total, %zu in hypnogram) recorded %s",
                              metrics::name(params.metric), F.subject().id.c_str(), F.session(), F.episode(),
-                             M.total_pages(), M.full_pages(), M.hypnogram().n_pages(), ctime( &dima));
+                             M.full_pages(), M.total_pages(), M.hypnogram().n_pages(), ctime( &dima));
 
-                if ( pz - pa != (int)M.full_pages() ) {
-                        APPLOG_WARN ("correcting end page to match full page count in EDF: %d->%zu",
-                                     pz, pa + M.full_pages());
-                        pz = pa + M.full_pages();
+                if ( pz - pa != (int)M.total_pages() ) {
+                        APPLOG_WARN ("correcting end page to match total page count in EDF: %d->%zu",
+                                     pz, pa + M.total_pages());
+                        pz = pa + M.total_pages();
                 }
                 _pages_in_bed += (pz-pa);
 
@@ -181,14 +181,14 @@ CProfile (CRecording& M,
         int     pa = (size_t)difftime( M.F().start_time(), _0at) / _pagesize,
                 pz = (size_t)difftime( M.F().end_time(), _0at) / _pagesize;
         time_t  dima = M.F().start_time();
-        APPLOG_INFO ("adding single recording %s of [%s, %s, %s] %zu pages (%zu full, %zu in hypnogram) recorded %s",
+        APPLOG_INFO ("adding single recording %s of [%s, %s, %s] %zu full pages (%zu total, %zu in hypnogram) recorded %s",
                      metrics::name(params.metric), M.F().subject().id.c_str(), M.F().session(), M.F().episode(),
-                     M.total_pages(), M.full_pages(), M.hypnogram().n_pages(), ctime( &dima));
+                     M.full_pages(), M.total_pages(), M.hypnogram().n_pages(), ctime( &dima));
 
-        if ( pz - pa != (int)M.full_pages() ) {
-                APPLOG_WARN ("correcting end page to match full page count in EDF: %d->%zu",
-                          pz, pa + M.full_pages());
-                pz = pa + M.full_pages();
+        if ( pz - pa != (int)M.total_pages() ) {
+                APPLOG_WARN ("correcting end page to match total page count in EDF: %d->%zu",
+                          pz, pa + M.total_pages());
+                pz = pa + M.total_pages();
         }
         _pages_in_bed += (pz-pa);
 
diff --git a/upstream/src/aghermann/expdesign/recording.hh b/upstream/src/aghermann/expdesign/recording.hh
index a67af4e..a0a86c2 100644
--- a/upstream/src/aghermann/expdesign/recording.hh
+++ b/upstream/src/aghermann/expdesign/recording.hh
@@ -184,10 +184,10 @@ class CRecording {
 
         // actual page counts based on actual edf samples
         size_t
-        total_pages() const  // this is actually 'full'
+        full_pages() const
                 { return _source().recording_time() / pagesize(); }
         size_t
-        full_pages() const   // please swap names with 'total_pages'
+        total_pages() const
                 { return round(_source().recording_time() / pagesize()); }
         size_t
         total_samples() const
diff --git a/upstream/src/aghermann/rk1968/rk1968.cc b/upstream/src/aghermann/rk1968/rk1968.cc
index b075d41..63687ca 100644
--- a/upstream/src/aghermann/rk1968/rk1968.cc
+++ b/upstream/src/aghermann/rk1968/rk1968.cc
@@ -264,8 +264,8 @@ host_get_data( lua_State *L)
                 } else {
                         auto& R = Hi->second;
                         int page = lua_tointeger( L, 4);
-                        if ( page < 0 || (size_t)page >= R.total_pages() ) {
-                                make_error_return( "Page %d out of range (%zu is last)", page, R.total_pages());
+                        if ( page < 0 || (size_t)page >= R.full_pages() ) {
+                                make_error_return( "Page %d out of range (%zu is last full)", page, R.full_pages());
                         }
                         double fa = lua_tonumber( L, 5);
                         double fz = lua_tonumber( L, 6);
diff --git a/upstream/src/aghermann/ui/mw/measurements.cc b/upstream/src/aghermann/ui/mw/measurements.cc
index 9423288..36f433c 100644
--- a/upstream/src/aghermann/ui/mw/measurements.cc
+++ b/upstream/src/aghermann/ui/mw/measurements.cc
@@ -234,7 +234,8 @@ draw_timeline( cairo_t *cr) const
                                         auto    dxe = tl_left_margin() + e_pixel_start,
                                                 dye = tl_height() - 12;
                                         cairo_move_to( cr, dxe, dye - F(0.) * tl_height()/2);
-                                        for ( size_t i = 0; i < M.total_pages(); ++i ) {
+                                        const size_t pp = M.full_pages();
+                                        for ( size_t i = 0; i < pp; ++i ) {
                                                 float t = i * M.pagesize() / 60.;
                                                 cairo_line_to( cr,
                                                                dxe + (t*60/M.F().recording_time()) * e_pixels,
diff --git a/upstream/src/aghermann/ui/sf/controls_cb.cc b/upstream/src/aghermann/ui/sf/controls_cb.cc
index 06b832e..37af65a 100644
--- a/upstream/src/aghermann/ui/sf/controls_cb.cc
+++ b/upstream/src/aghermann/ui/sf/controls_cb.cc
@@ -120,7 +120,8 @@ bSFGotoNextUnscored_clicked_cb(
                 return;
 
         size_t p = SF.cur_page();
-        while ( ++p < SF.total_pages() )
+        auto tp = SF.total_pages();
+        while ( ++p < tp )
                 if ( SF.hypnogram[p] == sigfile::SPage::score_code(sigfile::SPage::TScore::none) ) {
                         SF.sb_clear();
                         SF.set_cur_vpage( SF.p2ap(p));
diff --git a/upstream/src/aghermann/ui/sf/montage-overlays.cc b/upstream/src/aghermann/ui/sf/montage-overlays.cc
index 22c05aa..bfbdd89 100644
--- a/upstream/src/aghermann/ui/sf/montage-overlays.cc
+++ b/upstream/src/aghermann/ui/sf/montage-overlays.cc
@@ -115,7 +115,7 @@ draw_overlays( cairo_t* cr,
                 }
 
                 if ( draw_spectrum and _p.pagesize_is_right()
-                     and _p.cur_page() < crecording.full_pages() ) {
+                     and _p.cur_page() < crecording.total_pages() ) {
                         guint   gx = 120,
                                 gy = ptop + 25,
                                 gh = min( 60.f, pbot - ptop - 5),
diff --git a/upstream/src/aghermann/ui/sf/montage_cb.cc b/upstream/src/aghermann/ui/sf/montage_cb.cc
index 6a2a6d7..b061ecf 100644
--- a/upstream/src/aghermann/ui/sf/montage_cb.cc
+++ b/upstream/src/aghermann/ui/sf/montage_cb.cc
@@ -169,7 +169,7 @@ daSFMontage_button_press_event_cb(
                         Ch->signal_display_scale =
                                 agh::alg::calibrate_display_scale(
                                         Ch->draw_filtered_signal ? Ch->signal_filtered : Ch->signal_original,
-                                        SF.vpagesize() * Ch->samplerate() * min (Ch->crecording.total_pages(), (size_t)10),
+                                        SF.vpagesize() * Ch->samplerate() * min (Ch->crecording.full_pages(), (size_t)10),
                                         SF.interchannel_gap / 2);
                         if ( event->state & GDK_CONTROL_MASK )
                                 for ( auto& H : SF.channels )
diff --git a/upstream/src/aghermann/ui/sf/sf.cc b/upstream/src/aghermann/ui/sf/sf.cc
index 51ea877..a8b2db7 100644
--- a/upstream/src/aghermann/ui/sf/sf.cc
+++ b/upstream/src/aghermann/ui/sf/sf.cc
@@ -174,7 +174,7 @@ SScoringFacility (agh::CSubject& J,
                         h.signal_display_scale =
                                 agh::alg::calibrate_display_scale(
                                         h.signal_filtered,
-                                        vpagesize() * h.samplerate() * min (h.crecording.total_pages(), (size_t)10),
+                                        vpagesize() * h.samplerate() * min (h.crecording.full_pages(), (size_t)10),
                                         interchannel_gap / 2);
                 agh::alg::ensure_within( h.signal_display_scale, 1e-6, 1e6);
 

-- 
Alioth's /git/debian-med/git-commit-notice on /srv/git.debian.org/git/debian-med/aghermann.git



More information about the debian-med-commit mailing list