|
CuteHMI - Modbus (CuteHMI.Modbus.2)
|
1 #ifndef H_EXTENSIONS_CUTEHMI_MODBUS_2_INCLUDE_CUTEHMI_MODBUS_RTUSERVER_HPP
2 #define H_EXTENSIONS_CUTEHMI_MODBUS_2_INCLUDE_CUTEHMI_MODBUS_RTUSERVER_HPP
4 #include "AbstractServer.hpp"
5 #include "internal/RegisterTraits.hpp"
6 #include "internal/QtRTUServerBackend.hpp"
8 #include <cutehmi/macros.hpp>
11 #include <QStateMachine>
39 Q_PROPERTY(
QString port READ port WRITE setPort NOTIFY portChanged)
40 Q_PROPERTY(QSerialPort::Parity parity READ parity WRITE setParity NOTIFY parityChanged)
41 Q_PROPERTY(QSerialPort::BaudRate baudRate READ baudRate WRITE setBaudRate NOTIFY baudRateChanged)
42 Q_PROPERTY(QSerialPort::DataBits dataBits READ dataBits WRITE setDataBits NOTIFY dataBitsChanged)
43 Q_PROPERTY(QSerialPort::StopBits stopBits READ stopBits WRITE setStopBits NOTIFY stopBitsChanged)
44 Q_PROPERTY(
int slaveAddress READ slaveAddress WRITE setSlaveAddress NOTIFY slaveAddressChanged)
52 void setPort(const
QString & port);
54 QSerialPort::Parity parity() const;
56 void setParity(QSerialPort::Parity);
58 QSerialPort::BaudRate baudRate() const;
60 void setBaudRate(QSerialPort::BaudRate baudRate);
62 QSerialPort::DataBits dataBits() const;
64 void setDataBits(QSerialPort::DataBits dataBits);
66 QSerialPort::StopBits stopBits() const;
68 void setStopBits(QSerialPort::StopBits stopBits);
70 int slaveAddress() const;
72 void setSlaveAddress(
int slaveAddress);
74 void setBusy(
bool busy) override;
79 void close() override;
86 void baudRateChanged();
88 void dataBitsChanged();
90 void stopBitsChanged();
92 void slaveAddressChanged();
105 backend(& config, coilData, discreteInputData, holdingRegisterData, inputRegisterData)
RegisterTraits< DiscreteInput >::Container DiscreteInputDataContainer
Definition: QtRTUServer.hpp:28
RegisterTraits< Coil >::Container CoilDataContainer
Definition: QtRTUServer.hpp:27
TCP server backend.
Definition: QtRTUServerBackend.hpp:15
static constexpr QSerialPort::BaudRate INITIAL_BAUD_RATE
Definition: RTUServerConfig.hpp:27
static constexpr int INITIAL_HOLDING_REGISTERS_ADDRESS_RANGE_MAX
Definition: RTUServerConfig.hpp:36
static const char * INITIAL_PORT
Definition: RTUServer.hpp:24
static constexpr QSerialPort::Parity INITIAL_PARITY
Definition: RTUServerConfig.hpp:26
static constexpr int INITIAL_DISCRETE_INPUTS_ADDRESS_RANGE_MIN
Definition: RTUServerConfig.hpp:33
static constexpr QSerialPort::DataBits INITIAL_DATA_BITS
Definition: RTUServerConfig.hpp:28
RegisterTraits< HoldingRegister >::Container HoldingRegisterDataContainer
Definition: QtRTUServer.hpp:29
Definition: RTUServer.hpp:16
static constexpr int MIN_SLAVE_ADDRESS
Definition: RTUServerConfig.hpp:23
static constexpr QSerialPort::StopBits INITIAL_STOP_BITS
Definition: RTUServerConfig.hpp:29
static constexpr int MAX_SLAVE_ADDRESS
Definition: RTUServerConfig.hpp:24
static constexpr int INITIAL_DISCRETE_INPUTS_ADDRESS_RANGE_MAX
Definition: RTUServerConfig.hpp:34
static constexpr int INITIAL_INPUT_REGISTERS_ADDRESS_RANGE_MAX
Definition: RTUServerConfig.hpp:38
static constexpr int INITIAL_HOLDING_REGISTERS_ADDRESS_RANGE_MIN
Definition: RTUServerConfig.hpp:35
Definition: RTUServerConfig.hpp:15
static constexpr int INITIAL_COILS_ADDRESS_RANGE_MIN
Definition: RTUServerConfig.hpp:31
static constexpr int INITIAL_COILS_ADDRESS_RANGE_MAX
Definition: RTUServerConfig.hpp:32
Abstract server.
Definition: AbstractServer.hpp:15
static constexpr int INITIAL_INPUT_REGISTERS_ADDRESS_RANGE_MIN
Definition: RTUServerConfig.hpp:37
RegisterTraits< InputRegister >::Container InputRegisterDataContainer
Definition: QtRTUServer.hpp:30
static constexpr int INITIAL_SLAVE_ADDRESS
Definition: RTUServerConfig.hpp:30