Fernando Maldonado pointed out that if he deselected, for example, Cadence on
the Ride Plot, then switched to another ride, the Cadence check box remained
unchecked but the Cadence curve showed back up on the plot. To hide the
curve, he had to check and uncheck the box again. This commit fixes that bug.
I'm not entirely happy with this fix. I'd rather AllPlot had access to the
QCheckBox objects in AllPlotWindow, but I can't think of a clean way to do
that. This patch at least seems to work.
With the introduction of the rideSelected signal the RideFile was
opened (as previously) by the RideSummaryWindow::htmlSummary()
member. In some cases, this signal was processed by RideSummary window
AFTER the other charts (AllPlot etc) this results in 'No data' being
shown on other charts.
This patch moves the file reading to RideItem::ride() which was previously
a public RideFile * (that is now a protected member ride_). As a happy by
product it removes the need to check if the file has already been read
across all other functions ensuring in-core values are not accidentally
overwritten. The read errors are made available by a new RideItem::errors()
member.
This modification is required to support the RideImportWizard in freeing
loaded RideFiles during batch import to ensure virtual memory is not
exhausted when large numbers of files are imported at once. This modification
is also included in this patch.
The default position of the power combo box in the Ride Plot is to shade
power. Change the default value of the shade_power variable to match. This
didn't matter before 79ced76, since prior to that commit we (mostly
redundantly) called showPower from setAllPlotWidgets, whereas now we only call
showPower after a change in the combo box.
I don't like disabling the ride plot tab when I select a manual ride,
because I frequently scroll through the ride list to search for a ride
by the shape of its ride plot, and every time I hit a manual ride I get
bounced to the CP plot tab. So rather than disable the ride plot tab,
just make it show an empty plot.
The previous version of this code contained a memory corruption bug.
QwtPlot deletes all of the items that are attached to it in its
destructor, but the QwtPlotMarkers for intervals were being allocated as a
group with array new. If we deleted an AllPlot object, then, it would
have tried to delete each of the marker objects individually, rather than
with array delete, which causes memory corruption. We haven't seen this
bug before because we don't ever delete AllPlot objects (which is a memory
leak in MainWindow).
This update changes the plot to use a right y axis for speed. This makes it easier to see speed differences.
Some other packages use separate y axes for each data type, but as far as I can tell, this is not available with the qwt library used by GC.
--jtc
regardless of the Units preference. This patch checks the preference
and displays it in the appropriate units.
Unlike some of the other cases, I'm checking the value of the Units
setting each time the plot/panel is displayed.
The patch also pulls the 0.62137119 magic constant into a #define
MILES_PER_KM. This constant (and it's inverse, KMS_PER_MILE), occurs
in several files, and (IMHO) really deserves to be pulled into a
separate header, but again, that's work for another day.
--jtc
someone sets the date on their PT and doesn't reset the device before going
for a ride. This fix will keep GC working until the user splits the ride
(and until we add a ride-splitting function).