diff --git a/android-sources/AndroidManifest.xml b/android-sources/AndroidManifest.xml index db20d7f..d8e5b8a 100644 --- a/android-sources/AndroidManifest.xml +++ b/android-sources/AndroidManifest.xml @@ -15,7 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> - + diff --git a/headers/climbingrace.h b/headers/climbingrace.h index dbc1126..ada6797 100644 --- a/headers/climbingrace.h +++ b/headers/climbingrace.h @@ -86,6 +86,7 @@ public slots: // base station sync void handleBaseStationUpdate(QVariant data); + Q_INVOKABLE bool pairConnectedUsbExtensions(); // functions for qml Q_INVOKABLE int getState(); diff --git a/resources/qml/SettingsDialog/SettingsBaseStationPage.qml b/resources/qml/SettingsDialog/SettingsBaseStationPage.qml index eeac4c8..f29d474 100644 --- a/resources/qml/SettingsDialog/SettingsBaseStationPage.qml +++ b/resources/qml/SettingsDialog/SettingsBaseStationPage.qml @@ -1,7 +1,7 @@ import QtQuick 2.9 import QtMultimedia 5.8 import QtQuick.Window 2.2 -import QtQuick.Controls 2.2 +import QtQuick.Controls 2.12 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 import QtQuick.Controls.Styles 1.4 @@ -173,7 +173,7 @@ Column { id: baseStationConnectedOptionsComp ScrollView{ - + id: flickable contentHeight: baseStationConnectedOptions.childrenRect.height contentWidth: -1 width: parentComp.width @@ -185,7 +185,14 @@ Column { scale: 0.95 ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ScrollBar.vertical.policy: ScrollBar.AlwaysOff + ScrollBar.vertical: ScrollBar { + parent: flickable.parent + anchors.top: flickable.top + anchors.left: flickable.right + anchors.bottom: flickable.bottom + policy: ScrollBar.AlwaysOn + interactive: false + } Column { id: baseStationConnectedOptions @@ -229,6 +236,21 @@ Column { } } + SmoothItemDelegate { + id: connectUsbExtensionsDel + + width: parent.width + height: parentObj.delegateHeight + + text: "pair extensions" + + onClicked: { + busyDl.open() + var ret = speedBackend.pairConnectedUsbExtensions() + busyDl.displayMessageAndClose(ret ? "OK":"error", ret ? "#6bd43b":"#e03b2f" ) + } + } + SmoothItemDelegate { id: baseStationUpdateDel diff --git a/sources/baseconn.cpp b/sources/baseconn.cpp index 06b7cf2..bda8539 100644 --- a/sources/baseconn.cpp +++ b/sources/baseconn.cpp @@ -72,6 +72,7 @@ bool BaseConn::init() { void BaseConn::deInit() { this->connections.clear(); + emit this->connectionsChanged(); this->setState("disconnected"); } @@ -326,14 +327,15 @@ void BaseConn::socketReplyRecieved(QString reply) { // ------------------------- bool BaseConn::updateTime() { - if(abs(this->timeOffset) < 10000000) { + if(abs(this->timeOffset) < 10000) { // the time is already up-to-date return true; } - // NOT IMPLEMENTED YET - return false; + QVariantMap ret = this->sendCommand(5001, this->date->currentSecsSinceEpoch()); + qDebug() << ret; + return ret["status"].toInt() == 200; } bool BaseConn::updateFirmware() { diff --git a/sources/climbingrace.cpp b/sources/climbingrace.cpp index f8b0290..f8773b3 100644 --- a/sources/climbingrace.cpp +++ b/sources/climbingrace.cpp @@ -470,6 +470,12 @@ void ClimbingRace::refreshTimerText() { this->timerTextRefreshTimer->start(); } +bool ClimbingRace::pairConnectedUsbExtensions() { + QVariantMap ret = this->baseConn->sendCommand(5002, "", 10000); + qDebug() << ret; + return ret["status"] == 200; +} + // - athlete management - QVariant ClimbingRace::getAthletes() {