Commit Graph

60 Commits

Author SHA1 Message Date
Mark Liversedge
daf63f2dac MainWindow Refactor Part 5 of 5 - TABBED ATHLETES
The final part (and one of the reasons) for the mainwindow
refactoring -- we now support tabbed athletes rather than
having a new mainwindow for each athlete opened.

Context is saved/restored and there are new functions for
opening and closing tabs and windows of tabs.

The tabbar itself is fugly -- the next few days will spend
some time looking at making it prettier on Linux/Win and
more native on Mac (see MMTabBar).
2013-12-26 01:03:32 +00:00
Mark Liversedge
c5028e33c4 Autofilter
.. let the user choose metadata texts to filter
   by value in the sidebar.

Note there are issues;

1. the value lists are not updated automatically when
   rides are updated or imported and values are added
   or removed.

2. it only works with shorttext metadata fields, we might
   choose to add numeric etc later.

3. it would be nice to get an indication of how many
   activities contain the value and maybe even sort
   by count.
2013-12-20 17:48:49 +00:00
Mark Liversedge
2383f8fbb2 New Metric Fatigue Index
Looks at the max and min (non-zero) power values and
uses the difference between them to calculate a fatigue
index as a percentage.

i.e.
FI = (maxP - minP) / maxP * 100.00;

This is really only useful for targetted intervals as for
most riding there will always be a period of time where
the rider coasts or takes it easy.

We may look to improve it by smoothing or comparing to the
average power instead of minimum power.
2013-12-18 11:00:48 +00:00
Mark Liversedge
dbb9a668ec Fix Lucene searches in Home Sidebar
.. I hadn't finished that bit of the code before
   pushing. A bit of an oversight!
2013-12-17 16:39:46 +00:00
Mark Liversedge
a876c8da62 QT5 -- Part 3 of 3
Fixup crashes and major issues created by porting
to QT5. These have included;

* Fix CP plot log scale
* AllPlot axes and tooltip
* DBAccess prepare/bind bug
* LTMSettings crash
* LTMWindow zoomer/picker crash
* LTMPlot axes hack

There are still issues remaining but we can start
working through them at leisure -- the product now
builds and runs.
2013-12-09 21:21:51 +00:00
Mark Liversedge
4026ff87bd Added Effect of Altitude (%)
A metric of the %age of power that has been lost due
to riding at altitude.
2013-11-05 21:31:31 +00:00
Mark Liversedge
4dff955424 Average aPower
Added an average aPower metric.

I also and found and fixed a couple of bugs along the way;

* intervals create a ridefile and need to explicitly call
  recalculateDerivedMetrics()

* the aPower calculation was using the calculated vo2max
  percentage the wrong way around (!)
2013-11-05 20:06:09 +00:00
Mark Liversedge
ab7ee66f5b Disable Minimum W' Metric
.. its too slooooow.

.. lets fix the WPrime performance issue before
   introducing any metrics on the back of it.
2013-10-31 17:36:56 +00:00
Mark Liversedge
9bf7816f02 Add Minimum W' Metric
It TREBLES the amount of time required to refresh the
metrics, so will need to be optmised before 3.1 is released.

But it should only need to run once.

I've also added a 'RideMetric::Low' type which we could
also apply to weight.
2013-10-31 16:49:43 +00:00
Mark Liversedge
5653169a0f HR Time in Zone percent
.. to match the recent update for the power
   time in zone metric.
2013-10-29 10:38:06 +00:00
Mark Liversedge
064e840c32 New Metric Percent Time In Zone
The current TIZ metrics only allow you to chart the
absolute time in zone. Over longer periods it can be
helpful to look at the overall ratio of intensities
trained at.
2013-10-29 09:59:00 +00:00
Mark Liversedge
77278b2ed1 A lot less assert
There still some assert left in the code, but removed
a fair number of the examples where, its just as easy
to handle the condition gracefully, without crashing.

By 3.1 we will have eradicated assert from the code.
2013-08-04 11:06:07 +01:00
Mark Liversedge
449eb6e818 Fixup Athlete/DBAccess/MainWindow dependency
A bit of a mix of stuff, but basically the Athlete
class has sql stuff in it, that DBAccess used but
also referenced a session number in MainWindow.

Removed the interdependency and moved all code to do
with DB to DBAccess and out of MainWindow and Athlete.

At the same time needed to clean up a bit of memory
management and so introduced a MainWindow and Athlete
destructor.

We are now ready to do refactor part 4 to split MainWindow
into a new View class (that will be in each tab).
2013-07-20 11:07:03 +01:00
Mark Liversedge
12f63e2b73 Move specialFields from MainWindow to Context
.. and tidy up a few unneccessary references to mainWindow
2013-07-14 11:51:34 +01:00
Mark Liversedge
0fcbbe1b77 Refactor MainWindow Part 2 of 5
Decoupled classes from MainWindow to reference Context
and Athlete (and introduced a couple of new headers).

We no longer pass around a MainWindow pointer to children
but pass a context instead.

There are still a few pieces left in MainWindow that need
to move to a better place;
    * Setting/clearing filter selection
    * Working with Intervals
    * Adding/Deleting Rides
    * Save on Exit

As mentioned previously there are lots of other parts to
this refactor left to do;
    * break MainWindow Gui elements into Toolbar and Views

    * migrate from RideItem and Ridelist to ActivityCollection
      and Activity classes that are not tied into gui elements.

    * introduce Application Context and AthleteCollection
2013-07-11 14:02:02 +01:00
Mark Liversedge
c56c5a9567 MainWindow Refactor Part 1 of 5
Breaking the MainWindow 'god object' into
separate classes for Athlete and Context.

Further updates will need to;
- break MainWindow Gui elements into Toolbar and Views

- migrate from RideItem and Ridelist to ActivityCollection
  and Activity classes that are not tied into gui elements.

- introduce Application Context and AthleteCollection

Once these are done we will be in a position to decouple
most classes from mainwindow and also introduce tabbed
athletes.
2013-07-07 15:50:28 +01:00
Mark Liversedge
8fe16cc871 Clean up measures.xml
.. remove it as part of the upgrade.
.. use built-in version for db schema
.. don't re-read it when doing getAllMeasuresFor()
2013-05-22 21:18:57 +01:00
Mark Liversedge
57b15dbe86 Fix RideFileCache threaded db access
The call to RideFile::getWeight() in RideFileCache
computation ends up with a call the read the measures
table in the DB. This is BAD since it is called from
a thread.

We now call getWeight() in the metric aggregator before
launching the ridefilecache computation -- this will cache
the weight and avoid db access.

I've also removed the duplicate code in the w/kg metric code
too and it should be marginally faster at computing metrics
now.

BIG THANKS TO ILJA BOOIJ FOR HIGHLIGHTING THIS, DESPITE MY
INITIAL SCEPTICISM. I OWE HIM A PINT (OR TWO) :)

Fixes #604
2013-05-19 19:06:28 +01:00
Mark Liversedge
a16c4d1615 BasiRideMetric handle no speed/distance gracefully 2013-05-13 20:05:32 +01:00
Mark Liversedge
67b5ee0fda Add version details to Crash report
By refactoring out the version stuff from the about dialog
and making it part of the crash report (and reused).
2013-05-12 13:27:08 +01:00
Mark Liversedge
3e3b92b889 Add Fatigue Profiling Peak Power Durations
.. added for 2,3,8 and 90m peak power

.. user defined intervals for peak power/vam/np et al
   are still planned for v3.1

Fixes #595
2013-05-09 20:10:54 +01:00
Mark Liversedge
2887c0d3df DBSchema increment to 44
.. was missed in April, no biggie but need to make sure
   it matches the metric definitions and comment in DBAccess.cpp
2013-05-06 18:24:04 +01:00
Mark Liversedge
1b16b034bd Metric Histogram Plot
Update to the histogram plot to now plot long term metrics.
It enables you to plot distribution of say, Intensity Factor
for a season or cycle.

You can select the y-axis metric too, so rather than just
plotting duration you could plot say, TSS accumulated for
different ride intensities.

Fixes #560
2013-04-20 10:35:44 +01:00
Mark Liversedge
1127b57bef Code Cleanup: DBAccess
.. invalid comments about texts which are bwing stored.
2013-02-10 21:14:35 +00:00
Mark Liversedge
df96307d47 TRIMP fallback to workout time if time riding 0 2013-01-24 21:42:23 +00:00
Andy Bryson
49d8eb0fc3 Remove Boost
Replace boost checksum stuff.
Remove boost from versions
Remove Boost from src.pro
Remove Boost from gcconfig.pri.in
2012-12-29 22:59:28 +00:00
Andy Bryson
ff546e8471 Remove Boost Dependency - The Easy Bits
Replace boost stuff with QT or C++ equivalents
2012-12-27 17:04:36 +00:00
Mark Liversedge
546b4aac83 W/KG fixup distribution/histogram
The w/kg ridefile cache was not quite right
for distribution charting.
2012-12-03 14:56:43 +00:00
Mark Liversedge
a9d3bd6650 User configure Field to set colors from
The user can now select a metadata text field to use when
setting colors from keywords.

Fixes #32.
2012-11-23 22:01:41 +00:00
Damien
b9f2e98e47 Add myzeo data download Add ZQ and sleep time metrics 2012-11-18 16:13:15 +00:00
Damien
37f294c82e About dialog
About dialog now shows versions and contributors.

Fixes #563.
2012-10-28 22:10:11 +00:00
Mark Liversedge
b3da24901e Change Search Strategy
1. Use the whitespace analyzer so its easier to search for
tokens that are a mix of letters and numbers e.g. workout
codes and TT route names.

2. Search as you type. Since we have very small collections
to search across (typically no more than a couple of thousand)
there is no major overhead in searching as you type.

3. Search all texts by default not just the Notes field. This is
a more appropriate default and is less likely to confuse new
users. In addition, it is most likely what most users want to
do anyway.
2012-10-27 08:46:36 +01:00
Mark Liversedge
7a8d4377b9 Search/Filter using Lucene
Searching and filtering the ride list using a search box.
This is implemented using a new optional dependency on
CLucene.

Fixes #627.
2012-10-21 15:28:26 +01:00
Mark Liversedge
22ebf53591 Increment DB version
Last commit added a new metric but didn't increment the DBAccess
DB schema version, causing DB functions to break. This patch just
increments the version to ensure the DB is rebuilt to include
the new metric.
2012-08-19 20:48:10 +01:00
Mark Liversedge
a04375f20d Manual entries compute metrics
A few months ago I commented out the calculation of metrics
for manual ride files. This was a hack to avoid fixing the code
to handle metric calculations from overrides where there are no
data points.

This annoyingly meant that the 'rides' metric was zero for manual
ride files, and any derived metrics similarly were zero.

This patch fixes that.
2012-07-08 16:22:40 +01:00
Rainer Clasen
23e31b99cd added non-zero average power metric
This might be meaningless for actual analysis, but helps to match numbers
of devices, that exclude time with zero power from the average
calculation.

While it's controversal to be usefull, this leaves the choice to the user.
2012-05-01 22:28:06 +02:00
Mark Liversedge
de15bbef02 Add Minute Mile Pace metric
Runners tend to measure speed in minute mile pace and
this is common even if they use metric units.
2012-02-18 17:48:36 +00:00
Jamie Kimberley
3490424f2a fix unit conversion error in max cadence calc
There was a unit conversion from km->miles being applied to cadence. I have
removed the offending line.

I've also changed the precision so the we report cadence as an integer.

Fixes #601.
2012-02-13 06:48:49 +00:00
Mark Liversedge
b5f979e3f8 Add Temperature to Ride Summary
More complex than I had hoped for, to add
Temperature I needed to;

* introduce two new metrics Avg/Max temperature
* adjust metric conversion to include a conversionSum
  for the C to F conversion
* handle temperature as a metadata field as well as a
  ride data series
* handle the RideFile::noTemp value rather than just
  averaging or calculating max.

Fixes #603.
2012-01-15 16:27:09 +00:00
Damien
8c38809838 Add ResponseIndex and EfficiencyFactor
modified:   src/BikeScore.cpp
	modified:   src/Coggan.cpp
	modified:   src/DBAccess.cpp
2011-12-17 17:54:20 +00:00
Damien Grauser
9c611c4b5b Add temperature icon to GCBubble 2011-12-08 22:38:58 +00:00
Mark Liversedge
9428205ced Add a Watts per kilogram metric
All the existing wpk metrics concentrate
on the wpk for a fixed period, which is great
but we should also support it for an interval
(where it is arguably most interesting).

This patch fixes that.

Fixes #467.
2011-11-22 20:28:18 +00:00
Mark Liversedge
7e03e82ab6 Version 3 to use metricDBv3
Some users often switch between v2 and v3 of GC. Either
because they are testing or they are transitioning from
v2 stable to v3 development builds.

But at launch the metricDB is refreshed each time, since
the v2 and v3 metrics are so different.

To avoid this, from version 3 the metricDB file will be
called metricDBv3 to avoid conflicting with the original
metricDB file.

Fixes #376.
2011-11-21 07:59:49 +00:00
Mark Liversedge
d144599ef8 Activity Popup Bubble
A popup bubble when hovering over the activity
history or an entry on the calendar.

It is a pre-cursor for the activity bar for
selecting rides and is available for any
widget to call (it is a member of mainwindow).

To support the data series indicator icons a
new metadata field 'Data' has been added to
store a string to represent the data series
that are present.

In addition, the Sport code is used to decide
if a bike/run/swim icon should be shown instead
of a string (but needs translation support when
we get round to that).

Lastly, it has been coded for horizontal alignment
but will need to be updated for the activity bar
to support vertical alignment.

This is an experimental feature and will develop
over time, specifically;

* you cannot define which metrics are show in the
  bubble -- they are hardcoded at present

* the coloring is hardcoded, as is the font size

* Only the activity list and diary use it.
2011-09-10 22:36:13 +01:00
Mark Liversedge
a119c6e55d Reinstate Colors on Calendar
The background color on the calendar now reflects
the color configration.

The color for each ride is precomputed and stored
in the metricDB (so we don't have to scan the ride
everytime we need to determine its color).

As a happy by-product the ride navigator no longer
scans the text to determine the row color and is an
order of magnitude faster when repainting (although
most users are unlikely to notice in practice).

Fixes #448.
2011-09-05 10:54:40 +01:00
Damien
5f6033ee31 Add a Maximums column in the ride summary
Add maximums to the ride summary, which also required adding
max_speed and max_cadence to the basic ride metrics.

Fixes #440.
2011-09-01 19:08:53 +01:00
Mark Liversedge
be21f65d16 Increment MetricDB version for PeakPwrHr update. 2011-08-24 06:43:29 +01:00
Damien
a70e8dabbe Modify TRIMP formula to use time_riding instead of workout time
Fixes #355.
2011-08-06 12:33:23 +01:00
Damien Grauser
2f7f69ed5c Add PeakPowerHr metric (average HR during peak power)
[c6a376 folded manually into release_3.0.0dev from master]
2011-07-30 13:11:34 +01:00
Mark Liversedge
7a96823942 More Metric Refresh Performance Improvements
The DBAccess functions instantiate a local SpecialFields object in
almost every method. Profiling by Fredrik Lingvall has shown this
is rather expensive (and also unneccessary since they do not
change at runtime).

A specialFields member has been added to the MainWindow class
and is instantiated at startup and referenced in the DBAccess
methods instead.

Rough tests suggest a 10% speed improvement in metric refreshes.
2011-05-13 21:15:15 +01:00