M3KTE_TERM/M3KTE_TERM/lineringer.h
Вячеслав Штейбезандт 7dc314d266 Fix & update
> Исправлено окно настроек (Период опроса плат и раздел сетевого адреса)
> Исправлено значение Odd Parity при передаче
> Добавлена возможность остановить опрос платы

Добавлен модуль LineRinger для опроса Modbus устройств.
2025-03-12 11:05:14 +03:00

60 lines
1.1 KiB
C++

#ifndef LINERINGER_H
#define LINERINGER_H
#include <QWidget>
#include <QModbusTcpClient>
#include <QModbusRtuSerialMaster>
#include <QSerialPortInfo>
#include <QSerialPort>
#include <QMessageBox>
#include <QProgressDialog>
namespace Ui {
class LineRinger;
}
class LineRinger : public QWidget
{
Q_OBJECT
public:
enum callStatus{
NOERROR = 0,
ERROR = 1,
INTERRUPT = 2
};
explicit LineRinger(QWidget *parent = nullptr);
~LineRinger();
callStatus lineCall();
signals:
void stopLineCall();
private slots:
void on_connectButton_clicked();
void on_ringButton_clicked();
void on_checkAutoBaud_stateChanged(int arg1);
private:
Ui::LineRinger *ui;
void syncColumnHeaders();
struct deviceOnLine
{
uint8_t adr;
unsigned baudRate;
QString fields[7] = {"Undefined", "Undefined", "Undefined", "Undefined", "Undefined", "Undefined", "Undefined"};
};
QVector<deviceOnLine>devicesList;
bool isAutoBaud = false;
unsigned currentBaudRate;
QModbusClient *modbusDevice = nullptr;
};
#endif // LINERINGER_H