- Adapted indenation to new agreed upon system
- Added support for second generation scriptcontext based counter
This commit is contained in:
95
motor.h
95
motor.h
@ -16,63 +16,64 @@
|
||||
#include "hipadaba.h"
|
||||
|
||||
#define MOTOBPARLENGTH 12
|
||||
typedef struct __Motor {
|
||||
pObjectDescriptor pDescriptor;
|
||||
pHdb objectNode;
|
||||
pIDrivable pDrivInt;
|
||||
pICallBack pCall;
|
||||
int (*MotorSetPar)(struct __Motor *self, SConnection *pCon, char *name, float fVal);
|
||||
int (*MotorGetPar)(struct __Motor *self, char *name, float *fVal);
|
||||
int (*MotorGetHardPosition)(struct __Motor *self, SConnection *pCon, float *fVal);
|
||||
char *drivername;
|
||||
char *name;
|
||||
MotorDriver *pDriver;
|
||||
float fTarget;
|
||||
float fPosition;
|
||||
long endScriptID;
|
||||
int posCount; /* counter for calling the
|
||||
motor callback */
|
||||
int retryCount; /* for retries in status */
|
||||
int posFaultCount;
|
||||
int stopped;
|
||||
int errorCount;
|
||||
ObPar *ParArray;
|
||||
void *pPrivate;
|
||||
void (*KillPrivate)(void *);
|
||||
} Motor;
|
||||
typedef Motor *pMotor;
|
||||
typedef struct __Motor {
|
||||
pObjectDescriptor pDescriptor;
|
||||
pHdb objectNode;
|
||||
pIDrivable pDrivInt;
|
||||
pICallBack pCall;
|
||||
int (*MotorSetPar) (struct __Motor * self, SConnection * pCon,
|
||||
char *name, float fVal);
|
||||
int (*MotorGetPar) (struct __Motor * self, char *name, float *fVal);
|
||||
int (*MotorGetHardPosition) (struct __Motor * self, SConnection * pCon,
|
||||
float *fVal);
|
||||
char *drivername;
|
||||
char *name;
|
||||
MotorDriver *pDriver;
|
||||
float fTarget;
|
||||
float fPosition;
|
||||
long endScriptID;
|
||||
int posCount; /* counter for calling the
|
||||
motor callback */
|
||||
int retryCount; /* for retries in status */
|
||||
int posFaultCount;
|
||||
int stopped;
|
||||
int errorCount;
|
||||
ObPar *ParArray;
|
||||
void *pPrivate;
|
||||
void (*KillPrivate) (void *);
|
||||
} Motor;
|
||||
typedef Motor *pMotor;
|
||||
/*------------------------------------------------------------------------
|
||||
a tiny structure used in CallBack work
|
||||
--------------------------------------------------------------------------*/
|
||||
typedef struct {
|
||||
float fVal;
|
||||
char *pName;
|
||||
} MotCallback;
|
||||
/*-------------------------------------------------------------------------*/
|
||||
float fVal;
|
||||
char *pName;
|
||||
} MotCallback;
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/* parameter management */
|
||||
int MotorGetPar(pMotor self, char *name, float *fVal);
|
||||
int MotorSetPar(pMotor self, SConnection *pCon, char *name, float fVal);
|
||||
int MotorGetPar(pMotor self, char *name, float *fVal);
|
||||
int MotorSetPar(pMotor self, SConnection * pCon, char *name, float fVal);
|
||||
|
||||
/* driving */
|
||||
long MotorRun(void *self, SConnection *pCon, float fNew);
|
||||
int MotorCheckBoundary(pMotor self, float fVal, float *fHard,
|
||||
char *error, int iErrLen);
|
||||
|
||||
long MotorRun(void *self, SConnection * pCon, float fNew);
|
||||
int MotorCheckBoundary(pMotor self, float fVal, float *fHard,
|
||||
char *error, int iErrLen);
|
||||
|
||||
/* Where are we ? */
|
||||
int MotorGetSoftPosition(pMotor self,SConnection *pCon, float *fVal);
|
||||
int MotorGetHardPosition(pMotor self,SConnection *pCon, float *fVal);
|
||||
|
||||
int MotorGetSoftPosition(pMotor self, SConnection * pCon, float *fVal);
|
||||
int MotorGetHardPosition(pMotor self, SConnection * pCon, float *fVal);
|
||||
|
||||
/* creation */
|
||||
int MotorCreate(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
int argc, char *argv[]);
|
||||
pMotor MotorInit(char *drivername,char *name, MotorDriver *pDriv);
|
||||
void MotorKill(void *self);
|
||||
int MotorCreate(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
int argc, char *argv[]);
|
||||
pMotor MotorInit(char *drivername, char *name, MotorDriver * pDriv);
|
||||
void MotorKill(void *self);
|
||||
|
||||
/* interface to interpreter */
|
||||
int MotorAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
int argc, char *argv[]);
|
||||
pMotor FindMotor(SicsInterp *pSics, char *name);
|
||||
|
||||
#endif
|
||||
int MotorAction(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
int argc, char *argv[]);
|
||||
pMotor FindMotor(SicsInterp * pSics, char *name);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user