From 3b2862c045d7fd755cca01985ccdbd321ed27aea Mon Sep 17 00:00:00 2001 From: MarkRivers Date: Thu, 7 Apr 2011 03:34:47 +0000 Subject: [PATCH] Many changes to implement executeProfile --- motorApp/NewportSrc/XPSController.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/motorApp/NewportSrc/XPSController.h b/motorApp/NewportSrc/XPSController.h index 08fe20b9..ea0cf5d9 100644 --- a/motorApp/NewportSrc/XPSController.h +++ b/motorApp/NewportSrc/XPSController.h @@ -11,7 +11,8 @@ USAGE... Newport XPS EPICS asyn motor device driver #include "XPSAxis.h" #define XPS_MAX_AXES 8 -#define TCP_TIMEOUT 2.0 +#define XPS_POLL_TIMEOUT 2.0 +#define XPS_MOVE_TIMEOUT 100000.0 // "Forever" // drvInfo strings for extra parameters that the XPS controller supports #define XPSMinJerkString "XPS_MIN_JERK" @@ -37,19 +38,22 @@ class XPSController : public asynMotorController { void report(FILE *fp, int level); XPSAxis* getAxis(asynUser *pasynUser); XPSAxis* getAxis(int axisNo); + asynStatus poll(); /* These are the functions for profile moves */ asynStatus initializeProfile(size_t maxPoints, const char* ftpUsername, const char* ftpPassword); asynStatus buildProfile(); asynStatus executeProfile(); + asynStatus abortProfile(); asynStatus readbackProfile(); /* These are the methods that are new to this class */ + void profileThread(); + asynStatus runProfile(); + asynStatus waitMotors(); /* Deferred moves functions.*/ asynStatus processDeferredMoves(); asynStatus processDeferredMovesInGroup(char * groupName); - asynStatus enableSetPosition(int enable); - asynStatus setPositionSettlingTime(double sleepTime); protected: XPSAxis **pAxes_; /**< Array of pointers to axis objects */ @@ -67,12 +71,8 @@ class XPSController : public asynMotorController { #define LAST_XPS_PARAM XPSStatus_ private: - int enableSetPosition_; /**< This is controlled via the XPSEnableSetPosition function (available via the IOC shell). */ - - /** Parameter to control the sleep time used when setting position. - * A function called XPSSetPositionSettlingTime(XPS, int) (millisec parameter) - * is available in the IOC shell to control this. */ - double setPositionSettlingTime_; + bool enableSetPosition_; /**< Enable/disable setting the position from EPICS */ + double setPositionSettlingTime_; /**< The settling (sleep) time used when setting position. */ char *IPAddress_; int IPPort_; char *ftpUsername_; @@ -81,7 +81,8 @@ class XPSController : public asynMotorController { int moveSocket_; char firmwareVersion_[100]; int movesDeferred_; - + epicsEventId profileExecuteEvent_; + friend class XPSAxis; }; #define NUM_XPS_PARAMS (&LAST_XPS_PARAM - &FIRST_XPS_PARAM + 1)