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.

58 lines
1.2 KiB
C++

#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())//<2F><><EFBFBD><EFBFBD>״ֻ̬<CCAC><D6BB>ʱ
{
Sleep(gLogMgr->GetDebugCmdDelay());
return true;
}
//laipu pci <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
gPciCh365Mgr->WritePortState(gPciPortMgr->GetCtrlPort(m_CtrlContent),m_bOpen);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
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 += "[<5B><>"+m_CtrlContent+"]";
}
else
{
str += "[<5B><>"+m_CtrlContent+"]";
}
gLogMgr->WriteDebugLog(str);
}