Commit Graph

35 Commits

Author SHA1 Message Date
Mark Liversedge
d95a03ed2f Code Cleanup: Device Downloading
.. all comments are suggestions not mandatory and we have a feature
request system for that.
2013-02-11 14:12:41 +00:00
Rainer Clasen
a2af765f31 Remove Boost - SrmDevice
converted SrmDevice to use signals instead of callback.
Also add missing erase connections.

Signed-off-by: Andy Bryson <agbryson@gmail.com>
2012-12-29 18:32:22 +00:00
Andy Bryson
ff546e8471 Remove Boost Dependency - The Easy Bits
Replace boost stuff with QT or C++ equivalents
2012-12-27 17:04:36 +00:00
Alejandro Martinez
8e179cfbfb Enable RideFile seriesName translation
Also changed all references to QObject::tr for a version with the proper context
2012-12-20 15:55:47 -03:00
Rainer Clasen
0c1e1dd2a5 SrmDevice: fix catching broken downloads
broken downloads weren't detected, properly. This caused empty files to be
created.
2012-07-30 18:55:50 +02:00
Rainer Clasen
c1cd91b538 SrmDevice: fixed marker offsets
marker offsets were off by one. This could lead to bad indices when adding
an "open" marker at the end of a recording.
2012-03-22 10:58:47 +01:00
Rainer Clasen
6a66bbb82c SrmDevice: use srmio logging callback
use srmios builtin logging functionality. Nuked code copying srmios
logging.
2012-02-11 21:04:15 +01:00
Rainer Clasen
85132fce44 SrmDevice: fix counting skipped blocks
block counter wasn't increased for skipped blocks. Just a cosmetic issue,
as block counter was used for progress and status messages, only.
2012-02-11 21:03:14 +01:00
Rainer Clasen
dda86936a1 SrmDevice: fix rideList population
oops, overwrote the startTime, accidently. Wondering how this passed any
testing as this resulted in all blocks being skipped.

Added explicit initialization of wanted field, aswell.
2012-02-11 20:57:05 +01:00
Rainer Clasen
d3184df0c6 SrmDevice: moved status reporting to open method
so that it's not limited to downloads, only. Helps investigating erase
issues.
2012-02-11 15:19:24 +01:00
Rainer Clasen
1490102e8d Device: allow status updates from all methods
turned statusCallback into a member of Device (instead of a parameter to
download() and preview(). This allows all methods to access it, directly
and provide better feedback during open/close/erase.
2012-02-11 15:07:31 +01:00
Rainer Clasen
e3d6c17288 SrmDevice: use srmio win-comm when available
srmio just introduced support for the win32 Comm API. This patch allows us
to use it.
2012-02-11 14:25:26 +01:00
Rainer Clasen
2215dca141 use new srmio error reporting
hopefully we'll get more helpfull error reports due to more detailed and
unique error messages.
2011-08-27 23:05:24 +02:00
Rainer Clasen
d6200ec2d9 Download: provide end time for ride blocks
for better guessing in preview ,)
2011-08-27 23:05:24 +02:00
Rainer Clasen
bb002013f6 SrmDevice: sync port support with srmio
The comm port types supported by srmio may vary depending on the build
system (no ftd2xx.h, no termios, ...).

This commit keeps GoldenCheetah from using unsupported srmio port types
based on the srmio build.
2011-07-26 10:46:01 +02:00
Rainer Clasen
f8c31271e3 SrmDevice: support D2XX with srmio, as well
added the last bits to use the libftd2xx support I just wrote for srmio.
In other words: this needs an update srmio from github, again.
2011-07-26 02:18:06 +02:00
Rainer Clasen
61ade35920 download: port list comfort
if the devices have a way to identify which CommPort they support and if
CommPorts are just for this device, this is now taken into account for the
port combo box:

Unsupported ports (i.e. currently D2xx for srm) aren't shown for the
selected device type.

Serial ports that are hard-wired to a certain device type (like built in
USB2Serial adapters in PC6/7) aren't offered for other devices, as well.

As a temporary hack, this PCV claims /dev/cu.*PL2303 to be "his". Of
course this has to go, if/when we start supporting other devices with
built in prolific usb2serial adapter or native serial interface (that
might get connected to a prolific adapter).

If we find a way to gather more details for the available ports, we can
extend this quite easily. Possible ideas:
 - hald (obsolete)
 - libudev (linux specific)
 - kdelibs solid (linux specific?)
2011-07-25 17:05:32 +02:00
Rainer Clasen
54365675f4 SrmDevice: re-added data fixup
during the transition to the new API the data fixup (mostly for PCV) got
lost.

re-added data fixup.
2011-07-25 09:04:05 +02:00
Rainer Clasen
dac52789c4 SrmDevice: switched to full API
implemented preview().

download() now gets only selected blocks.
download() splits data into several files.
2011-07-24 17:14:48 +02:00
Rainer Clasen
9c3bab727c allow download of multiple files - for PC7
The new powercontrols have a lot more memory and they allow you to
selectively download the recorded "rides". Looking at srmwin, this seems
to be the suggested way of operation. (i.e. record multiple workouts,
download only the "new" ones).

Furthermore, the SRM file format has some limits (timespan, total number
of records), that make it inapropriate to store "all rides" into one file
and split it later.

So download now
- tries to get a list of rides of the device
  - if it gets any, the user can get prompted to choose which to download.
- let device download (selected/all) rides, split if necessary and return
  a list with tmp filename, start time, file extension.
- download dialog builds new filename based on time, prompts user for
  overwriting when file exists and renames file.

The download Dialog now stays open, so user can read the status messages
and click "cleanup". This avoids many of the anoying message boxes we had
in the Srm download.

Cleanup's user interaction (confirmation, errors) was moved from the
individual device to DownloadDialog, as well.
2011-07-24 16:58:50 +02:00
Rainer Clasen
68398cba33 SrmDevice: re-use open code
made srmio handles attributes of the SrmDevice class and added methods to
allocate/open/close/free these handles. So download() + cleanup() can use
the same code.

As a goodie the handles stay open after download and the second
initialization on cleanup() is skipped - saving some time. Well,
assuming the caller reuses the same SrmDevice instance.

SrmDevice destructor takes care of closing/freeing the srmio handles
automagically.
2011-07-24 15:47:38 +02:00
Rainer Clasen
dbfbe50df6 split Device class to allow keeping download state
right now there's just one object for each Device type througout the whole
app. This forbids keeping actual state in the Device object during
download/cleanup.

This patch puts the list of supported Devices into a seperate class.
Actual Device objects are now created dynamically.

This is necessary for the upcoming Download changes.
2011-07-24 15:47:28 +02:00
Rainer Clasen
02d3b6e733 use new srmio API - allowing PC7 support
srmio changed it's API completely. Adopted SrmDevice to use new API.

As a first step, we keep using the "simple" API to save everything into a
single file.

While this works fine for PCV, this will run into limitations of the SRM
file format, quite soon. This needs to be addressed in another step.
2011-07-24 13:47:03 +02:00
Rainer Clasen
0b4d46cdfe CommPort: keep device names seperate
CommPort::name used to prefix the actual device name/path with the actual
device type to make it unique. This is used in DownloadRideDialog to map
the device dropdown list to the actual device.

This patch seperates name + device type to make the hack in SrmDevice a
bit less ugly: srmio doesn't use the built in CommPort abstraction and
needs the unmodified device names. This is still ugly, but I can't come up
with anything better (... for now).
2011-07-24 13:46:47 +02:00
Mark Liversedge
805e74de5a Inital V3 Branch 2010-12-30 17:35:23 +00:00
Sean Rhea
3b0c4e635e 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-06 11:38:56 -08:00
Rainer Clasen
2a91250a08 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
1961b6bfe4 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
Rainer Clasen
bc61223729 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
Sean Rhea
e47ef623ca 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
fc80df4040 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
f223e9c2e8 don't clear/close device if open fails 2009-08-18 04:51:48 -07:00
Sean Rhea
5c0ad5da25 add option to clear srm memory after download 2009-08-18 04:37:50 -07:00
Sean Rhea
d62a9cf1b2 fix include path to srmio.h 2009-08-18 03:12:19 -07:00
Sean Rhea
264d565968 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