#ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include "secondwindows.h" #include "QDebug" #include #include #include QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE #define LO(x) ((uint8_t) ((x) & 0xff)) #define HI(x) ((uint8_t) (((x) >> 8) & 0xff)) class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = nullptr); ~MainWindow(); ModBusHandler *modebus; QThread *modeBusThread; Ui::MainWindow *ui; QSerialPort *serial; QVector comList; int portComboboxIndex; int speedComboboxIndex; int bitComboboxIndex; QString adrValue; QSettings *conf; public slots: void dataSetter(DataStruct data); private slots: void hideInteface(); void showInteface(); void on_pushButtonConnect_clicked(); void on_pushButtonAddPri_clicked(); void on_pushButtonSetPri_clicked(); void on_labelSens_clicked(); void on_comboBoxPort_currentIndexChanged(int index); void on_comboBoxSpeed_currentIndexChanged(int index); void on_comboBoxBit_currentIndexChanged(int index); void on_lineEditAddr_textEdited(const QString &arg1); void on_comboBoxUnitSens_activated(int index); void on_comboBoxKu_activated(int index); void on_comboBoxVch_activated(int index); void on_comboBoxNch_activated(int index); void on_comboBoxPlavGround_activated(int index); private: uint16_t adrPri; QByteArray ba; bool isConnected; QTimer *tmr; static const uint16_t Crc16Table[256]; DataStruct state; int OffsetKuDisplay; void getSens(); void getState(); void setState(); void refreshDisplay(); }; #endif // MAINWINDOW_H