- Fixes to HM code for AMOR TOF

- A couple of TAS fixes
- o2t was fixed to work with any drivable
- FOCUS was mended to include beam monitor in data file
This commit is contained in:
cvs
2002-07-19 15:09:21 +00:00
parent e0c5afcf6d
commit bde19bb973
38 changed files with 604 additions and 249 deletions

View File

@@ -397,8 +397,8 @@ int TASCalc(pTASdata self, SConnection *pCon,
for(i = 0; i < 4; i++)
{
helmconv[i] = .0;
currents[i] = readCurrent(tasMotorOrder[CURMOT+i],pCon);
currents[i+4] = readCurrent(tasMotorOrder[CURMOT + i + 4],pCon);
currents[i] = readDrivable(tasMotorOrder[CURMOT+i],pCon);
currents[i+4] = readDrivable(tasMotorOrder[CURMOT + i + 4],pCon);
}
readConversionFactors(self,helmconv);
@@ -626,8 +626,8 @@ int TASUpdate(pTASdata self, SConnection *pCon)
for(i = 0; i < 4; i++)
{
convH[i] = .0;
helmCurrent[i] = readCurrent(tasMotorOrder[CURMOT+i],pCon);
helmCurrent[4+i] = readCurrent(tasMotorOrder[CURMOT+i+4],pCon);
helmCurrent[i] = readDrivable(tasMotorOrder[CURMOT+i],pCon);
helmCurrent[4+i] = readDrivable(tasMotorOrder[CURMOT+i+4],pCon);
}
readConversionFactors(self,convH);
@@ -729,15 +729,29 @@ int TASUpdate(pTASdata self, SConnection *pCon)
return 1;
}
/*-----------------------------------------------------------------------
readCurrent tries to read the value of one of the magnet currents.
readDrivable tries to read the value of one of the magnet currents.
All errors are ignored because most of the time currents will not be
present in the system.
-----------------------------------------------------------------------*/
float readCurrent(char *val, SConnection *pCon){
float readDrivable(char *val, SConnection *pCon){
pIDrivable pDriv;
CommandList *pCom;
pDummy pDum;
pMotor pMot = NULL;
float fVal;
/*
if motor: read motor
*/
pMot = FindMotor(pServ->pSics,val);
if(pMot != NULL){
MotorGetSoftPosition(pMot,pCon,&fVal);
return fVal;
}
/*
else: read general drivable
*/
pCom = FindCommand(pServ->pSics,val);
if(pCom != NULL){
pDriv = GetDrivableInterface(pCom->pData);
@@ -745,7 +759,7 @@ float readCurrent(char *val, SConnection *pCon){
return pDriv->GetValue(pCom->pData,pCon);
}
}
return .0;
return -999.99;
}
/*-----------------------------------------------------------------------
startCurrent starts driving a current to a new value
@@ -767,3 +781,7 @@ void readConversionFactors(pTASdata self,float convH[4]){
convH[2] = self->tasPar[HCONV3]->fVal;
convH[3] = self->tasPar[HCONV4]->fVal;
}