Change strcmp to strcasecmp to fix case sensitivity issue in hipadaba hget
r1748 | dcl | 2007-03-30 18:40:48 +1000 (Fri, 30 Mar 2007) | 2 lines
This commit is contained in:
@@ -1348,7 +1348,7 @@ int DMC2280GetTextPar(void *pData, char *name, char *textPar) {
|
||||
|
||||
self = (pDMC2280Driv)pData;
|
||||
|
||||
if(strcmp(name,UNITS) == 0) {
|
||||
if(strcasecmp(name,UNITS) == 0) {
|
||||
snprintf(textPar, UNITSLEN, self->units);
|
||||
return 1;
|
||||
}
|
||||
@@ -1382,76 +1382,76 @@ static int DMC2280GetPar(void *pData, char *name,
|
||||
self = (pDMC2280Driv)pData;
|
||||
|
||||
/* XXX Maybe move this to a configuration parameter.*/
|
||||
if(strcmp(name,HOME) == 0) {
|
||||
if(strcasecmp(name,HOME) == 0) {
|
||||
*fValue = self->home;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,HARDLOWERLIM) == 0) {
|
||||
if(strcasecmp(name,HARDLOWERLIM) == 0) {
|
||||
*fValue = self->fLower;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,HARDUPPERLIM) == 0) {
|
||||
if(strcasecmp(name,HARDUPPERLIM) == 0) {
|
||||
*fValue = self->fUpper;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,SPEED) == 0) {
|
||||
if(strcasecmp(name,SPEED) == 0) {
|
||||
*fValue = self->speed;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,MAXSPEED) == 0) {
|
||||
if(strcasecmp(name,MAXSPEED) == 0) {
|
||||
*fValue = self->maxSpeed;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,ACCEL) == 0) {
|
||||
if(strcasecmp(name,ACCEL) == 0) {
|
||||
*fValue = self->accel;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,MAXACCEL) == 0) {
|
||||
if(strcasecmp(name,MAXACCEL) == 0) {
|
||||
*fValue = self->maxAccel;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,DECEL) == 0) {
|
||||
if(strcasecmp(name,DECEL) == 0) {
|
||||
*fValue = self->decel;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,MAXDECEL) == 0) {
|
||||
if(strcasecmp(name,MAXDECEL) == 0) {
|
||||
*fValue = self->maxDecel;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,MOTOFFDELAY) == 0) {
|
||||
if(strcasecmp(name,MOTOFFDELAY) == 0) {
|
||||
*fValue = self->motOffDelay;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,"debug") == 0) {
|
||||
if(strcasecmp(name,"debug") == 0) {
|
||||
*fValue = self->debug;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,SETTLE) == 0) {
|
||||
if(strcasecmp(name,SETTLE) == 0) {
|
||||
*fValue = self->settle;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,AIRPADS) == 0) {
|
||||
if(strcasecmp(name,AIRPADS) == 0) {
|
||||
*fValue = self->has_airpads;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,BLOCKAGE_CHECK_INTERVAL) == 0) {
|
||||
if(strcasecmp(name,BLOCKAGE_CHECK_INTERVAL) == 0) {
|
||||
*fValue = self->blockage_ckInterval;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,"blockage_thresh") == 0) {
|
||||
if(strcasecmp(name,"blockage_thresh") == 0) {
|
||||
*fValue = self->blockage_thresh;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,"blockage_ratio") == 0) {
|
||||
if(strcasecmp(name,"blockage_ratio") == 0) {
|
||||
*fValue = self->blockage_ratio;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,"blockage_fail") == 0) {
|
||||
if(strcasecmp(name,"blockage_fail") == 0) {
|
||||
*fValue = self->blockage_fail;
|
||||
return 1;
|
||||
}
|
||||
if (self->abs_endcoder != 0) {
|
||||
if (strcmp(name,"absenc") == 0) {
|
||||
if (strcasecmp(name,"absenc") == 0) {
|
||||
if (readAbsEnc(self, fValue) == SUCCESS)
|
||||
return 1;
|
||||
else
|
||||
@@ -1459,28 +1459,28 @@ static int DMC2280GetPar(void *pData, char *name,
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (strcmp(name,"homerun") == 0) {
|
||||
if (strcasecmp(name,"homerun") == 0) {
|
||||
if (readHomeRun(self, fValue) == SUCCESS)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if(strcmp(name,"thread0") == 0)
|
||||
if(strcasecmp(name,"thread0") == 0)
|
||||
return ReadThread(self, 0, fValue);
|
||||
if(strcmp(name,"thread1") == 0)
|
||||
if(strcasecmp(name,"thread1") == 0)
|
||||
return ReadThread(self, 1, fValue);
|
||||
if(strcmp(name,"thread2") == 0)
|
||||
if(strcasecmp(name,"thread2") == 0)
|
||||
return ReadThread(self, 2, fValue);
|
||||
if(strcmp(name,"thread3") == 0)
|
||||
if(strcasecmp(name,"thread3") == 0)
|
||||
return ReadThread(self, 3, fValue);
|
||||
if(strcmp(name,"thread4") == 0)
|
||||
if(strcasecmp(name,"thread4") == 0)
|
||||
return ReadThread(self, 4, fValue);
|
||||
if(strcmp(name,"thread5") == 0)
|
||||
if(strcasecmp(name,"thread5") == 0)
|
||||
return ReadThread(self, 5, fValue);
|
||||
if(strcmp(name,"thread6") == 0)
|
||||
if(strcasecmp(name,"thread6") == 0)
|
||||
return ReadThread(self, 6, fValue);
|
||||
if(strcmp(name,"thread7") == 0)
|
||||
if(strcasecmp(name,"thread7") == 0)
|
||||
return ReadThread(self, 7, fValue);
|
||||
return 0;
|
||||
}
|
||||
@@ -1509,7 +1509,7 @@ static int DMC2280SetPar(void *pData, SConnection *pCon,
|
||||
|
||||
/* XXX Maybe move this to a configuration parameter.*/
|
||||
/* Set home, managers only. Users should set softposition */
|
||||
if(strcmp(name,HOME) == 0) {
|
||||
if(strcasecmp(name,HOME) == 0) {
|
||||
if(!SCMatchRights(pCon,usMugger))
|
||||
return 1;
|
||||
else {
|
||||
@@ -1528,7 +1528,7 @@ static int DMC2280SetPar(void *pData, SConnection *pCon,
|
||||
}
|
||||
}
|
||||
|
||||
if(strcmp(name,SETPOS) == 0) {
|
||||
if(strcasecmp(name,SETPOS) == 0) {
|
||||
if (self->pMot == NULL)
|
||||
self->pMot = FindMotor(pServ->pSics, self->name);
|
||||
MotorGetPar(self->pMot,"softzero",&oldZero);
|
||||
@@ -1538,7 +1538,7 @@ static int DMC2280SetPar(void *pData, SConnection *pCon,
|
||||
}
|
||||
|
||||
/* Set motor off delay, managers only */
|
||||
if(strcmp(name,MOTOFFDELAY) == 0) {
|
||||
if(strcasecmp(name,MOTOFFDELAY) == 0) {
|
||||
if(!SCMatchRights(pCon,usMugger))
|
||||
return 1;
|
||||
else {
|
||||
@@ -1548,7 +1548,7 @@ static int DMC2280SetPar(void *pData, SConnection *pCon,
|
||||
}
|
||||
|
||||
/* Debug, managers only */
|
||||
if(strcmp(name,"debug") == 0) {
|
||||
if(strcasecmp(name,"debug") == 0) {
|
||||
if(!SCMatchRights(pCon,usMugger))
|
||||
return 1;
|
||||
else {
|
||||
@@ -1558,7 +1558,7 @@ static int DMC2280SetPar(void *pData, SConnection *pCon,
|
||||
}
|
||||
|
||||
/* Setttle, managers only */
|
||||
if(strcmp(name,SETTLE) == 0) {
|
||||
if(strcasecmp(name,SETTLE) == 0) {
|
||||
if(!SCMatchRights(pCon,usMugger))
|
||||
return 1;
|
||||
else {
|
||||
@@ -1568,7 +1568,7 @@ static int DMC2280SetPar(void *pData, SConnection *pCon,
|
||||
}
|
||||
|
||||
/* Set airpads, managers only */
|
||||
if(strcmp(name,AIRPADS) == 0) {
|
||||
if(strcasecmp(name,AIRPADS) == 0) {
|
||||
if(!SCMatchRights(pCon,usMugger))
|
||||
return 1;
|
||||
else {
|
||||
@@ -1579,7 +1579,7 @@ static int DMC2280SetPar(void *pData, SConnection *pCon,
|
||||
|
||||
/* Set interval between blocked motor checks,
|
||||
* managers only */
|
||||
if(strcmp(name,BLOCKAGE_CHECK_INTERVAL) == 0) {
|
||||
if(strcasecmp(name,BLOCKAGE_CHECK_INTERVAL) == 0) {
|
||||
if(!SCMatchRights(pCon,usMugger))
|
||||
return 1;
|
||||
else {
|
||||
@@ -1590,7 +1590,7 @@ static int DMC2280SetPar(void *pData, SConnection *pCon,
|
||||
|
||||
/* Set movement threshold for blocked motor checks,
|
||||
* managers only */
|
||||
if(strcmp(name,"blockage_thresh") == 0) {
|
||||
if(strcasecmp(name,"blockage_thresh") == 0) {
|
||||
if(!SCMatchRights(pCon,usMugger))
|
||||
return 1;
|
||||
else {
|
||||
@@ -1601,7 +1601,7 @@ static int DMC2280SetPar(void *pData, SConnection *pCon,
|
||||
|
||||
/* Set ratio for blocked motor checks,
|
||||
* managers only */
|
||||
if(strcmp(name,"blockage_ratio") == 0) {
|
||||
if(strcasecmp(name,"blockage_ratio") == 0) {
|
||||
if(!SCMatchRights(pCon,usMugger))
|
||||
return 1;
|
||||
else {
|
||||
@@ -1612,7 +1612,7 @@ static int DMC2280SetPar(void *pData, SConnection *pCon,
|
||||
|
||||
/* Set blocked motor checks failure mode,
|
||||
* managers only */
|
||||
if(strcmp(name,"blockage_fail") == 0) {
|
||||
if(strcasecmp(name,"blockage_fail") == 0) {
|
||||
if(!SCMatchRights(pCon,usMugger))
|
||||
return 1;
|
||||
else {
|
||||
@@ -1623,7 +1623,7 @@ static int DMC2280SetPar(void *pData, SConnection *pCon,
|
||||
|
||||
/* Invoke Home Run routine in controller,
|
||||
* managers only */
|
||||
if(self->abs_endcoder == 0 && strcmp(name,"homerun") == 0) {
|
||||
if(self->abs_endcoder == 0 && strcasecmp(name,"homerun") == 0) {
|
||||
if(!SCMatchRights(pCon,usMugger))
|
||||
return 1;
|
||||
else {
|
||||
@@ -1637,7 +1637,7 @@ static int DMC2280SetPar(void *pData, SConnection *pCon,
|
||||
}
|
||||
|
||||
/* Set speed */
|
||||
if(strcmp(name,SPEED) == 0) {
|
||||
if(strcasecmp(name,SPEED) == 0) {
|
||||
if ((0.0 - newValue) > FLT_EPSILON) {
|
||||
snprintf(pError, ERRLEN,"ERROR:'%s %s' must be greater than or equal to %f", self->name, SPEED, 0.0);
|
||||
SCWrite(pCon, pError, eError);
|
||||
@@ -1656,7 +1656,7 @@ static int DMC2280SetPar(void *pData, SConnection *pCon,
|
||||
}
|
||||
|
||||
/* Set Acceleration */
|
||||
if(strcmp(name,ACCEL) == 0) {
|
||||
if(strcasecmp(name,ACCEL) == 0) {
|
||||
if ((0.0 - newValue) > FLT_EPSILON) {
|
||||
snprintf(pError, ERRLEN,"ERROR:'%s %s' must be greater than or equal to %f", self->name, ACCEL, 0.0);
|
||||
SCWrite(pCon, pError, eError);
|
||||
@@ -1675,7 +1675,7 @@ static int DMC2280SetPar(void *pData, SConnection *pCon,
|
||||
}
|
||||
|
||||
/* Set Deceleration */
|
||||
if(strcmp(name,DECEL) == 0) {
|
||||
if(strcasecmp(name,DECEL) == 0) {
|
||||
if ((0.0 - newValue) > FLT_EPSILON) {
|
||||
snprintf(pError, ERRLEN,"ERROR:'%s %s' must be greater than or equal to %f", self->name, DECEL, 0.0);
|
||||
SCWrite(pCon, pError, eError);
|
||||
|
||||
Reference in New Issue
Block a user