123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- #ifndef IAXISMANAGER_H
- #define IAXISMANAGER_H
- #include "JAxis.h"
- #include "ICoord.h"
- #include <map>
- enum emum_Wait_Action
- {
- WAIT = 0,
- NO_WAIT
- };
- enum Response_Status
- {
- Response_OK = 0,
- Response_Abort,
- Response_Error,
- };
- struct ProcessResponse
- {
- Response_Status eStatus = Response_OK;
- int ErrorCode = 0;
- std::string sErrorMessage = "";
- };
- enum emum_Interlock_Axis_Action
- {
- ALARM,
-
- TRIGGER,
- COMPEL
- };
- enum Collision_Detect_Mode
- {
- ColDetect_BothAvoid,
- ColDetect_OverAvoid_AroundInhibit,
- ColDetect_BothInhibit,
- ColDetect_BothInhibit_Manual,
- ColDetect_Disable
- };
- class IAxisManager
- {
- public:
- IAxisManager(){};
- ~IAxisManager(){};
-
- virtual ProcessResponse Init(std::map<std::string,JAxis*> &mpAxis, std::map<std::string,ICoord*> &mpCoord) = 0;
-
- virtual ProcessResponse Exit() = 0;
-
-
- virtual ProcessResponse SetMotionTimeOut(int nTime_ms) = 0;
- virtual ProcessResponse ClearMotionTimeOut() = 0;
-
- virtual ProcessResponse SetEmergencyStopStatus(bool bStatus) = 0;
-
- virtual ProcessResponse SetAxisVel(std::string sAxisName, double dVelRatio) = 0;
-
- virtual ProcessResponse SetAxisVelAcc(std::string sAxisName, double dVelRatio) = 0;
-
- virtual ProcessResponse SetAxisAcc(std::string sAxisName, double dVelOrAccRatio, bool bIsAccRatio = false) = 0;
-
-
- virtual ProcessResponse GetAxisStatus(std::string sAxisName,AxisStatus& stAxisStatus) = 0;
-
- virtual double GetAxisActualPos(std::string sAxisName,ProcessResponse &stResponse) = 0;
-
- virtual double GetAxisActualVel(std::string sAxisName,ProcessResponse &stResponse) = 0;
-
- virtual double GetAxisActualAcc(std::string sAxisName,ProcessResponse &stResponse) = 0;
-
- virtual ProcessResponse WaitForMotionComplete(JAxis* pAxis, int nMonitorInterval, const bool& bStop = false,
- bool bInstantStopMode = false) = 0;
-
- virtual ProcessResponse CheckAxisStatus(std::string sAxisName) = 0;
-
- virtual bool isEmergencyStop(std::string sAxisName) = 0;
-
-
- virtual ProcessResponse MoveToTrap( std::string sAxisName,double dPosOrDist,double dVelRatio,
- emum_Wait_Action eWaitAction,const bool& bStop = false) = 0;
-
- virtual ProcessResponse MoveToGear(std::string sAxisName,std::string sMasterName,double dPosOrDist,
- long nMasterEven,long nSlaveEven,long nSlopeOrFollowDis = 0) = 0;
-
- virtual ProcessResponse MoveToFollow(std::string sAxisName,std::string sMasterName,double dPosOrDist,
- long nMasterEven,long nSlaveEven,long nSlopeOrFollowDis = 0) = 0;
-
- virtual ProcessResponse MoveTrap( std::string sAxisName,double dPosOrDist,double dVelRatio,emum_Wait_Action eWaitAction) = 0;
-
- virtual ProcessResponse Jog(std::string sAxisName,double dVelRatio) = 0;
-
- virtual ProcessResponse MoveGear(std::string sAxisName,std::string sMasterName,double dPosOrDist,
- long nMasterEven,long nSlaveEven,long nSlopeOrFollowDis = 0) = 0;
-
- virtual ProcessResponse MoveFollow(std::string sAxisName,std::string sMasterName,double dPosOrDist,
- long nMasterEven,long nSlaveEven,long nSlopeOrFollowDis = 0) = 0;
-
- virtual ProcessResponse AxisHoming(std::string sAxisName, const bool& bStop = false) = 0;
-
-
- virtual ProcessResponse SetCrdSynAllRatio(double dVelRatio) = 0;
-
- virtual ProcessResponse SetCrdSynVelRatio(double dVelRatio) = 0;
-
-
- virtual ProcessResponse XYMoveTo(std::string sCrdName,double dXPos, double dYPos, bool& bExit, bool bWaitStop) = 0;
- virtual ProcessResponse XYZMoveTo(std::string sCrdName,double dXPos, double dYPos, double dZPos, bool& bExit, bool bWaitStop) = 0;
- virtual ProcessResponse XYRMoveTo(std::string sCrdName,double dXPos, double dYPos, double dRPos,bool& bExit, bool bWaitStop) = 0;
- virtual ProcessResponse XYZRMoveTo(std::string sCrdName,double dXPos, double dYPos, double dZPos,double dRPos,bool& bExit,
- bool bWaitStop) = 0;
- virtual ProcessResponse XZMoveTo(std::string sCrdName,double dXPos, double dZPos, bool& bExit, bool bWaitStop) = 0;
- virtual ProcessResponse XRMoveTo(std::string sCrdName,double dXPos, double dRPos, bool& bExit, bool bWaitStop) = 0;
- virtual ProcessResponse XZRMoveTo(std::string sCrdName,double dXPos, double dZPos, double dRPos, bool& bExit, bool bWaitStop) = 0;
- virtual ProcessResponse YZMoveTo(std::string sCrdName,double dYPos, double dZPos, bool& bExit, bool bWaitStop) = 0;
- virtual ProcessResponse YRMoveTo(std::string sCrdName,double dYPos, double dRPos, bool& bExit, bool bWaitStop) = 0;
- virtual ProcessResponse YZRMoveTo(std::string sCrdName,double dYPos, double dZPos, double dRPos, bool& bExit, bool bWaitStop) = 0;
- virtual ProcessResponse ZRMoveTo(std::string sCrdName,double dZPos, double dRPos, bool& bExit, bool bWaitStop) = 0;
- };
- #endif
|