Minor changes to casting self, implementation of Fix
r1038 | dcl | 2006-08-02 16:19:22 +1000 (Wed, 02 Aug 2006) | 2 lines
This commit is contained in:
@ -81,7 +81,7 @@ typedef struct {
|
|||||||
static int MonGetStatus(CounterDriver *cntrData, float *fControl) {
|
static int MonGetStatus(CounterDriver *cntrData, float *fControl) {
|
||||||
BeamMon *self = NULL;
|
BeamMon *self = NULL;
|
||||||
|
|
||||||
self = (BeamMon *) cntrData;
|
self = (BeamMon *) cntrData->pData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief Starts counting in the current mode and with the current preset
|
/** \brief Starts counting in the current mode and with the current preset
|
||||||
@ -91,7 +91,7 @@ static int MonGetStatus(CounterDriver *cntrData, float *fControl) {
|
|||||||
static int MonStart(CounterDriver *cntrData) {
|
static int MonStart(CounterDriver *cntrData) {
|
||||||
BeamMon *self = NULL;
|
BeamMon *self = NULL;
|
||||||
|
|
||||||
self = (BeamMon *) cntrData;
|
self = (BeamMon *) cntrData->pData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief Pauses a counting operation
|
/** \brief Pauses a counting operation
|
||||||
@ -101,7 +101,7 @@ static int MonStart(CounterDriver *cntrData) {
|
|||||||
static int MonPause(CounterDriver *cntrData) {
|
static int MonPause(CounterDriver *cntrData) {
|
||||||
BeamMon *self = NULL;
|
BeamMon *self = NULL;
|
||||||
|
|
||||||
self = (BeamMon *) cntrData;
|
self = (BeamMon *) cntrData->pData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* \brief Continues a paused counting operation.
|
/* \brief Continues a paused counting operation.
|
||||||
@ -111,7 +111,7 @@ static int MonPause(CounterDriver *cntrData) {
|
|||||||
static int MonContinue(CounterDriver *cntrData) {
|
static int MonContinue(CounterDriver *cntrData) {
|
||||||
BeamMon *self = NULL;
|
BeamMon *self = NULL;
|
||||||
|
|
||||||
self = (BeamMon *) cntrData;
|
self = (BeamMon *) cntrData->pData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief Cancels a counting operation. This is an emergency stop used when interrupting an operation.
|
/** \brief Cancels a counting operation. This is an emergency stop used when interrupting an operation.
|
||||||
@ -120,7 +120,7 @@ static int MonContinue(CounterDriver *cntrData) {
|
|||||||
static int MonHalt(CounterDriver *cntrData) {
|
static int MonHalt(CounterDriver *cntrData) {
|
||||||
BeamMon *self = NULL;
|
BeamMon *self = NULL;
|
||||||
|
|
||||||
self = (BeamMon *) cntrData;
|
self = (BeamMon *) cntrData->pData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief Reads the counter and the monitors in the lCounts array.
|
/** \brief Reads the counter and the monitors in the lCounts array.
|
||||||
@ -130,7 +130,7 @@ static int MonHalt(CounterDriver *cntrData) {
|
|||||||
static int MonReadValues(CounterDriver *cntrData) {
|
static int MonReadValues(CounterDriver *cntrData) {
|
||||||
BeamMon *self = NULL;
|
BeamMon *self = NULL;
|
||||||
|
|
||||||
self = (BeamMon *) cntrData;
|
self = (BeamMon *) cntrData->pData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* \brief Called when an error condition is reported by a counter operation.
|
/* \brief Called when an error condition is reported by a counter operation.
|
||||||
@ -143,7 +143,7 @@ static int MonReadValues(CounterDriver *cntrData) {
|
|||||||
static int MonGetError(CounterDriver *cntrData, int *iCode, char *error, int iErrLen) {
|
static int MonGetError(CounterDriver *cntrData, int *iCode, char *error, int iErrLen) {
|
||||||
BeamMon *self = NULL;
|
BeamMon *self = NULL;
|
||||||
|
|
||||||
self = (BeamMon *) cntrData;
|
self = (BeamMon *) cntrData->pData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* \brief Tries to fix problem associated with iCode error reported by MonGetError.
|
/* \brief Tries to fix problem associated with iCode error reported by MonGetError.
|
||||||
@ -157,7 +157,15 @@ static int MonGetError(CounterDriver *cntrData, int *iCode, char *error, int iEr
|
|||||||
static int MonTryAndFixIt(CounterDriver *cntrData, int iCode) {
|
static int MonTryAndFixIt(CounterDriver *cntrData, int iCode) {
|
||||||
BeamMon *self = NULL;
|
BeamMon *self = NULL;
|
||||||
|
|
||||||
self = (BeamMon *) cntrData;
|
self = (BeamMon *) cntrData->pData;
|
||||||
|
assert(self != NULL);
|
||||||
|
|
||||||
|
switch(iCode){
|
||||||
|
case NOTCONNECTED:
|
||||||
|
initRS232(self->controller);
|
||||||
|
return COREDO;
|
||||||
|
}
|
||||||
|
return COTERM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*\brief Sets a parameter to a given value.
|
/*\brief Sets a parameter to a given value.
|
||||||
@ -169,7 +177,7 @@ static int MonTryAndFixIt(CounterDriver *cntrData, int iCode) {
|
|||||||
static int MonSet(CounterDriver *cntrData, char *name, int iCter, float FVal) {
|
static int MonSet(CounterDriver *cntrData, char *name, int iCter, float FVal) {
|
||||||
BeamMon *self = NULL;
|
BeamMon *self = NULL;
|
||||||
|
|
||||||
self = cntrData->pData;
|
self = (BeamMon *) cntrData->pData;
|
||||||
if(strcmp(name,"threshold") == 0){
|
if(strcmp(name,"threshold") == 0){
|
||||||
//TODO set threshold
|
//TODO set threshold
|
||||||
self->dummy_threshold = FVal;
|
self->dummy_threshold = FVal;
|
||||||
@ -179,7 +187,7 @@ static int MonSet(CounterDriver *cntrData, char *name, int iCter, float FVal) {
|
|||||||
static int MonGet(CounterDriver *cntrData, char *name, int iCter, float *fVal) {
|
static int MonGet(CounterDriver *cntrData, char *name, int iCter, float *fVal) {
|
||||||
BeamMon *self = NULL;
|
BeamMon *self = NULL;
|
||||||
|
|
||||||
self = cntrData->pData;
|
self = (BeamMon *) cntrData->pData;
|
||||||
if(strcmp(name,"threshold") == 0){
|
if(strcmp(name,"threshold") == 0){
|
||||||
//TODO get threshold
|
//TODO get threshold
|
||||||
*fVal = self->dummy_threshold;
|
*fVal = self->dummy_threshold;
|
||||||
@ -191,7 +199,7 @@ static int MonGet(CounterDriver *cntrData, char *name, int iCter, float *fVal) {
|
|||||||
static int MonSend(CounterDriver *cntrData, char *pText, char *pReply, int iReplyLen) {
|
static int MonSend(CounterDriver *cntrData, char *pText, char *pReply, int iReplyLen) {
|
||||||
BeamMon *self = NULL;
|
BeamMon *self = NULL;
|
||||||
|
|
||||||
self = (BeamMon *) cntrData;
|
self = (BeamMon *) cntrData->pData;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void KillMon(pCounterDriver self) {
|
static void KillMon(pCounterDriver self) {
|
||||||
|
Reference in New Issue
Block a user