Compare commits

...

822 Commits

Author SHA1 Message Date
Sean Rhea
30c877a5f2 fix FTDI required for SRM download bug
GC supports two download port types: serial ports and D2XX.  Before, if
either of these failed to load, the download dialog wouldn't show either
port type.  With this patch, if both fail, GC displays a warning, but if
either one succeeds, GC will proceed with only that port type.  This
change should fix the problem that users were having to download and
install both the FTDI drivers and the PL2303 ones in order to download
from the SRM PCV.
2010-02-06 11:23:26 -08:00
Robert Carlsen
92d2601a5a Added sanity checking to ignore missing metrics
There is a possibility that ride metrics may become unavailable yet
remain requested by QSettings (stored in
~/Library/Preferences/org.goldencheetah.GoldenCheetah.plist on OS X).

This patch ignores any metrics listed in the preferences yet are not
supported by the running version of Golden Cheetah.
2010-02-05 08:09:34 -08:00
Sean Rhea
113375669f don't check dependencies until newMetric is called
Before, we checked them during addMetric, and that left us vulnerable
link-order errors.  With this patch, we wait until someone actually asks
for an instance of a metric, and then we check all metrics' dependencies.
That way, since the Ride Summary always creates at least one metric, we'll
still check the dependencies of them all.  We just do it a little later in
the program's execution than before.
2010-02-05 08:08:21 -08:00
Sean Rhea
cd0e9c184b add Erase Ride(s) button to download dialog
This is a workaround for the SRM erase bug.  It gives the user a way to
try erasing the device's memory without re-downloading a ride.
2010-02-04 20:26:16 -08:00
Sean Rhea
28cbe359d4 regenerate stress cache after config change
fixes #32
2010-02-04 05:15:02 -08:00
Sean Rhea
76a8d94384 stop coddling 705's firmware
In other words, we're no longer going to support files from broken 705
firmware in GC.  However, GC 1.2 contains the check, so people with bad
files can open them in 1.2, export to CSV, and then import into a more
recent build.

Alternatively, if someone comes up with a good way to distinguish files that
need this check from those that don't, I'd be happy to use that.
2010-01-25 20:21:54 -08:00
Robert Carlsen
19e023928b Updated doc/Makefile for new content.
Added cyclist-info.png to the install directive.
Edited the rsync path to reflect the absolute rather than relative path
to the www root for the goldencheetah website.
2010-01-24 13:22:34 -05:00
Jamie Kimberley
0f0ee9e36e Update power.zones info in users guide
Updated web documentation to describe the three methods that we have in
place to set the CP value in the power.zones files.
2010-01-24 13:17:22 -05:00
Mark Liversedge
391fc7b9c9 True Interval Patch, second part
The best interval dialog rounded intervals to the nearest second
due to a casting of a double to int. This was introduced by Mark L
during the intervals code patch and is an error.

All the plots have now been adjusted to correctly determine if a ride
point is within an interval. Related cropping and binning issues in
3d plot an Histogram plot have also been corrected.

fixes #15
2010-01-20 08:28:42 -08:00
Sean Rhea
dbb8429665 fix BestIntervalDialog
The small test file doesn't catch this bug, but just about
any real file does.  Grrr.
2010-01-19 10:55:54 -08:00
Sean Rhea
d9e9fe1d22 fix fencepost errors in Ride->Find Power Peaks
Also removes nasty cut-and-paste from BestIntervalsDialog.

Tested successfully on test/rides/2010_01_13_*.gc.
2010-01-18 11:56:35 -08:00
Sean Rhea
e2deb1fc99 extract core functionality into static function
...so that we can use BestIntervalDialog::findBests elsewhere in the code.
2010-01-18 11:54:42 -08:00
Sean Rhea
16f3032b3f fix fencepost errors in BestIntervalDialog
This is almost a complete rewrite of the functional part of the dialog.
I've tested it on both test files (2010_01_13_*.gc in test/rides).
Thanks to Mark L for pointing out a number of the problems.
2010-01-18 11:34:01 -08:00
Sean Rhea
075829500f remove eol spaces -- no functional change 2010-01-18 11:32:07 -08:00
Sean Rhea
3dab200560 test file for finding interval fencepost errors with recInt=1.0 2010-01-18 11:32:07 -08:00
Mark Liversedge
0be592cab5 test file for finding interval fencepost errors with recInt=1.26 2010-01-18 11:31:57 -08:00
Mark Liversedge
7754f9a0a3 replace import pragmas with includes
import is deprecated and is almost certainly not what was originally
intended, since it is used to include Qt and GC header files.

fixes #22
2010-01-18 08:27:42 -08:00
unknown
0b36db91d0 Add OpenGL, GCC4 and 3d DLLs to Win32 nsi
When building an installer the nsi file needed to be
updated to reflect new DLL dependencies introduced by
the Model plot.

Additionally, Qt 4.6 is built using gcc 4.4 and now
requires the associated runtime dll.

fixes #21
2010-01-18 08:26:50 -08:00
Sean Rhea
699cd73b6a appsettings can't be false
Also note the use of a default value as the second
argument to appsettings->value().
2010-01-17 21:19:10 -08:00
Mark Liversedge
4d1783276c fix 3d plot performance issues
Scrolling up and down the ride files is painfully slow when
3d is compiled in. This patch uses a setActive mechanism in
the same fashion as the pfpv and performance manager tabs.

Additionally, a recent patch to support user preferences for
units added a settings lookup that was called for every point.
This is also fixed.

fixes #16
2010-01-17 21:18:53 -08:00
Sean Rhea
195937f186 ignore intervals that start after the end of the ride
fixes #17
2010-01-17 21:02:12 -08:00
Sean Rhea
9509e083b7 remember smoothing across restarts
fixes #18
2010-01-17 20:54:47 -08:00
Sean Rhea
29487ed774 mark warnings as such in import wizard 2010-01-17 20:40:32 -08:00
Sean Rhea
f2ae215d4b no decimal point for elevation gain metric
Thanks to Tom W for pointing this out.
2010-01-17 20:19:45 -08:00
Rainer Clasen
99b6e1ba71 Don't reread downloaded SRM files
Get the start timestamp directly from the downloaded data. No need to read
the written data, again.
2010-01-16 13:04:09 -08:00
Rainer Clasen
2f9f44ee9d fix SRM download when there is no data
When you're trying to download data from an empty PCV, srmpc_get_data()
returns a data structure without chunks. This will cause srm_data_write()
to fail.
2010-01-16 13:01:21 -08:00
Keisuke Yamaguchi
b1137801be Added translation support for RideImportWizard Finish/Abort button
fixed bug "when non-English language is selected, Import Wizard
cannot be closed/aborted with abortButton".
2010-01-16 10:35:48 -05:00
Rainer Clasen
0eb650f544 report error detail on SRM download failure
While SrmDevice is catching errors returned by srmpc_get_data, it doesn't
decode + report what kind of error (errno).

Adjusted message to include the returned error.
2010-01-15 23:14:37 -05:00
Robert Carlsen
d543fe45f9 Adding slash in default library path for Windows 2010-01-15 09:13:26 -05:00
Robert Carlsen
f5dab4d9dd Modify .gitignore to omit "tags" dir created by ctags for vim 2010-01-15 08:49:47 -05:00
Thomas Weichmann
bb58138e26 respect user's units pref in 3d plots
fixes #14
2010-01-13 08:28:15 -08:00
Jamie Kimberley
4d3c208908 Show power and cadence in stationary tcx files
Minor change to handle how duplicate records in tcx files are handled.
This allows for power and cadence to be properly displayed for rides
with no distance information (e.g. trainer rides).
2010-01-13 08:23:41 -08:00
Mark Liversedge
a89ebacac0 support Windows in Serial.h|cpp
The serial code was Linux/Mac only and utilised termio/tcsetattr
functions that were not available on Windows platforms. This patch
ports the serial code to the Windows APIs using the same approach
as the Computrainer.cpp code.  It allows us to support old-style
serial download cables on Windows.  (We already supported them on
Mac and Linux.)
2010-01-11 08:01:38 -08:00
unknown
9920afdb4d update french translation 2010-01-10 11:07:57 -08:00
Mark Liversedge
2b580ca6fd Fix 3d cosmetics and CPV/AEPF channels
The pedal force channel was incorrectly named - it should have been
the torque value. The AEPF/CPV values are derived from the power
cadence and cranklength. This is corrected with this patch.

Additionally, the axis labels positioning has been amended to be
more appealling and position more appropriately.
2010-01-10 10:45:15 -08:00
Sean Rhea
5d7168bc65 bug fix: don't lose intervals when spliting rides 2010-01-10 10:42:52 -08:00
Sean Rhea
6d759b8d1d fix unused variable warning 2010-01-10 10:07:57 -08:00
Mark Liversedge
68845644f6 WKO Parsing Dist Chart Fix
The bodge to manage so-called 'optional padding' which led to the
need to keep updating constants like 0x8014 et al was caused by a
misunderstanding of how Distribution Charts are recorded in a WKO
file.

This patch correctly decodes these segments of a WKO file and as
a result remove the need for the optpad2 function. There are still
some 'weird' constants that are parsed, but these are limited to
the artefacts resulting from the fact that the WKO software uses
MFC persistent object format to write the file data and these
constants reflect the POF Archive PIDs.
2010-01-10 10:06:18 -08:00
Mitsukuni Sato
2d3f26fed2 translate to japanese (5 Jan 2010) 2010-01-10 10:03:08 -08:00
Chris Cleeland
65b9c14255 allow a calendar popup
Interestingly, Chris Cleeland, and apparently only Chris Cleeland, can't
enter manual rides for dates in the past without this patch.

Fixes #7.
2010-01-06 08:21:07 -05:00
Jamie Kimberley
a812b6ea08 website now has developer guide for tracker
Updated the documentation on the website to include some guidelines
for developers worknig with the issue tracker.
2010-01-06 08:11:52 -05:00
Steve Gribble
d58d7dedaf Fix float parsing bug that manifests on Qt4.6 and later.
This file relies on Qt's QDataStream to handle the parsing
of primitive C types from Computrainer .3dp files, including
floats.  In Qt4.5 and earlier, Qt defaulted to 32 bit
floats.  In Qt4.6 and later, Qt started using 64 bit
floats by default.  As a side-effect, parsing broke on
Qt4.6, leading to a crash when importing or using .3dp files.

This patch fixes the issue by using QDataStream's
"setVersion()" method to tell Qt to use the Qt4.0 serialization
format for the QDataStream used in this file.  This
patch does not affect any other files.  This patch
should make the formatting assumptions both backwards
and forwards compatible.
2010-01-05 22:56:59 -05:00
Sean Rhea
e76247a25b remove ride map from RideCalendar
I think the previous implementation could have referenced already-deleted
RideItem objects during calls to Split Ride.

This commit removes the calendar's own map of RideItems, and instead
uses the list of rides in MainWindow::allRideItems.  Because I use
binary search on that list, this implementation should be just as fast
as the old one.  But because I don't hang on to any RideItem pointers
beyond a single call to RideCalendar::paintCell, it shouldn't be
vulnerable to referencing already-deleted RideItem objects.
2010-01-04 09:00:43 -05:00
Jamie Kimberley
ea8fe63abd Add documentation for our issue tracker
Added instructions and links for submitting bug reports and feature
requests to the website documentation.
2010-01-03 17:24:23 -05:00
Sean Rhea
0243a8640c mark prefers red, too 2010-01-03 12:41:17 -05:00
Mark Liversedge
12230958d6 Show Daily Stress on Performance Plot
Since the daily stress values are readily available
from the stress calculator this patch shows them on the
chart to show the make-up of the training that has resulted
in th short term and long term stress scores.

Ideally, we would also show the relative intensity for each day
too so you can view, at a glance, the intensity AND volume of the
ongoing training load -- but the intensity is not readily available
in the calculator or the stress.cache file.
2010-01-03 11:36:20 -05:00
Sean Rhea
f42a093d4d use ExtendedSelection in intervalWidget 2010-01-02 19:00:02 -05:00
Sean Rhea
0edc94d00a bug fix: integer division error
I introduced this bug in commit 23b2ff4.
2010-01-02 17:06:41 -05:00
Sean Rhea
86df4288da note about version 1.7 of ftdi drivers 2010-01-02 15:43:16 -05:00
Sean Rhea
23b2ff416c add Daniels Points to manual ride entry
And estimate them based on time/distance just like we do with BikeScore.
2010-01-02 13:17:31 -05:00
Sean Rhea
56b1af8b44 remove unused variables 2010-01-02 13:01:31 -05:00
Sean Rhea
9b6b50c92d float --> double 2010-01-02 12:59:35 -05:00
Sean Rhea
8c65bf88a8 ignore manual rides when estimating BikeScore 2010-01-02 12:55:33 -05:00
Sean Rhea
46db59eec1 ignore rides that don't load properly
Need to call item->ride() in order to load the ride, and should ignore those
for which the result is NULL.  Do this after checking the date, though, so
that we don't load older rides into memory.
2010-01-02 12:52:58 -05:00
Sean Rhea
400fd23692 bug fix: segfault on manual ride entry if no rides 2010-01-02 12:47:50 -05:00
Sean Rhea
10ec613843 remove tabs and eol spaces, no functional change 2010-01-02 12:45:31 -05:00
Sean Rhea
d3bb2ef51c support arbitrary ride metrics in manual ride files 2010-01-02 12:36:31 -05:00
Sean Rhea
baf3e203ab use split instead of section
This will be useful for my next commit.
2010-01-02 12:36:31 -05:00
Sean Rhea
d09152e394 nit: don't store cp as a member variable 2010-01-02 12:36:22 -05:00
Sean Rhea
2fc4cf79b9 implement DanielsPoints::override 2010-01-02 12:36:17 -05:00
Sean Rhea
2514a3fd26 bug fix: manual ride time always counts towards weekly summary
Before, if distance and speed were both zero, time_riding was set
to zero, and the manual ride time would not be included in the
weekly summary.  This patch fixes that by overriding time_riding.
2010-01-02 11:50:00 -05:00
Sean Rhea
954214137f don't include final decay in xPower
RaceDay doesn't do it, and RaceDay is the reference implementation
for xPower/BikeScore.
2010-01-01 19:05:41 -05:00
Sean Rhea
f48246398b add new mailing list info to web page 2010-01-01 12:28:41 -05:00
Sean Rhea
f2c53b1707 use foreach to eliminate explicit iterator type
Also switch to const RideItem pointer.
2009-12-31 10:15:14 -05:00
Berend De Schouwer
e4b54f42b9 Support two rides at the same date and time 2009-12-31 10:08:44 -05:00
Berend De Schouwer
d4ee3fe8cd Calendar move defaults to constructor 2009-12-31 10:08:44 -05:00
Sean Rhea
255f57b5f7 read intervals in iBike CSV files 2009-12-30 22:08:10 -05:00
Berend De Schouwer
4f4973ab18 Multiple rides per day in the calendar 2009-12-30 18:41:37 -05:00
Sean Rhea
abbdd4667e bug fix: remember user's curve preferences
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.
2009-12-30 17:52:13 -05:00
Sean Rhea
be9a35354d fix indentation -- no functional change 2009-12-30 17:15:14 -05:00
Sean Rhea
cae1d15f4d respect user's unit pref in import wizard
Based on a patch by Thomas Weichmann.
2009-12-30 17:13:28 -05:00
Sean Rhea
b89ff9f1d6 about dialog nits: add line breaks, remove italics 2009-12-30 10:17:55 -05:00
Sean Rhea
6cba1d0c94 show home path in about dialog 2009-12-30 10:13:23 -05:00
Sean Rhea
a2665bc3b9 fix segfault in ModelPlot on bad ride files 2009-12-30 09:42:49 -05:00
Mark Liversedge
3d72d7e812 3D Modelling
A new tab on the ride analysis view for analysing ride data in three
dimensions. Interval selection is supported and a z-axis slider is
available for helping to identify data in the z-plane. A color legend
is displayed since coloring is independent of x/y/z values.

Coloring and Z axis values are averages for associated values of x/y.
The code requires qwtplot3d to be installed (see gcconfig.pri.in) and
with older Mac dev envs you will need to add -lz to LIBS too. (LIBS += -lz).

On Linux qwt3d_function.h needs a #include <stdio.h> added to compile.

Greg Steele helped design and test.

There are 2 open issues x/y/z axis labels occasionally appear in the
wrong place. lastly, the bin selection is for X&Y bin sizes and it
would be better to have separate sliders.
2009-12-30 09:41:33 -05:00
Sean Rhea
a79f2865cc split ride saves in .gc format 2009-12-28 11:36:38 -05:00
Sean Rhea
80a3c275b0 bug fix: set ride start time correctly in .gc files 2009-12-28 11:36:38 -05:00
Dag Gruneau
7ae6763bc5 bug fix: don't crash when computing metrics on empty intervals 2009-12-28 11:02:08 -05:00
Sean Rhea
a5f75ec569 add hysteresis to ElevationGain metric 2009-12-25 10:43:13 -05:00
Sean Rhea
0d488cb9ea fix neg alt bug in ElevationGain metric 2009-12-25 10:40:54 -05:00
Sean Rhea
ed063cf6a4 choose your own metrics for intervals
This commit adds a page to the config dialog in which the user can choose
which metrics GC will show for intervals.  The GUI design could use some work,
but the functionality is there.  All implemented metrics are available to
choose, and choices are saved across restarts.
2009-12-24 17:51:50 -05:00
Thomas Weichmann
30b931bedb Fixed unit conversion in CSV importer 2009-12-24 10:38:56 -05:00
Sean Rhea
9d1ed11186 fix compile error with std::sort on Linux 2009-12-23 07:57:46 -05:00
Sean Rhea
58e6fe59b6 remove old intervals code 2009-12-22 18:11:02 -05:00
Sean Rhea
818f678436 use RideMetrics for intervals in RideSummaryWindow 2009-12-22 17:54:50 -05:00
Sean Rhea
ea2177cc62 add ninety_five_percent_hr metric 2009-12-22 17:54:50 -05:00
Sean Rhea
4b1805f3c2 add max_power metric 2009-12-22 17:54:38 -05:00
Sean Rhea
96b00f4b77 fix metrics for interval use 2009-12-22 17:53:40 -05:00
Sean Rhea
fa843db0ab figure out zoneRange from RideFile::startTime 2009-12-22 15:40:30 -05:00
Sean Rhea
ef200085a8 compute metrics in RideMetric
Move the logic for how to compute RideMetrics from a RideFile, including
dependency tracking, out of RideItem and into RideMetric.  I'm going to start
using them for intervals as well as rides, and I don't want to construct a
RideItem for each interval.  It also seems more natural here.  For
performance, RideItem still caches the computed metrics for a RideFile.
2009-12-22 15:23:02 -05:00
Sean Rhea
e16443e23f aggregateWith takes a const reference 2009-12-22 15:23:02 -05:00
Sean Rhea
0d7e923c93 get rid of PointwiseRideMetric
It's no shorter than just calling foreach, and I feel it just confuses things.
2009-12-22 15:23:02 -05:00
Sean Rhea
85e9202c15 add more comments to RideMetric.h 2009-12-22 15:23:02 -05:00
Sean Rhea
abae88dc6c don't repeat "Average"
In the average column of the RideSummary, we don't need to re-emphasize that
the averages names' start with "Average ".  I hope this doesn't cause
problems for translation.
2009-12-22 15:23:02 -05:00
Sean Rhea
59a0908da4 get rid of metricsXml
Instead, just list the symbols of the RideMetrics for each column, then get
the name and precision of each metric from the RideMetric object.  This change
builds the groundwork to letting the user specify which metrics to show.
2009-12-22 15:23:02 -05:00
Sean Rhea
d096eb8854 add RideMetric::precision
...which specifies how many digits after the decimal we should show when
displaying the value of a RideMetric.
2009-12-22 15:23:01 -05:00
Sean Rhea
8aa0996e6e add RideMetric::name
The name of a RideMetric is a short string suitable for use as a label in the
ride summary.  It should be translated using QObject::tr().
2009-12-22 15:23:01 -05:00
Sean Rhea
d2b44ec508 rename RideMetric::name to RideMetric::symbol
The symbol of a ride metric is the string by which we refer to it in the
code, configuration files, and caches (like stress.cache).  It should not
be translated, and it should never be shown to the user.
2009-12-22 15:23:01 -05:00
Sean Rhea
9b4782ab98 srm interval end bug fix
If the user forgot to end an interval before downloading a ride, GC
would crash due to an assertion failure.  The included ride file
demonstrates the bug.
2009-12-22 14:49:54 -05:00
Mark Liversedge
32b94d954f add bring to front/send to back to PfPvPlot
Another rightclick menu for intervals, adding a bring to front and send to
back option but only when viewing the pfPvPlot, additionally the algorithm in
PfPv plot for determining which interval a point is used for has been adjusted
to fully populate every interval curve where appropriate (and incorrect
comments and redundant code have been removed).

IntervalItems now have a display sequence number so when you have
overlapping intervals you can bring to front and send to back on the
PfPv plot. The display sequence could be used on other plots if/when
they distinguish between intervals.

Previously, the coloring of intervals on PfPvPlot was determined solely
by the order they were defined which could be quite confusing.
2009-12-22 09:51:02 -05:00
Dag Gruneau
7a90ac8783 use setting for imperial/metric in interval dist
Before, the heading showed "Distance (km)" but the actual value was always
displayed in miles.  This patch fixes it.
2009-12-22 09:44:09 -05:00
Thomas Weichmann
9717eeb798 add context menu to ride tree
Includes save, delete, split, find peaks and best interval functions.
2009-12-22 09:35:20 -05:00
Mark Liversedge
d10b08e86f switch from QToolBox to QComboBox
This patch removes the QToolBox from commit e93970 and replaces it with
a QComboBox instead. A new object ViewSelection can be included in any
new views and will manage the interaction with MainWindow to switch
between views. It is essentially a QComboBox with some code to interact
with MainWindow.

A new signal viewChanged(int) has been implemented in MainWindow to
notify of a view change. The parameter will be set to VIEW_ANALYSIS
or VIEW_TRAIN depending upon which view was selected.

In addition, a new TrainWindow object has been created which implements
the Realtime code and is comprised of the TrainTool and TrainTabs
implemented in e93970. It also sets its splitters from remembered values
in the same fashion as the central splitter on the Analysis view.
2009-12-21 13:34:28 -05:00
Mark Liversedge
0d96ba220d Support for WKO v3 file format
Summary analysis suggests the new (v29) of the WKO 3.0 file format does
not contain any differences (or noticeable) to the previous version.
This patch enables files to be imported using the existing code instead
of being rejected because they are 'newer than the supported format'.

Further testing and analysis will be performed on the WKO 3.0 file formats
but this patch should enable users of v3 to import there files into GC.
2009-12-21 12:56:23 -05:00
Mark Liversedge
e93970ed4d Introduce Toolbox to GUI
The left side of MainWindow is now a toolbox which contains
Ride Analysis and Racing and Training options. The Right side
tabs have been reorganised and associated with the toolbox.

To support the population of the Racing and Training left tool
the config dialog has been updated to enable the user to configure
the location of their workouts.

In addition, the config dialog now calls upon MainWindow to issue
a configUpdate() signal to notify widgets when config has been
updated. This is a refactoring of the existing mechanism that
only called realtimeWindow->updateConfig, now any widget can
connect to the MainWindow signal and re-read its config appropriately.
Currently, the TrainTool and RealtimeWindow widgets have been coded to
use this.
2009-12-20 21:39:38 -05:00
Sean Rhea
e5affbbc64 introduce "metric overrides"
This commit allows every ride file to specify a set of "metric overrides":
values to use in place of those for RideMetrics we would otherwise compute.

The most gratifying immediate result of this change is that we can associate a
"skiba_bike_score" metric override with each Manual CSV file, thereby
eliminating the need for a bogus "bs" parameter in RideFilePoint.

In the future, though, we can also save these overrides to a GcRideFile using
a syntax something like this:

  <override>
    <metric name="skiba_bike_score" value="100"/>
    <metric name="average_speed" secs="3600" km="30"/>
  </override>

(Note that average_speed needs to store time and distance in order to
aggregate properly.)

Then we can add a dialog that allows the user to override the computed value
of a metric for any given ride.  For example, if my HRM was on the fritz
during a ride, I could estimate my average HR and override that metric.
(We might want to show these overrided metrics in a different color, so that
it was clear they weren't the computed values.)

Finally, I think we could actually use this feature to eliminate the Manual
CSV format altogether, and just use GcRideFiles without any samples or
intervals, but with metric overrides for all the available metrics.
2009-12-20 12:29:33 -05:00
Sean Rhea
0dae2b88cc don't explicitly specify bs
It's going away soon.
2009-12-20 12:29:25 -05:00
Thomas Weichmann
9474f281db reorder ride menu, add separators, capitalization 2009-12-19 19:09:26 -05:00
Mark Liversedge
30341cf339 Stress Calculator loses pending changes
The stress calculator works through every ride and updates stress.cache.
After each file is processed its details are wiped with a freeMemory, this
causes unsaved changes to be lost (isDirty is ignored).

This patch adds a check to make sure the file is not dirty before the
in-core values are deleted.
2009-12-19 18:58:17 -05:00
Mark Liversedge
937907c6b8 Support Metric/English units in realtime mode
Realtimode mode now supports miles and kilometers for speed, average
speed and distance telemetry.
2009-12-19 18:54:17 -05:00
Mark Liversedge
1a96535708 Computrainer code to open COM ports above 9 on Windows
The docs for CreateFile indicate that to open a comm port above
COM9 you must use a filespec of "\\.\COMX". The original code
did not apply this rule and failed to open ports above COM9 as a
result. This is especially important since it is quite common for
the USB->Serial converters to assign an assignable comm port number.
2009-12-19 18:50:40 -05:00
Mark Liversedge
d1d2037883 New Cyclist set first CP SEGV fix
When setting up the CP for a new cyclist the code for inserting
ranges called setCP with an unitialised range number variable. This
fix sets it to 0 for the very first range.

Also fixed the indentation of the code around the fix to make it
easier to follow.
2009-12-19 18:48:54 -05:00
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
71d67e2203 check that cp > 0
The commit replaces the erroneous commit a3ae0ee.  I thought the problem with
the zones file that motivated that commit was that some of the zones were of
length zero.  In fact, the problem was just that the CP is zero in the first
zone range, and a CP of zero leads to a RI of inf.
2009-12-18 09:38:22 -05:00
Mitsukuni Sato
009c013521 add calls to tr() for translation 2009-12-17 19:10:36 -05:00
Mitsukuni Sato
32471598ce add japanese translation resource 2009-12-17 19:10:17 -05:00
Sean Rhea
b0416f0a4f read lat/lon from iBike csv 2009-12-17 18:08:16 -05:00
Sean Rhea
e11ad0cbf6 revert bad zones I accidentally added in 97156c3 2009-12-17 18:02:08 -05:00
Sean Rhea
25bd2c1ff6 read ride date and time out of iBike csv files 2009-12-17 17:52:23 -05:00
Sean Rhea
592280445a fix tabs and spaces -- no functional change 2009-12-17 17:43:54 -05:00
Mark Liversedge
78716c3f4b Fix new Cyclist SEGV on open options dialog
The code to set the critical power for the cyclist page in the
config dialog calls zones->getCP(currentRange) when currentRange
is -1 (out of bounds). This caused a SEGV. This patch checks for
a -1 value and sets CP to 0 rather than calling zones->getCP.
2009-12-17 17:37:51 -05:00
Sean Rhea
a3ae0ee314 check that zone.hi > zone.lo 2009-12-17 17:34:48 -05:00
Sean Rhea
97156c3637 auto-select SRM for downloads
Hack: SRM PCV download cables use the PL2203 chipset.  If the
first device name contains "PL2303", then, we're probably dealing
with an SRM, so go ahead and select the SRM device.  Generalize?
2009-12-17 11:36:19 -05:00
Ned Harding
9b7673b451 win32: added new dependency to installer 2009-12-15 18:22:37 -05:00
Mark Liversedge
4d3b204f09 Find Peak Intervals fix 0 distance bug
The find peak intervals added intervals with 0km for start and stop. They
now get set appropriately, so peak intervals display correctly when viewed
in byDistance on AllPlot.
2009-12-14 19:22:17 -05:00
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
Sean Rhea
b2ef8940a7 cp plot gets zones in its constructor 2009-12-10 10:16:57 -08:00
Sean Rhea
90ce36f984 make some functions 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
eb9eddfb66 zones ptr is never null 2009-12-10 10:16:56 -08:00
Sean Rhea
3bb50ec996 whitespace and other nonfunctional cleanup 2009-12-10 10:16:56 -08:00
Sean Rhea
21782c4e6f remove duplicate addZoneRange function
The cp argument wasn't being used, so just call the one that
doesn't take a cp argument.
2009-12-10 10:16:56 -08:00
Sean Rhea
27d55025ac nit: cleanup function 2009-12-10 10:16:56 -08:00
Sean Rhea
d2d0ac9f1c QList<ZoneRange*> --> QList<ZoneRange>
Again, get rid of deletes at the slight expense of a few cheap copies.
2009-12-10 10:16:56 -08:00
Sean Rhea
9cb955e9b3 QList<ZoneInfo*> --> QList<ZoneInfo>
Gets rid of some deletes, and shouldn't be much slower,
as QStrings are copy-on-write.
2009-12-10 10:16:56 -08:00
Sean Rhea
1c5b8e4168 remove printfs and cleanup whitespace
No functional change.  Note, however, that removing the printf from
addZoneRange(int cp) revealed that the cp argument was unused.
2009-12-10 10:16:55 -08:00
Steve Gribble
ec696a14e9 Another bug fix to handle rides that start in the middle of a course.
Computrainer 3D software lets you start your ride partway into
a course.  But, if you do this, the first distance recorded
in the log file is the distance you started at, rather than zero.
GC expects the first data point to be at distance zero, however,
and therefore this causes total distance to be reported incorrectly.

This patch fixes the bug by remembering the distance of the
first data point, and subtracting that from all distances
reported to GC, so that distances are zero-based (i.e.,
so that the first data point is always at distance zero.)
2009-12-08 08:51:55 -08:00
Sean Rhea
27ab607d1f remove gratuitous returns 2009-12-08 08:51:13 -08:00
Justin Knotzke
bff2880965 Fixed a SEGV when user clicked stop in Realtime.
Fixed a crash due to threading of the socket.
Improved performance of discovery()
Improved ability to recover from a lost channel
Fixed bug where channel ID's weren't being correctly sent.
GC wasn't waiting for Qt to return from connecting to the host. It now is.
Fixed When the user hit stop then start, the realtime thread did not start.
2009-12-08 08:45:10 -08:00
Steve Gribble
ac2a2d4f82 fix bugs and add features to Computrainer3dpFile
Specifically:

1.  The previous code assumed the wrong units while extracting
    speed and distance from a .3dp file.  Computrainer stores
    speed in (miles per hour / 160), and distance in kilometers.
    This patch converts .3dp speed/distance data points into
    kph and km correctly.  As a side-effect, speed and distance
    are displayed correctly in GC windows and calculations.

2.  This patch adds code to extract altitude data from a .3dp
    file and include it in a ride.

3.  .3dp files do not have a consistent inter-datapoint time
    interval.  Since GC expects one, the earlier version of this
    code averaged 1000 data points from the middle of the ride to
    estimate this interval.  Unfortunately, this approach caused
    a bunch of problems for various calculations that GC does,
    such as calculating the riding time (vs. workout time),
    average speed, xPower, critical power plot and FTP, and so
    on.  [GC assumes that # data points * inter-datapoint-interval
    = workout time, but this isn't true when you used an estimated
    interval.]

    To fix this, this patch adds averaging and interpolation code
    to covert the data point sequence in the .3dp file to an
    averaged sequence with a data point every 250ms.  Since the
    inter-data-point interval is now fixed, these calculation bugs
    went away, and correct values are now calculated and displayed
    by GC.

4.  Fix (3.) has another useful side-effect:  the number of data
    points per ride given to GC goes down by 10x.  (Raw .3dp files
    have a data point every 30-50ms.  This averaging/smoothing
    code emits a data point every 250ms.)  Since the critical
    power calculation is an O(n^2) calculation, the time for
    this calculation is reduced by 100x.  Instead of an hour
    to do the calculation for a typical 2hr ride, it now takes
    less than a minute.

5.  The code was cleaned up in several regards:  comments
    were added to help document the .3dp format and explain
    the averaging/smoothing code, and types from boost/cstdint.hpp
    were used instead of native C types when using a variable
    of a specific size  (e.g., the code now uses uint16_t instead
    of unsigned short, etc.).

This patch was built by Steve Gribble and Daniel Stark.
2009-12-03 20:25:33 -08:00
Sean Rhea
ea2b1909ae don't add interval 0 if it's the only one 2009-12-01 06:22:48 -05:00
Sean Rhea
06dacae358 fix compiler warning
A class with virtual functions needs a vitual destructor.
2009-12-01 05:37:51 -05:00
Sean Rhea
9e588ad413 fix unused variable warning 2009-12-01 05:37:46 -05:00
Mark Liversedge
c1704ebf97 Fixed SEGV when no devices are configured and workout mode is selected 2009-12-01 05:19:29 -05:00
Sean Rhea
7a3d154afa temporary patch to estimate dp from bs
I want to add Daniels Points to the ManualRideFile format, but until then,
simply estimate them from the BikeScore based on a weighting I took from some
of my long rides.  It's mostly on long steady rides that I estimate BikeScore
as part of a ManualRideFile, so hopefully this isn't too terrible as a
temporary patch.  A better fix is in the works.
2009-11-28 18:50:49 -05:00
Jamie Kimberley
74cbddff5b update developers guide for patch qwt
Removed qwt from the list of dependencies. Changed build instructions to
reflect the use of the patched version of qwt.
2009-11-28 18:50:47 -05:00
Mark Liversedge
d83ba74ae3 Fix Stress.Cache refresh on wrong tab 2009-11-28 11:51:11 -05:00
Sean Rhea
828562ec3d bug fix: xPower shouldn't count coffee breaks
Commit 420b2b6 introduced a bug whereby it used the total workout time,
rather than the time riding, to compute xPower.  This should only affect
your data if you take long breaks during rides, like to stop for brunch,
or if you store multiple rides in the same ride file--i.e., you don't
use the split ride feature.  Nonetheless, it's worth deleting your
stress.cache file after applying this commit, just in case.

I've also added three rides, notes, and a zones file to the test directory to
illustrate the differences discussed above.  The first ride is just an hour at
CP/FTP.  It should have a BikeScore of very close to 100, and Daniels Points
very close to 33.  The next ride is the same as the first, but followed by 20
minutes of coasting.  Its Daniels Points should be the same as the former,
but its BikeScore should be a good bit higher.  The final ride is the same as
the first, but interrupted partway through by 30 minutes of no riding at all,
as though the cyclist stopped for coffee and a pastry.  It should have
nearly identical BikeScore and Daniels Points to the first ride.  In the
broken implementation of xPower that this commit fixes, it did not.

Dan C: I reverted your changes to the xPower calculation in this commit and
went back to my implementation.  It's just easier for me to think about the
code that way.  My apologies.  I kept the other changes you made, though.
2009-11-28 11:42:34 -05:00
Sean Rhea
39ef9efc4d bug fix: don't compute Daniels Points if no CP set 2009-11-27 22:55:41 -05:00
Sean Rhea
3429f2d5a4 add DanielsPoints metric
Fit a curve to the points system in Table 2.2 of "Daniel's Running Formula",
Second Edition, assume that power at VO2Max is 1.2 * FTP, further assume that
pace is proportional to power (which is not too far off in running), and scale
so that one hour at FTP is worth 33 points (which is the arbirary value
Daniels chose).
2009-11-27 18:23:52 -05:00
Mark Liversedge
d4f8ce5b07 Remove Notes Tab and place notes on Summary Tab
Adding splitter for the ride summary/notes layout
2009-11-27 18:19:18 -05:00
Sean Rhea
7324ebda06 fix season selector in cp plot 2009-11-27 16:46:09 -05:00
Sean Rhea
411abf55b8 stop PM chart at max(today, latest ride)
I've been using the manual ride feature to plan my weeks in advance, so it's
helpful to have the x-axis on the PM chart extend past today's date.
2009-11-27 16:46:09 -05:00
Mark Liversedge
82ac0f5e1f add realtime mode
Joint work between Mark L, Justin, and Steve Gribble.
2009-11-23 10:42:48 -05:00
Mark Liversedge
e3426c1024 win32 and linux build fixes
- change SeasonParser include from <> to "" for Windows
- include stdio.h in PowerTapUtil for Linux
2009-11-21 17:21:47 -05:00
Sean Rhea
6394483df4 link to msg about building on windows 2009-11-21 15:27:41 -05:00
Sean Rhea
e7b762333d ugly fix for zones file without a BEGIN
Just attribute all earlier rides to the first zone.  We should do better in
the future, maybe by complaining to the user in a dialog, but for now,
not crashing definitely seems better than crashing.
2009-11-21 15:23:04 -05:00
Sean Rhea
51aafe7ede rest during intervals counts against averages
This seems like the right call to me.  If I'm doing an interval and I stop
riding for some reason, I'm resting, and that should affect my average power.
I thought it was always this way, but apparently not.
2009-11-21 14:34:49 -05:00
Jamie Kimberley
182843896d test file with two intervals in first 10 secs
Good for testing what happens in the Ride Plot when there are interval
markers within the first smoothing period.
2009-11-21 14:33:36 -05:00
Sean Rhea
6914185680 don't plot intervals before first smoothing window 2009-11-21 14:27:13 -05:00
Sean Rhea
ab28d32b65 rename ergomo csv files 2009-11-21 14:03:43 -05:00
Sean Rhea
5c3896b6cc fix intervals for ergomo csv 2009-11-21 14:02:37 -05:00
Sean Rhea
25e8658592 fail gracefully if rec_int changes mid-ride
Includes test ride that demonstrates the problem.
2009-11-21 13:48:23 -05:00
Sean Rhea
6d33d10944 inject a little philosophy onto the front page 2009-11-15 20:03:14 -08:00
Sean Rhea
02cf0ac83d need <algorithm> for std::lower_bound in Linux
Thanks to Mark Liversedge for pointing this out.
2009-11-15 19:53:18 -08:00
Sean Rhea
93d62cc5c2 fix Ride Plot shading bug introduced in 79ced76
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.
2009-11-15 08:52:23 -08:00
Sean Rhea
db943fbcd6 make ride plot work for manual rides
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.
2009-11-09 09:20:24 -08:00
Sean Rhea
1edd8c0767 add y-axis shows work mode to CP plot
This mode is fun because the "CP Curve" is a straight line,
just like in the model:

  work = CP * time + AWC

You can also see that the AWC is the y-intercept.
2009-11-09 09:05:03 -08:00
Sean Rhea
3912c2474c "Tools"->"Critical Power Calculator" 2009-11-09 10:21:43 -05:00
Sean Rhea
6d20bea968 don't show CP values off the end of lines
I.e., if the user selects a time to the left of the red dashed CP line,
we shouldn't show a value in the "CP Curve" box.
2009-11-09 10:03:50 -05:00
Sean Rhea
aef876e817 use foreach 2009-11-09 09:56:48 -05:00
Sean Rhea
ae5dd3feb3 prefer most recent season in CP plot 2009-11-09 09:54:34 -05:00
Sean Rhea
82934425ab fix bug in 2f8d101, need to strip path
The filename argument actually contained the whole path.  This fix passes
the filename and directory separately, so that the anchored regex works.
2009-11-09 09:50:51 -05:00
Sean Rhea
632bb6ddd1 whitespace cleanup -- no functional changes 2009-11-07 14:42:14 -05:00
Sean Rhea
4ee57a25b0 misc cleanup 2009-11-07 14:42:09 -05:00
Sean Rhea
14f59f8e5e delete NULL is a no-op 2009-11-07 14:27:01 -05:00
Sean Rhea
dfc7e88f26 drop read_cpi_file, cleanup read_one 2009-11-07 14:23:51 -05:00
Sean Rhea
3d6d9ad86d don't fill in bestDates for today's ride 2009-11-07 14:19:46 -05:00
Sean Rhea
a9ddd40dda errors should be QMessageBoxes, not printfs 2009-11-07 14:15:36 -05:00
Sean Rhea
5ac70a9a98 simplify very confusing code 2009-11-07 13:53:33 -05:00
Sean Rhea
9029be7ccc little bits of CpintPlot cleanup
Cleanup whitespace, use scoped_ptr, prefer QVector over QList, etc.
2009-11-07 13:52:22 -05:00
Sean Rhea
a7df8c48b3 progress dialog doesn't need to be a class member
We can also allocate it on the stack.
2009-11-07 13:52:09 -05:00
Sean Rhea
79ced76347 setAllPlotWidgets doesn't need to call show*
It's only called from setData, which calls AllPlot::setData right afterwards,
and the latter will do all the things that the show* functions do.
2009-11-07 10:32:00 -05:00
Sean Rhea
2f8d1013be anchor regexp
Anchoring this regexp (i.e., making it start with a "^") reduces the time
it takes to load the first CP plot from 10 seconds to 6.5 seconds on
Sean's three years of rides.  Unbelievable, but repeatable.
2009-11-06 23:43:35 -05:00
Sean Rhea
c71f38ecb0 clean up and sorten cpi_filename_to_date 2009-11-06 23:36:43 -05:00
Sean Rhea
c8c0cf395a ~qwt_plot_item calls detach 2009-11-06 09:13:59 -05:00
Sean Rhea
846f95d5b3 use foreach, tidy up code 2009-11-06 08:49:54 -05:00
Sean Rhea
19f905d2d1 fix leaked CPCurve 2009-11-06 08:38:38 -05:00
Sean Rhea
288d0ce7c6 allocate QPen objs on the stack
This fixes a memory leak.
2009-11-05 20:01:02 -05:00
Sean Rhea
5e3692a1b4 use QVector<double> 2009-11-05 19:59:00 -05:00
Sean Rhea
ae94021a21 fix tabs and eol spaces -- no functional change 2009-11-05 11:40:07 -05:00
Sean Rhea
c5240d1c0c compute time in zones in computeMetrics
...not in htmlSummary, so that the WeeklySummaryWindow doesn't have to
generate the full htmlSummaries for a week.
2009-11-01 22:01:53 -05:00
Sean Rhea
cb50314915 use colors from RideList in htmlSummary
Rob Carlsen suggested that the htmlSummary should use the same colors as in
the ride list.  I agree, but they're a little to light, so bump the saturation
a bit.  While we're at it, go ahead and do the zones list, too.
2009-11-01 21:03:30 -05:00
Sean Rhea
cae4d092c9 highlight every other interval 2009-11-01 20:05:09 -05:00
Sean Rhea
0789c68f30 srm intervals names match those on PowerControl 2009-11-01 20:01:20 -05:00
Sean Rhea
094e58d04d switch to QVector and fix a memory error 2009-11-01 20:00:24 -05:00
Sean Rhea
263ffd353f combine SrmFileReader::openRideFile and readSrmFile 2009-11-01 17:43:49 -05:00
Sean Rhea
d6f46b80d4 remove commented-out code 2009-11-01 17:27:48 -05:00
Sean Rhea
a312b4a881 srm.h|cpp >> SrmRideFile.cpp and rm the former 2009-11-01 17:24:55 -05:00
Sean Rhea
a49b659014 fix eol spaces -- no functional change 2009-11-01 17:21:46 -05:00
Sean Rhea
c964e274aa only fill in intervals if the RideFile hasn't already 2009-11-01 17:19:11 -05:00
Sean Rhea
7687b7f73a use RideFileIntervals in SplitRideDialog 2009-11-01 12:47:59 -05:00
Sean Rhea
c848726f0c let the factory call fillInIntervals 2009-11-01 12:45:43 -05:00
Sean Rhea
521653993d bug fix: check that rideItem->ride is not NULL 2009-11-01 12:44:11 -05:00
Sean Rhea
4b7413295c use RideFileIntervals in htmlSummary 2009-11-01 12:01:52 -05:00
Sean Rhea
3cc99bf2b0 use RideFileIntervals in AllPlot 2009-11-01 12:01:52 -05:00
Sean Rhea
1dc513e7a9 add RideFileInterval
Eventually, I'm going to remove interval as a member of RideFilePoint, and
only use RideFileIntervals.  But I have to rework a bunch of other code first,
so for now the two will coexist.
2009-11-01 12:01:42 -05: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
Sean Rhea
f39f2b516b oops: add units for 95% hr 2009-11-01 11:51:26 -05:00
Sean Rhea
68832ff6c0 fix tabs and eol spaces -- no functional change 2009-11-01 10:58:12 -05:00
Sean Rhea
8595f2cfc5 remove writeAsXML declaration
This should have been part of 868e3d4.
2009-11-01 07:35:08 -05:00
Robert Carlsen
3f63a69c6f Updating description for Comma-Separated Values files. 2009-10-31 17:22:37 -04:00
Sean Rhea
dbc3ed9e1c add Joe Friel's "aerobic decoupling" metric to ride summary 2009-10-31 16:22:06 -04:00
Robert Carlsen
c173c2be06 Grammatical corrections to ride file format descriptions. 2009-10-31 15:42:16 -04:00
Eric Murray
7c76937cd7 Fixed "shaking" bug with PerfPlot sliders. 2009-10-31 15:14:37 -04:00
Sean Rhea
868e3d4b6b remove XmlRideFile and "Export to XML"
These were part of an earlier attempt at a GC-specific ride file
format.  They aren't in use now, and they'll be replaced by the new
one when it's done.
2009-10-31 15:12:48 -04:00
Sean Rhea
5dc82a6c93 add descriptions to RideFile types
...and use these to get rid of the explicit list of ride file type
descriptions in the import wizard.
2009-10-31 15:00:37 -04:00
Sean Rhea
c66bf0b1c9 add RideFileFactory::suffixes() and use it
...to eliminate the problem of enumerating all possible file suffixes
all over the code.
2009-10-30 19:13:37 -04:00
Sean Rhea
edc7cc4960 fix absolutely atrocious use of tabs 2009-10-30 19:08:29 -04:00
Sean Rhea
2ab59a3905 hist much prettier with 5W-wide bins 2009-10-30 11:55:08 -04:00
Sean Rhea
f48e640565 last mod times depended on svn, remove them 2009-10-30 11:52:34 -04:00
Sean Rhea
f1e22cec42 goodbye 2000 W in cp screenshot 2009-10-30 11:50:51 -04:00
Sean Rhea
f9ff06bdd3 nit: we also import PowerTap CSV 2009-10-30 10:54:59 -04:00
Sean Rhea
af758f24ff update link to mailing list 2009-10-30 10:53:59 -04:00
Jamie Kimberley
7d2cf8d305 Add support for 3dp comutrainer files in the cp plot 2009-10-29 09:47:53 -04:00
Greg Lonnon
5a25dcb56a Computrainer 3dp file support 2009-10-29 09:47:45 -04:00
Sean Rhea
39c7787c19 fix memory leak in CsvRideFile 2009-10-28 21:05:18 -04:00
Sean Rhea
aad5a337b8 areDataPresent should return a const ptr 2009-10-27 23:38:57 -04:00
Robert Carlsen
7ec5bff235 fix SeasonParser.cpp::EndDocument() - return value was missing 2009-10-27 01:32:56 -04:00
Sean Rhea
87aad4a2dd add cp curve value, make room in best value
I am so not a UI designer, but it least now all the information is there and
visible.  UI types: please dive in at any time.
2009-10-26 20:29:20 -04:00
Sean Rhea
a91782b69b remove printf and comment 2009-10-26 19:39:29 -04:00
Robert Carlsen
e7f8f9cbd1 fix performance manager to deal with descending ride list preference. 2009-10-25 20:00:06 -04:00
Robb Romans
476aa1b48b comments about QDates in SeasonParser.cpp 2009-10-25 19:47:47 -04:00
Sean Rhea
76f89187ba update README to include build instructions
...in particular, what to do with the .pri.in files.  Also move README
to the toplevel directory.
2009-10-25 19:45:11 -04:00
Sean Rhea
d3b1a62af3 reduce memory footprint of StressCalculator
After processing each RideItem, call freeMemory to deallocate the RideFile
object inside it, since we're done with the RideFile once we have the
BikeScore.  Also call computeMetrics instead of htmlSummary, since we only
need the BikeScore and computeMetrics is faster.

After computing the stress cache from scratch on Sean's ride library
(3 years of rides), this change reduces the process virtual memory size
(VSIZE) from 769 MB to 412 MB.  Even more dramatically, it reduces the
resident set size (RSIZE) from 389 MB to 36 MB!

On Sean's MacBook, which has 4 GB of RAM, this change results in a modest
reduction in the time to compute the stress cache, from 17 seconds down to
14.  On machines with more limited memory footprints, or when dealing with
a larger ride library, the speedup could be very dramatic.  (Once the
process starts paging, it's going to crawl.)

Now that it only takes 14 seconds to calculate, it's really not clear to
me that we need store the stress cache on the filesystem at all.
2009-10-25 17:40:34 -04:00
Sean Rhea
0d45c46a2a add computeMetrics and freeMemory functions
computeMetrics computes the RideMetrics without building up the htmlSummary.
freeMemory frees the rideFile object associated with this ride.
2009-10-25 17:40:03 -04:00
Sean Rhea
b144b5ec48 assert.h to make Linux happy 2009-10-24 14:19:48 -07:00
Justin Knotzke
08c232d70b Filtering of data in Critical Plot based on Seasons
Based on the defined dates per season, CP displays all plot only
for that Season.
2009-10-22 21:45:07 -07:00
Justin Knotzke
c630d281d3 Added Season support via xml file.
Using seasons.xml, support now for a season name, start date and end date.

Fixed some memory leaks.
2009-10-22 21:45:03 -07:00
Mark Liversedge
5acf35d542 fix angle brackets in include
They break the build on win32.  Use quotes instead.
2009-10-18 18:40:22 -07:00
Justin Knotzke
f8e9227c99 Support for Qollector in Critical Power Plot
is_ride_filename wasn't filtering for qla files.
2009-10-18 08:32:11 -07:00
Eric Murray
617f034fa3 fix PM to use exp weighted avg
Also limit decimal places in STS, LTS, and SB display fields.
2009-10-16 20:46:30 -07:00
Sean Rhea
46d026674f drop ancient PowerAgent compatibility mode
This old compatibility mode was only used to verify that we could match the
output of an old version of PowerAgent, and it hasn't been used in GC in a
long time.  I can't see us ever using it again, either.
2009-10-10 12:35:35 -04:00
Sean Rhea
318c9debd4 put all our unit conversions in one header file 2009-10-10 12:27:42 -04:00
Sean Rhea
f449fbaaaf sort file names -- no functional change 2009-10-10 08:58:48 -04:00
Eric Murray
c28591142b add performance monitor 2009-10-08 16:42:55 -04:00
Sean Rhea
abf4b74cc3 abstract "Critical Power Plot" tab into its own class 2009-10-07 09:47:17 -04:00
Sean Rhea
7c90677655 minor AllPlotWindow cleanup 2009-10-07 08:20:35 -04:00
Sean Rhea
7aa858cf02 abstract "Weekly Summary" tab into its own class 2009-10-07 08:10:26 -04:00
Justin Knotzke
a7a81b53c5 Added missing recIntSecs to Qollector
The interval time was not being recorded.
2009-10-05 09:24:48 -04:00
Mark Liversedge
18068b1cae more WKO file constants
New optional padding data 0x0e 0x80 and data cache marker 0x1d 0x80.
2009-10-05 09:20:12 -04:00
Sean Rhea
29368cbbdb don't plot points before first smoothing interval
Otherwise, the zeros we average distort the starting values.
This effect is particularly noticeable with altitude.
2009-10-04 06:32:25 -04:00
Sean Rhea
51bc450448 include assert.h in HistogramWindow.cpp 2009-10-03 21:57:02 -04:00
Sean Rhea
28c0b8e221 remove some calls to saveAndOpenNotes
I don't think that our zones or CP changing should require re-opening the
notes file.  Only changing which ride is selected should do so.

This commit is the follow-on to a85c4f.  Please review.
2009-10-03 21:54:27 -04:00
Sean Rhea
a85c4fae65 unfuck generateWeeklySummary/saveNotes confusion
I have no idea why we were saving the current notes file and opening a new one
every time we called generateWeeklySummary, but it seems totally wrong to me.
This commit merely separates the two concerns into two separate functions,
generateWeeklySummary and saveAndOpenNotes, and calls the latter everywhere
the former is already called.  As such, there should be no functional change.
We can work out whether we should really be saving (possibly empty) notes
files in all these places as part of a future commit.
2009-10-03 21:46:06 -04:00
Sean Rhea
18916aea7f abstract "PF/PV Plot" tab into its own class 2009-10-03 21:01:47 -04:00
Sean Rhea
5b8837a423 abstract "Histogram Analysis" tab into its own class 2009-10-03 19:16:30 -04:00
Berend De Schouwer
de96ee2f16 fix PowerHist zoom out with a call to setZoomBase 2009-10-03 18:13:09 -04:00
Berend De Schouwer
6744d4ad98 fix AllPlot zoom out with a call to setZoomBase 2009-10-03 18:11:00 -04:00
Berend De Schouwer
6692e6daad fix CSV date autodetect
There were some missing calls to set Qt::CaseInsensitive.
2009-10-03 18:06:37 -04:00
Sean Rhea
03666b478e take qwtconfig.pri out of git
Provide a qwtconfig.pri.in that you copy to qwtconfig.pri, instead.
2009-10-03 17:57:22 -04:00
Ned Harding
5c20f8340f remove qwt5.dll from windows install
...since it is now staticly linked.
2009-10-02 11:44:08 -04:00
Mark Liversedge
b08bd55b1b add additional wko padding value
...including test file from Jim Baker.
2009-10-02 09:31:23 -04:00
Justin Knotzke
ec05ca5dfc fix typo in QuarqParser
"Watts" shouldn't be capitalized.
2009-10-01 10:10:22 -04:00
Justin Knotzke
96cdb4ebd9 fix interval '9' bug in QuarqParser
I'm assuming this was a typo.  '9' should be '0'.
2009-10-01 10:10:22 -04:00
Mark Liversedge
6dca518fff more messing around with dates in ride import
- Allow user to edit any file date during import.
- WKO reader uses filename date over metadata in the file after import.
2009-09-30 08:59:59 -04:00
Sean Rhea
5ab5bc7010 move bikescore up in ride summary
...so that the intervals summary is "above the fold".  That may be a little on
the wide side for small screens, but it's still less wide than the intervals
summary, so it's not the worst offender in that regard.
2009-09-28 19:52:05 -04:00
Sean Rhea
3e9905565b add Eric Murray to list of contributors
It's pretty inexcusable that I forgot this before.  I'm sorry, Eric!
2009-09-28 14:47:23 -04:00
Sean Rhea
ab96f78050 abstract "Ride Plot" tab into its own class 2009-09-27 21:40:03 -04:00
Sean Rhea
b53be32172 less public variables in AllPlot
Also clean up includes and pre-declared classes.
2009-09-27 21:11:53 -04:00
Sean Rhea
a18fea04c7 allocate MetricAggregator on stack 2009-09-27 20:16:55 -04:00
Sean Rhea
8f221b4b71 use QSharedPointer for daily RideMetrics 2009-09-27 20:11:44 -04:00
Sean Rhea
f911ffa9c1 use QSharedPointer for weekly RideMetrics 2009-09-27 20:05:20 -04:00
Sean Rhea
e7e34c107e use a QVector for time_in_zone 2009-09-27 20:00:47 -04:00
Thomas Weichmann
47cc777b04 allow for less wide MainWindow
- Moved Allplot time/distance combobox down next too smoothing slider.
- Rotated allplot plot scale lables to save a little space.
2009-09-27 13:14:17 -04:00
Greg Lonnon
97cb66c128 added smart recording support to TcxParser.cpp
The recording interval can vary. If the recording interval is not 1
second, then the data is linearly interpolated for the time period at
1 second intervals. This allows for smart recording or garmin 705 data
drops to work correctly with GC.
2009-09-27 13:05:09 -04:00
Jamie Kimberley
a15904937d powertap .csv file with speed/cad/hr/power data
Powertap .csv file containing data for speed, cadence, hr, and power.
2009-09-26 16:28:23 -04:00
Jamie Kimberley
a377206c43 Powertap .raw file with speed/cad/hr/power data
Powertap .raw file containing data for speed, cadence, hr, and power.
It also has a few intervals markers which may be useful for verifying
that we handle intervals correctly.
2009-09-26 16:28:23 -04:00
Jamie Kimberley
350cc0ee96 Powertap .raw file with speed/cad/hr, no power
Powertap .raw file generated when using the powertap as a cyclecomputer.
it contains data for speed, cadence, HR but no data for power.
2009-09-26 16:28:23 -04:00
Mark Liversedge
850213b968 report errors up from WkoRideFile 2009-09-26 16:15:59 -04:00
Berend De Schouwer
f3cb9c6fab do not load wko files with zero records
Includes a test wko file that previously caused a crash.
2009-09-26 16:15:06 -04:00
Greg Lonnon
6406973cc0 fix the flashing windows on startup
As it turns out, the show call for tab widgets are handled by the tabwidget
container, so we don't need to call them explicitly ourselves.
2009-09-26 16:00:57 -04:00
Mark Liversedge
f28c360ff5 Parse ergomo csv filenames for date 2009-09-21 21:57:31 -07:00
Mark Liversedge
bff774ad82 Allow upper and lower case suffixes in filenames when importing 2009-09-21 21:57:31 -07:00
Jamie Kimberley
8a205f92d9 Add ergomo CSV ride files to src/test/rides/ 2009-09-21 21:41:44 -04:00
Sean Rhea
9949e175e1 new screenshots
Show off all the cool stuff we've been doing.
2009-09-20 22:26:47 -07:00
Sean Rhea
afd7d8fb1d altitude is always zero in .raw files 2009-09-20 21:56:00 -07:00
Sean Rhea
bc16f3d0a4 delete main window on close
...and set AllPlot's parent so that it gets deleted, too.
2009-09-20 21:34:31 -07:00
Sean Rhea
0cbe39e834 allow altitude plot to go below zero
Also ensure that altitude axis is at least 100 feet/meters tall to avoid
making a flat course look hilly.
2009-09-20 21:22:52 -07:00
Julian Simioni
a8d73e567e Added ride file with altitude below sea level
Added a ride file to the tests where some altitude values are below sea
level.
2009-09-20 21:08:05 -07:00
Sean Rhea
2b7929433d fix spelling of Kimberley 2009-09-20 15:32:57 -07:00
Sean Rhea
406cc4db43 fix weekly summary bug where ride fails to appear
Without this patch, it will occationally be the case that a ride won't appear
in the weekly summary until the ride is itself selected (as opposed to just
selecting some other ride in the same week).
2009-09-20 14:25:52 -07:00
Sean Rhea
8b4fbf0491 don't crash cpint plot when time < 0 2009-09-20 14:14:56 -07:00
Julian Simioni
fcfae4d596 tcx file with time < 0 causes cpint crash
Also added a file for descriptions of test cases.
2009-09-20 14:14:53 -07:00
Sean Rhea
64256bd24a put power and altitude on their own axes 2009-09-20 11:52:35 -07:00
Sean Rhea
83d1903276 use local version of qwt
Add top-level build.pro, gitignore top-level Makefile, point src.pro at our
own qwt dir, and adjust gcconfig.pri.in accordingly.
2009-09-20 11:13:11 -07:00
Sean Rhea
d42c46236b apply many axes patch 2009-09-20 11:09:19 -07:00
Sean Rhea
a3a19caba8 build static qwt lib 2009-09-20 11:09:19 -07:00
Sean Rhea
74e6f9776a add .gitignore files for qwt 2009-09-20 11:09:19 -07:00
Sean Rhea
44b602d775 check qwt-5.2, r588 into repository 2009-09-20 11:07:49 -07:00
Sean Rhea
cc7710b2c7 clarify no SRM download support under Windows 2009-09-20 09:50:22 -07:00
Sean Rhea
ff0e164b6f update web page for release 1.2.0 2009-09-20 08:29:45 -07:00
Jamie Kimberley
c6798b452c clean up wildcard filters in import wizard
Show all supported files as the default and each specific format as a
separate option.
2009-09-20 08:26:01 -07:00
Mark Liversedge
418982b732 wko test file with non-metric units in charts 2009-09-19 19:06:29 -07:00
Mark Liversedge
f238366db9 minor fix to wko chart data processing
Only affects users with non-metric units on standard charts in WKO.
2009-09-19 19:02:07 -07:00
Mark Liversedge
127f136249 unified ride import wizard
All the file import options are now supported by one dialog.  As an extra
special bonus, GC now supports dragging and dropping files to import them.
2009-09-19 18:05:43 -07:00
Eric Murray
b3c31b8c64 fix manual ride BS estimates for rides under 1 hour
also added progress box while calculating BS estimating factors
2009-09-19 09:32:39 -07:00
Eric Murray
e80c5fe6d7 fix manual ride entry crash when no zones file
This is a partial patch based on code from Eric Murray.  It changes just
enough of ManyalRideDialog to fix a crash that otherwise occurs when the
user doesn't have a zones file.
2009-09-19 09:21:53 -07:00
Sean Rhea
7368b76e76 add 95th percentile heart rate to interval summary 2009-09-16 07:24:12 -07:00
Sean Rhea
ed3ff60857 store DataPoints themselves, not pointers, in list
Gets rid of one more pair of new/delete.
2009-09-16 07:22:27 -07:00
Sean Rhea
3ec0897f01 change xyzArrays into QVectors
To match coding conventions and simplify memory management.
2009-09-16 07:22:20 -07:00
Sean Rhea
54044697b9 change smoothXYZ arrays into QVectors
To match coding conventions and simplify memory management.
2009-09-16 07:22:10 -07:00
Sean Rhea
494e4d949e cleanup zone label deletion
Use foreach function to shorten and clarify code.
2009-09-16 07:22:04 -07:00
Sean Rhea
99858423be fix memory error in interval marker code
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).
2009-09-16 07:21:56 -07:00
Sean Rhea
3c771d97d4 allocate altitude pen on stack
Since it's only used for the duration of this function.
2009-09-16 07:20:58 -07:00
Sean Rhea
608c154bc5 allow different interval lengths in tools dialog
Also switch it to being a modeless dialog, so that the user can search through
his/her CP graph to find values to use, and clean up the code a little.
2009-09-12 21:20:53 -04:00
Sean Rhea
f0c2fbf946 fix secs range in best intervals 2009-09-12 21:11:50 -04:00
Sean Rhea
2f6ad86fc7 explain "git commit ." 2009-09-12 16:45:52 -04:00
Sean Rhea
4051016a8b correct commit msg guidelines
first line should be *50* chars or less, not 40
2009-09-12 15:05:28 -04:00
Sean Rhea
48b5b6e377 update d/l page to point to devel guide 2009-09-12 14:37:59 -04:00
Sean Rhea
86d1274d6e update faq
- update which version of OS X GC requires
- remove links to books (may add them back elsewhere some day...)
- remove old question about ptunpk
2009-09-12 14:32:34 -04:00
Sean Rhea
4fc297a69f remove done items from wishlist 2009-09-12 14:31:30 -04:00
Sean Rhea
7f6481f43e add new developer's guide 2009-09-12 14:26:42 -04:00
Sean Rhea
6dd0696acd remove google ads 2009-09-12 14:26:42 -04:00
Mark Liversedge
a3f6f37787 Optional padding data with value 0x8012 discovered 2009-09-12 11:57:14 -04:00
Berend De Schouwer
e9d1a86353 SplitRide altitude matches CSV2 2009-09-12 11:54:33 -04:00
Sean Rhea
6eeea4a305 simplify GC_BUILD_DATE and GC_VERSION
Use gcc macros for __TIME__ and __DATE__ to compute build date.  This has the
advantage that we don't have to shell out to find the date, though it has the
disadvantage that it doesn't give us any control over format, nor does it
report the time zone.

By default, set GC_VERSION to "(developer build)".  For release versions,
specify GC_VERSION explicitly in gcconfig.pri like this:

  QMAKE_CXXFLAGS += -DGC_VERSION="'\"1.2.0\"'"

It would be nice to specify the git commit id in developer builds.  On the
other hand, the developer could always have uncommitted changes, so the git
commit id doesn't really make for a completely reproducible build.  It's also
a pain to get ahold of in Windows.
2009-09-11 09:13:20 -04:00
Mark Liversedge
af676f24eb WKO Import no longer aborts bulk import on first file error. 2009-09-11 09:13:20 -04:00
Justin Knotzke
e761091097 main and RideItem now use the global function that returns the correct QSettings. 2009-09-11 08:49:20 -04:00
Justin Knotzke
72c40de966 Added to what Greg has done in regards to GC's settings. Fixed a bug regarding where power.zones file was being saved to. 2009-09-11 08:49:20 -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
Julian Simioni
5299810a7e tcx ride requiring AltitudeMeters 2009-09-10 21:27:04 -04:00
Julian Simioni
b86921d90c Fixed altitude in .tcx files.
One-liner to correctly parse altitude in Garmin .tcx files.
2009-09-10 21:21:59 -04:00
Mark Liversedge
570b2ffc73 Added support for Cycleops 300PT in WKO import 2009-09-10 21:14:55 -04:00
Justin Knotzke
65ee84f948 Changed the label from mm to m as that's what is displayed. 2009-09-09 07:25:57 -04:00
Berend De Schouwer
0873317ea7 Fix PfPV divide 1000 2009-09-09 07:17:43 -04:00
unknown
236878ff7f Fixes editing of notes
Signed-off-by: Robert Carlsen <robert@robertcarlsen.net>
2009-09-08 18:25:50 -04:00
unknown
f71d329f14 Fixes major bug putting AppData in wrong place on Vista & Win7
Signed-off-by: Robert Carlsen <robert@robertcarlsen.net>
2009-09-08 18:25:42 -04:00
Robert Carlsen
eb0a40ba8e Update version number to 1.2.0 for imminent release. 2009-09-07 19:45:48 -04:00
Greg Lonnon
e7c7a43b8d fixed the following use of a uninitialized variable
==30062== Conditional jump or move depends on uninitialised value(s)
==30062==    at 0x49070E: ElevationGain::perPoint(RideFilePoint const*, double, RideFile const*, Zones const*, int) (BasicRideMetrics.cpp:114)
==30062==    by 0x491592: PointwiseRideMetric::compute(RideFile const*, Zones const*, int, QHash<QString, RideMetric*> const&) (RideMetric.h:54)
2009-09-07 12:27:08 -04:00
Rhea@.(none)
29ad88de64 rearrange src.pro for Windows 2009-09-06 19:30:03 -04:00
Berend De Schouwer
879b1f6a2e Use CSV filename as timestamp 2009-09-06 18:35:49 -04:00
Sean Rhea
50428b5586 try three times to get PT version string
Sometimes we miss the 'V' in 'VER' on the first one, but a subsequent one
lines up right.  Patch from Dan Connelly.
2009-09-06 18:25:43 -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
d65fd2a4d0 This should never have made it to github
Revert "Revert "First line of Notes in WKO imported file now has sport followed by workout code. Improves Calendar display.""

This reverts commit 3567012046.
2009-09-05 22:32:33 -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
c798420cee Test files for the qollector. 2009-09-05 22:27:32 -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
Justin Knotzke
3567012046 Revert "First line of Notes in WKO imported file now has sport followed by workout code. Improves Calendar display."
This reverts commit 325140af26.
2009-09-05 22:24:01 -04:00
Mark Rages
e7f7decf10 Add support for Quarq ANT+ log import.
The Quarq ANT+ log contains a hex dump of raw ANT+ messages.  This
importer uses the closed-source program "qollector_interpret" to convert
the ANT+ log file into an XML format, then parses that into a RideFile.

qollector_interpret binaries for several platforms may be downloaded from
http://opensource.quarq.us/qollector_interpret

If the qollector_interpret program is not available, the menu selection
for importing Quarq ANT+ will not appear, nor will .qla files be
imported.
2009-09-05 21:28:12 -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
Mark Liversedge
325140af26 First line of Notes in WKO imported file now has sport followed by workout code. Improves Calendar display.
Signed-off-by: Robert Carlsen <robert@robertcarlsen.net>
2009-09-04 10:52:10 -04:00
Mark Liversedge
afb3fb6d62 WKO Fix for 64bit, Big Endian and Interval should be 0
Signed-off-by: Robert Carlsen <robert@robertcarlsen.net>
2009-09-04 10:00:03 -04:00
Sean Rhea
7bd0d0326c fix include <> --> "" 2009-09-02 21:25:58 -04:00
Rhea@.(none)
a41226ade5 fix newlines 2009-09-02 21:17:35 -04:00
Berend De Schouwer
bab4063fd0 Resize for small screens 2009-09-02 12:46:17 -04:00
unknown
f4336ec87c Fixes stack overflow crash bug 2009-09-02 10:54:13 -04:00
Sean Rhea
9fb219019e move 'CONFIG += static debug' into gcconfig.pri 2009-09-02 10:45:13 -04:00
Thomas Weichmann
32e30f7ccd Changed title of Power Histogram Tab to Histogram Analysis 2009-09-02 10:38:28 -04:00
Sean Rhea
75e2c43cdd don't compile/link D2XX.cpp if isEmpty( D2XX_INCLUDE )
As suggested by Berend De Schouwer.
2009-09-02 10:36:02 -04:00
Claus Assmann
0c08ff093d Need unistd.h for unlink(2). 2009-09-02 10:30:33 -04:00
Justin Knotzke
faf01deb6f Took out a RideCalendar::addRide() Adding a ride debug statement. 2009-09-01 06:38:07 -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
Berend De Schouwer
4399d1ad81 RidePlot/ErgomoCSV/ErgomoHU Interval consistency 2009-09-01 06:12:34 -04:00
Berend De Schouwer
86cfac2d9e Calendar add-remove rides 2009-09-01 06:12:34 -04:00
Sean Rhea
a1bbf4d50f bug fix: no altitude in srm files
This bug was introduced in 5c0bdd89, which added an alt member to
SrmDataPoint without initializing it.
2009-09-01 05:38:18 -04:00
Claus Assmann
debd870811 There are more than just 3 OSs, make "Unix" the default. 2009-09-01 05:29:36 -04:00
Robert Carlsen
ad0fdd243e Changed declaration of QMAKE_CXXFLAGS to include possible settings from gcconfig.pri. ( = --> += ) 2009-08-31 11:16:43 -04:00
Sean Rhea
d03defb2da ignore empty include paths 2009-08-31 05:36:17 -07:00
Sean Rhea
a5dd700033 add D2XX_INCLUDE path
Also remove Windows-specific include path in D2XX.h, as setting
D2XX_INCLUDE in gcconfig.pri will accomplish the same thing.
2009-08-30 15:08:48 -07:00
Berend De Schouwer
ec8d3e9949 Add Calendar 2009-08-30 14:49:25 -07:00
Berend De Schouwer
55f0b19ff5 Add altitude for Ergomo CSV 2009-08-30 09:35:10 -07:00
Sean Rhea
75a5d66a6a test csv file with -1 hr values
This cvs file from Phil Skiba contains -1 values for hr that were
crashing the power histogram plot.

This is also the first entry into the test/rides directory, in which I
hope to store all ride files that have ever crashed any version of GC.
2009-08-30 09:25:08 -07:00
Sean Rhea
0200f3189c handle non-standard include/lib paths 2009-08-30 09:03:16 -07:00
Robert Carlsen
acaa6e1f1a Restoring src.pro to use Mac Carbon framework 2009-08-29 18:34:18 -04:00
Mark Liversedge
b37c80f849 Fix .notes created in ~/Library/GoldenCheetah rather than ~/Library/GoldenCheetah/<cyclist>/
Signed-off-by: Robert Carlsen <robert@robertcarlsen.net>
2009-08-29 18:30:27 -04:00
Mark Liversedge
1d85f94f7b Stop .notes file being created in / when browsing through WKO files.
Signed-off-by: Robert Carlsen <robert@robertcarlsen.net>
2009-08-28 18:40:01 -04:00
Mark Liversedge
ce2ae9a8d3 Rudimentary calculation of Distance from Time/Speed when Distance is not available as a graph
Signed-off-by: Robert Carlsen <robert@robertcarlsen.net>
2009-08-27 10:54:56 -04:00
Mark Liversedge
a7023c2ea5 Added Fix for Garmin 205/305
Signed-off-by: Robert Carlsen <robert@robertcarlsen.net>
2009-08-26 14:23:16 -04:00
Robert Carlsen
a970b12f68 Fix for PowerHist crash with HR of -1 2009-08-26 10:47:50 -04:00
Mark Liversedge
d66ca54b41 Updated WKO import to support Altitude in RideFile->appendPoint()
Signed-off-by: Robert Carlsen <robert@robertcarlsen.net>
2009-08-25 13:35:21 -04:00
Mark Liversedge
e9e3262caa Adjustments to wko specific source files 2009-08-25 09:59:23 -04:00
Mark Liversedge
d2efc75948 Added WKO RideNotes, applied style guide, fixed CP calc, check version of file 2009-08-25 09:59:22 -04:00
Mark Liversedge
e281cfb444 Src.pro and MainWindow.h changes for WKO import 2009-08-25 09:59:22 -04:00
Mark Liversedge
3722c3bdf0 Changed MainWindow.cpp to attach WKO file import 2009-08-25 09:59:22 -04:00
Mark Liversedge
59805db47c Initial support for WKO file import 2009-08-25 09:59:22 -04:00
Robert Carlsen
143355459d Fix for swapped cadence and altitude data 2009-08-25 09:22:52 -04:00
Thomas Weichmann
5c0bdd8969 Changes to add altitude data to allplot & elevation gained to ride metrics 2009-08-25 06:18:20 -04:00
Sean Rhea
2be608410a fix inexplicable naming conflict
Somehow this SrmData conflicts with the one in srm.h.  I would have expected
the compiler to flag that, but it didn't.  Weird.
2009-08-24 21:21:44 -07:00
Sean Rhea
bf41ffdb10 use gcconfig.pri for local config 2009-08-24 20:08:55 -07:00
Sean Rhea
0c82211bf6 restructure srm d/l code to improve clarity
Use class wrappers around the srmio library to insure that we always
close every opened device and free all allocated data.  Includes other
little bits of stylistic cleanup.
2009-08-24 20:03:07 -07:00
Sean Rhea
20b7c401ad naked new okay for Qt classes with parent pointers 2009-08-24 19:54:32 -07:00
Sean Rhea
59d0b0ede1 coding style guidelines 2009-08-24 19:42:12 -07:00
unknown
086eb6c26b Fixes Win32 Build again 2009-08-22 12:13:06 -04:00
Justin Knotzke
d3ea473f60 This adds timezone support for TCX files. - Julian Simioni 2009-08-21 20:26:47 -04:00
Justin Knotzke
5a453fb210 Misc fixes by Julian Simioni.. Thanks. 2009-08-21 20:22:59 -04:00
Justin Knotzke
3f7938f344 Julian Simioni's patch that uses standard OS directories for storing settings and libraries as well as settings.
USB Stick support still supported.
2009-08-21 19:34:19 -04:00
Sean Rhea
e5ec325caf don't clear/close device if open fails 2009-08-18 04:51:48 -07:00
Sean Rhea
278fd14af7 add option to clear srm memory after download 2009-08-18 04:37:50 -07:00
Sean Rhea
453a398663 fix include path to srmio.h 2009-08-18 03:12:19 -07:00
Sean Rhea
1adbef36e8 add include path for srmio 2009-08-15 17:55:11 -07:00
Sean Rhea
1409d9ec34 use local install of libsrmio.a
Rather than committing the srmio code to the GC repository, let the user
download and build it on their own.  It can be found at

  http://www.zuto.de/project/file/srmio/

or

  git://github.com/rclasen/srmio.git
2009-08-15 17:28:31 -07:00
Sean Rhea
e31db9f837 direct srm d/l -- ghetto, but working
The ghetto part is that we just read the device path out of the device name,
then pass that path directly to Rainer's srmpc_get_data, rather than passing
it an abstraction of a serial port.  As such, this code will only work on
Unix-like operating systems.  But it does work, and that's a good start.
2009-08-15 14:15:46 -07:00
Sean Rhea
d6022ec28c add Prolific 2303 to serial device paths 2009-08-15 14:15:45 -07:00
Sean Rhea
31c3b508bb fix segfault on very short rides 2009-08-15 14:15:45 -07:00
Sean Rhea
9ecf06a334 add qmake file to build static lib 2009-08-15 14:15:45 -07:00
Sean Rhea
83fb5c6968 srmio version 0.0.3 2009-08-15 14:15:45 -07:00
Justin Knotzke
b5f1e64cae Fixed a bug where MPH was always shown in the AllPlot even when Metric was selected. 2009-08-15 07:26:38 -04:00
Eric Murray
e3e1f8fe82 Manual ride entry updates
fix to use last N days worth of rides for BiksScore estimates
fix for skipping some rides in BikeScore estimates
skips rides with zero Bikescore for BikeScore estimates
hitting enter on ManualRide entry dialog doesn't write file
better checking for inputs on ManualRide dialog

Signed-off-by: Robert Carlsen <robert@robertcarlsen.net>
2009-08-12 21:04:36 -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
41063d069d avoid static constructor ordering bug 2009-08-10 21:45:46 -07:00
Sean Rhea
a237779dc8 QString.h --> QString 2009-08-09 22:04:59 -07:00
Sean Rhea
fc4108904f treat hsecsincemidn as a signed integer 2009-08-09 22:04:51 -07:00
Eric Murray
6ce20ccb29 Fixed calculation errors in manual ride BikeScore estimates 2009-08-09 15:43:07 -07:00
Sean Rhea
83ce4d1f59 abstract instructions; use combo for port, too 2009-08-09 15:34:53 -07:00
Sean Rhea
5461e07fcd add combobox to select device type 2009-08-09 15:34:46 -07:00
Sean Rhea
502cb4b60f abstract Device to support multiple device types 2009-08-09 15:34:39 -07:00
Sean Rhea
9624cd03a9 move all PT-specific code out of DownloadRideDialog 2009-08-09 15:34:32 -07:00
Sean Rhea
a01bc21ece localize PT-specific code in DownloadRideDialog 2009-08-09 15:33:49 -07:00
Sean Rhea
f588082449 clean up headers 2009-08-09 15:33:41 -07:00
Sean Rhea
356ee341b2 move calc of d/l status str to PowerTapDevice
...thereby making DownloadRideDialog a little more device-agnostic.
2009-08-09 15:33:35 -07:00
Sean Rhea
563285ab9d move filename calculation to downloadClicked()
...in preparation for moving more of DownloadRideDialog into PowerTapDevice.
2009-08-09 15:33:23 -07:00
Sean Rhea
6dee00e5b8 move PT download code into PowerTapDevice.(h|cpp) 2009-08-09 15:33:16 -07:00
Sean Rhea
6e56b8652f rename PowerTap.(h|cpp) to PowerTapUtil.(h|cpp)
...in preparation for separating out a PowerTapDevice class.
2009-08-09 15:33:02 -07:00
Sean Rhea
b4553ed189 ManualRideDialog doesn't need PowerTap functions 2009-08-09 15:32:54 -07:00
Sean Rhea
1c732ed2cc rename Device to CommPort
I hate to change so many lines of code just for a little rename, but I want to
distinguish between "devices", like the PowerTap and SRM, and "communications
ports", like the serial port and the native D2XX drivers.  This work is in
preparation for adding direct download support for the SRM.
2009-08-09 10:01:00 -07:00
Sean Rhea
f765cef661 fix unused parameter warning 2009-08-09 09:29:11 -07:00
Sean Rhea
e9bae94b83 fix unused variable warnings 2009-08-08 10:39:22 -07:00
Sean Rhea
913b5b6c73 add support for .srm version 7 2009-08-08 10:39:12 -07:00
Justin Knotzke
eb06e3e6d7 Manual patch entry by Eric Murray. Users can now enter in a manual entry
based on distance or time.
2009-08-07 21:31:06 -04:00
Justin Knotzke
ca4278f904 Manual patch entry by Eric Murray. Users can now enter in a manual entry based on distance or time. 2009-08-07 21:25:22 -04:00
Sean Rhea
df9519a027 git replaces svn 2009-08-01 19:33:26 -07:00
Sean Rhea
d79a6f5885 reminder to update web page about git 2009-08-01 14:51:30 -07:00
Sean Rhea
71fcf7ba5d Merge branch 'master' of git@github.com:srhea/GoldenCheetah 2009-08-01 14:23:00 -07:00
Sean Rhea
ad8e5015e1 fix zero-torque bug in PowerHist 2009-08-01 14:04:48 -07:00
Justin Knotzke
d500064da2 Fixed a small bug whereby we weren't deteting Linux correctly (or at all for that matter)
It now uses the standard QMAKE -spec for #ifdefs
2009-08-01 16:52:49 -04:00
Justin Knotzke
9f65afff15 Try to deduce Ergomo filenames when importing into GC as CSV.
Berend De Schouwer

Instead of importing with the creation time -- which is when the file
was downloaded -- attempt to get a more useful time.
2009-07-01 09:28:18 -04:00
Justin Knotzke
07b8d15769 Ergomo CSV files list both a TIME field at column 0, and a PAUSE field
at column 10.

The TIME (L_SEC) field appears to always increment one recording
interval at a time -- however it always increment consistently.  When
there is a pause, the TIME field increments as if there was NO pause.

For example:

   11,   0.015,    0,   0, 12.7,   0,1350.2, 11.7,  0,     0
   12,   0.015,    0,   0, 12.7,   0,1350.0, 11.7,  0,     0
   13,   0.015,    0,   0, 12.7,   0,1350.0, 11.7,  0, 35607
   14,   0.015,    0,   0,  2.9,  70,1095.2,  4.7,  0,     0
   15,   0.021,    0,   0,  2.9,  70,1094.0,  4.7,  0,     0

At the 13th second, there was a pause for 35607 seconds.  The 14th
second is actually the 14+35607 second.

The attached patch loads those files correctly.  This allows the "Ride
-> Split Ride..." menu option to work as expected.

Thanks Berend De Schouwer
2009-07-01 09:20:34 -04:00
Robert Carlsen
f8d6190553 PfPv patch for missing cadence data from Dan Connelly 2009-06-30 00:33:10 -04:00
Robert Carlsen
ee7a953e53 added .gitignore for doc dir 2009-06-26 18:44:41 -04:00
Robert Carlsen
0754c43b1f updating FTDI instructions on user guide page 2009-06-26 18:12:40 -04:00
Robert Carlsen
64751d7585 Adding missing assert.h include 2009-06-24 14:43:56 -04:00
Robert Carlsen
263e28b6b6 Restoring ifdef for D2XX on win32 2009-06-23 13:18:00 -04:00
Robert Carlsen
8dc03b0cb3 Merge branch 'clean' into hub 2009-06-23 12:48:44 -04:00
Sean Rhea
7f1a19930c update title again, rewrite introduction text
Say more about what GC actually does, rather than talking about future goals.
2009-06-23 09:23:30 -07:00
Robert Carlsen
8af2bb02e5 Adding .gitignore files. Feel free to tweak them for your environment 2009-06-23 12:20:56 -04:00
Robert Carlsen
0b9458d954 Bug fixes for PfPv and TCXParser from Ned 2009-06-23 12:19:56 -04:00
Sean Rhea
2ddd87faae web page edit: more inclusive title 2009-06-23 08:48:54 -07:00
Robert Carlsen
13ec408aa3 Adding in PolarRideFile.cpp/h 2009-06-23 09:20:00 -04:00
Justin Knotzke
47b4cf1c44 Damien's patch to support CS600 Polar files. 2009-06-23 06:35:53 -04:00
Robert Carlsen
e973e51281 updating the website docs 2009-06-23 02:06:34 -04:00
Justin F. Knotzke
38f8283ece Threw in an ifdef to fix differences between qwt 5.2 and qwt 5.1.2 2009-06-22 12:02:21 +00:00
Robert Carlsen
e8f2877539 Adjusting weekly plot axis label font size slightly for Mac. Small fonts (< 8pt) are aliased by default in OS X. 2009-06-22 05:37:13 +00:00
Robert Carlsen
52821ee647 Small bug fix for lo and hi margins values. 2009-06-22 05:29:50 +00:00
Justin F. Knotzke
fcdd894c52 Small fixes post Dan's Mega Patch.. 2009-06-22 03:50:04 +00:00
Justin F. Knotzke
d9baad3545 Missing settings.h 2009-06-22 03:23:37 +00: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
76f6cf3f7f Added DaysScaleDraw.h for Dan's mega patch 2009-06-22 03:10:09 +00:00
Justin F. Knotzke
3ab2c91ce2 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:27:11 +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
3723185439 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:25:09 +00:00
Justin F. Knotzke
69775fccb9 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:24:28 +00:00
Justin F. Knotzke
08fc58454f Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:24:21 +00:00
Justin F. Knotzke
6caf431d05 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:24:16 +00:00
Justin F. Knotzke
f11d7e1bd9 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:24:10 +00:00
Justin F. Knotzke
fb4514b5fe Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:24:05 +00:00
Justin F. Knotzke
e8cddb104f Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:23:37 +00:00
Justin F. Knotzke
1652491be1 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:23:30 +00:00
Justin F. Knotzke
12f91a9bf1 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:23:23 +00:00
Justin F. Knotzke
3b4e902870 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:23:17 +00:00
Justin F. Knotzke
d2545348a1 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:23:11 +00:00
Justin F. Knotzke
b90598eb39 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:23:06 +00:00
Justin F. Knotzke
6ccaac6123 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:23:00 +00:00
Justin F. Knotzke
15a546927e Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:22:56 +00:00
Justin F. Knotzke
bf534977b8 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:22:51 +00:00
Justin F. Knotzke
d92468a625 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:22:45 +00:00
Justin F. Knotzke
47044708d9 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:22:39 +00:00
Justin F. Knotzke
9fefe27a38 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:22:35 +00:00
Justin F. Knotzke
483589c372 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:22:30 +00:00
Justin F. Knotzke
420b2b6b44 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:22:25 +00:00
Justin F. Knotzke
84f4250e4a Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:22:18 +00:00
Justin F. Knotzke
2e1801d8bd Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:22:13 +00:00
Justin F. Knotzke
4453d690b3 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:21:16 +00:00
Justin F. Knotzke
b2acd45c8d Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:21:12 +00:00
Justin F. Knotzke
ea58d961a6 Dan Connelly's MEGA patch.
It includes both powerzones and weekly summary plots.

  Thanks Dan.
2009-06-22 02:21:10 +00:00
Justin F. Knotzke
40120a373e Crank length updated live (you must change the ride) to see the change. Before this patch you had to restart GC. Thanks to Berend. 2009-06-21 16:54: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
ea49b24337 Berend De SchouwerI made it possible to set the default cranklength.
I made it a combo box to avoid having to take care of invalid inputs.
2009-06-21 14:08:05 +00:00
Justin F. Knotzke
02dce7245b Berend De SchouwerI made it possible to set the default cranklength.
I made it a combo box to avoid having to take care of invalid inputs.
2009-06-21 14:04:37 +00:00
Robert Carlsen
12db84372f Fixing a case-sensitivity bug with csv files. 2009-06-17 13:56:53 +00:00
Justin F. Knotzke
78766b0752 Fix by Dan Connelly for a weekly summary bug that showed different summaries for the same week when moving the picker. 2009-06-02 00:09:28 +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
Sean C. Rhea
015862460e cleanup related to parseRideFileName
It was lame that I had to add the "xml" suffix to this regex.  It should be
enough to add a RideFile subclass.  This patch also does a more robust job of
setting the notesFileName.
2009-05-03 15:56:00 +00:00
Sean C. Rhea
4633562138 oops! 2009-05-03 15:38:15 +00:00
Sean C. Rhea
aeec208f10 read xml files
The current RideFile type associates a unique interval number with each sample
point, meaning that intervals can't overlap.  It also names intervals as
integers, not strings.  So for now, XmlRideFile just orders intervals by their
order in the xml file and names them by their order in this list (starting
with zero, to match convention).  It then associates each sample with the
lowest-named interval into which the sample falls.  This strategy means that a
raw file exported to xml will have the same interval locations and names when
read back in as xml.
2009-05-03 01:41:12 +00:00
Sean C. Rhea
37fdc5eefd document encoding string can't contain spaces 2009-05-03 01:22:33 +00:00
Sean C. Rhea
095ad55763 handle failure to read ride file gracefully 2009-05-03 01:08:38 +00:00
Sean C. Rhea
9dc3c00023 export to XML functionality 2009-05-02 22:58:57 +00:00
Justin F. Knotzke
7e6ee45d9a Dan found a bug in how the dates were written to file. 2009-04-17 12:03:25 +00:00
Robert Carlsen
8506306627 Updating the Delete Ride dialog with caution icon and "Cancel"/"Delete" buttons. Also wrapped strings in Qt translate functions. 2009-04-14 18:04:37 +00:00
Robert Carlsen
604c24147f Delete ride function from Ned Harding. 2009-04-14 15:48:13 +00:00
Robert Carlsen
4604f62e23 Updating the minor version to 1. 2009-04-10 20:13:59 +00:00
Justin F. Knotzke
0f0e817ff0 Ned's install script for Win32. 2009-04-10 14:33:13 +00:00
Justin F. Knotzke
bc17462c41 Fix by Daniel Connelly to ensure Zones Ranges are more continuous. 2009-04-10 14:06:18 +00:00
Robert Carlsen
6222fe888a Committing Ned Harding's win32 building updates 2009-04-08 19:22:11 +00:00
Robert Carlsen
c9a641ea61 Committing Ned Harding's patches for building on win32. 2009-04-08 07:12:24 +00:00
Robert Carlsen
93b5007746 From Ned Harding: Basic implementation of dflcn header for win32 2009-04-08 06:59:49 +00:00
Robert Carlsen
53f4e6f224 From Ned Harding: Basic implementation of dflcn header for win32 2009-04-08 06:58:59 +00:00
Justin F. Knotzke
48bd6b2fec Fixed skiba_xpower bug. 2009-04-07 23:29:18 +00:00
Justin F. Knotzke
4861d91c95 Small fix to LTM. Still in comments 2009-04-07 22:28:14 +00:00
Justin F. Knotzke
4ac1444f5c Small fix to LTM. Still in comments 2009-04-07 22:23:24 +00:00
Justin F. Knotzke
3fe277a9a5 Small fix to LTM. Still in comments 2009-04-07 22:22:39 +00:00
Justin F. Knotzke
0d1066a020 Quick LTM fix. This is all still in comments. 2009-04-07 22:15:36 +00:00
Justin F. Knotzke
22be6e216d Stupid svn and case sensitivity 2009-04-07 22:14:57 +00:00
Justin F. Knotzke
7209df0764 Small fix to LTM. Still in comments 2009-04-07 22:09:52 +00:00
Justin F. Knotzke
3f1d3f2adb Small fix to LTM. Still in comments 2009-04-07 22:09:22 +00:00
Justin F. Knotzke
73814a4df8 Small fix to LTM. Still in comments 2009-04-07 21:32:27 +00:00
Robert Carlsen
9228211e15 restoring static linking for qwt lib and removing reference to ftdi lib (handled in D2XX.h/cpp at runtime) 2009-04-06 16:20:06 +00:00
Justin F. Knotzke
0f218f7cdd Wrong file.. 2009-04-06 10:13:59 +00:00
Justin F. Knotzke
4bc62f7a6e Wrong file.. 2009-04-06 10:13:01 +00:00
Justin F. Knotzke
4978209289 This is the new Metrics SQL Database support. 2009-04-06 01:24:48 +00:00
Justin F. Knotzke
57e5fea35b This is the new Metrics SQL Database support. 2009-04-06 01:24:30 +00:00
Justin F. Knotzke
b7c40388f2 SplitRideDialog. Missing from r300 Checkin. 2009-04-06 01:05:40 +00:00
Justin F. Knotzke
c7652caeec Accidentally took out ppc from the mac build. 2009-04-06 01:03:05 +00:00
Justin F. Knotzke
21d5576393 Split Ride.
It offers to split at any time gap over 30 seconds and also at any interval.  
If the time gap is over 5 minutes it defaults to checked, otherwise it 
defaults to unchecked.

Anywhere you check, it will split the ride at that point overwriting the or
original ride with a shorter one and creating new rides after the split points
 The original would get renamed with a .bak so it could be recovered.
2009-04-06 01:01:17 +00:00
Justin F. Knotzke
3db61084a1 Fixed a possible memory bug. Thank you to Dan Connelly 2009-04-03 00:33:06 +00:00
Justin F. Knotzke
56cc8b084d Tom Montgomery's patch:
I have made changes to the Import CSV dialog box; the new (proposed)  
behaviour is as follows:

  At first, the datePicker widget and OK button are disabled.
  The datePicker is preset to today's date (no longer really  
necessary, but the code is there).
  User clicks 'choose a file' and the usual file browser appears.
  If a file is selected, its creation date is stuffed into the  
datePicker.
  On return from the browser, the datePicker and OK buttons are re- 
enabled.
  User can modify the ride date, in case the file upload was not done  
on ride day.
  User clicks OK, the file is imported as before.
2009-03-27 18:02:34 +00:00
Justin F. Knotzke
6cfccfc92f This patch by Tom Montgomer now uses the current date when importing a CSV file instead of defaulting to 2000.
Thanks Tom.
2009-03-25 23:21:47 +00:00
Justin F. Knotzke
f328248582 GC now support the latest v10 iBike CSV import.
Thanks to Tom Montgomery
2009-03-25 23:15:18 +00:00
Justin F. Knotzke
9d22cc3dc8 Thanks to Ned Harding, Golden Cheetah now support Ant+ Sport. Thanks Ned. Much appreciated.
J
2009-03-18 17:59:46 +00:00
Justin F. Knotzke
a65460d5d8 2009-02-22 15:35:43 +00:00
Justin F. Knotzke
ee3b9f46b9 Took out DBAccess references. 2009-02-22 15:28:26 +00:00
Justin F. Knotzke
d769625f5c Took out DBAccess references. 2009-02-22 15:26:15 +00:00
Justin F. Knotzke
071c9b1071 Took out MetricView references. 2009-02-22 00:49:00 +00:00
Justin F. Knotzke
b6a902ebd9 The critical power plot show maximum average power for all rides.
But you don't know when you reach this value.

I propose this small patch to show the value and the date like on this print screen.

Damien
2009-02-22 00:08:34 +00:00
Justin F. Knotzke
9e73576fba The critical power plot show maximum average power for all rides.
But you don't know when you reach this value.

I propose this small patch to show the value and the date like on this print screen.

Damien
2009-02-22 00:07:19 +00:00
Justin F. Knotzke
b046ae538b The critical power plot show maximum average power for all rides.
But you don't know when you reach this value.

I propose this small patch to show the value and the date like on this print screen.

Damien
2009-02-22 00:07:05 +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
Robert Carlsen
92749ac705 Identify the device type as "Garmin TCX" when reading from a tcx file. 2009-01-26 18:58:25 +00:00
Sean C. Rhea
9e4d237ce9 pop up a warning if we can't find libftd2xx 2009-01-24 20:09:13 +00:00
Sean C. Rhea
a6f269363e load libftd2xx via dlopen rather than linking to it with ld,
so that GC won't crash if it's not there
2009-01-24 17:50:06 +00:00
Robert Carlsen
03e2f95c43 Changed the AvgCadence unit from "bpm" to "rpm". 2009-01-24 00:22:59 +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
7026520ec4 This patch changes the weekly summary to include the number of seconds
in total time riding, which previously only included hours and minutes.
A few seconds over a week shouldn't account for much, but I think it's
desirable to use the same resultion for data values across the product
for consistancy if nothing else.

   --jtc
2009-01-17 19:33:49 +00:00
Robert Carlsen
842303029c Updated the Pf/Pv plot curve to use antialiased ellipses rather than points. 2009-01-14 05:21:52 +00:00
Robert Carlsen
1292a5f8e9 Applied JTC's P10, changing DatePickerDialog and RideFile objects to use boost::scoped_ptr to ensure that the objects are deleted. He recommends that we extend this technique to replace other raw pointer / delete methods.
Also, changed PfPvPlot so it will look for the CP from the power.zones file and use that rather than a hard coded value.
2009-01-12 17:15:54 +00:00
Robert Carlsen
a8dad052fd added version 1.0.277 release 2009-01-10 01:41:31 +00:00
Robert Carlsen
50a9de052c from jt conklin: fixed a possible memory leak in the weekly summary. 2009-01-09 23:43:52 +00:00
Robert Carlsen
5a00528f4d Changed the update signal from returnPressed() to editingFinished() for the lineEdit fields in the ride plot and power histrogram views. 2009-01-08 06:47:33 +00:00
Robert Carlsen
b4584baf03 Adding iBike CSV import support. 2009-01-07 01:28:09 +00:00
Robert Carlsen
d849834070 Added escaping slashes to the build date. It may only work on linux/max os x, I haven't had a chance to try it on win32. 2009-01-06 02:51:15 +00:00
Robert Carlsen
21a72bc45e Added escaping slashes to the svn version number compiler directive to workaround a qmake issue with using a string value for a define. The modified statement is: \\\"svnversion . | cut -f '2' -d ':'\\\"
It may only work on linux/max os x, I haven't had a chance to try it on win32.

This was noted here: http://www.archivum.info/qt-interest@trolltech.com/2008-09/msg00070.html
2009-01-06 02:26:24 +00:00
Robert Carlsen
264e8b118e Changed from Build Date to Version Numbering system in the about dialog. As discussed on the list, the protocol is major.minor.revision, currently 1.0.271. The major and minor version numbers are set in src.pro; the revision number should be automatically derived using "svnversion . | cut -f '2' -d ':'" in src.pro. 2009-01-06 01:54:01 +00:00
Robert Carlsen
fe5b1300eb Opting to include the svn revision number grab in src.pro 2009-01-06 01:37:32 +00:00
Robert Carlsen
c731525124 Utility to add include the svn revision number to the program version in the about dialog. 2009-01-06 00:32:16 +00:00
Robert Carlsen
dd7c308667 Fix case sensitivity issue in Pages.h for #include <QCheckBox> 2009-01-05 02:30:05 +00:00
Robert Carlsen
700ac5c12d From JT Conklin: Fix to force the aggregateWith() method to use properly use metric units while incrementing when set as a user preference. 2009-01-05 02:23:09 +00:00
Robert Carlsen
f685703ae4 Updating the AddRide method to honor the ride list sorting preference. 2009-01-05 02:03:52 +00:00
Robert Carlsen
8d2edd4c48 Added a user preference to change the Ride List sorting. Default should be ascending by date, as it has been. Disabling the "Sort ride list ascending" preference will sort the ride list descending by date.
Also, added margins to the widgets in the main window.
2009-01-05 01:47:37 +00:00
Robert Carlsen
f8a94dc767 From JT Conklin:
Added support to TCX, CSV and SRM import functions to correctly remember the last import directory.
2009-01-03 20:31:57 +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
Robert Carlsen
33ee8daf1e Just standardizing some indention. 2009-01-03 17:25:55 +00:00
Justin F. Knotzke
fb1b79cccf This is a 100% cosmetic issue, but I've never liked the way the
"about" dialog is formatted, with "GoldenCheetah is Licenced under
the GNU General Public Licence." and "Source code can be obtained 
from http://goldencheetah.org/" run together in a single paragraph
because the way the line is broken after "Source".  

The attached patch splits the two sentences into two separate
paragraphs, and centers the entire dialog text.

While this is subjective, I think it looks a lot better.

   --jtc
2009-01-03 11:55:56 +00:00
Robert Carlsen
c11b305239 On the ride plot, the range of speed is typically much smaller than the ranges of power, heart rate, and cadence. As a result, for many activities it's difficult to distinguish much difference.
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
2009-01-03 07:13:45 +00:00
Robert Carlsen
baaacda681 Re-enabled the build date QMake flag. Disabled to permit "qmake -spec macx-xcode" to create a valid xcode project file. 2009-01-02 21:26:09 +00:00
Robert Carlsen
1105d60d1f Added compiler flags to build as Mac OS X Universal Binary. May require QWT and Qt to be universal as well. 2009-01-02 21:23:38 +00:00
Justin F. Knotzke
d5997b9fee The Ride Plot currently displays the activity's speed in MPH,
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
2009-01-02 20:58:06 +00:00
Justin F. Knotzke
f2187c6965 While browsing the GC code, I found that there was not an explicit
deletion of the Tools (CP Calculator) Dialog, nor was the attribute
set that tells the framework to delete the dialog when it's dismissed.
Since the other dialogs use the attribute, this patch does the same.

   --jtc
2009-01-02 18:09:26 +00:00
Justin F. Knotzke
801a26392e JTC found and fixed a double addWidget error.. 2009-01-02 17:28:59 +00:00
Sean C. Rhea
ec38e8ca1d add device types 2008-05-27 03:53:22 +00:00
Sean C. Rhea
61161a7b5d remember last import path 2008-05-27 03:00:30 +00:00
Sean C. Rhea
5a3c3c8eb7 playing around with export to XML,
may eventually become the "native" GC file format
2008-05-27 02:56:07 +00:00
Sean C. Rhea
a9ce6ae947 add Windows to About dialog 2008-05-23 16:07:20 +00:00
Sean C. Rhea
ef5f2c1a47 from Rob C: change '\' to '/' 2008-05-23 16:04:37 +00:00
Sean C. Rhea
6c3ff75f0b from Rob C: set D2XX to 9600-N-1 to make PT happy on Windows 2008-05-23 16:03:33 +00:00
Sean C. Rhea
1e9c4dffe8 group rides by type, course 2008-05-20 04:57:06 +00:00
Sean C. Rhea
80e113d347 from Justin: "It should fix the bugs with creating a new power.zones file plus
adds two DateEdits to show the start and end of a zone range."
2008-05-19 15:03:26 +00:00
Sean C. Rhea
ff59009f86 Dan Connelly points out that it should be "n * (n + 1) / 2" (plus, not minus). 2008-05-19 14:46:50 +00:00
Sean C. Rhea
9d557b26a1 from Justin: PT reports no data as watts == -1, assume watts == 0 in that case 2008-05-18 15:14:47 +00:00
Sean C. Rhea
91f114f199 from Justin: more hacking on the zones editor 2008-05-18 15:11:21 +00:00
Sean C. Rhea
7c72da0c72 from Justin: icons for windows 2008-05-18 15:01:35 +00:00
Sean C. Rhea
babbaa7e2c Sane failure for rides longer than a week, which usually happen because
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).
2008-05-18 14:19:37 +00:00
Sean C. Rhea
f91e45d950 fix small memory leak 2008-05-18 14:00:50 +00:00
Sean C. Rhea
6aa6693cad fix awful indentation 2008-05-18 13:58:45 +00:00
Sean C. Rhea
41da1dfc68 smooth updating of progress bar in update_cpi_file 2008-05-14 22:47:54 +00:00
Sean C. Rhea
d91608ecca from Justin: add Serial.(h|cpp) 2008-05-14 14:59:23 +00:00
Sean C. Rhea
25b17de0e4 from Justin: nits 2008-05-14 14:57:00 +00:00
Sean C. Rhea
e6c85a12f4 from Justin: zones editor, switch from FTP to CP 2008-05-14 00:17:10 +00:00
Sean C. Rhea
4eeb656016 update progress dialog while aggregating over .cpi files 2008-05-13 16:42:39 +00:00
Sean C. Rhea
b6f817c4d7 combine cpint.(h|cpp) with CpintPlot.cpp 2008-05-13 16:30:35 +00:00
Sean C. Rhea
83d6989d51 from Justin: more .pro file patches for Windows, plus ToolsDialog 2008-05-13 16:15:22 +00:00
Sean C. Rhea
e63452d521 from Justin: on Windows, hton[ls] is in winsock.h 2008-05-13 03:33:08 +00:00
Sean C. Rhea
812b17c952 don't need 2008-05-13 03:30:49 +00:00
Sean C. Rhea
e2d9a96b52 Justin's changes, heavily editted, to compile on Windows 2008-05-13 02:18:15 +00:00
Sean C. Rhea
133f677b12 renaming to match directory name 2008-05-13 02:16:46 +00:00
Sean C. Rhea
da214db96d move TODO list to the web page as a "wish list" 2008-05-12 16:37:34 +00:00
Sean C. Rhea
98ede8e40c combined lots of emails all into this file 2008-05-12 16:28:58 +00:00
Sean C. Rhea
65c4e1d277 remove old directories 2008-05-12 03:31:25 +00:00
Sean C. Rhea
6e5487ca39 everything in one directory 2008-05-12 03:28:53 +00:00
Sean C. Rhea
b519a0384b insert new rides into allRides in order by date, remove duplicates 2008-05-11 05:18:17 +00:00
Sean C. Rhea
3c998c98b0 Let QTemporaryFile go out of scope so it will really close before calling
rename, since Windows won't rename an open file.  Call remove before rename on
Windows, since Windows rename won't overwrite.  Call setPermissions with
previous value plus all read flags, rather than using write flags explicitly.
Replace lots of asserts with QMessageBox::criticals.
2008-05-10 15:51:26 +00:00
Sean C. Rhea
2f3df889c5 New download code doesn't use Unix-isms. Big thanks to Rob Carlsen for
debugging the weirdness around QTextStream::setFieldWidth.
2008-05-10 03:41:08 +00:00
Sean C. Rhea
60f9724543 remove ctype.h 2008-05-06 05:31:40 +00:00
Sean C. Rhea
7cf5766ab7 remove Unix-specific includes, clean up copyrights somewhat 2008-05-06 05:26:44 +00:00
Sean C. Rhea
91d51a6246 use more QT classes instead of OS-specific stuff 2008-05-06 05:25:31 +00:00
Sean C. Rhea
c832727a03 replace Unix-specific stuff with QT equivalents; convert to C++ 2008-05-05 17:42:58 +00:00
Sean C. Rhea
73fdb7d6ef make listFunctions a pointer so that static initialization order doesn't matter 2008-05-05 02:03:33 +00:00
Sean C. Rhea
bfadc8c043 switch statements suck 2008-05-04 17:32:40 +00:00
Sean C. Rhea
cd080aa48c add JT 2008-05-04 06:56:44 +00:00
Sean C. Rhea
f27ff27c3b TCX importing and Pedal Force vs. Pedal Velocity Chart from
J.T. Conklin (jtc@acorntoolworks.com).
2008-05-04 06:50:34 +00:00
Sean C. Rhea
aed29e150d remove older command-line tools 2008-05-04 05:16:18 +00:00
Sean C. Rhea
4434239235 remove temporary command-line version 2008-05-04 05:13:09 +00:00
Sean C. Rhea
8db3e2c0b2 add power.zones 2008-05-04 05:10:23 +00:00
Sean C. Rhea
f34e0fc74c Lots of code cleanup. All Unix/Mac-specific download code used by graphical
version is now in pt/Serial.cpp, which the .pro files should ignore on win32.
2008-05-04 05:09:32 +00:00
Sean C. Rhea
51165d0acf New download code now working with older VCP driver as well. This code isn't
really fit for human consumption.  I'm just checking it in before I clean it
up in case I go and break something on accident.
2008-05-03 17:52:46 +00:00
Sean C. Rhea
2e21b6e328 now also downloads from serial/usbserial devices and automatically chooses
between them and D2XX based on what's installed
2008-04-12 20:56:12 +00:00
Sean C. Rhea
b47ac76116 set svn:ignore 2008-04-10 17:37:06 +00:00
Sean C. Rhea
17cbe38af8 - Separated download logic from device abstraction layer.
- Now creates a .raw file.
2008-04-10 17:29:30 +00:00
Sean C. Rhea
bce0fbdb95 proof of concept program to test downloading from PT with D2XX drivers 2008-04-02 15:35:32 +00:00
Sean C. Rhea
9f56747a6d added "Find Best Intervals" dialog 2008-03-15 17:30:48 +00:00
Sean C. Rhea
262fa0d9b1 add bit about how to get TextEdit to save a .zones file 2008-03-14 01:52:32 +00:00
Sean C. Rhea
76f161fb46 add BikeScore link 2008-03-14 01:51:50 +00:00
Sean C. Rhea
9e7c9407ff 2008, not 2007 2008-03-11 16:12:19 +00:00
Sean C. Rhea
371bfbdae3 add new images to Makefile 2008-03-11 16:10:15 +00:00
Sean C. Rhea
c70685ee4a added new release 2008-03-11 16:05:58 +00:00
Sean C. Rhea
55356eb221 actually ignore the bad time block that we claim we're going to ignore 2008-03-11 01:02:39 +00:00
Sean C. Rhea
b6691939f1 minor edits 2008-03-10 19:01:35 +00:00
Sean C. Rhea
8ea444f55e fix for QT 4.3.1 and add TM symbol 2008-03-10 18:01:44 +00:00
Sean C. Rhea
7fd58c7f0d first pass at a new User's Guide 2008-03-09 16:49:13 +00:00
Sean C. Rhea
6e60d167b7 added comments 2008-03-08 16:26:12 +00:00
Sean C. Rhea
d5fd8c1234 renamed CombinedFileReader to RideFileFactory 2008-03-08 16:20:43 +00:00
Sean C. Rhea
8b782dff27 Removed RawFile and replaced it with RideFile. I can't remember how we ended
up with both, but they're basically the same class.
2008-03-08 16:11:41 +00:00
Sean C. Rhea
7a43765a25 Now using "Critical Power" instead of "Functional Threshold Power". 2008-03-07 22:36:09 +00:00
Sean C. Rhea
eae6f74087 Use "CP" instead of "FTP" in power.zones to be more compatible with Skiba's
terminology, but still allow "FTP" for backwards compatibility.
2008-03-07 21:37:51 +00:00
Sean C. Rhea
2c2d1eedb6 use minutes, not seconds, as the y-axis says 2008-03-07 20:11:55 +00:00
Sean C. Rhea
26e0336f62 don't try to compute BikeScore if no zones file present 2008-03-07 19:57:33 +00:00
Sean C. Rhea
ad32b3ed94 Adding this here so I don't lose it. 2008-02-21 20:25:04 +00:00
Sean C. Rhea
304fbb49b4 BikeScore, xPower, and Relative Intensity updated to match Skiba's method
more or less exactly.  Also added (TM) to BikeScore in Ride Summary.
2008-02-21 18:41:38 +00:00
Sean C. Rhea
d16330134d Separated out BikeScore as a RideMetric. 2008-02-21 00:51:50 +00:00
Sean C. Rhea
aba9a29a43 All the basic ride metrics now use the RideMetric interface. 2008-02-20 19:24:20 +00:00
Sean C. Rhea
5dc93dccc8 - Added TotalWorkRideMetric.
- Use XML to describe what metrics to display and in what order.
2008-02-20 17:24:45 +00:00
Sean C. Rhea
156a053666 Needed to #include<assert.h>. 2008-02-19 00:31:46 +00:00
Sean C. Rhea
e68caf412b Patch from Rob Carlsen to handle Ergomo CSV imports. 2008-02-17 01:58:53 +00:00
Sean C. Rhea
7db9fd58f4 Separated out total_distance as a ride metric. More to come, especially
ordering and grouping into a display.
2008-02-14 17:57:25 +00:00
Sean C. Rhea
676838bc70 Patch from Justin and Rob.
Adds metric/english unit's dialog and BikeScore calculation.
2008-02-13 17:34:28 +00:00
Sean C. Rhea
76be545eee look for /dev/cu.usbmodem... 2007-11-04 16:38:28 +00:00
Sean C. Rhea
74fef7e468 added link to Rob's Mac Intel build 2007-10-02 21:07:08 +00:00
Sean C. Rhea
cc8a22e2dd moved release images into their own repository 2007-09-25 02:04:18 +00:00
Sean C. Rhea
670e172e26 bug fix release 2007-09-24 03:38:50 +00:00
Sean C. Rhea
f2b2350312 bug fix release 2007-09-24 02:14:32 +00:00
Sean C. Rhea
048ce08ca9 need to qmake now 2007-09-24 02:05:50 +00:00
Sean C. Rhea
f66e94c05a CsvRideFile now only sets its ride startTime if the file is
appropriately named.  cpint now ignores startTime, as it wasn't 
using it anyway.
2007-09-22 16:27:09 +00:00
Sean C. Rhea
d2532341b4 new release 2007-09-18 18:22:28 +00:00
Sean C. Rhea
83e9f67755 call qmake in src before make 2007-09-18 17:24:01 +00:00
Sean C. Rhea
fbff0d6df1 Bug fix for interval markers: must divide by 60.0, not 60,
to get floating point division.
2007-09-18 17:23:39 +00:00
Sean C. Rhea
32dc259642 switched to Justin's code for sample lines so that reading no value
between commas works
2007-09-17 21:57:15 +00:00
Sean C. Rhea
bb3afec9eb ignore Makefile 2007-09-17 21:47:20 +00:00
Sean C. Rhea
f691758e7e converted to qmake 2007-09-17 21:46:37 +00:00
Sean C. Rhea
b03edad5f5 ignore file 2007-09-17 21:43:26 +00:00
Sean C. Rhea
c852547fb3 renamed .pro file 2007-09-17 21:42:59 +00:00
Sean C. Rhea
b97eaa4bf5 converted to C++/qmake 2007-09-17 21:39:30 +00:00
Sean C. Rhea
3c1f6f5e27 converted to C++/qmake 2007-09-17 21:38:06 +00:00
Sean C. Rhea
8b02b6620d removed empty cpint dir 2007-09-17 20:35:59 +00:00
Sean C. Rhea
b723d43bc1 moved cpint code into gui dir 2007-09-17 20:32:19 +00:00
Sean C. Rhea
9e09e4fe70 cpint now using unified ride file framework, too 2007-09-17 18:51:04 +00:00
Sean C. Rhea
42eb95c8b3 unified framework for reading in different ride
file types (raw, srm, and csv)
2007-09-17 18:10:32 +00:00
Sean C. Rhea
134f22f0ca interval markers patch from Justin Knotzke 2007-09-09 16:58:51 +00:00
Sean C. Rhea
4a8ff92437 CSV import code from Justin Knotzke 2007-08-30 16:17:17 +00:00
Sean C. Rhea
b19783c469 Rob Carlsen's patch for ignoring zeros in heart rate during intervals. 2007-08-15 20:46:44 +00:00
Sean C. Rhea
8373bbaf09 Rob Carlsen's patch adding max power to interval summary. 2007-08-15 20:16:13 +00:00
Sean C. Rhea
b8827105b8 some new stuff 2007-08-15 20:11:56 +00:00
Sean C. Rhea
bd73c83b25 new release with cpint fix 2007-08-07 15:22:37 +00:00
Sean C. Rhea
b658247509 note about brltty on Ubuntu 2007-08-07 15:07:10 +00:00
Sean C. Rhea
f402d9afd8 new release with cpint fix 2007-08-07 15:05:59 +00:00
Sean C. Rhea
abbe205dc9 Serious bug fix: while interval duration SHOULD be computed by using
previous data point (i.e., q->secs - p->secs), the duration to multiply
the wattage value by SHOULD NOT be.  Instead, should multiply by
rec_int.  (My ride from Jul 31, 2007 demonstrates the problem.  I
started an interval with a 1-sec wattage of 773 after a ~48 second rest.
Using the old code, that gets credited as 773 watts for 48 secs!)
2007-08-05 14:57:57 +00:00
Sean C. Rhea
253e2083f7 Rob's ride notes patch. 2007-06-10 23:38:15 +00:00
Sean C. Rhea
a9faed9361 oops; need to use QString::arg(), not '+' 2007-06-10 23:04:04 +00:00
Sean C. Rhea
629d9c7db2 Rob's changes 2007-06-10 22:36:46 +00:00
Sean C. Rhea
139c7c03fc add FTP to zones 2007-06-08 22:38:26 +00:00
Sean C. Rhea
ebdbff5f0e new dest dir for install 2007-05-21 04:49:37 +00:00
Sean C. Rhea
fd0e5f76be mention qwt 5.0.1, not older version, as pointed out by Rob Carlsen 2007-05-21 04:47:48 +00:00
Sean C. Rhea
8ebc1a4eb2 Don't output line with zero time (Rob Carlsen says it crashes WKO+), and
print zeroes, rather than nothing, when nm, mph, or watts are zero.
2007-05-21 04:46:26 +00:00
Sean C. Rhea
e2fc9bce5c added zoomer and panner to AllPlot, but needs work still. 2007-05-13 02:28:10 +00:00
Sean C. Rhea
d01184905f fixed bug where interval length was 1 recint too short 2007-05-10 16:30:01 +00:00
Sean C. Rhea
866eec4eee added "About GoldenCheetah" dialog with build date and link to GPL 2007-05-07 22:00:31 +00:00
Sean C. Rhea
27bf8ae1ef fix to work on OS X 2007-05-07 21:09:31 +00:00
Sean C. Rhea
abdf74ca5a use QLineEdit instead of QLabel in CP plot to avoid resizing bug 2007-05-03 23:30:56 +00:00
Sean C. Rhea
0cd28ba8d0 Warning msg said we ignored it when time went backwards in a PT file, but code
was still calling exit(1).  Now it really does ignore it.
2007-04-30 21:39:11 +00:00
Sean C. Rhea
fff8f9a0e6 okay, really fixed this time 2007-04-29 22:40:52 +00:00
Sean C. Rhea
edd39b3d3b fixed problem with download ride button not hilighting when more than one
device is available
2007-04-29 17:27:48 +00:00
Sean C. Rhea
3cdc85e411 added screenshot-weekly.png 2007-04-26 21:25:10 +00:00
Sean C. Rhea
1f8ce83475 new ride summary screenshot showing power zones,
added weekly summary screenshot
2007-04-26 21:24:43 +00:00
Sean C. Rhea
ae1c59d738 new release and description of zones file format 2007-04-26 21:15:53 +00:00
Sean C. Rhea
d87c0500ab new release 2007-04-26 20:32:28 +00:00
Sean C. Rhea
9cdda62cfa new release 2007-04-26 20:32:17 +00:00
Sean C. Rhea
753977743e oops: checked in unnecessary gcc-4.0 bit on accident 2007-04-26 20:26:13 +00:00
Sean C. Rhea
43cf7e0126 - MacOS case-insensitive file system confuses our Time.h with
/usr/include/time.h, so renamed the former.
- Bug fixes for when there is no power.zones file
2007-04-26 20:10:21 +00:00
Sean C. Rhea
e103824538 added zones to the weekly summary, consolidated and cleaned up code 2007-04-25 19:30:55 +00:00
Sean C. Rhea
cfdbe3cc30 working on adding time in each power zone to ride summery 2007-04-24 19:38:49 +00:00
Sean C. Rhea
9dd02b69e4 added weekly summary 2007-04-24 17:55:40 +00:00
Sean C. Rhea
29c760cdeb cpint (cmdline and gui) now works with .srm files, too 2007-04-22 06:25:31 +00:00
Sean C. Rhea
de66eed5ca cpint now uses intervals that are a whole number of seconds long, in
preparation for supporting data files from a variety of devices on the same
machine
2007-04-18 23:03:03 +00:00
Sean C. Rhea
c00bc0504d add cpint dir 2007-04-18 23:01:40 +00:00
Sean C. Rhea
db43014375 added GPL to comments 2007-04-18 22:40:56 +00:00
Sean C. Rhea
b5b16a4768 added GPL to comments 2007-04-18 22:40:24 +00:00
Sean C. Rhea
e1371fab8c fix time riding bug for SRM by making use of rec_int_ms in RawFile rather than
tracking last_secs
2007-04-18 21:19:56 +00:00
Sean C. Rhea
b967d276d1 check that we go forward by at least one recint on block transition 2007-04-18 21:18:12 +00:00
Sean C. Rhea
6952d2b82c get rid of unused parameter warnings 2007-04-18 21:09:52 +00:00
Sean C. Rhea
859b1f2842 converted cpint code to C++ in preparation for making it understand SRM files 2007-04-17 21:55:08 +00:00
Sean C. Rhea
acd48e7112 add srm directory, better handling of qmake 2007-04-17 20:52:30 +00:00
Sean C. Rhea
ff3227f520 move TODO to top level 2007-04-17 20:47:58 +00:00
Sean C. Rhea
432820a24e stuff 2007-04-17 20:47:21 +00:00
Sean C. Rhea
eefe0373c8 - display file even if errors, so long as we get some data
- count time riding as time either pedaling or moving, so that time on trainer
  with front wheel sensor still counts
2007-04-17 20:46:48 +00:00
Sean C. Rhea
56970da25c - fix unused variable warnings
- don't add a bogus interval 0 to files without any intervals
2007-04-17 20:45:05 +00:00
Sean C. Rhea
f2fe16ed51 shouldn't have been added; generated by qmake 2007-04-17 20:44:04 +00:00
Sean C. Rhea
efc99a8a26 add debug to config 2007-04-17 20:43:22 +00:00
Sean C. Rhea
2f7d42c46f commented out printfs 2007-04-17 20:25:30 +00:00
Sean C. Rhea
69612c8d59 anti-aliasing was the source of the poor plot performance on Linux 2007-04-17 19:12:20 +00:00
Sean C. Rhea
7e0731c7f8 allow for multiple imports at once 2007-04-17 18:06:22 +00:00
Sean C. Rhea
abf2f5b349 updates to work with qwt 5.0.1 2007-04-17 18:00:37 +00:00
Sean C. Rhea
7b52bc6f73 csv output uses .csv extension instead of .dat 2007-04-16 21:16:11 +00:00
Sean C. Rhea
aefc1d18e8 svn ignore libsrm.a 2007-04-12 04:09:00 +00:00
Sean C. Rhea
d7daa3d54d added import from SRM menu item and made cpint not crash when it can't find
cpint data for a ride (until we get it working with srm data)
2007-04-12 04:07:33 +00:00
Sean C. Rhea
3a2a469d58 Will now read, interpret, and include any appropriately named .srm files in
the user's directory.  Ride summary, ride plot, and power histogram all work
fine, but opening the CP intervals graph causes a crash if any such files
exist.  Also need to add a menu item to import .srm files that renames them to
the proper form (date-time.srm).
2007-04-09 20:43:52 +00:00
Sean C. Rhea
f6968f98bf starting to work on SRM code; this commit will decode .srm files 2007-04-09 01:43:40 +00:00
Sean C. Rhea
2729800d42 new release 2007-04-01 19:14:24 +00:00
Sean C. Rhea
8c7dfdeecd new release 2007-04-01 19:12:57 +00:00
Sean C. Rhea
8a3bc4fd44 new release 2007-04-01 19:02:52 +00:00
Sean C. Rhea
3e7d53b418 new release 2007-04-01 18:57:21 +00:00
Sean C. Rhea
0dc0f48416 Hardware echo detection was being fooled because in the normal case, the
result of a version request, triggered by writing 'V', is the string "VER...".
Sometimes, this was preceeded by a zero byte, in which case hardware echo
detection worked, but other times it wasn't, and we stripped the 'V' from
"VER...", only to wait forever for one extra byte that wasn't coming.  The new
approach is to read until we get the "\r\n", then search for "VER", then see
if any other 'V's preceed it, in which case we assume we're dealing with
hardware echo.
2007-04-01 05:41:38 +00:00
Sean C. Rhea
6bee5b3ca0 How did we NOT always open the serial port with O_NONBLOCK? WTF? 2007-04-01 05:07:04 +00:00
Sean C. Rhea
dd9ff12914 patch from Aldy to make wattage an integer in CVS exports 2007-03-07 20:44:49 +00:00
Sean C. Rhea
f18ea0d646 fixed Mac release bugs and updated both feb 21 to feb 22 2007-02-22 17:22:25 +00:00
Sean C. Rhea
54ab7d02c3 fix for centering in QT 4.1.1 2007-02-22 17:12:50 +00:00
Sean C. Rhea
6fc7669b71 cpint picker and rec_int fix, mac version 2007-02-22 03:02:11 +00:00
Sean C. Rhea
4ac73d88ac with picker and rec_int bug fix, linux version 2007-02-22 02:58:31 +00:00
Sean C. Rhea
a341bc4302 using a picker in cpint plot 2007-02-22 02:46:02 +00:00
Sean C. Rhea
1143a30248 fix misinterpretation of rec_int and add error message
for time moving backwards
2007-02-21 17:31:31 +00:00
Sean C. Rhea
04aadf4ee3 with interval seconds padding fix 2007-02-13 02:44:13 +00:00
Sean C. Rhea
f726979a01 add leading zero to single-digit seconds values 2007-02-13 02:40:45 +00:00
Sean C. Rhea
dc1fcfef35 add intervals 2007-02-12 20:58:37 +00:00
Sean C. Rhea
6a121a7fc7 add new release 2007-02-12 20:58:26 +00:00
Sean C. Rhea
c24e341b3d linux version 2007-02-12 20:47:23 +00:00
Sean C. Rhea
9f6a0ad7d6 new release; linux version coming soon 2007-02-12 20:42:58 +00:00
Sean C. Rhea
e9628702ed added Dan Connelly 2007-02-12 20:30:30 +00:00
Sean C. Rhea
a179ec592a return after reject() 2007-02-12 20:25:12 +00:00
Sean C. Rhea
0e09790c5b patch from Aldy to fix interval durations that display as XX:60 2007-02-12 20:16:48 +00:00
Sean C. Rhea
5593c8e3f7 add work, clarify units 2007-02-12 20:14:16 +00:00
Sean C. Rhea
a2f233b345 detect hwecho based on whether the hardware seems to be echoing during
pt_read_version, rather than based on the device name
2007-02-12 03:00:42 +00:00
Sean C. Rhea
a5b621a13d add interval information to ride summary 2007-02-11 20:56:13 +00:00
Sean C. Rhea
2b23610f5f add "Export to CSV..." menu option 2007-02-11 20:00:45 +00:00
Sean C. Rhea
491ef5c639 check for unreasonable speeds, and patches from Aldy 2007-02-11 18:40:14 +00:00
Sean C. Rhea
4283c5b408 fixed bug pointed out by Dan Connelly with graph sliders in empty rides 2007-02-10 04:14:48 +00:00
Sean C. Rhea
fa45b5c980 fixed link 2007-02-01 16:24:57 +00:00
Sean C. Rhea
81c5cf80b3 add new releases 2007-01-30 23:16:51 +00:00
Sean C. Rhea
982fb843cf new mac release
This line, and those below, will be ignored--

AM   doc/GoldenCheetah_2007-01-30_Darwin_powerpc.dmg
2007-01-30 23:10:30 +00:00
Sean C. Rhea
3b23740f62 new linux build 2007-01-30 23:10:00 +00:00
Sean C. Rhea
78fbe4e643 specify QT 4.1.1-static in path 2007-01-30 22:26:50 +00:00
Sean C. Rhea
d2abe9716f Fix for crash where ride time is shorter than smoothing. In particular, the
sample ride is shorter than the default smoothing value.
2007-01-29 19:59:04 +00:00
Sean C. Rhea
6134c947ed patch from Aldy to ignore zeros in cadence and hr and optionally in power 2007-01-24 20:23:41 +00:00
Sean C. Rhea
035226c3b5 fix NaNs in ride summary 2007-01-21 02:57:02 +00:00
Sean C. Rhea
734d025b7f remove Linux tarballs 2007-01-19 18:19:10 +00:00
Sean C. Rhea
e4e6c39aba added download screenshot 2007-01-19 18:16:52 +00:00
Sean C. Rhea
8bd578057f Linux build, more documentation on building from scratch 2007-01-19 18:12:09 +00:00
Sean C. Rhea
c850170cfc bunch of "#include <assert.h>" lines for Andrew Kruse 2007-01-19 17:47:41 +00:00
Sean C. Rhea
7f2d13a779 added link to FTDI drivers 2007-01-19 17:43:11 +00:00
Sean C. Rhea
f628170850 metric and csv options from Aldy 2007-01-19 17:00:47 +00:00
Sean C. Rhea
79b83fd668 another patch from Aldy: must compare to NaN with ne, not != 2007-01-17 22:27:32 +00:00
Sean C. Rhea
861507bb30 linux screenshot 2007-01-06 22:48:45 +00:00
Sean C. Rhea
1de131f122 ignore executable on Linux 2007-01-06 22:31:08 +00:00
584 changed files with 176934 additions and 4442 deletions

8
.gitignore vendored Normal file
View File

@@ -0,0 +1,8 @@
Makefile
# old skool
.svn
# osx noise
.DS_Store
profile

View File

@@ -1,31 +0,0 @@
#
# $Id: Makefile,v 1.11 2006/09/06 23:23:03 srhea Exp $
#
# Copyright (c) 2006 Sean C. Rhea (srhea@srhea.net)
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
SUBDIRS=doc src
all: subdirs
.PHONY: all subdirs clean
clean:
@for dir in $(SUBDIRS); do $(MAKE) -wC $$dir clean; done
subdirs:
@for dir in $(SUBDIRS); do $(MAKE) -wC $$dir; done

15
README Normal file
View File

@@ -0,0 +1,15 @@
To build
cp src/gcconfig.pri.in src/gcconfig.pri
cp qwt/qwtconfig.pri.in qwt/qwtconfig.pri
Edit both src/gcconfig.pri and qwt/qwtconfig.pri as necessary, then
qmake
make
To uninstall the older FTDI VCP drivers on Mac OS X, open a Terminal and type:
sudo mv /System/Library/Extensions/FTDIUSBSerialDriver.kext /tmp
Type your password when prompted, then restart your computer.

2
build.pro Normal file
View File

@@ -0,0 +1,2 @@
TEMPLATE = subdirs
SUBDIRS = qwt src

9
doc/.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
# old skool
.svn
# osx noise
.DS_Store
profile
#html files are auto-generated by the scripts:
*.html

View File

@@ -3,12 +3,11 @@ CONTENT=$(wildcard *.content)
HTML=$(subst .content,.html,$(CONTENT))
TARBALLS=$(wildcard gc_*.tgz)
OTHER=logo.jpg sample.gp sample.png cpint.gp cpint.png \
screenshot-summary.png screenshot-plot.png \
screenshot-cpint.png screenshot-phist.png
DISTRIB=GoldenCheetah_2006-12-25_Darwin_powerpc.dmg \
GoldenCheetah_2006-09-06_Darwin_powerpc.dmg \
GoldenCheetah_2006-09-07_Darwin_powerpc.dmg \
GoldenCheetah_2006-09-19_Darwin_powerpc.dmg
critical-power-plot.png histogram-analysis.png pf-pv-plot.png \
ride-plot.png ride-summary.png weekly-summary.png \
choose-a-cyclist.png main-window.png critical-power.png \
power.zones cyclist-info.png
all: $(HTML)
.PHONY: all clean install
@@ -17,8 +16,14 @@ clean:
rm -f $(HTML)
install:
rsync -avz -e ssh $(HTML) $(TARBALLS) $(OTHER) $(DISTRIB) \
srhea.net:public_html/goldencheetah/
rsync -avz -e ssh $(HTML) $(TARBALLS) $(OTHER) \
srhea.net:/home/srhea/wwwroot/goldencheetah.org/
bug-tracker.html: bug-tracker.content genpage.pl
./genpage.pl "Bug Tracker" $< > $@
command-line.html: command-line.content genpage.pl
./genpage.pl "Legacy Command-Line Tools" $< > $@
contact.html: contact.content genpage.pl
./genpage.pl "Contact Us" $< > $@
@@ -26,6 +31,9 @@ contact.html: contact.content genpage.pl
contrib.html: contrib.content genpage.pl
./genpage.pl "Contributors" $< > $@
developers-guide.html: developers-guide.content genpage.pl
./genpage.pl "Developer's Guide" $< > $@
download.html: download.content genpage.pl
./genpage.pl "Download" $< > $@
@@ -38,6 +46,9 @@ index.html: index.content genpage.pl
license.html: license.content genpage.pl
./genpage.pl "License" $< > $@
mailing-list.html: mailing-list.content genpage.pl
./genpage.pl "Mailing Lists" $< > $@
screenshots.html: screenshots.content genpage.pl
./genpage.pl "Screenshots" $< > $@
@@ -47,3 +58,9 @@ search.html: search.content genpage.pl
users-guide.html: users-guide.content genpage.pl
./genpage.pl "User's Guide" $< > $@
wishlist.html: wishlist.content genpage.pl
./genpage.pl "Wish List" $< > $@
zones.html: zones.content genpage.pl
./genpage.pl "Power Zones File Guide" $< > $@

97
doc/bug-tracker.content Normal file
View File

@@ -0,0 +1,97 @@
<p>We have an issue tracker set up at
<a href=http://bugs.goldencheetah.org/projects/show/goldencheetah>
bugs.goldencheetah.org</a>. Below are some guidelines for users and
developers for working with the issue tracker.</p>
<big><font face="arial,helvetica,sanserif">
Report a new bug/feature
</font></big>
<p> If you think that you have found a bug in GoldenCheetah or would like
to request a new feature please report it by filing a new issue at our <a
href=http://bugs.goldencheetah.org/projects/show/goldencheetah>issue
tracker</a>. To report a bug/feature request go to the above link and
follow these steps:
<ol>
<li>Login or register for a new account.</li>
<li>Click the "new issue" link near the top of the page.</li>
<li>Select either "bug" or "feature" from the tracker drop-down menu.</li>
<li>Fill out the form including as much detail as possible.<br>
You can upload crashreports, problem files, or screenshots if they
help document the issue.</li>
<li>Click the create button to save your report.<br>
This will also send a copy of your report to the Golden-Cheetah-Users
mailing list.</li>
</ol>
<p>Thanks for helping to improve GoldenCheetah.</p>
<big><font face="arial,helvetica,sanserif">
Managing issues in the tracker
</font></big>
<p>To make it easier for all of us to track the status please try to
adhere to a few simple guidelines listed below.</p>
<font face="arial,helvetica,sanserif">
<b>Issue Status:</b>
</font>
<p>Depending on your account status (non-member, reporter, developer, or
manager) you may be able to update the status of an existing issue. When
working in the bug tracker please update the status appropriately.
Current status options are:</p>
<ul>
<li>New: Default status.
<li>Assigned: issue has been assigned to someone on the project. If you
are a Developer you can assign an issue to someone, including
yourself. If you are working on a fix, please change the status to
Assigned, and post a message stating your plan of attack etc.
<li>Feedback: This could be used to alert others that you have a
proposed fix that you want feed back on. Please attach patches and
make a note. Also remember to tag the issue in your patches.
<li>Resolved: The issue has been corrected. People that have tested the
patch or that submitted the bug should update to this status when
they feel that it has been fixed. If it turns out that it was not
resolved, most users can change the status back to "feedback". If
you do so, please leave a note.
<li>Tempfix: A workaround for the issue has been posted, but we may still be
working on a more long term solution.
<li>Closed: Those with commit access to Github are the only ones that
can mark an issue as closed. That said, if you are submitting a
patch that fixes and issue, please include the "fixes #<issuenum>"
tag to your commit as this will automatically close the issue when your
patch is accepted and pushed to github.
</ul>
<font face="arial,helvetica,sanserif">
<b>Tagging in messages</b>
</font>
<p>The tracker has a very basic tagging and markup scheme that is described in
detail <a href="http://bugs.goldencheetah.org/help/wiki_syntax.html">here</a>.
Perhaps the most useful feature is the ability to use tags to link issues,
commits, etc. When commenting on an issue please use the following tags
when appropriate to automatically create links when:</p>
<table align="center" width="600">
<tr>
<th>Tag</th>
<th>Effect</th>
</tr>
<tr>
<td>Issue #2</td>
<td>Creates a link to existing Issue #2</td>
</tr>
<tr>
<td>commit:e76247a</td>
<td>Creates a link to commit e76247a</td>
</tr>
<tr>
<td>source:src/MainWindow.cpp</td>
<td>Creates a link to src/Mainwindow.cpp in our git repo</td>
</tr>
</table>

BIN
doc/cheetah_logo.eps Normal file

Binary file not shown.

BIN
doc/choose-a-cyclist.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

232
doc/command-line.content Normal file
View File

@@ -0,0 +1,232 @@
<!-- $Id: users-guide.content,v 1.5 2006/05/27 16:32:46 srhea Exp $ -->
<p>
<big><font face="arial,helvetica,sanserif">
Using the Command Line Utilities
</font></big>
<p>
In addition to the GUI, Golden Cheetah comes with
several command line utilities:
<code>ptdl</code>, which downloads ride data from a PowerTap Pro version 2.21
cycling computer, <code>ptunpk</code>, which unpacks the raw bytes downloaded
by <code>ptdl</code> and outputs more human-friendly ride information, and
<code>cpint</code>, which computes your critical power (see below). We've
also written several Perl scripts to help you graph and summarize the data.
<p>
NOTE: We no longer support the use of the command-line tools. Please use the
graphical version of GoldenCheetah instead. This documentation is here for
the benefit of the brave alone.
<p>
<big><font face="arial,helvetica,sanserif">
Extracting the Data
</font></big>
<p>
First, make sure you have the FTDI drivers installed, as described in the <a
href="users-guide.html">User's Guide</a>. You can then run <code>ptdl</code>
without arguments:
<pre>
$ ./ptdl
Reading from /dev/tty.usbserial-3B1.
Reading version information...done.
Reading ride time...done.
Writing to 2006_05_15_11_34_03.raw.
Reading ride data..............done.
$ head -5 2006_05_15_11_34_03.raw
57 56 55 64 02 15
60 06 05 0f 6b 22
40 08 30 00 00 00
86 0e 74 99 00 55
81 06 77 a8 40 55
</pre>
<p>
If everything goes well, <code>ptdl</code> will automatically detect the
device (<code>/dev/tty.usbserial-3B1</code> in the example above), read the
ride data from it, and write to a file named by the date and time at which the
ride started (<code>2006_05_15_11_34_03.raw</code> in the example; the format
is YYYY_MM_DD_hh_mm_ss.raw).
<p>
<big><font face="arial,helvetica,sanserif">
Unpacking the Data
</font></big>
<p>As shown by the <code>head</code> command above, the data in this
<code>.raw</code> file is just the raw bytes that represent your ride. To
unpack those bytes and display them in a more human-friendly format, use
<code>ptunpk</code>:
<pre>
$ ./ptunpk 2006_05_15_11_34_03.raw
$ head -5 2006_05_15_11_34_03.dat
# Time Torq MPH Watts Miles Cad HR Int
# 2006/5/15 11:34:03 1147707243
# wheel size=2096 mm, interval=0, rec int=1
0.021 13.1 2.450 43 0.00781 0 85 0
0.042 13.4 5.374 97 0.00912 64 85 0
</pre>
<code>ptunpk</code> takes a <code>.raw</code> file for input and writes a
<code>.dat</code> file as output. Lines that start with an ampersand ("#") in
this file are comments; the other lines represent measured samples. As shown
by the first comment in the file, the columns are: time in minutes, torque in
Newton-meters, speed in miles per hour, power in watts, distance in miles,
cadence, heart rate, and interval number.
<p>
<big><font face="arial,helvetica,sanserif">
Summarizing the Data
</font></big>
<p>
We hope to have a graphical interface to these programs soon, but until then,
the only summarization tools we have are command-line programs. The script
<code>intervals.pl</code> summarizes the intervals performed in a workout:
<small>
<pre>
$ ./intervals.pl 2006_05_03_16_24_04.dat
Power Heart Rate Cadence Speed
Int Dur Dist Avg Max Avg Max Avg Max Avg Max
0 77:10 19.3 213 693 134 167 82 141 16.0 27.8
1 4:03 0.9 433 728 175 203 84 122 13.0 18.8
2 7:23 1.0 86 502 135 179 71 141 16.0 28.2
3 4:27 0.9 390 628 170 181 70 100 12.0 17.6
4 8:04 0.9 60 203 130 178 50 120 18.0 30.1
5 4:30 0.9 384 682 170 179 79 113 11.0 18.6
6 8:51 1.1 53 245 125 176 70 141 8.0 26.6
7 2:48 0.4 400 614 164 178 62 91 8.0 13.6
8 7:01 1.1 46 268 128 170 71 141 12.0 28.8
9 4:30 0.9 379 560 168 180 81 170 11.0 18.3
10 28:46 6.5 120 409 128 179 79 141 15.0 31.0
</pre>
</small>
<p>
In the example above, a rider performed five hill intervals, four of which
climbed a medium size hill that took about 4-5 minutes to climb (intervals
1, 3, 5, and 9), and one on a shorter hill that took just under 3 minutes to
climb (interval 7).
<p>
<big><font face="arial,helvetica,sanserif">
Graphing the Data
</font></big>
<p>
For graphing the data in the ride, we use <code>smooth.pl</code> and the
<code>gnuplot</code> program. You can use <a href="sample.gp">sample.gp</a>
to graph the power, heart rate, cadence, and speed for the hill workout above:
<pre>
$ gnuplot sample.gp
</pre>
<img align="center" alt="Sample Plot" src="sample.png">
<p>
<big><font face="arial,helvetica,sanserif">
Finding Your "Critical Power"
</font></big>
<p>
Joe Friel calls the maximum average power a rider can sustain over an interval
the rider's "critical power" for that duration. The <code>cpint</code>
program automatically computes your critical power over all interval lengths
using the data from all your past rides. This program looks at all the
<code>.raw</code> files in a directory, calculating your maximum power over
every subinterval length and storing them in a corresponding <code>.cpi</code>
file. It then combines the data in all of the <code>.cpi</code> files to find
your critical power over <i>all</i> subintervals of <i>all</i> your rides.
<pre>
$ ls *.raw
2006_04_28_10_48_33.raw 2006_05_10_17_08_30.raw 2006_05_18_16_32_53.raw
2006_05_03_16_24_04.raw 2006_05_13_10_29_12.raw 2006_05_21_12_25_07.raw
2006_05_05_10_52_05.raw 2006_05_15_11_34_03.raw 2006_05_22_18_28_47.raw
...
2006_05_09_09_54_29.raw 2006_05_17_16_44_35.raw
$ ./cpint
Compiling data for ride on Fri Apr 28 10:48:33 2006...done.
Compiling data for ride on Sat Apr 29 10:07:48 2006...done.
Compiling data for ride on Sun Apr 30 14:00:17 2006...done.
...
Compiling data for ride on Mon May 22 18:28:47 2006...done.
0.021 1264
0.042 1221
0.063 1216
...
5.019 391
...
171.885 163
</pre>
<p>
Over this set of rides, the rider's maximum power is 1264 watts, achieved over
an interval of 0.021 minutes (1.26 seconds). Over all five-minute
subintervals, he has achieved a maximum average power of 391 watts. The
longest ride in this set was 171.885 minutes long, and he averaged 163 watts
over it.
<p>
We can graph the output of <code>cpint</code> using <code>gnuplot</code> with
<a href="cpint.gp">cpint.gp</a>:
<pre>
$ ./cpint > cpint.out
$ gnuplot cpint.gp
</pre>
<img src="cpint.png">
<p>
The first time you run <code>cpint</code> it will take a while, as it has to
analyze all your past rides. On subsequent runs, however, it will only
analyze new files.
<p><i>Training and Racing with a Power Meter</i> (see the <a
href="faq.html">FAQ</a>) contains a table of critical powers of Cat 5 cyclists
up through international pros at interval lengths of 5 seconds, 1 minute, 5
minutes, and 60 minutes. Using this table and the <code>cpint</code> program,
you can determine whether you're stronger than others in your racing category
at each interval length and adapt your training program accordingly.
<p>
<big><font face="arial,helvetica,sanserif">
Converting Old Data
</font></big>
<p>
If you've used the PowerTuned software that comes with the PowerTap you may
have lots of old ride data in that program that you'd like to include in your
critical power graph. You can convert the <code>.xml</code> files that
PowerTuned produces to <code>.raw</code> files using the <code>ptpk</code>
program:
<p>
<pre>
$ ./ptpk 2006_04_27_00_23_28.xml
$ head -5 2006_04_27_00_23_28.raw
57 56 55 64 02 15
60 06 04 7b 80 17
40 08 30 00 00 00
84 04 00 24 00 ff
83 03 00 d7 00 ff
</pre>
<p>
<code>ptpk</code> assumes the input <code>.xml</code> file was generated with
a wheel size of 2,096 mm and a recording interval of 1. If this is not the
case, you should specify the correct values with the <code>-w</code> and
<code>-r</code> options.
<p>
Note that the PowerTuned software computes the output speed in miles per hour
by multiplying the measured speed in kilometers per hour by 0.62, and the
miles per hour values in a <code>.xml</code> file are thus only accurate to
two significant figures, even though they're printed out to three decimal
places. Because of this limitation, the sequence <code>ptpk</code>,
<code>ptunpk</code> is not quite the identity function; in particular, the
wattage values from <code>ptpk</code> may only be accurate to two significant
digits.

View File

@@ -1,18 +1,55 @@
<!-- $Id: contrib.content,v 1.4 2006/09/06 04:07:18 srhea Exp $ -->
Sean Rhea bought a PowerTap Pro on April 20, 2006, and immediately set to
figuring out how to use it from his Mac Powerbook without using Virtual PC.
Within a week, he was able to download the raw data. Shortly thereafter, Russ
Cox asked what he was up to, and the two worked together to figure out the
packing format used. By May 4, they could reproduce the numbers given by the
PowerTap software except for minor discrepancies in the time values. David
Easter then pointed out how the checksum bytes in the download protocol were
used, and Sean Rhea coded up their combined discoveries into the two
utilities, <code>ptdl</code> and <code>ptunpk</code>.
<p>Sean Rhea bought a PowerTap Pro on April 20, 2006 and immediately set
to figuring out how to use it from his Mac without using Virtual PC.
With help from Russ Cox and David Easter, he wrote two command-line
programs for downloading data from a PowerTap and interpreting that
data. Sean released these two tools, <code>ptdl</code> and
<code>ptunpk</code>, on May 4, 2006.</p>
<p>Later that year, Sean needed to learn QT for his real job, and he set
about writing a graphical version of his software for practice. He
released the first graphical version on September 6, 2006, changing the
name to GoldenCheetah in reference to an old legend from his days as a
runner.</p>
<p>Since then, a large community has contributed additional code and
other support, including:</p>
<table width="80%">
<tr>
<td valign="top" width="33%">
<ul>
<li>Robert Carlsen</li>
<li>Rainer Clasen</li>
<li>J.T. Conklin</li>
<li>Dan Connelly</li>
<li>Damian Grauser</li>
<li>Ned Harding</li>
<li>Aldy Hernandez</li>
</ul>
</td>
<td valign="top" width="33%">
<ul>
<li>Jamie Kimberley</li>
<li>Justin Knotzke</li>
<li>Andrew Kruse</li>
<li>Mark Liversedge</li>
<li>Greg Lonnon</li>
<li>Tom Montgomery</li>
</ul>
</td>
<td valign="top">
<ul>
<li>Eric Murray</li>
<li>Scott Overfield</li>
<li>Mark Rages</li>
<li>Berend de Schouwer</li>
<li>Julian Simioni</li>
<li>Tom Weichmann</li>
</ul>
</td>
</tr>
</table>
<p>
Rob Carlsen helped get the serial port version of the PowerTap Pro working
with the Keyspan USB-to-serial adaptor. Scott Overfield helped me figure out
that we should be using the <code>/dev/cu.*</code> devices instead of the
<code>/dev/tty.*</code> ones.

BIN
doc/critical-power-plot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

BIN
doc/critical-power.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

BIN
doc/cyclist-info.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

View File

@@ -0,0 +1,566 @@
<!-- $Id: users-guide.content,v 1.5 2006/05/27 16:32:46 srhea Exp $ -->
<p>This guide will teach you how to download the GoldenCheetah source code,
build it, modify it, and submit your changes to be included in the next
release. If you're just looking to use GoldenCheetah, please check out the
<a href="users-guide.html">Users Guide</a> or the
<a href="download.html">Download Page</a>.</p>
<big><font face="arial,helvetica,sanserif">
Installing dependencies
</font></big>
<p>GC requires a number of libraries. On Mac OS X, you can get most of these
through <a href="http://www.macports.org/">Mac Ports</a>. On Linux and other
Unixes, you can use whatever package manager your distribution provides. (We
list the package names for MacPorts and Ubuntu below.) On Windows, you'll
probably need to download and install everything by hand. You might also want
to read <a href="old-mailing-list-archives/2009-September/002502.html">this
mailing list message</a>.</p>
<p>You'll need the following:</p>
<table align="center" width="500">
<tr>
<td>Package</td>
<td>Version</td>
<td>MacPorts</td>
<td>Ubuntu</td>
</tr>
<tr>
<td><a href="http://qt.nokia.com/downloads">Qt</a></td>
<td>4.5.0 or later</td>
<td>qt4-mac</td>
<td>libqt4-dev</td>
</tr>
<tr>
<td><a href="http://www.boost.org/users/download/">Boost</a></td>
<td>1.38.0 or later</td>
<td>boost</td>
<td>libboost-dev</td>
</tr>
<tr>
<td><a href="http://git-scm.com/download">git</a></td>
<td>any</td>
<td>git-core</td>
<td>git</td>
</tr>
</table>
<p>If you're going to download directly from a PowerTap, you might need to
install the <a href="http://www.ftdichip.com/Drivers/D2XX.htm">FTDI USB
driver</a>. If you're going to download directly from an SRM, you need to
download and install <a href="git://github.com/rclasen/srmio.git">libsrmio</a>.
Neither of these libraries is required if you just want to import data you've
already downloaded with another program.</p>
<big><font face="arial,helvetica,sanserif">
Checking out the code
</font></big>
<p>Once you've downloaded and installed the above dependencies, you need to
check out the GC source code. GC uses <em>git</em> for version control. To
checkout the code, execute this command:</p>
<blockquote>
<pre>
git clone git://github.com/srhea/GoldenCheetah.git
</pre>
</blockquote>
<p>That should create a new directory, <code>GoldenCheetah</code>, in your
current working directory. In the rest of this document, we'll reference
paths relative to that directory. You can find the source code in
<code>GoldenCheetah/src</code>, for instance. Likewise, this
document is in <code>GoldenCheetah/doc/developers-guide.content</code>.<p>
<big><font face="arial,helvetica,sanserif">
Building an executable
</font></big>
<p>To build GC, we currently use <em>qmake</em>, which comes with the Qt
libraries referenced above. All local configuration is stored in the file
<code>gcconfig.pri</code>, which you create by copying
<code>gcconfig.pri.in</code>, both in the <code>GoldenCheetah/src</code>
directory. Additionally, GoldenCheetah uses a patched version of <a
href="http://sourceforge.net/projects/qwt/">Qwt</a> which is located in the
<code>GoldenCheetah/qwt</code> directory. You'll need to copy the
configuration file <code>qwtconfig.pri.in</code> to <code>qwtconfig.pri</code>
and edit that file if needed. The steps you'll take are as follows:</p>
<blockquote>
In the top level GoldenCheetah directory
<pre>
cp src/gcconfig.pri.in src/gcconfig.pri
cp qwt/qwtconfig.pri.in qwt/qwtconfig.pri
vi src/gcconfig.pri # Follow the directions at the top of the file.
vi qwt/qwtconfig.pri # This may not need to be edited to successfully build.
qmake build.pro # called qmake-mac in MacPorts
make
</pre>
</blockquote>
<p>We're aware that a lot of people would rather use a configure-like script
for the build process. We would too, but none of us know
<a href="http://www.gnu.org/software/autoconf/">autoconf</a> well
enough to integrate it with Qt on Mac, Linux, and Windows. If you can help
us out with that, please email the
<a href="cgi-bin/mailman/listinfo/golden-cheetah-users">GoldenCheetah User's
Mailing List</a>.</p>
<big><font face="arial,helvetica,sanserif">
Making changes
</font></big>
<p>Now that you've got GC up and running, you can add whatever features you want.
We generally frown on dogmatic coding conventions, and we're big fans of the
"rough consensus and running code" philosophy. That said, please do your best
to adhere to the following style guidelines:</p>
<ul>
<li>Use spaces instead of tabs.
<li>Do not end lines with whitespace. End every file with a newline.
Otherwise git becomes angry. This command will
highlight any whitespace problems in commit <em>abcd0123</em> in red:
<blockquote>
<pre>
git show --color abcd0123
</pre>
</blockquote>
<li>Avoid "using namespace ..." in header files.
<li>Don't declare global variables in header files. If you must use a global
variable, declare it <code>static</code> within a .cpp file.
<li>Only call C++'s operator <code>new</code> within the constructors and
<code>reset</code> functions of <code>std::auto_ptr</code>,
<code>boost::scoped_pointer</code>, etc. or when passing a parent pointer to a
Qt class (so that the parent deletes the child). Never call
<code>delete</code> explicitly.
<li>Do not use <code>malloc</code> or <code>free</code> unless forced to by an
external C library.
<li>Allocate large buffers on the heap, not on the stack.
<li>When the C++ standard library has an appropriate function, use it.
Likewise for Qt and Boost.
<li>Only use external libraries with GPL-compatible licenses.
<li>Avoid C-style casts. Learn and use C++'s <code>static_cast</code>,
<code>reinterpret_cast</code>, etc.
</ul>
<p>Not all of the GoldenCheetah code follows these guidelines today, but we're
working on it. You can help out by adhering to them in new code.</p>
<hr width="20%"/>
<p>At some point, you'll probably decide that a change you've made is worth
sharing with others. You'll use <em>git</em> again to share your changes, and
the following sections will show you how. A warning: git is pretty hard to
learn, but it's worth it. Once you get used to it, you'll be surprised you
ever put up with another revision control system.</p>
<big><font face="arial,helvetica,sanserif">
Committing changes to git
</font></big>
<p> An example will make this section more concrete. Since my SRM doesn't
record altitude, let's say that I get annoyed that the Ride Summary always
shows "Elevation Gain (feet): 0.0", so I change the code not to show any ride
metric whose value is zero. <em>git-diff</em> shows exactly what I've
changed:</p>
<blockquote>
<pre>
$ cd GoldenCheetah/src
$ git diff
diff --git a/src/RideItem.cpp b/src/RideItem.cpp
index 6971b9b..c368725 100644
--- a/src/RideItem.cpp
+++ b/src/RideItem.cpp
@@ -362,6 +362,8 @@ RideItem::htmlSummary()
assert(displayName.length() &gt; 0);
const RideMetric *m = metrics.value(name);
assert(m);
+ if (m-&gt;value(false) == 0.0)
+ continue;
if (m-&gt;units(metricUnits) == "seconds") {
QString s("&lt;tr&gt;&lt;td&gt;%1:&lt;/td&gt;&lt;td "
"align=\"right\"&gt;%2&lt;/td&gt;&lt;/tr&gt;");
</pre>
</blockquote>
<p>In order to share this change, I need to use <em>git-commit</em>:</p>
<blockquote>
<pre>
$ git commit RideItem.cpp
</pre>
</blockquote>
<p>git will open up an editor for me to type a commit message. It's important
to take the time to write good commit messages, as they form a history of who
has changed which lines of code and for what purpose. The first line of every
commit message should be a short description of 50 characters or less. The
second line should be blank. Subsequent lines should be less than 80
characters long and should describe the change in detail. If your commit
addresses an existing bug or feature please add a tag to the body of your
commit message. Allowable tags are "fixes" which is used to close an
issue and "refs" to reference an issue. For example, adding the text
"fixes #2" will close issue #2. Once I write the file and exit the
editor, <em>git-log</em> will show the result:</p>
<blockquote>
<pre>
$ git log -p -1
commit 30303ef2d11f4bead0860b969b4b74814053b76b
Author: Sean Rhea &lt;sean.c.rhea@gmail.com&gt;
Date: Wed Sep 2 21:04:33 2009 -0400
don't include zero metrics in ride summary
When a device doesn't have altitude, there's no reason to show it. Likewise
with heart rate if the user wasn't wearing a heart rate monitor during a ride.
Maybe in the future this behavior could be enabled on a per-metric basis.
diff --git a/src/RideItem.cpp b/src/RideItem.cpp
index 6971b9b..c368725 100644
--- a/src/RideItem.cpp
+++ b/src/RideItem.cpp
@@ -362,6 +362,8 @@ RideItem::htmlSummary()
assert(displayName.length() &gt; 0);
const RideMetric *m = metrics.value(name);
assert(m);
+ if (m-&gt;value(false) == 0.0)
+ continue;
if (m-&gt;units(metricUnits) == "seconds") {
QString s("&lt;tr&gt;&lt;td&gt;%1:&lt;/td&gt;&lt;td "
"align=\"right\"&gt;%2&lt;/td&gt;&lt;/tr&gt;");
</pre>
</blockquote>
<p>Note that had I changed more than one file, I would have just listed them
all when I ran <em>git-commit</em>. For example,</p>
<blockquote>
<pre>
$ git commit file1.cpp file2.cpp
</pre>
</blockquote>
<p>I can also commit everything I've changed all at once via</p>
<blockquote>
<pre>
$ git commit . # note the 'dot'
</pre>
</blockquote>
<big><font face="arial,helvetica,sanserif">
Managing commits
</font></big>
<p>git works best if you commit early and often. For example, I usually
commit a few times as I'm writing a new feature. Once I get my code to
compile, I commit it again. Then if I fix any bugs that turn up during
runtime, I commit the bug fixes. Then maybe I go back and clean up the new
code, now that I understand the problem better, and I commit those changes,
too.</p>
<p>The reasoning behind all of these commits is that commits are like save
points in a video game. If at any point I decide I'm messing things up,
I can just go back to the previous commit. <em>git-diff</em> shows me my
uncommitted changes. Let's say that I've decided I should also change the
text in the Ride Summary to reflect the fact that I'm only showing non-zero
metrics now. Here's my change:</p>
<blockquote>
<pre>
$ git diff
diff --git a/src/RideItem.cpp b/src/RideItem.cpp
index c368725..2ff9c49 100644
--- a/src/RideItem.cpp
+++ b/src/RideItem.cpp
@@ -159,13 +159,13 @@ static const char *metricsXml =
" precision=\"1\"/&gt;\n"
" &lt;/metric_group&gt;\n"
" &lt;metric_group name=\"Averages\"&gt;\n"
- " &lt;metric name=\"average_speed\" display_name=\"Speed\"\n"
+ " &lt;metric name=\"average_speed\" display_name=\"(Non-zero) Speed\"\n"
" precision=\"1\"/&gt;\n"
- " &lt;metric name=\"average_power\" display_name=\"Power\"\n"
+ " &lt;metric name=\"average_power\" display_name=\"(Non-zero) Power\"\n"
" precision=\"0\"/&gt;\n"
- " &lt;metric name=\"average_hr\" display_name=\"Heart rate\"\n"
+ " &lt;metric name=\"average_hr\" display_name=\"(Non-zero) Heart rate\"\n"
" precision=\"0\"/&gt;\n"
- " &lt;metric name=\"average_cad\" display_name=\"Cadence\"\n"
+ " &lt;metric name=\"average_cad\" display_name=\"(Non-zero) Cadence\"\n"
" precision=\"0\"/&gt;\n"
" &lt;/metric_group&gt;\n"
" &lt;metric_group name=\"BikeScore&#8482;\" note=\"BikeScore is a trademark
</pre>
</blockquote>
<p>But now I decide I don't like that change--I'd rather do it another way.
No problem. <em>git-checkout</em> will restore the previous version committed:</p>
<blockquote>
<pre>
$ git checkout src/RideItem.cpp
</pre>
</blockquote>
<p>If I want to restore the entire directory to the state of the last commit,
I checkout the whole directory:</p>
<blockquote>
<pre>
$ git checkout . # note the 'dot'
</pre>
</blockquote>
<p>Alternatively, if I had already committed this change, I can use
<em>git-reset</em> to throw away my latest commit like this:</p>
<blockquote>
<pre>
$ git reset --hard HEAD^
</pre>
</blockquote>
<p>Be careful with that one, though--it's irreversible.</p>
<big><font face="arial,helvetica,sanserif">
Combining commits
</font></big>
<p>Coming back to our example, let's say I instead decide to change the ride
summary a little differently and commit it:</p>
<blockquote>
<pre>
$ git log -p -1
commit 225f3093a206cbcc296ed1c8a25996ce1968bda6
Author: Sean Rhea <sean.c.rhea@gmail.com>
Date: Sat Sep 5 16:21:33 2009 -0400
include "non-zero" in metric group titles
diff --git a/src/RideItem.cpp b/src/RideItem.cpp
index c368725..449e19e 100644
--- a/src/RideItem.cpp
+++ b/src/RideItem.cpp
@@ -146,7 +146,7 @@ double RideItem::timeInZone(int zone)
static const char *metricsXml =
"&lt;metrics&gt;\n"
- " &lt;metric_group name=\"Totals\"&gt;\n"
+ " &lt;metric_group name=\"Non-zero Totals\"&gt;\n"
" &lt;metric name=\"workout_time\" display_name=\"Workout time\"\n"
" precision=\"0\"/&gt;\n"
" &lt;metric name=\"time_riding\" display_name=\"Time riding\"\n"
@@ -158,7 +158,7 @@ static const char *metricsXml =
" &lt;metric name=\"elevation_gain\" display_name=\"Elevation Gain\"\n"
" precision=\"1\"/&gt;\n"
" &lt;/metric_group&gt;\n"
- " &lt;metric_group name=\"Averages\"&gt;\n"
+ " &lt;metric_group name=\"Non-zero Averages\"&gt;\n"
" &lt;metric name=\"average_speed\" display_name=\"Speed\"\n"
" precision=\"1\"/&gt;\n"
" &lt;metric name=\"average_power\" display_name=\"Power\"\n"
</pre>
</blockquote>
<p>Now I have two commits, which I can see with <em>git-log</em>:</p>
<blockquote>
<pre>
$ git log origin/master..devel-guide
commit 225f3093a206cbcc296ed1c8a25996ce1968bda6
Author: Sean Rhea &lt;sean.c.rhea@gmail.com&gt;
Date: Sat Sep 5 16:21:33 2009 -0400
include "non-zero" in metric group titles
commit df657cd3f0dcb8484a468c2efb04da77ee0472e0
Author: Sean Rhea &lt;sean.c.rhea@gmail.com&gt;
Date: Wed Sep 2 13:42:33 2009 -0400
don't include zero metrics in ride summary
When a device doesn't have altitude, there's no reason to show it. Likewise
with heart rate if the user wasn't wearing a heart rate monitor during a ride.
Maybe in the future this behavior could be enabled on a per-metric basis.
</pre>
</blockquote>
<p>If I'm happy with my changes, I can share them with the world just
like they are using <em>git-format-patch</em>. In this case, however, these
two changes should really be combined into one: the second change was
something I should have done along with the first, I just didn't think of it
at the time. I can use <em>git-rebase -i</em> to combine them:</p>
<blockquote>
<pre>
$ git rebase -i origin/master
</pre>
</blockquote>
<p>That will bring up an editor window with a list of my changes, like
this:</p>
<blockquote>
<pre>
pick df657cd don't include zero metrics in ride summary
pick 225f309 include "non-zero" in metric group titles
# Rebase df33fe2..920643f onto df33fe2
#
# Commands:
# p, pick = use commit
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
#
</pre>
</blockquote>
<p>The directions are pretty self explanatory. You can reorder commits by
reordering their lines in this file. You can drop a commit by removing it
from the file entirely. You can also change the first word on a line from
"pick" to "squash", and git will combine that commit with the one that comes
before it. That's what I want to do here. I change line 2 of this file so
that the first two lines are:</p>
<blockquote>
<pre>
pick df657cd don't include zero metrics in ride summary
squash 225f309 include "non-zero" in metric group titles
</pre>
</blockquote>
<p>Then I write the file and quit the editor. Git does a little work
saying:</p>
<blockquote>
<pre>
Rebasing (1/2)
</pre>
</blockquote>
<p>And then it brings up another editor window that shows both of my commit
messages. I edit the two message to combine them into one, write the file,
and exit the editor. git says:</p>
<blockquote>
<pre>
Successfully rebased and updated refs/heads/master.
</pre>
</blockquote>
<p>And I can see the result with <code>git log -p</code>.</p>
<big><font face="arial,helvetica,sanserif">
Submitting a patch
</font></big>
<p>Okay, <em>now</em> I'm ready to share my change. I'll use
<em>git-format-patch</em>:
<blockquote>
<pre>
$ git format-patch HEAD^
0001-don-t-include-zero-metrics-in-ride-summary.patch
</pre>
</blockquote>
<p>In the <code>GoldenCheetah/src</code> directory I'll now find a <em>patch
file</em>, <code>0001-don-t-include-zero-metrics-in-ride-summary.patch</code>,
that other people can use to include my change in their own local git
repositories.</p>
<p>If you have a patch you'd like to share with others, you can email it to
the <a href="cgi-bin/mailman/listinfo/golden-cheetah-users">GoldenCheetah
User's Mailing List</a>, and it will be considered for inclusion in the next
release of GoldenCheetah. In fact, if you join the mailing list, you'll see
lots of patches like this. You may even want to try some of them.</p>
<big><font face="arial,helvetica,sanserif">
Applying patches
</font></big>
<p>Let's say I email the patch above to the mailing list, and it sounds like a
useful feature to you. To test it yourself, you can download the patch file
to your <code>GoldenCheetah/src</code> directory and apply it to your
repository using <em>git-am</em>:</p>
<blockquote>
<pre>
$ git am 0001-don-t-include-zero-metrics-in-ride-summary.patch
Applying: don't include zero metrics in ride summary
</pre>
</blockquote>
<p>If you now type, "git log", you'll see that "don't include zero metrics in
ride summary" has been added to your repository.</p>
<p>If enough people like a patch, and it doesn't introduce any new bugs, one
of the GoldenCheetah maintainers will probably commit it to the official GC
repository on github.</p>
<big><font face="arial,helvetica,sanserif">
Staying up to date
</font></big>
<p>In order to keep your local repository up to date with
the official one, you use <em>git-fetch</em> followed by
<em>git-rebase</em>:</p>
<blockquote>
<pre>
$ git fetch origin
$ git rebase origin/master
First, rewinding head to replay your work on top of it...
Fast-forwarded master to origin/master.
</pre>
</blockquote>
<p>Note that, unlike above, we didn't supply a "-i" option to
<em>git-rebase</em> this time.</p>
<p><em>git-fetch</em> downloads a copy of all the patches at github to
your local repository, but it doesn't apply them. <em>git-rebase</em> undoes
the changes that are unique to your local repository, applies any new patches
from <code>origin/master</code>, and then re-applies your patches.</p>
<p>If you have uncommitted changes, the rebase will fail:</p>
<blockquote>
<pre>
$ git rebase origin/master
src/RideItem.cpp: needs update
cannot rebase: you have unstaged changes
</pre>
</blockquote>
<p>Commit your changes with <em>git-commit</em> and then re-run the
<em>git-rebase</em>. It will work this time.</p>
<p>For developers who are used to subversion, this need to commit changes
before rebasing is the most annoying aspect of git. All I can say is that you
won't mind it much after time. Because you can use "git rebase -i" to
combine, reorder, and even drop commits, a commit in git is much lighter
weight than one in subversion. As I said above, commit early and often.</p>
<p>If the changes from github conflict with yours, you'll have to merge.
<em>git-rebase</em> will exit with an error and a list of directions on how to
fix things. Read them carefully.</p>

View File

@@ -1,7 +1,14 @@
<!-- $Id: download.content,v 1.6 2006/08/11 20:21:03 srhea Exp $ -->
<!-- $Id: download.content,v 1.6 2009/01/09 20:45:03 rcarlsen Exp $ -->
Right now Golden Cheetah is available as source code and in binary form for
Mac OS X on PowerPC processors.
<p>
Golden Cheetah is available as source code and in binary form for
Mac OS X Universal Binary, Linux on x86 processors and Windows 32-bit.
</p>
<p>
Depending on your operating system, you may need to install the <a
href="http://www.ftdichip.com/Drivers/D2XX.htm">FTDI USB
driver</a> if you're using the PowerTap's new USB download cradle. The FTDI USB drivers are an optional install if you do not plan on downloading from your device using Golden Cheetah.
</p>
<p>
<font face="arial,helvetica,sanserif">
@@ -9,16 +16,10 @@ Mac OS X on PowerPC processors.
</font>
<p>
The Golden Cheetah source code is available via
<a href="http://subversion.tigris.org/">Subversion</a>.
Use this command to check out the current version of the repository:
<pre>
svn checkout http://goldencheetah.org/svn/trunk goldencheetah
</pre>
You can also browse the source <a
href="http://goldencheetah.org/svn/trunk">here</a>.
The Golden Cheetah source code is available via git. See the
<a href="developers-guide.html">Developer's Guide</a> for more information.
You can also <a href="http://github.com/srhea/GoldenCheetah/tree/master/">browse
the source on github</a>.
<p>
<font face="arial,helvetica,sanserif">
@@ -27,13 +28,208 @@ href="http://goldencheetah.org/svn/trunk">here</a>.
<p>
<center>
<table width="100%">
<table width="100%" cellspacing="5">
<tr>
<td width="20%"><i>Date</i></td>
<td width="30%"><i>File</i></td>
<td width="15%"><i>Version</i></td>
<td width="25%"><i>Files</i></td>
<td><i>Description</i></td>
</tr>
<tr>
<td valign="top">1.2.0</td>
<td valign="top">
<a href="GoldenCheetah_1.2.0_Linux_x86.tgz">Linux x86</a><br>
<a href="GoldenCheetah_1.2.0_Linux_x86_64.tgz">Linux x86_64</a><br>
<a href="GoldenCheetah_1.2.0_Darwin_Universal.dmg">Mac OS X Universal</a><br>
<a href="GoldenCheetah_1.2.0_Windows_Installer.exe">Windows 32-bit</a>
</td>
<td valign="top">
<p>
Lots of new features in this release, including:
</p>
<ul>
<li>Direct download from SRM (R. Clasen and S. Rhea)
<li>WKO+ file import (M. Liversedge)
<li>Qollector support (M. Rages)
<li>Altitude plotting (T. Weichmann)
<li>Manual ride entry (E. Murray)
<li>Power zones shading (D. Connell)
<li>Weekly summary histograms (R. Carlsen)
<li>Automatic CP estimation from CP graph (D. Connell)
<li>Support for running off a USB stick (J. Knotzke)
<li>OS-specific directory layout (J. Simioni)
<li>PF/PV plot improvements (B. de Schouwer)
<li>Memory leak fixes (G. Lonnon)
</ul>
<p>Thanks also to Jamie Kimberley for extensive testing.
</td>
</tr>
<tr>
<td valign="top">1.1.325</td>
<td valign="top">
<a href="GoldenCheetah_1.1.325_Linux_x86.gz">Linux x86</a><br>
<a href="GoldenCheetah_1.1.325_Linux_x86_64.gz">Linux x86_64</a><br>
<a href="GoldenCheetah_1.1.325_Darwin_Universal.dmg">Mac OS X Universal</a><br>
<a href="GoldenCheetah_1.1.325_Windows_Installer.exe">Windows 32-bit</a>
</td>
<td valign="top">
<p>
First official Windows release courtesy of Ned Harding. Ned put much effort into the port to make the download reliable and created a nice installer, too (Thanks Ned!). He also provided the long-awaited Split Ride feature - break up a ride file into separate rides easily using long time gaps and intervals.
<ul>
<li>Ant+Sport PowerTap support.
<li>Split Rides by time gaps or intervals.
<li>Delete ride from list.
<li>Use distance or time for x-axis in Ride Plot (Thanks Damain).
<li>Numerous bug fixes (Thanks Tom, Dan).
</p>
</td>
</tr>
<tr>
<td valign="top">1.0.277</td>
<td valign="top">
<a href="GoldenCheetah_1.0.277_Linux_x86.gz">Linux x86</a>,<br>
<a href="GoldenCheetah_1.0.277_Linux_x86_64.tar.gz">Linux x86_64</a>,<br>
<a href="GoldenCheetah_1.0.277_Darwin_Universal.dmg">Mac OS X Universal</a>
</td>
<td valign="top">
<p>*Note: Beginning with this release we are changing to a numbered versioning system. Minor point releases will generally indicate builds with new features, while bugfix releases will increment the final number, which represents the svn revision*</p>
<p>Several new features in this release: Critical Power calculator, find best intervals utility, Pedal Force / Pedal Velocity chart, iBike and Ergomo CSV import, GUI power zones creator, separate vertical axes for Power / HR / Cadence and Speed in the Ride plot, sorting rides with the most recent at the top of the list, and many bug fixes courtesy of JT Conklin.
</p>
<p>You may need to install <a href="http://www.ftdichip.com/Drivers/D2XX.htm">USB drivers</a> from FTDI.
</p>
<p>
For posterity, the <a href="http://robertcarlsen.net/blog/?page_id=49">beta version</a> for Windows, based on r295.
</p>
</td>
</tr>
<tr>
<td valign="top">Mar 10, 2008</td>
<td valign="top">
<a href="GoldenCheetah_2008-03-10_Linux_x86.tgz">Linux x86</a>,<br>
<a href="GoldenCheetah_2008-03-10_Darwin_Universal.dmg">Mac OS X Universal</a>
</td>
<td valign="top">
This release introduces <a href="http://www.physfarm.com/Analysis%20of%20Power%20Output%20and%20Training%20Stress%20in%20Cyclists-%20BikeScore.pdf">BikeScore&#8482;</a>,
a metric of training stress developed by Dr. Philip Skiba. It also
fixes several small bugs in earlier releases.
</td>
</tr>
<tr>
<td valign="top">Sep 23, 2007</td>
<td valign="top">
<a href="GoldenCheetah_2007-09-23_Linux_x86.tgz">Linux x86</a>,<br>
<a href="GoldenCheetah_2007-09-23_Darwin_i386.dmg">Mac OS X x86</a>,<br>
<a href="GoldenCheetah_2007-09-23_Darwin_powerpc.dmg">Mac OS X PowerPC</a>
</td>
<td valign="top">
Bug fix release. CVS imports weren't quite working in the last one.
</td>
</tr>
<tr>
<td valign="top">Sep 18, 2007</td>
<td valign="top">
<a href="GoldenCheetah_2007-09-18_Linux_x86.tgz">Linux x86</a>,<br>
<a href="GoldenCheetah_2007-09-18_Darwin_powerpc.dmg">Mac OS X PowerPC</a>
</td>
<td valign="top">
This release adds two small, but excellent features from Justin Knotzke:
CSV file imports and visual interval markers in the ride plot.
</td>
</tr>
<tr>
<td valign="top">Aug 7, 2007</td>
<td valign="top">
<a href="GoldenCheetah_2007-08-07_Linux_x86.tgz">Linux x86</a>,<br>
<a href="GoldenCheetah_2007-08-07_Darwin_powerpc.dmg">Mac OS X PowerPC</a>
</td>
<td valign="top">This release fixes a bug in the critical power
intervals graph where you could get bad data if you started an interval
after a long period of not moving. It also adds really basic zooming to
the ride plot: use the left mouse button to zoom in and the right one to
return to the previous zoom state. It's pretty crappy right now, but
it's better than nothing.
</td>
</tr>
<tr>
<td valign="top">Apr 26, 2007</td>
<td valign="top">
<a href="GoldenCheetah_2007-04-26_Linux_x86.tgz">Linux x86</a>,<br>
<a href="GoldenCheetah_2007-04-26_Darwin_powerpc.dmg">Mac OS X PowerPC</a>
</td>
<td valign="top">This release fixes some bugs and adds a whole bunch of
new features:
<ul>
<li>Now imports .srm files (direct download from SRM hopefully coming
soon)
<li>New "Weekly Summary" tab shows total weekly hours, miles, and work
<li>Power zones can now be entered into a text file, after which GC will
display time in each zone in the ride and weekly summaries; for more
information on the zone file format, <a href="zones.html">see this
page</a>.
</ul>
</td>
</tr>
<tr>
<td valign="top">Apr 1, 2007</td>
<td valign="top">
<a href="GoldenCheetah_2007-04-01_Linux_x86.tgz">Linux x86</a>,<br>
<a href="GoldenCheetah_2007-04-01_Darwin_powerpc.dmg">Mac OS X PowerPC</a>
</td>
<td valign="top">This release fixes a bug that was introduced with the
hardware echo detection code. If you're using the CycleOps-supplied USB
cable to download from your PowerTap unit, this release should make
downloads more reliable. (Those using the KeySpan USB-to-serial adaptor
or a plain-old serial port shouldn't see any difference.)</td>
</tr>
<tr>
<td valign="top">Feb 22, 2007</td>
<td valign="top">
<a href="GoldenCheetah_2007-02-22_Linux_x86.tgz">Linux x86</a>,<br>
<a href="GoldenCheetah_2007-02-22_Darwin_powerpc.dmg">Mac OS X PowerPC</a>
</td>
<td valign="top">Clicking on the Critical Power Plot now displays the
interval duration, maximum power for that ride, and maximum power for all
rides below the plot. Also fixes a bug for recording intervals longer than
two seconds.</td>
</tr>
<tr>
<td valign="top">Feb 12, 2007</td>
<td valign="top">
<a href="GoldenCheetah_2007-02-12_Linux_x86.tgz">Linux x86</a>,<br>
<a href="GoldenCheetah_2007-02-12_Darwin_powerpc.dmg">Mac OS X PowerPC</a>
</td>
<td valign="top">Interval information now included in ride summary, rides can
now be exported as comma-separated values for import into Excel, and better
automatic detection of hardware echo. Also includes a number of bux
fixes.</td>
</tr>
<tr>
<td valign="top">Jan 30, 2007</td>
<td valign="top">
<a href="GoldenCheetah_2007-01-30_Linux_x86.tgz">Linux x86</a>,<br>
<a href="GoldenCheetah_2007-01-30_Darwin_powerpc.dmg">Mac OS X PowerPC</a>
</td>
<td valign="top">Bug fix release.</td>
</tr>
<tr>
<td valign="top">Jan 6, 2007</td>
<td valign="top"><a href="GoldenCheetah_2007-01-06_Linux_x86.tgz">Linux
x86</a></td>
<td valign="top">First release for Linux.</td>
</tr>
<tr>
<td valign="top">Dec 25, 2006</td>
<td valign="top"><a href="GoldenCheetah_2006-12-25_Darwin_powerpc.dmg">Mac OS
@@ -84,7 +280,7 @@ These are the older, source-only, command-line distributions. I've left them
up for historical purposes only; I don't recommend using them.
<center>
<table width="100%">
<table width="100%" cellspacing="10">
<tr>
<td width="20%"><i>Date</i></td>
<td width="30%"><i>File</i></td>

View File

@@ -1,11 +1,25 @@
<!-- $Id: faq.content,v 1.4 2006/07/05 16:59:56 srhea Exp $ -->
<p>
<i>I downloaded a .dmg, opened it, dragged and dropped GoldenCheetah into
Applications, double-clicked on it, and nothing happened. What gives?</i>
<b><i>GoldenCheetah doesn't find my PowerTap on Ubuntu Linux.</i></b>
<p>
If you're using the USB cradle (as opposed to the older, serial one),
the FTDI driver sometimes conflicts with the braille terminal in the
default Ubuntu installation. Try unplugging the PT cradle from the
computer and uninstalling <code>brltty</code>:
<blockquote>
<code>sudo apt-get remove brltty</code>
</blockquote>
Then plug the device back in and it should work.
<p>
Are you running OS X Tiger? You need to be. If you are, and you're still
<b><i>I downloaded a .dmg, opened it, dragged and dropped GoldenCheetah into
Applications, double-clicked on it, and nothing happened. What
gives?</i></b>
<p>
Are you running OS X Tiger (10.4) or later? You need to be.
If you are, and you're still
having this problem, open Terminal (in Applications -&gt; Utilities) and type
this at the prompt:
@@ -16,50 +30,3 @@ this at the prompt:
then press &lt;return&gt; and send an email to the mailing list with
whatever it prints out. We'll help you debug it.
<p>
<i>I've downloaded and unpacked the data. Now what do I do with it?</i>
<p>
We highly recommend that you buy and read both Joe Friel's <i>The
Cyclist's Training Bible</i> and Allen and Coggan's <i>Training and
Racing with a Power Meter</i>. The former is the definitive book about all
aspects of cycling training (although we think he's off his rocker in the
chapter about diet), and the latter is the definitive book about power-based
training.
<p>
Also, if you buy either of these books through the links below, we'll get a
referral fee in return, helping us to support this web site. Thanks!
<center>
<iframe
src="http://rcm.amazon.com/e/cm?t=goldencheetah-20&o=1&p=8&l=as1&asins=B0006JHZ7Q&fc1=000000&IS2=1&lt1=_blank&lc1=0000ff&bc1=000000&bg1=ffffff&f=ifr"
style="width:120px;height:240px;" scrolling="no" marginwidth="0"
marginheight="0" frameborder="0"></iframe>
<iframe
src="http://rcm.amazon.com/e/cm?t=goldencheetah-20&o=1&p=8&l=as1&asins=1931382794&fc1=000000&IS2=1&lt1=_blank&lc1=0000ff&bc1=000000&bg1=ffffff&f=ifr"
style="width:120px;height:240px;" scrolling="no" marginwidth="0"
marginheight="0" frameborder="0"></iframe>
</center>
<p>
<i>Does the output of <code>ptunpk</code> exactly match that of the software
included with the PowerTap?</i>
<p>
Almost. If you run it in compatibility mode, using the <code>-c</code>
option, it matches the PowerTap software's output exactly on everything but
the time values, at least for the five sample rides we've tried it with.
The times are a little off, but not by more than 0.1%, so we don't consider it
a big deal.
<p>
That said, the PowerTap software does some weird things, like converting from
kilometers to miles by multiplying by 0.62, but then reporting the miles
values with five digits after the decimal place. If you run
<code>ptunpk</code> without the <code>-c</code> option, it will unpack the
data in the way we think it should. The results mostly match up with the
official ones, and are almost certainly identical within the range of accuracy
of the device.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -16,7 +16,7 @@ open (FILE, "$content_file") or die "Could not open $content_file";
print<<EOF;
<!--
Copyright (c) 2006 Sean C. Rhea (srhea\@srhea.net)
Copyright (c) 2006-2008 Sean C. Rhea (srhea\@srhea.net)
All rights reserved.
This file was automatically generated by genpage.pl. To change it,
@@ -26,16 +26,25 @@ print<<EOF;
<html>
<head>
<title>Golden Cheetah: PowerTap Software for Mac OS X</title>
<meta name="keywords" content="powertap mac cycling performance">
<title>Golden Cheetah: Cycling Performance Software for Linux, Mac OS X, and Windows</title>
<meta name="keywords" content="powertap srm linux mac cycling performance">
<style type='text/css'>
li {
margin: .5em 0
}
body {
color: #000000;
background: #ffffff;
}
:link {
color: #5e431b;
}
:visited {
color: #996e2d;
}
</style>
</head>
<body text="#000000"
link="#5e431b"
vlink="#996e2d"
alink="#000000"
bgcolor="#ffffff">
<table width="95%" border="0" width="100%" cellspacing="10">
<tr>
@@ -47,30 +56,15 @@ print<<EOF;
<p> <b><a href="index.html">Introduction</a></b>
<br> <b><a href="screenshots.html">Screenshots</a>
<br> <b><a href="users-guide.html">User's Guide</a>
<br> <b><a href="developers-guide.html">Developer's Guide</a>
<br> <b><a href="faq.html">FAQ</a>
<br> <b><a href="wishlist.html">Wish List</a>
<br> <b><a href="license.html">License</a></b>
<br> <b><a href="download.html">Download</a></b>
<br> <b><a href="contrib.html">Contributors</a></b>
<br> <b><a href="search.html">Search</a></b>
<br> <b><a href="cgi-bin/mailman/listinfo/golden-cheetah-users">Mailing List</a></b>
<p>
<script type="text/javascript"><!--
google_ad_client = "pub-2993461533095312";
google_ad_width = 120;
google_ad_height = 240;
google_ad_format = "120x240_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "5E431B";
google_color_url = "996E2D";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br> <b><a href="mailing-list.html">Mailing List</a></b>
<br> <b><a href="bug-tracker.html">Bug Tracker</a></b>
</center>
</td>
@@ -87,7 +81,7 @@ google_color_text = "000000";
Cheetah</font></b></big></big></big>
<br>
<big><font face="arial,helvetica,sanserif">
PowerTap Software for Mac OS X
Cycling Performance Software for Linux, Mac OS X, and Windows
</font></big>
<p>
</td></tr>
@@ -114,9 +108,9 @@ while (<FILE>) {
}
close (FILE);
if (defined $last_mod) {
print "<p><hr><em>Last modified $last_mod.</em>\n";
}
#if (defined $last_mod) {
# print "<p><hr><em>Last modified $last_mod.</em>\n";
#}
print<<EOF;

BIN
doc/histogram-analysis.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

View File

@@ -1,26 +1,46 @@
<!-- $Id: index.content,v 1.1 2006/05/16 14:24:50 srhea Exp $ -->
<p>
The goal of the Golden Cheetah project is to develop a software package that:
<center>
<em>To all those volunteers who selflessly give their time and without whom
amateur sport would not exist.</em>
<br>
-- Graeme Obree, in the dedication of <em>Flying Scotsman</em>
</center>
<p>
GoldenCheetah is a software package that:
<ul>
<li>Downloads ride data from power measurement devices, such as the <a
href="http://www.cycleops.com/products/powertap.htm">CycleOps PowerTap</a>,
the <a href="http://www.ergomo.net/Home-_14.html">ergomo</a>, the <a
href="http://www.polarusa.com/consumer/powerkit/default.asp">Polar
Electro</a>, and the <a href="http://www.srm.de/usa/index.html">SRM Training
System</a><p>
<li>Helps athletes analyze downloaded data with features akin to commercial
power analysis software, such as <a href="http://cyclingpeaks.com/">Cycling
Peaks</a><p>
<li>Works on non-Microsoft Windows-based systems, such as FreeBSD, Linux, and
Mac OS X<p>
<li>Is available under an
<a href="http://www.opensource.org/docs/definition.php">Open Source</a>
license
<li>Downloads ride data directly from the CycleOps PowerTap and the SRM
PowerControl.<p>
<li>Imports ride data downloaded with other programs, including TrainingPeaks
WKO+ and the manufacturers' software for the Ergomo, Garmin, Polar, PowerTap,
and SRM devices.<p>
<li>Provides a rich set of analysis tools, including a critical power graph,
BikeScore calculation, histogram analysis, a best interval finder, and a pedal
force versus pedal velocity chart, to name just a few.<p>
<li>Is available for Linux, Mac OS X, and Windows. (The Windows version
does not yet support direct downloads from the SRM PowerControl.)<p>
<li>Is released under an Open Source license.
</ul>
<p>
In short, we believe that cyclists should be able to download their power data
We believe that cyclists should be able to download their power data
to the computer of their choice, analyze it in whatever way they see fit, and
share their methods of analysis with others.
<hr width="20%"/>
<small>
<p>
* WKO+ and TrainingPeaks are trademarks of Peaksware, LLC.
<br/>
** BikeScore is a trademark of Dr. Philip Friere Skiba, PhysFarm Training
Systems LLC.
</p>
</small>

17
doc/mailing-list.content Normal file
View File

@@ -0,0 +1,17 @@
<p>
There are two mailing lists for the Golden Cheetah project:
<p><a href="http://groups.google.com/group/golden-cheetah-users">Golden
Cheetah Users</a> is a list for submitting bug reports, feature requests, and
constructive criticism. It's a good place to search if you have a question
that someone might have already answered. It's also where we discuss new
features, plans, etc. On busy days there may be as many as 20 emails sent to
Golden Cheetah Users.
<p><a href="http://groups.google.com/group/golden-cheetah-announce">Golden
Cheetah Announce</a> is a lower volume, moderated list where we post
announcements of new releases, important bug fixes, etc. If you don't want to
get a lot of email, but you do want to know when we put out a new release,
this is the list for you. It receives one or two emails per month.

BIN
doc/main-window.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

View File

@@ -1,5 +1,6 @@
#!/bin/sh
# $Id: mkdmg.sh,v 1.2 2006/09/06 23:23:03 srhea Exp $
export PATH=/usr/local/Trolltech/Qt-4.1.1-static/bin:$PATH
VERS=`date +'%Y-%m-%d'`
OS=`uname -s`
CPU=`uname -p`
@@ -7,22 +8,24 @@ SUFFIX="$VERS"_"$OS"_"$CPU"
rm -rf tmp
mkdir tmp
cd tmp
svn checkout svn+ssh://goldencheetah.org/home/srhea/svnroot/goldencheetah/trunk goldencheetah
svn checkout svn+ssh://goldencheetah.org/home/srhea/svnroot/goldencheetah/trunk/src goldencheetah
cd goldencheetah
qmake
make
mv src/gui/GoldenCheetah.app ..
make clean
rm doc/gc_*.tgz
rm doc/GoldenCheetah_*.dmg
mv gui/GoldenCheetah.app ..
#make clean
#rm doc/gc_*.tgz
#rm doc/GoldenCheetah_*.dmg
#rm doc/GoldenCheetah_*.tgz
cd ..
strip GoldenCheetah.app/Contents/MacOS/GoldenCheetah
find . -name .svn | xargs rm -rf
tar czvf src.tgz goldencheetah
rm -rf goldencheetah
SIZE=`du -csk * | grep total | awk '{printf "%.0fm", $1/1024+5}'`
strip GoldenCheetah.app/Contents/MacOS/GoldenCheetah
#find . -name .svn | xargs rm -rf
#tar czvf src.tgz goldencheetah
SIZE=`du -csk GoldenCheetah.app | grep total | awk '{printf "%.0fm", $1/1024+5}'`
hdiutil create -size $SIZE -fs HFS+ -volname "Golden Cheetah $VERS" tmp.dmg
hdiutil attach tmp.dmg
cp -R GoldenCheetah.app src.tgz /Volumes/Golden\ Cheetah\ $VERS/
cp -R GoldenCheetah.app /Volumes/Golden\ Cheetah\ $VERS/
hdiutil detach /Volumes/Golden\ Cheetah\ $VERS/
hdiutil convert tmp.dmg -format UDZO -o GoldenCheetah_$SUFFIX.dmg
hdiutil internet-enable -yes GoldenCheetah_$SUFFIX.dmg

BIN
doc/pf-pv-plot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

27
doc/power.zones Normal file
View File

@@ -0,0 +1,27 @@
From BEGIN until 2006/07/17, CP=297:
1, Active Recovery, 122, 167
2, Endurance, 167, 228
3, Tempo, 228, 274
4, Lactate Threshold, 274, 319
5, VO2 Max, 319, 365
6, Anaerobic Capacity, 365, 678
7, Sprinting, 678, MAX
From 2006/07/17 until 2007/02/05, CP=329:
1, Active Recovery, 135, 185
2, Endurance, 185, 253
3, Tempo, 253, 303
4, Lactate Threshold, 303, 354
5, VO2 Max, 354, 404
6, Anaerobic Capacity, 404, 752
7, Sprinting, 752, MAX
From 2007/02/05 until END, CP=347:
1, Active Recovery, 139, 191
2, Endurance, 191, 260
3, Tempo, 260, 312
4, Lactate Threshold, 312, 364
5, VO2 Max, 364, 416
6, Anaerobic Capacity, 416, 774
7, Sprinting, 774, MAX

BIN
doc/ride-plot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

BIN
doc/ride-summary.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

View File

@@ -3,32 +3,47 @@
<p>
<center>
<p>
<big><font face="arial,helvetica,sanserif">
The Ride Summary
Ride Summary
</font></big>
<p>
<img src="screenshot-summary.png" alt="Ride Summary Screen" align="center">
<img src="ride-summary.png" alt="Ride Summary Screen" align="center">
<p>
<big><font face="arial,helvetica,sanserif">
The Power, Heart Rate, Speed, and Cadence Plot
Plotting Altitude, Cadence, Heart Rate, Power, and Speed
</font></big>
<p>
<img src="screenshot-plot.png" alt="Power and HR Plot" align="center">
<img src="ride-plot.png" alt="Power and HR Plot" align="center">
<p>
<big><font face="arial,helvetica,sanserif">
The Critical Power Plot
Plotting Critical Power
</font></big>
<p>
<img src="screenshot-cpint.png" alt="The Critical Power Plot" align="center">
<img src="critical-power-plot.png" alt="The Critical Power Plot" align="center">
<p>
<big><font face="arial,helvetica,sanserif">
The Power Histogram
Histogram Analysis
</font></big>
<p>
<img src="screenshot-phist.png" alt="The Power Histogram" align="center">
<img src="histogram-analysis.png" alt="The Power Histogram" align="center">
<p>
<big><font face="arial,helvetica,sanserif">
Plotting Pedal Force Versus Pedal Velocity
</font></big>
<p>
<img src="pf-pv-plot.png" alt="The Power Histogram" align="center">
<p>
<big><font face="arial,helvetica,sanserif">
The Weekly Summary
</font></big>
<p>
<img src="weekly-summary.png" alt="The Weekly Summary" align="center">
</center>

View File

@@ -1,241 +1,315 @@
<!-- $Id: users-guide.content,v 1.5 2006/05/27 16:32:46 srhea Exp $ -->
<big><font face="arial,helvetica,sanserif">
Using the GUI
Step 1: Installing the FTDI drivers
</font></big>
<p>
Using the graphical version of Golden Cheetah should be pretty
self-explanatory. Download the disk image from the <a
href="download.html">download page</a>, drag the Golden Cheetah application
into your Applications folder, open your Applications folder, and then double
click on Golden Cheetah.
Depending on your operating system, you may need to install the <a
href="http://www.ftdichip.com/Drivers/D2XX.htm">FTDI USB
driver</a> if you're using the PowerTap's new USB download cradle. The FTDI USB drivers are an optional install if you do not plan on downloading from your device using Golden Cheetah.
(Note: version 1.7 of the FTDI drivers for Mac seems to be buggy. Until they
post a patched version, you can download version 1.6
<a href="http://bugs.goldencheetah.org/attachments/download/1/Universal_D2XX0.1.6.dmg">here</a>.)
</p>
<p>
If you're running Linux, you may also need to uninstall the <code>brtty</code>
(Braille TTY) application, as it interferes with FTDI's driver. The command
<pre>
sudo apt-get remove brtty
</pre>
should do the trick on Debian/Ubuntu.
<p>
The latest version (7.1.1) of Saris's PowerAgent software uses an incompatible
version of FTDI's driver from the one GoldenCheetah uses, and PowerAgent
removes the driver that GoldenCheetah needs when you install PowerAgent. If
you want to run both GoldenCheetah and PowerAgent, you need to use PowerAgent
version 7.0.1 or earlier. We're working to correct this problem, but we're
not there yet.
<p>
<big><font face="arial,helvetica,sanserif">
Using the Command Line Utilities
Step 2: Installing GoldenCheetah
</font></big>
<p>
In addition to the GUI, Golden Cheetah comes with
several command line utilities:
<code>ptdl</code>, which downloads ride data from a PowerTap Pro version 2.21
cycling computer, <code>ptunpk</code>, which unpacks the raw bytes downloaded
by <code>ptdl</code> and outputs more human-friendly ride information, and
<code>cpint</code>, which computes your critical power (see below). All three
are written in simple C code but have only been tested on Mac OS X so far.
We've also written several Perl scripts to help you graph and summarize the
data.
To install GoldenCheetah, go to <a href="download.html">the download page</a>
and download the version for your operating system and processor.
<p>
On Mac OS X, when the download finishes, Mac OS X should automatically open
the <code>.dmg</code> file for you. If not, double-click to open it. Drag
the GoldenCheetah icon into your Applications folder, and you're done.
<p>
The Linux version of GoldenCheetah is distributed as a tarball. Download this
file and save it to <code>/tmp</code>, then from a terminal:
<pre>
cd /tmp
tar xzvf GoldenCheetah_DATE_Linux_x86.tgz
cd GoldenCheetah_DATE_Linux_x86
sudo cp GoldenCheetah /usr/local/bin
cd ..
rm -rf GoldenCheetah_DATE_Linux_x86.tgz
</pre>
Be sure to replace "DATE" with the date of the revision you downloaded, such
as "2007-09-23".
<p>
<big><font face="arial,helvetica,sanserif">
Extracting the Data
Step 3: Running GoldenCheetah
</font></big>
<p>
To use <code>ptdl</code>, you'll first need to install
<a href="http://www.ftdichip.com/Drivers/VCP.htm">the drivers</a> for the
FTDI chip the PowerTap Pro USB Downloader uses. Once these are installed, you
should be able to just run <code>ptdl</code> without arguments:
<pre>
$ ./ptdl
Reading from /dev/tty.usbserial-3B1.
Reading version information...done.
Reading ride time...done.
Writing to 2006_05_15_11_34_03.raw.
Reading ride data..............done.
$ head -5 2006_05_15_11_34_03.raw
57 56 55 64 02 15
60 06 05 0f 6b 22
40 08 30 00 00 00
86 0e 74 99 00 55
81 06 77 a8 40 55
</pre>
<p>
If everything goes well, <code>ptdl</code> will automatically detect the
device (<code>/dev/tty.usbserial-3B1</code> in the example above), read the
ride data from it, and write to a file named by the date and time at which the
ride started (<code>2006_05_15_11_34_03.raw</code> in the example; the format
is YYYY_MM_DD_hh_mm_ss.raw).
To run GoldenCheetah on Mac OS X, double-click on the GoldenCheetah icon in
your Applications folder. On Linux, just type "GoldenCheetah" at the prompt.
<p>
The first time you run GoldenCheetah, you'll get an empty "Choose a Cyclist"
dialog box:
<p>
<center><img src="choose-a-cyclist.png"></center>
<p>
Click on "New...", enter your name and click "OK", then select your name and
click "Open". After that, the main GoldenCheetah window will open:
<p>
<center><img src="main-window.png"></center>
<p>
Your main window won't yet have any rides in it, of course. To fix that, you
need either to download a ride from your PowerTap or import one from another
program. GoldenCheetah can import <code>.srm</code> files recorded on SRM
power meters and <code>.csv</code> files created by other programs. To
download a file from your PowerTap, select "Ride->Download from device..."
from the menu. To import one, select either "Ride->Import from SRM..." or
"Ride->Import from CSV...".
<p>
Once you've downloaded or imported a ride, you can see some simple statistics
about it on the "Ride Summary" page: your total riding time and average power,
for example. If you click on the "Ride Plot" tab at the top of the screen,
you can see a graph of your speed, power, cadence, and heart rate during the
ride. The "Power Histogram" shows how much time you spent at each power
during the ride, and the "Notes" tab allows you to record notes about the
ride. The "Weekly Summary" shows your total time and work for the week.
<p>
The "Critical Power Plot" is one of the most useful features of GoldenCheetah.
It shows the highest average power you attained for every interval length
during the ride. Some people call this the "Mean Maximal Power" graph. The
green line shows values for this ride; the red line shows the combination of
all your rides. (If you only have one ride so far, the two lines will
overlap.) Clicking on the graph with your mouse brings up a blue line, and
the values under this line are shown at the bottom of the screen.
<p>
It helps to think about an example:
<p>
<center><img src="critical-power.png"></center>
<p>
In this example, the blue line is right around the 14-second mark on the
x-axis. So the values shown under "Today" and "All Rides", at the bottom, are
the hardest the cyclist went for any 14-second period during the ride itself
and during all rides he's ever recorded in GoldenCheetah. Since the two
values are the same, he set a new personal record during this ride.
<p>
The Critical Power Plot is most useful before you're going to go do intervals
or a time trial. Say you want to do six 2-minute intervals with three minutes
rest in between. Click on the Critical Power Plot, drag the blue line to the
2-minute mark, and read the value shown in "All Rides". That's the hardest
you've ever gone for two minutes. Now go out and try to beat it!
<p>
<big><font face="arial,helvetica,sanserif">
Unpacking the Data
Step 4: Setting Up Your Power Zones
</font></big>
<p>As shown by the <code>head</code> command above, the data in this
<code>.raw</code> file is just the raw bytes that represent your ride. To
unpack those bytes and display them in a more human-friendly format, use
<code>ptunpk</code>:
<p>
If you look back at the screenshot above, you may notice that there are
several things shown in the "Ride Summary" tab that aren't on your version.
The picture above shows a non-zero "Bike Score", and there's a list of how
much time the cyclist spent in each "Power Zone" during the ride as well.
<p>
BikeScore(TM) is a measure of the physiological stress you underwent during a
ride. It was developed by Dr. Philip Skiba, and you can read more about it in
<a href="http://www.physfarm.com/Analysis%20of%20Power%20Output%20and%20Training%20Stress%20in%20Cyclists-%20BikeScore.pdf">an article he wrote</a>.
<p>
For GoldenCheetah to compute your BikeScore and the time spent in each power
zone, you first need to tell it what your power zones and critical power
are. You can define your power zones however you like, maybe using the ones
defined by Joe Friel, for example. Your critical power should be the
maximum power you can sustain over an hour. Some people call this your
"lactate threshold" or "functional threshold power". Our friend Bill says a
rose by any other name would smell as sweet.
<p>
There are currently three ways to set up your power zones. Each method has
its benefits, so feel free to select the method that best suits your needs.
<p><b>Method 1: Set via critical power plot.</b>
<p> GoldenCheetah can determine a value for your CP value based on all
of the data in your critical power plot. The calculated value of CP can
be used to create a new range in your power.zones file by clicking the
"save CP value" button in the lower right corner of the critical power
plot tab. The new range will use the default zone definitions (see Method 2).
Once the new range is set, you can manually edit the file to change the zone
definitions as in Method 3.
<p>
<b>Method 2: User preferences.</b>
<p>
From the menu bar select GoldenCheetah->Preferences, then click on
"cyclist info". The window should look like this:
<p>
<center><img src="cyclist-info.png"></center>
<p>
Enter a value for critical power at the top of the dialog and click save
to set your CP. New ranges can also be set via this dialog so that you can
adjust your CP value throughout the season as your fitness increases (or
decreases). Once your CP is set, GoldenCheetah will set up seven power zones
based on percentages of your CP value. The zones are:
<p>
<table align="center" width="450">
<tr>
<td>Zone</td>
<td>Description</td>
<td>Low</td>
<td>High</td>
</tr>
<tr>
<td>Z1</td>
<td>Active Recovery</td>
<td>0%</td>
<td>55%</td>
</tr>
<tr>
<td>Z2</td>
<td>Endurance</td>
<td>55%</td>
<td>75%</td>
</tr>
<tr>
<td>Z3</td>
<td>Tempo</td>
<td>75%</td>
<td>90%</td>
</tr>
<tr>
<td>Z4</td>
<td>Threshold</td>
<td>90%</td>
<td>105%</td>
</tr>
<tr>
<td>Z5</td>
<td>VO2 Max</td>
<td>105%</td>
<td>120%</td>
</tr>
<tr>
<td>Z6</td>
<td>Anaerobic</td>
<td>120%</td>
<td>150%</td>
</tr>
<tr>
<td>Z1</td>
<td>Neuromuscular</td>
<td>150%</td>
<td>MAX</td>
</tr>
</table>
<p>
If you want to use other zones boundaries or labels, you can manually edit
the power.zones file as described in Method 3.
<p>
<b>Method 3: Manually edit the power.zones file.</b>
<p>
To edit/create the power.zones file you'll need to use a text editor.
On Linux, that probably means nano, vi, or emacs. On Mac, the easiest
editor to use is TextEdit, which is in your Applications folder.
<p> Start by downloading <a href="power.zones">this sample file</a> and saving
it in your rider directory, which is listed in the GoldenCheetah->About GoldenCheetah
menu item.
<p>
Open the power.zones file in a text editor and you'll see this:
<blockquote>
<pre>
$ ./ptunpk 2006_05_15_11_34_03.raw
$ head -5 2006_05_15_11_34_03.dat
# Time Torq MPH Watts Miles Cad HR Int
# 2006/5/15 11:34:03 1147707243
# wheel size=2096 mm, interval=0, rec int=1
0.021 13.1 2.450 43 0.00781 0 85 0
0.042 13.4 5.374 97 0.00912 64 85 0
</pre>
From BEGIN until 2006/07/17, CP=297:
1, Active Recovery, 122, 167
2, Endurance, 167, 228
3, Tempo, 228, 274
4, Lactate Threshold, 274, 319
5, VO2 Max, 319, 365
6, Anaerobic Capacity, 365, 678
7, Sprinting, 678, MAX
<code>ptunpk</code> takes a <code>.raw</code> file for input and writes a
<code>.dat</code> file as output. Lines that start with an ampersand ("#") in
this file are comments; the other lines represent measured samples. As shown
by the first comment in the file, the columns are: time in minutes, torque in
Newton-meters, speed in miles per hour, power in watts, distance in miles,
cadence, heart rate, and interval number.
From 2006/07/17 until 2007/02/05, CP=329:
1, Active Recovery, 135, 185
2, Endurance, 185, 253
3, Tempo, 253, 303
4, Lactate Threshold, 303, 354
5, VO2 Max, 354, 404
6, Anaerobic Capacity, 404, 752
7, Sprinting, 752, MAX
From 2007/02/05 until END, CP=347:
1, Active Recovery, 139, 191
2, Endurance, 191, 260
3, Tempo, 260, 312
4, Lactate Threshold, 312, 364
5, VO2 Max, 364, 416
6, Anaerobic Capacity, 416, 774
7, Sprinting, 774, MAX
</pre>
</blockquote>
<p>
The format of the file is simple. You define a range of time, starting with a
date or "BEGIN" to indicate the oldest possible time and ending with a date or
"END" to indicate the latest possible time. Then you put your critical power
(CP) for that date range. Then you list your zones, where each zone has a
number, a name, a minimum power value, and a maximum power value. You can
have as many time ranges and zones as you like. Most people enter a new time
range every time their critical power goes up--right after a fitness test, for
example.
<p>
NOTE: By default, Mac OS's TextEdit will try and save the power.zones file
with a <code>.txt</code> extension. Use the menu command "Format->Make Plain
Text" to get it to let you save the file with a <code>.zones</code> extension
instead.
<p>
<p>
<big><font face="arial,helvetica,sanserif">
Summarizing the Data
</font></big>
<p>
We hope to have a graphical interface to these programs soon, but until then,
the only summarization tools we have are command-line programs. The script
<code>intervals.pl</code> summarizes the intervals performed in a workout:
<small>
<pre>
$ ./intervals.pl 2006_05_03_16_24_04.dat
Power Heart Rate Cadence Speed
Int Dur Dist Avg Max Avg Max Avg Max Avg Max
0 77:10 19.3 213 693 134 167 82 141 16.0 27.8
1 4:03 0.9 433 728 175 203 84 122 13.0 18.8
2 7:23 1.0 86 502 135 179 71 141 16.0 28.2
3 4:27 0.9 390 628 170 181 70 100 12.0 17.6
4 8:04 0.9 60 203 130 178 50 120 18.0 30.1
5 4:30 0.9 384 682 170 179 79 113 11.0 18.6
6 8:51 1.1 53 245 125 176 70 141 8.0 26.6
7 2:48 0.4 400 614 164 178 62 91 8.0 13.6
8 7:01 1.1 46 268 128 170 71 141 12.0 28.8
9 4:30 0.9 379 560 168 180 81 170 11.0 18.3
10 28:46 6.5 120 409 128 179 79 141 15.0 31.0
</pre>
</small>
<p>
In the example above, a rider performed five hill intervals, four of which
climbed a medium size hill that took about 4-5 minutes to climb (intervals
1, 3, 5, and 9), and one on a shorter hill that took just under 3 minutes to
climb (interval 7).
<p>
<big><font face="arial,helvetica,sanserif">
Graphing the Data
</font></big>
<p>
For graphing the data in the ride, we use <code>smooth.pl</code> and the
<code>gnuplot</code> program. You can use <a href="sample.gp">sample.gp</a>
to graph the power, heart rate, cadence, and speed for the hill workout above:
<pre>
$ gnuplot sample.gp
</pre>
<img align="center" alt="Sample Plot" src="sample.png">
<p>
<big><font face="arial,helvetica,sanserif">
Finding Your "Critical Power"
</font></big>
<p>
Joe Friel calls the maximum average power a rider can sustain over an interval
the rider's "critical power" for that duration. The <code>cpint</code>
program automatically computes your critical power over all interval lengths
using the data from all your past rides. This program looks at all the
<code>.raw</code> files in a directory, calculating your maximum power over
every subinterval length and storing them in a corresponding <code>.cpi</code>
file. It then combines the data in all of the <code>.cpi</code> files to find
your critical power over <i>all</i> subintervals of <i>all</i> your rides.
<pre>
$ ls *.raw
2006_04_28_10_48_33.raw 2006_05_10_17_08_30.raw 2006_05_18_16_32_53.raw
2006_05_03_16_24_04.raw 2006_05_13_10_29_12.raw 2006_05_21_12_25_07.raw
2006_05_05_10_52_05.raw 2006_05_15_11_34_03.raw 2006_05_22_18_28_47.raw
...
2006_05_09_09_54_29.raw 2006_05_17_16_44_35.raw
$ ./cpint
Compiling data for ride on Fri Apr 28 10:48:33 2006...done.
Compiling data for ride on Sat Apr 29 10:07:48 2006...done.
Compiling data for ride on Sun Apr 30 14:00:17 2006...done.
...
Compiling data for ride on Mon May 22 18:28:47 2006...done.
0.021 1264
0.042 1221
0.063 1216
...
5.019 391
...
171.885 163
</pre>
<p>
Over this set of rides, the rider's maximum power is 1264 watts, achieved over
an interval of 0.021 minutes (1.26 seconds). Over all five-minute
subintervals, he has achieved a maximum average power of 391 watts. The
longest ride in this set was 171.885 minutes long, and he averaged 163 watts
over it.
<p>
We can graph the output of <code>cpint</code> using <code>gnuplot</code> with
<a href="cpint.gp">cpint.gp</a>:
<pre>
$ ./cpint > cpint.out
$ gnuplot cpint.gp
</pre>
<img src="cpint.png">
<p>
The first time you run <code>cpint</code> it will take a while, as it has to
analyze all your past rides. On subsequent runs, however, it will only
analyze new files.
<p><i>Training and Racing with a Power Meter</i> (see the <a
href="faq.html">FAQ</a>) contains a table of critical powers of Cat 5 cyclists
up through international pros at interval lengths of 5 seconds, 1 minute, 5
minutes, and 60 minutes. Using this table and the <code>cpint</code> program,
you can determine whether you're stronger than others in your racing category
at each interval length and adapt your training program accordingly.
<p>
<big><font face="arial,helvetica,sanserif">
Converting Old Data
Legacy Command-Line Tools
</font></big>
<p>
If you've used the PowerTuned software that comes with the PowerTap you may
have lots of old ride data in that program that you'd like to include in your
critical power graph. You can convert the <code>.xml</code> files that
PowerTuned produces to <code>.raw</code> files using the <code>ptpk</code>
program:
<p>
<pre>
$ ./ptpk 2006_04_27_00_23_28.xml
$ head -5 2006_04_27_00_23_28.raw
57 56 55 64 02 15
60 06 04 7b 80 17
40 08 30 00 00 00
84 04 00 24 00 ff
83 03 00 d7 00 ff
</pre>
<p>
<code>ptpk</code> assumes the input <code>.xml</code> file was generated with
a wheel size of 2,096 mm and a recording interval of 1. If this is not the
case, you should specify the correct values with the <code>-w</code> and
<code>-r</code> options.
<p>
Note that the PowerTuned software computes the output speed in miles per hour
by multiplying the measured speed in kilometers per hour by 0.62, and the
miles per hour values in a <code>.xml</code> file are thus only accurate to
two significant figures, even though they're printed out to three decimal
places. Because of this limitation, the sequence <code>ptpk</code>,
<code>ptunpk</code> is not quite the identity function; in particular, the
wattage values from <code>ptpk</code> may only be accurate to two significant
digits.
You can still build the older, command-line tools from the source code, but we
no longer include them in releases. <a href="command-line.html">You can find
documentation for them here.</a>

BIN
doc/weekly-summary.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

27
doc/wishlist.content Normal file
View File

@@ -0,0 +1,27 @@
<big><font face="arial,helvetica,sanserif">
I wish GoldenCheetah would let me...
</font></big>
<p>If you have a new feature that you'd like to see in GoldenCheetah
please create a new issue on our
<a href=http://bugs.goldencheetah.org/projects/show/goldencheetah>bug/feature
tracker</a>. Instructions for doing so are <a href="bug-tracker.html">here</a>.
<p>
Examples of some features are:
<ul>
<li>Graph ride metrics (daily hours, work, BikeScore) over the long
term (weeks, seasons)</li>
<li>Display the numbers at the bottom of the ride plot, like the
critical power graph does</li>
<li>Select intervals in the ride plot and display metrics for them
at the bottom</li>
<li>Pop up an "importing rides" thermometer when importing</li>
<li>Remember last settings for showPower, showHr, etc., in ride plot</li>
<li>Group rides list into seasons</li>
<li>Group rides list by type, course</li>
<li>Add lines to CP plot for seasons, last six (eight?) weeks, etc.</li>
<li>Create new intervals</li>
<li>Show mulitple rides (seasons, etc.) in power histogram</li>
<li>Annotate ride plot</li>
<li>Label rides by type, course</li>
</ul>

69
doc/zones.content Normal file
View File

@@ -0,0 +1,69 @@
<!-- $Id: download.content,v 1.6 2006/08/11 20:21:03 srhea Exp $ -->
The zone file format consists of a list of date ranges and the power
zones that should be used for all rides within each range. Someday I'll
add a dialog to GC that allows you to type in your zones within the
application. Right now, you'll have to write them into a text file
yourself. For example:
<blockquote>
<pre>
# Power zones for Sean Rhea
From BEGIN until 2006/07/17: # after original testing
1, Active Recovery, 122, 167
2, Endurance, 167, 228
3, Tempo, 228, 274
4, Lactate Threshold, 274, 319
5, VO2 Max, 319, 365
6, Anaerobic Capacity, 365, 678
7, Sprinting, 678, MAX
From 2006/07/17 until 2007/02/05: # since Workingman's ITT
1, Active Recovery, 135, 185
2, Endurance, 185, 253
3, Tempo, 253, 303
4, Lactate Threshold, 303, 354
5, VO2 Max, 354, 404
6, Anaerobic Capacity, 404, 752
7, Sprinting, 752, MAX
From 2007/02/05 until END: # since 20-min Diablo ITT
1, Active Recovery, 139, 191
2, Endurance, 191, 260
3, Tempo, 260, 312
4, Lactate Threshold, 312, 364
5, VO2 Max, 364, 416
6, Anaerobic Capacity, 416, 774
7, Sprinting, 774, MAX
</pre>
</blockquote>
If you copy the above into a file named "power.zones" in your
GoldenCheetah directory (e.g., "~/Library/GoldenCheetah/YourName"), GC
will display power zone information for all your rides using my power
zones.
<p>
The format should be pretty obvious. Comments start from a '#'
character and run until the end of a line.
<p>
A range goes from a date (in YYYY/MM/DD format) at which to start using
the following zones to a date before which to stop doing so. Also, you
can start the first range in a file with the keyword "BEGIN", which will
be treated as the earliest possible date, and you can end the last range
with the keyword "END", which will be treated as the latest. Also, in
order to have your zones displayed in the "Weekly Summary", each range
needs to start on a Monday.
<p>
After a range, you enter the zones to use during that range. Each zone
has a name (e.g., "2"), a description (e.g., "Endurance"), a low power
and a high power. The number of zones, their names and descriptions are
entirely up to you; I use ones similar to those advocated by Allen and
Coggan, as you might have noticed. The lower number in each range is
inclusive, and the upper one is not; i.e., you should read the range as
[low, high). Also, you can use the keywork "MAX" to indicate the
maximum possible power.

2
qwt/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
lib
qwtconfig.pri

409
qwt/CHANGES Normal file
View File

@@ -0,0 +1,409 @@
Release 5.2.1
===================
Bug Fixes
---------
1) QwtScaleDraw
Wrong border dist hints for unregular scale divisions fixed
Release 5.2.0
===================
Changes
-------
1) Ported to Qt 4.5.x
2) Scaling of non cosmetic pens (for printing to devices in high resolution)
3) Clipping of polygons for SVG rendering
4) QwtRect removed
use QwtClipper instead
5) QwtPlotRescaler
Introduced
6) QwtDoubleInterval
BorderMode introduced
7) QwtPlotCurve
Performance of incremental curve painting ( = draw(from, to) ) improved.
8) QwtLegendItem
setIdentfierMode renamed to setIdentifierMode
9) QwtPlotCanvas::replot() introduced
code from QwtPlot::replot shifted
10)QwtPlot
drawCanvas(), updateAxes() changed from protected to public
11)QwtScaleEngine
loMargin/hiMargin renamed to lowerMargin/upperMargin
12)QwtScaleDiv
lBound/hBound renamed to lowerBound/upperBound
13)QwtSpline
cofficientA/B/C introduced
14)QwtDial
counter clockwise scales introduced
15)QwtPlotMarker
Vertical text labels
16)doc/qwt-5.2.0.qch added foe browsing the Qwt docs in the Qt assistant
Bug Fixes
---------
1) QwtLinearScaleEngine
Rounding problems fixed
2) Again some print layout problems fixed
3) QwtPlotScaleItem: 1 pixel offset fixed
4) QwtPlotSpectrogram, clipping of contour lines
against the bounding rect
5) QwtPlotZoomer::setZoomStack for stacks with unlimited depth
6) Printing of rotated tick labels
Release 5.1.1
===================
Bug Fixes
---------
1) Several compiler incompatibilities fixed
2) DBL_EPSILON removed
Using DBL_EPSILON in the calculations of the dials/sliders and the
scale engines leads to problems with the inaccuracy of floating points.
The behaviour has been reverted to 5.0.x.
3) QwtSlider/QwtKnob
setScaleDraw() fixed.
4) QwtRect
Pointless private declaration removed
Release 5.1.0
===================
Changes
-------
1) QwtSymbol::copy introduced
Now it is possible to use derived symbol classes for curves
2) QwtPlotScaleItem introduced
A new type of plot item for displaying axes on the canvas
3) QwtClipper added
A collection of clipping algos
4) Using DBL_EPSILON
This change allows smaller intervals for sliders/dials
5) QwtPanner
setOrientation() added.
6) QwtPlot
axisStepSize() added
clear is virtual now
7) QwtPlotPrintFilter
PrintCanvasBackground splitted into PrintBackground, PrintFrameWithScales
8) QwtPlotZoomer
setZoomStack() added
9) Changes for the QwtPolar package
QwtLegendItemManager introduced
QwtMagnifier introduced
10)Suffix rules added in qwtconfig.pri for different targets for
debug/release builds.
Bug Fixes
---------
1. QwtAbstractScaleDraw::setAbstractScaleDraw
Reinitialization problem fixed
2. QwtLegendItem
key event handlers fixed
3. QwtPicker
solaris-cc compiler problem fixed
4. Inaccurate mapping of scale to widget coordinates fixed
5. QwtPlotCurve::draw
Updates for Qt 4.3 added
6. QwtPlotLayout
AlignToCanvas layout calculation fixed
7. QwtPlot::print
Workaround for a QPen initialization problem,
when printing to Pdf, added
8. QwtText
Layout of rich text documents fixed
9. Designer
Handling of QwtScaleWidget fixed
10. realtime example
Qt::WA_PaintOutsidePaintEvent added, ScrollZoomer fixed
11. Several others I have forgotten
Release 5.0.2
===================
Bug Fixes
---------
1. QwtPlotCurve::Xfy curve type fixed
2. Memory leak in QwtLegend fixed
3. Vertical alignment of rich texts fixed
4. Workaround for a Qt4 bug added, that produces horrible performance
when painting curves with a pen width > 1.
5. Background for the tracker text of QwtPickers fixed.
Improved (faster + better rendered texts) implementation of
painting tracker texts, using capabilities of Qt >= 4.3.
6. QwtArrowButton/QwtCounter: workaround for layout bug ( Qt < 4.3 )
of the Cleanlook style added.
7. A couple of minor fixes
Changes
-------
1. QSvgGenerator added to the bode example
Release 5.0.1
===================
Changes
-------
1. A couple of problems, when building Qwt fixed.
2. Displaying Rich Text with Qt 4.x fixed
Release 5.0.0
===================
Platforms
---------
Support of Qt3 and Qt4. Qt2 is not supported any longer.
Key features
------------
1. Redesign of plot items. Makes it much easier to develop
individual items.
2. Redesign of the scale classes. All calculations are
collected in scale engines, where the application can
implement it´s own (f.e log2, or date scales). Now it´s
also possible to have individual and completely irregular scales
3. Redesign of the QwtText classes. The MathML renderer of
the Qt4 solutions package is embedded.
work for all expressions/situations.
4. New classes for navigating: QwtPanner, QwtMaginfier
5. Spectrogram/Contour plots and other classes for displaying
raster data added.
Changes
-------
5.0.0 is by far the release with the most changes in the history of Qwt
- too many to make list.
Release 4.2.0/0.4.2
===================
License
--------
A couple of exceptions to the LGPL with the intention to allow static
linking with commercial applications. See COPYING.
Key features:
-------------
1. Designer plugin
2. Rich Text support ( f.e. E = m * c<sup>2</sup> ) added.
3. QwtDial class family added (QwtDial, QwtCompass, QwtAnalogClock, ...)
4. QwtPicker class family added. Includes QwtPlotZoomer, a complete
implementation of recursive zooming.
5. Device metrics independent printing of QwtPlot. (QPrinter::HighResolution)
6. QwtPlot::setCurveBrush(), QwtCurve::setBrush() added. The area
between curve and baseline will be filled with this brush.
7. Rotation of axis tick labels added. Very useful for axis with long
labels like time scales ...
8. Added a new abstract QwtData class to plot data from almost any type of
container class.
9. QwtDoublePoint, QwtDoubleSize, QwtDoubleRect double counterparts
for QPoint, QSize, QRect.
10. First steps to support Qtopia. All examples can be compiled and started
in the qvfb emulator.
Changes:
---------
1. Rewrite of QwtLegend/QwtLegendItem (no QTable anymore)
2. Each plot item will be painted, even if one of the axis it is
attached to is disabled. (like in all other releases beside 0.4.1)
3. Code for double buffering moved to a new class QwtPaintBuffer.
Double buffering can be enabled/disabled now.
4. QwtPainter, QwtMetricsMap, QwtLayoutMetrics added
Hide paint device metrics dependencies.
5. Layout code rewritten and moved to a new class QwtPlotLayout
New layout options canvasMargin(), alignCanvasToScales()
6. QwtPlot: sizeHint() != minimumSizeHint()
9. Internal plot data are private again. A couple of get methods
added instead.
10. canvas repaints triggered by paint events. Enables event filtering
11. QwtPlot::drawCanvasItems added. In opposite to QwtPlot::drawCanvas
it is used by the printing code too.
12. qwtMax, qwtMin, qwtInt mapped to QMAX, QMIN, qRound from qglobal.h
13. operator= for plot item classes changed.
14. readOnly property added for sliders.
15. valid flag added for QwtDblRange
16. QwtCounter wrap around policy: a counter under- or overflow sets
focus to the smallest up/down button and disables counting.
A space bar keypress release event re-enables counting.
17. QwtPushButton added. A class that adds rich text and alignments
features to QPushButton, like they are used in QLabel
18. Clipped painting code moved from QwtCurve to QwtPainter/QwtRect
19. Canvas cache added to optimize trivial repaints.
20. QwtPlot::drawCurve added for incremental curve data
21. QwtSliderBase, readOnly, isValid added
22. Added filtering of the colors of the title and scales to QwtPrintFilter.
23. Support of QT_NO_CAST_ASII and QT_NO_COMPAT added
24. Batch file added for generating Visual Studio project files
25. QwtPlotCurve, QwtPlotMarker, QwtPlotGrid: more methods public
26. QwtPlot::setLegendPosition added
27. A lot of changes I don't remember, ... sorry.
Bugfixes:
---------
1. Autodetection of painter redirection. QPixmap::grabWidget() works
with Qwt Widgets again.
2. QwtSlider: Rounding double->int conversions instead of simple casts.
3. Bad additional line, connected to the first curve point, when zooming
deep, fixed.
4. QwtMarker: Painting of symbols with width != height fixed
5. QwtPlot::plotMouseXXX/canvasMap pixel coordinates synced.
Now both include the canvas frame.
6. Layout fixed for QwtScaleDraws without tick labels
8. Tab focus chains fixed, focus indications added.
9. Support QwtAutoScale::Inverted when autoScale is off also.
10. Keyboard control, focus indications added.
11. Improved QStyle awareness.
12. Printing of plots with disabled axes
Examples
--------
1. New example linux/cpustat added. Runs also on non linux boxes
with dummy values. Beside showing a couple of features that
are new with 0.4.1 and 0.4.2, it shows how to extend and customize
a QwtPlots.
2. Added new example event_filter to demonstrate event filtering.
This example shows how to add additional controls to the scales,
how to translate mouse clicks on the scales into signals and
how to move points on the canvas.
3. realtime example shows how to use scrollbars when zooming
Release 0.4.1
============
Changes:
---------
1. Platform independent project files. makefiles directory removed.
2. RPM spec file template added.
3. __declspec formalism added for Win32 DLLs. Requires
'DEFINES += QWT_DLL' in the .pro file.
4. QString used for visible texts.
5. Code for error curves removed. These type of features should be
implemented in derived curve classes.
6. A lot of Qt 1.2 related code removed/replaced.
7. QwtColorFilter, QwtPixFrame removed. QwtPlotPixFrame renamed
to QwtPlotCanvas.
8. qmodules.h aware. Skips QwtLegend in case of !QT_MODULE_TABLE
9. All Widgets including QwtPlot optimized to reduce flicker
during resize/repaint.
10. QwtPlot curves/markers can be disabled/enabled to hide/show individual
curves without removing the curves from the plot.
11. Internal maps removed from QwtCurve. QwtCurve::setMap, QwtCurve::setRect,
QwtCurve::setRange removed.
Feature additions:
------------------
1. Printing
QwtPlot::print prints to any type of QPaintDevice now.
Hardcoded printer attributes margin, creator and document title have
been removed and must/can be set by the applications now.
Printing of background and legends added. QwtColorFilter replaced
by QwtPlotPrintFilter.
2. Layout
Many layout fixes and additions. Now all Widgets behave well in
QLayouts and provide sensible sizeHints. QwtPlot::setMargin(int) added.
Fieldwidth added for QwtPlot::setAxisFormat for application that need
range independent width. Title and axis title are Qt:Alignment aware.
Qt::WordBreak or multiline titles are possible.
3. Legend
En/Disabling of single curves in the legend added.
QwtPlot::setAutoLegend added.
4. Extensibility
QwtPlot::insertCurve + QwtPlot::insertMarker added. Now derived
classes of QwtPlotCurve and QwtPlotMarker can be added. Virtual
methods provided by QwtPlotCurve for sub-classing.
QwtScale::setScaleDraw + QwtPlot::setAxisScaleDraw + some virtual
methods for QwtScaleDraw added. Application can implement individual
axis labels now.
5. Sliders
QWheelEvent added. The MouseWheel stepsize is controlled by the
Scroll Page Size. QwtWheel::setWheelWidth added. QwtKnob::setSymbol,
QwtKnob::symbol added.
Bugfixes:
---------
1. Workaround for spontanous curves resulting from overruns
when zooming too deep.
2. Wrong QColorGroup::ColorRole for background colors fixed.
Necessary for several non default QStyles.
3. QwtWheel fixed for vertical wheels. Better color support.
4. QwtSlider fixed.
5. Many forgotten others
Release 0.4.0
============
Bugfixes:
---------
1. A few occurences of the boolean literal \c false were changed into macro
\c FALSE for cross compiler compatibility.
2. A few local variables in member functions were renamed to suppress
warnings issued by really picky compilers about global/class variables
being hidden.
3. In qwt_legend.h, a fully qualified name was used in a class declaration.
The HPUX compiler chokes on this (and it's ugly), so it was fixed.
4. Macro M_2PI is now only defined is this hasn't already been done by the
system's clib.
Feature additions:
------------------
1. Qwt now works with Qt3.0. In order to achieve this, QwtLegend now no
longer derives from QTableView, but from QTable. This seems to have had
quite a few consequences. Kudo's to Uwe Rathmann for uploading this nice
fix to the CVS tree.
2. Getters for a plot's title and title font have been added.
Release 0.3.0
============
License:
--------
1. The license has changed from GPL to LGPL.
Bugfixes:
---------
1. The makefiles for win32 caused object files to have extension .o instead of
.obj. The 'propagate' file was changed to fix this, using tmake's target
platform flag.
2. There were problems with rint() on win32 platforms. rint() is a BSD call,
not even available on all unices. All calls to rint(x) have been replaced
by floor(x+.5).
3. Some static class data members were initialized with the value of other
static class data members (from Qt). This caused programs depend on the
initialization order of class members. This is now fixed by replacing the
static properties by static signleton factories.
4. When a plot was zoomed and then printed, curves and markers laying outside
the plot's scale were still printed. The print() function now uses clipping.
Feature additions:
------------------
1. Multi-line plot titles are now supported: the PostScript document name is
not the plot title, with "\n" characters replaced by "--". Geometry
management has been changed to support multi-line titles.
2. In the mailinglist, there were often feature requests for features that
were in fact implemented, but not available through QwtPlot's API. Many
private members have been made protected or even public, to give users
more control. This is poor design, but Qwt will be refactored anyway.
3. Qwt always displayed floats with 5 digits. This was insufficient for many
applications. QwtPlot, QwtScale, QwtAutoScale got some methods to set the
label format. This is a printf like format for the numbers at the scales,
consisting of 'f' and a precision, or 'g' and the significance.
Build system:
-------------
1. The 'makefiles' directory was removed from the cvs tree, and is now only
generated for releases. CVS users should have tmake installed, to generate
the makefiles themselves.
2. The 'examples' directory now uses tmake's 'subdirs' template, to iterate
over all subdirectories and build all examples with one command. There was
allready a makefile for this, but now the process is automated by tmake.
3. Under unix, the library now gets a proper version number. Current version
is 0.3.0.
Documentation:
--------------
1. All documentation is converted to the Doxygen documentation system. The
release contains two settings files, 'Doxygen' and 'Doxygen.users',
generating a developer's and user's manual, respectively.

543
qwt/COPYING Normal file
View File

@@ -0,0 +1,543 @@
Qwt License
Version 1.0, January 1, 2003
The Qwt library and included programs are provided under the terms
of the GNU LESSER GENERAL PUBLIC LICENSE (LGPL) with the following
exceptions:
1. Widgets that are subclassed from Qwt widgets do not
constitute a derivative work.
2. Static linking of applications and widgets to the
Qwt library does not constitute a derivative work
and does not require the author to provide source
code for the application or widget, use the shared
Qwt libraries, or link their applications or
widgets against a user-supplied version of Qwt.
If you link the application or widget to a modified
version of Qwt, then the changes to Qwt must be
provided under the terms of the LGPL in sections
1, 2, and 4.
3. You do not have to provide a copy of the Qwt license
with programs that are linked to the Qwt library, nor
do you have to identify the Qwt license in your
program or documentation as required by section 6
of the LGPL.
However, programs must still identify their use of Qwt.
The following example statement can be included in user
documentation to satisfy this requirement:
[program/widget] is based in part on the work of
the Qwt project (http://qwt.sf.net).
----------------------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

176
qwt/INSTALL Normal file
View File

@@ -0,0 +1,176 @@
Introduction
============
Qwt uses qmake to build all its components and examples.
qmake is part of a Qt distribution.
qmake reads project files, that contain the options and rules how to
build a certain project. A project file ends with the suffix "*.pro".
Files that end with the suffix "*.pri" are included by the project
files and contain definitions, that are common for several project files.
qwtconfig.pri is read by all project files of the Qwt package.
So the first step is to edit qwtconfig.pri to adjust it to your
needs.
MathML Extension
================
Qwt/Qt4 supports the MathML render engine from the Qt solutions package,
that is only available with a commercial Qt license.
You need a release of qtmmlwidget >= 2.1.
Copy the files qtmmlwidget.[cpp|h] to textengines/mathml.
Documentation
==========================
Qwt includes a class documentation, that is available in various formats:
- Html files
- PDF document
- Qt Compressed Help (*.qch ) for the Qt assistant.
- Man pages ( UNIX only )
A) Unix Qt3/Qt4
==========================
qmake
make
make install
If you have installed a shared library it's path has to be known to
the run-time linker of your operating system. On Linux systems read
"man ldconfig" ( or google for it ). Another option is to use
the LD_LIBRARY_PATH (on some systems LIBPATH is used instead, on MacOSX
it is called DYLD_LIBRARY_PATH) environment variable.
If you only want to check the Qwt examples without installing something,
you can set the LD_LIBRARY_PATH to the lib directory
of your local build.
If you didn't enable autobuilding of the examples in qwtconfig.pri
you have to build the examples this way:
cd examples
qmake
make
B) Win32/MSVC Qt3/Qt4
=====================
Please read the qmake documentation how to convert
your *.pro files into your development environment.
F.e MSVC with nmake:
qmake qwt.pro
nmake
If you didn't enable autobuilding of the examples in qwtconfig.pri
you have to build the examples this way:
cd examples
qmake examples.pro
nmake
admin/msvc-qmake.bat helps users of Visual Studio users to
generate makefiles or project files (.dsp for MSVC-6.0 or vcproj for
MSVC.NET) for Qwt.
To generate makefiles, type: "admin\msvc-qmake"
To generate project files, type: "admin\msvc-qmake vc"
When you have built a Qwt DLL you need to add the following
define to your compiler flags: QWT_DLL.
Windows doesn't like mixing of debug and release binaries. Most
of the problems with using the Qwt designer plugin are because
of trying to load a Qwt debug library into a designer release
executable.
C) Win32/MinGW Qt4
==================
C1) Windows Shell
Start a Windows Shell, where Qt4 is initialized. ( F.e. with
"Programs->Qt by Trolltech ...->Qt 4.x.x Command Prompt" ).
qmake qwt.pro
make
If you didn't enable autobuilding of the examples in qwtconfig.pri
you have to build the examples this way:
cd examples
qmake examples.pro
make
make install
C2) MSYS Shell Qt >= 4.3.0
Support for the MSYS Shell has been improved in Qt 4.3.0.
Now building Qwt from the MSYS Shell works exactly like in UNIX or in the
Windows Shell - or at least it should:
because of a bug in Qt 4.3.0 you always have to do a "qmake -r".
C3) MSYS Shell Qt < 4.3.0
For Qt < 4.3.0 you have to set the MINGW_IN_SHELL variable.
make will run into errors with the subdirs target, that can be
ignored (make -i).
export MINGW_IN_SHELL=1;
qmake
make -i
make -i install
If you didn't enable autobuilding of the examples in qwtconfig.pri
you have to build the examples this way:
cd examples
qmake examples.pro
make -i
make -i install
C1-C3)
When you have built a Qwt DLL you need to add QWT_DLL to your compiler
flags. If you are using qmake for your own builds this done by adding
the following line to your profile: "DEFINES += QWT_DLL".
Windows doesn't like mixing of debug and release binaries. Most
of the problems with using the Qwt designer plugin are because
of trying to load a Qwt debug library into a designer release
executable.
D) MacOSX
Well, the Mac is only another Unix system. So read the instructions in A).
In the recent Qt4 releases the default target of qmake is to generate
XCode project files instead of makefiles. So you might need to do the
following:
qmake -spec macx-g++
...
D) Qtopia Core
I only tested Qwt with Qtopia Core in qvfb (Virtual Framebuffer Devivce)
Emulator on my Linux box. To build Qwt for the emulator was as simple as
for a regular Unix build.
qmake
make
E) Qtopia (!= Qtopia Core)
I once compiled the Qwt library against Qtopia 4.2.0 successfully - but
not more. It should be possible to build and install Qwt, but it's
not done yet.
Good luck !

33
qwt/README Normal file
View File

@@ -0,0 +1,33 @@
The Qwt Widget Library
----------------------
Qwt is an extension to the Qt GUI library from Troll Tech AS.
The Qwt library contains widgets and components which are
primarily useful for technical and scientifical purposes.
It includes a 2-D plotting widget, different kinds of sliders,
and much more.
Qwt is hosted at http://qwt.sf.net
Installation
------------
Read INSTALL how to build and install Qwt.
Copyright
---------
Qwt Widget Library
Copyright (C) 1997 Josef Wilgen
Copyright (C) 2002 Uwe Rathmann
Qwt is published under the Qwt License, Version 1.0.
You should have received a copy of this licence in the file
COPYING.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

58
qwt/admin/msvc-qmake.bat Normal file
View File

@@ -0,0 +1,58 @@
REM Batch file to make all Makefiles or all Visual Studio project files
REM (*.dsp for MSVC-6.0 or *.vcproj for MSVC-7.0) for Qwt with qmake.
REM
REM BUG: the designer plugin *.dsp file may not work; the Makefile does.
REM
REM To make Makefiles, type: msvc-qmake
REM To make project files type: msvc-qmake vc
REM For the Qwt library:
cd src
qmake -t %1lib% src.pro
cd ..
REM For the designer plugin:
cd textengines\mathml
qmake -t %1lib mathml.pro
cd ..\..
REM For the designer plugin:
cd designer
qmake -t %1lib designer.pro
cd ..
REM For the examples:
cd examples
cd bode
qmake -t %1app bode.pro
cd ..\cpuplot
qmake -t %1app cpuplot.pro
cd ..\curvdemo1
qmake -t %1app curvdemo1.pro
cd ..\curvdemo2
qmake -t %1app curvdemo2.pro
cd ..\data_plot
qmake -t %1app data_plot.pro
cd ..\dials
qmake -t %1app dials.pro
cd ..\event_filter
qmake -t %1app event_filter.pro
cd ..\histogram
qmake -t %1app histogram.pro
cd ..\radio
qmake -t %1app radio.pro
cd ..\realtime_plot
qmake -t %1app realtime_plot.pro
cd ..\simple_plot
qmake -t %1app simple_plot.pro
cd ..\sliders
qmake -t %1app sliders.pro
cd ..\spectrogram
qmake -t %1app spectrogram.pro
cd ..\svgmap
qmake -t %1app svgmap.pro
cd ..\sysinfo
qmake -t %1app sysinfo.pro
cd ..\..
REM EOF

9
qwt/admin/no-qt-keywords.sh Executable file
View File

@@ -0,0 +1,9 @@
#! /bin/sh
find src -name "qwt_*.h" | xargs grep -l 'signals:' | xargs sed -i "s/signals:/Q_SIGNALS:/"
find src -name "qwt_*.h" | xargs grep -l 'slots:' | xargs sed -i "s/signals:/Q_SLOTS:/"
find src -name "qwt_*.cpp" | xargs grep -l 'emit ' | xargs sed -i "s/emit /Q_EMIT /"
echo "CONFIG += no_keywords" >> src/src.pro

299
qwt/admin/svn2package.sh Executable file
View File

@@ -0,0 +1,299 @@
#! /bin/sh
#
# Generates a Qwt package from sourceforge svn
#
# Usage: svn2package.sh [-b|--branch <svn-branch>] [packagename]
#
##########################
# usage
##########################
function usage() {
echo "Usage: $0 [-b|--branch <svn-branch>] [-pdf] [-qch] [packagename]"
exit 1
}
################################
# checkout
################################
function checkoutQwt() {
if [ -x $2 ]
then
rm -r $2
if [ $? -ne 0 ]
then
exit $?
fi
fi
svn -q co https://qwt.svn.sourceforge.net/svnroot/qwt/$1/$2
if [ $? -ne 0 ]
then
echo "Can't access sourceforge SVN"
exit $?
fi
if [ "$3" != "$2" ]
then
rm -rf $3
mv $2 $3
fi
}
##########################
# cleanQwt dirname
##########################
function cleanQwt {
cd $1
if [ $? -ne 0 ]
then
exit $?
fi
find . -name .svn -print | xargs rm -r
rm TODO
rm admin/svn2package.sh
PROFILES="qwtconfig.pri"
for PROFILE in $PROFILES
do
sed -i -e 's/= debug /= release /' $PROFILE
done
HEADERS=`find . -type f -name '*.h' -print`
SOURCES=`find . -type f -name '*.cpp' -print`
PROFILES=`find . -type f -name '*.pro' -print`
PRIFILES=`find . -type f -name '*.pri' -print`
for EXPANDFILE in $HEADERS $SOURCES $PROFILES $PRIFILES
do
expand -4 $EXPANDFILE > $EXPANDFILE.expand
mv $EXPANDFILE.expand $EXPANDFILE
done
for SRCFILE in $SOURCES $PROFILES $PRIFILES
do
sed -i -e '/#warning/d' $SRCFILE
done
sed -i -e "s/\$\$VERSION-svn/$VERSION/" qwtconfig.pri
sed -i -e "s/\$\${QwtVersion}-svn/\$\${QwtVersion}/" qwt.prf
cd - > /dev/null
}
##########################
# createDocs dirname
##########################
function createDocs {
ODIR=`pwd`
cd $1
if [ $? -ne 0 ]
then
exit $?
fi
cp Doxyfile Doxyfile.doc
sed -i '/PROJECT_NUMBER/d' Doxyfile.doc
echo "PROJECT_NUMBER = $VERSION" >> Doxyfile.doc
if [ $GENERATE_MAN -ne 0 ]
then
sed -i -e '/GENERATE_MAN/d' -e '/PROJECT_NUMBER/d' Doxyfile.doc
echo 'GENERATE_MAN = YES' >> Doxyfile.doc
fi
if [ $GENERATE_PDF -ne 0 ]
then
# We need LateX for the qwtdoc.pdf
sed -i -e '/GENERATE_LATEX/d' -e '/GENERATE_MAN/d' -e '/PROJECT_NUMBER/d' Doxyfile.doc
echo 'GENERATE_LATEX = YES' >> Doxyfile.doc
echo 'GENERATE_MAN = YES' >> Doxyfile.doc
echo "PROJECT_NUMBER = $VERSION" >> Doxyfile.doc
fi
if [ $GENERATE_QCH -ne 0 ]
then
sed -i -e '/GENERATE_HTMLHELP/d' Doxyfile.doc
echo "GENERATE_HTMLHELP = YES" >> Doxyfile.doc
fi
cp ../INSTALL ../COPYING ./
doxygen Doxyfile.doc > /dev/null
if [ $? -ne 0 ]
then
exit $?
fi
if [ $GENERATE_QCH -ne 0 ]
then
doxygen2qthelp --namespace=net.sourceforge.qwt-$VERSION --folder=qwt-$VERSION html/index.hhp qwt-$VERSION.qch
rm html/index.hh*
fi
rm Doxyfile.doc Doxygen.log INSTALL COPYING
rm -r images
if [ $GENERATE_PDF -ne 0 ]
then
cd latex
make > /dev/null 2>&1
if [ $? -ne 0 ]
then
exit $?
fi
cd ..
mkdir pdf
mv latex/refman.pdf pdf/qwtdoc.pdf
rm -r latex
fi
cd $ODIR
}
##########################
# posix2dos filename
##########################
function posix2dos {
# At least one unix2dos writes to stdout instead of overwriting the input.
# The -q option is always enabled in stdin->stdout mode.
unix2dos <$1 >$1.dos
mv $1.dos $1
}
##########################
# prepare4Win dirname
##########################
function prepare4Win {
cd $1
if [ $? -ne 0 ]
then
exit $?
fi
rm -r doc/man
# win files, but not uptodate
BATCHES=`find . -type f -name '*.bat' -print`
HEADERS=`find . -type f -name '*.h' -print`
SOURCES=`find . -type f -name '*.cpp' -print`
PROFILES=`find . -type f -name '*.pro' -print`
PRIFILES=`find . -type f -name '*.pri' -print`
for FILE in $BATCHES $HEADERS $SOURCES $PROFILES $PRIFILES
do
posix2dos $FILE
done
cd - > /dev/null
}
##########################
# prepare4Unix dirname
##########################
function prepare4Unix {
cd $1
if [ $? -ne 0 ]
then
exit $?
fi
rm -rf admin
cd - > /dev/null
}
##########################
# main
##########################
QWTDIR=
SVNDIR=trunk
BRANCH=qwt
VERSION=
GENERATE_PDF=0
GENERATE_QCH=0
GENERATE_MAN=1
while [ $# -gt 0 ] ; do
case "$1" in
-h|--help)
usage; exit 1 ;;
-b|--branch)
shift; SVNDIR=branches; BRANCH=$1; shift;;
-pdf)
GENERATE_PDF=1; shift;;
-qch)
GENERATE_QCH=1; shift;;
*)
QWTDIR=qwt-$1 ; VERSION=$1; shift;;
esac
done
if [ "$QWTDIR" == "" ]
then
usage
exit 2
fi
TMPDIR=/tmp/$QWTDIR-tmp
echo -n "checkout to $TMPDIR ... "
checkoutQwt $SVNDIR $BRANCH $TMPDIR
cleanQwt $TMPDIR
echo done
echo -n "generate documentation ... "
createDocs $TMPDIR/doc
if [ $GENERATE_PDF -ne 0 ]
then
mv $TMPDIR/doc/pdf/qwtdoc.pdf $QWTDIR.pdf
rmdir $TMPDIR/doc/pdf
fi
echo done
DIR=`pwd`
echo -n "create packages in $DIR ... "
cd /tmp
rm -rf $QWTDIR
cp -a $TMPDIR $QWTDIR
prepare4Unix $QWTDIR
tar cfz $QWTDIR.tgz $QWTDIR
tar cfj $QWTDIR.tar.bz2 $QWTDIR
rm -rf $QWTDIR
cp -a $TMPDIR $QWTDIR
prepare4Win $QWTDIR
zip -r $QWTDIR.zip $QWTDIR > /dev/null
rm -rf $TMPDIR $QWTDIR
mv $QWTDIR.tgz $QWTDIR.tar.bz2 $QWTDIR.zip $DIR/
echo done
exit 0

4
qwt/designer/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
moc
obj
plugins
resources

135
qwt/designer/designer.pro Normal file
View File

@@ -0,0 +1,135 @@
# -*- mode: sh -*- ###########################
# Qwt Widget Library
# Copyright (C) 1997 Josef Wilgen
# Copyright (C) 2002 Uwe Rathmann
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the Qwt License, Version 1.0
##############################################
QWT_ROOT = ..
include ( $${QWT_ROOT}/qwtconfig.pri )
contains(CONFIG, QwtDesigner) {
CONFIG += warn_on
SUFFIX_STR =
VVERSION = $$[QT_VERSION]
isEmpty(VVERSION) {
# Qt 3
debug {
SUFFIX_STR = $${DEBUG_SUFFIX}
}
else {
SUFFIX_STR = $${RELEASE_SUFFIX}
}
}
else {
CONFIG(debug, debug|release) {
SUFFIX_STR = $${DEBUG_SUFFIX}
}
else {
SUFFIX_STR = $${RELEASE_SUFFIX}
}
}
TEMPLATE = lib
MOC_DIR = moc
OBJECTS_DIR = obj$${SUFFIX_STR}
DESTDIR = plugins/designer
INCLUDEPATH += $${QWT_ROOT}/src
DEPENDPATH += $${QWT_ROOT}/src
LIBNAME = qwt$${SUFFIX_STR}
contains(CONFIG, QwtDll) {
win32 {
DEFINES += QT_DLL QWT_DLL
LIBNAME = $${LIBNAME}$${VER_MAJ}
}
}
!contains(CONFIG, QwtPlot) {
DEFINES += NO_QWT_PLOT
}
!contains(CONFIG, QwtWidgets) {
DEFINES += NO_QWT_WIDGETS
}
unix:LIBS += -L$${QWT_ROOT}/lib -l$${LIBNAME}
win32-msvc:LIBS += $${QWT_ROOT}/lib/$${LIBNAME}.lib
win32-msvc.net:LIBS += $${QWT_ROOT}/lib/$${LIBNAME}.lib
win32-msvc2002:LIBS += $${QWT_ROOT}/lib/$${LIBNAME}.lib
win32-msvc2003:LIBS += $${QWT_ROOT}/lib/$${LIBNAME}.lib
win32-msvc2005:LIBS += $${QWT_ROOT}/lib/$${LIBNAME}.lib
win32-msvc2008:LIBS += $${QWT_ROOT}/lib/$${LIBNAME}.lib
win32-g++:LIBS += -L$${QWT_ROOT}/lib -l$${LIBNAME}
# isEmpty(QT_VERSION) does not work with Qt-4.1.0/MinGW
VVERSION = $$[QT_VERSION]
isEmpty(VVERSION) {
# Qt 3
TARGET = qwtplugin$${SUFFIX_STR}
CONFIG += qt plugin
UI_DIR = ui
HEADERS += qwtplugin.h
SOURCES += qwtplugin.cpp
target.path = $(QTDIR)/plugins/designer
INSTALLS += target
IMAGES += \
pixmaps/qwtplot.png \
pixmaps/qwtanalogclock.png \
pixmaps/qwtcounter.png \
pixmaps/qwtcompass.png \
pixmaps/qwtdial.png \
pixmaps/qwtknob.png \
pixmaps/qwtscale.png \
pixmaps/qwtslider.png \
pixmaps/qwtthermo.png \
pixmaps/qwtwheel.png \
pixmaps/qwtwidget.png
} else {
# Qt 4
TARGET = qwt_designer_plugin$${SUFFIX_STR}
CONFIG += qt designer plugin
RCC_DIR = resources
HEADERS += \
qwt_designer_plugin.h
SOURCES += \
qwt_designer_plugin.cpp
contains(CONFIG, QwtPlot) {
HEADERS += \
qwt_designer_plotdialog.h
SOURCES += \
qwt_designer_plotdialog.cpp
}
RESOURCES += \
qwt_designer_plugin.qrc
target.path = $$[QT_INSTALL_PLUGINS]/designer
INSTALLS += target
}
}
else {
TEMPLATE = subdirs # do nothing
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,42 @@
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#include <QLineEdit>
#include <QTabWidget>
#include <QHBoxLayout>
#include <QPushButton>
#include "qwt_designer_plotdialog.h"
using namespace QwtDesignerPlugin;
PlotDialog::PlotDialog(const QString &properties, QWidget *parent):
QDialog(parent)
{
setWindowTitle("Plot Properties");
QLineEdit *lineEdit = new QLineEdit(properties);
connect(lineEdit, SIGNAL(textChanged(const QString &)),
SIGNAL(edited(const QString &)));
QTabWidget *tabWidget = new QTabWidget(this);
tabWidget->addTab(lineEdit, "General");
QPushButton *closeButton = new QPushButton("Close");
connect(closeButton, SIGNAL(clicked()), this, SLOT(accept()));
QHBoxLayout *buttonLayout = new QHBoxLayout;
buttonLayout->addStretch(1);
buttonLayout->addWidget(closeButton);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(tabWidget);
mainLayout->addLayout(buttonLayout);
setLayout(mainLayout);
}

View File

@@ -0,0 +1,39 @@
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_DESIGNER_PLOTDIALOG_H
#define QWT_DESIGNER_PLOTDIALOG_H
#include <qglobal.h>
#if QT_VERSION < 0x040000
#ifdef __GNUC__
#error This code is Qt4 only
#endif
#endif
#include <QDialog>
namespace QwtDesignerPlugin
{
class PlotDialog: public QDialog
{
Q_OBJECT
public:
PlotDialog(const QString &properties, QWidget *parent = NULL);
signals:
void edited(const QString&);
};
}
#endif

View File

@@ -0,0 +1,516 @@
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#if defined(_MSC_VER) /* MSVC Compiler */
#pragma warning ( disable : 4786 )
#endif
#include <qglobal.h>
#include <qaction.h>
#include <QtPlugin>
#include <QDesignerFormEditorInterface>
#include <QDesignerFormWindowInterface>
#include <QDesignerFormWindowCursorInterface>
#include <QExtensionManager>
#include <QErrorMessage>
#include "qwt_designer_plugin.h"
#ifndef NO_QWT_PLOT
#include "qwt_designer_plotdialog.h"
#include "qwt_plot.h"
#include "qwt_scale_widget.h"
#endif
#ifndef NO_QWT_WIDGETS
#include "qwt_counter.h"
#include "qwt_wheel.h"
#include "qwt_thermo.h"
#include "qwt_knob.h"
#include "qwt_slider.h"
#include "qwt_analog_clock.h"
#include "qwt_compass.h"
#endif
#include "qwt_text_label.h"
using namespace QwtDesignerPlugin;
CustomWidgetInterface::CustomWidgetInterface(QObject *parent):
QObject(parent),
d_isInitialized(false)
{
}
bool CustomWidgetInterface::isContainer() const
{
return false;
}
bool CustomWidgetInterface::isInitialized() const
{
return d_isInitialized;
}
QIcon CustomWidgetInterface::icon() const
{
return d_icon;
}
QString CustomWidgetInterface::codeTemplate() const
{
return d_codeTemplate;
}
QString CustomWidgetInterface::domXml() const
{
return d_domXml;
}
QString CustomWidgetInterface::group() const
{
return "Qwt Widgets";
}
QString CustomWidgetInterface::includeFile() const
{
return d_include;
}
QString CustomWidgetInterface::name() const
{
return d_name;
}
QString CustomWidgetInterface::toolTip() const
{
return d_toolTip;
}
QString CustomWidgetInterface::whatsThis() const
{
return d_whatsThis;
}
void CustomWidgetInterface::initialize(
QDesignerFormEditorInterface *formEditor)
{
if ( d_isInitialized )
return;
QExtensionManager *manager = formEditor->extensionManager();
if ( manager )
{
manager->registerExtensions(new TaskMenuFactory(manager),
Q_TYPEID(QDesignerTaskMenuExtension));
}
d_isInitialized = true;
}
#ifndef NO_QWT_PLOT
PlotInterface::PlotInterface(QObject *parent):
CustomWidgetInterface(parent)
{
d_name = "QwtPlot";
d_include = "qwt_plot.h";
d_icon = QPixmap(":/pixmaps/qwtplot.png");
d_domXml =
"<widget class=\"QwtPlot\" name=\"qwtPlot\">\n"
" <property name=\"geometry\">\n"
" <rect>\n"
" <x>0</x>\n"
" <y>0</y>\n"
" <width>400</width>\n"
" <height>200</height>\n"
" </rect>\n"
" </property>\n"
"</widget>\n";
}
QWidget *PlotInterface::createWidget(QWidget *parent)
{
return new QwtPlot(parent);
}
#endif
#ifndef NO_QWT_WIDGETS
AnalogClockInterface::AnalogClockInterface(QObject *parent):
CustomWidgetInterface(parent)
{
d_name = "QwtAnalogClock";
d_include = "qwt_analog_clock.h";
d_icon = QPixmap(":/pixmaps/qwtanalogclock.png");
d_domXml =
"<widget class=\"QwtAnalogClock\" name=\"AnalogClock\">\n"
" <property name=\"geometry\">\n"
" <rect>\n"
" <x>0</x>\n"
" <y>0</y>\n"
" <width>200</width>\n"
" <height>200</height>\n"
" </rect>\n"
" </property>\n"
" <property name=\"lineWidth\">\n"
" <number>4</number>\n"
" </property>\n"
"</widget>\n";
}
QWidget *AnalogClockInterface::createWidget(QWidget *parent)
{
return new QwtAnalogClock(parent);
}
#endif
#ifndef NO_QWT_WIDGETS
CompassInterface::CompassInterface(QObject *parent):
CustomWidgetInterface(parent)
{
d_name = "QwtCompass";
d_include = "qwt_compass.h";
d_icon = QPixmap(":/pixmaps/qwtcompass.png");
d_domXml =
"<widget class=\"QwtCompass\" name=\"Compass\">\n"
" <property name=\"geometry\">\n"
" <rect>\n"
" <x>0</x>\n"
" <y>0</y>\n"
" <width>200</width>\n"
" <height>200</height>\n"
" </rect>\n"
" </property>\n"
" <property name=\"lineWidth\">\n"
" <number>4</number>\n"
" </property>\n"
"</widget>\n";
}
QWidget *CompassInterface::createWidget(QWidget *parent)
{
return new QwtCompass(parent);
}
#endif
#ifndef NO_QWT_WIDGETS
CounterInterface::CounterInterface(QObject *parent):
CustomWidgetInterface(parent)
{
d_name = "QwtCounter";
d_include = "qwt_counter.h";
d_icon = QPixmap(":/pixmaps/qwtcounter.png");
d_domXml =
"<widget class=\"QwtCounter\" name=\"Counter\">\n"
"</widget>\n";
}
QWidget *CounterInterface::createWidget(QWidget *parent)
{
return new QwtCounter(parent);
}
#endif
#ifndef NO_QWT_WIDGETS
DialInterface::DialInterface(QObject *parent):
CustomWidgetInterface(parent)
{
d_name = "QwtDial";
d_include = "qwt_dial.h";
d_icon = QPixmap(":/pixmaps/qwtdial.png");
d_domXml =
"<widget class=\"QwtDial\" name=\"Dial\">\n"
" <property name=\"geometry\">\n"
" <rect>\n"
" <x>0</x>\n"
" <y>0</y>\n"
" <width>200</width>\n"
" <height>200</height>\n"
" </rect>\n"
" </property>\n"
" <property name=\"lineWidth\">\n"
" <number>4</number>\n"
" </property>\n"
"</widget>\n";
}
QWidget *DialInterface::createWidget(QWidget *parent)
{
return new QwtDial(parent);
}
#endif
#ifndef NO_QWT_WIDGETS
KnobInterface::KnobInterface(QObject *parent):
CustomWidgetInterface(parent)
{
d_name = "QwtKnob";
d_include = "qwt_knob.h";
d_icon = QPixmap(":/pixmaps/qwtknob.png");
d_domXml =
"<widget class=\"QwtKnob\" name=\"Knob\">\n"
" <property name=\"geometry\">\n"
" <rect>\n"
" <x>0</x>\n"
" <y>0</y>\n"
" <width>100</width>\n"
" <height>100</height>\n"
" </rect>\n"
" </property>\n"
"</widget>\n";
}
QWidget *KnobInterface::createWidget(QWidget *parent)
{
return new QwtKnob(parent);
}
#endif
#ifndef NO_QWT_PLOT
ScaleWidgetInterface::ScaleWidgetInterface(QObject *parent):
CustomWidgetInterface(parent)
{
d_name = "QwtScaleWidget";
d_include = "qwt_scale_widget.h";
d_icon = QPixmap(":/pixmaps/qwtscale.png");
d_domXml =
"<widget class=\"QwtScaleWidget\" name=\"ScaleWidget\">\n"
"</widget>\n";
}
QWidget *ScaleWidgetInterface::createWidget(QWidget *parent)
{
return new QwtScaleWidget(QwtScaleDraw::LeftScale, parent);
}
#endif
#ifndef NO_QWT_WIDGETS
SliderInterface::SliderInterface(QObject *parent):
CustomWidgetInterface(parent)
{
d_name = "QwtSlider";
d_include = "qwt_slider.h";
d_icon = QPixmap(":/pixmaps/qwtslider.png");
d_domXml =
"<widget class=\"QwtSlider\" name=\"Slider\">\n"
" <property name=\"geometry\">\n"
" <rect>\n"
" <x>0</x>\n"
" <y>0</y>\n"
" <width>200</width>\n"
" <height>60</height>\n"
" </rect>\n"
" </property>\n"
"</widget>\n";
}
QWidget *SliderInterface::createWidget(QWidget *parent)
{
QwtSlider *slider = new QwtSlider(parent);
#if 0
slider->setScalePosition(QwtSlider::Bottom);
slider->setRange(0.0, 10.0, 1.0, 0);
slider->setValue(3.0);
#endif
return slider;
}
#endif
TextLabelInterface::TextLabelInterface(QObject *parent):
CustomWidgetInterface(parent)
{
d_name = "QwtTextLabel";
d_include = "qwt_text_label.h";
#ifdef __GNUC__
#warning QwtTextLabel icon is missing
#endif
d_icon = QPixmap(":/pixmaps/qwtwidget.png");
d_domXml =
"<widget class=\"QwtTextLabel\" name=\"TextLabel\">\n"
" <property name=\"geometry\">\n"
" <rect>\n"
" <x>0</x>\n"
" <y>0</y>\n"
" <width>100</width>\n"
" <height>20</height>\n"
" </rect>\n"
" </property>\n"
"</widget>\n";
}
QWidget *TextLabelInterface::createWidget(QWidget *parent)
{
return new QwtTextLabel(parent);
}
#ifndef NO_QWT_WIDGETS
ThermoInterface::ThermoInterface(QObject *parent):
CustomWidgetInterface(parent)
{
d_name = "QwtThermo";
d_include = "qwt_thermo.h";
d_icon = QPixmap(":/pixmaps/qwtthermo.png");
d_domXml =
"<widget class=\"QwtThermo\" name=\"Thermo\">\n"
"</widget>\n";
}
QWidget *ThermoInterface::createWidget(QWidget *parent)
{
return new QwtThermo(parent);
}
#endif
#ifndef NO_QWT_WIDGETS
WheelInterface::WheelInterface(QObject *parent):
CustomWidgetInterface(parent)
{
d_name = "QwtWheel";
d_include = "qwt_wheel.h";
d_icon = QPixmap(":/pixmaps/qwtwheel.png");
d_domXml =
"<widget class=\"QwtWheel\" name=\"Wheel\">\n"
"</widget>\n";
}
QWidget *WheelInterface::createWidget(QWidget *parent)
{
return new QwtWheel(parent);
}
#endif
CustomWidgetCollectionInterface::CustomWidgetCollectionInterface(
QObject *parent):
QObject(parent)
{
#ifndef NO_QWT_PLOT
d_plugins.append(new PlotInterface(this));
d_plugins.append(new ScaleWidgetInterface(this));
#endif
#ifndef NO_QWT_WIDGETS
d_plugins.append(new AnalogClockInterface(this));
d_plugins.append(new CompassInterface(this));
d_plugins.append(new CounterInterface(this));
d_plugins.append(new DialInterface(this));
d_plugins.append(new KnobInterface(this));
d_plugins.append(new SliderInterface(this));
d_plugins.append(new ThermoInterface(this));
d_plugins.append(new WheelInterface(this));
#endif
d_plugins.append(new TextLabelInterface(this));
}
QList<QDesignerCustomWidgetInterface*>
CustomWidgetCollectionInterface::customWidgets(void) const
{
return d_plugins;
}
TaskMenuFactory::TaskMenuFactory(QExtensionManager *parent):
QExtensionFactory(parent)
{
}
QObject *TaskMenuFactory::createExtension(
QObject *object, const QString &iid, QObject *parent) const
{
if (iid == Q_TYPEID(QDesignerTaskMenuExtension))
{
#ifndef NO_QWT_PLOT
if (QwtPlot *plot = qobject_cast<QwtPlot*>(object))
return new TaskMenuExtension(plot, parent);
#endif
#ifndef NO_QWT_WIDGETS
if (QwtDial *dial = qobject_cast<QwtDial*>(object))
return new TaskMenuExtension(dial, parent);
#endif
}
return QExtensionFactory::createExtension(object, iid, parent);
}
TaskMenuExtension::TaskMenuExtension(QWidget *widget, QObject *parent):
QObject(parent),
d_widget(widget)
{
d_editAction = new QAction(tr("Edit Qwt Attributes ..."), this);
connect(d_editAction, SIGNAL(triggered()),
this, SLOT(editProperties()));
}
QList<QAction *> TaskMenuExtension::taskActions() const
{
QList<QAction *> list;
list.append(d_editAction);
return list;
}
QAction *TaskMenuExtension::preferredEditAction() const
{
return d_editAction;
}
void TaskMenuExtension::editProperties()
{
const QVariant v = d_widget->property("propertiesDocument");
if ( v.type() != QVariant::String )
return;
#ifndef NO_QWT_PLOT
QString properties = v.toString();
if ( qobject_cast<QwtPlot*>(d_widget) )
{
PlotDialog dialog(properties);
connect(&dialog, SIGNAL(edited(const QString&)),
SLOT(applyProperties(const QString &)));
(void)dialog.exec();
return;
}
#endif
static QErrorMessage *errorMessage = NULL;
if ( errorMessage == NULL )
errorMessage = new QErrorMessage();
errorMessage->showMessage("Not implemented yet.");
}
void TaskMenuExtension::applyProperties(const QString &properties)
{
QDesignerFormWindowInterface *formWindow
= QDesignerFormWindowInterface::findFormWindow(d_widget);
if ( formWindow && formWindow->cursor() )
formWindow->cursor()->setProperty("propertiesDocument", properties);
}
Q_EXPORT_PLUGIN2(QwtDesignerPlugin, CustomWidgetCollectionInterface)

View File

@@ -0,0 +1,244 @@
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_DESIGNER_PLUGIN_H
#define QWT_DESIGNER_PLUGIN_H
#include <qglobal.h>
#if QT_VERSION < 0x040000
#ifdef __GNUC__
#error This code is Qt4 only
#endif
#endif
#include <QDesignerCustomWidgetInterface>
#include <QDesignerTaskMenuExtension>
#include <QExtensionFactory>
namespace QwtDesignerPlugin
{
class CustomWidgetInterface: public QObject,
public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
CustomWidgetInterface(QObject *parent);
virtual bool isContainer() const;
virtual bool isInitialized() const;
virtual QIcon icon() const;
virtual QString codeTemplate() const;
virtual QString domXml() const;
virtual QString group() const;
virtual QString includeFile() const;
virtual QString name() const;
virtual QString toolTip() const;
virtual QString whatsThis() const;
virtual void initialize(QDesignerFormEditorInterface *);
protected:
QString d_name;
QString d_include;
QString d_toolTip;
QString d_whatsThis;
QString d_domXml;
QString d_codeTemplate;
QIcon d_icon;
private:
bool d_isInitialized;
};
class CustomWidgetCollectionInterface: public QObject,
public QDesignerCustomWidgetCollectionInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
public:
CustomWidgetCollectionInterface(QObject *parent = NULL);
virtual QList<QDesignerCustomWidgetInterface*> customWidgets() const;
private:
QList<QDesignerCustomWidgetInterface*> d_plugins;
};
#ifndef NO_QWT_PLOT
class PlotInterface: public CustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
PlotInterface(QObject *parent);
virtual QWidget *createWidget(QWidget *parent);
};
#endif
#ifndef NO_QWT_WIDGETS
class AnalogClockInterface: public CustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
AnalogClockInterface(QObject *parent);
virtual QWidget *createWidget(QWidget *parent);
};
#endif
#ifndef NO_QWT_WIDGETS
class CompassInterface: public CustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
CompassInterface(QObject *parent);
virtual QWidget *createWidget(QWidget *parent);
};
#endif
#ifndef NO_QWT_WIDGETS
class CounterInterface: public CustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
CounterInterface(QObject *parent);
virtual QWidget *createWidget(QWidget *parent);
};
#endif
#ifndef NO_QWT_WIDGETS
class DialInterface: public CustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
DialInterface(QObject *parent);
virtual QWidget *createWidget(QWidget *parent);
};
#endif
#ifndef NO_QWT_WIDGETS
class KnobInterface: public CustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
KnobInterface(QObject *parent);
virtual QWidget *createWidget(QWidget *parent);
};
#endif
#ifndef NO_QWT_PLOT
class ScaleWidgetInterface: public CustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
ScaleWidgetInterface(QObject *parent);
virtual QWidget *createWidget(QWidget *parent);
};
#endif
#ifndef NO_QWT_WIDGETS
class SliderInterface: public CustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
SliderInterface(QObject *parent);
virtual QWidget *createWidget(QWidget *parent);
};
#endif
class TextLabelInterface: public CustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
TextLabelInterface(QObject *parent);
virtual QWidget *createWidget(QWidget *parent);
};
#ifndef NO_QWT_WIDGETS
class ThermoInterface: public CustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
ThermoInterface(QObject *parent);
virtual QWidget *createWidget(QWidget *parent);
};
#endif
#ifndef NO_QWT_WIDGETS
class WheelInterface: public CustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
WheelInterface(QObject *parent);
virtual QWidget *createWidget(QWidget *parent);
};
#endif
class TaskMenuFactory: public QExtensionFactory
{
Q_OBJECT
public:
TaskMenuFactory(QExtensionManager *parent = 0);
protected:
QObject *createExtension(QObject *object,
const QString &iid, QObject *parent) const;
};
class TaskMenuExtension: public QObject,
public QDesignerTaskMenuExtension
{
Q_OBJECT
Q_INTERFACES(QDesignerTaskMenuExtension)
public:
TaskMenuExtension(QWidget *widget, QObject *parent);
QAction *preferredEditAction() const;
QList<QAction *> taskActions() const;
private slots:
void editProperties();
void applyProperties(const QString &);
private:
QAction *d_editAction;
QWidget *d_widget;
};
};
#endif

View File

@@ -0,0 +1,15 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>pixmaps/qwtplot.png</file>
<file>pixmaps/qwtanalogclock.png</file>
<file>pixmaps/qwtcounter.png</file>
<file>pixmaps/qwtcompass.png</file>
<file>pixmaps/qwtdial.png</file>
<file>pixmaps/qwtknob.png</file>
<file>pixmaps/qwtscale.png</file>
<file>pixmaps/qwtslider.png</file>
<file>pixmaps/qwtthermo.png</file>
<file>pixmaps/qwtwheel.png</file>
<file>pixmaps/qwtwidget.png</file>
</qresource>
</RCC>

202
qwt/designer/qwtplugin.cpp Normal file
View File

@@ -0,0 +1,202 @@
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#if defined(_MSC_VER) /* MSVC Compiler */
#pragma warning ( disable : 4786 )
#endif
#include <qglobal.h>
#include <qvaluelist.h>
#include <qmime.h>
#include <qdragobject.h>
#include "qwtplugin.h"
#include "qwt_text_label.h"
#ifndef NO_QWT_PLOT
#include "qwt_plot.h"
#include "qwt_scale_widget.h"
#endif
#ifndef NO_QWT_WIDGETS
#include "qwt_counter.h"
#include "qwt_wheel.h"
#include "qwt_thermo.h"
#include "qwt_knob.h"
#include "qwt_slider.h"
#include "qwt_analog_clock.h"
#include "qwt_compass.h"
#endif
namespace
{
struct Entry
{
Entry() {}
Entry( QString _classname, QString _header, QString _pixmap,
QString _tooltip, QString _whatshis):
classname(_classname),
header(_header),
pixmap(_pixmap),
tooltip(_tooltip),
whatshis(_whatshis)
{}
QString classname;
QString header;
QString pixmap;
QString tooltip;
QString whatshis;
};
QValueList<Entry> vec;
const Entry *entry(const QString& str)
{
for ( uint i = 0; i < vec.count(); i++ )
{
if (str == vec[i].classname)
return &vec[i];
}
return NULL;
}
}
QwtPlugin::QwtPlugin()
{
#ifndef NO_QWT_PLOT
vec.append(Entry("QwtPlot", "qwt_plot.h",
"qwtplot.png", "QwtPlot", "whatsthis"));
vec.append(Entry("QwtScaleWidget", "qwt_scale_widget.h",
"qwtscale.png", "QwtScaleWidget", "whatsthis"));
#endif
#ifndef NO_QWT_WIDGETS
vec.append(Entry("QwtAnalogClock", "qwt_analog_clock.h",
"qwtanalogclock.png", "QwtAnalogClock", "whatsthis"));
vec.append(Entry("QwtCompass", "qwt_compass.h",
"qwtcompass.png", "QwtCompass", "whatsthis"));
vec.append(Entry("QwtCounter", "qwt_counter.h",
"qwtcounter.png", "QwtCounter", "whatsthis"));
vec.append(Entry("QwtDial", "qwt_dial.h",
"qwtdial.png", "QwtDial", "whatsthis"));
vec.append(Entry("QwtKnob", "qwt_knob.h",
"qwtknob.png", "QwtKnob", "whatsthis"));
vec.append(Entry("QwtSlider", "qwt_slider.h",
"qwtslider.png", "QwtSlider", "whatsthis"));
vec.append(Entry("QwtThermo", "qwt_thermo.h",
"qwtthermo.png", "QwtThermo", "whatsthis"));
vec.append(Entry("QwtWheel", "qwt_wheel.h",
"qwtwheel.png", "QwtWheel", "whatsthis"));
#endif
vec.append(Entry("QwtTextLabel", "qwt_text_label.h",
"qwtwidget.png", "QwtTextLabel", "whatsthis"));
}
QWidget* QwtPlugin::create(const QString &key,
QWidget* parent, const char* name)
{
QWidget *w = NULL;
#ifndef NO_QWT_PLOT
if ( key == "QwtPlot" )
w = new QwtPlot( parent );
else if ( key == "QwtScaleWidget" )
w = new QwtScaleWidget( QwtScaleDraw::LeftScale, parent);
#endif
#ifndef NO_QWT_WIDGETS
if ( key == "QwtAnalogClock" )
w = new QwtAnalogClock( parent);
else if ( key == "QwtCounter" )
w = new QwtCounter( parent);
else if ( key == "QwtCompass" )
w = new QwtCompass( parent);
else if ( key == "QwtDial" )
w = new QwtDial( parent);
else if ( key == "QwtWheel" )
w = new QwtWheel( parent);
else if ( key == "QwtThermo" )
w = new QwtThermo( parent);
else if ( key == "QwtKnob" )
w = new QwtKnob( parent);
else if ( key == "QwtSlider" )
w = new QwtSlider( parent);
#endif
if ( key == "QwtTextLabel" )
w = new QwtTextLabel( parent);
if ( w )
w->setName(name);
return w;
}
QStringList QwtPlugin::keys() const
{
QStringList list;
for (unsigned i = 0; i < vec.count(); i++)
list += vec[i].classname;
return list;
}
QString QwtPlugin::group( const QString& feature ) const
{
if (entry(feature) != NULL )
return QString("Qwt");
return QString::null;
}
QIconSet QwtPlugin::iconSet( const QString& pmap) const
{
QString pixmapKey("qwtwidget.png");
if (entry(pmap) != NULL )
pixmapKey = entry(pmap)->pixmap;
const QMimeSource *ms =
QMimeSourceFactory::defaultFactory()->data(pixmapKey);
QPixmap pixmap;
QImageDrag::decode(ms, pixmap);
return QIconSet(pixmap);
}
QString QwtPlugin::includeFile( const QString& feature ) const
{
if (entry(feature) != NULL)
return entry(feature)->header;
return QString::null;
}
QString QwtPlugin::toolTip( const QString& feature ) const
{
if (entry(feature) != NULL )
return entry(feature)->tooltip;
return QString::null;
}
QString QwtPlugin::whatsThis( const QString& feature ) const
{
if (entry(feature) != NULL)
return entry(feature)->whatshis;
return QString::null;
}
bool QwtPlugin::isContainer( const QString& ) const
{
return false;
}
Q_EXPORT_PLUGIN( QwtPlugin )

42
qwt/designer/qwtplugin.h Normal file
View File

@@ -0,0 +1,42 @@
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_PLUGIN_H
#define QWT_PLUGIN_H
#include <qglobal.h>
#if QT_VERSION >= 0x040000
#ifdef __GNUC__
#error This code is Qt3 only
#endif
This code is Qt3 only
#endif
#include <qwidgetplugin.h>
class QT_WIDGET_PLUGIN_EXPORT QwtPlugin: public QWidgetPlugin
{
public:
QwtPlugin();
QStringList keys() const;
QWidget* create( const QString &classname, QWidget* parent = 0, const char* name = 0 );
QString group( const QString& ) const;
QIconSet iconSet( const QString& ) const;
QString includeFile( const QString& ) const;
QString toolTip( const QString& ) const;
QString whatsThis( const QString& ) const;
bool isContainer( const QString& ) const;
};
#endif

1521
qwt/doc/Doxyfile Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
qwt/doc/images/cpuplot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
qwt/doc/images/curves.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
qwt/doc/images/dials1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

BIN
qwt/doc/images/dials2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
qwt/doc/images/graph.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
qwt/doc/images/knob.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
qwt/doc/images/plot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
qwt/doc/images/radio.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
qwt/doc/images/sinus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
qwt/doc/images/sliders.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

BIN
qwt/doc/images/sysinfo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

161
qwt/doc/qwt.dox Normal file
View File

@@ -0,0 +1,161 @@
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
/*
This file contains NO source code, just some documentation for doxygen to
parse.
*/
/*!
\mainpage Qwt - Qt Widgets for Technical Applications
The Qwt library contains GUI Components and utility classes which are primarily
useful for programs with a technical background. Beside a 2D plot widget
it provides scales, sliders, dials, compasses, thermometers, wheels and knobs
to control or display values, arrays, or ranges of type double.
\image html plot.png
\if homepage
\section homepage Project page
The official project page is hosted at
<a href="http://qwt.sourceforge.net">sourceforge</a>
\endif
\section license License
Qwt is distributed under the terms of the \ref qwtlicense.
\section platforms Platforms
Qwt 5.x might be usable in all environments where you find
<a href="http://www.trolltech.com/products/qt">Qt</a>.
It is compatible with Qt 3.3.x and Qt 4.x, but the documentation
is generated for Qt 4.x.\n
\section screenshotsonmainpage Screenshots
- \ref curvescreenshots\n
- \ref scatterscreenshots\n
- \ref spectrogramscreenshots\n
- \ref histogramscreenshots\n
- \ref controlscreenshots\n
\latexonly Screenshots are only available in the HTML docs.\endlatexonly
\section downloads Downloads
Stable releases, prereleases and snapshots are available at the Qwt <a href="http://sourceforge.net/projects/qwt">project page</a>.
For getting a snapshot with all bugfixes for the latest 5.2 release:
\code svn co https://qwt.svn.sourceforge.net/svnroot/qwt/branches/qwt-5.2 \endcode
For getting a development snapshot from the SVN repository:
\code svn co https://qwt.svn.sourceforge.net/svnroot/qwt/trunk/qwt \endcode
Qwt doesn't distribute binary packages, but today all major Linux distributors
offer one. Note, that these packages often don't include the examples.
\section installonmainpage Installation
Have a look at the qwt.pro project file. It is prepared for building
dynamic libraries in Win32 and Unix/X11 environments.
If you don't know what to do with it, read the file \ref qwtinstall and/or
Trolltechs
<a href="http://www.trolltech.com/developer/documentation/index.html">qmake</a> documentation. Once you have build the library you have to install
all files from the lib, include and doc directories.
\section support Support
- Mailing list\n
For all kind of Qwt related questions use the Qwt <a href="http://sourceforge.net/mail/?group_id=13693">mailing list</a>.\n
If you prefer newsgroups use the mail to news gateway of <a href="http://dir.gmane.org/gmane.comp.graphics.qwt.general">Gmane</a>.
- Forum\n
<a href="http://www.qtcentre.org">Qt Centre</a> is a great resource for Qt
related questions. It has a sub forum, that is dedicated to
Qwt related questions.
- Individual support\n
If you are looking for individual support, or need someone who implements
your Qwt component/application contact qwt-support@tigertal.de.
\section relatedprojects Related Projects
<a href="http://qwtpolar.sourceforge.net">QwtPolar</a>, a polar plot widget.\n
<a href="http://qwtplot3d.sourceforge.net">QwtPlot3D</a>, an OpenGL 3D plot widget.\n
<a href="http://soft.proindependent.com/qtiplot.html">QtiPlot</a>,
data analysis and scientific plotting tool, using QwtPlot.
\section languagebindings Language Bindings
<a href="http://pyqwt.sourceforge.net">PyQwt</a>, a set of Qwt Python bindings.\n
<a href="http://rubyforge.org/projects/korundum/">Korundum/QtRuby</a>, including a set of Qwt Ruby bindings.\n
\section donations Donations
Sourceforge offers a <a href="http://sourceforge.net/docman/display_doc.php?docid=20244&group_id=1"> Donation System</a> via PayPal. You can use it, if you like to <a href="http://sourceforge.net/project/project_donations.php?group_id=13693">support</a> the development of Qwt.
\section credits Credits:
\par Authors:
Uwe Rathmann, Josef Wilgen ( <= Qwt 0.2 )
\par Project admin:
Uwe Rathmann \<rathmann@users.sourceforge.net\>
*/
/*!
\page qwtlicense Qwt License, Version 1.0
\include "COPYING"
*/
/*!
\page qwtinstall INSTALL
\include "INSTALL"
*/
/*!
\page curvescreenshots Curve Plots
\image html plot.png
\image html sinus.png
\image html cpuplot.png
\image html graph.png
\image html curves.png
*/
/*!
\page scatterscreenshots Scatter Plot
\image html scatterplot.png
*/
/*!
\page spectrogramscreenshots Spectrogram, Contour Plot
\image html spectrogram1.png
\image html spectrogram2.png
\image html spectrogram3.png
/*!
\page histogramscreenshots Histogram
\image html histogram.png
*/
/*!
\page controlscreenshots Dials, Compasses, Knobs, Wheels, Sliders, Thermos
\image html radio.png
\image html sliders.png
\image html dials1.png
\image html dials2.png
\image html sysinfo.png
*/

350
qwt/examples/bode/bode.cpp Normal file
View File

@@ -0,0 +1,350 @@
#include <qregexp.h>
#include <qapplication.h>
#include <qtoolbar.h>
#include <qtoolbutton.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qstatusbar.h>
#include <qprinter.h>
#include <qpicture.h>
#include <qpainter.h>
#include <qfiledialog.h>
#if QT_VERSION >= 0x040300
#ifdef QT_SVG_LIB
#include <qsvggenerator.h>
#endif
#endif
#if QT_VERSION >= 0x040000
#include <qprintdialog.h>
#include <qfileinfo.h>
#else
#include <qwt_painter.h>
#endif
#include <qwt_counter.h>
#include <qwt_plot_zoomer.h>
#include <qwt_plot_panner.h>
#include <qwt_text.h>
#include <qwt_math.h>
#include "pixmaps.h"
#include "bode_plot.h"
#include "bode.h"
class Zoomer: public QwtPlotZoomer
{
public:
Zoomer(int xAxis, int yAxis, QwtPlotCanvas *canvas):
QwtPlotZoomer(xAxis, yAxis, canvas)
{
setSelectionFlags(QwtPicker::DragSelection | QwtPicker::CornerToCorner);
setTrackerMode(QwtPicker::AlwaysOff);
setRubberBand(QwtPicker::NoRubberBand);
// RightButton: zoom out by 1
// Ctrl+RightButton: zoom out to full size
#if QT_VERSION < 0x040000
setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlButton);
#else
setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier);
#endif
setMousePattern(QwtEventPattern::MouseSelect3,
Qt::RightButton);
}
};
//-----------------------------------------------------------------
//
// bode.cpp -- A demo program featuring QwtPlot and QwtCounter
//
// This example demonstrates the mapping of different curves
// to different axes in a QwtPlot widget. It also shows how to
// display the cursor position and how to implement zooming.
//
//-----------------------------------------------------------------
MainWin::MainWin(QWidget *parent):
QMainWindow(parent)
{
d_plot = new BodePlot(this);
d_plot->setMargin(5);
#if QT_VERSION >= 0x040000
setContextMenuPolicy(Qt::NoContextMenu);
#endif
d_zoomer[0] = new Zoomer( QwtPlot::xBottom, QwtPlot::yLeft,
d_plot->canvas());
d_zoomer[0]->setRubberBand(QwtPicker::RectRubberBand);
d_zoomer[0]->setRubberBandPen(QColor(Qt::green));
d_zoomer[0]->setTrackerMode(QwtPicker::ActiveOnly);
d_zoomer[0]->setTrackerPen(QColor(Qt::white));
d_zoomer[1] = new Zoomer(QwtPlot::xTop, QwtPlot::yRight,
d_plot->canvas());
d_panner = new QwtPlotPanner(d_plot->canvas());
d_panner->setMouseButton(Qt::MidButton);
d_picker = new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft,
QwtPicker::PointSelection | QwtPicker::DragSelection,
QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOn,
d_plot->canvas());
d_picker->setRubberBandPen(QColor(Qt::green));
d_picker->setRubberBand(QwtPicker::CrossRubberBand);
d_picker->setTrackerPen(QColor(Qt::white));
setCentralWidget(d_plot);
QToolBar *toolBar = new QToolBar(this);
QToolButton *btnZoom = new QToolButton(toolBar);
#if QT_VERSION >= 0x040000
btnZoom->setText("Zoom");
btnZoom->setIcon(QIcon(zoom_xpm));
btnZoom->setCheckable(true);
btnZoom->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
#else
btnZoom->setTextLabel("Zoom");
btnZoom->setPixmap(zoom_xpm);
btnZoom->setToggleButton(true);
btnZoom->setUsesTextLabel(true);
#endif
QToolButton *btnPrint = new QToolButton(toolBar);
#if QT_VERSION >= 0x040000
btnPrint->setText("Print");
btnPrint->setIcon(QIcon(print_xpm));
btnPrint->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
#else
btnPrint->setTextLabel("Print");
btnPrint->setPixmap(print_xpm);
btnPrint->setUsesTextLabel(true);
#endif
#if QT_VERSION < 0x040000
QToolButton *btnSVG = new QToolButton(toolBar);
btnSVG->setTextLabel("SVG");
btnSVG->setPixmap(print_xpm);
btnSVG->setUsesTextLabel(true);
#elif QT_VERSION >= 0x040300
#ifdef QT_SVG_LIB
QToolButton *btnSVG = new QToolButton(toolBar);
btnSVG->setText("SVG");
btnSVG->setIcon(QIcon(print_xpm));
btnSVG->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
#endif
#endif
#if QT_VERSION >= 0x040000
toolBar->addWidget(btnZoom);
toolBar->addWidget(btnPrint);
#if QT_VERSION >= 0x040300
#ifdef QT_SVG_LIB
toolBar->addWidget(btnSVG);
#endif
#endif
#endif
toolBar->addSeparator();
QWidget *hBox = new QWidget(toolBar);
QHBoxLayout *layout = new QHBoxLayout(hBox);
layout->setSpacing(0);
layout->addWidget(new QWidget(hBox), 10); // spacer
layout->addWidget(new QLabel("Damping Factor", hBox), 0);
layout->addSpacing(10);
QwtCounter *cntDamp = new QwtCounter(hBox);
cntDamp->setRange(0.0, 5.0, 0.01);
cntDamp->setValue(0.0);
layout->addWidget(cntDamp, 0);
#if QT_VERSION >= 0x040000
(void)toolBar->addWidget(hBox);
#else
toolBar->setStretchableWidget(hBox);
#endif
addToolBar(toolBar);
#ifndef QT_NO_STATUSBAR
(void)statusBar();
#endif
enableZoomMode(false);
showInfo();
connect(cntDamp, SIGNAL(valueChanged(double)),
d_plot, SLOT(setDamp(double)));
connect(btnPrint, SIGNAL(clicked()), SLOT(print()));
#if QT_VERSION < 0x040000
connect(btnSVG, SIGNAL(clicked()), SLOT(exportSVG()));
#elif QT_VERSION >= 0x040300
#ifdef QT_SVG_LIB
connect(btnSVG, SIGNAL(clicked()), SLOT(exportSVG()));
#endif
#endif
connect(btnZoom, SIGNAL(toggled(bool)), SLOT(enableZoomMode(bool)));
connect(d_picker, SIGNAL(moved(const QPoint &)),
SLOT(moved(const QPoint &)));
connect(d_picker, SIGNAL(selected(const QwtPolygon &)),
SLOT(selected(const QwtPolygon &)));
}
void MainWin::print()
{
#if 1
QPrinter printer;
#else
QPrinter printer(QPrinter::HighResolution);
#if QT_VERSION < 0x040000
printer.setOutputToFile(true);
printer.setOutputFileName("/tmp/bode.ps");
printer.setColorMode(QPrinter::Color);
#else
printer.setOutputFileName("/tmp/bode.pdf");
#endif
#endif
QString docName = d_plot->title().text();
if ( !docName.isEmpty() )
{
docName.replace (QRegExp (QString::fromLatin1 ("\n")), tr (" -- "));
printer.setDocName (docName);
}
printer.setCreator("Bode example");
printer.setOrientation(QPrinter::Landscape);
#if QT_VERSION >= 0x040000
QPrintDialog dialog(&printer);
if ( dialog.exec() )
{
#else
if (printer.setup())
{
#endif
QwtPlotPrintFilter filter;
if ( printer.colorMode() == QPrinter::GrayScale )
{
int options = QwtPlotPrintFilter::PrintAll;
options &= ~QwtPlotPrintFilter::PrintBackground;
options |= QwtPlotPrintFilter::PrintFrameWithScales;
filter.setOptions(options);
}
d_plot->print(printer, filter);
}
}
void MainWin::exportSVG()
{
QString fileName = "bode.svg";
#if QT_VERSION < 0x040000
#ifndef QT_NO_FILEDIALOG
fileName = QFileDialog::getSaveFileName(
"bode.svg", "SVG Documents (*.svg)", this);
#endif
if ( !fileName.isEmpty() )
{
// enable workaround for Qt3 misalignments
QwtPainter::setSVGMode(true);
QPicture picture;
QPainter p(&picture);
d_plot->print(&p, QRect(0, 0, 800, 600));
p.end();
picture.save(fileName, "svg");
}
#elif QT_VERSION >= 0x040300
#ifdef QT_SVG_LIB
#ifndef QT_NO_FILEDIALOG
fileName = QFileDialog::getSaveFileName(
this, "Export File Name", QString(),
"SVG Documents (*.svg)");
#endif
if ( !fileName.isEmpty() )
{
QSvgGenerator generator;
generator.setFileName(fileName);
generator.setSize(QSize(800, 600));
d_plot->print(generator);
}
#endif
#endif
}
void MainWin::enableZoomMode(bool on)
{
d_panner->setEnabled(on);
d_zoomer[0]->setEnabled(on);
d_zoomer[0]->zoom(0);
d_zoomer[1]->setEnabled(on);
d_zoomer[1]->zoom(0);
d_picker->setEnabled(!on);
showInfo();
}
void MainWin::showInfo(QString text)
{
if ( text == QString::null )
{
if ( d_picker->rubberBand() )
text = "Cursor Pos: Press left mouse button in plot region";
else
text = "Zoom: Press mouse button and drag";
}
#ifndef QT_NO_STATUSBAR
#if QT_VERSION >= 0x040000
statusBar()->showMessage(text);
#else
statusBar()->message(text);
#endif
#endif
}
void MainWin::moved(const QPoint &pos)
{
QString info;
info.sprintf("Freq=%g, Ampl=%g, Phase=%g",
d_plot->invTransform(QwtPlot::xBottom, pos.x()),
d_plot->invTransform(QwtPlot::yLeft, pos.y()),
d_plot->invTransform(QwtPlot::yRight, pos.y())
);
showInfo(info);
}
void MainWin::selected(const QwtPolygon &)
{
showInfo();
}
int main (int argc, char **argv)
{
QApplication a(argc, argv);
MainWin w;
#if QT_VERSION < 0x040000
a.setMainWidget(&w);
#endif
w.resize(540,400);
w.show();
int rv = a.exec();
return rv;
}

32
qwt/examples/bode/bode.h Normal file
View File

@@ -0,0 +1,32 @@
#include <qmainwindow.h>
#include <qwt_polygon.h>
class QwtPlotZoomer;
class QwtPlotPicker;
class QwtPlotPanner;
class BodePlot;
class MainWin : public QMainWindow
{
Q_OBJECT
public:
MainWin(QWidget *parent = 0);
private slots:
void moved(const QPoint &);
void selected(const QwtPolygon &);
void print();
void exportSVG();
void enableZoomMode(bool);
private:
void showInfo(QString text = QString::null);
BodePlot *d_plot;
QwtPlotZoomer *d_zoomer[2];
QwtPlotPicker *d_picker;
QwtPlotPanner *d_panner;
};

View File

@@ -0,0 +1,23 @@
# -*- mode: sh -*- ################################################
# Qwt Widget Library
# Copyright (C) 1997 Josef Wilgen
# Copyright (C) 2002 Uwe Rathmann
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the Qwt License, Version 1.0
###################################################################
include( ../examples.pri )
TARGET = bode
QT += svg
HEADERS = \
bode.h \
bode_plot.h \
cplx.h \
pixmaps.h
SOURCES = \
bode.cpp \
bode_plot.cpp

View File

@@ -0,0 +1,181 @@
#include <qwt_math.h>
#include <qwt_scale_engine.h>
#include <qwt_symbol.h>
#include <qwt_plot_grid.h>
#include <qwt_plot_marker.h>
#include <qwt_plot_curve.h>
#include <qwt_legend.h>
#include <qwt_text.h>
#include "cplx.h"
#include "bode_plot.h"
static void logSpace(double *array, int size, double xmin, double xmax)
{
if ((xmin <= 0.0) || (xmax <= 0.0) || (size <= 0))
return;
const int imax = size -1;
array[0] = xmin;
array[imax] = xmax;
const double lxmin = log(xmin);
const double lxmax = log(xmax);
const double lstep = (lxmax - lxmin) / double(imax);
for (int i = 1; i < imax; i++)
array[i] = exp(lxmin + double(i) * lstep);
}
BodePlot::BodePlot(QWidget *parent):
QwtPlot(parent)
{
setAutoReplot(false);
setTitle("Frequency Response of a Second-Order System");
setCanvasBackground(QColor(Qt::darkBlue));
// legend
QwtLegend *legend = new QwtLegend;
legend->setFrameStyle(QFrame::Box|QFrame::Sunken);
insertLegend(legend, QwtPlot::BottomLegend);
// grid
QwtPlotGrid *grid = new QwtPlotGrid;
grid->enableXMin(true);
grid->setMajPen(QPen(Qt::white, 0, Qt::DotLine));
grid->setMinPen(QPen(Qt::gray, 0 , Qt::DotLine));
grid->attach(this);
// axes
enableAxis(QwtPlot::yRight);
setAxisTitle(QwtPlot::xBottom, "Normalized Frequency");
setAxisTitle(QwtPlot::yLeft, "Amplitude [dB]");
setAxisTitle(QwtPlot::yRight, "Phase [deg]");
setAxisMaxMajor(QwtPlot::xBottom, 6);
setAxisMaxMinor(QwtPlot::xBottom, 10);
setAxisScaleEngine(QwtPlot::xBottom, new QwtLog10ScaleEngine);
// curves
d_crv1 = new QwtPlotCurve("Amplitude");
#if QT_VERSION >= 0x040000
d_crv1->setRenderHint(QwtPlotItem::RenderAntialiased);
#endif
d_crv1->setPen(QPen(Qt::yellow));
d_crv1->setYAxis(QwtPlot::yLeft);
d_crv1->attach(this);
d_crv2 = new QwtPlotCurve("Phase");
#if QT_VERSION >= 0x040000
d_crv2->setRenderHint(QwtPlotItem::RenderAntialiased);
#endif
d_crv2->setPen(QPen(Qt::cyan));
d_crv2->setYAxis(QwtPlot::yRight);
d_crv2->attach(this);
// marker
d_mrk1 = new QwtPlotMarker();
d_mrk1->setValue(0.0, 0.0);
d_mrk1->setLineStyle(QwtPlotMarker::VLine);
d_mrk1->setLabelAlignment(Qt::AlignRight | Qt::AlignBottom);
d_mrk1->setLinePen(QPen(Qt::green, 0, Qt::DashDotLine));
d_mrk1->attach(this);
d_mrk2 = new QwtPlotMarker();
d_mrk2->setLineStyle(QwtPlotMarker::HLine);
d_mrk2->setLabelAlignment(Qt::AlignRight | Qt::AlignBottom);
d_mrk2->setLinePen(QPen(QColor(200,150,0), 0, Qt::DashDotLine));
d_mrk2->setSymbol( QwtSymbol(QwtSymbol::Diamond,
QColor(Qt::yellow), QColor(Qt::green), QSize(7,7)));
d_mrk2->attach(this);
setDamp(0.0);
setAutoReplot(true);
}
void BodePlot::showData(double *frequency, double *amplitude,
double *phase, int count)
{
d_crv1->setData(frequency, amplitude, count);
d_crv2->setData(frequency, phase, count);
}
void BodePlot::showPeak(double freq, double amplitude)
{
QString label;
label.sprintf("Peak: %.3g dB", amplitude);
QwtText text(label);
text.setFont(QFont("Helvetica", 10, QFont::Bold));
text.setColor(QColor(200,150,0));
d_mrk2->setValue(freq, amplitude);
d_mrk2->setLabel(text);
}
void BodePlot::show3dB(double freq)
{
QString label;
label.sprintf("-3 dB at f = %.3g", freq);
QwtText text(label);
text.setFont(QFont("Helvetica", 10, QFont::Bold));
text.setColor(Qt::green);
d_mrk1->setValue(freq, 0.0);
d_mrk1->setLabel(text);
}
//
// re-calculate frequency response
//
void BodePlot::setDamp(double damping)
{
const bool doReplot = autoReplot();
setAutoReplot(false);
const int ArraySize = 200;
double frequency[ArraySize];
double amplitude[ArraySize];
double phase[ArraySize];
// build frequency vector with logarithmic division
logSpace(frequency, ArraySize, 0.01, 100);
int i3 = 1;
double fmax = 1;
double amax = -1000.0;
for (int i = 0; i < ArraySize; i++)
{
double f = frequency[i];
cplx g = cplx(1.0) / cplx(1.0 - f * f, 2.0 * damping * f);
amplitude[i] = 20.0 * log10(sqrt( g.real()*g.real() + g.imag()*g.imag()));
phase[i] = atan2(g.imag(), g.real()) * (180.0 / M_PI);
if ((i3 <= 1) && (amplitude[i] < -3.0))
i3 = i;
if (amplitude[i] > amax)
{
amax = amplitude[i];
fmax = frequency[i];
}
}
double f3 = frequency[i3] -
(frequency[i3] - frequency[i3 - 1])
/ (amplitude[i3] - amplitude[i3 -1]) * (amplitude[i3] + 3);
showPeak(fmax, amax);
show3dB(f3);
showData(frequency, amplitude, phase, ArraySize);
setAutoReplot(doReplot);
replot();
}

View File

@@ -0,0 +1,25 @@
#include <qwt_plot.h>
class QwtPlotCurve;
class QwtPlotMarker;
class BodePlot: public QwtPlot
{
Q_OBJECT
public:
BodePlot(QWidget *parent);
public slots:
void setDamp(double damping);
private:
void showData(double *frequency, double *amplitude,
double *phase, int count);
void showPeak(double freq, double amplitude);
void show3dB(double freq);
QwtPlotCurve *d_crv1;
QwtPlotCurve *d_crv2;
QwtPlotMarker *d_mrk1;
QwtPlotMarker *d_mrk2;
};

62
qwt/examples/bode/cplx.h Normal file
View File

@@ -0,0 +1,62 @@
#ifndef BODE_CPLX_H
#define BODE_CPLX_H
#include <math.h>
class cplx {
private:
double re,im;
public:
double real() {return re;}
double imag() {return im;}
cplx() {
re = 0.0;
im = -0.0;
}
cplx& operator= (cplx a) {
re = a.re;
im = a.im;
return *this;
}
cplx(double r, double i = 0.0) {
re = r;
im = i;
}
friend cplx operator * (cplx x1, cplx x2);
friend cplx operator + (cplx x1, cplx x2);
friend cplx operator - (cplx x1, cplx x2);
friend cplx operator / (cplx x1, cplx x2);
};
inline cplx operator+(cplx x1, cplx x2)
{
return cplx(x1.re + x2.re, x1.im + x2.im);
}
inline cplx operator-(cplx x1, cplx x2)
{
return cplx(x1.re - x2.re, x1.im - x2.im);
}
inline cplx operator*(cplx x1, cplx x2)
{
return cplx(x1.re * x2.re - x1.im * x2.im,
x1.re * x2.im + x2.re * x1.im);
}
inline cplx operator/(cplx x1, cplx x2)
{
double denom = x2.re * x2.re + x2.im * x2.im;
return cplx( (x1.re * x2.re + x1.im * x2.im) /denom,
(x1.im * x2.re - x2.im * x1.re) / denom);
}
#endif

View File

@@ -0,0 +1,95 @@
#ifndef PIXMAPS_H
#define PIXMAPS_H
static const char *print_xpm[]={
"32 32 12 1",
"a c #ffffff",
"h c #ffff00",
"c c #ffffff",
"f c #dcdcdc",
"b c #c0c0c0",
"j c #a0a0a4",
"e c #808080",
"g c #808000",
"d c #585858",
"i c #00ff00",
"# c #000000",
". c None",
"................................",
"................................",
"...........###..................",
"..........#abb###...............",
".........#aabbbbb###............",
".........#ddaaabbbbb###.........",
"........#ddddddaaabbbbb###......",
".......#deffddddddaaabbbbb###...",
"......#deaaabbbddddddaaabbbbb###",
".....#deaaaaaaabbbddddddaaabbbb#",
"....#deaaabbbaaaa#ddedddfggaaad#",
"...#deaaaaaaaaaa#ddeeeeafgggfdd#",
"..#deaaabbbaaaa#ddeeeeabbbbgfdd#",
".#deeefaaaaaaa#ddeeeeabbhhbbadd#",
"#aabbbeeefaaa#ddeeeeabbbbbbaddd#",
"#bbaaabbbeee#ddeeeeabbiibbadddd#",
"#bbbbbaaabbbeeeeeeabbbbbbaddddd#",
"#bjbbbbbbaaabbbbeabbbbbbadddddd#",
"#bjjjjbbbbbbaaaeabbbbbbaddddddd#",
"#bjaaajjjbbbbbbaaabbbbadddddddd#",
"#bbbbbaaajjjbbbbbbaaaaddddddddd#",
"#bjbbbbbbaaajjjbbbbbbddddddddd#.",
"#bjjjjbbbbbbaaajjjbbbdddddddd#..",
"#bjaaajjjbbbbbbjaajjbddddddd#...",
"#bbbbbaaajjjbbbjbbaabdddddd#....",
"###bbbbbbaaajjjjbbbbbddddd#.....",
"...###bbbbbbaaajbbbbbdddd#......",
"......###bbbbbbjbbbbbddd#.......",
".........###bbbbbbbbbdd#........",
"............###bbbbbbd#.........",
"...............###bbb#..........",
"..................###..........."};
static const char *zoom_xpm[]={
"32 32 8 1",
"# c #000000",
"b c #c0c0c0",
"a c #ffffff",
"e c #585858",
"d c #a0a0a4",
"c c #0000ff",
"f c #00ffff",
". c None",
"..######################........",
".#a#baaaaaaaaaaaaaaaaaa#........",
"#aa#baaaaaaaaaaaaaccaca#........",
"####baaaaaaaaaaaaaaaaca####.....",
"#bbbbaaaaaaaaaaaacccaaa#da#.....",
"#aaaaaaaaaaaaaaaacccaca#da#.....",
"#aaaaaaaaaaaaaaaaaccaca#da#.....",
"#aaaaaaaaaabe###ebaaaaa#da#.....",
"#aaaaaaaaa#########aaaa#da#.....",
"#aaaaaaaa###dbbbb###aaa#da#.....",
"#aaaaaaa###aaaaffb###aa#da#.....",
"#aaaaaab##aaccaaafb##ba#da#.....",
"#aaaaaae#daaccaccaad#ea#da#.....",
"#aaaaaa##aaaaaaccaab##a#da#.....",
"#aaaaaa##aacccaaaaab##a#da#.....",
"#aaaaaa##aaccccaccab##a#da#.....",
"#aaaaaae#daccccaccad#ea#da#.....",
"#aaaaaab##aacccaaaa##da#da#.....",
"#aaccacd###aaaaaaa###da#da#.....",
"#aaaaacad###daaad#####a#da#.....",
"#acccaaaad##########da##da#.....",
"#acccacaaadde###edd#eda#da#.....",
"#aaccacaaaabdddddbdd#eda#a#.....",
"#aaaaaaaaaaaaaaaaaadd#eda##.....",
"#aaaaaaaaaaaaaaaaaaadd#eda#.....",
"#aaaaaaaccacaaaaaaaaadd#eda#....",
"#aaaaaaaaaacaaaaaaaaaad##eda#...",
"#aaaaaacccaaaaaaaaaaaaa#d#eda#..",
"########################dd#eda#.",
"...#dddddddddddddddddddddd##eda#",
"...#aaaaaaaaaaaaaaaaaaaaaa#.####",
"...########################..##."};
#endif

View File

@@ -0,0 +1,57 @@
#include <qpainter.h>
#include <qwt_scale_map.h>
#include <qwt_plot_curve.h>
#include "cpuplot.h"
#include "cpupiemarker.h"
CpuPieMarker::CpuPieMarker()
{
setZ(1000);
#if QT_VERSION >= 0x040000
setRenderHint(QwtPlotItem::RenderAntialiased, true);
#endif
}
int CpuPieMarker::rtti() const
{
return QwtPlotItem::Rtti_PlotUserItem;
}
void CpuPieMarker::draw(QPainter *p,
const QwtScaleMap &, const QwtScaleMap &,
const QRect &rect) const
{
const CpuPlot *cpuPlot = (CpuPlot *)plot();
const QwtScaleMap yMap = cpuPlot->canvasMap(QwtPlot::yLeft);
const int margin = 5;
QRect pieRect;
pieRect.setX(rect.x() + margin);
pieRect.setY(rect.y() + margin);
pieRect.setHeight(yMap.transform(80.0));
pieRect.setWidth(pieRect.height());
const int dataType[] = { CpuPlot::User, CpuPlot::System, CpuPlot::Idle };
int angle = (int)(5760 * 0.75);
for ( unsigned int i = 0;
i < sizeof(dataType) / sizeof(dataType[0]); i++ )
{
const QwtPlotCurve *curve = cpuPlot->cpuCurve(dataType[i]);
if ( curve->dataSize() > 0 )
{
const int value = (int)(5760 * curve->y(0) / 100.0);
p->save();
p->setBrush(QBrush(curve->pen().color(), Qt::SolidPattern));
if ( value != 0 )
p->drawPie(pieRect, -angle, -value);
p->restore();
angle += value;
}
}
}

View File

@@ -0,0 +1,18 @@
//-----------------------------------------------------------------
// This class shows how to extend QwtPlotItems. It displays a
// pie chart of user/total/idle cpu usage in percent.
//-----------------------------------------------------------------
#include <qwt_plot_item.h>
class CpuPieMarker: public QwtPlotItem
{
public:
CpuPieMarker();
virtual int rtti() const;
virtual void draw(QPainter *p,
const QwtScaleMap &, const QwtScaleMap &,
const QRect &rect) const;
};

Some files were not shown because too many files have changed in this diff Show More