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.

95 lines
4.0 KiB
C++

#pragma once
#include "GlobalDefine.h"
#include "SmartPtr.h"
#include "ObjBase.h"
//元件对象
class CObjComponent
{
friend class CDlgObjComponent;
public:
CObjComponent();
CObjComponent(Dbxy pt,DbSize size);
~CObjComponent(void);
void Draw(CDC* pDC);
DbRect GetRect();
Dbxy GetBasePt(){return m_BasePt;};
void SetBasePt(Dbxy pt){m_BasePt = pt;};
void SetSize(DbSize s){m_Size = s;};
DbSize GetSize(){return m_Size;};
void SetBase(bool b){m_bBase = b;};
bool IsBase(){return m_bBase;};//是否为基准元件
bool IsInRect(DbRect rect,bool bCenterIn =false);
void SetSelected(bool b);
bool IsSelected(){return m_bSel;};
void SetbCollected(bool b){m_bCollected = b;};//设置收集状态
bool IsCollected(){return m_bCollected;};
void CollectWorkData(DbRect &rect,vector<vector<Dbxy>> &vec);
bool IsCircle(){return m_bCircle;};
void SetIsCircle(bool b){m_bCircle = b;};
void SetColorIdx(int idx){m_ColorIdx = idx;};
void SetObjMarkIdx(bool b);
int GetObjMarkIdx(){return m_ObjMarkIdx;};
void SetbMarkObj(bool b){m_bMarkObj = b;};
bool IsMarkObj(){return m_bMarkObj;};
void SetMarkSidewardObj(){m_bMarkSidewardObj = true;};
void SetObjLineIdx(int idx){m_ObjLineIdx = idx;};
int GetObjLineIdx(){return m_ObjLineIdx;};
void SetbAutoCreatObj(){m_bAutoCreatObj = true;};
bool IsbAutoCreat(){return m_bAutoCreatObj;};
void SetIndex(IntXY idx){m_Index = idx;};
IntXY GetIndex(){return m_Index;};
void SetbView(bool b){m_bView = b;};
void SetRealBasePt(Dbxy pt){m_RealBasePt = pt;};
Dbxy GetRealBasePt(){return m_RealBasePt;};
void SetbViewed(bool b){m_bViewed = b;};
bool IsbViewed(){return m_bViewed;};
void AddObjShape(Sptr<CObjBase> p);
void SetbMarked(bool b){m_bMarked = b;};
bool IsbMarked(){return m_bMarked;};
void NotCollect(){m_bCollecteData = false;};//不要收集数据
bool IsbCollecteData(){return m_bCollecteData;};
void SetShapeLockState(bool b);
void SetColor(COLORREF c){m_Color = c;};
void SetVal1(double val){m_Val1 = val;};
void SetVal2(double val){m_Val2 = val;};
double GetVal1(){return m_Val1;};
double GetVal2(){return m_Val2;};
private:
void Reset();
COLORREF GetObjColorByIdx(int Idx);
private:
bool m_bBase;//是否为基准元件
bool m_bSel;//是否被选中
bool m_bCircle;//是否为圆形
bool m_bCollected;//数据是否已经被收集过了,避免重复收集
bool m_bMarked;//是否被加工过了
bool m_bCollecteData;//是否需要收集加工数据(false 的时候不收集obj 的数据)
bool m_bMarkObj;//是否为标记的obj (用于CCD 定位)
Dbxy m_BasePt;//元件的基准点(中心点)
DbSize m_Size;//元件的尺寸
int m_TempIdx;//使用的数据模板编号
int m_ColorIdx;//颜色索引值
int m_ObjMarkIdx;//obj 标记,用来区别是否开孔
int m_ObjLineIdx;//obj 在line 上的索引值,用来确定相邻line 中obj 的关系
bool m_bAutoCreatObj;//是否为自动创建的obj
bool m_bMarkSidewardObj;//是否为标记obj 旁边的obj
vector<Sptr<CObjBase>> m_ObjShapeVec;//绑定图形obj (用来收集数据)
//LPS -ISP3000--------------------------------------------------------------------------------------
IntXY m_Index;//obj 的索引编号
bool m_bView;//是否正在观察
bool m_bViewed;//是否被观察过了
Dbxy m_RealBasePt;//元件的基准点(中心点) 实际的值(可能和显示值不一样)
DbSize m_RealSize;//元件的尺寸 实际的值(可能和显示值不一样)
COLORREF m_Color;//对象的颜色
double m_Val1;//记录值1(功率w)
double m_Val2;//记录值2(温度)
};