Skip to content

Commit

Permalink
Adjustments to get TXDB test to work
Browse files Browse the repository at this point in the history
  • Loading branch information
drmason789 committed Oct 18, 2024
1 parent b00d369 commit 045557d
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 48 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ src/inner_templates/googlemaps/cesium-key.js
.vscode/settings.json
/tst/Devices/.vs
src/inner_templates/googlemaps/cesium-key.js

build/
23 changes: 14 additions & 9 deletions src/devices/trixterxdreamv1bike/trixterxdreamv1settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
const QString trixterxdreamv1settings::keys::Enabled = QZSettings::trixter_xdream_v1_bike_enabled;
const QString trixterxdreamv1settings::keys::HeartRateEnabled = QZSettings::trixter_xdream_v1_bike_heartrate_enabled;
const QString trixterxdreamv1settings::keys::SteeringEnabled = QZSettings::trixter_xdream_v1_bike_steering_enabled;
const QString trixterxdreamv1settings::keys::SteeringCalibrationLeft = QZSettings::trixter_xdream_v1_bike_steeringcalibration_left;
const QString trixterxdreamv1settings::keys::SteeringCalibrationCenterLeft =QZSettings::trixter_xdream_v1_bike_steeringcalibration_centerLeft;
const QString trixterxdreamv1settings::keys::SteeringCalibrationCenterRight = QZSettings::trixter_xdream_v1_bike_steeringcalibration_centerRight;
const QString trixterxdreamv1settings::keys::SteeringCalibrationRight = QZSettings::trixter_xdream_v1_bike_steeringcalibration_right;
const QString trixterxdreamv1settings::keys::SteeringCalibrationMAX = QZSettings::trixter_xdream_v1_bike_steeringcalibration_max;
const QString trixterxdreamv1settings::keys::SteeringCalibrationLeft = QZSettings::trixter_xdream_v1_bike_steering_l;
const QString trixterxdreamv1settings::keys::SteeringCalibrationCenterLeft =QZSettings::trixter_xdream_v1_bike_steering_cl;
const QString trixterxdreamv1settings::keys::SteeringCalibrationCenterRight = QZSettings::trixter_xdream_v1_bike_steering_cr;
const QString trixterxdreamv1settings::keys::SteeringCalibrationRight = QZSettings::trixter_xdream_v1_bike_steering_r;
const QString trixterxdreamv1settings::keys::SteeringCalibrationMAX = QZSettings::trixter_xdream_v1_bike_steering_max;
const QString trixterxdreamv1settings::keys::ConnectionTimeoutMilliseconds = QZSettings::trixter_xdream_v1_bike_connectionTimeoutMilliseconds;


Expand Down Expand Up @@ -104,10 +104,15 @@ void trixterxdreamv1settings::Load(const QSettings &settings) {
this->set_heartRateEnabled(settings.value(keys::HeartRateEnabled, DefaultHeartRateEnabled).toBool());
this->set_steeringEnabled(settings.value(keys::SteeringEnabled, DefaultSteeringEnabled).toBool());
this->set_connectionTimeoutMilliseconds(settings.value(keys::ConnectionTimeoutMilliseconds, DefaultConnectionTimeoutMilliseconds).toUInt());
steeringCalibrationInfo sc(settings.value(keys::SteeringCalibrationLeft, DefaultSteeringCalibrationL).toInt(),
settings.value(keys::SteeringCalibrationCenterLeft, DefaultSteeringCalibrationCL).toInt(),
settings.value(keys::SteeringCalibrationCenterRight, DefaultSteeringCalibrationCR).toInt(),
settings.value(keys::SteeringCalibrationRight, DefaultSteeringCalibrationR).toInt());

int32_t l = settings.value(keys::SteeringCalibrationLeft, DefaultSteeringCalibrationL).toInt();
int32_t lc = settings.value(keys::SteeringCalibrationCenterLeft, DefaultSteeringCalibrationCL).toInt();
int32_t lr = settings.value(keys::SteeringCalibrationCenterRight, DefaultSteeringCalibrationCR).toInt();
int32_t r = settings.value(keys::SteeringCalibrationRight, DefaultSteeringCalibrationR).toInt();

int32_t xx = settings.value(keys::SteeringCalibrationCenterLeft, 1).toInt();

steeringCalibrationInfo sc(l,lc,lr, r);
this->set_steeringCalibration(sc);
}

Expand Down
1 change: 0 additions & 1 deletion src/devices/trixterxdreamv1bike/trixterxdreamv1settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "qzsettings.h"



/**
* @brief The trixterxdreamv1bikesettings class encapsulates the application settings for the Trixter X-Dream V1 Bike.
* Field accessors restrict values to defined limits.
Expand Down
20 changes: 10 additions & 10 deletions src/qzsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,11 +773,11 @@ const QString QZSettings::proform_treadmill_575i = QStringLiteral("proform_tread
const QString QZSettings::trixter_xdream_v1_bike_enabled = QStringLiteral("trixter_xdream_v1_bike_enabled");
const QString QZSettings::trixter_xdream_v1_bike_heartrate_enabled = QStringLiteral("trixter_xdream_v1_bike_heartrate_enabled");
const QString QZSettings::trixter_xdream_v1_bike_steering_enabled = QStringLiteral("trixter_xdream_v1_bike_steering_enabled");
const QString QZSettings::trixter_xdream_v1_bike_steeringcalibration_left = QStringLiteral("trixter_xdream_v1_bike_steeringcalibration_left");
const QString QZSettings::trixter_xdream_v1_bike_steeringcalibration_centerLeft = QStringLiteral("trixter_xdream_v1_bike_steeringcalibration_centerLeft");
const QString QZSettings::trixter_xdream_v1_bike_steeringcalibration_centerRight = QStringLiteral("trixter_xdream_v1_bike_steeringcalibration_centerRight");
const QString QZSettings::trixter_xdream_v1_bike_steeringcalibration_right = QStringLiteral("trixter_xdream_v1_bike_steeringcalibration_right");
const QString QZSettings::trixter_xdream_v1_bike_steeringcalibration_max = QStringLiteral("trixter_xdream_v1_bike_steeringcalibration_max");
const QString QZSettings::trixter_xdream_v1_bike_steering_l = QStringLiteral("trixter_xdream_v1_bike_steering_l");
const QString QZSettings::trixter_xdream_v1_bike_steering_cl = QStringLiteral("trixter_xdream_v1_bike_steering_cl");
const QString QZSettings::trixter_xdream_v1_bike_steering_cr = QStringLiteral("trixter_xdream_v1_bike_steering_cr");
const QString QZSettings::trixter_xdream_v1_bike_steering_r = QStringLiteral("trixter_xdream_v1_bike_steering_r");
const QString QZSettings::trixter_xdream_v1_bike_steering_max = QStringLiteral("trixter_xdream_v1_bike_steering_max");
const QString QZSettings::trixter_xdream_v1_bike_connectionTimeoutMilliseconds = QStringLiteral("trixter_xdream_v1_bike_connectionTimeoutMilliseconds");


Expand Down Expand Up @@ -1439,11 +1439,11 @@ QMap<QString, QVariant> allSettings{
{QZSettings::trixter_xdream_v1_bike_enabled, QZSettings::default_trixter_xdream_v1_bike_enabled },
{QZSettings::trixter_xdream_v1_bike_heartrate_enabled, QZSettings::default_trixter_xdream_v1_bike_heartrate_enabled },
{QZSettings::trixter_xdream_v1_bike_steering_enabled, QZSettings::default_trixter_xdream_v1_bike_steering_enabled },
{QZSettings::trixter_xdream_v1_bike_steeringcalibration_left, QZSettings::default_trixter_xdream_v1_bike_steeringcalibration_left },
{QZSettings::trixter_xdream_v1_bike_steeringcalibration_centerLeft, QZSettings::default_trixter_xdream_v1_bike_steeringcalibration_centerLeft },
{QZSettings::trixter_xdream_v1_bike_steeringcalibration_centerRight, QZSettings::default_trixter_xdream_v1_bike_steeringcalibration_centerRight },
{QZSettings::trixter_xdream_v1_bike_steeringcalibration_right, QZSettings::default_trixter_xdream_v1_bike_steeringcalibration_right },
{QZSettings::trixter_xdream_v1_bike_steeringcalibration_max, QZSettings::default_trixter_xdream_v1_bike_steeringcalibration_max },
{QZSettings::trixter_xdream_v1_bike_steering_l, QZSettings::default_trixter_xdream_v1_bike_steering_l },
{QZSettings::trixter_xdream_v1_bike_steering_cl, QZSettings::default_trixter_xdream_v1_bike_steering_cl },
{QZSettings::trixter_xdream_v1_bike_steering_cr, QZSettings::default_trixter_xdream_v1_bike_steering_cr },
{QZSettings::trixter_xdream_v1_bike_steering_r, QZSettings::default_trixter_xdream_v1_bike_steering_r },
{QZSettings::trixter_xdream_v1_bike_steering_max, QZSettings::default_trixter_xdream_v1_bike_steering_max },
{QZSettings::trixter_xdream_v1_bike_connectionTimeoutMilliseconds, QZSettings::default_trixter_xdream_v1_bike_connectionTimeoutMilliseconds }
};

Expand Down
23 changes: 11 additions & 12 deletions src/qzsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ class QZSettings {
static const QString default_horizon_treadmill_profile_user5;

static const QString nordictrack_gx_2_7;
static const bool default_nordictrack_gx_2_7 = false;
static constexpr bool default_nordictrack_gx_2_7 = false;

static const QString rolling_resistance;
static constexpr double default_rolling_resistance = 0.005;
Expand Down Expand Up @@ -2162,25 +2162,24 @@ class QZSettings {
static const QString trixter_xdream_v1_bike_steering_enabled;
static constexpr bool default_trixter_xdream_v1_bike_steering_enabled= true;

static const QString trixter_xdream_v1_bike_steeringcalibration_left;
static constexpr uint8_t default_trixter_xdream_v1_bike_steeringcalibration_left = 0;
static const QString trixter_xdream_v1_bike_steering_max;
static constexpr int8_t default_trixter_xdream_v1_bike_steering_max= 45;

static const QString trixter_xdream_v1_bike_steeringcalibration_centerLeft;
static constexpr uint8_t default_trixter_xdream_v1_bike_steeringcalibration_centerLeft=2;
static const QString trixter_xdream_v1_bike_steering_l;
static constexpr int8_t default_trixter_xdream_v1_bike_steering_l = -default_trixter_xdream_v1_bike_steering_max;

static const QString trixter_xdream_v1_bike_steeringcalibration_centerRight;
static constexpr uint8_t default_trixter_xdream_v1_bike_steeringcalibration_centerRight= 2;
static const QString trixter_xdream_v1_bike_steering_cl;
static constexpr int8_t default_trixter_xdream_v1_bike_steering_cl=-2;

static const QString trixter_xdream_v1_bike_steeringcalibration_right;
static constexpr uint8_t default_trixter_xdream_v1_bike_steeringcalibration_right = 250;
static const QString trixter_xdream_v1_bike_steering_cr;
static constexpr int8_t default_trixter_xdream_v1_bike_steering_cr= 2;

static const QString trixter_xdream_v1_bike_steeringcalibration_max;
static constexpr uint8_t default_trixter_xdream_v1_bike_steeringcalibration_max= 250;
static const QString trixter_xdream_v1_bike_steering_r;
static constexpr int8_t default_trixter_xdream_v1_bike_steering_r = default_trixter_xdream_v1_bike_steering_max;

static const QString trixter_xdream_v1_bike_connectionTimeoutMilliseconds;
static constexpr uint32_t default_trixter_xdream_v1_bike_connectionTimeoutMilliseconds= 500;


/**
* @brief Write the QSettings values using the constants from this namespace.
* @param showDefaults Optionally indicates if the default should be shown with the key.
Expand Down
6 changes: 3 additions & 3 deletions src/settings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ import QtQuick.Dialogs 1.0
property bool proform_treadmill_575i: false

// from version ?
property bool trixter_xdream_v1_bike: false
property bool trixter_xdream_v1_bike_enabled: false
property bool trixter_xdream_v1_bike_heartrate_enabled: true
property bool trixter_xdream_v1_bike_steering_enabled: true
property int trixter_xdream_v1_bike_steering_L : -45
Expand Down Expand Up @@ -3011,10 +3011,10 @@ import QtQuick.Dialogs 1.0
rightPadding: 0
leftPadding: 0
clip: false
checked: settings.trixter_xdream_v1_bike
checked: settings.trixter_xdream_v1_bike_enabled
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.fillWidth: true
onClicked: settings.trixter_xdream_v1_bike = checked
onClicked: settings.trixter_xdream_v1_bike_enabled = checked
}
RowLayout {
id: trixterXDreamV1BikeConnection
Expand Down
2 changes: 1 addition & 1 deletion tst/Devices/bluetoothdevicetestdatabuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,6 @@ class BluetoothDeviceTestDataBuilder : public virtual BluetoothDeviceTestData
* @param use (Optional) indicates whether to use non-bluetooth discovery.
* @return
*/
BluetoothDeviceTestDataBuilder * useNonBluetoothDiscovery(bool use=false);
BluetoothDeviceTestDataBuilder * useNonBluetoothDiscovery(bool use=true);

};
21 changes: 9 additions & 12 deletions tst/Devices/devicediscoveryinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include "devicediscoveryinfo.h"
#include "qzsettings.h"
#include "trixterxdreamv1bike/trixterxdreamv1settings.h"

static QMap<QString, QVariant> trackedSettings;

Expand Down Expand Up @@ -52,17 +51,15 @@ void InitializeTrackedSettings()
trackedSettings.insert(QZSettings::toorx_bike, QZSettings::default_toorx_bike);
trackedSettings.insert(QZSettings::toorx_ftms, QZSettings::default_toorx_ftms);
trackedSettings.insert(QZSettings::toorx_ftms_treadmill, QZSettings::default_toorx_ftms_treadmill);


trackedSettings.insert(trixterxdreamv1settings::keys::Enabled, trixterxdreamv1settings::DefaultEnabled );
trackedSettings.insert(trixterxdreamv1settings::keys::HeartRateEnabled,trixterxdreamv1settings::DefaultHeartRateEnabled);
trackedSettings.insert(trixterxdreamv1settings::keys::SteeringEnabled,trixterxdreamv1settings::DefaultSteeringEnabled);
trackedSettings.insert(trixterxdreamv1settings::keys::SteeringCalibrationLeft,trixterxdreamv1settings::DefaultSteeringCalibrationL);
trackedSettings.insert(trixterxdreamv1settings::keys::SteeringCalibrationCenterLeft,trixterxdreamv1settings::DefaultSteeringCalibrationCR);
trackedSettings.insert(trixterxdreamv1settings::keys::SteeringCalibrationCenterRight, trixterxdreamv1settings::DefaultSteeringCalibrationCR);
trackedSettings.insert(trixterxdreamv1settings::keys::SteeringCalibrationRight, trixterxdreamv1settings::DefaultSteeringCalibrationR);
trackedSettings.insert(trixterxdreamv1settings::keys::SteeringCalibrationMAX, trixterxdreamv1settings::MaxSteeringAngle);
trackedSettings.insert(trixterxdreamv1settings::keys::ConnectionTimeoutMilliseconds, trixterxdreamv1settings::DefaultConnectionTimeoutMilliseconds);
trackedSettings.insert(QZSettings::trixter_xdream_v1_bike_enabled, QZSettings::default_trixter_xdream_v1_bike_enabled );
trackedSettings.insert(QZSettings::trixter_xdream_v1_bike_heartrate_enabled, QZSettings::default_trixter_xdream_v1_bike_heartrate_enabled );
trackedSettings.insert(QZSettings::trixter_xdream_v1_bike_steering_enabled, QZSettings::default_trixter_xdream_v1_bike_steering_enabled);
trackedSettings.insert(QZSettings::trixter_xdream_v1_bike_steering_l, QZSettings::default_trixter_xdream_v1_bike_steering_l);
trackedSettings.insert(QZSettings::trixter_xdream_v1_bike_steering_cl, QZSettings::default_trixter_xdream_v1_bike_steering_cl);
trackedSettings.insert(QZSettings::trixter_xdream_v1_bike_steering_cr, QZSettings::default_trixter_xdream_v1_bike_steering_cr);
trackedSettings.insert(QZSettings::trixter_xdream_v1_bike_steering_r, QZSettings::default_trixter_xdream_v1_bike_steering_r);
trackedSettings.insert(QZSettings::trixter_xdream_v1_bike_steering_max, QZSettings::default_trixter_xdream_v1_bike_steering_max);
trackedSettings.insert(QZSettings::trixter_xdream_v1_bike_connectionTimeoutMilliseconds, QZSettings::default_trixter_xdream_v1_bike_connectionTimeoutMilliseconds);


};
Expand Down

0 comments on commit 045557d

Please sign in to comment.