diff --git a/Qt-Secret/src/.gitignore b/Qt-Secret/src/.gitignore new file mode 100644 index 0000000..84c048a --- /dev/null +++ b/Qt-Secret/src/.gitignore @@ -0,0 +1 @@ +/build/ diff --git a/Qt-Secret/src/build/debug/.gitignore b/Qt-Secret/src/build/debug/.gitignore deleted file mode 100644 index c996f46..0000000 --- a/Qt-Secret/src/build/debug/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/libQt-Secret.so.1.2.0 diff --git a/Qt-Secret/src/build/debug/libQt-Secret.so b/Qt-Secret/src/build/debug/libQt-Secret.so deleted file mode 120000 index 12e65b5..0000000 --- a/Qt-Secret/src/build/debug/libQt-Secret.so +++ /dev/null @@ -1 +0,0 @@ -libQt-Secret.so.1.2.0 \ No newline at end of file diff --git a/Qt-Secret/src/build/debug/libQt-Secret.so.1 b/Qt-Secret/src/build/debug/libQt-Secret.so.1 deleted file mode 120000 index 12e65b5..0000000 --- a/Qt-Secret/src/build/debug/libQt-Secret.so.1 +++ /dev/null @@ -1 +0,0 @@ -libQt-Secret.so.1.2.0 \ No newline at end of file diff --git a/Qt-Secret/src/build/debug/libQt-Secret.so.1.2 b/Qt-Secret/src/build/debug/libQt-Secret.so.1.2 deleted file mode 120000 index 12e65b5..0000000 --- a/Qt-Secret/src/build/debug/libQt-Secret.so.1.2 +++ /dev/null @@ -1 +0,0 @@ -libQt-Secret.so.1.2.0 \ No newline at end of file diff --git a/Qt-Secret/src/build/release/libQt-Secret.so b/Qt-Secret/src/build/release/libQt-Secret.so deleted file mode 120000 index 12e65b5..0000000 --- a/Qt-Secret/src/build/release/libQt-Secret.so +++ /dev/null @@ -1 +0,0 @@ -libQt-Secret.so.1.2.0 \ No newline at end of file diff --git a/Qt-Secret/src/build/release/libQt-Secret.so.1 b/Qt-Secret/src/build/release/libQt-Secret.so.1 deleted file mode 120000 index 12e65b5..0000000 --- a/Qt-Secret/src/build/release/libQt-Secret.so.1 +++ /dev/null @@ -1 +0,0 @@ -libQt-Secret.so.1.2.0 \ No newline at end of file diff --git a/Qt-Secret/src/build/release/libQt-Secret.so.1.2 b/Qt-Secret/src/build/release/libQt-Secret.so.1.2 deleted file mode 120000 index 12e65b5..0000000 --- a/Qt-Secret/src/build/release/libQt-Secret.so.1.2 +++ /dev/null @@ -1 +0,0 @@ -libQt-Secret.so.1.2.0 \ No newline at end of file diff --git a/Qt-Secret/src/build/release/libQt-Secret.so.1.2.0 b/Qt-Secret/src/build/release/libQt-Secret.so.1.2.0 deleted file mode 100755 index 534641a..0000000 Binary files a/Qt-Secret/src/build/release/libQt-Secret.so.1.2.0 and /dev/null differ diff --git a/ScStwLibraries/headers/scstwtimer.h b/ScStwLibraries/headers/scstwtimer.h index bfe5469..e1aac72 100644 --- a/ScStwLibraries/headers/scstwtimer.h +++ b/ScStwLibraries/headers/scstwtimer.h @@ -66,8 +66,9 @@ public: * \brief ScStwTimer constructor * \param parent the parent object * \param directControlEnabled Defines if protected properties (startTimer, stopTime, reactionTime and state) can be directly set from outside. + * \param letter the letter of the timer (only first char will be used!) */ - explicit ScStwTimer(QObject *parent = nullptr, bool directControlEnabled = false); + explicit ScStwTimer(QObject *parent = nullptr, bool directControlEnabled = false, QString letter = "" ); /*! * \brief The TimerState enum contains all state the timer can be in @@ -121,6 +122,11 @@ protected: */ bool directControlEnabled; + /*! + * \brief The letter (eg. "A" or "B") of the Timer (only one char) + */ + QString letter; + public slots: /*! @@ -218,6 +224,12 @@ public slots: */ QString getText(); + /*! + * \brief Function to get the letter of the timer + * \return The letter of the timer or "" + */ + QString getLetter(); + /*! * \brief Function to set if the timer is supposed to be disabled * @@ -272,6 +284,16 @@ public slots: */ bool setReactionTime(double rectionTime); + /*! + * \brief Function to dircetly change the letter + * + * Only works when directControlEnabled is set to true! + * + * \param newLetter the letter to change to + * \return false when directControlEnabled is set to false and the letter was therefore not modified, true otherwise + */ + bool setLetter(QString newLetter); + protected slots: /*! diff --git a/ScStwLibraries/sources/scstwrace.cpp b/ScStwLibraries/sources/scstwrace.cpp index 0d86f1c..5998f13 100644 --- a/ScStwLibraries/sources/scstwrace.cpp +++ b/ScStwLibraries/sources/scstwrace.cpp @@ -397,6 +397,7 @@ QVariantList ScStwRace::getTimerDetailList() { tmpTimer.insert("currentTime", timer->getCurrentTime()); tmpTimer.insert("reactionTime", timer->getReactionTime()); tmpTimer.insert("text", timer->getText()); + tmpTimer.insert("letter", timer->getLetter()); tmpTimers.append(tmpTimer); } diff --git a/ScStwLibraries/sources/scstwremotemonitorrace.cpp b/ScStwLibraries/sources/scstwremotemonitorrace.cpp index d80d8ba..56d6f4e 100644 --- a/ScStwLibraries/sources/scstwremotemonitorrace.cpp +++ b/ScStwLibraries/sources/scstwremotemonitorrace.cpp @@ -207,6 +207,8 @@ bool ScStwRemoteMonitorRace::refreshRemoteTimers(QVariantList remoteTimers) { this->timers[currId]->setReactionTime(remoteTimer.toMap()["reactionTime"].toDouble()); this->timers[currId]->setState(newState, true); + + this->timers[currId]->setLetter(remoteTimer.toMap()["letter"].toString()); } return true; diff --git a/ScStwLibraries/sources/scstwtimer.cpp b/ScStwLibraries/sources/scstwtimer.cpp index 737c058..11950e5 100644 --- a/ScStwLibraries/sources/scstwtimer.cpp +++ b/ScStwLibraries/sources/scstwtimer.cpp @@ -18,9 +18,15 @@ #include "../headers/scstwtimer.h" -ScStwTimer::ScStwTimer(QObject *parent, bool directControlEnabled) : QObject(parent) +ScStwTimer::ScStwTimer(QObject *parent, bool directControlEnabled, QString letter) : QObject(parent) { this->directControlEnabled = directControlEnabled; + + if(letter.length() > 1) + this->letter = letter[0]; + else + this->letter = letter; + this->startTime = 0; this->stopTime = 0; this->reactionTime = 0; @@ -46,10 +52,6 @@ bool ScStwTimer::start(double timeOfStart) { if(this->state == STARTING) this->setState(RUNNING); }); - QTimer::singleShot(timeOfStart - QDateTime::currentMSecsSinceEpoch() - 1000, [=](){ - //this->handleClimberStart(QDateTime::currentMSecsSinceEpoch()); - }); - } else this->setState(RUNNING); @@ -202,6 +204,14 @@ void ScStwTimer::setState(TimerState newState){ } } +bool ScStwTimer::setLetter(QString newLetter) { + if(!this->directControlEnabled) + return false; + + this->letter = newLetter; + return true; +} + ScStwTimer::TimerState ScStwTimer::getState() { return this->state; } @@ -212,7 +222,7 @@ double ScStwTimer::getCurrentTime() { return QDateTime::currentMSecsSinceEpoch() - this->startTime; default: { if(this->state == WAITING || this->state == WON || this->state == LOST) - return this->stopTime - this->startTime; + return abs(this->stopTime - this->startTime); else return -1; } @@ -223,27 +233,32 @@ double ScStwTimer::getReactionTime() { return this->reactionTime; } +QString ScStwTimer::getLetter() { + return this->letter; +} + QString ScStwTimer::getText() { - //qDebug() << this->getState(); - QString newText; + + QString newText = ""; + int newTime = 0; switch (this->state) { case ScStwTimer::IDLE: - newText = "0.000 sec"; + newTime = 0; break; case ScStwTimer::STARTING: - newText = "0.000 sec"; + newTime = 0; break; case ScStwTimer::WAITING: newText = "please wait..."; break; case ScStwTimer::RUNNING: - newText = QString::number( this->getCurrentTime() / 1000.0, 'f', 3 ) + " sec"; + newTime = this->getCurrentTime(); break; case ScStwTimer::WON: - newText = QString::number( this->getCurrentTime() / 1000.0, 'f', 3 ) + " sec"; + newTime = this->getCurrentTime(); break; case ScStwTimer::LOST: - newText = QString::number( this->getCurrentTime() / 1000.0, 'f', 3 ) + " sec"; + newTime = this->getCurrentTime(); break; case ScStwTimer::FAILED: newText = "false start"; @@ -256,6 +271,9 @@ QString ScStwTimer::getText() { break; } + if(newText == "") + newText = QString::number( newTime / 1000.0, 'f', 3 ).rightJustified(6, '0'); + return newText; } diff --git a/ScStwStyling/ScStwStyling.pro b/ScStwStyling/ScStwStyling.pro index 5ccc3de..5e3704e 100644 --- a/ScStwStyling/ScStwStyling.pro +++ b/ScStwStyling/ScStwStyling.pro @@ -38,5 +38,5 @@ CONFIG(release, debug|release): { } # Default rules for deployment. -target.path = $$GLOBAL_TARGET_PATH/lib +target.path = /usr/local/lib !isEmpty(target.path): INSTALLS += target diff --git a/ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/BusyIndicator.qml b/ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/BusyIndicator.qml index 3e3fafc..ffeaf10 100644 --- a/ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/BusyIndicator.qml +++ b/ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/BusyIndicator.qml @@ -23,16 +23,16 @@ import QtQuick.Controls 2.0 T.BusyIndicator { id: control - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) + property var image: "qrc:/images/SpeedHoldBlack.png" + + implicitWidth: leftPadding + rightPadding + implicitHeight: topPadding + bottomPadding contentItem: Item { Image { id: holdImage anchors.fill: parent - source: "qrc:/images/SpeedHold.png" + source: control.image fillMode: Image.PreserveAspectFit } diff --git a/ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/TimerColumn.qml b/ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/TimerColumn.qml index 109d450..5150516 100644 --- a/ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/TimerColumn.qml +++ b/ScStwStyling/resources/qml/lib/de/itsblue/ScStw/Styling/Components/TimerColumn.qml @@ -19,7 +19,6 @@ import QtQuick 2.0 import QtQuick.Controls 2.0 import de.itsblue.ScStw 2.0 -import de.itsblue.ScStwMonitor 2.0 Column { id: control @@ -27,26 +26,16 @@ Column { property var timers property var colors property var fontName - - opacity: backend.scStwClient.state === ScStwClient.CONNECTED ? 1:0 + property bool showSecLabel: false + property bool showTimerLetter: true + property double textScale: 1 spacing: 0 Repeater { id: timerRep - property var clearedTimers: removeDisabledTimers(control.timers) - - function removeDisabledTimers(timers) { - var ret = [] - for(var i = 0; i < timers.length; i++) { - if(timers[i]["state"] !== ScStwTimer.DISABLED) - ret.push(timers[i]) - } - return ret - } - - model: clearedTimers.length + model: control.timers.length delegate: Item { id: timerDel @@ -54,15 +43,16 @@ Column { width: parent.width height: control.height / timerRep.model - Label { - id: laneNameLa + Text { + id: timerLetterLa + + enabled: control.showTimerLetter && text !== "" anchors { left: parent.left + leftMargin: parent.width * 0.03 } - leftPadding: parent.width * 0.03 - width: parent.width * 0.15 height: parent.height * 0.5 @@ -71,45 +61,54 @@ Column { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft - text: ""//index === 0 ? "A":"B" + opacity: enabled ? 1:0 - color: control.colors.text + text: control.timers[index]["letter"] + + color: control.colors.accent font.pixelSize: height font.styleName: control.fontName + + Behavior on opacity { + NumberAnimation { + duration: 200 + } + } } - Label { + Text { id: timerTextLa anchors.centerIn: parent - anchors.horizontalCenterOffset: laneNameLa.text !== "" ? parent.width * 0.06:0 + anchors.horizontalCenterOffset: timerLetterLa.enabled ? parent.width * 0.06:0 anchors.verticalCenterOffset: -(parent.height * 0.04 * reactTimeLa.opacity) width: parent.width * 0.8 height: parent.height * 0.8 - elide: "ElideRight" - color: ([ScStwTimer.WON].indexOf(timerRep.clearedTimers[index]["state"]) >= 0 ? control.colors.success : - [ScStwTimer.FAILED,ScStwTimer.LOST].indexOf(timerRep.clearedTimers[index]["state"]) >= 0 ? control.colors.error: + color: ([ScStwTimer.WON].indexOf(control.timers[index]["state"]) >= 0 ? control.colors.success : + [ScStwTimer.FAILED,ScStwTimer.LOST].indexOf(control.timers[index]["state"]) >= 0 ? control.colors.error: control.colors.text) - text: timerRep.clearedTimers[index]["text"] + enabled: control.timers[index]["state"] !== ScStwTimer.DISABLED + + text: control.timers[index]["text"] fontSizeMode: Text.Fit verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter - font.pixelSize: height + font.pixelSize: height * control.textScale font.styleName: control.fontName minimumPixelSize: 1 } - Label { + Text { id: reactTimeLa - property int rtime: timerRep.clearedTimers[index]["reactionTime"] + property int rtime: control.timers[index]["reactionTime"] anchors { centerIn: parent @@ -123,7 +122,7 @@ Column { scale: enabled ? 1:0.9 opacity: enabled ? 1:0 - enabled: timerRep.clearedTimers[index]["state"] >= ScStwTimer.STARTING && rtime !== 0 + enabled: control.timers[index]["state"] >= ScStwTimer.STARTING && rtime !== 0 fontSizeMode: Text.Fit @@ -134,7 +133,7 @@ Column { color: control.colors.text - font.pixelSize: timerTextLa.font.pixelSize * 0.5 + font.pixelSize: timerTextLa.font.pixelSize * control.textScale font.styleName: control.fontName minimumPixelSize: 1 diff --git a/ScStwStyling/resources/shared/ScStwStylingShared.qrc b/ScStwStyling/resources/shared/ScStwStylingShared.qrc index 875e9cb..cce3696 100644 --- a/ScStwStyling/resources/shared/ScStwStylingShared.qrc +++ b/ScStwStyling/resources/shared/ScStwStylingShared.qrc @@ -3,7 +3,8 @@ fonts/fa5solid.woff images/BaseStationBlack.png images/BaseStationWhite.png - images/SpeedHold.png fonts/PTMono-Regular.ttf + images/SpeedHoldBlack.png + images/SpeedHoldWhite.png diff --git a/ScStwStyling/resources/shared/images/SpeedHold.png b/ScStwStyling/resources/shared/images/SpeedHoldBlack.png similarity index 100% rename from ScStwStyling/resources/shared/images/SpeedHold.png rename to ScStwStyling/resources/shared/images/SpeedHoldBlack.png diff --git a/ScStwStyling/resources/shared/images/SpeedHoldWhite.png b/ScStwStyling/resources/shared/images/SpeedHoldWhite.png new file mode 100644 index 0000000..11dd41b Binary files /dev/null and b/ScStwStyling/resources/shared/images/SpeedHoldWhite.png differ diff --git a/ScStwStyling/sources/scstwappthememanager.cpp b/ScStwStyling/sources/scstwappthememanager.cpp index a924dac..00fef82 100644 --- a/ScStwStyling/sources/scstwappthememanager.cpp +++ b/ScStwStyling/sources/scstwappthememanager.cpp @@ -82,7 +82,8 @@ ScStwAppThemeManager::ScStwAppThemeManager(QObject *parent) : QObject(parent) {"startpadIcon", "qrc:/graphics/icons/startpad_black.png"}, {"baseStationIcon", "qrc:/images/BaseStationBlack.png"}, {"profilesIcon", "qrc:/graphics/icons/user_black.png"}, - {"confirmIcon", "qrc:/graphics/icons/ok_black.png"} + {"confirmIcon", "qrc:/graphics/icons/ok_black.png"}, + {"SpeedHold", "qrc:/images/SpeedHoldBlack.png"} }); ScStwAppTheme *darkTheme = new ScStwAppTheme( @@ -130,7 +131,8 @@ ScStwAppThemeManager::ScStwAppThemeManager(QObject *parent) : QObject(parent) {"startpadIcon", "qrc:/graphics/icons/startpad.png"}, {"baseStationIcon", "qrc:/images/BaseStationWhite.png"}, {"profilesIcon", "qrc:/graphics/icons/user.png"}, - {"confirmIcon", "qrc:/graphics/icons/ok.png"} + {"confirmIcon", "qrc:/graphics/icons/ok.png"}, + {"SpeedHold", "qrc:/images/SpeedHoldWhite.png"} } ); diff --git a/docs/.gitignore b/docs/.gitignore index facb6f8..e47c0cb 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,3 +1,4 @@ /html/ /latex/ /xml/ +/m.css/ diff --git a/release/debian/DEBIAN/control b/release/debian/DEBIAN/control index 028668a..d02e8bb 100644 --- a/release/debian/DEBIAN/control +++ b/release/debian/DEBIAN/control @@ -1,5 +1,5 @@ Package: libScStwSharedLibraries -Version: 1.0.0 +Version: 1.1.0 Section: base Priority: optional Architecture: armhf diff --git a/release/debian/usr/local/lib/libScStwLibraries.so.1.0.0 b/release/debian/usr/local/lib/libScStwLibraries.so.1.0.0 index cfe029b..a04d0ce 100755 Binary files a/release/debian/usr/local/lib/libScStwLibraries.so.1.0.0 and b/release/debian/usr/local/lib/libScStwLibraries.so.1.0.0 differ diff --git a/release/debian/usr/local/lib/libScStwStyling.so b/release/debian/usr/local/lib/libScStwStyling.so new file mode 120000 index 0000000..c42ad2d --- /dev/null +++ b/release/debian/usr/local/lib/libScStwStyling.so @@ -0,0 +1 @@ +libScStwStyling.so.1.0.0 \ No newline at end of file diff --git a/release/debian/usr/local/lib/libScStwStyling.so.1 b/release/debian/usr/local/lib/libScStwStyling.so.1 new file mode 120000 index 0000000..c42ad2d --- /dev/null +++ b/release/debian/usr/local/lib/libScStwStyling.so.1 @@ -0,0 +1 @@ +libScStwStyling.so.1.0.0 \ No newline at end of file diff --git a/release/debian/usr/local/lib/libScStwStyling.so.1.0 b/release/debian/usr/local/lib/libScStwStyling.so.1.0 new file mode 120000 index 0000000..c42ad2d --- /dev/null +++ b/release/debian/usr/local/lib/libScStwStyling.so.1.0 @@ -0,0 +1 @@ +libScStwStyling.so.1.0.0 \ No newline at end of file diff --git a/release/debian/usr/local/lib/libScStwStyling.so.1.0.0 b/release/debian/usr/local/lib/libScStwStyling.so.1.0.0 new file mode 100755 index 0000000..e9c474f Binary files /dev/null and b/release/debian/usr/local/lib/libScStwStyling.so.1.0.0 differ diff --git a/release/libScStwSharedLibraries.deb b/release/libScStwSharedLibraries.deb index 2d36372..1771d9b 100644 Binary files a/release/libScStwSharedLibraries.deb and b/release/libScStwSharedLibraries.deb differ diff --git a/release/libScStwSharedLibraries_1.0.0.deb b/release/libScStwSharedLibraries_1.0.0.deb new file mode 100644 index 0000000..2d36372 Binary files /dev/null and b/release/libScStwSharedLibraries_1.0.0.deb differ