提交原始齿轮泵代码
This commit is contained in:
+189
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
*
|
||||
*
|
||||
* 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>
|
||||
#include "Serial/serial.h"
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include "Public.h"
|
||||
#include "rfid/rfidmanager.h"
|
||||
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 DlgVoltePara25Dots;
|
||||
class DlgVolteParaNo73;
|
||||
|
||||
class InkJetPrinter : public QTabWidget,public ParaSettingUI
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit InkJetPrinter(QWidget *parent = 0);
|
||||
~InkJetPrinter();
|
||||
void pressureAdj();
|
||||
FileTranseceiver* fileTransceiv;
|
||||
FileTranseceiver* tcpTransceiv;
|
||||
Serial *serialFPGA;
|
||||
Serial *serialSTM32;
|
||||
QThread* m_serialThreadFPGA;
|
||||
QThread* m_serialThreadSTM32;
|
||||
bool flagOfSerialThreadStratEn;
|
||||
// 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, unsigned int res);
|
||||
void closeSerialFPGA();
|
||||
void closeSerialSTM32();
|
||||
void close_jd_timer();
|
||||
void handlePushButtonStartPressed(bool);
|
||||
void handleInitedPID();
|
||||
void saveFPGAStatus(unsigned char *data);
|
||||
void saveFPGAPhaseDetectHighTm(unsigned char *data);
|
||||
void saveFPGAVersionNum(unsigned int);
|
||||
void saveGearPumpVal(unsigned char *data);
|
||||
void saveSTM32Status(unsigned char *data);
|
||||
void savePulseCntVal(unsigned char *data);
|
||||
void saveFPGACalandarAndDat(unsigned char *data);
|
||||
void saveFPGACnt3CurrValue(unsigned char *data);
|
||||
void saveFPGAXXXDay(unsigned char *data);
|
||||
void saveSTM32Version(unsigned char *data);
|
||||
void saveSTM32Time(unsigned char *data);
|
||||
void onModbusWriteCalendar();
|
||||
|
||||
void stopSendFPGAData(bool);
|
||||
void stopSendSTM32Data(bool);
|
||||
void closedSerial();
|
||||
void restartSerialPort();
|
||||
|
||||
void resetPressureCnt();
|
||||
void pressureAdjustForsystemseeting();
|
||||
|
||||
private:
|
||||
Ui::InkJetPrinter *ui;
|
||||
DlgShowMsg *dlgShowMsg;
|
||||
DlgVoltePara25Dots *voltePara25DotsDlg;
|
||||
DlgVolteParaNo73 *no73VolteParaDlg;
|
||||
//MainWindow *mainWindow;
|
||||
QTimer* viscosity_timer;
|
||||
QTimer* timer;
|
||||
QTime t1;
|
||||
bool m_rampDone = false; // pressureAdj 软启动完成标志
|
||||
int m_adjSkip = 0; // pressureAdj 节拍计数
|
||||
int m_lastPressure = 0; // pressureAdj 上次采样压力(稳定检测用)
|
||||
int m_stableCount = 0; // pressureAdj 压力连续稳定计数
|
||||
int m_pressureBuf[10] = {}; // pressureAdj 压力滑动平均缓冲(10点=1s)
|
||||
int m_bufIdx = 0; // pressureAdj 滑动平均写入索引
|
||||
bool m_lastReclaimMode = false; // 上次 flagOfReclaimPumEnable 状态,用于检测切换
|
||||
bool m_lastByHand = false; // 上次 isPumpValveControledByHand 状态,用于检测手动、自动
|
||||
void autoControlHeater();
|
||||
void autoControlValvePump();
|
||||
void detectAndcontrolReclaimTank();
|
||||
void refreshModbusStatus(void);
|
||||
void checkPressureControl();
|
||||
void showMessage(QString);
|
||||
|
||||
#ifdef __RFID_CARD
|
||||
RFIDManager* manager_rfid = nullptr;
|
||||
void initRFIDManager();
|
||||
#endif
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
// void updateQRcode();
|
||||
// void startPrint();
|
||||
// void pausePrint();
|
||||
// void stopPrint();
|
||||
void showMotorIsen(int,int);
|
||||
void showReclaimTankstatus(unsigned char);
|
||||
|
||||
void setReclaimTankCurrentPos(int);
|
||||
void reclaimTankOpenDone();
|
||||
void reclaimTankCloseDone();
|
||||
void reclaimTankBlock(); //回收槽卡住
|
||||
//void changeEditMode(int);
|
||||
void SpeedOver(int mode);
|
||||
void updateCnt1GroupDisp(bool);
|
||||
|
||||
void sig_updateDisp(bool);
|
||||
|
||||
void updataPara2UI();
|
||||
void sendPicScene(PicScene* pPicScene);
|
||||
void openFile(QString filePath,bool insertFlag);
|
||||
|
||||
private slots:
|
||||
void OnSpeedOver(int mode);
|
||||
|
||||
void timerHandler();
|
||||
void onInkJetPrinterCurrentChanged(int index);
|
||||
void onReclaimTankBlock();
|
||||
void onAuthChanged(int auth);
|
||||
void onConfigChanged();
|
||||
void OnFinished(int event);
|
||||
void OnBoxFinished(int event);
|
||||
void DacAdjustStore();
|
||||
void recievedFile2Save(QString fileName);
|
||||
void viscosity_timerHandler();
|
||||
void disableTabClick();
|
||||
void enableInkJetTabClick(bool);
|
||||
void sendDataManual(QString,QString,QString,QString,QString);
|
||||
|
||||
void slt_showMsg(QString msg);
|
||||
private:
|
||||
|
||||
QLabel *t_label;
|
||||
QMessageBox *msgtest,*msgBox1;
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void resizeEvent(QResizeEvent *);
|
||||
void checkMixValveOpen();
|
||||
void checkMixValveClose();
|
||||
void cycleValveRunForSelfCheck();
|
||||
void cnt1GroupCheck(void);
|
||||
void cntGroupCheck();
|
||||
|
||||
void autoControlCycleValve();
|
||||
|
||||
void loadVoltageValue();
|
||||
bool pushButtonStartFlag;
|
||||
|
||||
unsigned char rWarnViscoReady;
|
||||
|
||||
void initCntGroup();
|
||||
public:
|
||||
bool eventFilter(QObject *watched, QEvent *event);
|
||||
};
|
||||
|
||||
#endif // INKJETPRINTER_H
|
||||
Reference in New Issue
Block a user