Reply
Thread Tools
Posts: 193 | Thanked: 201 times | Joined on Dec 2009 @ Subotica, Serbia
#111
Could you add a new option, checkbox, which when checked the application stops recording movement when the alarm is started.
As it is now I always get a big spike at the end, probably because I'm lifting up the N900 to hit the button to turn off the alarm.

It has the duration of the whole sleep. It would be nice to know the duration of REM sleep to.
__________________
Demine
PeQersi
 
Posts: 51 | Thanked: 13 times | Joined on May 2010 @ Poland
#112
Originally Posted by convulted View Post
This is a bug in data.py, and happens when the config file is not found. "Sample_smoothing = ..." in data.py needs to change to "sample_smoothing = ...". (Or, "sample_smoothing" in main.py needs to change to "Sample_smoothing". Not sure.)
I've had the same problem. I've changed "Sample_smoothing = ..." into "sample_smoothing = ..." and now it's working like a charm thx

Last edited by kamil365; 2010-08-21 at 09:12.
 
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.
 
Posts: 197 | Thanked: 101 times | Joined on Dec 2009 @ Netherlands
#114
The durations are still printed using AM/PM format. The follwong change fixes that:

Code:
--- main.py.org 2010-08-21 12:07:23.000000000 +0200
+++ main.py     2010-08-21 13:18:25.000000000 +0200
@@ -725,7 +725,7 @@                                                                                                                           
 #        diff_tuple=Seconds2Tuple(diff_sec)                                                                                                  
 #        print diff_tuple,  records.StartTime_tuple,  EndTime_tuple                                                                          
 #        diff=strftime("%H:%M:%S", diff_tuple)                                                                                               
-        diff=time.strftime("%X", time.gmtime(diff_sec))                                                                                      
+        diff=time.strftime("%H:%M:%S", time.gmtime(diff_sec))                                                                                
         if(diff_sec>86400): d="1 day, " #longer than 24h                                                                                     
         else: d=""                                                                                                                           
         self.ui.lblTimes.setText(str(d0)+"  -  "+str(d1)+"  (Duration: "+d+str(diff)+")")                                                    
@@ -1157,7 +1157,7 @@                                                                           
             d1=strftime("%a. %d.%m.%Y  %H:%M:%S", EndTime_tuple)                         
                                                                                          
         diff_sec=records.Index*records.Sampling_interval*records.Value_smoothing/1000    
-        diff=time.strftime("%X", time.gmtime(diff_sec))                                  
+        diff=time.strftime("%H:%M:%S", time.gmtime(diff_sec))                            
                                                                                          
         if(diff_sec>86400): diff="1 day, "+diff #longer than 24h
 
rm42's Avatar
Posts: 963 | Thanked: 626 times | Joined on Sep 2009 @ Connecticut, USA
#115
Just installed from devel (never installed before) and the app won't start.
__________________
-- Worse than not knowing is not wanting to know! --

http://temporaryland.wordpress.com/
 
Posts: 437 | Thanked: 90 times | Joined on Nov 2006
#116
Originally Posted by rm42 View Post
Just installed from devel (never installed before) and the app won't start.
This seems to be a known issue. See post #107 and post #109. It would be best to let the developer fix this problem if you don't understand how to apply the fix in post #109.
 
caco3's Avatar
Posts: 560 | Thanked: 423 times | Joined on May 2010 @ Switzerland
#117
Wow, what a great response

Thank you all for the ideas and the bug fixes.
I fixed the config bug, added the stop function (mmlado's request) and corrected the displayed duration time (thanks to mirakels).
I also included mirakels change for Yscale, how ever I do not suggest to increase Yscale. If I have it bigger than 1, I mainly see noise.
Maybe you can show us some screenshots?

@mmlados:
I do not see a way to properly detect when you are in the REM. Because of that i also do not know how to measure its time.
Maybe in a later version, when we have more expirience with the data.

Please check the latest version and report any bugs.
__________________
On N9 check out this:
CacheMe 4 the N9, a geocaching client / MiniBible, a bible viewer / TheWord brings daily bible verses onto your phone / BatteryGraph to monitor the battery drainage / doublepress2unlock to unlock your phone with a double press onto the power button / GPRS Data Usage to monitor your GPRS data usage /
and more...

On N900 check out this: SleepAnalyser to analyse your sleep movements / PasswordMaker a for a password generator
 

The Following 2 Users Say Thank You to caco3 For This Useful Post:
Posts: 197 | Thanked: 101 times | Joined on Dec 2009 @ Netherlands
#118
I guess it all depends on what th trigger level will be (e.g. how soft your matras is and how wild youre movements are during the night

Anyway here are two screenshots. One with Yscale=1 and one with Yscale=4.

I thing the one with yscale=4 shows a much better picture...
Attached Images
  
 
caco3's Avatar
Posts: 560 | Thanked: 423 times | Joined on May 2010 @ Switzerland
#119
Hmm, I see, your graphs are indeed much smaller. Either you have a much harder matress, put your phone further away or have a very smooth sleep

I guess I should add Yscale to the config screen.
How ever as it is already full, I first have to figure out how to make it scrollable.
__________________
On N9 check out this:
CacheMe 4 the N9, a geocaching client / MiniBible, a bible viewer / TheWord brings daily bible verses onto your phone / BatteryGraph to monitor the battery drainage / doublepress2unlock to unlock your phone with a double press onto the power button / GPRS Data Usage to monitor your GPRS data usage /
and more...

On N900 check out this: SleepAnalyser to analyse your sleep movements / PasswordMaker a for a password generator
 
eitama's Avatar
Posts: 702 | Thanked: 334 times | Joined on Feb 2010 @ Israel.
#120
Hey Hey!

The last 3 versions before this one, did not start on my device.
Today I updated, fired it up, and it's now running!

Gonna try it tonight!!! Woohoo!

Cheers mate!
__________________
| Developer of Horizontal-Call - Call your contacts, fast! |
| Reverse SSH - access your N900 from anywhere, anytime |
| Using Samsung Galaxy S GT-i9000 and Nokia N900 |
| DonateMe - If you feel I helped you in a very good way, feel free to donate |
 
Reply


 
Forum Jump


All times are GMT. The time now is 11:21.