OEM.Mechanical.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #include "stdafx.h"
  2. #include "OEM.Mechanical.h"
  3. #include "DIOS.Dev.Generator.Demo.hpp"
  4. OemMechanical::OemMechanical(std::shared_ptr <DIOS::Dev::IOEventCenter> EventCenter,
  5. int nGrid, unsigned int nAE, unsigned int nFT, unsigned int nPressureState, unsigned int nCompPressureDEC, unsigned int nDepress,
  6. float fMechAngle, float fMechHeight, float fPressureValue, float fAGD, float fMAG): super(EventCenter)
  7. {
  8. m_pGEN = nullptr;
  9. m_Grid = nGrid;
  10. m_Mammo_AE = nAE;
  11. m_Mammo_FT = nFT;
  12. m_Mammo_PressureState = nPressureState;
  13. m_Mammo_CompPressureDEC = nCompPressureDEC;
  14. m_Mammo_Depress = nDepress;
  15. m_Mammo_MechAngle = fMechAngle;
  16. m_Mammo_MechHeight = fMechHeight;
  17. m_Mammo_PressureValue = fPressureValue;
  18. m_Mammo_AGD = fAGD;
  19. m_Mammo_MAG = fMAG;
  20. }
  21. OemMechanical::~OemMechanical()
  22. {
  23. }
  24. bool OemMechanical::Prepare()
  25. {
  26. printf("OemMechanical::Prepare\n");
  27. Register();
  28. return true;
  29. }
  30. void OemMechanical::Register()
  31. {
  32. printf("OemMechanical::Register\n");
  33. super::Register();
  34. }
  35. void OemMechanical::SetCtrlDev(DemoDevice* pCtrlDev)
  36. {
  37. m_pGEN = pCtrlDev;
  38. }
  39. nsDev::RET_STATUS OemMechanical::GetTomoResults(ResDataObject& resultAngle, ResDataObject& resultHeight)
  40. {
  41. nsDev::RET_STATUS ret = nsDev::RET_STATUS::RET_FAILED;
  42. ret = m_pGEN->GetTomoResults(resultAngle, resultHeight);
  43. return ret;
  44. }
  45. nsDev::RET_STATUS OemMechanical::SetGrid(unsigned int GridType)
  46. {
  47. nsDev::RET_STATUS ret = nsDev::RET_STATUS::RET_FAILED;
  48. //ysj++v1的逻辑是首先获取,如果不同,再set,相同则不做动作。
  49. ret = m_pGEN->SetGrid(GridType);
  50. return ret;
  51. }
  52. //这个接口,UI层 可能是叫setpress
  53. nsDev::RET_STATUS OemMechanical::SetAutoTracking(unsigned int nAutoTracking)
  54. {
  55. nsDev::RET_STATUS ret = nsDev::RET_STATUS::RET_FAILED;
  56. ret = m_pGEN->SetAutoTracking(nAutoTracking);
  57. return ret;
  58. }