-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathPage1.qml
More file actions
38 lines (22 loc) · 672 Bytes
/
Page1.qml
File metadata and controls
38 lines (22 loc) · 672 Bytes
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
import QtQuick 2.7
Page1Form {
Connections {
target: serialTerminal
onGetData: {
terminal.append("<"+data);
}
}
sendBtn.onClicked: {
terminal.append(">"+dataToSend.text)
serialTerminal.writeToSerialPortSlot(dataToSend.text+"\r\n")
}
connectBtn.onClicked: {
if (serialTerminal.getConnectionStatusSlot() === false){
serialTerminal.openSerialPortSlot(serialPorts.currentText,serialPorts.currentText)
connectBtn.text = "Disconnect"
}else {
serialTerminal.closeSerialPortSlot();
connectBtn.text = "Connect"
}
}
}