207 lines
5.7 KiB
C++
207 lines
5.7 KiB
C++
#pragma once
|
|
|
|
#include <QtWidgets/QWidget>
|
|
#include <QTimer>
|
|
#include <QLabel>
|
|
#include <QStackedWidget>
|
|
// 包含UI自动生成的头文件(qmake编译时会自动生成)
|
|
#include "ui_InkJetPrinter.h"
|
|
#include "mainwidget.h"
|
|
#include "testprintwidget.h"
|
|
//#include "ercodesettings.h"
|
|
//#include "loadfilesetting.h"
|
|
//#include "MainInterfaceWidget.h"
|
|
|
|
#include "MyInputMethod.h"
|
|
#include <QMessageBox>
|
|
#include <QSpinBox>
|
|
#include <QTime>
|
|
#include <QThread>
|
|
#include "fontsetwidget.h"
|
|
#include "Printsetting.h"
|
|
#include "MainInstruction.h"
|
|
#include "SystemManage.h"
|
|
#include "SystemSetting.h"
|
|
#include "SystemUpdate.h"
|
|
#include "OtherInfo.h"
|
|
#include "scene/ScheduleShiftsEditor.h"
|
|
#include "Serial/serial.h"
|
|
#include "LogInfo.h"
|
|
#include "DateVarSet.h"
|
|
#include "CounterVarSet.h"
|
|
|
|
#include "QBarCode.h"
|
|
#include "dlgQrCode.h"
|
|
|
|
#include "rfid/RFIDManager.h"
|
|
#include "runtimectrl.h"
|
|
|
|
class InkJetPrinter : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
InkJetPrinter(QWidget* parent = nullptr);
|
|
~InkJetPrinter();
|
|
|
|
private:
|
|
// UI对象(由.ui文件生成)
|
|
Ui::InkJetPrinter ui;
|
|
SysPara* sysPara = nullptr;
|
|
|
|
QLabel* m_LabelTimer; // 保留原有变量,和ui中的控件关联
|
|
QTimer* m_Timer;
|
|
QTimer* timer;
|
|
QTimer* viscosity_timer;
|
|
// QTimer* jd_timer;
|
|
|
|
QStackedWidget* m_StackedWidget; // 关联ui中的m_StackedWidget
|
|
MainWidget* m_MainWidget;
|
|
TestPrintWidget* m_TestPrintWidget;
|
|
|
|
QBarCode* m_BarCodeDlg __attribute__((deprecated("Use BarcodeEditor instead"))) = nullptr;
|
|
|
|
dlgQrCode* m_QRCodeDlg __attribute__((deprecated("Use BarcodeEditor instead"))) = nullptr;
|
|
|
|
SystemManage* m_SystemManage;
|
|
SystemUpdate* m_SystemUpdate;
|
|
SystemSetting* m_SystemSetting;
|
|
OtherInfo* m_OtherInfo;
|
|
|
|
FontSetWidget* m_FontSetWidget;
|
|
|
|
PrintSetting* m_PrintSetting;
|
|
|
|
bool m_isDefaultPrintSettingMode = false;
|
|
PrintSettingModel m_savedPrintSettingModel;
|
|
|
|
MainInstruction* m_MainInstruction;
|
|
|
|
LogInfo* m_LogInfo;
|
|
LogInfoCtrl* ctrl_loginfo = nullptr;
|
|
|
|
ScheduleShiftsEditor* m_scheduleShiftsEditor = nullptr;
|
|
|
|
DateVarSet* m_DateVarSet;
|
|
|
|
CounterVarSet* m_CounterVarSet;
|
|
|
|
QTextEdit *m_textEdit;
|
|
|
|
QTextCursor cursor;
|
|
|
|
Serial *serialFPGA;
|
|
Serial *serialSTM32;
|
|
QThread* m_serialThreadFPGA;
|
|
QThread* m_serialThreadSTM32;
|
|
bool flagOfSerialThreadStratEn;
|
|
|
|
private:
|
|
bool pushButtonStartFlag;
|
|
void init();
|
|
void autoControlValvePump();
|
|
void pressureAdj();
|
|
void autoControlHeater();
|
|
void cycleValveRunForSelfCheck();
|
|
void detectAndcontrolReclaimTank();
|
|
|
|
void checkPressureControl();
|
|
void showMessage(QString);
|
|
|
|
void enterDefaultPrintSettingMode();
|
|
void exitDefaultPrintSettingMode();
|
|
|
|
bool cardTouchConfirm(QString msgTxt, QString variableMsgTxt);
|
|
|
|
QMessageBox *msgtest;
|
|
|
|
QDateTime curPowerOnDateTime;
|
|
int timeoutDay;
|
|
|
|
RunTimeCtrl* ctrl_runTime = nullptr;
|
|
void initRunTimeCtrl();
|
|
|
|
#ifdef __RFID_CARD
|
|
RFIDManager* manager_rfid = nullptr;
|
|
void initRFIDManager();
|
|
#endif
|
|
private slots:
|
|
void slt_showMsg(QString msg);
|
|
void timerHandler();
|
|
void getMainWidgetButtonClickedSlot(int index);
|
|
void getTestPrintWidgetButtonClickedSlot(int index);
|
|
void openDatetimeEditor(DateItemModel dateModel, TextItemModel textItemModel);
|
|
// void getErCodeSettingsWidgetButtonClickedSlot(int index);
|
|
// void getMainInterfaceWidgetButtonClickedSlot(int index);
|
|
void viscosity_timerHandler();
|
|
|
|
void rebootApp();
|
|
|
|
void getFontSetWidgetButtonClickedSlot(int index);
|
|
void getPrintSettingButtonClickedSlot(int index);
|
|
void getMainInstructWidgetButtonClickedSlot(int index);
|
|
void getSystemManageWidgetButtonClickSlot(int index);
|
|
void getSystemUpdateWidgetButtonClickSlot(int index);
|
|
void getSystemSettingWidgetButtonClickSlot(int index);
|
|
void getOtherInfoWidgetButtonClickSlot(int index);
|
|
void getLogInfoWidgetButtonClickSlot(int index);
|
|
void getDateSetWidgetButtonClickSlot(int index);
|
|
void getCounterVarSetWidgetButtonClickSlot(int index);
|
|
void slt_counterVarUpdate();
|
|
|
|
void showScheduleShiftsEditor(QVector<ScheduleModel> schedules, TextItemModel txtModel);
|
|
|
|
void onScheduleShiftsEditDone();
|
|
|
|
//Serial
|
|
void saveFPGAVersionNum(unsigned int);
|
|
void saveFPGAStatus(unsigned char *data);
|
|
void saveFPGAPhaseDetectHighTm(unsigned char *data);
|
|
void saveFPGACalandarAndDat(unsigned char *data);
|
|
void saveFPGACnt3CurrValue(unsigned char *data);
|
|
void saveFPGAXXXDay(unsigned char *data);
|
|
void stopSendFPGAData(bool);
|
|
void closeSerialFPGA();
|
|
|
|
void closeSerialSTM32();
|
|
void stopSendSTM32Data(bool);
|
|
void saveSTM32Status(unsigned char *data);
|
|
void saveGearPumpVal(unsigned char *data);
|
|
void savePulseCntVal(unsigned char *data);
|
|
void saveSTM32Version(unsigned char *data);
|
|
void saveSTM32Time(unsigned char *data);
|
|
void closedSerial();
|
|
void showFPGAqueuesize(int size);
|
|
void showSTM32queuesize(int size);
|
|
void showqueueFPGAsize(int size);
|
|
void restartSerialPort();
|
|
|
|
void disableTabClick();
|
|
|
|
void setShowVserionInfo(QString);
|
|
|
|
void OnFinished(int event);
|
|
|
|
void slt_editCounter(CounterViewModel vm);
|
|
|
|
// 保养警告
|
|
void slt_warningMaintenance();
|
|
signals:
|
|
void maintenanceShow();
|
|
|
|
public slots:
|
|
void close_jd_timer();
|
|
void enableInkJetTabClick(bool flag);
|
|
|
|
void handleInitedPID();
|
|
void resetPressureCnt();
|
|
|
|
int dateTimeElasped(int,QString);
|
|
void warningHandler(int);
|
|
void warningShow(int,int);
|
|
|
|
void createNewJobFile();
|
|
|
|
public:
|
|
bool eventFilter(QObject *watched, QEvent *event);
|
|
}; |