ExposureController.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #include "stdafx.h"
  2. #include "ExposureController.h"
  3. #include "ICommunicateEntity.h"
  4. using namespace DIOS::Dev::Detail::MachineryECOM;
  5. ExposureController::ExposureController() :m_communicate(nullptr)
  6. {
  7. }
  8. ExposureController::~ExposureController()
  9. {
  10. }
  11. std::string ExposureController::CLASSID()
  12. {
  13. return "7ED42E38-E0FB-35DF-0730-4F3F24D782BC";
  14. }
  15. void ExposureController::Initialize(const std::string &name)
  16. {
  17. SetName(name);
  18. }
  19. void ExposureController::OnCommunicationEstablished(ICommunicateEntity *communicate)
  20. {
  21. m_communicate = communicate;
  22. }
  23. void ExposureController::ActiveExposureTubeHeightPositionAutoNotify(int sensorid)
  24. {
  25. if (!m_communicate)
  26. {
  27. return;
  28. }
  29. GPIO_DI_PARAM params;
  30. params.ch_associate_id = (unsigned char)sensorid;
  31. m_communicate->GPIO_DI_Ctrl(OP_SET, (GPIO_DI_ID)m_functionIds[ID_XRAYON_NOTIFY], DI_ATTR_SET_ASSOCIATE_CH2, params);
  32. }
  33. void ExposureController::ActiveExposureTubeAnglePositionAutoNotify(int sensorid)
  34. {
  35. if (!m_communicate)
  36. {
  37. return;
  38. }
  39. GPIO_DI_PARAM params;
  40. params.ch_associate_id = (unsigned char)sensorid;
  41. m_communicate->GPIO_DI_Ctrl(OP_SET, (GPIO_DI_ID)m_functionIds[ID_XRAYON_NOTIFY], DI_ATTR_SET_ASSOCIATE_CH1, params);
  42. }