-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInertiaPage.qml
127 lines (111 loc) · 3.21 KB
/
InertiaPage.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.1
Rectangle{
color: "white"
height: parent.height - 10
width: parent.width
anchors.top: parent.top
anchors.topMargin: 5
anchors.left: parent.left
anchors.leftMargin: 0
Component.onCompleted: {
ark.incrementComponents();
ark.flushButtonTransients();
}
Button{
id: card_6_0
width: parent.width - 20
height: 50
anchors.left: parent.left
anchors.leftMargin: 7
anchors.top: parent.top
anchors.topMargin: 5
Material.background: "white"
text: "Enable"
ToolTip.visible: hovered
ToolTip.text: "Enable/Disable Drive"
property int boxToken: 6
property int cardToken: 0
function setValue(value){ Material.background = (value == 1) ? Material.Green : Material.Red;}
Connections{
target: ark
onUpChildVal: {
if (card_6_0.boxToken === box)
{
if (card_6_0.cardToken === card)
{
card_6_0.setValue(value);
}}}
}
onClicked: {
ark.upButtonTransient(card_6_0.boxToken, card_6_0.cardToken);
}
}
Button{
id: card_7_0
width: parent.width - 20
height: 50
anchors.left: parent.left
anchors.leftMargin: 7
anchors.top: card_6_0.bottom
anchors.topMargin: 5
Material.background: "white"
text: "Detect Inertia"
ToolTip.visible: hovered
ToolTip.text: "Set Detect Inertia Flag in Drive"
property int boxToken: 7
property int cardToken: 0
function setValue(value){ Material.background = (value == 1) ? Material.Green : Material.Red;}
onWriteStatus: {
if (status === 1){
writeCard.message = "Write Successful";
}
else{
writeCard.message = "Write Failure";
}
writeTimer.counter = 0;
writeTimer.restart();
}
onUpWriteStatus(status){ \n\n if (status === 1){ \n writeCard.message = \"Write Successful\"; \n } \n else{ \n writeCard.message = \"Write Failure\"; \n } \n writeTimer.counter = 0; \n writeTimer.restart(); \n\n } \n
"
Card{
id: writeCard
property string NewMessage: "None"
anchors.top: reportCard.bottom
Timer{
id: writeTimer
interval: 1000
running: false
repeat: true
property int counter: 0
property bool qul: false
onTriggered: {
counter += 1;
writeCard.setText(message + " " + counter + " sec ago");
}
}
Component.onCompleted: {
setName("Write Status: ");
setText(writeCard.message);
setFontSize(10);
setViewTool("Status of last Write Command");
}
}
Card{ \n id: writeCard \n property string message: \"\"\n \n anchors.top: reportCard.bottom \n\n Timer{\n id: writeTimer \n interval: 1000 \n running: false\n repeat: true \n property int counter: 0 \n onTriggered: {\n counter += 1;\n writeCard.setText(message + \" \" + counter + \" sec ago\");\n }\n }\n Component.onCompleted: { \n setName(\"Write Status: \"); \n setText(\"\"); \n setFontSize(10); \n setViewTool(\"Status of last Write Command\"); \n } \n}\n
"
Connections{
target: ark
onUpChildVal: {
if (card_7_0.boxToken === box)
{
if (card_7_0.cardToken === card)
{
card_7_0.setValue(value);
}}}
}
onClicked: {
ark.upButtonTransient(card_7_0.boxToken, card_7_0.cardToken);
}
}
}