Commit 33ae1720 authored by Dorian Zedler's avatar Dorian Zedler

- added ability to view results of athlete

- improved design of athlete view and stack push / pop animations
parent 6b819d32
......@@ -101,6 +101,7 @@ public slots:
Q_INVOKABLE bool createAthlete( QString userName, QString fullName );
Q_INVOKABLE bool deleteAthlete( QString userName );
Q_INVOKABLE bool selectAthlete( QString userName );
Q_INVOKABLE QVariant getResults( QString userName );
Q_INVOKABLE bool reloadBaseStationIpAdress();
};
......
This diff is collapsed.
......@@ -520,6 +520,13 @@ Popup {
duration: 300
easing.type: Easing.InOutQuad
}
NumberAnimation {
property: "x"
from: width * 0.1
to: 0
duration: 300
}
}
pushExit: Transition {
NumberAnimation {
......@@ -529,6 +536,13 @@ Popup {
duration: 300
easing.type: Easing.InOutQuad
}
NumberAnimation {
property: "x"
to: -width * 0.1
from: 0
duration: 300
}
}
popExit: Transition {
......@@ -539,6 +553,12 @@ Popup {
duration: 300
easing.type: Easing.InOutQuad
}
NumberAnimation {
property: "x"
to: width * 0.1
from: 0
duration: 300
}
}
popEnter: Transition {
NumberAnimation {
......@@ -548,6 +568,12 @@ Popup {
duration: 300
easing.type: Easing.InOutQuad
}
NumberAnimation {
property: "x"
from: -width * 0.1
to: 0
duration: 300
}
}
}
......
import QtQuick 2.3
import QtQuick.Controls 2.4
import QtQuick.Controls.Styles 1.2
BusyIndicator {
id: control
property double animationSpeed: 0.5
contentItem: Item {
implicitWidth: 64
implicitHeight: 64
Item {
id: item
x: parent.width / 2 - 32
y: parent.height / 2 - 32
width: 64
height: 64
opacity: control.running ? 1 : 0
property int currentHeight: 0
onCurrentHeightChanged: {
}
Behavior on opacity {
OpacityAnimator {
duration: 250
}
}
SequentialAnimation {
loops: Animation.Infinite
running: true
NumberAnimation {
target: item
duration: 2000 * 1/control.animationSpeed
to: 1000
properties: "currentHeight"
easing.type: Easing.InOutQuad
}
NumberAnimation {
target: item
duration: 2000 * 1/control.animationSpeed
to: 0
properties: "currentHeight"
easing.type: Easing.InOutQuad
}
}
Row {
anchors.fill: parent
spacing: item.width / 9
Repeater {
id: repeater
model: 5
Rectangle {
property double heightMultiplier: Math.abs( Math.sin(( (item.currentHeight + (index*20))*0.01) * (Math.PI/2) ) )
anchors.verticalCenter: parent.verticalCenter
width: item.width / 9
height: ( heightMultiplier ) * ( item.height - 1 ) + 1
radius: width * 0.5
color: "#21be2b"
}
}
}
}
}
}
import QtQuick 2.9
import QtQuick.Controls 2.4
Item {
id: control
property var loadData
property var listData: ({})
property Component delegate
property int status: -1
signal refresh()
Component.onCompleted: {
}
ListView {
id: listView
model: control.listData.length
anchors.fill: parent
enabled: status === 200 || status === 902
opacity: enabled ? 1:0
ScrollBar.vertical: ScrollBar {
parent: listView.parent
anchors {
top: listView.top
left: listView.right
margins: 10
leftMargin: 3
bottom: listView.bottom
}
width: 8
visible: listView.model > 0
active: true
}
delegate: control.delegate
onContentYChanged: {
/*
if(contentY < -listView.height * 0.3 && control.status !== 905){
contentY = 0
control.refresh()
}*/
}
Behavior on opacity {
NumberAnimation {
duration: 200
}
}
Behavior on contentY {
NumberAnimation {
duration: 200
}
}
}
FancyBusyIndicator {
anchors.centerIn: parent
opacity: listView.opacity === 1 ? 0:1
}
}
......@@ -14,5 +14,7 @@
<file>components/SmoothSwitchDelegate.qml</file>
<file>components/InputDelegate.qml</file>
<file>components/SmoothSliderDelegate.qml</file>
<file>components/RemoteDataListView.qml</file>
<file>components/FancyBusyIndicator.qml</file>
</qresource>
</RCC>
......@@ -459,7 +459,7 @@ QVariant ClimbingRace::getAthletes() {
QVariantList tmpAthletes = reply["data"].toList();
qDebug() << tmpAthletes;
//qDebug() << tmpAthletes;
return tmpAthletes;
}
......@@ -503,7 +503,7 @@ bool ClimbingRace::selectAthlete( QString userName){
if(reply["status"] != 200){
//handle Error!!
qDebug() << "+ --- error deleting athlete: " << reply["status"];
qDebug() << "+ --- error selecting athlete: " << reply["status"];
return false;
}
......@@ -511,7 +511,21 @@ bool ClimbingRace::selectAthlete( QString userName){
}
QVariant ClimbingRace::getResults( QString userName ){
QVariantMap reply = this->baseConn->sendCommand(4004, userName);
if(reply["status"] != 200){
//handle Error!!
qDebug() << "+ --- error getting results: " << reply["status"];
return false;
}
QVariantList tmpAthletes = reply["data"].toList();
//qDebug() << tmpAthletes;
return tmpAthletes;
}
// -------------------------
// --- functions for qml ---
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment