#pragma once #include "CMatrixCommon.h" //一维矩阵:矩阵起点由外部保存,矩阵中保存的位置是相对于起点的位置 // namespace ns_mat { struct MatrixPointInfo { int nDieRow = 0; //点在矩阵中所在行 int nDieCol = 0; //点在矩阵中所在列 int iDieIndex = 0; //当前Point在pcb中的序号 bool bDisable = 0; //该点是否可用 XY_DOUBLE_STRUCT stPosition{ 0,0 }; //程序设置的位置,相对于左上角的位置 }; class __declspec(dllexport) OneDimMatrix { public: OneDimMatrix(); ~OneDimMatrix(); LONG LoadMatrix(int matriId, MATRIX_SEARCH_DIR dir); LONG GetPointInfo(int index, MatrixPointInfo& pointInfo); LONG GetPointInfo(int row, int col, MatrixPointInfo& pointInfo); LONG GetPointPosition(int index, XY_DOUBLE_STRUCT& position); LONG GetPointPosition(int row, int col, XY_DOUBLE_STRUCT& pointInfo); int GetAmount() { return m_nAmount; };//获取总数 private: void Sort_Z(); void Sort_S(); private: OneDimMatrixInfo m_stMatrixInfo;//矩阵数据 std::map m_mapMatrixInfo; //每个矩阵点对应的信息 CProduct* m_pCProduct = nullptr; //产品数据库 static std::mutex m_MatrixMutex; bool bIsInitSuccess = false; int m_nMartixID = 1; int m_nAmount = 0; }; }