Commit Graph

29 Commits

Author SHA1 Message Date
Mark Liversedge
feb111a4ff RideFile reading refactoring
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.
2009-12-18 19:39:29 -05:00
Sean Rhea
4a79c95d37 remove global mainwindow pointer from PowerHist 2009-12-13 11:02:33 -05:00
Mark Liversedge
29a9e41444 Interval features and new GC file format 2009-12-12 11:41:35 -05:00
Sean Rhea
95b44b7752 make zones ptr const 2009-12-10 10:16:57 -08:00
Sean Rhea
772de9f364 RideItem::zones is just a pointer
...not a pointer to a pointer.
2009-12-10 10:16:57 -08:00
Sean Rhea
522824bb40 switch RideFile::dataPoints to QVector
...so that we can binary search within them.  Also, switch a lot of
QListIterators to Qt foreach.
2009-11-01 11:51:26 -05:00
Berend De Schouwer
de96ee2f16 fix PowerHist zoom out with a call to setZoomBase 2009-10-03 18:13:09 -04:00
Greg Lonnon
243a28bb87 the settings code was leaking and it was copy/pasted in a few files.
created a method to find QSettings (settings.h) and stopped it from leaking.

The leak looked like this...

==7800==    at 0x4C2726C: operator new(unsigned long) (vg_replace_malloc.c:230)
==7800==    by 0x64FD232: (within /usr/lib/libQtCore.so.4.5.0)
==7800==    by 0x64FDB62: QSettings::QSettings(QString const&, QString const&, Q
Object*) (in /usr/lib/libQtCore.so.4.5.0)
==7800==    by 0x4738E5: PfPvPlot::setData(RideItem*) (PfPvPlot.cpp:361)
2009-09-11 08:49:20 -04:00
Sean Rhea
dc8877eb6a turn off tooltips in PowerHist
With some versions of Qt/Qwt, tooltips cause an infinite recursion.  We don't
know why this happens yet, but this patch at least prevents crashes while we
figure it out.
2009-09-06 14:13:31 -04:00
Sean Rhea
fbc3c939e2 remove unused functions 2009-09-06 14:08:19 -04:00
Justin Knotzke
656f548896 This should never have made it to github.
Revert "Revert "guard against all negative values in PowerHist""

This reverts commit d785ca5a0f.
2009-09-05 22:31:47 -04:00
Justin Knotzke
d785ca5a0f Revert "guard against all negative values in PowerHist"
This reverts commit df33fe2301.
2009-09-05 22:24:01 -04:00
Sean Rhea
df33fe2301 guard against all negative values in PowerHist
This patch unifies the way in which we handle negative values in the Power
Histogram by ignoring all values (speed, hr, cadence, power, and torque)
less than zero.

I'm not sure if this is the right way to handle such values long term, but
it sure beats dumping core.
2009-09-04 19:52:33 -04:00
Sean Rhea
dc50cf79e6 PowerHist cleanup: trust QVector::resize()
QVector::resize() already does exponential capacity growth and zero fills new
elements, so there's no reason for us to be doing either by hand.  This change
simplifies our code substantially.
2009-09-01 06:19:54 -04:00
Robert Carlsen
a970b12f68 Fix for PowerHist crash with HR of -1 2009-08-26 10:47:50 -04:00
Justin Knotzke
5a453fb210 Misc fixes by Julian Simioni.. Thanks. 2009-08-21 20:22:59 -04:00
Robert Carlsen
e8a7a4bf4d Fixed constructor bug when using a NULL value and qwt5. ie. unit(NULL) -> unit(0) 2009-08-11 17:15:54 -04:00
Justin F. Knotzke
622516b63d This code should now allow GC to be run off a USB stick.. or the Qollector. If GC finds a Library/GoldenCheetah next to the executable, it will use that location to store all of its settings and Libraries. Otherwise, it reverts to how GC handled settings previously. 2009-08-11 06:07:36 -04:00
Sean Rhea
e9bae94b83 fix unused variable warnings 2009-08-08 10:39:22 -07:00
Sean Rhea
ad8e5015e1 fix zero-torque bug in PowerHist 2009-08-01 14:04:48 -07:00
Justin F. Knotzke
8d3fbf85e1 Berend De Schouwer
A little tooltip highlighter to let you know power what you are looking at.
2009-06-22 03:18:05 +00:00
Justin F. Knotzke
af633953ec Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 03:10:46 +00:00
Justin F. Knotzke
13deea6f31 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:26:35 +00:00
Justin F. Knotzke
ca26791dcb Berend De Schouwer
A little tooltip highlighter to let you know power what you are looking at.
2009-06-21 14:10:16 +00:00
Justin F. Knotzke
5c2f829519 Danniel Connelly's patch regarding Histogram and the implementation of a Y Axis. 2009-05-16 20:57:39 +00:00
Justin F. Knotzke
52b2049949 Damian Grauser's patch which throws a toggle in the Ride Plot graphs which
will toggle between distance and time.

Thanks Damien.
2009-02-14 23:52:10 +00:00
Justin F. Knotzke
f7ea9b236e This changes the power histogram implementation to use the QVector
data type instead of dynamically allocating and freeing arrays. No
memory leak here, but it's an low hanging fruit type of example of
what kind of changes we can do to reduce the amount of explicit 
dynamic memory management.

   --jtc
2009-01-17 19:36:31 +00:00
Justin F. Knotzke
f1ade25fa7 or relatively short (~1 hr) activities, with relatively small (~5w)
bucket sizes, the power histogram often looks short and squat with a
lot of whitespace at the top because the largest bucket may be 3 - 5
minutes, but the y-axis is scaled by adding a constant 10 (minutes) to
the max.

The attached patch scales the y-axis by a factor of 1.1 (The ride plot
does the same scaling, and it appears to work well there).  Now you're
able to see more detail in histogram plots as the curve is not all
squashed along the bottom of the graph.
    -jtc
2009-01-03 18:35:55 +00:00
Sean C. Rhea
6e5487ca39 everything in one directory 2008-05-12 03:28:53 +00:00