Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the support for recorded and paused time #222

Merged
merged 58 commits into from Aug 31, 2020

Conversation

FJBDev
Copy link
Collaborator

@FJBDev FJBDev commented Aug 20, 2020

"Paused Time" & "Recorded Time" data element in MyTourbook


As requested in this discussion thread and this GitHub issue, I have added the following time data for each tour:

New time data:

  • Elapsed time (formerly Recording Time)
  • Recorded Time
  • Paused Time (= Elapsed Time - Recorded Time)

Existing time data:

  • Moving Time
  • Break Time ( = Elapsed Time - Moving Time)

WHY ?

As the famous ultra-trail runner Xavier Thévenard says here in his 2018 summary :

Pour la petite histoire, depuis que je suis gamin j’ai chopé un réflexe. Sur chacune de mes sorties quand je m’arrête, pour contempler un paysage et faire une pause, j’arrête en même temps mon chrono. Aujourd’hui c’est toujours pareil. Cela peut sembler bête, mais à mon sens, c’est loin d’être idiot. 🤔😃

Admettons que je fasse 6 séances d’entrainement par semaine, sur chacune de mes sorties je fais une pause de 10 min, ce qui fait 1h de plus à la fin de semaine, qui est alors comptabilisé comme de l’entrainement. A la fin de l’année j’ai donc 52h d’activités supplémentaires gratuites. C’est pour cela que je trouve que la précision est importante car 52h sur une année d’entrainement c’est énorme

What he is basically saying is that if the user-triggered pauses are not taken into account, it can lead to yearly numbers that can be quite far from the reality. In his example, it can lead up to 52h of training where he was actually enjoying the landscape, taking a bio break etc.....
Hence, having MyTourbook that stores and displays the pauses time for each activity is very important if not mandatory.

HOW ?

The new time values (Recorded and Paused Time) are imported from the following file formats :
Garmin FIT, Suunto (Ambit 2 xml, Ambit 2 sml, Suunto Spartan/9 .json.gz), SportTracks Fitlog, Garmin TCX
Note: I could do it for more formats but I don't own files for the other supported extensions. Hence, for those formats, I have set during the import the recorded time to be equal to the elapsed time. See here as an example

Furthermore, for existing activities, I have added the ability to re-import, for any given tour, only the timer pauses (and hence also the recorded time).

image


When re-importing only this data, the log will display the previous timer pauses value and the current one for more clarity for the user.
image

The appropriate UI, menus and tooltips were updated to display the recorded and paused times :

TourBookView and TourDataEditorView

image

Calendar View

image

Statistics View

  • Day/Week/Month/Year Summaries

Added the ability to choose in between the different times
image


  • Tour tooltip

image

2D Map

  • Added the ability to display/hide the location and duration of the tour pauses
    image

Tour Chart

  • Added the ability to display/hide the location and duration of the tour pauses in the tour chart
    image

UI

  • Added the ability for the user to choose the time value used to compute the pace and the speed (Recorded vs Moving)
    image

Important note:

When upgrading from database 41 (20.8) to 42 (20.NEXT), the recorded time will be updated to be equal, by default, to the elapsed time (recording time) and hence the paused time will be equal to 0. See the note above on how to import the recorded/paused time in existing tours.

Misc other changes:

  • French translation

  • String externalizing (example : Replacing ":" with UI.SYMBOL_COLON)

wolfgang-ch and others added 30 commits July 26, 2020 15:42
…bobox disappears in Linux -> unusable

Normally when a combobox has the focus, then an item can be selected with the keyboard, which works in Linux but the focus in this slideout did also not work

This is the first time that a listbox is used in MT :-)

Maybe there are other places where a combobox in a slideout is also used.

Removed listbox.select(0) -> a disabled list is not readable
Added a number of optimizations to provide better support for Dropbox feature.

Conflicts:
	bundles/net.tourbook/src/net/tourbook/importdata/EasyImportManager.java
	bundles/net.tourbook/src/net/tourbook/ui/views/rawData/RawDataView.java
…isplayed

disable tree actions when flat layout is displayed
…b but this was not the reason to remove it, this image was NEVER disposed -> SWT was running very fast out of handles when moving the tour chart slider as this would create a new image for every new slider position, discovered this issue with SWT sleak
… a feature used:

- import
- tour directories
- display a tour, e.g. in map or chart

sometimes it is not easy to get the "correct" sorting or find the best category new/improved/bugfix
wolfgang-ch and others added 6 commits August 23, 2020 15:35
requires complex sql, it looks good now but needs more testing
mytourbook#220

now the sql statements are much more complex
* Proof of concept for Elapsed Time

* Numbers for POC

* Support for pauses for the fitlog format

* It is fully working for fitlog files

* First stab at the fit pauses

* Pause time for Suunto 9 files but the recorded time is wrong

* TODOs

* Revert of BreakTimeTool.java

* WIP Storing tourTimerPauses differently in the database

* Fixed the database design issue.

* Adding the paused time in the Calendar view

* Misc

* Formatting

* Rearranged value formats preferences with all the times

* Added all the time values in the Tour Tooltip

* Added all the time values in the Calendar view and added the property
tourRecordedTime in TourData

* done and todo

* WIP : Paused times for fit files

* WIP : Fit pauses imports

* Revert

* FIT : Suunto and maybe others don't have events for pauses but the
recorded time is available

* Formatting

* Revert

* Suunto Ambit XML pauses import

* Bugfix for Suunto Ambit import introduced in last commit

* done

* Suunto Ambit SML pauses import

* todo

* Bugfix : We need to set the tourdata for each tourtimerpause

* TODO

* TODO

* TODO

* Adding the ability to reimport only tour timer pauses

* Alphabetical order

* When updating to the new DB, by default, the recorded time will be the
elapsed time (hence the pause time will be 0)

* Some fit files don't have the detailed pauses information but they have
the total recorded time

* Adding the Recorded time column in the TourBookView

* Adding strings for paused time

* Added the paused time in the TourBookView

* When reimporting, we set the recorded time (if any) before setting the
timer pauses

* Adding the paused time and recorded time as sums

* Icon fix

* WIP

* TODO

* Readme update

* When reimporting a tour and only importing the tour timer pauses, we
display the previous vs new data. We should do that for the other
reimport menus

* TODO

* DB version change

* We need to save the previous data

* Changing header icons

* Setting the recorded time and paused time when importing pauses as a
list

* CSV Import

* Misc

* Revert

* Only setting the paused time when the recorded time is not 0

* Polar HRM

* Fit log import fixes

* GPX Import

* Misc

* Headers

* Done and checked

* Renaming

* Renaming

* Renaming

* French translation

* TODO

* WIP UI update when manually modifying elapsed recorded paused moving and
break time

* DONE UI update when manually modifying elapsed recorded paused moving
and
break time

* More info

* Adding Recorded and Paused Time in the Statistics tooltip

* Renaming computeTourDrivingTime to computeTourMovingTime

* WIP Displaying the pause durations on the 2D Map

* Misc code beautifying

* 2d map Added the ability to display/hide the location and duration of
the tour pauses

* Small fix

* Adding the icon for showing/hiding tour pauses

* Fix for Fitlog import

* Setting the tour recorded time

* Comments

* TODOs

* Add the PR number when created

* Checking that every file import sets correctly the tour recorded time

* Exporting/importing recorded and paused time for the GPX format

* Beautifying

* Added the new time Tourbookview columns in CSV Export

* WIP TCS Pauses import

* Formatting

* Pause import for TCX files

* Merge part 2

* TODO Fix unknown regression

* Added the ability to display recorded and paused time in the
Day/Week/Month/Year Summaries

* DONE AND TODOs

* Readme update

* TODO

* TODO

* WIP Added the ability to display/hide the tour pauses in the chart

* Removing Unused action

* WIP Display pauses in the tour chart

* S9 Import: We need to take into account when the user starts and stops
the activity to have a correct elapsed time

* XML tags
@FJBDev FJBDev changed the title Misc code changes Adding the support for recorded and paused time Aug 26, 2020
@wolfgang-ch wolfgang-ch merged commit fe27fa1 into mytourbook:FJBDev Aug 31, 2020
@wolfgang-ch
Copy link
Collaborator

I cannot set a comment on a binary file, so my comment is for https://github.com/FJBDev/mytourbook/blob/f93e3daaef02f600a67f63f3637ebdbca015ab41/bundles/net.tourbook/icons/tour-pauses-disabled.png

The disabled action image is very dark but all other disabled actions have a much lighter grey. I've done this with the Curves dialog in Gimp similar to this curve.

mt-curves

Copy link
Collaborator

@wolfgang-ch wolfgang-ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review is not yet finished, currently it's too much for my brain

Copy link
Collaborator Author

@FJBDev FJBDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review is not yet finished, currently it's too much for my brain

That's ok, this work involves a LOT of modifications.

Copy link
Collaborator

@wolfgang-ch wolfgang-ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code review is now done, I'm doing a functional review with the resolved issues.

Currently I'm implementing the app tag filter with AND'ed tags, so there will modifications (-> merge conflicts) everywhere were tag's are filtered as the SQL statements must be slightly restructured. The Tour Book view is now done and will merge it now but any other tag filter dependened views will also have these changes.

@FJBDev
Copy link
Collaborator Author

FJBDev commented Sep 3, 2020

I cannot set a comment on a binary file, so my comment is for https://github.com/FJBDev/mytourbook/blob/f93e3daaef02f600a67f63f3637ebdbca015ab41/bundles/net.tourbook/icons/tour-pauses-disabled.png

The disabled action image is very dark but all other disabled actions have a much lighter grey. I've done this with the Curves dialog in Gimp similar to this curve.

mt-curves

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants