137 lines
4.5 KiB
C++
137 lines
4.5 KiB
C++
#ifndef PROMPTDIALOG_H
|
|
#define PROMPTDIALOG_H
|
|
|
|
#include <QDialog>
|
|
#include <QDir>
|
|
#include <QFile>
|
|
#include <QTextCodec>
|
|
#include "wordsinputdialog.h"
|
|
#include "numerinputdialog.h"
|
|
#include "setcontrolstyle.h"
|
|
#include "sharedviews/passworddialog.h"
|
|
|
|
#define NOODLES 1
|
|
#define BOTTOM 2
|
|
#define TIMELIMITMAX 2147483647
|
|
#define TIMELIMITMIN 2147385345
|
|
|
|
namespace Ui {
|
|
class PromptDialog;
|
|
}
|
|
|
|
class PromptDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit PromptDialog(QWidget *parent = 0);
|
|
~PromptDialog();
|
|
|
|
enum BTN_SHOW
|
|
{
|
|
BTN_OK_CANCEL, //ok和cancel按钮
|
|
BTN_OK, //ok按钮
|
|
BTN_R_R_S, //重命名、替换、跳过
|
|
BTN_RESTART, //重启按钮
|
|
BTN_UCANCEL, //升级取消按钮
|
|
BTN_WARRANT, //授权按钮
|
|
BTN_M_C_C, //手动换色
|
|
BTN_FACE, //面线检测
|
|
BTN_NONE, //无按钮
|
|
BTN_P_NONE, //进度条模式下无按钮(文件导入导出)
|
|
BTN_HMI_DECRYPT, //界面解密
|
|
BTN_CHANGE_PASSWORD, //修改一级密码
|
|
BTN_TRIMDOWN, //下剪线
|
|
BTN_WORK_AREA, //设置可工作区域
|
|
BTN_TEST_ADC //测试电位器
|
|
};
|
|
|
|
private:
|
|
Ui::PromptDialog *ui;
|
|
QList<QPushButton*> m_buttonEmbNeedleList;
|
|
|
|
QPushButton *m_pEmbNeedleBtn;
|
|
QPoint m_btnOkPoint;//ok按钮位置
|
|
QPoint m_btnCancelPoint;//cancel按钮位置
|
|
|
|
int m_selectNeedleIdx;//针杆索引
|
|
int m_selectHeadleIdx;//机头索引
|
|
int m_funType;//功能类型
|
|
|
|
int m_curColorOrder;//当前色序数
|
|
int m_totalColorOrder;//总色序数
|
|
int m_totalHead;//总机头数
|
|
QString m_filePath;
|
|
|
|
int m_area;//xy正负位置
|
|
QString m_newPassword;//获取新密码字符串
|
|
QString m_confirmPassword;//获取确认新密码字符串
|
|
|
|
QString m_buttonStyle1;
|
|
QString m_buttonStyle2;
|
|
|
|
private:
|
|
void initControl();//初始化窗体控件,包括位置、尺寸、样式
|
|
void initResolution1910();//初始化窗体控件为1920x1080分辨率
|
|
void initResolution1006();//初始化窗体控件为1920x1080分辨率
|
|
void initControlStyle();//初始化窗体控件样式
|
|
|
|
public:
|
|
void initDialog(int sel = 0);//初始化窗体
|
|
void setTitleStr(QString str);//设置标题
|
|
void setStrColor(QString str);//设置底线面线断线机头显示字体的颜色
|
|
void setContentStr(QString str);//设置显示内容
|
|
void setADCContentStr();//设置电位器信息显示
|
|
void setContentProcessStr(QString str);//设置进度条显示内容
|
|
void setContentInfoShow();//主板信息内容显示
|
|
void setContentWarrantShow();//授权信息内容显示
|
|
void setContentHMIDecryptShow(QString id);//界面解密网卡ID号显示
|
|
void setContentChangePasswordShow();//修改一级用户密码内容显示
|
|
void setValue(int progress);
|
|
void setButtonUCancelStr(QString str);
|
|
void setRange(int minimum, int maximum);
|
|
void setCurNeedleStr(QString idx = 0);//当前针杆
|
|
void setPosValueStr(QString posValue);//电位器值
|
|
void setCurNeedleStrVisible(bool bl);//当前针杆label是否可见
|
|
void initNeedleBar(int val = MACHINE_PUNCH);//初始化针杆
|
|
inline int getNeedleSelectIdx(){return m_selectNeedleIdx;}//获取所选针杆的索引值
|
|
inline int getArea(){return m_area;}
|
|
//inline int getGearValue(){return m_gearValue;}//获取档位值
|
|
inline QString getInputNewPassword(){return m_newPassword;}//获取新密码
|
|
inline QString getInputConfirmPassword(){return m_confirmPassword;}//获取确认新密码
|
|
|
|
void setHeadNum(int headNum);//机头个数
|
|
void initEmbHead(int headNum,int colorOrderNum,QString path);//初始化机头
|
|
|
|
QString getNetworkCardID();//获取网卡ID
|
|
QString getInputPassword();//获取界面输入密码
|
|
|
|
signals:
|
|
void siUpdataCancel();
|
|
|
|
public slots:
|
|
void slotMCInfoChange();
|
|
|
|
private slots:
|
|
void slotEmbNeedleBtnClick();//针杆按钮被点击
|
|
|
|
private slots:
|
|
void on_buttonOk_clicked();
|
|
void on_buttonCancel_clicked();
|
|
void on_buttonRename_clicked();
|
|
void on_buttonReplace_clicked();
|
|
void on_buttonSkip_clicked();
|
|
void on_buttonRestart_clicked();
|
|
void on_buttonUpdataCancel_clicked();
|
|
void on_buttonWarrant_clicked();
|
|
void on_buttonWarrantCancel_clicked();
|
|
void on_buttonDetectBegin_clicked();
|
|
void on_buttonDetectEnd_clicked();
|
|
void on_buttonDetectClose_clicked();
|
|
void on_buttonHMIPassword_clicked();
|
|
void on_buttonNewPassword_clicked();
|
|
void on_buttonConfirmPassword_clicked();
|
|
};
|
|
|
|
#endif // PROMPTDIALOG_H
|