#ifndef LOGINFO_H #define LOGINFO_H #include #include #include "MyFileDialog.h" #include #include #include "SysPara.h" #include "myinclude.h" #include "loginfoctrl.h" namespace Ui { class LogInfo; } enum DevStatusLightType{ DEV_STATUS_GREEN, DEV_STATUS_RED, DEV_STATUS_YELLOW, }; typedef struct{ DevStatusLightType inkSwint = DEV_STATUS_GREEN; // 墨线开关 DevStatusLightType inkLeak = DEV_STATUS_GREEN; // 墨水缸满 DevStatusLightType inkWaterLevel = DEV_STATUS_GREEN; // 墨水液位 DevStatusLightType solveLevelWarn = DEV_STATUS_GREEN; // 溶液液位 DevStatusLightType recycleWarn = DEV_STATUS_GREEN; // 回收故障 DevStatusLightType viscosityWarn = DEV_STATUS_GREEN; // 粘度故障 DevStatusLightType chargeFault = DEV_STATUS_GREEN; // 相位故障 DevStatusLightType highVoltageFault = DEV_STATUS_GREEN;// 高压故障 QString pressValue; QString visoValue; QString gearPumpRunSpeed; QString highVol; QString dataSize; }AlarmStatus; class LogInfo : public QWidget { Q_OBJECT public: explicit LogInfo(QWidget *parent = 0); ~LogInfo(); static QString getRunStatusText(void); static void setRunStatusText(QString str); static void showMachineInformation(QString Mac,QString SerialNum, QString VernonBachVer, QString FpgaVer); static void showRemoteControll(QString SuperNode, QString edgeIP); void onReadRecorder(); void deleteDirectoryContents(const QDir &directory); static void truncatelog(); static void showVerionInformation(QString,QString,QString,QString); void setScrollBar(); void init(); void applyStyleSheet(); // 应用样式表 void bindSysPara(SysPara *sysPara); void updateSysStatusToUI(const AlarmStatus& alarmStatus); void checkState(); protected slots: void deleteOldLog(const QString folderPath, int days); void deleteOldLog(); private slots: void on_pushButtonClear_pressed(); void on_pushButtonPreState_pressed(); void on_pushButtonExportFile_pressed(); void on_pushButtonClearCurrent_pressed(); void onOpen_FIle_select(); void readRunStatusText(); void buttonClickedSlot(); void on_btn_clean_clicked(); void slt_cleanOver(bool flag); void checkReclaimStatus(); signals: void sendButtonClickedSignal(int); void faultTesumePress(); private: Ui::LogInfo *ui; static QTextEdit *textEdit; static QTextEdit *textEdit2; static QTextEdit *textEditMachInfo; static int runStatusTextIndex; MyFileDialog *fileDialog; QString openFileName; static QString currenDate; static QString r_CurrentDate; QTimer *timerLogdel; QTimer *timerCheckReclaimStatus = nullptr; LogInfoCtrl *ctrl_loginfo = nullptr; // 锁定全局控件,放出逆清洗 void lockUI(); void unlockUI(); protected: SysPara *sysPara = nullptr; void showEvent(QShowEvent *event) override; }; #endif // LOGINFO_H