123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- #pragma once
- #include <vector>
- #define HIKVISION_CAMERA_EXPORTS
- #include "CCameraManage.h"
- #include "CModule.h"
- #include "CCalib.h"
- #include "CBondHead.h"
- #include "CXYCalib.h"
- #include "CHIKVisionCamera.h"
- #include "CWafflePackHead.h"
- #include "CWaferTable.h"
- #include "JMotion.h"
- #include "CTransferTable.h"
- #include "CBondTable.h"
- #include "CNozzleTable.h"
- #include "CForceControl.h"
- #include "VerticalMeasure.h"
- #include "HorizMeasure.h"
- #include "CAxis.h"
- #include "CWafflePackHead.h"
- #include "CWaferHead.h"
- #include "CUltraHead.h"
- #include "CEutecticHead.h"
- #ifdef C_MACHINE_EXPORTS
- #define C_MACHINE_DLL_API __declspec(dllexport)
- #else
- #define C_MACHINE_DLL_API //__declspec(dllimport)
- #endif
- /*
- 初始化过程:
- 1、调用运控库对象,创建卡、轴、IO
- 2、调用资源大类,加载资源大类中的所有资源
- 3、创建模组对象,创建完对象后将轴、IO对象设置到模组中
- 4、创建测量对象,力控标定和使用对象(根据力控轴数量创建)、垂直测量对象、水平测量对象
- 注:由于水平测量也需要使用和垂直测量均使用了测高,需要使用力控标定对象,所以力控标定对象在Machine中创建,再将对象指针给各个模组
- 注:测量对象模组中并不会再次使用,认为属于机台,不属于模组
- 5、初始化模组:
- (1)初始化资源:创建该模组需要的功能对象,包括插补对象、标定对象(需要轴、相机,无法在构造函数创建)、PR策略(需要轴、相机)、矩阵数据等
- (2)从数据库拷贝一份数据保存到对象中,包括该模组中其他对象的数据加载
- Machine类认为是机台大类,属于机台不属于模组的轴、IO、对象也在Machine类中创建和控制。(是否应该继承Module)
- */
- class C_MACHINE_DLL_API Machine
- {
- public:
- enum HeadType
- {
- UltralHead, //超声头
- EutecticHead, //共晶头
- };
- static Machine* GetInstance();
- static void releaseInstance();
- JMotion* GetMotion() {return m_pMotion;}
- LONG ToHome();
- vector<CAxis*> GetMachineAllAxis() {return m_vetAxis;};
- CBondHead* GetBondHead() {return m_pBondHead;}
- //CUltraHead* GetUltraHead() { return m_pBondHead; };
- CBondTable* GetBondTable() { return m_pBondTable; }
- //CEutecticHead* GetEutecticHead() { return m_pEutecticHead; }
-
- CTransferTable* GetWaferCalibTable() { return m_pWaferTransferTable; }
- CTransferTable* GetWaffleCalibTable() { return m_pWaffleTransferTable; }
- CNozzleTable* GetNozzleTable() { return m_pNozzleTable; }
- //CForceControl* GetBHForce() { return m_pBondHeadForce; }
- //CForceControl* GetWaferForce() { return m_pWaferHeadForce; }
- CVerticalMeasure* GetVerticalMeasure() { return m_pVerMeasure; }
- CHorizMeasure* GetHorizMeasure() { return m_pHorizMeasure; }
- CWafflePackHead* GetWafflePackHead() { return m_pWaffleHead; }
- CWaferHead* GetWaferHead() { return m_pWaferHead; };
- CWaferTable* GetWaferTable() { return m_pWaferTable; }
- CResources* GetResources() { return m_pResource; };
- //AxesMapPage* GetMotionAxesMapPage(){
- // return m_pMotion->getMapPage();
- //}
- JMotion* GetJMotion() {
- return m_pMotion;
- }
- CXYCalib* GetBondHeadHighCameraCalib() {
- switch (Machine::m_eHeadType)
- {
- case Machine::HeadType::UltralHead:
- return nullptr;
- case Machine::HeadType::EutecticHead:
- return m_pBondHead->GetHighCameraCalib();
- default:
- return nullptr;
- break;
- }
- }
- CXYCalib* GetBondHeadLowCameraCalib() { return m_pBondHead->GetLowCameraCalib(); }
- CXYCalib* GetLookUpCameraCalib() { return m_pBondHead->GetLookUpCameraCalib(); }
- CXYCalib* GetWaferCameraCalib() { return m_pWaferTable->GetWaferXYCalib(); }
- CXYCalib* GetWafflePackCameraCalib() { return m_pWaffleHead->GetCameraCalib(); }
- CCTDCalib* GetWafflePackCTDCalib() { return m_pWaffleHead->GetCTDCalib(); }
- CRCalib* GetBondHeadRCalib() { return m_pBondHead->GetHeadRCalib(); }
- bool GetInitSuccess() { return m_bIsInitSuccess; }
- HeadType GetHeadType() { return m_eHeadType; }
- void SetHeadType(HeadType type) { m_eHeadType = type; }
- LONG MoveToSafePosition() { return OK; };
- LONG load();
- LONG save();
- private:
- Machine();
- ~Machine();
- LONG CreateModules();
- void CreateMeasures();
- LONG InitModules();
- void AllocModule();//所有模组都创建完成后调用,将模组指针分配给其他模组
- void ReleaseAxisAndIo();
- LONG CreatAllAxis();
- LONG CreatAllIo();
- LONG CreatAllCoord();
- bool GetAxisByMotion(string name, CAxis * *pAxis);
- bool GetIoByMotion(IO_LIST name, CIO * *pIo);
- bool GetCoordByMotion(COORD_LIST type, CCoord * *pCoord);
-
- private:
- static Machine* m_instance;
- vector<CAxis*> m_vetAxis;
- vector<CIO*> m_vetIO;
- vector<CCoord*> m_vetCoord;
- vector<CModule*> m_vetModules;
- CBondHead* m_pBondHead = nullptr;
- //CEutecticHead* m_pEutecticHead = nullptr;
- //CUltraHead* m_pUltraHead = nullptr;
- CWafflePackHead* m_pWaffleHead = nullptr;
- CWaferTable* m_pWaferTable = nullptr;
- CWaferHead* m_pWaferHead = nullptr;
- CEjector* m_pEjector = nullptr;
- CTransferTable* m_pWaferTransferTable = nullptr;
- CTransferTable* m_pWaffleTransferTable = nullptr;
- CBondTable* m_pBondTable = nullptr;
- CNozzleTable* m_pNozzleTable = nullptr;
- CForceControl* m_pBondHeadForce = nullptr;
- CForceControl* m_pWaferHeadForce = nullptr;
- //仅用于测量
- CVerticalMeasure* m_pVerMeasure = nullptr;
- CHorizMeasure* m_pHorizMeasure = nullptr;
- //运控接口
- JMotion* m_pMotion = nullptr;
- //相机管理接口
- CCameraManage* m_pCameraManage = nullptr;
- CResources* m_pResource = nullptr;
- CManageDB* pCManageDB = nullptr;
- bool m_bIsInitSuccess = false;
- bool m_bMotionEnable = true; //运控卡禁止/启用
- HeadType m_eHeadType = HeadType::UltralHead;
- CHardware* m_pCHardware = nullptr;
-
- };
|