#include <MyMip.h>
Public Member Functions | |
MyMip (MipManager *mm, const std::string &device, int baudrate, int deviceid) | |
Constructor. | |
void | Initialize () |
Initialize. | |
void | Terminate () |
Terminate. | |
virtual void | OnReceivedReadAxisStatus (int cmdid, eAxisStatusFlags status) |
virtual void | OnReceivedReadError (int cmdid, eError error) |
virtual void | OnReceivedClearError (int cmdid) |
virtual void | OnReceivedReadWarning (int cmdid, eWarning warning) |
virtual void | OnReceivedClearWarning (int cmdid) |
virtual void | OnReceivedReadVersion (int cmdid, int command_interpreter_version, int runtime_library_version, int hardware_revision, int bootrom_version, int application_number, int application_version) |
virtual void | OnReceivedSetPosVelocity (int cmdid) |
virtual void | OnReceivedSetWaitMode (int cmdid) |
virtual void | OnReceivedMoveAbsolute (int cmdid) |
virtual void | OnReceivedMoveRelative (int cmdid) |
virtual void | OnReceivedStopMotion (int cmdid) |
virtual void | OnReceivedFindHomeSys (int cmdid) |
virtual void | OnReceivedReadPosition (int cmdid, int position) |
virtual void | OnReceivedReadVelocity (int cmdid, int position) |
virtual void | OnReceivedReadVelocityMean (int cmdid, int position) |
virtual void | OnReceivedReadCurrent (int cmdid, int position) |
virtual void | OnReceivedCheckCRC (int cmdid, bool ok, int crc) |
void | OnEvent () |
int | AngleToPosition (double angle) |
Converts positions to angles. | |
double | PositionToAngle (int position) |
Converts angles to positions. | |
double | ShortestAngle (double anglemust, double anglenow) |
Returns the angle associated with the shortest motor movement. | |
double | DegToRad (double angle) |
Converts degrees to radians. | |
double | RadToDeg (double angle) |
Converts radians to degrees. |
This class implements the desired functionality. It sends commands to the MIP device and processes the received replies. Furthermore, it periodically checks the motor control status.