78 lines
1.5 KiB
C
78 lines
1.5 KiB
C
|
#ifndef LINERINGER_H
|
||
|
#define LINERINGER_H
|
||
|
|
||
|
#include <QWidget>
|
||
|
#include <QModbusTcpClient>
|
||
|
#include <QModbusRtuSerialMaster>
|
||
|
#include <QSerialPortInfo>
|
||
|
#include <QSerialPort>
|
||
|
#include <QMessageBox>
|
||
|
#include <QProgressDialog>
|
||
|
|
||
|
extern "C" __declspec(dllexport) QWidget* init(QWidget *parent);
|
||
|
|
||
|
#include <QEvent>
|
||
|
|
||
|
class truthSeaker : public QEvent
|
||
|
{
|
||
|
public:
|
||
|
truthSeaker() : QEvent(QEvent::User) {}
|
||
|
~truthSeaker() {}
|
||
|
|
||
|
private:
|
||
|
};
|
||
|
|
||
|
|
||
|
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();
|
||
|
void emitShowTheTru(QWidget* w);
|
||
|
QWidget* father = nullptr;
|
||
|
|
||
|
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;
|
||
|
};
|
||
|
|
||
|
extern "C" __declspec(dllexport) void linker(LineRinger *w, QWidget*par, void (*lkn)(QWidget*));
|
||
|
|
||
|
#endif // LINERINGER_H
|