Commit Graph

27 Commits

Author SHA1 Message Date
Mark Liversedge
64da909243 Basic Navigation Model
.. back and forward buttons to navigate between views and selections.

.. currently limited to just rides, date ranges and views.

.. next step is to enable click to select from trends overviews to allow
   users to drill down from the season overview into activities and
   back again.

.. part of the shift from searching through lists to analyse data to
   exploring data visually with drill down and click through.

.. the buttons are very basic and there is no way to explore the
   history / recently viewed items etc. these will come later.

Fixes #3529
2020-07-05 16:38:30 +01:00
Ale Martinez
3bfcfa57aa Implement RideMetric value and toString with 2 parameters for Pace metrics
Fix base class toString 2 parameters bug
Use toString(metric, value) in getStringForSymbol to avoid setting the value
Use toString(metric, value) in MetricOverviewItem::setDateRange for testing
2020-06-23 15:51:57 -03:00
Mark Liversedge
cc6fa1d02a Refresh RideFileCache before Metrics
.. since user metrics may reference the ridefile cache as part
   of the formula e.g. bests(POWER, 1200)
2020-05-26 19:54:30 +01:00
Mark Liversedge
fd0a5955ef Fix some metric refresh SEGV
.. A few situations that cause race conditions and crashes when metrics
   are being refreshed, found whilst testint user metrics.

   1. access to QString is not thread-safe, fixed with a const
   2. metric vector resizing is needed even if all metrics are zero
   3. entire ride interval needs to be computed, assignment in thread
      is not thread-safe and was incomplete anyway.
2020-05-08 14:31:43 +01:00
Ale Martinez
42fa49c50f Add sport field to RideItem/RideDB as primary field
Exiting isRun/isSwim are preserved and new isRide/isXtrain added.
Use them in DataFilter to provide isRide, isRun, isSwim and isXtrain
and in RideSummary for better filtering of activities in rides, runs
swims and xtrains.
Part 1 of #3280
2020-04-06 19:13:43 -03:00
Mark Liversedge
3aab662642 Interval sidebar helper for performance tests
.. right click options to
   * mark a user interval as a performance test
   * create a performance test interval from a disovered interval

.. this way when interval discovery finds a hard effort that you
   want to clone as a performance test, you can do it with one
   click.
2018-08-05 21:55:39 +01:00
Mark Liversedge
649d3ee014 Fix Interval Color bug
.. editing a user interval color never worked properly.
   the color wasn't changed or remembered at all.

.. lots of independent bugs conspired to cause this but
   mostly it was because the interval color was not
   recorded in the ride file.

NOTE: files created with this release will not be
      backwards compatible with earlier releases.
2018-07-29 22:01:49 +01:00
Mark Liversedge
a45fe546f9 Mark Performance Tests
.. allow the user to set a flag "Performance Test" against an interval
   within an activity.

.. the distinction is needed to highlight the section of an activity
   that was a test (as opposed to the entire activity containing
   test efforts.

.. this is so we can fit them to PD and IR models in the future
   avoiding the need to use algorithms to extract TTE type efforts.

.. the update was surprisingly complex since we need to update the
   ridefile to record this with the interval and also update the
   ride cache as well as adding the bool to all the interval helper
   functions.

.. along the way it became clear why user specified colors for
   intervals were getting lost (they are not in the ridefile) and
   will fix this in another post.

.. NOTE: ridefiles created with this version will not be backward
         compatible with earlier versions because they contain a
         new field for intervals marked as performance tests.
2018-07-29 16:08:19 +01:00
qheath
c8523a2716 various minor bugfixes + warningfixes (#2878)
* fix unclosed file descriptors

* remove various compiler warnings

sometimes it was only ambiguous indentation, sometimes bugs were fixed:

- forgotten `break;` instructions or `fallthrough` annotations:
  - src/ANT/ANTChannel.cpp
  - src/Charts/CriticalPowerWindow.cpp
  - src/Charts/MUPlot.cpp
  - src/Core/DataFilter.cpp
  - src/FileIO/RideFileCache.cpp
  - src/FileIO/RideFileCommand.cpp
  - src/Train/DialWindow.cpp
- forgotten braces:
  - lmfit/lmmin.c
  - src/FileIO/XDataDialog.cpp
- test on the wrong variables:
  - src/Gui/Pages.cpp
- wrong parenthesis
  - src/Charts/CPPlot.cpp
- missing macro argument
  - src/Cloud/WithingsDownload.cpp
- missing `return;` statement
  - src/Cloud/Xert.cpp
- unused variables
  - src/Gui/DiarySidebar.cpp
- unclear indentation
  - src/Core/RideItem.cpp
  - src/FileIO/BinRideFile.cpp
  - src/Metrics/PaceZones.cpp
  - src/Metrics/RideMetadata.cpp
  - src/Metrics/Zones.cpp

* remove unnecessary Leaf::Parameters enum value from data filters

lists of parameters don't exist as such outside of the parser, and have
no business using the same type `Leaf` as complete terms anyway

* remove unnecessary argument

`leaf1.print(leaf2,...)` would print `leaf2` and completely ignore
`leaf1`, so now `leaf2.print(...)` is used instead
2018-05-30 13:33:02 +01:00
Alejandro Martinez
b984c340ba Refactor Measures
Part 5 of #2588
- BodyMeasures code in Athlete was moved to BodyMeasures class in Core
- HrvMeasures code in Athlete was moved to HrvMeasures class in Core
- Both implement the Abstract Base Class MeasuresGroup which provides uniform
  access to measures
- Class Measures consolidate access to Body/Hrv Measures
- Body/Hrv measures file is accessed for only one place
- Names/Symbols for Body/Hrv measures are defined only once
2017-11-19 00:14:26 -03:00
Alejandro Martinez
c1de1def02 HRV Measures - Part 3
Added HRV Measure fingerprint to RideItem fingerprint
to detect changes in HRV Measures potentially affecting
ride metrics.
2017-08-02 18:19:14 -03:00
Alejandro Martinez
2888b27e16 Adds HRV Measures - Part 1
Implements #2568 part 1, 2, 3, and 4
2017-07-26 17:17:21 -03:00
Joern
319c1f6702 Fix Terminology
... "measurements" (noun) not "measures" (verb) - thanks Mark
2017-04-22 19:44:45 +02:00
Keith Reynolds
5dc6e8eb1a Use defines for units
Fix precision loss issues
Remove unused variables
2017-03-31 10:09:35 -06:00
Joern
cb9b38dcc0 BodyMeasures
... add "source" and "originalSource"
... add "time" display for bodyMeasures read from cloud services
... store in /config not in /activities
... code clean-up (warnings, enum instead preprocessor constants)
2017-03-26 12:42:06 +02:00
Joern
c6c2121784 Introduce BodyMeasures as generalization of current Withings Data
... body measures are weight/height data as provided by multiple fitness platform (one of the being the already support Withings platform)
... all access to Weight from external platforms is done through the body measures model - not direct use of Withings any more
... not all platform deliver all measures - but (hopefully) all are providing "weight in kg" as a minimum data

General Download Dialog for Body Measures
... allowing to select the source and the daterange for which data is downloaded (e.g. only the new data since last available measure)
... Support existing Withings Download
... Support new Today's Plan as data source (which is able to receive measures from other sits - e.g. Garmin Connect)
... Support CSV files as data source

Store Body Measures Data in one fix file under /activities (not in /cache like Withings) (so that e.g. backup works like before).

What's open:

... CSV File Import (Info Message on missing feature)
... Test of "old" Withings Download API (since I can't do this)
2017-03-18 13:42:36 +01:00
Mark Liversedge
9d0b0b9b27 HRV Support Add stdmean() and stdvariance() to RideMetric
.. Leif Warland is developing the HRV metric support
   and some of these are std deviations. When you
   aggregate std deviations the mean and variances
   are needed.

.. RideMetric::stdmean() and ::stdvariance() return
   a value that is stored in the RideDB if it is
   non-zero.

.. RideItem::getStdMeanForSymbol()
   RideItem::getStdVarianceForSymbol

   return the stored value for use when aggregating in
   the same way that RideItem::getCountForSymbol() does.
2017-02-22 09:45:48 +00:00
Mark Liversedge
a6caf5f07a RideItem::getCountForSymbol return 1 not zero
.. a count of zero makes no sense, so it returns 1
   whenever the value is unset. This fixes averaging
   for metrics that don't bother to set count.
2017-02-21 13:33:29 +00:00
Mark Liversedge
a3be6bac46 LTMPlot aggregate metrics using count
.. don't fallback on workout_time, let the metrics supply
   the value to use.

Fixes #2353
2017-02-20 18:31:34 +00:00
Mark Liversedge
d4a1cbc250 RideCache stores count for each metric
.. the RideMetric::count() value is written to the ride
   cache (rideDB.json) if it is non-zero.

.. it is not used in the aggregation logic yet, but the
   rideDB version number has been incremented to force
   a rebuild on first run.
2017-02-20 17:50:46 +00:00
grauser
ffff355416 DataFilter : Match exact name for XDATA series 2016-11-21 21:14:22 +01:00
Mark Liversedge
a38696e25d Data Processor 'On Save' and Snippets
.. a data processor can now be configured to run on save

.. in addition, the data processor is now passed the operation
   that is triggering it: "Manual", "ADD", "UPDATE", "DELETE",
   "IMPORT".

.. a new data processor has been added to write a JSON file to
   the snippet directory (added to the athlete structure).

.. this is so we can output a snippet every time an activity is
   added, updated or deleted (i.e. runs "on save").

.. these JSON snippets can be used to update external datastores
   where coaches use other analytic software but don't want to
   manually sync GC changes with there external stores.
2016-11-12 22:36:44 +00:00
Mark Liversedge
635f27ccbd XDATA(name, series, ...) accepts wildcards
.. you can now use the XDATA function to return XDATA field
   values using a wildcard.

.. this is likely to be most useful for ignoring the xdata
   name when searching for a specific data series.

.. e.g. XDATA("*", "YAW", repeat) will get the YAW data series
   regardless of the name of the xdata name that the user
   chooses.
2016-09-08 20:25:19 +01:00
Mark Liversedge
ac37f48033 XDATA in DataFilter 1 of 3
.. Filter rides for presence of XDATA by name using the syntax:
   XDATA("XDATANAME", "SERIESNAME", sparse|repeat|interpolate|resample)

.. this is the first of 2 commits, in this one we have added XDATA to
   the rideitem and rideDB.json so we can check if XDATA is present
   without opening the ridefile

.. this allows us to return true or false for an XDATA(..) call when
   working across rideitems (not data points) in DataFilter evaluate,
   note that the join control (sparse,repeat etc) is ignored when you
   are filtering ride items

.. in the next commit we will add the ability to get at the xdata
   values when iterating in user data or user metrics

.. there are likely to be further refinements for the outer join
   required to support interpolation and resampling in a third commit.
2016-07-16 11:46:35 +01:00
Alejandro Martinez
bab562fb46 Deprecated BestIntervalDialog
Added Specification parameter to AddIntervalDialog::findPeaks
So it can be used as a more general replacement for
BestIntervalDialog::findBests and findBestsKPH
2016-07-12 11:23:47 -03:00
Alejandro Martinez
6937df7786 Add support for running HR zones part 3
Changed ride cache and charts to use zones according to sport(s)
2016-05-09 15:21:47 -03:00
Mark Liversedge
4b5201c4c5 Restructure source directory
Introducing a directory structure to make it a bit less
daunting for new developers and perhaps even old hands.

The main folders all start with an upper character, so src
files are now located in;

* Core - Core data structures
* Gui - Main GUI elements
* Metrics - Models and Metrics
* FileIO - Device and File I/O
* Charts - All the chart types
* Cloud - Working with Web Resources
* Train - Anything Train View specific
* ANT - Our ANT+ Stack
* Resources - Images, Translations, Web etc

Apologies to anyone who needs to merge across this update.
2016-02-25 14:51:53 +00:00