Files
sinqepicsapp/sinqEPICSApp/src/EL734Driver.h
koennecke af4d16d25f Implemented a feature which allows for an additional field for having a text message
with a motor axis. To this purpose a new derived class SINQAxis and SINQController were
added which other drivers using this feature can derive from. The proof of concept and
test platform is the EL734 driver.
2017-03-20 16:40:25 +01:00

61 lines
1.6 KiB
C++

/*
FILENAME... EL734Driver.h
USAGE... Motor driver support for the PSI EL734 controller.
Mark Koennecke
February 2013
*/
#include "SINQController.h"
#include "SINQAxis.h"
#define MAX_EL734_AXES 12
#define COMLEN 80
class EL734Axis : public SINQAxis
{
public:
/* These are the methods we override from the base class */
EL734Axis(class EL734Controller *pC, int axis);
void report(FILE *fp, int level);
asynStatus move(double position, int relative, double min_velocity, double max_velocity, double acceleration);
asynStatus moveVelocity(double min_velocity, double max_velocity, double acceleration);
asynStatus home(double min_velocity, double max_velocity, double acceleration, int forwards);
asynStatus stop(double acceleration);
asynStatus poll(bool *moving);
asynStatus setPosition(double position);
asynStatus setClosedLoop(bool closedLoop);
private:
EL734Controller *pC_; /**< Pointer to the asynMotorController to which this axis belongs.
* Abbreviated because it is used very frequently */
int oredMSR;
double position;
int homing;
time_t next_poll;
int ErrTxtIdx;
void forwardErrorTxt(EL734Axis *axis);
friend class EL734Controller;
};
class EL734Controller : public SINQController {
public:
EL734Controller(const char *portName, const char *EL734PortName, int numAxes);
void report(FILE *fp, int level);
EL734Axis* getAxis(asynUser *pasynUser);
EL734Axis* getAxis(int axisNo);
friend class EL734Axis;
private:
asynUser *pasynUserController_;
asynStatus transactController(char command[COMLEN], char reply[COMLEN]);
void switchRemote();
};