#pragma once #include "stdafx.h" enum CameraType { CamType_Unknown = 0, CamType_Transfer, CamType_Reflex, CamType_Back }; enum ScanDirectionIns { SD_Forward = 0, SD_Backward, SD_Unknown }; // Glass ±âÁØ Scan ¹æÇâ. static char ASG_NAME[4][10]={"LEFT", "RIGHT", "TOP", "BOTTOM"}; enum emPadPos {PAD_LEFT, PAD_RIGHT, PAD_TOP, PAD_BOTTOM, PAD_KIND}; static BOOL IsTopBottomPad(emPadPos ppos){return ppos >= PAD_TOP;}; static BOOL IsHoriInsPad(emPadPos ppos){return IsTopBottomPad(ppos);}; static char *GetPadPosName(emPadPos ppos) { return ASG_NAME[ppos]; } class CScanCell; class CScanRegion; class CScanModel; class CScanGlass; class CZone_MatPoint { public: CRect rectOrg; CRect rectAdj; public: CZone_MatPoint() { Reset(); } void Reset() { rectOrg.SetRect(0,0,0,0); rectAdj.SetRect(0,0,0,0); } CZone_MatPoint& operator=(CZone_MatPoint& rhs) { rectOrg = rhs.rectOrg; rectAdj = rhs.rectAdj; return *this; } void OffsetRegion(int nXDiff,int nMarginLeft,int nMarginRight) { int nWidth = rectAdj.Width(); rectAdj.OffsetRect(nXDiff,0); if(nMarginLeft > rectAdj.left) { rectAdj.left = nMarginLeft; rectAdj.right = rectAdj.left + nWidth; } if(nMarginRight < rectAdj.right) { rectAdj.right = nMarginRight; rectAdj.left = rectAdj.right - nWidth; } } }; class CZone_MatReg { public: int iFrame; CArray pPoint; public: CZone_MatReg() { Reset(); } ~CZone_MatReg() { DeleteAll(); } void DeleteAll() { pPoint.RemoveAll(); } void Reset() { iFrame = -1; DeleteAll(); } CZone_MatReg& operator=(CZone_MatReg& rhs) { iFrame = rhs.iFrame; DeleteAll(); for (int i = 0; i < rhs.pPoint.GetSize(); i++) { pPoint.Add(rhs.pPoint.GetAt(i)); } return *this; } void OffsetRegion(int nXDiff,int nMarginLeft,int nMarginRight) { for (int i = 0; i < pPoint.GetSize(); i++) pPoint.GetAt(i).OffsetRegion(nXDiff,nMarginLeft,nMarginRight); } }; class CZone_MatRegArray : public CArray { public: ~CZone_MatRegArray() { DeleteAll(); } void DeleteAt(LONG nIndex) { if(nIndex >= GetSize()) return; for (int i = 0; i < GetSize(); i++) { if(nIndex == i) { if(GetAt(i) != NULL) GetAt(i)->DeleteAll(); delete GetAt(i); RemoveAt(i); break; } } } void DeleteAll() { for (int i = 0; i < GetSize(); i++) { if(GetAt(i) != NULL) GetAt(i)->DeleteAll(); delete GetAt(i); } RemoveAll(); } }; class CScanCell { public: CZone_MatRegArray m_pZoneMatReg; CScanCell(){m_RectCellPat.SetRect(300, 1, 11700, 1023);} public: CRect m_RectCellPat; CZone_MatRegArray *GetZoneRegData(){return &m_pZoneMatReg;} CZone_MatReg *GetZoneReg(int iFrame) {return NULL;} public: void SetScanRegion(int iCell, CScanRegion *pRegion){m_iCell= iCell; m_pScanRegion= pRegion;} CScanRegion* GetScanRegion() {return m_pScanRegion;} int m_iCell; CScanRegion *m_pScanRegion; }; class CScanRegion { public: CScanRegion() {m_bOnlyPAD= FALSE;} BOOL m_bOnlyPAD; CScanCell m_pCell[1]; int GetCellCount() {return 1;} CScanCell *GetCellInfo(int i) {return m_pCell;} public: void SetScanModel(int iRegion, CScanModel *pModel){m_iRegion= iRegion; m_pScanModel= pModel;} CScanModel* GetScanModel() {return m_pScanModel;} int m_iRegion; CScanModel *m_pScanModel; BOOL SetCellCount(int nRegion) { m_pCell[0].SetScanRegion(0, this); return TRUE; } }; class CScanModel { public: BOOL m_bAsgZone; public: CScanModel() { m_bAsgZone= TRUE; m_ConvPitch= 179.5; m_ScanPitch= 179.5;} public: CScanRegion m_pRegion[1]; CScanRegion *GetScanRegion(int i) {return m_pRegion;} int GetRegionCount() {return 1;} double m_ConvPitch, m_ScanPitch; double GetConvPitch() {return m_ConvPitch;} double GetScanPitch() {return m_ScanPitch;} public: BOOL SetRegionCount(int nRegion) { m_pRegion[0].SetScanModel(0, this); m_pRegion[0].SetCellCount(1); return TRUE; } void SetScanGlass(int iModel, CScanGlass *pGlass){m_iModel= iModel; m_pScanGlass= pGlass;} CScanGlass* GetScanGlass() {return m_pScanGlass;} int m_iModel; CScanGlass *m_pScanGlass; }; class CScanGlass { CScanModel m_pModel[1]; public: CScanGlass() {m_enScanDirection= SD_Forward; m_nScanIdx= 0; SetModelCount(1);} int m_nScanIdx; int m_enScanDirection; public: int GetModelCount() {return 1;} CScanModel *GetScanModel(int i) {return m_pModel;} int GetCamType() {return CamType_Reflex;} CString GetHPanelID() {return CString("HPANELID");} int GetMarginLeft() {return 100;} int GetMarginRight() {return 100;} CString GetRecipeName() {return CString("TEMPRECIPE");} int GetConvMode() {return 1;} BOOL SetModelCount(int nRegion) { m_pModel[0].SetScanGlass(0, this); m_pModel[0].SetRegionCount(1); return TRUE; } }; class CFakeBase { public: int m_nFrameWidth; int m_nFrameHeight; CString m_strHPanelID; CFakeBase() { m_nFrameWidth = 10240; m_nFrameHeight = 1024; m_strHPanelID = "Test"; } }; extern CFakeBase *g_pBase; class CHMConfigFile { public: void SetFileName(char *name){}; void GetItemValue(char* szName, int& nValue, int nDefault= 0){nValue= nDefault;} };