mainwindow.h Example File
modbus/master/mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QModbusDataUnit>
class QModbusClient;
class QModbusReply;
namespace Ui {
class MainWindow;
class SettingsDialog;
}
class SettingsDialog;
class WriteRegisterModel;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
void initActions();
QModbusDataUnit readRequest() const;
QModbusDataUnit writeRequest() const;
private slots:
void on_connectButton_clicked();
void onStateChanged(int state);
void on_readButton_clicked();
void readReady();
void on_writeButton_clicked();
void on_readWriteButton_clicked();
void on_connectType_currentIndexChanged(int);
void on_writeTable_currentIndexChanged(int);
private:
Ui::MainWindow *ui;
QModbusReply *lastRequest;
QModbusClient *modbusDevice;
SettingsDialog *m_settingsDialog;
WriteRegisterModel *writeModel;
};
#endif // MAINWINDOW_H