kartoone / mybiketraffic

ConnectIQ app for processing Garmin Varia radar data and counting vehicles.
http://www.mybiketraffic.com
45 stars 5 forks source link

Request to add handling for activities that are manually paused #5

Open bnestor opened 2 years ago

bnestor commented 2 years ago

Hi, I suspect that activities that are paused manually are not able to continue recording. Oddly enough, this usually results in the entire activity (even after resume) not having vehicle count/speed data. I don't think this is the case when my timer auto-pauses at red lights, but I think somehow when I manually pause and go to the resume/save/resume later/discard menu the . I am not sure how to debug this on my own, but I suspect that the issue is in :

https://github.com/kartoone/mybiketraffic/blob/d2dcc86802c449b4ab567b113af8c7bc2272ca9a/source/MyBikeTrafficApp.mc#L10

I found a similar thread here on pausing and starting an activity with persistant global variables:

https://forums.garmin.com/developer/connect-iq/f/discussion/3755/data-field-variables-lost-when-you-resume-later

Thanks,

Bret

bnestor commented 2 years ago

Did some further dubugging today.

Ride 1: (Ride in traffic with automatic device stops at red lights)&(pause and resume later in middle of ride). Behaviour: traffic speed/relative speed/vehicle count is saved before pause, but not after resume. Ride 2:(Ride in traffic without automatic device stops). Behaviour: all vehicle speed/relative speed/vehicle count is saved for entire segment Ride3: (Ride in traffic with automatic device stops at red lights). Behaviour: All vehicle speed/relative speed/vehicle count is saved for entire segment. Future: (Pause activity manually and immediately resume). Behaviour:???

Based It looks like there is no persistent data (pausing timer within activity is fine, but pausing the activity wholesale is not). I will try to figure out how to debug this stuff and see if I can solve it.

kartoone commented 2 years ago

A few notes ... all data is being written into the .FIT file so if the count is reset during the ride, all you have to do is upload your .FIT file to mybiketraffic.com and all the data from the entire ride will be re-analyzed and re-read into the website and show you the total vehicle count for the entire ride. That being said, I appreciate your help in debugging this problem as I do want to figure out why you are seeing the count resetting mid-ride. To help me understand the situation, what do you mean by "pausing timer within activity" vs "pausing the activity wholesale"?

cagnulein commented 2 years ago

@bnestor since @kartoone is away, do you have a simple FIT file that I can use for reference for #6 Thanks!