- 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:
11
amor2t.c
11
amor2t.c
@ -931,12 +931,23 @@
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
memcpy(pAOM,pNew,sizeof(Amor2T));
|
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 */
|
/* set modified interface functions */
|
||||||
|
pAOM->pDes->GetInterface = A2TGetInterface;
|
||||||
|
pAOM->pDriv->Halt = A2THalt;
|
||||||
pAOM->pDes->SaveStatus = NULL;
|
pAOM->pDes->SaveStatus = NULL;
|
||||||
pAOM->pDriv->CheckLimits = ANA2TCheck;
|
pAOM->pDriv->CheckLimits = ANA2TCheck;
|
||||||
pAOM->pDriv->SetValue = ANA2TSetValue;
|
pAOM->pDriv->SetValue = ANA2TSetValue;
|
||||||
pAOM->pDriv->GetValue = ANA2TGetValue;
|
pAOM->pDriv->GetValue = ANA2TGetValue;
|
||||||
|
pAOM->pDriv->CheckStatus = A2TStatus;
|
||||||
|
|
||||||
|
|
||||||
/* install commands */
|
/* install commands */
|
||||||
|
@ -454,7 +454,7 @@
|
|||||||
SCWrite(pCon,pBueffel,eValue);
|
SCWrite(pCon,pBueffel,eValue);
|
||||||
sprintf(pBueffel,"Maximum peak height: %ld\n", self->lPeak);
|
sprintf(pBueffel,"Maximum peak height: %ld\n", self->lPeak);
|
||||||
SCWrite(pCon,pBueffel,eValue);
|
SCWrite(pCon,pBueffel,eValue);
|
||||||
sprintf(pBueffel,"Aproximate FWHM: %f\n",self->FWHM);
|
sprintf(pBueffel,"Approximate FWHM: %f\n",self->FWHM);
|
||||||
SCWrite(pCon,pBueffel,eValue);
|
SCWrite(pCon,pBueffel,eValue);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
37
hkl.c
37
hkl.c
@ -822,6 +822,16 @@
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* some people are stupid.......... */
|
||||||
|
if(myPsi > 360.)
|
||||||
|
{
|
||||||
|
myPsi -= 360;
|
||||||
|
}
|
||||||
|
if(myPsi < .0)
|
||||||
|
{
|
||||||
|
myPsi += 360.;
|
||||||
|
}
|
||||||
|
|
||||||
/* no retries if normal beam calculation
|
/* no retries if normal beam calculation
|
||||||
or specific Hamilton or specific
|
or specific Hamilton or specific
|
||||||
psi requested */
|
psi requested */
|
||||||
@ -901,11 +911,15 @@
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sprintf(pBueffel,
|
if(iRetry != 1)
|
||||||
"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");
|
sprintf(pBueffel,
|
||||||
SCWrite(pCon,pBueffel,eError);
|
"ERROR: failed to find a possible setting for %4.1f %4.1f %4.1f %s",
|
||||||
return 0;
|
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],
|
int RunHKL(pHKL self, float fHKL[3],
|
||||||
@ -1557,13 +1571,16 @@ ente:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
iRet = CalculateSettings(self,fHKL, fPsi, iHamil, fSet,pCon);
|
iRet = CalculateSettings(self,fHKL, fPsi, iHamil, fSet,pCon);
|
||||||
if(!iRet)
|
sprintf(pBueffel," theta = %f, omega = %f, chi = %f, phi = %f",
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
sprintf(pBueffel,"{ theta = %f, omega = %f, chi = %f, phi = %f",
|
|
||||||
fSet[0], fSet[1], fSet[2],fSet[3]);
|
fSet[0], fSet[1], fSet[2],fSet[3]);
|
||||||
SCWrite(pCon,pBueffel,eValue);
|
SCWrite(pCon,pBueffel,eValue);
|
||||||
|
if(!iRet)
|
||||||
|
{
|
||||||
|
SCWrite(pCon,
|
||||||
|
"WARNING: Settings violate motor limits or cannot be calculated",
|
||||||
|
eWarning);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/*------------------ run */
|
/*------------------ run */
|
||||||
|
11
motor.c
11
motor.c
@ -733,7 +733,7 @@ extern void KillPiPiezo(void *pData);
|
|||||||
iRet = self->pDriver->GetPosition(self->pDriver,&fVal);
|
iRet = self->pDriver->GetPosition(self->pDriver,&fVal);
|
||||||
if(iRet == OKOK) /* all went well, the exception */
|
if(iRet == OKOK) /* all went well, the exception */
|
||||||
{
|
{
|
||||||
*fHard = fVal;
|
*fHard = fVal;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else /* a problem, the usual case: try fix the problem */
|
else /* a problem, the usual case: try fix the problem */
|
||||||
@ -791,7 +791,14 @@ extern void KillPiPiezo(void *pData);
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* apply zeropoint */
|
/* 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;
|
*fVal = fValue;
|
||||||
|
|
||||||
/* apply sign */
|
/* apply sign */
|
||||||
|
@ -129,8 +129,8 @@ phone setAccess 2
|
|||||||
adress UNKNOWN
|
adress UNKNOWN
|
||||||
adress setAccess 2
|
adress setAccess 2
|
||||||
# Counter counter
|
# Counter counter
|
||||||
counter SetPreset 1.000000
|
counter SetPreset 10.000000
|
||||||
counter SetMode Preset
|
counter SetMode Timer
|
||||||
# Motor som
|
# Motor som
|
||||||
som SoftZero 0.000000
|
som SoftZero 0.000000
|
||||||
som SoftLowerLim 0.000000
|
som SoftLowerLim 0.000000
|
||||||
@ -236,9 +236,9 @@ d1l sign 1.000000
|
|||||||
d1l InterruptMode 0.000000
|
d1l InterruptMode 0.000000
|
||||||
d1l AccessCode 2.000000
|
d1l AccessCode 2.000000
|
||||||
# Motor d1r
|
# Motor d1r
|
||||||
d1r SoftZero 0.000000
|
d1r SoftZero 2.000000
|
||||||
d1r SoftLowerLim -20.000000
|
d1r SoftLowerLim -22.000000
|
||||||
d1r SoftUpperLim 20.000000
|
d1r SoftUpperLim 18.000000
|
||||||
d1r Fixed -1.000000
|
d1r Fixed -1.000000
|
||||||
d1r sign 1.000000
|
d1r sign 1.000000
|
||||||
d1r InterruptMode 0.000000
|
d1r InterruptMode 0.000000
|
||||||
|
4
velo.c
4
velo.c
@ -1184,9 +1184,9 @@
|
|||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
fRot = fVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
fRot = fVal;
|
|
||||||
/* do drive if we really need to */
|
/* do drive if we really need to */
|
||||||
if(iDrive)
|
if(iDrive)
|
||||||
{
|
{
|
||||||
@ -1219,7 +1219,7 @@
|
|||||||
/* list command */
|
/* list command */
|
||||||
if(strcmp(argv[1],"list") == 0)
|
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);
|
argv[0],fTilt);
|
||||||
SCWrite(pCon,pBueffel,eValue);
|
SCWrite(pCon,pBueffel,eValue);
|
||||||
return 1;
|
return 1;
|
||||||
|
Reference in New Issue
Block a user