Improve error reporting e.g. with bad axis number

This commit is contained in:
Peter Denison
2007-09-20 10:34:47 +00:00
parent 4e83896390
commit 98f2ba3854
+26 -10
View File
@@ -11,9 +11,9 @@
* Notwithstanding the above, explicit permission is granted for APS to
* redistribute this software.
*
* Version: $Revision: 1.20 $
* Version: $Revision: 1.21 $
* Modified by: $Author: peterd $
* Last Modified: $Date: 2007-09-18 12:41:59 $
* Last Modified: $Date: 2007-09-20 10:34:47 $
*
* Original Author: Peter Denison
* Current Author: Peter Denison
@@ -252,8 +252,13 @@ static long init_record(struct motorRecord * pmr )
resolution);
*/
pasynUser->reason = motorStatus;
pPvt->pasynMotorStatus->read(pPvt->asynMotorStatusPvt, pasynUser,
&pPvt->status);
status = pPvt->pasynMotorStatus->read(pPvt->asynMotorStatusPvt, pasynUser,
&pPvt->status);
if (status != asynSuccess) {
asynPrint(pasynUser, ASYN_TRACE_ERROR,
"%s devMotorAsyn.c::init_record: pasynMotorStatus->read "
"returned %s", pmr->name, pasynUser->errorMessage);
}
pasynManager->freeAsynUser(pasynUser);
pPvt->needUpdate = 1;
@@ -471,8 +476,14 @@ static void asynCallback(asynUser *pasynUser)
switch (pmsg->command) {
case motorStatus:
/* Read the current status of the device */
pPvt->pasynMotorStatus->read(pPvt->asynMotorStatusPvt, pasynUser,
&pPvt->status);
status = pPvt->pasynMotorStatus->read(pPvt->asynMotorStatusPvt,
pasynUser,
&pPvt->status);
if (status != asynSuccess) {
asynPrint(pasynUser, ASYN_TRACE_ERROR,
"devMotorAsyn::asynCallback: %s pasynMotorStatus->read"
"returned %s\n", pmr->name, pasynUser->errorMessage);
}
break;
case motorMoveAbs:
@@ -482,12 +493,17 @@ static void asynCallback(asynUser *pasynUser)
/* Intentional fall-through */
default:
if (pmsg->interface == int32Type) {
pPvt->pasynInt32->write(pPvt->asynInt32Pvt, pasynUser,
pmsg->ivalue);
status = pPvt->pasynInt32->write(pPvt->asynInt32Pvt, pasynUser,
pmsg->ivalue);
} else {
pPvt->pasynFloat64->write(pPvt->asynFloat64Pvt, pasynUser,
pmsg->dvalue);
status = pPvt->pasynFloat64->write(pPvt->asynFloat64Pvt, pasynUser,
pmsg->dvalue);
}
if (status != asynSuccess) {
asynPrint(pasynUser, ASYN_TRACE_ERROR,
"devMotorAsyn::asynCallback: %s pasyn{Float64,Int32}->"
"write returned %s\n", pmr->name, pasynUser->errorMessage);
}
break;
}