Commit Graph

20 Commits

Author SHA1 Message Date
Eric Johnson
8de642c9ed Use float division when converting wheel size
In training mode, calculations of speed using wheel size and RPM from
a speed sensor used integer division. This truncated all wheel
circumferences to an integral number of meters. 2100mm wheels were
treated as 2 meters and 1960mm wheels were treated as 1 meter,
effectively reducing calculated speeds by roughly 5% and 50%
respectively.

Fixes #585
Fixes #651
Fixes #669
2013-09-21 17:29:26 +01:00
Mark Liversedge
4df7af1f09 Kickr Fixups for WF Api 3.0beta08
.. still has a 20sec connection issue
.. no longer crashes on BTLE reset
2013-03-16 21:48:10 +00:00
Mark Liversedge
96ddf765c3 Kickr connection fail gracefully
.. the code assumes the kickr connection will always work, even
when no BTLE hardware is present.

If no BTLE hardware is available then connections fail immediately
and so do attempts to find devices.

If BTLE hardware is available but the kickr connection cannot be
established in 30 seconds in train view then it returns an error.

Also added better device descriptions to check the device subtype
so we can identify stages, inride and kickr separately.
2013-02-07 09:16:46 +00:00
Mark Liversedge
c9571e0d8b BT40 / Kickr device discovery
Ensure the Kickr and BT40 devices can co-exist by
ignoring subtypes.

Also introduced a deviceFound signal so we can get a
device pairing page for BT40 (non-Kickr) devices.
2013-01-30 10:47:01 +00:00
Mark Liversedge
d0e96dcd47 BT40 Skeleton code
To enable support of BTLE (BT 4.0 'smart') devices
as well as the Kickr.

Very basic skeleton code to get started. Will need
to;
- add a BTLE 'pair' in AddDeviceWizard
- use profile not portspec for the uuids
- filter out RFLKT and KICKR as they have their
  own device types
- fixup BT40.cpp which is KICKR code in this commit
2013-01-29 20:28:43 +00:00
Mark Liversedge
0bdafbd24b WF Api support multiple connections
Changed the WF API wrapper to return a sensor connection
descriptor (int) in the same way open/close system calls
return a file descriptor.

This means we will be able to setup multiple connections
at once .. but not neccessarily in separate threads.
2013-01-28 21:40:00 +00:00
Mark Liversedge
f1cf87fec4 Kickr BTLE connection fixup
No need to scan first, connect directly to
the previouslt paired device uuid.

By no longer scanning we can have multiple
threads connecting at once without conflicting
with each other.
2013-01-28 19:43:00 +00:00
Mark Liversedge
9724282ccc Kickr load setting fixups
The load setting was not working properly, this update
ensures the load is set 10 times a second, but will
generate errors even though the device claims to be
connected.

Also added a few new methods to get/singal connection
status in the code.
2013-01-27 19:17:04 +00:00
Mark Liversedge
2917ab8c36 Kickr: Load setting fixup
Fixed up the Kickr code to resend the load if the
user is generating more than 50% over the load or
is only generating 50% of the load.

This is in case the last message was not processed
for some reason (connection being established, or
noise).
2013-01-27 15:49:55 +00:00
Mark Liversedge
20bb581fb5 Cocoa Memory Management Fixups
A number of memory management errors fixed, no doubt there
are more lurking in there.

* CocoaInitializer now sets up an application wide NSAutoreleasePool
* Kickr now init/releases an NSAutoreleasePool for its thread
* Local autorelease pools in constructors etc have been removed
* Searchbox and Button no longer release in the constructor

The icon corruption seems to be improved (I think it is a memory
management issue) but has not been totally removed.
2013-01-26 12:36:23 +00:00
Mark Liversedge
c25fda7701 Kickr BTLE Support (Beta)
This finalises beta support for the Wahoo Kickr
using their WFConnector API for BTLE.

This support will only work on Mac OSX - pending
ANT+ support to be available and/or BTLE support
is made available on Windows and Linux.

Fixes #446.
2013-01-23 22:08:10 +00:00
Mark Liversedge
33946c9012 Kickr mutex for thread safety
Ensure the member variables are only maintained in
one thread at a time.
2013-01-23 08:44:53 +00:00
Mark Liversedge
f8e2907fa0 Kickr speed calculation
.. using device configuration and wheel RPM.
2013-01-22 22:19:30 +00:00
Mark Liversedge
79be79d563 Kickr basic functionality
.. connects and disconnects to the Kickr
.. gets instant telemetry

Still need to sort the other channels (are there
any?) and also set load and gradient.

Pretty close and need to then clean up the qDebug
messages and we have a first pass at Kickr support.
2013-01-22 21:10:18 +00:00
Mark Liversedge
2228c2775f Kickr connect should fail if no BTLE hardware
Returns immediately if trying to connect when there is no
BTLE hardware available.
2013-01-22 13:09:02 +00:00
Mark Liversedge
ed40f0338b Fixed initial Kickr connection issues
It was because the connector was still searching when
asked it to connect to a sensor. We now cancel any
search before attempting to connect.

But sadly, the connection is dropped and a bunch of
error messages popup about firmware.
2013-01-21 21:36:37 +00:00
Mark Liversedge
82f8c7f3d3 Kickr checkpoint, connect errors
Can discover device but cannot connect. Checkpoint
commit as done for the night.
2013-01-21 20:27:55 +00:00
Mark Liversedge
2fe0644b9a Kickr device configuration complete
The code to discover and setup a Kickr device has
been finished. The portspec is used to hold the device
UUID for later connection.
2013-01-21 16:24:14 +00:00
Mark Liversedge
65e7faacba Kickr Checkpoint Commit
.. device discovery working after a bit of
heartache with blocking threads and signals.
2013-01-21 13:05:49 +00:00
Mark Liversedge
4a42337fa2 Kickr Skeleton Code
Added Skeleton code for device discovery, config
and runtime. Now need to develop the WFApi class
to support each function.
2013-01-20 19:11:16 +00:00