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.
TwoLaserHead-PushJig/LaiPuLaser/ModuleDeviceMgr.cpp

173 lines
5.6 KiB
C++

#include "StdAfx.h"
#include "ModuleDeviceMgr.h"
#include "GlobalFunction.h"
#include "PropertieMgr.h"
#include "MarkObjPropertieMgr.h"
#include "GlobalFunction.h"
#include "PltReader.h"
#include "PciPortMgr.h"
#include "PciCh365Mgr.h"
#include "PlatformXY.h"
#include "Laser.h"
#include "Motor.h"
#include "ApplicationPriority.h"
#include "WorkAreaMgr.h"
#include "CameraHawkvis.h"
#include "GratingRuler.h"
#include "AuthorityMgr.h"
#include "LaipuVbDllMgr.h"
#include "MarkAreaMgr.h"
#include "SocketMgr.h"
#include "Mirror.h"
#include "SinglechipCardMgr.h"
#include "CameraKeyence.h"
#include "LaserDeviceMgr.h"
#include "ProductMgr.h"
#include "OptoWaveLaserMgr.h"
#include "LogMgr.h"
#include "CommonFlowMgr.h"
#include "WorkRecord.h"
#include "PlcIOMgr.h"
#include "EncryptionMgr.h"
#include "ProgramCutMgr.h"
#include "MotionCard_PCI1245.h"
//#include "SuperDogMgr.h"
#include "Program_SZ_XL.h"
CModuleDeviceMgr gModuleDeviceMgr;//管理全局使用的类
CModuleDeviceMgr::CModuleDeviceMgr(void)
{
}
CModuleDeviceMgr::~CModuleDeviceMgr(void)
{
DeleteAllModule();
}
//创建模块对象(注意模块初始化的顺序)
void CModuleDeviceMgr::CreatAllModule()
{
//日志管理模块
//gLogMgr = new CLogMgr;
m_ModuleVec.push_back((CModule*)gLogMgr);
//权限管理
m_ModuleVec.push_back((CModule*)gAuthorityMgr);
//程序优先级管理
m_ModuleVec.push_back((CModule*)gAppPriorityMgr);
//工作区域
m_ModuleVec.push_back((CModule*)gWorkAreaMgr);
//plt 读取对象
m_ModuleVec.push_back((CModule*)gPltReader);
//脱机控制卡
m_ModuleVec.push_back((CModule*)gSinglechipCardMgr);
//振镜
m_ModuleVec.push_back((CModule*)gMirror);
//pci 卡端口管理(后面一些模块的初始化依赖于端口,所以要放在前面)
m_ModuleVec.push_back((CModule*)gPciPortMgr);
//pci 365 卡
m_ModuleVec.push_back((CModule*)gPciCh365Mgr);
//电机马达
m_ModuleVec.push_back((CModule*)CMotor::GetMotor(MOTOR_X));
m_ModuleVec.push_back((CModule*)CMotor::GetMotor(MOTOR_X2));
m_ModuleVec.push_back((CModule*)CMotor::GetMotor(MOTOR_Y));
m_ModuleVec.push_back((CModule*)CMotor::GetMotor(MOTOR_Z));
//XY 平台
gPlatformXY = new CPlatformXY(*(CMotor::GetMotor(MOTOR_X)),*(CMotor::GetMotor(MOTOR_Y)));
m_ModuleVec.push_back((CModule*)gPlatformXY);
#ifdef __DLG_PANE_PLATFORM__
gPlatformXY->Attach(&(GetFrame()->m_DlgPlatformCtrl));
(CMotor::GetMotor(MOTOR_Z))->Attach(&(GetFrame()->m_DlgPlatformCtrl));
#endif
#ifdef __PROGRAM_SHILAN_TUIHUO__
gPlatformXY->Attach(&(GetFrame()->m_DlgTuiHuoDeviceCtrl));
#endif
//激光
m_ModuleVec.push_back((CModule*)gLaser);
//光栅尺
m_ModuleVec.push_back((CModule*)gGratingRuler);
//socket 通讯管理
m_ModuleVec.push_back((CModule*)gSocketMgr);
//振镜运动参数
m_ModuleVec.push_back((CModule*)gMarkParMgr);
//工件产品管理
m_ModuleVec.push_back((CModule*)gProductMgr);
//标记区域
m_ModuleVec.push_back((CModule*)gMarkAreaMgr);
//常用流程
m_ModuleVec.push_back((CModule*)gCommonFlowMgr);
//加工记录管理
m_ModuleVec.push_back((CModule*)gWorkRecordMgr);
m_ModuleVec.push_back((CModule*)gProgramCutMgr);
m_ModuleVec.push_back((CModule*)gCameraHawkvis);
m_ModuleVec.push_back((CModule*)gCLaserDeviceMgr);
m_ModuleVec.push_back((CModule*)gPlcIOMgr);
m_ModuleVec.push_back((CModule*)gEncryptionMgr);
m_ModuleVec.push_back((CModule*)gMotionCard_PCI1245);
#ifdef USE_SUPER_DOG
m_ModuleVec.push_back((CModule*)gEncryptionMgr);
#endif
m_ModuleVec.push_back((CModule*)gProgram_SZ_XL);
}
//插入指定模块的属性
void CModuleDeviceMgr::InsertModuleGridProperty(int SelIdx)
{
DEVICE_PROP_COMB_TYPE CombType = (DEVICE_PROP_COMB_TYPE)SelIdx;
//设置要插入的模块--------------------------------------------
set<MODULE> ModuleSet;
switch(CombType)
{
case _COMB_NULL_PROP:
break;
case _COMB_PCI_PROP://pci 卡参数
ModuleSet.insert(_PCI_PORT_PROP);
break;
case _COMB_MOTION_CARD://运动控制卡
ModuleSet.insert(_MOTION_CARD_PCI1245L);
break;
case _COMB_MOTOR_PROP://电机马达
ModuleSet.insert(_MOTOR_PROP);//电机马达属性
break;
case _COMB_PLATFORM_XY_PROP://电机马达
ModuleSet.insert(_PLATFORM_XY_PROP);//电机马达属性
break;
case _COMB_DEVICE_PROP://硬件参数
ModuleSet.insert(_MIRROR_PROP);//切割参数
ModuleSet.insert(_TOOL_CUT_PROP);//切割参数
ModuleSet.insert(_LASER_PROP);//激光
ModuleSet.insert(_SPECTRA_PHYSICS_LASER_PROP);//光谱物理
ModuleSet.insert(_HAWKVIS_CCD_PROP);//深圳霍克视觉的CCD
ModuleSet.insert(_PLC_IO_PROP);//日志
break;
case _COMB_OTHER_PROP:
ModuleSet.insert(_LOG_PROP);//日志
ModuleSet.insert(_APP_PRIORITY_PROP);//程序优先级
ModuleSet.insert(_AUTHORITY_PROP);//权限管理
ModuleSet.insert(_WORK_AREA_PROP);//工作空间
ModuleSet.insert(_PLT_PROP);//plt 设置
ModuleSet.insert(_WORK_RECORD_PROP);//加工记录
break;
case _COMB_WORK_DATA://工作数据
ModuleSet.insert(_PRODUCT_PROP);//工件产品管理
break;
case _COMB_SPECIAL_DEVICE_PROP:
ModuleSet.insert(_PGM_SW_XL_PROP);
break;
case _COMB_COMMON_FLOW_PROP:
ModuleSet.insert(_COMMON_FLOW_PROP);
break;
default:
break;
}
//将指定的属性页插入wnd
CPanePropertiesWnd &wndProperties = GetFrame()->m_PaneDevicePar;
InsertPropertiesToWnd(ModuleSet,wndProperties);
}