-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.qml
107 lines (92 loc) · 2.33 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
import QtQuick 2.9
import QtQuick.Controls 2.2
import QlChannelSerial 1.0
ApplicationWindow {
property bool echo: false
id: window
visible: true
width: 640
height: 480
title: qsTr("NoTer")
header: ToolBar {
contentHeight: toolButton.implicitHeight
ToolButton {
id: toolButton
text: stackView.depth > 1 ? "\u25C0" : "\u2630"
font.pixelSize: Qt.application.font.pixelSize * 1.6
onClicked: {
if (stackView.depth > 1) {
stackView.pop()
} else {
drawer.open()
}
}
}
Label {
text: stackView.currentItem.title
anchors.centerIn: parent
}
}
Drawer {
id: drawer
width: window.width * 0.66
height: window.height
Column {
anchors.fill: parent
ItemDelegate {
text: qsTr("Configuración")
width: parent.width
onClicked: {
stackView.push(config)
drawer.close()
}
}
ItemDelegate {
text: qsTr("Utilidades")
width: parent.width
onClicked: {
stackView.push(util)
drawer.close()
}
}
}
}
StackView {
id:stackView;
anchors.fill: parent;
initialItem: cons
}
QlChannelSerial {
property bool openned: false
id: serial
onReadyReadSignal: {
var msg = getl()
cons.sendText(msg)
dell()
}
onConnected: {
openned = conn
}
}
Console{
property string connected
connected: serial.openned ? qsTr("Conectado") : qsTr("Desconectado")
id: cons
title: "Terminal - " + config.comboPuerto.currentText + ", "
+ config.comboBaudios.currentText + ", " + connected
consmode: config.checkBoxConsola.checked
hex: config.checkBoxHex.checked
localEcho: config.checkBoxEcho.checked
}
Utilidades{
id: util
visible: false
}
Config {
id: config
visible: false
}
ToastManager{
id: toast
}
}