[med-svn] [SCM] aghermann branch, master, updated. 4f7a3b774136ffffbaf9b05d90bd568347bc5461
Andrei Zavada
johnhommer at gmail.com
Fri Nov 16 00:50:18 UTC 2012
The following commit has been merged in the master branch:
commit 9fa3c94e38b6002b919b2a7c517fd3af6caa12cf
Author: Andrei Zavada <johnhommer at gmail.com>
Date: Sun Oct 14 21:56:05 2012 +0300
better signal size methods for CRecording
diff --git a/src/expdesign/recording.hh b/src/expdesign/recording.hh
index 101d4e1..b715f63 100644
--- a/src/expdesign/recording.hh
+++ b/src/expdesign/recording.hh
@@ -74,15 +74,25 @@ class CRecording
return _source.end_time();
}
- // this one is damn identical in two bases
+ // this one damn identical in two bases
size_t pagesize() const
{
return ((sigfile::CBinnedPower*)this) -> sigfile::CPageMetrics_base::pagesize();
}
- size_t pages() const
+
+ size_t total_pages() const
{
return _source.recording_time() / pagesize();
}
+ size_t full_pages() const
+ {
+ return round(_source.recording_time() / pagesize());
+ }
+ size_t total_samples() const
+ {
+ return _source.recording_time() * _source.samplerate(_sig_no);
+ }
+
// cut through, and cache it please
template <typename T>
diff --git a/src/ui/expdesign-measurements.cc b/src/ui/expdesign-measurements.cc
index 408f6c2..29f14d4 100644
--- a/src/ui/expdesign-measurements.cc
+++ b/src/ui/expdesign-measurements.cc
@@ -238,7 +238,7 @@ draw_timeline( cairo_t *cr) const
auto dxe = tl_left_margin() + e_pixel_start,
dye = timeline_height() - 12;
cairo_move_to( cr, dxe, dye - F(0.) * timeline_height()/2);
- for ( size_t i = 0; i < M.pages(); ++i ) {
+ for ( size_t i = 0; i < M.total_pages(); ++i ) {
float t = i * M.pagesize() / 60.;
cairo_line_to( cr,
dxe + (t*60/M.F().recording_time()) * e_pixels,
--
Sleep experiment manager
More information about the debian-med-commit
mailing list