132 lines
4.4 KiB
C
132 lines
4.4 KiB
C
|
#ifndef COLORORDERSETWIDGET_H
|
|||
|
#define COLORORDERSETWIDGET_H
|
|||
|
|
|||
|
#include <QWidget>
|
|||
|
#include <QDir>
|
|||
|
#include <QMouseEvent>
|
|||
|
#include "promptdialog.h"
|
|||
|
#include "mybutton.h"
|
|||
|
#include "setcontrolstyle.h"
|
|||
|
//#include "Include/datafiledst.h"
|
|||
|
#include "datafile/datafiledst.h"
|
|||
|
#include "datafile/datafiledsr.h"
|
|||
|
#include "mctype/mainwidgetfunction.h"
|
|||
|
#include <QDateTime>
|
|||
|
#include <QDebug>
|
|||
|
|
|||
|
#define TYPE_COLORSET 0 //色序设定
|
|||
|
#define TYPE_HIGHSET 1 //高度设定
|
|||
|
#define TABLE_HEIGHT_IDX 256 //高度从色序表的256开始
|
|||
|
|
|||
|
#define FILE_TYPE_DST 0 //dst文件类型
|
|||
|
#define FILE_TYPE_DSR 1 //dsr文件类型
|
|||
|
|
|||
|
namespace Ui {
|
|||
|
class ColorOrderSetWidget;
|
|||
|
}
|
|||
|
|
|||
|
class ColorOrderSetWidget : public QWidget
|
|||
|
{
|
|||
|
Q_OBJECT
|
|||
|
|
|||
|
public:
|
|||
|
explicit ColorOrderSetWidget(QWidget *parent = 0);
|
|||
|
~ColorOrderSetWidget();
|
|||
|
|
|||
|
private:
|
|||
|
Ui::ColorOrderSetWidget *ui;
|
|||
|
int m_itemPerPage;//界面每页条目数
|
|||
|
|
|||
|
private:
|
|||
|
EmbData *m_pCurEmbData;
|
|||
|
QList<MyButton*> m_buttonColorOrderList;
|
|||
|
QList<QPushButton*> m_buttonEmbNeedleList;
|
|||
|
QList<QPushButton*> m_buttonPunchDepthList;
|
|||
|
|
|||
|
QPushButton *m_pEmbNeedleBtn;
|
|||
|
MyButton *m_pColorBtn;
|
|||
|
u8 m_colorBeginStepCtrl;//换色后起始针步属性(除偏移、跳针等)
|
|||
|
u8 m_colorEndStepCtrl; //换色后结束针步属性(除偏移、跳针等)
|
|||
|
int m_greyBeginStep;//灰色起始
|
|||
|
int m_greyEndStep; //灰色结束
|
|||
|
int m_singleMulMode;//压胶机单双选择模式 0:单选 1:多选
|
|||
|
|
|||
|
QRgb *m_pColorBuf;
|
|||
|
QString m_buttonStyle1;
|
|||
|
QString m_buttonStyle2;
|
|||
|
|
|||
|
QByteArray m_beforeColorTable;//变换之前的色序表
|
|||
|
QByteArray m_colorTable;//变换之后的色序表
|
|||
|
int m_curSelectColor;
|
|||
|
int m_curPages;//当前页
|
|||
|
int m_pageNums;//总页数
|
|||
|
int m_colorNums;
|
|||
|
|
|||
|
s16 m_colorSetBtnLockFlag;//色序设定可切换按钮是否锁住1:锁住 -1:解锁
|
|||
|
|
|||
|
s16 m_setType;//设置类型 0:色序设定 1:毛巾高度设置
|
|||
|
s16 m_fileType;//文件类型 0:dst 1:dsr
|
|||
|
|
|||
|
private:
|
|||
|
void initWidget();
|
|||
|
void initControl();//初始化窗体控件,包括位置、尺寸、样式
|
|||
|
void initResolution1910();//初始化窗体控件为1920x1080分辨率
|
|||
|
void initResolution1006();//初始化窗体控件为1024x600分辨率
|
|||
|
void initControlStyle();//初始化窗体控件样式
|
|||
|
|
|||
|
void initPatternColorTable();//绘制花样的颜色列表
|
|||
|
void initNeedleBar();//初始化针杆
|
|||
|
void switchNeedleBar();//切换针杆
|
|||
|
void refreshColorShow();//刷新色序显示
|
|||
|
void refreshPatternCurColorShow();//刷新花样选中的色序显示(刷新花样部分线迹)
|
|||
|
void getNeedleNum(int & num);//获取配置文件针杆数量
|
|||
|
void switchNeedleNum(int & num);//针杆数量
|
|||
|
QString getNeedleColorStr(s16 idx);//获取配置文件针杆颜色索引字符
|
|||
|
QString getNeedleColorStr(s16 colorIdx,s16 idx);//获取配置文件针杆颜色索引字符
|
|||
|
void refreshLockBtn();//刷新色序锁定按钮
|
|||
|
|
|||
|
// void initHeadHeightValue();//初始化机头高度值
|
|||
|
// void refreshHeadHeightShow();//刷新机头高度显示
|
|||
|
QString getCurColorTabStr(s16 needleIdx);
|
|||
|
void getCurColorTabValue(s16 &colorInTab);
|
|||
|
void showPunchShape(QString filePath);//显示冲孔形状
|
|||
|
|
|||
|
public:
|
|||
|
void setTypeLogo(QString tStyle);//设置类型图标
|
|||
|
void setMainTitle(QString str);//设置主title
|
|||
|
void setSubTitle(QString str);//设置副title
|
|||
|
void show(QString filePath);
|
|||
|
void setColorTable(QByteArray table, int type=TYPE_COLORSET);
|
|||
|
|
|||
|
signals:
|
|||
|
void siChangeColorTable(int selColor,int colorIdx);
|
|||
|
void siChangeHighTable(int selColor,int colorIdx);
|
|||
|
void siBackHome();
|
|||
|
void siHighBackHome();
|
|||
|
void siCancelChangeColor(QByteArray table);
|
|||
|
void siCancelChangeHigh(QByteArray table);
|
|||
|
|
|||
|
private slots:
|
|||
|
void colorOrderBtnClick();
|
|||
|
void embNeedleBtnPressed();//针杆按钮被按下
|
|||
|
void embNeedleBtnReleased();//针杆按钮抬起
|
|||
|
void punchDepthBtnClick();//冲刀深度按钮被按下
|
|||
|
|
|||
|
void on_buttonPgUp_clicked();
|
|||
|
void on_buttonPgDn_clicked();
|
|||
|
void on_buttonOk_clicked();
|
|||
|
void on_buttonCancel_clicked();
|
|||
|
void on_buttonColorOrderCycle_clicked();
|
|||
|
void on_buttonColorOrderClear_clicked();
|
|||
|
void on_buttonColorSetLock_clicked();
|
|||
|
void on_buttonNeedle_clicked();
|
|||
|
|
|||
|
void on_buttonSingle_clicked();
|
|||
|
void on_buttonMul_clicked();
|
|||
|
|
|||
|
public slots:
|
|||
|
void slotChangeNeedleColor(int idx, int colorIdx);//针杆颜色改变
|
|||
|
};
|
|||
|
|
|||
|
#endif // COLORORDERSETWIDGET_H
|