mt-from-sf-to-gh / features

0 stars 0 forks source link

Custom Data/Measurements Tracks #182

Open mt-from-sf-to-gh opened 3 years ago

mt-from-sf-to-gh commented 3 years ago

Add to MTB the possibility to define/add any type of tracks beside the standard one (hr, power, cadence, rundynamics, ....). This would be for instance usefull when importing fit file (garmin) where custom application defined additional sets of measumerements. The implementation would look like: 1) define a "custom track definition" entity with 3 fields: "name"(unique key) ,"id"(unique key), unit, and maybe type (e.g:float, double, int,log, short,...). The first imolementation could be using float as type. 2) the above "custom track definition" would be created by user interface or during import like it is done for tour Tags or tour Type. 3) create a "custom data value" class which has the following fields: "Id"(of the definition), "Value" (float in the first implementation). the "TimeData" class will have an array of this class as new member field.
4) add 2 hashmaps for the CustomTracks and associated statistics(Avg, Min, Max) to the Tourdata and SerieData class. and modify the necessary functions in TourData and SerieData to populate those 2 HashMaps from the TimeData series. the HashMaps are like <String, float[]> for the CustomTracks the String being the "Id"(of the track definition) and the float array the classical timeserie of value, the stat hashmap would be HashMap<String, CustomTrackStatEntry> , CustomTrackStatEntry is just a serializable class with 3 float (Avg, Min, Max). The 2 HashMap are persisted in the SerieData Blob. 5) add new tab view similar to the Tour Data or analyzer, to allow you to view the data in a similar way as other standard tracks/measurements(hr, power, etc...) that tabview would be dedicated to the view and analysis of those CustomTracks.

I already implemented and experimented locally 3) and 4) above with great success :-) waiting for feedbak before going further on my code.

Reported by: gmngueko

Original Ticket: mytourbook/feature-requests/189

mt-from-sf-to-gh commented 3 years ago

Original comment by: FJBDev

mt-from-sf-to-gh commented 3 years ago

I already implemented and experimented locally 3) and 4) above with great success :-)

Nice! Considering that you already have implemented it, I would suggest that you submit a Pull Request so that you can get actual feedback on your code and the functionality

Original comment by: FJBDev

mt-from-sf-to-gh commented 3 years ago

Hi Frederic, Merry Christmas :-)

the pull request has been submitted. I didn't put all my work, just the common part. so you won't see the modification I made in the FitlogEx to do the actual import. I also experiment adding the timeslice columns for those custom tracks, I succeed locally and it actually works (I can see the additional column corresponding to the new tracks for each tours(custom tracks are specific to tour and not generic and fixed as the standard tracks.))

Original comment by: gmngueko

mt-from-sf-to-gh commented 3 years ago

Thanks for your Pull Request. I am just a contributor like you so I don't review Pull Requests but @wolfgang-ch does.

Merry Christmas too :-)

Original comment by: FJBDev