205 lines
6.8 KiB
C
205 lines
6.8 KiB
C
|
#ifndef PARAMETERSETDIALOG_H
|
|||
|
#define PARAMETERSETDIALOG_H
|
|||
|
|
|||
|
#include <QDialog>
|
|||
|
#include <QTextCodec>
|
|||
|
#include <QHostAddress>
|
|||
|
#include <QNetworkInterface>
|
|||
|
#include <QNetworkAddressEntry>
|
|||
|
|
|||
|
#include "items/paraitem.h"
|
|||
|
#include "numerinputdialog.h"
|
|||
|
#include "passworddialog.h"
|
|||
|
#include "mybutton.h"
|
|||
|
#include "promptdialog.h"
|
|||
|
#include "setcontrolstyle.h"
|
|||
|
#include "Lot/csvcode.h"
|
|||
|
|
|||
|
#define TEST_EMBROIDERY 1
|
|||
|
#define TEST_PUNCH 2
|
|||
|
|
|||
|
//设置时间的头文件
|
|||
|
#ifdef Q_OS_LINUX
|
|||
|
#include <arpa/inet.h>
|
|||
|
#include <hal-api.h>
|
|||
|
#endif
|
|||
|
|
|||
|
enum PATCHMODE
|
|||
|
{
|
|||
|
PATCH_COLOR,//按色贴布
|
|||
|
PATCH_NEEDLE//按针贴布
|
|||
|
};
|
|||
|
|
|||
|
namespace Ui {
|
|||
|
class ParameterSetDialog;
|
|||
|
}
|
|||
|
|
|||
|
class ParameterSetDialog : public QDialog
|
|||
|
{
|
|||
|
Q_OBJECT
|
|||
|
|
|||
|
public:
|
|||
|
explicit ParameterSetDialog(QWidget *parent = 0);
|
|||
|
~ParameterSetDialog();
|
|||
|
|
|||
|
private:
|
|||
|
Ui::ParameterSetDialog *ui;
|
|||
|
int m_itemPerPage;//界面每页条目数
|
|||
|
int m_curPage;//当前页数
|
|||
|
int m_rootCurPage;//超级用户界面当前页数
|
|||
|
QList<MyButton*> m_itemBtnList;
|
|||
|
QList <ParaItem> m_patchItemList;//贴布绣条目列表
|
|||
|
QList <ParaItem> m_itemList;
|
|||
|
QList <ParaItem> m_allItemList;
|
|||
|
int m_patchMode;
|
|||
|
MCStatus m_mcStatus;//机器状态
|
|||
|
int m_nodeType;//节点类型,根据节点类型显示平绣,毛巾,冲孔的机头个数 -rq
|
|||
|
//PromptDialog m_promptDlg;
|
|||
|
|
|||
|
private:
|
|||
|
void initControl();//初始化窗体控件,包括位置、尺寸、样式
|
|||
|
void initResolution1910();//初始化窗体控件为1920x1080分辨率
|
|||
|
void initResolution1006();//初始化窗体控件为1024x600分辨率
|
|||
|
void initControlStyle();//初始化窗体控件样式
|
|||
|
void refreshUi();
|
|||
|
void initArabControlPos();//设置阿拉伯语时控件对齐方式
|
|||
|
|
|||
|
private:
|
|||
|
QString getValueStr(int64_t val, int afterpoint);
|
|||
|
void changeValue(int buttenidx);
|
|||
|
void refreshValue();
|
|||
|
|
|||
|
public slots:
|
|||
|
void paraChange(int type, int id);
|
|||
|
void EXBParaChange();//外围板参数改变
|
|||
|
void slotRefreshHeadPara(int type);//刷新机头板参数
|
|||
|
|
|||
|
private:
|
|||
|
void refreshSensorPara(int min, int max, int num, ParaItem &item, u32 traverseState, u32 traverseState1,int m_nodeType);//刷新信号参数显示
|
|||
|
void saveParas(int idx = -1);
|
|||
|
void execItemClickEvent(s16 fun);//执行点击触发型参数的触发事件
|
|||
|
|
|||
|
private:
|
|||
|
ParaStruct m_mcParaValues;
|
|||
|
ParaStruct m_wkParaValues;
|
|||
|
|
|||
|
HeadInfo m_headParaValues;
|
|||
|
HcpsInfo m_hcpsParaValues;
|
|||
|
int m_setedFlag;
|
|||
|
int m_hcpsFlag;
|
|||
|
int m_paraType; //参数类型(机器参数、工作参数、花样参数等)
|
|||
|
int m_paraTypeSort; //参数类型分类(动作参数、位置参数、亮片参数等)
|
|||
|
QString m_networkCardID;//网卡ID(MAC地址)
|
|||
|
|
|||
|
QString m_filePath;//贴布绣配置文件
|
|||
|
u16 m_patchColorBuf[PATCHCOLORBUF]; //贴布绣按色缓存
|
|||
|
NeedlePatch m_patchNeedleBuf[PATCHNEEDLEBUF]; //贴布绣按针缓存
|
|||
|
bool isAuthority = true;//是否需要权限
|
|||
|
|
|||
|
public:
|
|||
|
void initData();
|
|||
|
void setTypeLogo(QString tStyle);//设置类型图标
|
|||
|
void setMainTitle(QString str);//设置主title
|
|||
|
void setSubTitle(QString str);//设置副title
|
|||
|
//(参数权限、参数类型、参数种类)得到相应参数类型列表,目前参数种类分类未使用
|
|||
|
void setItemList(int authority,int64_t type,int64_t sort = -1);
|
|||
|
void refreshProductType();//刷新产品类型
|
|||
|
|
|||
|
//设置贴布绣参数
|
|||
|
void setPatchItemList(int64_t type,int64_t snum,int64_t cnum,QString filePath);
|
|||
|
|
|||
|
//设置网络参数(IP和端口)
|
|||
|
void setNetworkItemList(int64_t type);
|
|||
|
|
|||
|
//设置网关网络参数(IP和端口)
|
|||
|
void setGatewayNetworkItemList(int64_t type);
|
|||
|
|
|||
|
void setCurPage(int idx);//设置当前页数
|
|||
|
void setItemValue(int idx,int value);//设置int型参数值
|
|||
|
void addBeadSequinParaItem(int idx,int value);//添加珠片设置条目
|
|||
|
void setItemStr(int idx,QString str);//设置字符型参数值
|
|||
|
int getItemValue(int idx);
|
|||
|
inline int getParaType(){return m_paraType;}//获取参数类型
|
|||
|
inline u16* getPatchColorParaBuf(){return m_patchColorBuf;}
|
|||
|
inline NeedlePatch* getPatchNeedleParaBuf(){return m_patchNeedleBuf;}
|
|||
|
|
|||
|
int exec();
|
|||
|
|
|||
|
public:
|
|||
|
int addParaItem(const QList<ParaItem> & itemList);
|
|||
|
int addParaItem(const ParaItem & item);
|
|||
|
|
|||
|
public:
|
|||
|
void setMcStates(MCStatus mcStatus);//设置机器状态(用于刷新遍历状态)
|
|||
|
|
|||
|
private slots:
|
|||
|
void on_button1_clicked();
|
|||
|
void on_button2_clicked();
|
|||
|
void on_button3_clicked();
|
|||
|
void on_button4_clicked();
|
|||
|
void on_button5_clicked();
|
|||
|
void on_button6_clicked();
|
|||
|
void on_button7_clicked();
|
|||
|
void on_button8_clicked();
|
|||
|
void on_button9_clicked();
|
|||
|
void on_button10_clicked();
|
|||
|
void on_button11_clicked();
|
|||
|
void on_button12_clicked();
|
|||
|
|
|||
|
void on_buttonPgUp_clicked();
|
|||
|
void on_buttonPgDn_clicked();
|
|||
|
|
|||
|
void on_buttonOk_clicked();
|
|||
|
void on_buttonCancel_clicked();
|
|||
|
|
|||
|
void on_buttonPatchParaClear_clicked();
|
|||
|
void on_buttonPatchParaColor_clicked();
|
|||
|
void on_buttonPatchParaNeedle_clicked();
|
|||
|
void on_buttonEXBParaRestore_clicked();
|
|||
|
void on_buttonReturn_clicked();
|
|||
|
void on_buttonHeadParaImport_clicked();
|
|||
|
void on_buttonHeadParaExport_clicked();
|
|||
|
|
|||
|
signals:
|
|||
|
void siUserLogin(s16 user);
|
|||
|
void siHMIDecrypt(QString id);//界面解密
|
|||
|
void siHeadBoardBusDetect();//机头板总线检测
|
|||
|
void siEXBBoardUpgrade(u8 protocol, u8 nodeid, u8 nodeType);//外围板升级
|
|||
|
void siParameterImport();
|
|||
|
void siParameterExport();
|
|||
|
void siHMIUpgrade();
|
|||
|
void siMCUpgrade();
|
|||
|
void siHookTest();//勾刀测试
|
|||
|
void siAutoSetSoftLimit();//自动定软限位
|
|||
|
void siEMBSpindleTest();//测试平绣齿轮比
|
|||
|
void siChenSpindleTest();//测试毛巾齿轮比
|
|||
|
void siEcdWidthTest();//测试平绣主轴编码器宽度
|
|||
|
void siFootTest();//测试独立压脚
|
|||
|
void siEmbWorkArea();//平绣设置可工作区域
|
|||
|
void siChenWorkArea();//毛巾设置可工作区域
|
|||
|
void siCoilWorkArea();//缠绕设置可工作区域
|
|||
|
void siFrameParaImport();//动框参数导入
|
|||
|
void siFrameParaExport();//动框参数导出
|
|||
|
void siExit();//退出程序
|
|||
|
void siChangePassword();//修改一级密码
|
|||
|
void siDeleteIni();//删除执行目录下的config.ini
|
|||
|
void siImportCSV();//导入csv文件
|
|||
|
void siDeleteCSV();//删除csv文件
|
|||
|
void siResetCSV();//重置安装调试进度
|
|||
|
void siDebugMode();//界面调试模式
|
|||
|
void siLiftMotor();//提升电机控制
|
|||
|
void siElasticCtrl();//松紧线控制
|
|||
|
void siChenilleColorDebug();//毛巾换色调试
|
|||
|
void siPatternClear();//花样总清
|
|||
|
void siPatternFcgClear();//花样总清
|
|||
|
void siVerRecovery();//版本恢复
|
|||
|
void siFrameAngleSet();
|
|||
|
void siTraverseSet(s16 csvCode,s16 type = 0);//点击遍历功能
|
|||
|
|
|||
|
void siPatternFcgClearFileid();//清除影响fileid的数据
|
|||
|
void siHeadParaImport(QString tStyle,int headType);
|
|||
|
void siHeadParaExport(int headType);
|
|||
|
};
|
|||
|
|
|||
|
#endif // PARAMETERSETDIALOG_H
|