Files
newspark110/device/lasermark/LaserMark.h
Chenwenxuan edac2715f0 init
2024-03-06 14:54:30 +08:00

104 lines
2.6 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef LASERMARK_H
#define LASERMARK_H
#include "LaserMark_global.h"
#include <QCoreApplication>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QVariant>
#include <QDateTime>
//
#include <QString>
#include <QMessageBox>
#include <QThread>
#include <QMutex>
#include "LaserMark_global.h"
#include "MarkEzdDll.h"
#ifdef UNICODE
#define QStringToTCHAR(x) (wchar_t*) x.utf16()
#define PQStringToTCHAR(x) (wchar_t*) x->utf16()
#define TCHARToQString(x) QString::fromUtf16((x))
#define TCHARToQStringN(x,y) QString::fromUtf16((x),(y))
#else
#define QStringToTCHAR(x) x.local8Bit().constData()
#define PQStringToTCHAR(x) x->local8Bit().constData()
#define TCHARToQString(x) QString::fromLocal8Bit((x))
#define TCHARToQStringN(x,y) QString::fromLocal8Bit((x),(y))
#endif
class LASERMARK_EXPORT LaserMark : public QThread
{
Q_OBJECT
public:
LaserMark();
private:
QSqlDatabase db;
private:
HINSTANCE m_hEzdDLL;
LMC1_INITIAL lmc1_Initial;
LMC1_CLOSE lmc1_Close;
LMC1_STOPMARK lmc1_StopMark;
LMC1_LOADEZDFILE lmc1_LoadEzdFile;
LMC1_MARKENTITY lmc1_MarkEntity;
LMC1_SETDEVCFG lmc1_SetDevCfg;
LMC1_GETPENPARAM lmc1_GetPenParam;
LMC1_SETPENPARAM lmc1_SetPenParam;
LMC1_DELETEENT lmc1_DeleteEnt;
LMC1_CLEARENTLIB lmc1_ClearEntLib;
LMC1_ADDTEXTTOLIB lmc1_AddTextToLib;
LMC1_MARK lmc1_Mark;
LMC1_ISMARKING lmc1_IsMarking; //为判断是否正在标刻
LMC1_SETTEXTENTPARAM2 lmc1_SetTextEntParam2;
LMC1_SETTEXTENTPARAM4 lmc1_SetTextEntParam4;
LMC1_SETPENPARAM4 lmc1_SetPenParam4;
LMC1_SAVEENTLIBTOFILE lmc1_SaveEntLibToFile;
LMC1_SETFONTPARAM3 lmc1_SetFontParam3;
private:
QString TempMarkTitle;
bool IsMarkStatus{false};
int MarkCount{0};
int _nFreq{0};
double _dQPulseWidth{0};
private:
bool InitSQL();
bool InitLaser(QString); //QString为 ezcad2.exe所处的目录的全路径名称例如C:\WorkBook\20180528\EzCAD2\Debug
QString GetMarkTitle(QString);
//多线程打标
QMutex mutex;
protected:
void run() override;
public:
bool Init(QString); //初始化
void Start(QString,QString*,int,bool); //打标的字符 返回打标的字符 打标次数 true为自动false为手动
void Abort(); //停止打标
void SetParam(); //设置金橙子参数
bool GetMyMarkStatus(); //获取激光打标状态true为正在打标false为空闲状态
bool SetFontParam(double, double, double, int,double); //字符高度 字体宽度 字体间距 频率 脉宽
};
#endif // LASERMARK_H