OpenSeizureDetector / Garmin_SD

Garmin Watch Seizure Detector - A seizure detector data source based on Garmin IQ watches such as Vivoactive HR
http://openseizuredetector.org.uk
GNU General Public License v3.0
12 stars 8 forks source link

Adding menu to toggle O2 sensor on the application. Default value is ON #31

Closed pmithrandir closed 8 months ago

pmithrandir commented 9 months ago

Adding menu item to toggle the o2 sensor, ON by default. Making sure the O2 data are not requested if sensor is off.

pmithrandir commented 9 months ago

Hi @jones139

I run that version today, but it didn't save battery (back to 7-8 hours)

Do you have any idea on what I forgot ? Will your comments correction resolve the issue from your POV ?

jones139 commented 9 months ago

I think what might have happened is that you changed the setting to OFF in the UI, but we do not re-start the app after the menu has been displayed, so the new value might not have been used in SdDataHandler.
Shutting down the app and re-starting it so it reads the setting from persistent storage might do it.
...Or we have to find a way of re-starting the app when the menu is exited - I don't know how to do that though.

pmithrandir commented 8 months ago

Hello,

I checked again the code, and I don't understand something. in SDDataHandler, we have 2 callback running. accelometer and heart rate.

But, if you look in the accelometer, it gets data from the heart rate, to update O2 again. Why would we do that ?

jones139 commented 8 months ago

I think I was finding that the heart rate callback was not being called for some reason, so I added a manual read of it.

On Thu, 1 Feb 2024 at 22:03, Pierre Bonneau @.***> wrote:

Hello,

I checked again the code, and I don't understand something. in SDDataHandler, we have 2 callback running. accelometer and heart rate.

But, if you look in the accelometer, it gets data from the heart rate, to update O2 again. Why would we do that ?

— Reply to this email directly, view it on GitHub https://github.com/OpenSeizureDetector/Garmin_SD/pull/31#issuecomment-1922340020, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACLSY324XXCGE3WPN3HFFTYRQGMPAVCNFSM6AAAAABCSTRGPKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRSGM2DAMBSGA . You are receiving this because you were mentioned.Message ID: @.***>

-- Graham Jones http://google.com/+GrahamJones Hartlepool, UK.

pmithrandir commented 8 months ago

Ok.I'll try to disable one or the other to see if it impacts something.Sent from Android deviceLe 2 févr. 2024 00:09, Graham Jones @.***> a écrit : I think I was finding that the heart rate callback was not being called for

some reason, so I added a manual read of it.

On Thu, 1 Feb 2024 at 22:03, Pierre Bonneau @.***>

wrote:

Hello,

I checked again the code, and I don't understand something.

in SDDataHandler, we have 2 callback running.

accelometer and heart rate.

But, if you look in the accelometer, it gets data from the heart rate, to

update O2 again.

Why would we do that ?

Reply to this email directly, view it on GitHub

https://github.com/OpenSeizureDetector/Garmin_SD/pull/31#issuecomment-1922340020,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/AACLSY324XXCGE3WPN3HFFTYRQGMPAVCNFSM6AAAAABCSTRGPKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRSGM2DAMBSGA

.

You are receiving this because you were mentioned.Message ID:

@.***>

--

Graham Jones http://google.com/+GrahamJones

Hartlepool, UK.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

jones139 commented 8 months ago

I think I was finding that the heart rate callback was not being called for some reason, so I added a manual read of it. On Thu, 1 Feb 2024 at 22:03, Pierre Bonneau @.> wrote: Hello, I checked again the code, and I don't understand something. in SDDataHandler, we have 2 callback running. accelometer and heart rate. But, if you look in the accelometer, it gets data from the heart rate, to update O2 again. Why would we do that ? — Reply to this email directly, view it on GitHub <#31 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACLSY324XXCGE3WPN3HFFTYRQGMPAVCNFSM6AAAAABCSTRGPKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRSGM2DAMBSGA . You are receiving this because you were mentioned.Message ID: @.> -- Graham Jones http://google.com/+GrahamJones Hartlepool, UK.

I just noticed that we introduced this in V1.3.3 because there was an issue with the heart rate indication freezing on some watches (https://github.com/OpenSeizureDetector/Garmin_SD/commit/053e4efedf79992824366a91cc0d34c4080d17a0)

jones139 commented 8 months ago

I made a few minor additional changes to go with this, because it was apparently doing irrational things - but I traced it to the O2sat being set in both the acceleration and the heart rate callbacks. I added a check in both of those for whether we have requested o2sat data and set it to zero if we have not.

All merged into the master branch now and a new release of V1.4.1 published.

Thank you!

Graham.

On Fri, 2 Feb 2024 at 06:12, Pierre Bonneau @.***> wrote:

Ok.I'll try to disable one or the other to see if it impacts something.Sent from Android deviceLe 2 févr. 2024 00:09, Graham Jones @.***> a écrit : I think I was finding that the heart rate callback was not being called for

some reason, so I added a manual read of it.

On Thu, 1 Feb 2024 at 22:03, Pierre Bonneau @.***>

wrote:

Hello,

I checked again the code, and I don't understand something.

in SDDataHandler, we have 2 callback running.

accelometer and heart rate.

But, if you look in the accelometer, it gets data from the heart rate, to

update O2 again.

Why would we do that ?

Reply to this email directly, view it on GitHub

< https://github.com/OpenSeizureDetector/Garmin_SD/pull/31#issuecomment-1922340020>,

or unsubscribe

< https://github.com/notifications/unsubscribe-auth/AACLSY324XXCGE3WPN3HFFTYRQGMPAVCNFSM6AAAAABCSTRGPKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRSGM2DAMBSGA>

.

You are receiving this because you were mentioned.Message ID:

@.***>

--

Graham Jones http://google.com/+GrahamJones

Hartlepool, UK.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/OpenSeizureDetector/Garmin_SD/pull/31#issuecomment-1922929130, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACLSY47WWIR2RLPMPGCTD3YRR7UZAVCNFSM6AAAAABCSTRGPKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRSHEZDSMJTGA . You are receiving this because you were mentioned.Message ID: @.***>

-- Graham Jones http://google.com/+GrahamJones Hartlepool, UK.