[med-svn] [SCM] aghermann branch, master, updated. 551e213a23b59b71cba6a9c3a282d1b60e21b854

Andrei Zavada johnhommer at gmail.com
Sun Apr 21 23:18:21 UTC 2013


The following commit has been merged in the master branch:
commit 90de00144fd81835713034eeffb7fe6bf289d3f6
Author: Andrei Zavada <johnhommer at gmail.com>
Date:   Mon Apr 22 02:12:57 2013 +0300

    fix outstanding drawing regressions after enabling rel-ts annotations/afs

diff --git a/src/ui/sf/channel.cc b/src/ui/sf/channel.cc
index 9268f9a..53f1252 100644
--- a/src/ui/sf/channel.cc
+++ b/src/ui/sf/channel.cc
@@ -461,17 +461,20 @@ mark_region_as_artifact( bool do_mark)
 {
 	if ( do_mark )
 		crecording.F().artifacts(_h).mark_artifact(
-			selection_start_time - crecording.F().start_time(),
-			selection_end_time - crecording.F().start_time());
+			selection_start_time,
+			selection_end_time);
 	else
 		crecording.F().artifacts(_h).clear_artifact(
-			selection_start_time - crecording.F().start_time(),
-			selection_end_time - crecording.F().start_time());
+			selection_start_time,
+			selection_end_time);
 
+	FAFA;
 	calculate_dirty_percent();
 
+	FAFA;
 	get_signal_filtered();
 
+	FAFA;
 	if ( type == sigfile::SChannel::TType::eeg ) {
 		get_psd_course();
 		get_psd_in_bands();
@@ -482,6 +485,7 @@ mark_region_as_artifact( bool do_mark)
 		if ( name == _p._p.AghH() )
 			_p.redraw_ssubject_timeline();
 	}
+	FAFA;
 }
 
 void
@@ -490,7 +494,7 @@ mark_region_as_annotation( const string& label, sigfile::SAnnotation::TType type
 {
 	sigfile::mark_annotation(
 		crecording.F().annotations(_h),
-		selection_start_time - crecording.F().start_time(), selection_end_time - crecording.F().start_time(),
+		selection_start_time, selection_end_time,
 		label,
 		type);
 }
diff --git a/src/ui/sf/hypnogram.cc b/src/ui/sf/hypnogram.cc
index a8ed3d0..2ce9104 100644
--- a/src/ui/sf/hypnogram.cc
+++ b/src/ui/sf/hypnogram.cc
@@ -81,10 +81,9 @@ draw_hypnogram( cairo_t *cr)
 
 		auto total_seconds = total_pages() * pagesize();
 		for ( auto &H : channels ) {
-			size_t this_sr = H.samplerate();
 			for ( auto &A : H.annotations ) {
-				cairo_move_to( cr, (double)A.span.a / this_sr / total_seconds * da_wd, 4);
-				cairo_line_to( cr, (double)A.span.z / this_sr / total_seconds * da_wd, 4);
+				cairo_move_to( cr, A.span.a / total_seconds * da_wd, 4);
+				cairo_line_to( cr, A.span.z / total_seconds * da_wd, 4);
 			}
 		}
 		cairo_stroke( cr);
@@ -97,10 +96,9 @@ draw_hypnogram( cairo_t *cr)
 
 		auto total_seconds = total_pages() * pagesize();
 		for ( auto &H : channels ) {
-			size_t this_sr = H.samplerate();
 			for ( auto &A : H.artifacts() ) {
-				cairo_move_to( cr, (double)A.a / this_sr / total_seconds * da_wd, 12);
-				cairo_line_to( cr, (double)A.z / this_sr / total_seconds * da_wd, 12);
+				cairo_move_to( cr, A.a / total_seconds * da_wd, 12);
+				cairo_line_to( cr, A.z / total_seconds * da_wd, 12);
 			}
 		}
 		cairo_stroke( cr);
diff --git a/src/ui/sf/montage.cc b/src/ui/sf/montage.cc
index a83c6bb..efac522 100644
--- a/src/ui/sf/montage.cc
+++ b/src/ui/sf/montage.cc
@@ -441,8 +441,8 @@ draw_page( cairo_t *cr,
 
 	double	half_pad = _p.pagesize() * _p.skirting_run_per1;
 
-	double	cvpa = _p.cur_xvpage_start() - crecording.F().start_time(),
-		cvpe = _p.cur_xvpage_end() - crecording.F().start_time(),
+	double	cvpa = _p.cur_xvpage_start(),
+		cvpe = _p.cur_xvpage_end(),
 		evpz = cvpe - cvpa;
       // artifacts (changed bg)
 	{
@@ -763,8 +763,8 @@ draw_montage( cairo_t* cr)
 		for ( auto &SA : common_annotations ) {
 			auto &S = *SA.first;
 			auto &A = *SA.second;
-			double	cvpa = cur_xvpage_start() - S.start_time(),
-				cvpe = cur_xvpage_end() - S.start_time(),
+			double	cvpa = cur_xvpage_start(),
+				cvpe = cur_xvpage_end(),
 				evpz = cvpe - cvpa;
 			double last_z = 0;
 			int overlap_count = 0;

-- 
Sleep experiment manager



More information about the debian-med-commit mailing list