#include "StdAfx.h" #include "TemplateMgr.h" #include "Layer.h" #include "Propertie.h" #include "PropertieMgr.h" #include "AuthorityMgr.h" #include "WorkFileLable.h" #include "WorkFileMgr.h" #include "LogMgr.h" #include "GlobalDrawMgr.h" #define MaxTempCnt 200 //可编辑模板的数量 #define NULL_IDX -1//判断无绑定模板的索引值 CTemplateMgr *gTemplateMgr = new CTemplateMgr; CTemplateMgr::CTemplateMgr(void) { m_bUseObjList = false;//是否使用对象列表 m_bClearOldObj = true;//读取文件时是否清除旧的obj 对象 } CTemplateMgr::~CTemplateMgr(void) { } #if 1//复写module 的函数 CMFCPropertyGridProperty *CTemplateMgr::CreatGridProperty() { CPropertieMgr &PropertieMgr = gDevicePropertieMgr; CString PropertyName;//属性名称 CString Description;//描述 CString Path = _T("Template");//存储路径 CString Name; //-------------------------------------------------------------------------------// PropertyName = _T("模板设定"); CMFCPropertyGridProperty* pGroup = new CMFCPropertyGridProperty(PropertyName); //-------------------------------------------------------------------------------// { PropertyName = _T("对象列表"); if(gAuthorityMgr->CheckAuthority(_Authority_Operator)) { //添加属性变量映射 Name = _T("m_bUseObjList");//变量名字 CPropertie *pPropertie = new CPropertie; pPropertie->SetpVal((void*)&m_bUseObjList); pPropertie->SetType(_PROP_TYPE_BOOL); pPropertie->SetpModule(this); pPropertie->SetPath(Path); pPropertie->SetName(Name); pPropertie->WriteRead(true);//读取保存的属性 //添加属性显示 PropertyName = _T("对象列表"); Description = _T("是否使用对象列表,使用后会影响刷新速度"); CMFCPropertyGridProperty* p = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_bUseObjList, Description); pGroup->AddSubItem(p); PropertieMgr.Insert(p, pPropertie); } } return pGroup; } void CTemplateMgr::OnAppInitialize() { //清空容器 m_TempVec.clear(); //初始化模板容器 for(int i=0;i &LabVec) { for(int i=0;i LabVecRangVec; CWorkFileMgr WorkFileMgr; WorkFileMgr.SeparateStrVec(LabVecRang,LabVecRangVec,LAB_TEMPLATE_START,LAB_TEMPLATE_END); //处理每个模板 if(!LabVecRangVec.empty()) { size_t size = LabVecRangVec.size(); for(size_t i=0;i=0&&idxGetTempRectPen()); } //设置指定模板的范围(bCircle 表示是否为圆形) void CTemplateMgr::SetTempRect(int idx,DbRect &rect,bool bCircle) { if(idx>=0&&idx> &vec) { if(idx>=0&&idx