proto-debuger/protoDebuger/main.qml

176 lines
5.2 KiB
QML
Raw Permalink Normal View History

2021-04-04 02:57:36 +00:00
import QtQuick 2.14
import QtQuick.Window 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.12
2021-04-12 15:39:06 +00:00
Rectangle {
2021-05-01 06:09:18 +00:00
objectName: "main"
2021-04-04 02:57:36 +00:00
id: root
2021-05-01 06:09:18 +00:00
width: 1440
height: 900
2021-04-04 02:57:36 +00:00
visible: true
2021-04-07 15:45:42 +00:00
2021-05-03 16:05:38 +00:00
function on_notify(str){
status.text = str;
}
2021-04-04 02:57:36 +00:00
Flow{
anchors.fill: parent
width: parent.width
height: parent.height
Rectangle {
2021-08-29 08:13:50 +00:00
width: 130;
2021-04-04 02:57:36 +00:00
height: parent.height
color: "black"
Flow{
id: element
flow:Flow.TopToBottom //从上到下排列
width: parent.width
height: parent.height
Button{
2021-05-03 05:50:07 +00:00
id: btn_serial
2021-04-04 02:57:36 +00:00
width: parent.width
2021-08-29 08:13:50 +00:00
height:80
2021-04-04 02:57:36 +00:00
onClicked: {
2021-04-07 15:45:42 +00:00
uart_choose.visible = true
2021-04-10 14:22:41 +00:00
net_choose.visible = false
proto_debug.visible = false
2021-04-04 02:57:36 +00:00
}
background: Image {
2021-08-29 08:13:50 +00:00
source: btn_serial.hovered? "qrc:///res/serial1.svg": "qrc:///res/serial.svg"
2021-04-04 02:57:36 +00:00
}
}
Text {
2021-05-03 05:50:07 +00:00
id: label_serial
2021-04-04 02:57:36 +00:00
text: qsTr("串口设置")
width: parent.width
color: "white"
2021-08-29 08:13:50 +00:00
font.pointSize: 15
2021-05-03 05:50:07 +00:00
anchors.top: btn_serial.bottom
2021-08-29 08:13:50 +00:00
leftPadding: 15
2021-06-30 16:50:13 +00:00
2021-04-04 02:57:36 +00:00
}
Button{
2021-05-03 05:50:07 +00:00
id: button_net
2021-04-04 02:57:36 +00:00
width: parent.width
2021-08-29 08:13:50 +00:00
height:80
2021-05-03 05:50:07 +00:00
anchors.top: label_serial.bottom
2021-04-04 02:57:36 +00:00
onClicked: {
2021-04-10 14:22:41 +00:00
2021-04-04 02:57:36 +00:00
}
2021-08-03 15:45:29 +00:00
background: Image {
source: button_net.hovered? "qrc:///res/nethover.svg":"qrc:///res/net.svg"
2021-04-04 02:57:36 +00:00
}
onPressed:{
2021-04-07 15:45:42 +00:00
uart_choose.visible = false
2021-04-10 14:22:41 +00:00
net_choose.visible = true
proto_debug.visible = false
2021-04-04 02:57:36 +00:00
}
}
Text {
2021-05-03 05:50:07 +00:00
id: label_net
2021-04-04 02:57:36 +00:00
text: qsTr("网口设置")
width: parent.width
color: "white"
2021-08-29 08:13:50 +00:00
font.pointSize: 15
2021-05-03 05:50:07 +00:00
anchors.top: button_net.bottom
2021-08-29 08:13:50 +00:00
leftPadding: 15
2021-06-30 16:50:13 +00:00
2021-04-04 02:57:36 +00:00
}
Button{
2021-05-03 05:50:07 +00:00
id: button_proto
2021-04-04 02:57:36 +00:00
width: parent.width
2021-08-29 08:13:50 +00:00
height:80
2021-05-03 05:50:07 +00:00
anchors.top: label_net.bottom
2021-04-04 02:57:36 +00:00
onClicked: {
2021-04-11 03:28:04 +00:00
uart_choose.visible = false
net_choose.visible = false
proto_debug.visible = true
2021-04-12 15:39:06 +00:00
DataWrap.getValFromQml(1)
2021-04-04 02:57:36 +00:00
}
background: Image {
2021-08-29 08:13:50 +00:00
source: !button_proto.hovered? "qrc:///res/proto.svg":"qrc:///res/proto_hover.svg"
2021-04-04 02:57:36 +00:00
}
}
Text {
2021-05-03 05:50:07 +00:00
id: label_proto
2021-04-04 02:57:36 +00:00
text: qsTr("协议调试")
width: parent.width
color: "white"
2021-08-29 08:13:50 +00:00
font.pointSize: 15
2021-05-03 05:50:07 +00:00
anchors.top: button_proto.bottom
2021-08-29 08:13:50 +00:00
leftPadding: 15
2021-06-30 16:50:13 +00:00
}
Button{
id: button_tcp_swarm
width: parent.width
height:60
anchors.top: label_proto.bottom
onClicked: {
uart_choose.visible = false
net_choose.visible = false
proto_debug.visible = false
tcp_swarm.visible = true
DataWrap.getValFromQml(1)
}
background: Image {
source: "qrc:///res/proto.svg"
}
}
Text {
id: label_button_tcp_swarm
text: qsTr("tcp集群")
width: parent.width
color: "white"
2021-08-29 08:13:50 +00:00
font.pointSize: 15
2021-06-30 16:50:13 +00:00
anchors.top: button_tcp_swarm.bottom
2021-08-29 08:13:50 +00:00
leftPadding: 15
2021-04-04 02:57:36 +00:00
}
2021-05-03 05:50:07 +00:00
2021-05-02 18:02:25 +00:00
Text {
2021-05-03 16:05:38 +00:00
id: status
2021-05-03 05:50:07 +00:00
text: qsTr("未连接")
2021-05-02 18:02:25 +00:00
width: parent.width
color: "white"
2021-08-29 08:13:50 +00:00
font.pointSize: 10
2021-05-03 05:50:07 +00:00
anchors.bottom: parent.bottom
2021-05-03 16:05:38 +00:00
Layout.leftMargin: 10
Layout.bottomMargin: 10
2021-05-02 18:02:25 +00:00
}
2021-05-03 05:50:07 +00:00
2021-04-04 02:57:36 +00:00
}
}
2021-04-10 14:22:41 +00:00
SerialSelect{
2021-04-07 15:45:42 +00:00
id: uart_choose
2021-08-29 08:13:50 +00:00
width: parent.width - 130
2021-04-24 17:21:31 +00:00
height: parent.height
2021-04-07 15:45:42 +00:00
}
2021-04-10 14:22:41 +00:00
NetSelect{
2021-04-11 03:28:04 +00:00
id: net_choose
2021-08-29 08:13:50 +00:00
width: parent.width - 130
2021-04-24 17:21:31 +00:00
height: parent.height
2021-04-07 15:45:42 +00:00
}
2021-04-10 14:22:41 +00:00
2021-04-13 17:28:19 +00:00
ProtoDebug{
2021-04-11 03:28:04 +00:00
id: proto_debug
2021-08-29 08:13:50 +00:00
width: parent.width - 130
2021-04-07 15:45:42 +00:00
height: parent.height
visible: false
2021-04-04 02:57:36 +00:00
}
2021-06-30 16:50:13 +00:00
TcpSwarm{
id: tcp_swarm
2021-08-29 08:13:50 +00:00
width: parent.width - 130
2021-06-30 16:50:13 +00:00
height: parent.height
visible: false
}
2021-04-13 17:28:19 +00:00
2021-04-04 02:57:36 +00:00
}
}