#include "StdAfx.h" #include "WorkCmdPciPortSwitch.h" #include "LogMgr.h" #include "PciPortMgr.h" #include "PciCh365Mgr.h" #include "Laser.h" CWorkCmdPciPortSwitch::CWorkCmdPciPortSwitch(CString CtrlContent,bool bOpen) :m_CtrlContent(CtrlContent),m_bOpen(bOpen) { } CWorkCmdPciPortSwitch::~CWorkCmdPciPortSwitch(void) { } void CWorkCmdPciPortSwitch::SetPar(CString CtrlContent,bool b) { m_CtrlContent = CtrlContent; m_bOpen = b; } bool CWorkCmdPciPortSwitch::Excute() { if(gLogMgr->IsDebuging())//调试状态只延时 { Sleep(gLogMgr->GetDebugCmdDelay()); return true; } //laipu pci 卡控制 gPciCh365Mgr->WritePortState(gPciPortMgr->GetCtrlPort(m_CtrlContent),m_bOpen); //激光操作 if(PCI_PORT_LASER == m_CtrlContent) { if(m_bOpen) { gLaser->OnOpen(); } else { gLaser->OnClose(); } } return true; } void CWorkCmdPciPortSwitch::WirteLog() { CString str = "[WorkCmd]"; if(m_bOpen) { str += "[开"+m_CtrlContent+"]"; } else { str += "[关"+m_CtrlContent+"]"; } gLogMgr->WriteDebugLog(str); }