import QtQuick 2.11
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.1
Item {
ServiceGroup {
id: modbusServiceGroup
name: "Modbus Service Group"
Service {
id: serverService
name: "TCP Server"
TCPServer {
id: server
}
}
Service {
id: clientService
name: "TCP Client"
TCPClient {
id: client
}
}
}
ColumnLayout {
anchors.centerIn: parent
spacing: 20
Label {
text: "Reminder: you may need to change default ports to higher numbers."
}
RowLayout {
id: serverLayout
spacing: 20
ColumnLayout {
spacing: 20
service: serverService
}
device: server
server: server
}
}
}
GridLayout {
id: serverControllersLayout
rows: 3
flow: GridLayout.TopToBottom
Label {
Layout.alignment:
Qt.AlignRight
text: qsTr("Register type:")
}
Label {
Layout.alignment:
Qt.AlignRight
text: qsTr("Address:")
}
Label {
Layout.alignment:
Qt.AlignRight
text: qsTr("Value:")
}
layout: serverControllersLayout
controller: CoilController {
device: server
}
}
layout: serverControllersLayout
controller: DiscreteInputController {
device: server
}
}
layout: serverControllersLayout
controller: HoldingRegisterController {
device: server
}
}
layout: serverControllersLayout
controller: InputRegisterController {
device: server
}
}
}
}
RowLayout {
id: clientLayout
spacing: 20
ColumnLayout {
spacing: 20
service: clientService
}
device: client
client: client
}
}
}
GridLayout {
id: clientControllersLayout
rows: 3
flow: GridLayout.TopToBottom
Label {
Layout.alignment:
Qt.AlignRight
text: qsTr("Register type:")
}
Label {
Layout.alignment:
Qt.AlignRight
text: qsTr("Address:")
}
Label {
Layout.alignment:
Qt.AlignRight
text: qsTr("Value:")
}
layout: clientControllersLayout
controller: CoilController {
device: client
}
}
layout: clientControllersLayout
text: qsTr("Discrete input (read-only)")
controller: DiscreteInputController {
device: client
}
}
layout: clientControllersLayout
controller: HoldingRegisterController {
device: client
}
}
layout: clientControllersLayout
text: qsTr("Input register (read-only)")
controller: InputRegisterController {
device: client
}
}
}
}
}
}
Definition: CoilControl.qml:8
Definition: DeviceControl.qml:7
Definition: HoldingRegisterControl.qml:8
Definition: ServiceControl.qml:7
Definition: TCPClientConfiguration.qml:6
Definition: TCPServerConfiguration.qml:6