#pragma once #include "IMotionModel.h" namespace DIOS::Dev::Detail::MachineryECOM { class RADMotionStageArgs; class ITubeAngleController; class ITubeHeightController; class ISensorADController; class ISensorEncoderController; class ITubeHorizontalController; class IOutputController; class RADMotionModel : public IMotionModel { public: RADMotionModel(); ~RADMotionModel(); public: virtual void ChangeStage(const std::string &stageName) override; virtual std::string GetStageName() override; virtual IMotionStageArgs *GetStageArgs() override; public: virtual void Initialize(IMachineryManager *machineryManager, IPositionManager *coordinates) override; virtual void LoadMachineryParams(ResDataObject ¶ms) override; virtual void LoadModelParams(ResDataObject ¶ms) override; virtual void SetTechnicalParams(ResDataObject ¶ms) override; virtual void OnFeedbackMotionParams(ResDataObject ¶ms) override; virtual BOOL GetMotionParams(ResDataObject ¶ms) override; virtual void SwitchScanningComponents(int nSwitch) override; virtual void SwitchWorkstation(string ws) override; private: void OnMotionStage(const std::string &name); void OnStageClearParams(); void OnStageStopMove(); void OnStageCenterAdjust(); void OnMotionStageMoveTubeHeight(); void OnMotionStageMoveTubeHorizontal(); void OnMotionStageMoveTubeRotation(); void AlignTubeHeightToDetector(); void RotateTubeToExposure(); float GetExposureAngle(); int JudgeDirectionInTubeHeightAxis(float current, float target); int JudgeDirectionInTubeAngleAxis(float current, float target); void MoveTubeHeight(int direction, float offset); void RotateTubeAngle(int direction, float offset); int JudgeDirectionInTubeHorizontalAxis(float current, float target); void MoveTubeHorizontal(int direction, float offset); void OnMotionStageMove2SID(string ws); private: std::string m_StageName; RADMotionStageArgs *m_stageArgs; IPositionManager *m_coordinates; ITubeAngleController *m_motorTubeAngle; ITubeHeightController *m_motorTubeHeight; ISensorADController *m_adDetectorHeight; ISensorEncoderController *m_encoderTubeAngle; ISensorEncoderController *m_encoderTubeHeight; ResDataObject m_MachineryParams; ResDataObject m_technicalParams; //ITubeHorizontalController* m_motorTubeHorizontal; ITubeHeightController* m_motorTubeHorizontal; ISensorADController* m_adTubeHorizontal; ISensorEncoderController* m_encoderTubeHorizontal; IOutputController* m_tubeLineMotionSwitch; }; }