mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 08:38:45 +00:00
Add Device Wizard
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.
This commit is contained in:
@@ -31,8 +31,8 @@ DeviceConfiguration::DeviceConfiguration()
|
||||
{
|
||||
// just set all to empty!
|
||||
type=0;
|
||||
isDefaultDownload=false;
|
||||
isDefaultRealtime=false;
|
||||
defaultString="";
|
||||
wheelSize=2100;
|
||||
postProcess=0;
|
||||
controller=NULL;
|
||||
}
|
||||
@@ -86,17 +86,17 @@ DeviceConfigurations::readConfig()
|
||||
configVal = appsettings->value(NULL, configStr);
|
||||
Entry.type = configVal.toInt();
|
||||
|
||||
configStr = QString("%1%2").arg(GC_DEV_WHEEL).arg(i+1);
|
||||
configVal = appsettings->value(NULL, configStr);
|
||||
Entry.wheelSize = configVal.toInt();
|
||||
|
||||
configStr = QString("%1%2").arg(GC_DEV_PROF).arg(i+1);
|
||||
configVal = appsettings->value(NULL, configStr);
|
||||
Entry.deviceProfile = configVal.toString();
|
||||
|
||||
configStr = QString("%1%2").arg(GC_DEV_DEFI).arg(i+1);
|
||||
configStr = QString("%1%2").arg(GC_DEV_DEF).arg(i+1);
|
||||
configVal = appsettings->value(NULL, configStr);
|
||||
Entry.isDefaultDownload = configVal.toInt();
|
||||
|
||||
configStr = QString("%1%2").arg(GC_DEV_DEFR).arg(i+1);
|
||||
configVal = appsettings->value(NULL, configStr);
|
||||
Entry.isDefaultRealtime = configVal.toInt();
|
||||
Entry.defaultString = configVal.toString();
|
||||
|
||||
configStr = QString("%1%2").arg(GC_DEV_VIRTUAL).arg(i+1);
|
||||
configVal = appsettings->value(NULL, configStr);
|
||||
@@ -124,6 +124,10 @@ DeviceConfigurations::writeConfig(QList<DeviceConfiguration> Configuration)
|
||||
// type
|
||||
configStr = QString("%1%2").arg(GC_DEV_TYPE).arg(i+1);
|
||||
appsettings->setValue(configStr, Configuration.at(i).type);
|
||||
|
||||
// wheel size
|
||||
configStr = QString("%1%2").arg(GC_DEV_WHEEL).arg(i+1);
|
||||
appsettings->setValue(configStr, Configuration.at(i).wheelSize);
|
||||
|
||||
// portSpec
|
||||
configStr = QString("%1%2").arg(GC_DEV_SPEC).arg(i+1);
|
||||
@@ -133,13 +137,9 @@ DeviceConfigurations::writeConfig(QList<DeviceConfiguration> Configuration)
|
||||
configStr = QString("%1%2").arg(GC_DEV_PROF).arg(i+1);
|
||||
appsettings->setValue(configStr, Configuration.at(i).deviceProfile);
|
||||
|
||||
// isDefaultDownload
|
||||
configStr = QString("%1%2").arg(GC_DEV_DEFI).arg(i+1);
|
||||
appsettings->setValue(configStr, Configuration.at(i).isDefaultDownload);
|
||||
|
||||
// isDefaultRealtime
|
||||
configStr = QString("%1%2").arg(GC_DEV_DEFR).arg(i+1);
|
||||
appsettings->setValue(configStr, Configuration.at(i).isDefaultRealtime);
|
||||
// default string
|
||||
configStr = QString("%1%2").arg(GC_DEV_DEF).arg(i+1);
|
||||
appsettings->setValue(configStr, Configuration.at(i).defaultString);
|
||||
|
||||
// virtual post Process...
|
||||
configStr = QString("%1%2").arg(GC_DEV_VIRTUAL).arg(i+1);
|
||||
|
||||
Reference in New Issue
Block a user