1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- #include "stdafx.h"
- #include "OEM.Collimator.h"
- //#include "DIOS.Dev.FPD.Demo.h"
- #include "DIOS.Dev.Generator.Demo.hpp"
- OemCollimator::OemCollimator(std::shared_ptr <DIOS::Dev::IOEventCenter> 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 <CollimatorDevice*> (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;
- }
|