- Many fixes to accomodate a nitty picky TRICS wishlist

- Added a log facility to scan which includes a variable which is logged but
  not driven during a scan.
- Fixed normal beam operation
This commit is contained in:
koennecke
2006-01-27 11:33:06 +00:00
parent 45fd50265f
commit b737b4d936
17 changed files with 367 additions and 182 deletions

View File

@@ -24,6 +24,8 @@
#include "danu.h"
#include "integrate.h"
#include "hkl.h"
#include "matrix/matrix.h"
#include "hkl.i"
#include "sicsvar.h"
#include "evcontroller.h"
#include "mesure.h"
@@ -755,6 +757,8 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
float fVal, fUB[9];
pSicsVariable pVar = NULL;
char *pFile = NULL, *pPtr;
float zero, pos;
pMotor pMot = NULL;
assert(self);
@@ -830,11 +834,11 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
fprintf(self->fHKL,"filetime = %s\n",pBueffel);
GetLambda(self->pCryst,&fVal);
fprintf(self->fHKL,"lambda = %f Angstroem\n",fVal);
GetUB(self->pCryst,fUB);
GetUB(self->pCryst,fUB);
fprintf(self->fHKL,
"UB = %7.6f %7.6f %7.6f %7.6f %7.6f %7.6f %7.6f %7.6f %7.6f\n",
fUB[0], fUB[1],fUB[2],fUB[3],fUB[4],fUB[5],fUB[6],fUB[7],fUB[8]);
/* write sample & user info */
strcpy(pBueffel,"CCL, Instr=TRICS, ");
pVar = FindVariable(pServ->pSics,"sample");
@@ -852,8 +856,58 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
strcat(pBueffel,pBuff);
}
fprintf(self->fRefl,"%s\n",pBueffel);
fprintf(self->fRefl,"lambda = %f Angstroem\n",fVal);
fprintf(self->fRefl,
"UB = %7.6f %7.6f %7.6f %7.6f %7.6f %7.6f %7.6f %7.6f %7.6f\n",
fUB[0], fUB[1],fUB[2],fUB[3],fUB[4],fUB[5],fUB[6],fUB[7],fUB[8]);
/*
* zero points for Juerg
*/
pBueffel[0] = '\0';
if(self->pCryst->pTheta != NULL){
MotorGetPar(self->pCryst->pTheta,"softzero",&zero);
snprintf(pBuff,131,"stt.zero = %f ", zero);
strcat(pBueffel,pBuff);
}
if(self->pCryst->pOmega != NULL){
MotorGetPar(self->pCryst->pOmega,"softzero",&zero);
snprintf(pBuff,131,"om.zero = %f ", zero);
strcat(pBueffel,pBuff);
}
if(self->pCryst->pChi != NULL){
MotorGetPar(self->pCryst->pChi,"softzero",&zero);
snprintf(pBuff,131,"chi.zero = %f ", zero);
strcat(pBueffel,pBuff);
}
if(self->pCryst->pPhi != NULL){
MotorGetPar(self->pCryst->pPhi,"softzero",&zero);
snprintf(pBuff,131,"phi.zero = %f ", zero);
strcat(pBueffel,pBuff);
}
fprintf(self->fRefl,"%s\n",pBueffel);
/*
* CEX motors ....
*/
pBueffel[0] = '\0';
pMot = FindCommandData(pServ->pSics,"cex1","Motor");
if(pMot != NULL){
MotorGetSoftPosition(pMot,pCon,&pos);
snprintf(pBuff,131,"cex1 = %f ",pos);
strcat(pBueffel,pBuff);
}
pMot = FindCommandData(pServ->pSics,"cex2","Motor");
if(pMot != NULL){
MotorGetSoftPosition(pMot,pCon,&pos);
snprintf(pBuff,131,"cex2 = %f ",pos);
strcat(pBueffel,pBuff);
}
if(strlen(pBueffel) > 1) {
fprintf(self->fRefl,"%s\n",pBueffel);
}
return 1;
}
/*---------------------------------------------------------------------------*/
@@ -1536,7 +1590,7 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
strtolower(argv[1]);
/*------ start */
if(strcmp(argv[1],"start") == 0)
if(strcmp(argv[1],"open") == 0)
{
if(!SCMatchRights(pCon,usUser))
{