- Fixed some serious bugs in amor2t having to do with recent extensions

- fixed velocity selector code to properly display data at list
- got hkl to give proper answers when a psi value was specified and
  limited psi to 360 max.
- fixed a minor spelling  error in fitcenter messages
- fixed badly working soft zeros with  negative sign
This commit is contained in:
cvs
2000-08-18 14:45:56 +00:00
parent e7e85d7b13
commit f3e4add7b5
6 changed files with 55 additions and 20 deletions

View File

@ -931,12 +931,23 @@
return 0;
}
memcpy(pAOM,pNew,sizeof(Amor2T));
pAOM->pDriv = CreateDrivableInterface();
pAOM->pDes = CreateDescriptor("Amor2T");
if(!pAOM->pDriv || !pAOM->pDes )
{
A2TKill(pNew);
SCWrite(pCon,"ERROR: out of memory in Amor2TFactory",eError);
return 0;
}
/* set modified interface functions */
pAOM->pDes->GetInterface = A2TGetInterface;
pAOM->pDriv->Halt = A2THalt;
pAOM->pDes->SaveStatus = NULL;
pAOM->pDriv->CheckLimits = ANA2TCheck;
pAOM->pDriv->SetValue = ANA2TSetValue;
pAOM->pDriv->GetValue = ANA2TGetValue;
pAOM->pDriv->CheckStatus = A2TStatus;
/* install commands */

View File

@ -454,7 +454,7 @@
SCWrite(pCon,pBueffel,eValue);
sprintf(pBueffel,"Maximum peak height: %ld\n", self->lPeak);
SCWrite(pCon,pBueffel,eValue);
sprintf(pBueffel,"Aproximate FWHM: %f\n",self->FWHM);
sprintf(pBueffel,"Approximate FWHM: %f\n",self->FWHM);
SCWrite(pCon,pBueffel,eValue);
return 1;

37
hkl.c
View File

@ -822,6 +822,16 @@
return 0;
}
/* some people are stupid.......... */
if(myPsi > 360.)
{
myPsi -= 360;
}
if(myPsi < .0)
{
myPsi += 360.;
}
/* no retries if normal beam calculation
or specific Hamilton or specific
psi requested */
@ -901,11 +911,15 @@
return 1;
}
}
sprintf(pBueffel,
"ERROR: failed to find a possible setting for %4.1f %4.1f %4.1f %s",
fHKL[0], fHKL[1], fHKL[2], "\n Even tried 36 psi settings");
SCWrite(pCon,pBueffel,eError);
return 0;
if(iRetry != 1)
{
sprintf(pBueffel,
"ERROR: failed to find a possible setting for %4.1f %4.1f %4.1f %s",
fHKL[0], fHKL[1], fHKL[2], "\n Even tried 36 psi settings");
SCWrite(pCon,pBueffel,eError);
return 0;
}
return 0;
}
/*-------------------------------------------------------------------------*/
int RunHKL(pHKL self, float fHKL[3],
@ -1557,13 +1571,16 @@ ente:
return 0;
}
iRet = CalculateSettings(self,fHKL, fPsi, iHamil, fSet,pCon);
if(!iRet)
{
return 0;
}
sprintf(pBueffel,"{ theta = %f, omega = %f, chi = %f, phi = %f",
sprintf(pBueffel," theta = %f, omega = %f, chi = %f, phi = %f",
fSet[0], fSet[1], fSet[2],fSet[3]);
SCWrite(pCon,pBueffel,eValue);
if(!iRet)
{
SCWrite(pCon,
"WARNING: Settings violate motor limits or cannot be calculated",
eWarning);
return 0;
}
return 1;
}
/*------------------ run */

11
motor.c
View File

@ -733,7 +733,7 @@ extern void KillPiPiezo(void *pData);
iRet = self->pDriver->GetPosition(self->pDriver,&fVal);
if(iRet == OKOK) /* all went well, the exception */
{
*fHard = fVal;
*fHard = fVal;
return 1;
}
else /* a problem, the usual case: try fix the problem */
@ -791,7 +791,14 @@ extern void KillPiPiezo(void *pData);
}
/* apply zeropoint */
fValue -= ObVal(self->ParArray,SZERO);
if(ObVal(self->ParArray,SIGN) < 0.)
{
fValue += ObVal(self->ParArray,SZERO);
}
else
{
fValue -= ObVal(self->ParArray,SZERO);
}
*fVal = fValue;
/* apply sign */

View File

@ -129,8 +129,8 @@ phone setAccess 2
adress UNKNOWN
adress setAccess 2
# Counter counter
counter SetPreset 1.000000
counter SetMode Preset
counter SetPreset 10.000000
counter SetMode Timer
# Motor som
som SoftZero 0.000000
som SoftLowerLim 0.000000
@ -236,9 +236,9 @@ d1l sign 1.000000
d1l InterruptMode 0.000000
d1l AccessCode 2.000000
# Motor d1r
d1r SoftZero 0.000000
d1r SoftLowerLim -20.000000
d1r SoftUpperLim 20.000000
d1r SoftZero 2.000000
d1r SoftLowerLim -22.000000
d1r SoftUpperLim 18.000000
d1r Fixed -1.000000
d1r sign 1.000000
d1r InterruptMode 0.000000

4
velo.c
View File

@ -1184,9 +1184,9 @@
SCWrite(pCon,pBueffel,eError);
return 0;
}
fRot = fVal;
}
fRot = fVal;
/* do drive if we really need to */
if(iDrive)
{
@ -1219,7 +1219,7 @@
/* list command */
if(strcmp(argv[1],"list") == 0)
{
sprintf(pBueffel,"%s.rotation = %f\n%s.Tilt = %f",argv[0], fRot,
sprintf(pBueffel,"%s.rotation = %f\n%s.Tilt = %f",argv[0], fRot,
argv[0],fTilt);
SCWrite(pCon,pBueffel,eValue);
return 1;