You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
3.3 KiB
C++
75 lines
3.3 KiB
C++
#pragma once
|
|
#include "GlobalDefine.h"
|
|
#include "LabVecRang.h"
|
|
|
|
|
|
//工件产品
|
|
class CProduct
|
|
{
|
|
friend class CProductMgr;
|
|
public:
|
|
CProduct(void);
|
|
~CProduct(void);
|
|
void Draw(CDC* pDC);
|
|
void WriteWorkFile(vector<CLab> &LabVec);
|
|
void ReadWorkFile(CLabVecRang &LabVecRang);
|
|
void SetBasePt(Dbxy pt){m_BasePt = pt;};
|
|
Dbxy &GetProductBasePt(){return m_BasePt;};
|
|
Dbxy &GetOffset(){return m_Offset;};
|
|
double GetRotateAng();
|
|
|
|
bool &IsUsed(){return m_bUsed;};
|
|
void SetUsed(bool b){m_bUsed = b;};
|
|
void GetMarkCoord(Dbxy &mark1,Dbxy &mark2);
|
|
void SetRealMarkPt(Dbxy pt);
|
|
void ResetRealMarkPt();
|
|
void SetTheoryMarkPt(Dbxy pt1,Dbxy pt2);
|
|
void SetbHasMarkPt3(bool b){m_bHasMarkPt3 = b;};
|
|
void SetTheoryMark3Pt(Dbxy pt){m_TheoryMarkPt3 = pt;};
|
|
void SetRealMark3Pt(Dbxy pt){m_RealMarkPt3 = pt;};
|
|
Dbxy TheoryPtToRealPt(Dbxy TheoryMarkPt);
|
|
void TheoryDataToRealData(vector<vector<Dbxy>> &vec,Dbxy &Offset);
|
|
void StretchDataToRealSize(vector<vector<Dbxy>> &vec);
|
|
void TheoryDataToRealData(vector<Dbxy> &vec,Dbxy &Offset);
|
|
void TheoryDataToRealData(vector<vector<Dbxy>> &SrcVec,vector<vector<Dbxy>> &DecVec,Dbxy &Offset);
|
|
void TheoryDataToRealData(vector<Dbxy> &SrcVec,vector<Dbxy> &DecVec,Dbxy &Offset);
|
|
bool IsSetRealMarkPt1();
|
|
bool IsSetRealMarkPt2();
|
|
void UseDefualtOffset();
|
|
bool IsMarkReady();
|
|
bool IsbLastOne(){return m_bLastOne;};
|
|
void SetbLastOne(bool b){m_bLastOne = b;};
|
|
void SetbNewAddProduct(bool bNew) { m_bNewAddProduct = bNew; };//设置是否是改造新增的产品
|
|
bool IsbNewAddProduct() { return m_bNewAddProduct; };//查询是否是改造新增的产品
|
|
private:
|
|
void CalTheoryToRealPar();
|
|
Dbxy CalRealProductScale();
|
|
void StretchPt(Dbxy &Pt,SObjOperatePar &Par);
|
|
void CalRealStretchPar();
|
|
double CalRealProductScaleExt(Dbxy TheoryMarkPt1,Dbxy TheoryMarkPt2,Dbxy RealMarkPt1,Dbxy RealMarkPt2);
|
|
public:
|
|
Dbxy m_BasePt;//工件的基准坐标点
|
|
bool m_bUsed;//是否使用
|
|
bool m_bLastOne;//是否为最后一个
|
|
bool m_bHasMarkPt3;//是否有mark3
|
|
bool m_bNewAddProduct = false;//是否是改造后新增的那块产品(201910)
|
|
public:
|
|
//用于定位的两个定位点---------------------------
|
|
Dbxy m_TheoryMarkPt1;//理论坐标(layer 中的坐标) mm
|
|
Dbxy m_TheoryMarkPt2;
|
|
Dbxy m_TheoryMarkPt3;
|
|
//ccd 抓取的实际值------------------------------------
|
|
Dbxy m_RealMarkPt1;//真实坐标(相对于激光中心点) mm
|
|
Dbxy m_RealMarkPt2;
|
|
Dbxy m_RealMarkPt3;
|
|
public:
|
|
//实际偏移旋转结果---------------------------------
|
|
Dbxy m_Offset;//理论数据映射为平台坐标的偏移
|
|
double m_RotateAng;//理论数据映射为平台坐标的旋转角度(反正切角)
|
|
double m_MaxRotateAng;//最大旋转角度(360 度角)计算出来的旋转角度超过这个值时可能有错误,计算无效
|
|
|
|
SObjOperatePar m_StretchParX;//X 方向拉伸参数
|
|
SObjOperatePar m_StretchParY;//Y 方向拉伸参数
|
|
};
|
|
|