PSI update
r1464 | ffr | 2007-02-12 12:20:21 +1100 (Mon, 12 Feb 2007) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
634f2023b1
commit
3168325921
64
mesure.c
64
mesure.c
@@ -33,6 +33,7 @@
|
||||
#include "fourtable.h"
|
||||
#include "lld.h"
|
||||
#include "stdscan.h"
|
||||
#include "exeman.h"
|
||||
|
||||
extern void SNXFormatTime(char *pBueffel, int iLen);
|
||||
extern float nintf(float f);
|
||||
@@ -445,7 +446,9 @@ static int MesureCalculateSettings(pMesure self, float fHKL[3], float fSet[4],
|
||||
float fPsi, SConnection *pCon)
|
||||
{
|
||||
int status, np;
|
||||
float step, tolerance;
|
||||
float step, tolerance, fHard;
|
||||
char *scanvar = NULL;
|
||||
char buffer[256];
|
||||
|
||||
SetHKLScanTolerance(self->pCryst,.0);
|
||||
status = CalculateSettings(self->pCryst,fHKL,fPsi,0,fSet,pCon);
|
||||
@@ -460,7 +463,26 @@ static int MesureCalculateSettings(pMesure self, float fHKL[3], float fSet[4],
|
||||
np = getMesureNP(self,(double)fSet[0]);
|
||||
tolerance = (step * (float)np)/2. + .2;
|
||||
SetHKLScanTolerance(self->pCryst,tolerance);
|
||||
return CalculateSettings(self->pCryst,fHKL,fPsi,0,fSet,pCon);
|
||||
status = CalculateSettings(self->pCryst,fHKL,fPsi,0,fSet,pCon);
|
||||
if(status != 1){
|
||||
return status;
|
||||
}
|
||||
scanvar = GetFourCircleScanVar(self->stepTable,fSet[0]);
|
||||
if(scanvar != NULL && strcmp(scanvar,"om") != 0){
|
||||
tolerance *= 2.;
|
||||
strcpy(buffer,"ERROR: 2theta limit problem:");
|
||||
if(!MotorCheckBoundary(self->p2Theta,fSet[0]-tolerance,&fHard,
|
||||
buffer,256-strlen(buffer))){
|
||||
SCWrite(pCon,buffer,eWarning);
|
||||
return 0;
|
||||
}
|
||||
if(!MotorCheckBoundary(self->p2Theta,fSet[0]+tolerance,&fHard,
|
||||
buffer,256-strlen(buffer))){
|
||||
SCWrite(pCon,buffer,eWarning);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
int MesureReflection(pMesure self, float fHKL[3], float fPsi,
|
||||
@@ -972,7 +994,9 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
||||
static float fMax = 10.;
|
||||
int iRet, i,ii, iLF, iNP;
|
||||
char pBueffel[512], pNum[10], pTime[132];
|
||||
pEVControl pEva = NULL;
|
||||
pEVControl pEva = NULL;
|
||||
pDummy pPtr = NULL;
|
||||
pIDrivable pDriv = NULL;
|
||||
|
||||
assert(self);
|
||||
assert(pCon);
|
||||
@@ -1058,7 +1082,20 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
||||
fTemp = -777.77;
|
||||
pEva = (pEVControl)FindCommandData(pServ->pSics,"temperature",
|
||||
"Environment Controller");
|
||||
if(pEva)
|
||||
if(pEva == NULL)
|
||||
{
|
||||
pPtr = (pDummy)FindCommandData(pServ->pSics,"temperature",
|
||||
"RemObject");
|
||||
if(pPtr != NULL)
|
||||
{
|
||||
pDriv = pPtr->pDescriptor->GetInterface(pPtr,DRIVEID);
|
||||
if(pDriv != NULL)
|
||||
{
|
||||
fTemp = pDriv->GetValue(pPtr,pCon);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
iRet = EVCGetPos(pEva, pCon,&fTemp);
|
||||
}
|
||||
@@ -1120,6 +1157,19 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/*---------------------------------------------------------------------*/
|
||||
static FILE *openListFile(char *pName){
|
||||
FILE *fd = NULL;
|
||||
pDynString filename = NULL;
|
||||
filename = findBatchFile(pServ->pSics,pName);
|
||||
if(filename != NULL){
|
||||
fd = fopen(GetCharArray(filename),"r");
|
||||
DeleteDynString(filename);
|
||||
} else {
|
||||
fd = fopen(pName,"r");
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
int MesureFile(pMesure self, char *pFile, int iSkip, SConnection *pCon)
|
||||
{
|
||||
@@ -1132,7 +1182,7 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
||||
assert(pCon);
|
||||
|
||||
/* well before doing a thing, open the list file */
|
||||
fd = fopen(pFile,"r");
|
||||
fd = openListFile(pFile);
|
||||
if(!fd)
|
||||
{
|
||||
sprintf(pBueffel,"ERROR: reflection file %s NOT found!",pFile);
|
||||
@@ -1221,7 +1271,7 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
||||
assert(pCon);
|
||||
|
||||
/* well before doing a thing, open the list file */
|
||||
fd = fopen(pFile,"r");
|
||||
fd = openListFile(pFile);
|
||||
if(!fd)
|
||||
{
|
||||
sprintf(pBueffel,"ERROR: reflection file %s NOT found!",pFile);
|
||||
@@ -1280,7 +1330,7 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
||||
assert(pCon);
|
||||
|
||||
/* well before doing a thing, open the list file */
|
||||
fd = fopen(pFile,"r");
|
||||
fd = openListFile(pFile);
|
||||
if(!fd)
|
||||
{
|
||||
sprintf(pBueffel,"ERROR: reflection file %s NOT found!",pFile);
|
||||
|
||||
Reference in New Issue
Block a user