Commit Graph

10008 Commits

Author SHA1 Message Date
Mark Liversedge
d57c3c9ce5 Fix TopNOverviewItem refresh when config changes
.. lookup metric when the configuration changes.
2021-08-17 18:44:42 +01:00
Mark Liversedge
0d2310e76a Overview Zone tile refresh
.. updates when config changes, not just at restart.
2021-08-17 18:24:00 +01:00
Mark Liversedge
d7ae5610cf Overview items respond to config changes
.. added configChanged() to base class

.. added calling configChanged() when preferences are
   changed and when the items config is updated.

.. updated MetaOverviewItem to use this, but also need
   to update the Zone and Best tiles too.
2021-08-17 17:45:21 +01:00
Mark Liversedge
eaa6120467 Overview Vertical Scrollbar
.. rounded and color changes when dragging, to align with the
   tile scrollbars and basically a bit more modern.
2021-08-17 12:17:26 +01:00
Mark Liversedge
e464762f7f Imperial/metric conversion error
.. in metricstrings(), asstring() and intervalstrings()
2021-08-16 22:53:03 +01:00
Mark Liversedge
195514c30e Fix Invalid JSON for .gchart
.. the irony that adding a __LAST__ property to ensure we
   had well formed JSON made sure it was /always/ invalid.

.. see fd546b4da for impact (almost none, but hey).
2021-08-15 09:42:15 +01:00
Mark Liversedge
5fd1a08419 Save/Restore Overview column widths
Fixes #4007.
2021-08-15 09:36:24 +01:00
Mark Liversedge
2ea3080d24 VERSION 3.6 DEVELOPMENT BUILD AUGUST 2021
.. marking up for release of a new development build.

[publish binaries]
v3.6-DEV2108
2021-08-14 11:17:36 +01:00
Mark Liversedge
fd546b4da1 Overview default config
.. when adding an overview chart it configures from a .gchart
   file built in via application.qrc

.. to update the default config all the developer needs to do
   is design using GC then export the .gchart into the
   appropriate src/Resources/charts/file.gchart

.. NOTE: the exported file has an errant comma (,) after the
         __LAST__ element. This is invalid JSON and should
         be fixed. It needs to be removed manually right now
         otherwise the JSON does not parse.
2021-08-14 10:13:51 +01:00
Mark Liversedge
2b30f9aa50 DataOverviewItem Vertical Scrollbar
.. progressively boldens as you hover and overlays contents
   to avoid taking screen real estate and being a distraction.

.. only watches mouse events and ignores wheel events since
   these clash with chartspace scrolling.

Fixes #4006.
2021-08-13 12:35:43 +01:00
Alejandro Martinez
09de27b0d2 Estimate Power - Add warning about accuracy
The sooner new users realize (or accept) they need a power meter
for power analysis of general outdoor rides, the better.
2021-08-12 16:50:15 -03:00
Alejandro Martinez
cc3f291113 Add encrypted API Key for RideWithGPS to Travis-ci builds
[skip AppVeyor]
To enable #3371 for Linux and macOS builds
2021-08-12 13:36:04 -03:00
Alejandro Martinez
dcd2a69951 Merge branch 'master' of https://github.com/GoldenCheetah/GoldenCheetah 2021-08-12 13:01:16 -03:00
Magnus Gille
c3bbd3a9ee Add support for Garmin HRM-Pro
Fixes: #3984
2021-08-12 16:51:56 +01:00
Mark Liversedge
d449933ab1 Refresh Perspective Selector on Add/Delete
.. commit 91f2c46 introduced a regression where the selector
   is not updated when the perspectives are changed (via
   the manage/add perspective functions).

.. this was because resetPerspective() returned if the
   athlete/view combination was last used to set the
   selector -- we now override this, but only when the
   perspectives config is changed.
2021-08-12 16:50:06 +01:00
Alejandro Martinez
7b2bd79448 Add encrypted API Key for RideWithGPS to AppVeyor builds
To enable #3371 for Windows builds
2021-08-12 12:23:57 -03:00
Mark Liversedge
6e88ee4ca6 Date consistency
.. datestring() was using 2 digit years and Overview data table
   sorting only expected 4 digit years.

.. datestring() now uses 4 digit years in line with everywhere
   else in the code.

.. data table sorting now supports 2 digit years and xx/xx/xx
   style dates too (just in case).
2021-08-12 16:11:18 +01:00
Mark Liversedge
b893e702b3 Iverview Data Table Negative Numbers
.. negative numbers were treated as strings because the
   matching pattern did not contain a '-'.
2021-08-12 13:35:55 +01:00
Mark Liversedge
18dbedc586 Fix Overview tile config
.. because the config widget is created before the tile
   configuration is loaded it needs to be updated before
   being shown to the user.

Fixes #4001.
2021-08-12 10:01:00 +01:00
grauser
fcad1ed196 RideWithGPS : Correct/implement API v2
Fix #3371
2021-08-11 22:20:23 +02:00
Mark Liversedge
8375f539db Bar Chart and Group By Category Labels
.. slightly improved category labels on a bar chart when groupby
   and date range is used. Labels for week, month and year are now
   specific e.g. 23/5, May and 2021 labels are applied respectively.
2021-08-10 21:02:59 +01:00
Mark Liversedge
cc0bb2e6d6 UserChart Smoothing and GroupBy
.. axis settings updated to enable users to smooth and group by
   for data series on the axis.

.. since group by needs to aggregate the series also have a new
   config term to define the aggregation method (Average, Total,
   Peak et al).

.. grouping and smoothing is applied in UserChart not the Generic
   chart or plot, so this functionality will not be available from
   Python and R charts (mostly because axis management and config
   is done differently).

Fixes #3999.
2021-08-10 18:47:39 +01:00
Alejandro Martinez
95cd28a279 Python embedded - Include Pandas 1.2.3
Pandas 1.3.x provokes problems on some charts, like HRV Trends
and otheres reported at the forum. Let's wait until it stabilizes
2021-08-09 20:27:46 -03:00
Alejandro Martinez
39fc9e4537 Enable View - Reset Layout considering perspectives
It behaves as before: current view layout is discarded and default
layout with perspectives is fetched from goldencheetah.org first and,
if not available, baked in layout is used.
Website defaults are not updated yet, so baked in layouts are used now.
2021-08-09 17:30:10 -03:00
Alejandro Martinez
1f77f08ae0 V3.6 Upgrade processing - put the current chart config into a general perspective
Renamed Resouces/xml/*-layout.xml files to Resources/xml/*-perspectives.xml
Removed deprecated Summary from Activities and Trends, and added default Overview to Trends
Added enclosing <Layouts></Layouts> and General perspective with proper type to each one
This provides default layouts for newly created athletes.
We still need to update layouts before release and to enable Reset Layout.
2021-08-08 14:24:29 -03:00
Mark Liversedge
91f2c46c3e Athlete/View switch update perspective selector
.. along the way renamed AthleteTab related methods in MainWindow
   to reflect the last commit renaming the classes.

.. there are also a handful of fixups to SEGV when no ride is
   selected in DataFilter (triggered by opening a second athlete
   and switching to trends view, which need to recreate the athlete
   switch bug that is also part of #3997).

.. and the logic to reset perspectives is changed in MainWindow
   with a special method resetPerspective that is called everywhere
   but will check the athlete/view combination has not already
   been set (to avoid multiple passes).

.. multi-athlete and perspectives need better testing as there are
   probably more SEGV in there, and if we fix them we could also
   remove the requirement for the opening view to always be Analysis.

Fixes #3997.
2021-08-08 15:19:36 +01:00
Mark Liversedge
01e0d14757 Renaming classes
.. Tab becomes AthleteTab - since Tab is almost meaningless
   TabView becomes AbstractView - since its the base for all the views

   there are no functional changes or fixes in this commit.
2021-08-08 13:05:06 +01:00
Mark Liversedge
29a76773a6 Overview Data Table tweaks
.. honour the sort order when refreshing (e.g. select new daterange or
   a new activity).

.. thin line to separate headings from data to make easier to read.
2021-08-07 20:44:13 +01:00
Mark Liversedge
abdce42223 User Sort DataTable on Overview
.. by clicking the header column the user can toggle sorting of
   the contents.

.. we try to infer the type of data in the column for sorting which
   probably works 80/20, but is better than adding yet more of a
   burden on the program that supplies the data.
2021-08-07 14:39:10 +01:00
Mark Liversedge
98466cc9cf Overview Data Table and Intervals
.. add legacy program to analysis view for an interval table.

.. highlight row in data table when mouse hovers over a row, but
   only when not using clickthru, since that already highlights
   the row to indicate click is available.
2021-08-07 09:23:12 +01:00
Alejandro Martinez
924da10958 DataFilter intervals() and intervalstrings() for Activity and Trends views
intervals(symbol|name|start|stop|type|test|color|route|selected|date|filename [,start [,stop]])
    returns a vector of values for the metric or field specified for each interval
    if no start/stop is supplied it uses the currently selected date range, or activity when no date range.

intervalstring(symbol|name|start|stop|type|test|color|route|selected|date|filename [,start [,stop]])
    same as intervals above but instead of returning a vector of numbers, the values
    are converted to strings as appropriate for the metric (e.g. Pace_Rowing mm:ss/500m).

Both metricname and metricunit now support name, start, stop, type, test, color, route, selected, date, filename,
in addition to metric names and date, to get corresponding localized string.

Example program to build an intervals table in Activities displaying all intervals for selected activity,
similar to the one in RideSummary:

{

names {
    metricname(name,
               Duration,
               Distance,
               Pace,
               xPace,
               Average_Heart_Rate
               );
}

units {
    metricunit(name,
               Duration,
               Distance,
               Pace,
               xPace,
               Average_Heart_Rate
               );
}

values {
    c(
      intervalstrings(name),
      intervalstrings(Duration),
      intervalstrings(Distance),
      intervalstrings(Pace),
      intervalstrings(xPace),
      intervalstrings(Average_Heart_Rate)
      );
}

}

Fixes #3626
2021-08-06 16:54:23 -03:00
Alejandro Martinez
0f9b92f8cf Datafilter - remove tabs introduced accidentally in previous commit 2021-08-06 14:44:07 -03:00
Mark Liversedge
171760097d GenericPlot scale labels
.. the scale factor was not being applied to data labels on
   a user chart.
2021-08-06 11:46:26 +01:00
Mark Liversedge
db9623a201 Alternate Json string protection
.. when embedding json in xml element attributes the string
   decoding mangles results.

   this is because of the way \ and " are handled at each
   pass, causing combinations to be lost early when decoding.

   This is largely a non-issue, except the user chart config
   is stored in perspectives.xml and worse, when embedded on
   an overview is encoded as .gcchart (xml) before being
   encoded in the perspective.xml.

   To avoid this issue, specifically with user charts and
   to leave all other json string encoding and decoding
   unaffected (e.g. ridefile.json) a new protect/unprotect
   method has been introduced.

   Utils::jsonprotect2() and Utils::jsonunprotect2() will
   still decode older style encoding for backwards
   compatibility, but now will translate \ and " in the
   encoded string with :sl: and :qu:

   This means that, for example, the following substitutions
   will be made:

   newline (\n) -> :sl:n
   cr (\r) -> :sl:r
   \ -> :sl:
   " -> :qu:

   If users add text with these characters (e.g. :sl:) then
   it will be decoded to a slash, but it is highly unlikely
   they will do this, and if they do, it should be harmless
   as these text strings aren't part of the the datafilter
   syntax.

Fixes #3996
2021-08-06 07:28:21 +01:00
Mark Liversedge
62012f1990 Fix Overview BubbleViz refresh bug
.. since axis min and max values were not initialised the
   visualisation would fail to refresh and was generally
   unpredictable.

.. we now set initial values and check when updating.
2021-08-05 18:06:22 +01:00
Alejandro Martinez
b36bbdc3c0 CP Chart - Reposition model helper when off window
This is already fixed when it is out to the right,
but still can happen to the left.

Fixes #3995
2021-08-05 13:09:17 -03:00
Mark Liversedge
00b50b47c3 activities() datafilter function
.. activities("Workout_Code=\"FTP\"", metrics(BikeStress))

   A new function that provides an activities filter
   to apply as a closure to an expression, following the
   same approach as the daterange() function.

   In the example above metrics() will only return values where the
   activity has a workout code "FTP".
2021-08-05 13:48:18 +01:00
Mark Liversedge
1986df1c95 DataFilter string escaping
.. unescape datafilter strings since the lexer supports that
   but they are not parsed.

.. Only supports \n, \r and \" for now, but that should be
   enough.
2021-08-05 10:56:23 +01:00
Alejandro Martinez
15bbe288a0 Enable DataFilter zones to be used in Trends View
Formula doesn't change.
When date range is set Trends View is assumed and we use the sport of included
activities with default to Bike (Run for Pace) when mixed, and date is the end
date for the date range.
Otherwise we use activity sport and date as before.
2021-08-04 16:06:28 -03:00
Mark Liversedge
534a6a4ef1 Overview table clickthru fix for single row
.. need to highlight first row of table when only a
   single row for click thru. Since values are shown in
   rows not columns.
2021-08-04 15:15:52 +01:00
Mark Liversedge
d41e7dd1f6 Logical and is '&&' not 'and'
.. annoyingly gcc allows this which is why I keep making
   this silly mistake.
2021-08-04 13:36:28 +01:00
Mark Liversedge
a98ac12d0e Fix clickthru SEGV for Bubble and TopN overview items
.. they raised signals in paint events which was highly
   problematic (!)

Fixes #3993
2021-08-04 13:21:09 +01:00
Mark Liversedge
49989f95b6 Overview Data Table - Part 3 of 4
.. click thru from the data row to the trends view to
   view it on the activity view.

.. Added a function "f {}" that returns the activity
   filenames- the same semantics used in the user chart.

.. the mechanism used in the overview items to click thru
   from the itemPaint function is dropped and we now
   do it from the mouse release event.

.. see issue #3993 which will get fixed using the same
   scheme as this one.
2021-08-04 13:05:46 +01:00
Mark Liversedge
98e49c3228 Fixup UserChart mouse interaction on a Chartspace
.. when a user chart is placed on an overview we filter mouse
   events from the chartspace and not the widget due to
   events being discarded.

   See this issue for more details:
   https://github.com/GoldenCheetah/GoldenCheetah/issues/3992
2021-08-03 22:38:15 +01:00
Alejandro Martinez
171882dc9f DataFilter zones - use translated strings from WPrime and RideFile
Also use joules for fatigue zone limits like the old summary.
2021-08-03 17:14:44 -03:00
Mark Liversedge
bd864344bb Fixup for legend mouse events in chartspace
.. when a userchart is embedded into an overview mouse events
   do not propagate in their entirety- as a result the legend
   widgets do not see MouseRelease (even though they see
   MousePress).

   So the click to show/hide when hovering over a legend item
   responds to the press not the release.
2021-08-03 19:39:31 +01:00
Mark Liversedge
72f91c31a8 Fix user chart axis color
.. when using named colors the axis was always black because
   the color was not being translated via the RGBColor macro.
2021-08-03 15:51:36 +01:00
Mark Liversedge
155273232f User Chart on Overview - Part 2 of 3
.. User charts can be scaled (lines, texts, markers, legend)

.. Plot area background color honours overview card color
   when we're on an overview.

.. when adding a user chart to an overview make it span a couple
   of columns and 3 times deeper than a metric tile.

NOTE:

   There are two bugs that need to be squashed individually
   and are related to user charts on overview:

   1. Mouse event handling seems to be broken for user
      charts in Overview.

   2. User chart axis colors are always black when the series
      are configured to use named colors.
2021-08-03 14:36:35 +01:00
Alejandro Martinez
a0f77fbf70 Remove sport parameter from zones DataFilter function
zones(hr|power|pace|fatigue, name|description|low|high|units|time|percent)
applies to the currently selected activity and sport is implicit.

Also changed name() by metricname() and unit() by metricunit() in script comments.
2021-08-02 20:32:47 -03:00
Alejandro Martinez
fd384d69ba Fix zero div crash in Overview Data Table when names() returns an error
Found while removing sport parameter from zones.
2021-08-02 20:21:13 -03:00