FluoroSwitchController.cpp 904 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "stdafx.h"
  2. #include "FluoroSwitchController.h"
  3. #include "ICommunicateEntity.h"
  4. using namespace DIOS::Dev::Detail::MachineryECOM;
  5. FluoroSwitchController::FluoroSwitchController() :m_communicate(nullptr)
  6. {
  7. }
  8. FluoroSwitchController::~FluoroSwitchController()
  9. {
  10. }
  11. std::string FluoroSwitchController::CLASSID()
  12. {
  13. return "A14BE4FF-C315-4380-8921-B00CF2A6DE2B";
  14. }
  15. void FluoroSwitchController::Initialize(const std::string &name)
  16. {
  17. SetName(name);
  18. }
  19. void FluoroSwitchController::OnCommunicationEstablished(ICommunicateEntity *communicate)
  20. {
  21. m_communicate = communicate;
  22. }
  23. void FluoroSwitchController::OutputSignal(bool bEnable)
  24. {
  25. if (!m_communicate)
  26. {
  27. return;
  28. }
  29. GPIO_DO_PARAM oriparam;
  30. oriparam.active_level = bEnable ? 0x1 : 0x0;
  31. m_communicate->GPIO_DO_Ctrl(OP_WRITE, (GPIO_DO_ID)m_functionIds[ID_FLUORO_SWITCH_OUT], DO_ATTR_NONE, oriparam);
  32. }