mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 16:39:57 +00:00
Introduce a wizard for adding realtime devices since it is prone to user error, is relatively complicated and is something most users will only ever do once or twice. There are several logical updates within this patch: First; Fix intermittent ANT+ not working * LibUsb - check bufRemaining is > 0 not non-zero * LibUsb - Always reset the USB stick on open * ANT.cpp - Support > 4 channels on USB2 * ANTChannel - Do not use pairing, but always * unassign, assign and set channel id. Second; Fix device discovery * Find and discover support in realtime controllers * Extend Serial.cpp to cover more Serial devices * Support for 4 or 8 ANT channels for USB1/USB2 Third; Introduce Add Device Wizard with * General and Specific wizard pages for each device type * Device pairing with telemetry display * fixed compile time warnings Fourth; Update Device Config Page * use wizard to add new device * remove edit fields, replaced by wizard * remove pair, firmware buttons replaced by wizard Fifth; Deprecate/Remove Device Types * Null Device - used by developers only * Quarqd client - replaced by Native ANT+ * GC Server - not implemented yet I have also introduced a device specific wheel size and flags for controlling the default selection and sources for sensor data when in multi-device mode. These are not yet supported in the code. Fixes #611. Fixes #497.
70 lines
2.4 KiB
C++
70 lines
2.4 KiB
C++
/*
|
|
* Copyright (c) 2009 Mark Liversedge (liversedge@gmail.com)
|
|
*
|
|
* 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
|
|
*/
|
|
|
|
|
|
// Lists all the device types supported
|
|
|
|
#ifndef _GC_DeviceTypes_h
|
|
#define _GC_DeviceTypes_h 1
|
|
#include "GoldenCheetah.h"
|
|
|
|
#include <QList>
|
|
|
|
#define DEV_PT 0x0001
|
|
#define DEV_SRM 0x0002
|
|
#define DEV_CT 0x0010
|
|
#define DEV_ANTPLUS 0x0020 // Quarqd ANT+ device
|
|
#define DEV_NULL 0x0040
|
|
#define DEV_ANTLOCAL 0x0080 // Local ANT+ device
|
|
#define DEV_GSERVER 0x0100 // NOT IMPLEMENTED IN THIS RELEASE XXX
|
|
#define DEV_GCLIENT 0x0200 // NOT IMPLEMENTED IN THIS RELEASE XXX
|
|
#define DEV_FORTIUS 0x0800 // Tacx Fortius
|
|
|
|
#define DEV_QUARQ 0x01 // ants use id:hostname:port
|
|
#define DEV_SERIAL 0x02 // use filename COMx or /dev/cuxxxx
|
|
#define DEV_TCP 0x03 // tcp port is hostname:port NOT IMPLEMENTED IN THIS RELEASE
|
|
#define DEV_USB 0x04 // use filename COMx or /dev/cuxxxx
|
|
#define DEV_LIBUSB 0x08 // will interact directly (i.e. no device file needed)
|
|
|
|
class DeviceType
|
|
{
|
|
public:
|
|
int type; // type specifier - not sure if neccessary
|
|
int connector; // is it a serial or tcp device?
|
|
char *name; // narrative name
|
|
bool realtime; // can it do realtime
|
|
bool download; // can it do download?
|
|
QString description; // tell me about it
|
|
QString image; // filename for image
|
|
};
|
|
|
|
class DeviceTypes
|
|
{
|
|
public:
|
|
DeviceTypes();
|
|
~DeviceTypes();
|
|
|
|
QList<DeviceType> Supported; // all the supported types in a list
|
|
QList<DeviceType> getList(); // returns a list of the supported device types
|
|
|
|
DeviceType getType(int); // return all details for type x
|
|
};
|
|
|
|
#endif // _GC_DeviceTypes_h
|
|
|