Commit Graph

739 Commits

Author SHA1 Message Date
Mark Liversedge
45d7d3c610 GPS support in RideFile
RideFile data points now include lon and lat members for the longitude
degrees and latitute degrees from the source ride files. As a result
most of the RideFile readers now set longitude and latitude to zero for
each data point, except for:

* Gc Format Files - now support read/write
* Wko Format Files - now support read
* Tcx Format Files - now support read (smoothed if smart recording)

Although there are no features within GC at this point in time that use
positioning data this may change over time. Critically, as users save
files to the new GC file format whilst adding interval data it is
important that this positioning data is not discarded before new
features arrive.
2009-12-14 19:13:45 -05:00
Mark Liversedge
2745291f59 Find Peak Powers only for Intervals smaller than entire ride time
The find peak powers functions was previously adding peak intervals for
durations that were longer than the entire ride, for example a 20 minute
ride would still have a 30min and 60min peak power interval added.

The duration of the ride is now checked and only peak intervals that
are shorter or equal to the length of the ride are added.
2009-12-14 10:34:53 -05:00
Mark Liversedge
d042f54e05 Add Average Power in Brackets to Selection Name
When a user creates a new interval by selecting a section of a ride
on AllPlotWindow the newly created selection now has the average power
for the selection placed at the end of the selection name in brackets.
2009-12-14 10:34:46 -05:00
Sean Rhea
32150f1d38 up the power
...to accomodate Greg Steele's monster quads.
2009-12-13 21:26:21 -05:00
Sean Rhea
b1fe7345b3 bug fix: don't let high go negative
You can recreate the bug by creating a new cyclist with only one
relatively slow and short ride, then clicking on the CP plot.
2009-12-13 18:21:05 -05:00
Sean Rhea
bbfc4a768c don't show axes for non-existent curves
If you don't have altitude, you'll no longer have an axis for feet/meters.
Thanks to Gary Smith for pointing out that the previous behavior was silly.
2009-12-13 18:06:05 -05:00
Sean Rhea
542e4d6a4d add altitude for iBike CSV format
Thanks to Fernando Maldonado for the test file.
2009-12-13 17:40:33 -05:00
Mark Liversedge
a649f64655 Use Standard Library Binary Search
Replace handcoded binary search in RideFiletimeToDistance() method
in RideFile with lower_bounds, since it is more efficient. The
distanceToTime() method has been removed since it is not used.
2009-12-13 17:22:49 -05:00
Sean Rhea
74742965dd move IntervalPlotData into .cpp and fix mem leak 2009-12-13 15:16:57 -05:00
Damien Grauser
333fe46196 add tr() for some QString and add french translation 2009-12-13 15:04:51 -05:00
Mark Liversedge
014c6301f6 Free references in WkoFileReader 2009-12-13 14:57:00 -05:00
Mark Liversedge
3773ec573e Misleading code comments adjusted
Attribution in header of IntervalItem.{h,cpp}
Commented out code removed
2009-12-13 14:45:25 -05:00
Mark Liversedge
bfc0d1575a IntervalItem::name removed
The class member IntervalItem::name is redundant since it is a duplicate
of the text() member of the base class QTreeWidgetItem. By removing it
we both simplify the code and remove the need to keep name and text in
sync when renaming and creating intervals.

As a result the itemChanged signal that was connected for renames and
then disconnected when the items are cleared can be connected once
and no disconnect is neccessary.

This connect/disconnect oddity was originally to avoid a SEGV that
resulted from accessing text() whilst the QTreeWidgetItem was being
destroyed. The code for removing intervals when a new ride is selected
no longer destroys and recreats MainWindow::allIntervals (which was also an
artefact of the original code to avoid a SEGV).
2009-12-13 13:07:17 -05:00
Sean Rhea
0dc9f6a4c0 delete MainWindow on close 2009-12-13 12:53:57 -05:00
Sean Rhea
6b7afe3353 remove global mainwindow ptr 2009-12-13 12:50:09 -05:00
Sean Rhea
9b6b1ba085 remove global ptr to main window from PfPvPlot 2009-12-13 12:46:50 -05:00
Sean Rhea
eb257e0746 remove global ptr to main window from ErgFile 2009-12-13 12:42:09 -05:00
Sean Rhea
890151a696 stop using global pointer, remove const cast 2009-12-13 12:34:32 -05:00
Sean Rhea
ffc63d539a fix leaked ConfigDialog and memory errors
The ConfigDialog is modal, so it needs to delete itself.  However, the
existing code contained a bunch of destructors with calls to delete on
widgets.  That's wrong.  Widgets are automatically parented on being added to
layouts, the parent widgets delete their children in their own destructors.
So remove all the explicit deletes.
2009-12-13 12:10:58 -05:00
Sean Rhea
db7f9a9ad2 remove global mainwindow pointer from ConfigDialog 2009-12-13 11:32:39 -05:00
Sean Rhea
1cf94fec6f change case of mainwindow to distinguish from global ptr 2009-12-13 11:24:26 -05:00
Sean Rhea
d36fb9eae0 remove global mainwindwo ptr from save dialogs
Also, allocate dialogs on stack to make free explicit.  I find
Qt::WA_DeleteOnClose to be really non-intuitive for modal dialogs.
2009-12-13 11:21:48 -05:00
Sean Rhea
4a79c95d37 remove global mainwindow pointer from PowerHist 2009-12-13 11:02:33 -05:00
Sean Rhea
c9aec66dcf remove global mainwindow pointer from AllPlotWindow.cpp
Also remove ugly const cast by introducing MainWindow::mutableIntervalItems.
2009-12-13 11:02:32 -05:00
Sean Rhea
01e1c22640 remove global mainwindow pointer from AllPlot.cpp 2009-12-13 11:02:32 -05:00
Mark Liversedge
a0c839514a PfPvPlot Display Fixes
The new intervals code removed some replots() to stop flickering but
they also removed critical refreshes after CP and Cadence values
are updated by the user using the entry fields on PfPvWindow.

Additionally, the setData() function was used to refresh all curves
when intervals were selected which caused user entries to be reset.

This patch introduces PfPvPlot::showIntervals() to only refresh the
intervals curve and fixes replots() to a) replot when neccessary
after a user entry but b) to not replot mid-refresh in the zones
background function.

The PfpvPlot::setData() function only sets the main curve (all the
black points).

When the user changes CP, CAD, CL in the window dialog they call
replot() explicitly rather than assuming the utility functions will
do it for them, since the utility functions are called within
setData (amongst others) and results in multiple replots() that are
ugly, but more importantly make it difficult to spot the deltas on
the plot as new intervals are overlayed because they all disappear
for a split second.
2009-12-13 10:59:10 -05:00
Sean Rhea
3c72be18ff adjust BS to DP scaling factor
This should have been part of commit 6a514f3.
2009-12-12 22:31:05 -05:00
Sean Rhea
a609738cca add parent pointer 2009-12-12 22:08:29 -05:00
Sean Rhea
c940517690 use more const 2009-12-12 22:07:53 -05:00
Sean Rhea
8f6237c5f6 don't need to call "return;" at end of function 2009-12-12 22:02:59 -05:00
Sean Rhea
bef469384b just call MainWindow::rideItem 2009-12-12 22:02:02 -05:00
Sean Rhea
d37a98ac9c include AllPlot.h first 2009-12-12 22:00:35 -05:00
Sean Rhea
f63dca40ef add combo to switch PM plot between BS and DP 2009-12-12 17:44:12 -05:00
Sean Rhea
293129c180 store ptr to MainWindow in PMWindow
I'm going to need it later when I add the ability to switch
from BikeScore to DanielsPoints.
2009-12-12 17:35:04 -05:00
Sean Rhea
a4459926b7 store both BikeScore and DanielsPoints in stress.cache 2009-12-12 17:00:17 -05:00
Sean Rhea
6a514f3043 scale DanielsPoints so that 1 hr @ FTP == 100 2009-12-12 16:40:37 -05:00
Damien Grauser
216bc6ef4b add language selector and French translations 2009-12-12 15:23:46 -05:00
Mark Liversedge
29a9e41444 Interval features and new GC file format 2009-12-12 11:41:35 -05:00
Sean Rhea
2db45dc0c5 introduce MainWindow rideSelected signal
...and use it to update the various tabs when a ride is selected.
2009-12-10 13:13:10 -08:00
Sean Rhea
4c7311e152 move htmlSummary into RideSummaryWindow 2009-12-10 11:50:50 -08:00
Sean Rhea
2f23582d08 call computeMetrics, not htmlSummary 2009-12-10 11:11:24 -08:00
Sean Rhea
5e4dc2ce57 add RideSummaryWindow
This change allows us to connect the zonesChanged signal to the ride summary,
so that we don't have to call ride->htmlSummary as a special case whenever
we call zonesChanged.  It will also come in useful later when I introduce a
rideSelected signal.
2009-12-10 11:05:10 -08:00
Sean Rhea
f5bee4ce89 rename function 2009-12-10 10:16:58 -08:00
Sean Rhea
e7a76022bb new zonesChanged signal 2009-12-10 10:16:58 -08:00
Sean Rhea
1169ca9239 public zones in MainWindow is const 2009-12-10 10:16:58 -08:00
Sean Rhea
19c63883d0 MetricAgg gets const Zones 2009-12-10 10:16:58 -08:00
Sean Rhea
f1a28616a6 ConfigDialog gets ptr to zones, not ptr to ptr 2009-12-10 10:16:58 -08:00
Sean Rhea
a4a2ca136a CyclistPage gets const Zones ptr 2009-12-10 10:16:57 -08:00
Sean Rhea
95b44b7752 make zones ptr const 2009-12-10 10:16:57 -08:00
Sean Rhea
1096fb4125 make some functions const 2009-12-10 10:16:57 -08:00