326 lines
8.7 KiB
C++
326 lines
8.7 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QMainWindow>
|
|
#include "ParaSettingUI.h"
|
|
#include "PrintSetting.h"
|
|
#include <QtGui>
|
|
#include "QBarCode.h"
|
|
#include "dlgQrCode.h"
|
|
#include "dlgmywarring.h"
|
|
//#define RETANKACK // 改回收
|
|
#include <QMessageBox>
|
|
#ifdef PICSCENE
|
|
#include "scene/picscene.h"
|
|
#include "VerBVersion.h"
|
|
#include "myinclude.h"
|
|
#include <QDialog>
|
|
class PicScene;
|
|
QT_BEGIN_NAMESPACE
|
|
class QAction;
|
|
class QToolBox;
|
|
class QSpinBox;
|
|
class QComboBox;
|
|
class QFontComboBox;
|
|
class QButtonGroup;
|
|
class QLineEdit;
|
|
class QGraphicsTextItem;
|
|
class QFont;
|
|
class QToolButton;
|
|
class QAbstractButton;
|
|
class QGraphicsView;
|
|
QT_END_NAMESPACE
|
|
#endif
|
|
#define CLEARCNTNOW
|
|
|
|
|
|
|
|
#include <QTimer>
|
|
#include <QTime>
|
|
#include <QDate>
|
|
namespace Ui {
|
|
class MainWindow;
|
|
}
|
|
|
|
class MainWindow : public QWidget,public ParaSettingUI
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainWindow(QWidget *parent = 0);
|
|
~MainWindow();
|
|
|
|
void bindSysPara(SysPara *SysPara);//重载
|
|
void updateSysParaToUI(); //重载
|
|
void updateSysStatusToUI(); //重载
|
|
void applyUIPara(); //重载
|
|
bool updatePhaseIndicatorLight();
|
|
// void showPrintBitImage();
|
|
int calculateMaxSpeed(int backup);
|
|
unsigned int showPrintBitImage();
|
|
|
|
void enablePrintButton(bool enable);
|
|
void enableReclaimCtrlButton(bool enable);
|
|
void resetReclaimCtrlButtonText();
|
|
void enablePushButtonStart(bool enable);
|
|
int getMaxSpeedCalcPara();
|
|
|
|
void generateDrwingQRCode(QString);
|
|
|
|
void PreviewPressed();
|
|
int getCurrPrintStatus();
|
|
TextEditOption* getTexteditOption();
|
|
|
|
void SetEditMode(int mode);
|
|
bool fileChange;
|
|
bool pushButtonFlag;
|
|
|
|
int getVarStarRow(int x, int y, int h, int w,char *dat);
|
|
|
|
void testPrint();
|
|
int searchQrVar();
|
|
PicScene* getPicScene();
|
|
//void pushOnlyCNT1Clear_Hide();
|
|
|
|
DlgMyWarring dlgMyWarring;
|
|
QString strWarring,strTitle;
|
|
QMessageBox *msgtest;
|
|
void updateTotalCnt(int en);
|
|
QTimer *timerShowItem;
|
|
void UpdateDateTimeQRCode(QString strContent);
|
|
|
|
//返回文档打印大小
|
|
QSizeF getDocSize()const ;
|
|
|
|
int timeoutOperate_launch;
|
|
QTimer *timerPrinter_operate_launch;
|
|
QQueue<QString> printDatasQueue;
|
|
void print_complete();
|
|
|
|
public slots:
|
|
void OnFinished(int event);
|
|
void onQRCodeClose();
|
|
void onEditQRCode();
|
|
void onEditBarCode();
|
|
void onBarCodeClose();
|
|
void on_pushButtonCleanUP_pressed();
|
|
//void on_pushOnlyCNT1Clear_pressed();
|
|
void onPushButtonCNTResetNowPressed();
|
|
void changeEditMode(int editMode);
|
|
void SetMainTabEdit(int n);
|
|
void changeTxtMode(QString str);
|
|
// void openPngFile(QString filePath);
|
|
void openPicFIleOpen(QString filePath, bool insertFlag);
|
|
void onReclainTankPositionChanged(int value);
|
|
void checkForPowerOff();
|
|
void on_pushButtonStart_pressed();
|
|
|
|
void setRunStatus(QString str);
|
|
|
|
void setRunStatus(QPixmap pixMap);
|
|
|
|
void _on_pushButtonPowerOff_pressed(bool notice);
|
|
|
|
void on_pushButtonReclaimTankClose_pressed();
|
|
|
|
void alterDataPrint(unsigned char);
|
|
void showDat(unsigned char * Dat);
|
|
void SendPrintDataToFpga(unsigned char alterEnable);
|
|
void on_pushButtonStopPrint_pressed();
|
|
void on_pushButtonPausePrint_pressed();
|
|
void RefreshStatusLight();
|
|
void onInitQRCode();
|
|
void onUpdateDispQRCode(int type); // 更新二维码显示
|
|
void modbusUpdateQRCode();
|
|
//void onUpdateDispBcCode(int type); // 更新条形码显示
|
|
void CheckStatus(int Flag);
|
|
void ShowWarnningText1(QString strTitle, QString strWarring);
|
|
void onStatusHighVoltageFault();
|
|
void onStatusInkLeak();
|
|
void onStatusInkSwint();
|
|
void onStatusInkWaterLevel();
|
|
void onStatusRecycleWarn();
|
|
void onStatusSolvLevelWarn();
|
|
void onStatusViscosityWarn();
|
|
void onStatusChargefault();
|
|
|
|
void onPreviewScene();
|
|
|
|
void update_scroll();
|
|
|
|
void JSON_UpdateDATA();
|
|
void on_pushButtonStartPrint_pressed();
|
|
void onGenerateQRCode(QString strData);
|
|
void onShowAndHideItem();
|
|
void onSwitchTimerShowItem(bool flag);
|
|
void onLabelFaultRusumePressed();
|
|
void onModbusPrintReceivedContent(int num);
|
|
void onEnableReclaimCtrlButton(bool flag);
|
|
void onInkJetPrinterCurrentChanged(int);
|
|
#ifdef EnableArabic
|
|
void setOpenFileName(QString);
|
|
#endif
|
|
private slots:
|
|
// void on_pushButtonTXTOpen_pressed();
|
|
void on_pushButtonGetData_pressed();
|
|
void onPushButtonPreviewPressed();
|
|
|
|
void on_pushButtonReclaimTanOpen_pressed();
|
|
void on_pushButtonPowerOff_pressed();
|
|
void ontextEdittextChanged();
|
|
void onTextEditCursorPositionChanged();
|
|
//void onLabelFaultRusumePressed();
|
|
|
|
|
|
void onLabelProductCntPressed();
|
|
void onLabelTotalProductCntPressed();
|
|
void displayTime();
|
|
void airPushingProcess();
|
|
|
|
void on_bottonEditText_pressed();
|
|
|
|
void on_pushButtonReduceTextDisplay_pressed();
|
|
void on_pushButtonEnlargeTextDisplay_pressed();
|
|
void printer_operate_launch();
|
|
void print_data_comein(QString text);
|
|
void query_print_queue();
|
|
void on_pushButton_Number_clicked();
|
|
void clearPrintDataQueue();
|
|
void drop_NextSignalHandler();
|
|
|
|
Q_SIGNALS:
|
|
void openFileChange();
|
|
void openCurrFile(QString);
|
|
void saveJmFile();
|
|
void setMainTabNow(int); // 切换到主窗口
|
|
void InkjetCleanUP();
|
|
void ShowWarnningText(QString , QString );
|
|
void editItemMode();
|
|
void CloseJd();
|
|
void pushButtonStartPressed(bool);
|
|
void repeatInitedPid();
|
|
void setCNT1Select(bool);
|
|
void setCNT2Select(bool);
|
|
void setCNT3Select(bool);
|
|
void getJSONData();
|
|
void scenefileOpen(QString,bool);
|
|
void setDisableAll();
|
|
void clearPressureFault();
|
|
|
|
//修改字体宽度
|
|
void autoUpdateFontWidthByMainWindow(const unsigned int);
|
|
|
|
void printer_operate_launch_result(int);
|
|
void WriteInstructionCodeAck(int InstructionCode,QByteArray data);
|
|
void clearQueueFinished();
|
|
private:
|
|
Ui::MainWindow *ui;
|
|
|
|
int dlgMyWarringShowDlyCnt;
|
|
void generateCharRamData();
|
|
void updatePrintDisplayLabel();
|
|
void reclaimTanOpen();
|
|
|
|
QBarCode *barcode;
|
|
dlgQrCode *dlgqrcode;
|
|
|
|
QThread ShowThead;
|
|
QTimer *timer;
|
|
QTimer *airPushTimer;
|
|
bool printintFlag; //判断当前是否在打印
|
|
bool startPrintingFlag;
|
|
bool previewFlag;
|
|
|
|
int searchExpiryVar();//检索有效期变量
|
|
void ExpiryDotUpdate(char Mode);
|
|
int r_ExpiryDay;
|
|
void Test_Start_Stop();
|
|
#ifdef PICSCENE
|
|
PicScene *pPicScene;
|
|
QGraphicsView *view;
|
|
QHBoxLayout *pSceneHBoxLayout;
|
|
QWidget *pSceneEditOptional;
|
|
|
|
QPushButton *pOpenSceneButton;
|
|
QPushButton *pNewSceneButton;
|
|
QPushButton *pImportSceneButton;
|
|
QPushButton *pSaveSceneButton;
|
|
QPushButton *pSaveAsSceneButton;
|
|
QPushButton *pEditSceneButton;
|
|
PicTextItem *textItem;
|
|
#endif
|
|
|
|
#if 0
|
|
private slots:
|
|
void deleteItem();
|
|
void bringToFront();
|
|
void sendToBack();
|
|
void itemInserted(DiagramItem *item);
|
|
void textInserted(QGraphicsTextItem *item);
|
|
void currentFontChanged(const QFont &font);
|
|
void fontSizeChanged(const QString &size);
|
|
void sceneScaleChanged(const QString &scale);
|
|
void textColorChanged();
|
|
void itemColorChanged();
|
|
void lineColorChanged();
|
|
void textButtonTriggered();
|
|
void fillButtonTriggered();
|
|
void lineButtonTriggered();
|
|
void handleFontChange();
|
|
void itemSelected(QGraphicsItem *item);
|
|
void about();
|
|
|
|
private:
|
|
void createToolBox();
|
|
void createActions();
|
|
void createMenus();
|
|
void createToolbars();
|
|
QWidget *createBackgroundCellWidget(const QString &text,
|
|
const QString &image);
|
|
QWidget *createCellWidget(const QString &text,
|
|
DiagramItem::DiagramType type);
|
|
QMenu *createColorMenu(const char *slot, QColor defaultColor);
|
|
QIcon createColorToolButtonIcon(const QString &image, QColor color);
|
|
QIcon createColorIcon(QColor color);
|
|
|
|
DiagramScene *scene;
|
|
QGraphicsView *view;
|
|
|
|
QAction *exitAction;
|
|
QAction *addAction;
|
|
QAction *deleteAction;
|
|
|
|
QAction *toFrontAction;
|
|
QAction *sendBackAction;
|
|
|
|
QMenu *fileMenu;
|
|
QMenu *itemMenu;
|
|
|
|
QToolBar *textToolBar;
|
|
QToolBar *editToolBar;
|
|
QToolBar *colorToolBar;
|
|
QToolBar *pointerToolbar;
|
|
|
|
QComboBox *sceneScaleCombo;
|
|
QComboBox *itemColorCombo;
|
|
QComboBox *textColorCombo;
|
|
QComboBox *fontSizeCombo;
|
|
QFontComboBox *fontCombo;
|
|
|
|
QToolBox *toolBox;
|
|
QButtonGroup *buttonGroup;
|
|
QButtonGroup *pointerTypeGroup;
|
|
QToolButton *fontColorToolButton;
|
|
QToolButton *fillColorToolButton;
|
|
QToolButton *lineColorToolButton;
|
|
QAction *boldAction;
|
|
QAction *underlineAction;
|
|
QAction *italicAction;
|
|
QAction *textAction;
|
|
QAction *fillAction;
|
|
QAction *lineAction;
|
|
#endif
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|