diff --git a/amor2t.c b/amor2t.c index ac777262..996818cb 100644 --- a/amor2t.c +++ b/amor2t.c @@ -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 */ diff --git a/fitcenter.c b/fitcenter.c index 7754281b..5139ce7a 100644 --- a/fitcenter.c +++ b/fitcenter.c @@ -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; diff --git a/hkl.c b/hkl.c index bc525eeb..48a24b91 100644 --- a/hkl.c +++ b/hkl.c @@ -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 */ diff --git a/motor.c b/motor.c index 34dca100..935c295b 100644 --- a/motor.c +++ b/motor.c @@ -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 */ diff --git a/sicsstatus.tcl b/sicsstatus.tcl index 66f129d8..c05429ff 100644 --- a/sicsstatus.tcl +++ b/sicsstatus.tcl @@ -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 diff --git a/velo.c b/velo.c index bc0782f5..d11a7da9 100644 --- a/velo.c +++ b/velo.c @@ -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;