#include "stdafx.h" #include "OEM.Collimator.h" //#include "DIOS.Dev.FPD.Demo.h" #include "DIOS.Dev.Generator.Demo.hpp" OemCollimator::OemCollimator(std::shared_ptr EventCenter, int nXSize, int nYSize, int nFilter, int nSID, int nAngle, int nMode): super(EventCenter) { m_nXSize = nXSize; m_nYSize = nYSize; m_nFilter = nFilter; m_nSID = nSID; m_nAngle = nAngle; m_nMode = nMode; } OemCollimator::~OemCollimator() { } bool OemCollimator::Prepare() { printf("OemCollimator::Prepare\n"); Register(); return true; } void OemCollimator::Register() { printf("OemCollimator::Register\n"); auto p = static_cast (this); auto Disp = Dispatch.Lock().As(); Disp->Action.Push("SetCollimatorSize", p, &CollimatorDevice::JSSetCollimatorSize); Disp->Action.Push("SetCollimatorFilter", p, &CollimatorDevice::JSSetCollimatorFilter); Disp->Action.Push("SetCollimatorSID", p, &CollimatorDevice::JSSetCollimatorSID); Disp->Action.Push("SetCollimatorAngle", p, &CollimatorDevice::JSSetCollimatorAngle); Disp->Action.Push("SetCollimatorLight", p, &CollimatorDevice::JSSetCollimatorLight); Disp->Get.Push("XSize", p, &CollimatorDevice::JSGetCollimatorXSize); Disp->Get.Push("YSize", p, &CollimatorDevice::JSGetCollimatorYSize); Disp->Get.Push("SID", p, &CollimatorDevice::JSGetCollimatorSID); Disp->Get.Push("Filter", p, &CollimatorDevice::JSGetCollimatorFilter); Disp->Get.Push("Angle", p, &CollimatorDevice::JSGetCollimatorAngle); } void OemCollimator::SetCtrlDev(DemoDevice* pCtrlDev) { m_pGEN = pCtrlDev; } nsDev::RET_STATUS OemCollimator::SetCollimatorFilter(WORD pParams) { nsDev::RET_STATUS ret = nsDev::RET_STATUS::RET_FAILED; ret = m_pGEN->SetFilter(pParams); return ret; } nsDev::RET_STATUS OemCollimator::SetCollimatorSize(WORD xsize, WORD ysize) { nsDev::RET_STATUS ret = nsDev::RET_STATUS::RET_FAILED; ret = m_pGEN->SetCollimatorSize(xsize, ysize); return ret; } nsDev::RET_STATUS OemCollimator::SetCollimatorLight(WORD pParams) { //nsDev::RET_STATUS ret = nsDev::RET_STATUS::RET_FAILED; nsDev::RET_STATUS ret = m_pGEN->SetCollimatorLight(pParams); return ret; }