Merge remote-tracking branch 'origin/master'

This commit is contained in:
Dorian Zedler 2020-06-14 17:55:22 +02:00
commit 851645cc96
Signed by: dorian
GPG key ID: 989DE36109AFA354
29 changed files with 106 additions and 63 deletions

1
Qt-Secret/src/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/build/

View file

@ -1 +0,0 @@
/libQt-Secret.so.1.2.0

View file

@ -1 +0,0 @@
libQt-Secret.so.1.2.0

View file

@ -1 +0,0 @@
libQt-Secret.so.1.2.0

View file

@ -1 +0,0 @@
libQt-Secret.so.1.2.0

View file

@ -1 +0,0 @@
libQt-Secret.so.1.2.0

View file

@ -1 +0,0 @@
libQt-Secret.so.1.2.0

View file

@ -1 +0,0 @@
libQt-Secret.so.1.2.0

View file

@ -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:
/*!

View file

@ -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);
}

View file

@ -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;

View file

@ -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;
}

View file

@ -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

View file

@ -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
}

View file

@ -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

View file

@ -3,7 +3,8 @@
<file>fonts/fa5solid.woff</file>
<file>images/BaseStationBlack.png</file>
<file>images/BaseStationWhite.png</file>
<file>images/SpeedHold.png</file>
<file>fonts/PTMono-Regular.ttf</file>
<file>images/SpeedHoldBlack.png</file>
<file>images/SpeedHoldWhite.png</file>
</qresource>
</RCC>

View file

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -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"}
}
);

1
docs/.gitignore vendored
View file

@ -1,3 +1,4 @@
/html/
/latex/
/xml/
/m.css/

View file

@ -1,5 +1,5 @@
Package: libScStwSharedLibraries
Version: 1.0.0
Version: 1.1.0
Section: base
Priority: optional
Architecture: armhf

View file

@ -0,0 +1 @@
libScStwStyling.so.1.0.0

View file

@ -0,0 +1 @@
libScStwStyling.so.1.0.0

View file

@ -0,0 +1 @@
libScStwStyling.so.1.0.0

Binary file not shown.

Binary file not shown.

Binary file not shown.