Preperations for modbus rtu
This commit is contained in:
@ -6,10 +6,10 @@
|
|||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QModbusTcpClient>
|
#include <QModbusClient>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
ChangeValuesDialog::ChangeValuesDialog(QModbusTcpClient &modbus, int serverAddress, QModbusDataUnit::RegisterType registerType, QWidget *parent) :
|
ChangeValuesDialog::ChangeValuesDialog(QModbusClient &modbus, int serverAddress, QModbusDataUnit::RegisterType registerType, QWidget *parent) :
|
||||||
QDialog{parent},
|
QDialog{parent},
|
||||||
m_ui{std::make_unique<Ui::ChangeValuesDialog>()},
|
m_ui{std::make_unique<Ui::ChangeValuesDialog>()},
|
||||||
m_modbus{modbus}
|
m_modbus{modbus}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "changevaluesmodel.h"
|
#include "changevaluesmodel.h"
|
||||||
|
|
||||||
// forward declares
|
// forward declares
|
||||||
class QModbusTcpClient;
|
class QModbusClient;
|
||||||
class QModbusReply;
|
class QModbusReply;
|
||||||
namespace Ui {class ChangeValuesDialog; }
|
namespace Ui {class ChangeValuesDialog; }
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ class ChangeValuesDialog : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ChangeValuesDialog(QModbusTcpClient &modbus, int serverAddress, QModbusDataUnit::RegisterType registerType, QWidget *parent = nullptr);
|
explicit ChangeValuesDialog(QModbusClient &modbus, int serverAddress, QModbusDataUnit::RegisterType registerType, QWidget *parent = nullptr);
|
||||||
~ChangeValuesDialog() override;
|
~ChangeValuesDialog() override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -29,7 +29,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
const std::unique_ptr<Ui::ChangeValuesDialog> m_ui;
|
const std::unique_ptr<Ui::ChangeValuesDialog> m_ui;
|
||||||
QModbusTcpClient &m_modbus;
|
QModbusClient &m_modbus;
|
||||||
ChangeValuesModel m_model;
|
ChangeValuesModel m_model;
|
||||||
std::unique_ptr<QModbusReply> m_reply;
|
std::unique_ptr<QModbusReply> m_reply;
|
||||||
};
|
};
|
||||||
|
4
main.cpp
4
main.cpp
@ -7,8 +7,6 @@
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication app{argc, argv};
|
|
||||||
|
|
||||||
qSetMessagePattern(QStringLiteral("%{time dd.MM.yyyy HH:mm:ss.zzz} "
|
qSetMessagePattern(QStringLiteral("%{time dd.MM.yyyy HH:mm:ss.zzz} "
|
||||||
"["
|
"["
|
||||||
"%{if-debug}D%{endif}"
|
"%{if-debug}D%{endif}"
|
||||||
@ -25,6 +23,8 @@ int main(int argc, char *argv[])
|
|||||||
QCoreApplication::setApplicationName(QStringLiteral("qmodbustester"));
|
QCoreApplication::setApplicationName(QStringLiteral("qmodbustester"));
|
||||||
QCoreApplication::setApplicationVersion(QStringLiteral("1.0"));
|
QCoreApplication::setApplicationVersion(QStringLiteral("1.0"));
|
||||||
|
|
||||||
|
QApplication app{argc, argv};
|
||||||
|
|
||||||
MainWindow mainWindow;
|
MainWindow mainWindow;
|
||||||
mainWindow.show();
|
mainWindow.show();
|
||||||
|
|
||||||
|
145
mainwindow.cpp
145
mainwindow.cpp
@ -3,7 +3,10 @@
|
|||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QSerialPort>
|
||||||
|
#include <QSerialPortInfo>
|
||||||
#include <QModbusTcpClient>
|
#include <QModbusTcpClient>
|
||||||
|
#include <QtSerialBus/QModbusRtuSerialMaster>
|
||||||
#include <QModbusReply>
|
#include <QModbusReply>
|
||||||
#include <QMetaEnum>
|
#include <QMetaEnum>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@ -23,26 +26,13 @@ QString toString(QModbusDataUnit::RegisterType registerType);
|
|||||||
MainWindow::MainWindow(QWidget *parent) :
|
MainWindow::MainWindow(QWidget *parent) :
|
||||||
QMainWindow{parent},
|
QMainWindow{parent},
|
||||||
m_ui{std::make_unique<Ui::MainWindow>()},
|
m_ui{std::make_unique<Ui::MainWindow>()},
|
||||||
m_modbus{std::make_unique<QModbusTcpClient>(this)},
|
m_model{std::make_unique<ModbusTableModel>(this)},
|
||||||
m_model{std::make_unique<ModbusTableModel>(this)}
|
m_completerModel{this},
|
||||||
|
m_completer{&m_completerModel, this}
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
m_ui->spinBoxTimeout->setValue(m_modbus->timeout());
|
qDebug() << m_settings.fileName();
|
||||||
connect(m_modbus.get(), &QModbusClient::timeoutChanged, m_ui->spinBoxTimeout, &QSpinBox::setValue);
|
|
||||||
connect(m_ui->spinBoxTimeout, &QSpinBox::valueChanged, m_modbus.get(), &QModbusClient::setTimeout);
|
|
||||||
|
|
||||||
m_ui->spinBoxRetries->setValue(m_modbus->numberOfRetries());
|
|
||||||
//connect(m_modbus.get(), &QModbusClient::numberOfRetriesChanged, m_ui->spinBoxRetries, &QSpinBox::setValue);
|
|
||||||
connect(m_ui->spinBoxRetries, &QSpinBox::valueChanged, m_modbus.get(), &QModbusClient::setNumberOfRetries);
|
|
||||||
|
|
||||||
modbusStateChanged(m_modbus->state());
|
|
||||||
|
|
||||||
connect(m_modbus.get(), &QModbusClient::errorOccurred,
|
|
||||||
this, &MainWindow::modbusErrorOccured);
|
|
||||||
|
|
||||||
connect(m_modbus.get(), &QModbusClient::stateChanged,
|
|
||||||
this, &MainWindow::modbusStateChanged);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
const auto addItem = [&](const auto &text, const auto &value){
|
const auto addItem = [&](const auto &text, const auto &value){
|
||||||
@ -63,11 +53,44 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
connect(m_ui->pushButtonRequest, &QAbstractButton::pressed, this, &MainWindow::requestPressed);
|
connect(m_ui->pushButtonRequest, &QAbstractButton::pressed, this, &MainWindow::requestPressed);
|
||||||
connect(m_ui->pushButtonWrite, &QAbstractButton::pressed, this, &MainWindow::writePressed);
|
connect(m_ui->pushButtonWrite, &QAbstractButton::pressed, this, &MainWindow::writePressed);
|
||||||
|
|
||||||
|
auto completions = m_settings.value("lastHosts").toStringList();
|
||||||
|
m_completerModel.setStringList(completions);
|
||||||
|
|
||||||
|
m_completer.setModel(&m_completerModel);
|
||||||
|
m_completer.setCaseSensitivity(Qt::CaseInsensitive);
|
||||||
|
m_ui->lineEditServer->setCompleter(&m_completer);
|
||||||
|
|
||||||
|
if (!completions.isEmpty())
|
||||||
|
m_ui->lineEditServer->setText(completions.first());
|
||||||
|
|
||||||
m_ui->tableView->setModel(m_model.get());
|
m_ui->tableView->setModel(m_model.get());
|
||||||
|
|
||||||
|
refreshSerialPorts();
|
||||||
|
|
||||||
|
connect(m_ui->toolButtonRefreshSerialports, &QToolButton::pressed, this, &MainWindow::refreshSerialPorts);
|
||||||
|
|
||||||
|
{
|
||||||
|
QMetaEnum e = QMetaEnum::fromType<QSerialPort::Parity>();
|
||||||
|
for (int i = 0; i < e.keyCount(); i++)
|
||||||
|
m_ui->comboBoxParity->addItem(e.key(i), QSerialPort::Parity(e.value(i)));
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
QMetaEnum e = QMetaEnum::fromType<QSerialPort::StopBits>();
|
||||||
|
for (int i = 0; i < e.keyCount(); i++)
|
||||||
|
m_ui->comboBoxStopBits->addItem(e.key(i), QSerialPort::StopBits(e.value(i)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow() = default;
|
MainWindow::~MainWindow() = default;
|
||||||
|
|
||||||
|
void MainWindow::refreshSerialPorts()
|
||||||
|
{
|
||||||
|
m_ui->comboBoxSerialPort->clear();
|
||||||
|
for (const auto &port : QSerialPortInfo::availablePorts())
|
||||||
|
m_ui->comboBoxSerialPort->addItem(port.portName() + " [" + port.manufacturer() + "; " + port.serialNumber() + "]", port.portName());
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::connectPressed()
|
void MainWindow::connectPressed()
|
||||||
{
|
{
|
||||||
if (m_reply)
|
if (m_reply)
|
||||||
@ -78,30 +101,70 @@ void MainWindow::connectPressed()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (const auto state = m_modbus->state())
|
switch (!m_modbus || m_modbus->state() != QModbusDevice::ConnectedState)
|
||||||
{
|
{
|
||||||
case QModbusDevice::ConnectedState:
|
case false:
|
||||||
m_modbus->disconnectDevice();
|
m_modbus->disconnectDevice();
|
||||||
|
m_modbus.release()->deleteLater();
|
||||||
break;
|
break;
|
||||||
case QModbusDevice::UnconnectedState:
|
|
||||||
m_modbus->setConnectionParameter(QModbusDevice::NetworkAddressParameter, m_ui->lineEditServer->text());
|
case true :
|
||||||
m_modbus->setConnectionParameter(QModbusDevice::NetworkPortParameter, m_ui->spinBoxPort->value());
|
switch (m_ui->comboBoxConnectionType->currentIndex())
|
||||||
|
{
|
||||||
|
case 0: // tcp
|
||||||
|
m_modbus = std::make_unique<QModbusTcpClient>(this);
|
||||||
|
m_modbus->setConnectionParameter(QModbusDevice::NetworkAddressParameter, m_ui->lineEditServer->text());
|
||||||
|
m_modbus->setConnectionParameter(QModbusDevice::NetworkPortParameter, m_ui->spinBoxPort->value());
|
||||||
|
break;
|
||||||
|
case 1: // rtu
|
||||||
|
m_modbus = std::make_unique<QModbusRtuSerialMaster>(this);
|
||||||
|
m_modbus->setConnectionParameter(QModbusDevice::SerialPortNameParameter, m_ui->comboBoxSerialPort->currentData().toString());
|
||||||
|
m_modbus->setConnectionParameter(QModbusDevice::SerialParityParameter, m_ui->comboBoxParity->currentData().value<QSerialPort::Parity>());
|
||||||
|
m_modbus->setConnectionParameter(QModbusDevice::SerialBaudRateParameter, QSerialPort::Baud9600);
|
||||||
|
m_modbus->setConnectionParameter(QModbusDevice::SerialStopBitsParameter, m_ui->comboBoxStopBits->currentData().value<QSerialPort::StopBits>());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
QMessageBox::warning(this, tr("Invalid connection type"), tr("Invalid connection type"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_modbus->setTimeout(m_ui->spinBoxTimeout->value());
|
||||||
|
connect(m_modbus.get(), &QModbusClient::timeoutChanged, m_ui->spinBoxTimeout, &QSpinBox::setValue);
|
||||||
|
connect(m_ui->spinBoxTimeout, &QSpinBox::valueChanged, m_modbus.get(), &QModbusClient::setTimeout);
|
||||||
|
|
||||||
|
m_modbus->setNumberOfRetries(m_ui->spinBoxRetries->value());
|
||||||
|
//connect(m_modbus.get(), &QModbusClient::numberOfRetriesChanged, m_ui->spinBoxRetries, &QSpinBox::setValue);
|
||||||
|
connect(m_ui->spinBoxRetries, &QSpinBox::valueChanged, m_modbus.get(), &QModbusClient::setNumberOfRetries);
|
||||||
|
|
||||||
|
modbusStateChanged(m_modbus->state());
|
||||||
|
|
||||||
|
connect(m_modbus.get(), &QModbusClient::errorOccurred,
|
||||||
|
this, &MainWindow::modbusErrorOccured);
|
||||||
|
|
||||||
|
connect(m_modbus.get(), &QModbusClient::stateChanged,
|
||||||
|
this, &MainWindow::modbusStateChanged);
|
||||||
|
|
||||||
|
|
||||||
if (!m_modbus->connectDevice())
|
if (!m_modbus->connectDevice())
|
||||||
{
|
{
|
||||||
|
QMessageBox::warning(this,
|
||||||
|
tr("Modbus client could not connect"),
|
||||||
|
tr("Modbus client could not connect:\n\n%0")
|
||||||
|
.arg(m_modbus->errorString())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
QMessageBox::warning(this,
|
|
||||||
tr("Modbus client is in wrong state"),
|
|
||||||
tr("Modbus client is in wrong state:\n\n%0")
|
|
||||||
.arg(QMetaEnum::fromType<QModbusDevice::State>().valueToKey(state))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::requestPressed()
|
void MainWindow::requestPressed()
|
||||||
{
|
{
|
||||||
|
if (!m_modbus)
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("No valid serial port openend"), tr("No valid serial port openend"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (const auto state = m_modbus->state(); state != QModbusDevice::ConnectedState)
|
if (const auto state = m_modbus->state(); state != QModbusDevice::ConnectedState)
|
||||||
{
|
{
|
||||||
QMessageBox::warning(this,
|
QMessageBox::warning(this,
|
||||||
@ -134,7 +197,7 @@ void MainWindow::requestPressed()
|
|||||||
|
|
||||||
QModbusDataUnit dataUnit(registerType.value<QModbusDataUnit::RegisterType>(), m_ui->spinBoxRegister->value(), m_ui->spinBoxCount->value());
|
QModbusDataUnit dataUnit(registerType.value<QModbusDataUnit::RegisterType>(), m_ui->spinBoxRegister->value(), m_ui->spinBoxCount->value());
|
||||||
qDebug() << m_ui->spinBoxSlave->value() << dataUnit.registerType() << dataUnit.startAddress() << dataUnit.valueCount();
|
qDebug() << m_ui->spinBoxSlave->value() << dataUnit.registerType() << dataUnit.startAddress() << dataUnit.valueCount();
|
||||||
if (m_reply = std::unique_ptr<QModbusReply>(m_modbus->sendReadRequest(std::move(dataUnit), m_ui->spinBoxSlave->value())))
|
if (m_reply = std::unique_ptr<QModbusReply>{m_modbus->sendReadRequest(std::move(dataUnit), m_ui->spinBoxSlave->value())})
|
||||||
{
|
{
|
||||||
updateRequestFields();
|
updateRequestFields();
|
||||||
|
|
||||||
@ -146,6 +209,8 @@ void MainWindow::requestPressed()
|
|||||||
if (!m_ui->checkBoxAutorefresh->isChecked())
|
if (!m_ui->checkBoxAutorefresh->isChecked())
|
||||||
m_model->setResult({});
|
m_model->setResult({});
|
||||||
connect(m_reply.get(), &QModbusReply::finished, this, &MainWindow::replyFinished);
|
connect(m_reply.get(), &QModbusReply::finished, this, &MainWindow::replyFinished);
|
||||||
|
connect(m_reply.get(), &QModbusReply::errorOccurred, this, &MainWindow::replyErrorOccurred);
|
||||||
|
connect(m_reply.get(), &QModbusReply::intermediateErrorOccurred, this, &MainWindow::replyIntermediateErrorOccurred);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -189,7 +254,15 @@ void MainWindow::modbusStateChanged(int state)
|
|||||||
m_ui->labelConnectionStatus->setText(QMetaEnum::fromType<QModbusDevice::State>().valueToKey(state));
|
m_ui->labelConnectionStatus->setText(QMetaEnum::fromType<QModbusDevice::State>().valueToKey(state));
|
||||||
|
|
||||||
if (state == QModbusDevice::ConnectedState)
|
if (state == QModbusDevice::ConnectedState)
|
||||||
|
{
|
||||||
|
auto completions = m_settings.value("lastHosts").toStringList();
|
||||||
|
completions.removeAll(m_ui->lineEditServer->text());
|
||||||
|
completions.prepend(m_ui->lineEditServer->text());
|
||||||
|
m_settings.setValue("lastHosts", completions);
|
||||||
|
m_completerModel.setStringList(completions);
|
||||||
|
|
||||||
m_ui->pushButtonConnect->setText(tr("Disconnect"));
|
m_ui->pushButtonConnect->setText(tr("Disconnect"));
|
||||||
|
}
|
||||||
else if (state == QModbusDevice::UnconnectedState)
|
else if (state == QModbusDevice::UnconnectedState)
|
||||||
{
|
{
|
||||||
m_ui->pushButtonConnect->setText(tr("Connect"));
|
m_ui->pushButtonConnect->setText(tr("Connect"));
|
||||||
@ -238,7 +311,7 @@ void MainWindow::replyFinished()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qWarning() << "result is invalid!";
|
qWarning() << "result is invalid!" << m_reply->error() << m_reply->errorString();
|
||||||
|
|
||||||
m_model->setResult({});
|
m_model->setResult({});
|
||||||
|
|
||||||
@ -290,6 +363,16 @@ void MainWindow::replyFinished()
|
|||||||
updateRequestFields();
|
updateRequestFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::replyErrorOccurred(QModbusDevice::Error error)
|
||||||
|
{
|
||||||
|
qDebug() << error;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::replyIntermediateErrorOccurred(QModbusDevice::IntermediateError error)
|
||||||
|
{
|
||||||
|
qDebug() << error;
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::updateRequestFields()
|
void MainWindow::updateRequestFields()
|
||||||
{
|
{
|
||||||
m_ui->spinBoxSlave->setEnabled(!m_reply);
|
m_ui->spinBoxSlave->setEnabled(!m_reply);
|
||||||
|
16
mainwindow.h
16
mainwindow.h
@ -6,9 +6,14 @@
|
|||||||
// Qt includes
|
// Qt includes
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
|
#include <QStringListModel>
|
||||||
|
#include <QSettings>
|
||||||
|
#include <QCompleter>
|
||||||
|
#include <QSettings>
|
||||||
|
#include <qmodbusdevice.h>
|
||||||
|
|
||||||
// forward declares
|
// forward declares
|
||||||
class QModbusTcpClient;
|
class QModbusClient;
|
||||||
class QModbusReply;
|
class QModbusReply;
|
||||||
namespace Ui { class MainWindow; }
|
namespace Ui { class MainWindow; }
|
||||||
class ModbusTableModel;
|
class ModbusTableModel;
|
||||||
@ -22,6 +27,8 @@ public:
|
|||||||
~MainWindow() override;
|
~MainWindow() override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void refreshSerialPorts();
|
||||||
|
|
||||||
void connectPressed();
|
void connectPressed();
|
||||||
void requestPressed();
|
void requestPressed();
|
||||||
void writePressed();
|
void writePressed();
|
||||||
@ -30,13 +37,18 @@ private slots:
|
|||||||
void modbusStateChanged(int state);
|
void modbusStateChanged(int state);
|
||||||
|
|
||||||
void replyFinished();
|
void replyFinished();
|
||||||
|
void replyErrorOccurred(QModbusDevice::Error error);
|
||||||
|
void replyIntermediateErrorOccurred(QModbusDevice::IntermediateError error);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateRequestFields();
|
void updateRequestFields();
|
||||||
|
|
||||||
const std::unique_ptr<Ui::MainWindow> m_ui;
|
const std::unique_ptr<Ui::MainWindow> m_ui;
|
||||||
const std::unique_ptr<QModbusTcpClient> m_modbus;
|
QSettings m_settings;
|
||||||
|
std::unique_ptr<QModbusClient> m_modbus;
|
||||||
const std::unique_ptr<ModbusTableModel> m_model;
|
const std::unique_ptr<ModbusTableModel> m_model;
|
||||||
std::unique_ptr<QModbusReply> m_reply;
|
std::unique_ptr<QModbusReply> m_reply;
|
||||||
QElapsedTimer m_timer;
|
QElapsedTimer m_timer;
|
||||||
|
QStringListModel m_completerModel;
|
||||||
|
QCompleter m_completer;
|
||||||
};
|
};
|
||||||
|
191
mainwindow.ui
191
mainwindow.ui
@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>947</width>
|
<width>1108</width>
|
||||||
<height>736</height>
|
<height>736</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -25,40 +25,135 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="labelServer">
|
<widget class="QComboBox" name="comboBoxConnectionType">
|
||||||
<property name="text">
|
<item>
|
||||||
<string>Server:</string>
|
<property name="text">
|
||||||
</property>
|
<string>TCP</string>
|
||||||
<property name="buddy">
|
</property>
|
||||||
<cstring>lineEditServer</cstring>
|
</item>
|
||||||
</property>
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Serial</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="lineEditServer">
|
<widget class="QStackedWidget" name="stackedWidget">
|
||||||
<property name="text">
|
<property name="currentIndex">
|
||||||
<string>192.168.8.116</string>
|
<number>0</number>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="labelPort">
|
|
||||||
<property name="text">
|
|
||||||
<string>Port:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>spinBoxPort</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="spinBoxPort">
|
|
||||||
<property name="maximum">
|
|
||||||
<number>65535</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>502</number>
|
|
||||||
</property>
|
</property>
|
||||||
|
<widget class="QWidget" name="page">
|
||||||
|
<layout class="QHBoxLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelServer">
|
||||||
|
<property name="text">
|
||||||
|
<string>Server:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>lineEditServer</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lineEditServer">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelPort">
|
||||||
|
<property name="text">
|
||||||
|
<string>Port:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>spinBoxPort</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinBoxPort">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>65535</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>502</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="page_2">
|
||||||
|
<layout class="QHBoxLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelSerialPort">
|
||||||
|
<property name="text">
|
||||||
|
<string>SerialPort:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>comboBoxSerialPort</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboBoxSerialPort"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="toolButtonRefreshSerialports">
|
||||||
|
<property name="text">
|
||||||
|
<string>🗘</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelBaudrate">
|
||||||
|
<property name="text">
|
||||||
|
<string>Baudrate:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>spinBoxBaudrate</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinBoxBaudrate">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>4000000</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>9600</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelParity">
|
||||||
|
<property name="text">
|
||||||
|
<string>Parity:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>comboBoxParity</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboBoxParity"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelStopBits">
|
||||||
|
<property name="text">
|
||||||
|
<string>StopBits:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>comboBoxStopBits</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboBoxStopBits"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -91,7 +186,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
@ -134,6 +229,9 @@
|
|||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>65535</number>
|
<number>65535</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>1000</number>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -151,6 +249,9 @@
|
|||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>65535</number>
|
<number>65535</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -166,7 +267,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_3">
|
<spacer name="horizontalSpacer_3">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
@ -277,7 +378,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_2">
|
<spacer name="horizontalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
@ -297,7 +398,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_4">
|
<spacer name="horizontalSpacer_4">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
@ -326,8 +427,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>947</width>
|
<width>1108</width>
|
||||||
<height>20</height>
|
<height>22</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@ -351,5 +452,21 @@
|
|||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>comboBoxConnectionType</sender>
|
||||||
|
<signal>currentIndexChanged(int)</signal>
|
||||||
|
<receiver>stackedWidget</receiver>
|
||||||
|
<slot>setCurrentIndex(int)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>123</x>
|
||||||
|
<y>44</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>225</x>
|
||||||
|
<y>44</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
</ui>
|
</ui>
|
||||||
|
Reference in New Issue
Block a user