12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #pragma once
- #include "IMotionModel.h"
- namespace DiosCtrlBox
- {
- class ResetMotionStageArgs;
- class ITubeAngleController;
- class ITubeHeightController;
- class ISensorADController;
- class ISensorEncoderController;
- class ILandmarkController;
- class ResetMotionModel : public IMotionModel
- {
- public:
- ResetMotionModel();
- ~ResetMotionModel();
- 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;
- private:
- void OnMotionStage(const std::string &name);
- void OnStageClearParams();
- void OnStageTubeAngleMoveToLandmark();
- void OnStageTubeHeightMoveToLandmark();
- void OnStageTubeAngleFindLandmark();
- void OnStageTubeHeightFindLandmark();
- void OnStageTubeAngleStopAtLandmark();
- void OnStageTubeHeightStopAtLandmark();
- void OnStageTubeAngleGoOutOfLowLandmark();
- void OnStageTubeAngleGoOutOfHighLandmark();
- void OnStageTubeHeightGoOutOfLowLandmark();
- void OnStageTubeHeightGoOutOfHighLandmark();
- void OnStageTubeAngleAttachZAxis();
- void OnStageTubeHeightAttachZAxis();
- void OnStageTubeAngleDetachZAxis();
- void OnStageTubeHeightDetachZAxis();
- void OnStageTubeAngleFindZAxis();
- void OnStageTubeHeightFindZAxis();
- void OnStageTubeAngleStopAtZAxis();
- void OnStageTubeHeightStopAtZxis();
- void OnStageTubeAngleFinishReset();
- void OnStageTubeHeightFinishReset();
- void OnStageStopMove();
- int JudgeTubeRotateLandmarkDirection();
- int JudgeTubeHeightLandmarkDirection();
- float GetTubeRotateResetPosition();
- int JudgeRotateDirection(float currentAngle, float targetAngle);
- int JudgeHeightDirection(float currentHeight,float targetHeight);
- int ComputeTubeAngleZToLandmarkRotateDirection();
- int ComputeTubeHeightZToLandmarkMoveDirection();
- BOOL IsTubeAngleAtResetLandmark();
- BOOL IsTubeHeightAtResetLandmark();
- private:
- std::string m_StageName;
- ResetMotionStageArgs *m_stageArgs;
- IPositionManager *m_coordinates;
- ITubeAngleController *m_motorTubeAngle;
- ITubeHeightController *m_motorTubeHeight;
- ISensorADController *m_adDetectorHeight;
- ISensorEncoderController *m_encoderTubeAngle;
- ISensorEncoderController *m_encoderTubeHeight;
- ILandmarkController *m_landmark;
- DWORD m_resetRotatePeriod;
- DWORD m_resetHeightPeriod;
- int m_tubeRotateLandmarkDirection;
- int m_tubeHeightLandmarkDirection;
- float m_tubeRotateResetAngle;
- int m_tubeHeightAxisPositiveDirection;
- int m_tubeRotateAxisPositiveDirection;
- };
- }
|