View Single Post
Posts: 197 | Thanked: 101 times | Joined on Dec 2009 @ Netherlands
#113
I played with Yscale a bit and noticed that triger levels are influenced by it. To fix this I made the following change:
Code:
--- functions_record.py.org     2010-08-21 12:07:17.000000000 +0200
+++ functions_record.py 2010-08-21 13:07:09.000000000 +0200
@@ -103,7 +103,8 @@
             Xder=0
             Yder=0
             XYder=0
-        records.arrData[3][i]=min(XYder*data.Yscale,  data.Ysize-17) #cut off if higher than graph border
+#        records.arrData[3][i]=min(XYder*data.Yscale,  data.Ysize-17) #cut off if higher than graph border
+        records.arrData[3][i]=XYder
         records.arrData[4][i]=lastindexovertrigger
 #        if(records.arrData[3][i]>data.Trigger): #over trigger
 #            lastindexovertrigger=i
@@ -304,7 +305,8 @@
             if(records.arrData[3][p+j]>peak): peak=records.arrData[3][p+j]
         x=i/Xscale
 #        x=i/Xscale+1
-        paint.drawLine(x, data.Ysize-peak-1-15, x, data.Ysize-1-15)  #draw yellow movement bar
+        h=min(peak*data.Yscale,  data.Ysize-17) #cut off if higher than graph border
+        paint.drawLine(x, data.Ysize-h-1-15, x, data.Ysize-1-15)  #draw yellow movement bar
         
         
         if(peak>data.Trigger):
the changes just applies the scaling at drawing time and does not change the actual measurements data!

With this change you can savely change the yscale parameter in the SleepAnalyser.conf file.

My 'movements' are inte order of 10 to 20. With a yscale of 1 the graph is quite difficult to read. Using yscale=4 gives me a much nicer view of the record.