Commit Graph

9377 Commits

Author SHA1 Message Date
Ale Martinez
bc13092cd2 Python Fixes - Clear context before to execute the script
Fixes #3459
2020-06-03 13:37:38 -03:00
Ale Martinez
15b491409a Fix AppVeyor deploy to S3
[skip ci]
It was uploading to S3 on every push to master.
2020-06-02 18:55:02 -03:00
Ale Martinez
92f3a237be Trim Python Home setting
If it contains blanks deployed Python detection fails,
lets make this a little more idiot-proof.
2020-06-02 18:44:07 -03:00
Mark Liversedge
a6ed25c7e4 Overview refactors cosmetic nits
.. spacing and margins got doubled and tripled up in layouts and
   some other related minor fixups.
2020-06-02 21:57:59 +01:00
Mark Liversedge
45a628b4b9 ChartBar context menu in Tab
.. instead of the 'More...' button in the top left of a chart when in
   tabbed mode we now have a menu button when you hover over a tab.

.. the menu button activates the chart menu for now, till we refactor
   to using a chart space.

.. the 'More...' menu is still available when in tiled mode (we need to
   decide what to do there).
2020-06-02 20:41:28 +01:00
Michel Dagenais
b6ee709520 Fix incorrect speed (halved) on BT40 (#3456)
Unlike for the cadence value which uses 1/1024 second units, the wheel
revolution value is based on 1/2048 second units [1]. It is easy to
notice the problem when you ride downhill at 25 kph instead of 50kph! In
addition, the speed was initially incorrect because the previous wheel
position value was stale. This would sometimes give the speed of a
rocket for the initial interval and make a jump on the distance of
several km.

[1] Cycling Power Service, Bluetooth Service Specification, Date 2016-05-03, Revision CPS_v1.1, Prepared By Sports and Fitness Working Group, head of page 15.

https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=412770,
2020-06-02 10:35:46 -03:00
Adrien Guinet
77bbca0a16 ErgFile: fix distance precision issues (#3435)
When parsing a "distance slope wind" type, a truncate to integers was done
after computation to meters. This involved rounding issues that were
accumulated, and were quite visible when such a file was used to synchronized
with an RLV video (the slope changes happened "too early").
2020-06-01 20:53:53 -03:00
Adrien Guinet
6ca1bd9a9c BT40: add support for Tacx's ANT over BLE (#3430)
This is based on https://github.com/abellono/tacx-ios-bluetooth-example/
This has only been tested so far with a Tacx Flow Smart T2240.
2020-06-01 20:51:01 -03:00
ericchristoffersen
93ff6c36b4 FixGPS - Dont Stomp Slope (#3468)
Rely on invalidate.
Fixes #3466
2020-06-01 11:57:20 -03:00
Ale Martinez
6a3734971d Add information about GSL as a mandatory dependency
[skip ci]
2020-05-31 19:35:47 -03:00
Mark Liversedge
f8f43eed4c Fir set RPE from Overview Regression
.. updating the RPE value via the RPE widget on the overview was lost in
   the last commit, this fix reinstates it.
2020-05-31 18:55:36 +01:00
Mark Liversedge
8a1842a9ba Refactor OverviewWindow for ChartSpace
.. the OverviewWindow class has been refactored to extract out the
   core dashboard UX/UI into a new class ChartSpace.

.. additionally, a ChartSpace contains a set of ChartSpaceItem which
   need to be subclassed by the developer.

.. for the Overview a set of OverwiewItem classes have been introduced
   such as RPEOverviewItem, MetricOverviewItem and so on. These are
   subclasses of the ChartSpaceItem.

.. The overview window implementation is now mostly configuration and
   assembly of a dashboard using OverviewItems and the ChartSpace.

.. This refactor is to enable the ChartSpace to be used as a drop in
   replacement for the existing TabView.

.. There are no functional enhancements in this commit, but the
   overview chart shouls appear to be unchanged by the user.
2020-05-31 18:16:53 +01:00
Ale Martinez
2d3eed0a98 Cleanup non-optional Defines from CI config
Removed redundant config and fixed GSL for windows instructions
Remove some compiler warnings to reduce log size
2020-05-30 18:13:20 -03:00
Ale Martinez
df160a10a1 Strava Download - Prevent laps overlapping and fix Lap Swim distance
Switching from start_index to start_date_local fixes #3457
Since Duration is End-Start+1, End is decremented to match elapsed_time.
fixLapSwims don't rely on Smart Recording being enabled and,
since km is distance at the end of the sample, a correction is added.
2020-05-30 16:55:25 -03:00
Mark Liversedge
a8473441ae GNU Scientific Library (GSL) Mandatory Dependency
.. making GSL mandatory, so we can rely on the modelling functions
   being available, amongst a few other things.

[publish binaries]
2020-05-29 15:51:58 +01:00
Ale Martinez
f18b5470ec Create Overlay Widgets with Qt::Tool flag on Linux
Michael Dagenais found this change makes the widgets to play nicer with
Windows Managers and avoids them to get on top of other programs windows.
Minimize and Restore is automatically handled now, so this commit partially
reverts b89019264e, removing MainWindow
state changes tracking, but keeping VideoWindow position tracking.
2020-05-27 18:04:41 -03:00
Alejandro Martinez
f51a6a6cb1 Remove Conditional Compilation for Qt < 5.9 (#3464)
This is a clean up to remove conditional compilation for all Qt versions
older than the last known to work: Qt 5.9 with Qt WebEngine and Qt Charts.
Includes an update note to INSTALL documents.
2020-05-27 09:26:25 -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
Michel Dagenais
0352e19e34 Clip the Meter Widgets to the visible portion of the Video Window (#3462)
When the video widget is scrolled, the MeterWidget windows appeared on
top of the Main Window user interface. Now the visible portion of the
Video Window is tracked and used as a clipping region. This avoids
blocking the controls on bottom toolbar.
2020-05-26 14:56:11 -03:00
Mark Liversedge
4f64b88f0f Datafilter vectors - rank()
.. rank(ascend|descend, list) - returns the ranking of each element
   of list in order specified. Ranking will range from 1 to n.
2020-05-26 10:40:35 +01:00
ericchristoffersen
4348a6279c Issue 3373: FixGps to run on altitude alone. (#3374)
Fixes #3373
2020-05-25 19:03:26 -03:00
Eric Christoffersen
d52fb5a68f Fixes for interpolation and gpx file load
Interpolation math fixes: Slope and interpolation behave correctly when
ride point location doesnt change.
In gpx read: do not open same file twice with different read flags.
2020-05-25 13:34:27 -03:00
Ale Martinez
c179419feb Recognise Peter Kanatselis and Michel Dagenais
By contributions to Train View code
2020-05-25 12:45:46 -03:00
Michel Dagenais
b89019264e MeterWidgets must move / hide when main window is moved / minimized (#3458)
When the main window is minimized on Linux, the MeterWidgets stay on the desktop.
A signal were added to the main window for state changes.
The VideoWindow connects to that signal and hide/shows the MeterWidgets accordingly.

Currently, when you move the main window, the MeterWidgets do not follow
and become out of place. 
On every Telemetry update, check if the real position on screen of the
video window has changed in order to update the position of the meter
widgets. The Video Window can move for several reasons like when
scrolled or when the Main Window is moved. The Meter Widgets are not
clipped like the Video Window by its scroll area parent though.
2020-05-25 12:44:54 -03:00
ericchristoffersen
922ebf987b Teach elevation widget to honor skipping (#3443)
Elevation widget was showing progress based on distance, which is workout distance and didn't accout for distance change due to skip forward/skip back.

Add routedistance to realtimedata so elevation widget can access it
elevation using routedistance to show progress
Fix uninit iterator in elevation widget paint
Draw route distance in elevation widget
2020-05-25 11:16:54 -03:00
Mark Liversedge
ca5504e486 DataFilter tests() - no submaximal
.. the recent update to tests() to retreive the bests found did not
   ignore submaximal points.
2020-05-25 12:21:01 +01:00
Mark Liversedge
369ffd2040 DataFilter vectors - estimates()
.. estimates(model, cp|ftp|w'|pmax|x|date) - returns a vector of values
   for the model selected.

   As with the estimate() function, passing a duration value 'x' will
   return the PD model estimate for that duration.

.. also removed hard coded model names.
2020-05-25 11:29:37 +01:00
Mark Liversedge
f4fcc93693 Deprecate WebKit Support
.. The NOWEBKIT define is no longer required to build.
   We now only support building with Chromium QWebEngine
2020-05-25 09:00:36 +01:00
Michel Dagenais
e8b1f69d63 Meter widget on linux (#3454)
Enable Meter Widgets overlaid on Video Window for Linux

Meter Widgets, with a transparent background over the video window, use
little screen estate while providing all the needed information. They
were added for WIN32 first but actually work fine on Linux with minor
flag adjustments.
2020-05-22 17:07:42 -03:00
Mark Liversedge
6c31805981 DataFilter vector tests() update
.. tests(user|bests, duration|power) - with no parameters will just
   return the number of tests in a ride/date range, or with 2 parameters
   will retrieve user defined or bests found by algorithm the last
   parameter defines if duration (secs) or power (watts) values are
   returned.
2020-05-21 19:35:17 +01:00
Ale Martinez
f2d93cc2dc Travis - Cache Homebrew downloaded bottles to speedup macOS builds
[skip appveyor]
2020-05-20 21:49:11 -03:00
Ale Martinez
5a0b022188 Travis - Enable cache for D2XX folder
[skip appveyor]
To avoid download and copy on each build
2020-05-20 21:04:35 -03:00
Ale Martinez
1cb1beb09c Enable GC_VIDEO_VLC option for macOS
After this change:
QtMacVideoWindow.h is used only for native macOS video options:
    GC_VIDEO_AV (incomplete)
    GC_VIDEO_QUICKTIME (obsolete)
Otherwise standard VideoWindow.h is included with the same options for
the three supported OS:
    GC_VIDEO_NONE: placeholder for no video, currently used for macOS builds
    GC_VIDEO_VLC: basic video control plus videosync, macOS experimental
    GC_VIDEO_QT5: basic video control only, macOS experimental
Overlay Widgets only works on Windows with VLC.
Tested with VLC 3.0.8 on the 3 Operating Systems.
2020-05-20 18:39:50 -03:00
Mark Liversedge
47e67f4d37 DataFilter vectors - resample()
.. resample(old, new, yvector) - returns yvector resampled from old
   sample rate to new sample rate. Assumes yvector has already been
   interpolated or smoothed as needed (see the interpolate function)

   For example, resampling to 10s power samples in a user chart:
   {
    finalise {
        t <- samples(SECS);
        xx <- seq(head(t,1),tail(t,1),10);
        yy <- resample(RECINTSECS, 10, samples(POWER));
    }

    x { xx; }
    y { yy; }
   }
2020-05-20 14:46:57 +01:00
Mark Liversedge
5772f6fd2f DataFilter vectors - interpolate()
.. interpolate(linear|cubic|akima|steffen, x,y, xvalues) - returns a
   vector of yvalues for each element in xvalues where the points
   in x,y are interpolated using the selected algorithm passed
   in the first parameter. e.g:

   xx <- samples(SECS);
   yy <- samples(POWER);

   first <- head(xx,1);
   last <- tail(xx,1);
   zxx <- seq(first, last, 0.1); # 10ths of a second
   zyy <- interpolate(cubic, xx, yy, zxx);
2020-05-19 18:34:38 +01:00
Ale Martinez
d4a5eaa501 Add Python 3.7 to Windows Installer and Linux AppImage
For Windows we use Python embeddable distribution
For Linux the relocatable Python AppImage
Packages included: sip, numpy, pandas, scipy, lmfit and plotly
[publish binaries]
2020-05-17 20:54:10 -03:00
Mark Liversedge
881e517b1a DataFilter vectors - random()
.. random(n) returns a vector of n random numbers between 0 and 1.
2020-05-17 18:51:43 +01:00
Mark Liversedge
21415379af DataFilter vector - samples(WBAL|WBALSECS)
.. added WBAL and WBALSECS as options for the samples() function to
   retreive the w'bal value (in joules) and the secs too.

.. seconds are potentially different to the samples(SECS) values as
   the w'bal series is always in 1s samples with gaps in recording
   accounted for as part of the calculation.
2020-05-16 20:08:35 +01:00
Ale Martinez
89b74816f6 Travis - Add core modules to Python distribution on macOS
[skip appveyor]
Initially: sip, numpy, pandas, scipy, lmfit and plotly
Deployed Python added to search path
Binaries reference the Python library on Cellar
Related to 2c0ce8f5c5
2020-05-16 14:09:03 -03:00
Mark Liversedge
f3e9ba3573 Datafilter vectors - rev()
.. rev(vector) - returns the vector with the sequence reversed.
2020-05-15 16:51:28 +01:00
Alejandro Martinez
2b68037c72 Enable build using vlc 3 on Windows with MSVC
On Linux no changes are required
In both cases the dynamic libraries seem to be binary compatibles
2020-05-14 19:42:29 -03:00
Ale Martinez
71a81e7f01 Add sha256 hash for CI binaries to GCversionXXX.txt
[publish binaries]
2020-05-14 11:12:13 -03:00
Mark Liversedge
f261a76b9e Datafilter vectors - bin()
.. bin(data, bins) - returns a vector of the data binned into bins, any
   data less than the first bin will be discarded, and data greater than
   the last bin will be included in the last bin.

   the returned bin is based upon counts, so will need to be scaled
   if want duration in seconds.

   e.g:

   b <- bins(data, quantiles(data, c(0,0.25,5,0.75,1))) * RECINTSECS;
2020-05-14 12:45:11 +01:00
Ale Martinez
a94500f1c3 Add GCversionXXX.txt to CI builds results
Where XXX identify the OS, to give build context.
GoldenCheetah --version output plus the last commit.
[publish binaries]
2020-05-13 18:19:45 -03:00
Ale Martinez
2c0ce8f5c5 macOS Travis-ci build - change library path in Python interpreter
Adds SIP 4.19.8
2020-05-13 13:13:43 -03:00
Mark Liversedge
4b4d86f413 Datafilter bug fixes
.. annotate - didn't validate parameters - seemingly inocuous but there
   are multiple validators that update leaf->seriesType. When this did
   not happen a) syntax errors were ignored (and caused a crash) and
   b) functions like samples(POWER) returned the wrong data.

.. annotate - assumed parameters were numeric or string but did not
   support vectors.

.. lots of use of 'it' as a variable, overriding the scope of the
   DataFilter::eval() function parameter which in a couple of cases
   led to SEGV ('it' is used when indexing vectors).
2020-05-13 14:53:25 +01:00
Mark Liversedge
670698fdef Datafilter - quantile()
.. quantile(vector, quantiles) - returns quantile values for the vector
   passed. quantiles can be a single value, or vector of values. The
   quantile is expressed as a value between 0 and 1, where 0.5 would
   represent the median. Values outside this range are truncated to
   0 or 1.
2020-05-11 19:39:07 +01:00
Mark Liversedge
73f11db578 Datafilter - daterange() closure
.. daterange(from, to, expression) - executes the expression setting the
   selected daterange as from-to.

.. any expression that honours the trend view date selection will use
   the from-to dates provided.

.. for example, to get weight data for a specific daterange:

   measures <- daterange("2020/01/01", "2020/05/01",
                          measures("Body", "WeightKg"));
2020-05-10 20:14:26 +01:00
Mark Liversedge
021ecda647 DataFilter - meanmax() set date range
.. meanmax(SERIES [, start, stop]) - now allows the user to provide a
   date range for the meanmax data to collect. This is so you can, for
   example, plot a 'last 90 days' curve:

   {
      finalise {
         yy <- meanmax(POWER, Date-90, Date);
         xx <- seq(1, length(yy), 1);
      }

      x { xx; }
      y { yy; }
   }
2020-05-10 16:47:59 +01:00
Mark Liversedge
44475a03fb Datafilter - meanmax() computer
.. meanmax(xvector, yvector) - returns a mean-maximal curve in 1s
   intervals from the x,y pair passed in.

   the data will be truncated where xvector and yvector are different
   lengths, negative y values are set to 0 and the entire dataset
   will be interpolated where there are gaps (i.e. the data is not
   presented in 1s intervals).
2020-05-10 15:57:57 +01:00