MachineryManager.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #pragma once
  2. #include "IMachineryManager.h"
  3. #include "DiosBoardCtrlParams.h"
  4. namespace DIOS::Dev::Detail::MachineryECOM
  5. {
  6. class ISensorADController;
  7. class ISensorEncoderController;
  8. class ITubeAngleController;
  9. class ITubeHeightController;
  10. class IExposureController;
  11. class ILandmarkController;
  12. class ICollimatorController;
  13. class IOutputController;
  14. class ITubeHorizontalController;
  15. class MachineryManager : public IMachineryManager
  16. {
  17. public:
  18. MachineryManager();
  19. ~MachineryManager();
  20. public:
  21. static MachineryManager *Instance();
  22. public:
  23. virtual void Initialize(IMechnicalComponentFactory *factory) override;
  24. virtual void OnCommunicationEstablished(ICommunicateEntity *communicate) override;
  25. virtual void *Resove(const std::string &name) override;
  26. protected:
  27. void LoadMotorTubeAngleCommunicateInterfaceIDs();
  28. void LoadMotorTubeHeightCommunicateInterfaceIDs();
  29. void LoadMotorTubeHorizontalCommunicateInterfaceIDs();
  30. void LoadSensorADTubeAngleCommunicateInterfaceIDs();
  31. void LoadSensorEncoderTubeAngleCommunicateInterfaceIDs();
  32. void LoadSensorADTubeHeightCommunicateInterfaceIDs();
  33. void LoadSensorEncoderTubeHeightCommunicateInterfaceIDs();
  34. void LoadSensorADDetectorHeightCommunicateInterfaceIDs();
  35. void LoadSensorEncoderDetectorHeightCommunicateInterfaceIDs();
  36. void LoadSensorADTubeHorizontalCommunicateInterfaceIDs();
  37. void LoadSensorEncoderTubeHorizontalCommunicateInterfaceIDs();
  38. void LoadExposureCommunicateInterfaceIDs();
  39. void LoadLandmarkCommunicateInterfaceIDs();
  40. void LoadOutputSignalInterfaceIDs();
  41. void LoadSensorADDetectorHorizontalCommunicateInterfaceIDs();
  42. void LoadSensorEncoderDetectorHorizontalCommunicateInterfaceIDs();
  43. private:
  44. void CreateComponents();
  45. void DistributeServoDrive();
  46. void SetFilterTimeOnComponents();
  47. void SetupAutouploadOnComponents();
  48. void SetupTubeAngleLimition();
  49. void SetupExposureTrigger();
  50. void SetupTubeAD();
  51. void SetupMotorBrake();
  52. void SetAttribute(GPIO_DI_ID ID, GPIO_DI_PARAM param);
  53. void SetAutoUpload(GPIO_DI_ID ID, GPIO_DI_PARAM param);
  54. private:
  55. static MachineryManager *m_instance;
  56. ICommunicateEntity *m_communicate;
  57. IMechnicalComponentFactory *m_mechnicalFactory;
  58. ITubeAngleController *m_motorTubeAngle;
  59. ITubeHeightController *m_motorTubeHeight;
  60. ISensorADController *m_adTubeAngle;
  61. ISensorADController *m_adTubeHeight;
  62. ISensorADController *m_adDetectorHeight;
  63. ISensorEncoderController *m_encoderTubeAngle;
  64. ISensorEncoderController *m_encoderTubeHeight;
  65. ISensorEncoderController *m_encoderDetectorHeight;
  66. IExposureController *m_exposure;
  67. ILandmarkController *m_landmark;
  68. ICollimatorController *m_collimator;
  69. IOutputController* m_tubeLineMotionSwitch;
  70. //ITubeHorizontalController* m_motorTubeHorizontal;
  71. ITubeHeightController* m_motorTubeHorizontal;
  72. ISensorADController* m_adTubeHorizontal;
  73. ISensorEncoderController* m_encoderTubeHorizontal;
  74. ISensorADController* m_adDetectorHorizontal;
  75. };
  76. }