-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.qml
284 lines (250 loc) · 7.56 KB
/
main.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15
ApplicationWindow {
visible: true
color: "transparent"
width: Screen.desktopAvailableWidth - 100
height: Screen.desktopAvailableHeight - 100
Component.onCompleted: {
// Commenting this to use properties instead of setters
//setX(Screen.width / 2 - width / 2);
//setY(Screen.height / 2 - height / 2);
x = Screen.width / 2 - width / 2
y = Screen.height / 2 - height / 2
}
title: "Badge System"
flags: Qt.FramelessWindowHint | Qt.WA_TranslucentBackground | Qt.Window
property string version
property string title
property string currTime : "INITIALIZING..."
property string odoostatus : "TCP/IP Pinging ODOO Server..."
property string odoostatus_color : "gray"
property string odooauthstatus : "XML Rpc Authing into ODOO Server..."
property string odooauthstatus_color : "gray"
property string rfid_area_color : "white"
property bool rfid_area_visible : true
property string rfid_process_status : "Initializing..."
property string rfid_process_status_color : "gray"
property string rfid_action_text : "WAITING CARD"
property string rfid_action_text_color : "black"
property string rfid_card_text : "- - -"
property string rfid_card_text_color : "black"
property string rfid_date_text : "- - -"
property string rfid_date_text_color : "black"
property QtObject running_clock
property QtObject odoopingcheck
property QtObject odooauthcheck
property QtObject rfid_process_check
property QtObject rfidCheck
Connections {
target: rfidCheck
function onRfidReset(msg) {
if (msg) {
rfid_area_color = "yellow"
}
}
}
Connections {
target: rfidCheck
function onRfidDate(msg) {
rfid_date_text = msg
}
}
Connections {
target: rfidCheck
function onRfidAction(msg) {
rfid_action_text = msg
}
}
Connections {
target: rfidCheck
function onRfidCardID(msg) {
rfid_card_text = msg
}
}
Connections {
target: rfidCheck
function onRfidCheckResult(msg) {
if (!msg) {
rfid_area_color = "red"
rfid_area_visible = "false";}
if (msg) {
rfid_area_color = "green"
rfid_area_visible = "true";}
}
}
Connections {
target: rfid_process_check
function onIsRfidReaderRunning(msg) {
if (!msg) {
rfid_process_status = "RFID Reader NOT Running"
rfid_process_status_color = "red";}
if (msg) {
rfid_process_status = "RFID Reader Running"
rfid_process_status_color = "green";}
}
}
Connections {
target: running_clock
function onTimetick(msg) {
currTime = msg;
}
}
Connections {
target: odoopingcheck
function onIsOdooUp(msg) {
if (!msg) {
odoostatus = "Odoo TCP/IP Ping FAILED"
odoostatus_color = "red";}
if (msg){
odoostatus = "Odoo TCP/IP Ping SUCCESS"
odoostatus_color = "green";}
}
}
Connections {
target: odooauthcheck
function onIsOdooAuth(msg){
if (!msg) {
odooauthstatus = "Odoo Instance Auth FAILED"
odooauthstatus_color = "red";}
if (msg){
odooauthstatus = "Odoo Instance Auth SUCCESS"
odooauthstatus_color = "green";}
}
}
Rectangle {
color: "transparent"
anchors.fill: parent
Rectangle {
anchors.fill: parent
color: "transparent"
Text {
anchors {
top: parent.top
topMargin: 110
horizontalCenter: parent.horizontalCenter
}
text: currTime
font.pixelSize: 64
color: "white"
}
Text {
anchors {
top: parent.top
topMargin: 15
left: parent.left
leftMargin: 15
}
text: title
font.pixelSize: 16
color: "white"
}
Text {
anchors {
top: parent.top
topMargin: 45
left: parent.left
leftMargin: 15
}
text: version
font.pixelSize: 16
color: "white"
}
Text {
anchors {
bottom: parent.bottom
bottomMargin: 75
left: parent.left
leftMargin: 15
}
text: "System status"
font.pixelSize: 24
color: "white"
}
Text {
anchors {
bottom: parent.bottom
bottomMargin: 30
left: parent.left
leftMargin: 15
}
text: "Sqlite DB Local connection OK"
font.pixelSize: 16
color: "green"
}
Text {
anchors {
bottom: parent.bottom
bottomMargin: 30
left: parent.left
leftMargin: 315
}
text: rfid_process_status
font.pixelSize: 16
color: rfid_process_status_color
}
Text {
anchors {
bottom: parent.bottom
bottomMargin: 30
left: parent.left
leftMargin: 615
}
text: odoostatus
font.pixelSize: 16
color: odoostatus_color
}
Text {
anchors {
bottom: parent.bottom
bottomMargin: 30
left: parent.left
leftMargin: 915
}
text: odooauthstatus
font.pixelSize: 16
color: odooauthstatus_color
}
Rectangle {
id: tag
visible: rfid_area_visible
width: 200
height: 200
color: rfid_area_color
anchors {
verticalCenter: parent.verticalCenter
right: parent.right
rightMargin: 100
}
Text {
text: rfid_action_text
font.pixelSize: 24
anchors {
horizontalCenter: parent.horizontalCenter
top: parent.top
topMargin: 45
}
}
Text {
text: rfid_card_text
font.pixelSize: 20
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: 60
}
}
Text {
text: rfid_date_text
font.pixelSize: 14
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: 25
}
}
}
}
}
}