153 lines
4.1 KiB
C++
153 lines
4.1 KiB
C++
/*
|
||
*
|
||
*
|
||
* DIFF_SEPTAL_POSITION 隔膜位置由20改为50的主泵动作时间
|
||
*/
|
||
#ifndef INKJETPRINTER_H
|
||
#define INKJETPRINTER_H
|
||
|
||
#define SPEEDOVER //超速停止
|
||
|
||
|
||
#include <QTabWidget>
|
||
#include <QTimer>
|
||
#include <QTime>
|
||
#include "Tftp/filetranseceiver.h"
|
||
#include "ParaSettingUI.h"
|
||
#include "modbus/modbustcp.h"
|
||
#include <QCloseEvent>
|
||
#include "dlgshowmsg.h"
|
||
#include <QThread>
|
||
#include <QMessageBox>
|
||
|
||
namespace Ui {
|
||
class InkJetPrinter;
|
||
}
|
||
|
||
|
||
#define MAX_PRESSURE_RELEASE_DIFF 25
|
||
#define MAX_PRESSURE_DIFF 50
|
||
#define MAX_VISICOSITY_RATIO 110 //105%
|
||
#define DIFF_SEPTAL_POSITION 50
|
||
#define MAX_VISICOSITY_VALUE_OVERFLOW_NUM 3 //连续超过此值会进行粘度调整
|
||
#define MAX_ALLOW_VISICOSITY_OVERFLOW_NUM 120 //连续超那么多次,会被认为粘度故障
|
||
|
||
class PicScene;
|
||
|
||
class InkJetPrinter : public QTabWidget,public ParaSettingUI
|
||
{
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit InkJetPrinter(QWidget *parent = 0);
|
||
~InkJetPrinter();
|
||
void pressureAdj(int);
|
||
FileTranseceiver* fileTransceiv;
|
||
FileTranseceiver* tcpTransceiv;
|
||
// void processCommands();
|
||
#ifdef MODBUS
|
||
// class ModbusSerial *modbus;
|
||
class ModbusTcp *modbus;
|
||
QThread m_thread;
|
||
#endif
|
||
|
||
public slots:
|
||
void onchangeEditMode(int);
|
||
void onChangeTab(QString);
|
||
//void onPrintErrorStatus(QString s);
|
||
void onPrintErrorStatus(QString s, unsigned int res);
|
||
|
||
void close_jd_timer();
|
||
void handlePushButtonStartPressed(bool);
|
||
void handleInitedPID();
|
||
|
||
void onModbusWriteCalendar();
|
||
void resetPressureCnt();
|
||
void pressureAdjustForsystemseeting();
|
||
|
||
private:
|
||
Ui::InkJetPrinter *ui;
|
||
DlgShowMsg *dlgShowMsg;
|
||
//MainWindow *mainWindow;
|
||
QTimer* viscosity_timer;
|
||
QTimer* timer;
|
||
QTimer* jd_timer;
|
||
QTime t1;
|
||
void autoControlHeater();
|
||
void autoControlValvePump();
|
||
|
||
void autoControlInkValve();
|
||
|
||
void autoControlCycleValve();
|
||
void autoControlCycleValveForSelfCheck();
|
||
|
||
void detectAndcontrolReclaimTank();
|
||
void refreshModbusStatus(void);
|
||
void checkPressureControl();
|
||
void showMessage(QString);
|
||
|
||
Q_SIGNALS:
|
||
|
||
// void updateQRcode();
|
||
// void startPrint();
|
||
// void pausePrint();
|
||
// void stopPrint();
|
||
|
||
void setReclaimTankCurrentPos(int);
|
||
void reclaimTankOpenDone();
|
||
void reclaimTankCloseDone();
|
||
void reclaimTankBlock(); //回收槽卡住
|
||
//void changeEditMode(int);
|
||
void SpeedOver(int mode);
|
||
void updateCnt1GroupDisp(bool);
|
||
void updataPara2UI();
|
||
void sendPicScene(PicScene* pPicScene);
|
||
void openFile(QString filePath,bool insertFlag);
|
||
|
||
private slots:
|
||
void OnSpeedOver(int mode);
|
||
void jd_timerHandler();
|
||
void timerHandler();
|
||
void onInkJetPrinterCurrentChanged(int index);
|
||
void onReclaimTankBlock();
|
||
void onAuthChanged(int auth);
|
||
void onConfigChanged();
|
||
void OnFinished(int event);
|
||
void DacAdjustStore();
|
||
void fpgaDebugWriteByte();
|
||
void fpgaDebugReadByte();
|
||
void fpgaDebugWriteWord();
|
||
void fpgaDebugReadWord();
|
||
void fpgaDebugWriteDWord();
|
||
void fpgaDebugReadDWord();
|
||
void recievedFile2Save(QString fileName);
|
||
void viscosity_timerHandler();
|
||
void disableTabClick();
|
||
private:
|
||
|
||
QLabel *t_label;
|
||
QMessageBox *msgtest;
|
||
void closeEvent(QCloseEvent *event);
|
||
void resizeEvent(QResizeEvent *);
|
||
void checkMixValveOpen();
|
||
void checkMixValveClose();
|
||
void cycleValveRunForSelfCheck();
|
||
void cnt1GroupCheck(void);
|
||
void loadVoltageValue();
|
||
char jd_res;
|
||
bool pushButtonStartFlag;
|
||
|
||
unsigned char rWarnViscoReady;
|
||
|
||
//压力控制相关状态变量
|
||
bool m_rampDone = false; // 软启动完成标志
|
||
int m_adjSkip = 0; // 节拍计数(闭环500ms周期)
|
||
int m_lastAvgPressure = 0; // 上次平均压力(微分项用)
|
||
int m_pressureBuf[20] = {}; // 压力滑动平均缓冲(20点=2s)
|
||
int m_bufIdx = 0; // 滑动平均写入索引
|
||
int m_bufValidCount = 0; // 缓冲区有效数据点数(0~20)
|
||
bool m_lastReclaimMode = false; // 上次 flagOfReclaimPumEnable 状态
|
||
bool m_lastByHand = false; // 上次 isPumpValveControledByHand 状态
|
||
};
|
||
|
||
#endif // INKJETPRINTER_H
|