- Added file checking and listings to exeman
- Fixed some problems with mesure - Fixed issues with tasub
This commit is contained in:
49
mesure.c
49
mesure.c
@@ -53,7 +53,9 @@
|
||||
pHKL pCryst; /* hkl object for crystallographic calc
|
||||
and reflection driving */
|
||||
pMotor pOmega; /* motor for omega scans */
|
||||
pMotor p2Theta; /* motor for 2 theta scans*/
|
||||
char *pCOmega; /* name of omega motor */
|
||||
char *pC2Theta; /* name of 2 theta motor */
|
||||
char *pFileRoot; /* where to write files */
|
||||
pDataNumber pDanu; /* where to get data file number */
|
||||
FILE *fRefl; /* reflection profile file */
|
||||
@@ -140,7 +142,8 @@ static void ListMesure(pMesure self, char *name, SConnection *pCon)
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
pMesure CreateMesure(pHKL pCryst, pScanData pScanner, pMotor pOmega,
|
||||
char *pOm, char *pFileRoot,
|
||||
char *pOm, pMotor p2Theta, char *p2t,
|
||||
char *pFileRoot,
|
||||
pDataNumber pDanu)
|
||||
{
|
||||
pMesure pNew = NULL;
|
||||
@@ -172,7 +175,9 @@ static void ListMesure(pMesure self, char *name, SConnection *pCon)
|
||||
pNew->pScanner = pScanner;
|
||||
pNew->pCryst = pCryst;
|
||||
pNew->pOmega = pOmega;
|
||||
pNew->p2Theta = p2Theta;
|
||||
pNew->pCOmega = strdup(pOm);
|
||||
pNew->pC2Theta = strdup(p2t);
|
||||
pNew->pFileRoot = strdup(pFileRoot);
|
||||
pNew->pDanu = pDanu;
|
||||
pNew->iCount = 0;
|
||||
@@ -229,7 +234,7 @@ static void ListMesure(pMesure self, char *name, SConnection *pCon)
|
||||
pHKL pCryst = NULL;
|
||||
pScanData pScan = NULL;
|
||||
CommandList *pCom = NULL;
|
||||
pMotor pMot = NULL;
|
||||
pMotor pMot = NULL, pMot2 = NULL;
|
||||
pDataNumber pDanu = NULL;
|
||||
pSicsO2T pO2T = NULL;
|
||||
char pBueffel[512];
|
||||
@@ -242,7 +247,7 @@ static void ListMesure(pMesure self, char *name, SConnection *pCon)
|
||||
/* check no of parameters
|
||||
inicom name hkl scan omega root danu
|
||||
*/
|
||||
if(argc < 7)
|
||||
if(argc < 8)
|
||||
{
|
||||
SCWrite(pCon,
|
||||
"ERROR: Insufficient number of parameters to MesureFactory",eError);
|
||||
@@ -297,9 +302,18 @@ static void ListMesure(pMesure self, char *name, SConnection *pCon)
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 2 theta */
|
||||
pMot2 = FindMotor(pSics,argv[5]);
|
||||
if(!pMot2)
|
||||
{
|
||||
sprintf(pBueffel,"ERROR: %s is no motor object ",argv[5]);
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Data Number */
|
||||
pCom = FindCommand(pSics,argv[6]);
|
||||
pCom = FindCommand(pSics,argv[7]);
|
||||
if(pCom)
|
||||
{
|
||||
pDum = (pDummy)pCom->pData;
|
||||
@@ -313,13 +327,14 @@ static void ListMesure(pMesure self, char *name, SConnection *pCon)
|
||||
}
|
||||
if(!pDanu)
|
||||
{
|
||||
sprintf(pBueffel,"ERROR: %s is no DataNumber object",argv[6]);
|
||||
sprintf(pBueffel,"ERROR: %s is no DataNumber object",argv[7]);
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* finally create the thing */
|
||||
pNew = CreateMesure(pCryst,pScan,pMot,argv[4],argv[5],pDanu);
|
||||
pNew = CreateMesure(pCryst,pScan,pMot,argv[4], pMot2, argv[5],
|
||||
argv[6],pDanu);
|
||||
if(!pNew)
|
||||
{
|
||||
SCWrite(pCon,"ERROR: no memory in MesureFactory",eError);
|
||||
@@ -415,7 +430,7 @@ static int getMesureNP(pMesure self, double twoTheta)
|
||||
This is supposed to be automatically set. In order to do so, I need
|
||||
the step width which in turn is dependent on two theta. Therefore I calculate
|
||||
two times: the first time with a scan tolerance of 0 to get two theta, the
|
||||
second time with teh scan tolerance ste to a decent value to get the
|
||||
second time with the scan tolerance ste to a decent value to get the
|
||||
real thing.
|
||||
---------------------------------------------------------------------------*/
|
||||
static int MesureCalculateSettings(pMesure self, float fHKL[3], float fSet[4],
|
||||
@@ -611,13 +626,29 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
||||
|
||||
/*
|
||||
below is the code for a single counter scan.
|
||||
TODO: (maybe) make this clearer and separte this into another subroutine
|
||||
TODO: (maybe) make this clearer and separate this into another subroutine
|
||||
|
||||
Set the scan up
|
||||
*/
|
||||
ClearScanVar(self->pScanner);
|
||||
AddScanVar(self->pScanner, pServ->pSics,pCon,scanVar,
|
||||
AddScanVar(self->pScanner, pServ->pSics,pCon,self->pCOmega,
|
||||
fStart, stepWidth);
|
||||
/*
|
||||
Oksana does not want o2t scans to be tightly coupled, this is why we
|
||||
cannot use the normal o2t scan variable. Instead we calculate new limits and
|
||||
steps for 2 theta and use it as a second scan variable
|
||||
*/
|
||||
if(strstr(scanVar,"o2t") != NULL){
|
||||
iRet = MotorGetSoftPosition(self->p2Theta,pCon,&fStart);
|
||||
if(!iRet)
|
||||
{
|
||||
return iRet;
|
||||
}
|
||||
stepWidth *= 2.;
|
||||
fStart -= (np/2.)*stepWidth;
|
||||
AddScanVar(self->pScanner, pServ->pSics,pCon,self->pC2Theta,
|
||||
fStart, stepWidth);
|
||||
}
|
||||
|
||||
/*
|
||||
as np can change, we have to reallocate enough space
|
||||
|
||||
Reference in New Issue
Block a user