From 03ec489cfbfe50e194e4dd9c0b37fec55099aeda Mon Sep 17 00:00:00 2001 From: dorian Date: Wed, 27 Mar 2019 22:26:45 +0100 Subject: [PATCH] - made connection icons variable --- qml/main.qml | 55 ++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/qml/main.qml b/qml/main.qml index 43548e9..eca0e9b 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -38,10 +38,6 @@ Window { id:root anchors.fill: parent - property double startTime: 0 - property double stoppedTime: 0 - property double currTime - //set default state to IDLE state: "IDLE" @@ -180,36 +176,45 @@ Window { height: !root.landscape()? parent.height*0.3:parent.width*0.3 } - ConnectionIcon { - id: buzzerConnIcon - status: speedBackend.baseStationConnections[1]["state"] + Row { + id: connectedExtensionsRow - source: appTheme.style.buzzerIcon anchors { top: parent.top topMargin: 10 left: baseConnConnIcon.right leftMargin: 1 } - height: !root.landscape()? parent.height*0.17:parent.width*0.17 - } - ConnectionIcon { - id: startpadConnIcon - status: speedBackend.baseStationConnections[0]["state"] + height: parent.height + width: parent.width - source: appTheme.style.startpadIcon - anchors { - top: parent.top - topMargin: 10 - left: buzzerConnIcon.right - leftMargin: 0 + Repeater { + id: connectedExtensionsRep + anchors.fill: parent + model: speedBackend.baseStationConnections.length + delegate: ConnectionIcon { + id: buzzerConnIcon + status: speedBackend.baseStationConnections[index]["state"] + + source: { + var source + switch(speedBackend.baseStationConnections[index]["type"]){ + case "STARTPAD": + source = appTheme.style.startpadIcon + break + case "TOPPAD": + source = appTheme.style.buzzerIcon + break + } + } + + height: !root.landscape()? parent.height*0.17:parent.width*0.17 + } } - height: !root.landscape() ? parent.height*0.17:parent.width*0.17 } } - Rectangle { id: upper_line width: root.landscape() ? 1:parent.width @@ -238,8 +243,8 @@ Window { contentItem: Text { //make text disappear } - height: root.landscape() ? size > parent.height * 0.9 ? parent.height * 0.9:size : size - width: root.landscape() ? size : size > parent.width * 0.9 ? parent.width * 0.9:size + height: root.landscape() ? (size > parent.height * 0.9 ? parent.height * 0.9:size) : (size > parent.width * 0.9 ? parent.width * 0.9:size) + width: height Label { id: startButt_text @@ -361,10 +366,6 @@ Window { } } - ErrorDialog { - id: errorDialog - } - // ProfilesDialog { // id: profilesDialog // }