- Fixes to HM code for AMOR TOF

- A couple of TAS fixes
- o2t was fixed to work with any drivable
- FOCUS was mended to include beam monitor in data file
This commit is contained in:
cvs
2002-07-19 15:09:21 +00:00
parent e0c5afcf6d
commit bde19bb973
38 changed files with 604 additions and 249 deletions

View File

@@ -20,6 +20,7 @@
#include <assert.h>
#include <time.h>
#include <ctype.h>
#include <tcl.h>
#include "fortify.h"
#include "sics.h"
#include "sicsvar.h"
@@ -241,7 +242,7 @@ static int TASHeader(pScanData self)
iCount = 0;
for(i = MAXMOT-8; i < MAXMOT;i++)
{
fVal = readCurrent(tasMotorOrder[i],self->pCon);
fVal = readDrivable(tasMotorOrder[i],self->pCon);
strcpy(pWork2,tasMotorOrder[i]);
strtoupper(pWork2);
fprintf(self->fd,"%-8s=%8.4f, ",pWork2,fVal);
@@ -429,7 +430,7 @@ static int TASScanPoint(pScanData self, int iPoint)
float fVal;
pMotor pMot = NULL;
long m1, m2, m3, cnts;
char pBueffel[1024], pWork[80];
char pBueffel[1024], pWork[80], pError[132];
/*
after polarisation analysis, this has to be ignored as it is called
@@ -507,14 +508,14 @@ static int TASScanPoint(pScanData self, int iPoint)
*/
for(i = 0; i < pTAS->addCount; i++)
{
fVal = -999.99;
if(pTAS->addType[i] == 1) /* motor */
{
pMot = FindMotor(self->pSics,tasMotorOrder[pTAS->addOutput[i]]);
if(pMot)
{
status = MotorGetSoftPosition(pMot,self->pCon,&fVal);
if(!status)
fVal = -9999.77;
fVal = readDrivable(tasMotorOrder[pTAS->addOutput[i]],self->pCon);
if(fVal < -990.){
sprintf(pError,"WARNING: problem reading %s",
tasMotorOrder[pTAS->addOutput[i]]);
SCWrite(self->pCon, pError,eWarning);
}
}
else
@@ -539,6 +540,20 @@ static int TASScanPoint(pScanData self, int iPoint)
return 1;
}
/*-----------------------------------------------------------------------
disables a3 driving in powder mode. In powder mode a3 is fixed. This
supresses the error message issued otherwise.
------------------------------------------------------------------------*/
static void fixPowder(unsigned char tasTargetMask[20]){
char *pPtr = NULL;
pPtr = Tcl_GetVar(pServ->pSics->pTcl,"powder",TCL_GLOBAL_ONLY);
if(pPtr){
if(strstr(pPtr,"1") != NULL){
tasTargetMask[2] = 0;
}
}
}
/*------------------------------------------------------------------------
TASScanDrive starts all the motors necessary to drive to a new scan
position. It thereby takes care of the TAS calculation if necessary.
@@ -588,7 +603,9 @@ static int TASScanDrive(pScanData self, int iPoint)
}
else
{
/* here there is a motor */
/*
This is a motor, start it.
*/
StartMotor(pServ->pExecutor,self->pSics, self->pCon, pVar->Name,
pVar->fStart + iPoint * pVar->fStep);
/*
@@ -614,6 +631,7 @@ static int TASScanDrive(pScanData self, int iPoint)
ignored here on purpose. There is a slight chance that
other points in the scan fit the bill.
*/
fixPowder(tasTargetMask);
TASStart(pTAS,self->pCon,
self->pSics,tasTargets,tasTargetMask);
}
@@ -1434,12 +1452,12 @@ int TASScan(SConnection *pCon, SicsInterp *pSics, void *pData,
pTAS->tasPar[TIT]->text,
pTAS->tasPar[USR]->text,
pTAS->tasPar[QH]->fVal - (pTAS->pScan->iNP/2)*pTAS->tasPar[DQH]->fVal,
pTAS->tasPar[QL]->fVal - (pTAS->pScan->iNP/2)*pTAS->tasPar[DQL]->fVal,
pTAS->tasPar[QK]->fVal - (pTAS->pScan->iNP/2)*pTAS->tasPar[DQK]->fVal,
pTAS->tasPar[QK]->fVal - (pTAS->pScan->iNP/2)*pTAS->tasPar[DQL]->fVal,
pTAS->tasPar[QL]->fVal - (pTAS->pScan->iNP/2)*pTAS->tasPar[DQK]->fVal,
pTAS->tasPar[EN]->fVal - (pTAS->pScan->iNP/2)*pTAS->tasPar[DEN]->fVal,
pTAS->tasPar[DQH]->fVal,
pTAS->tasPar[DQL]->fVal,
pTAS->tasPar[DQK]->fVal,
pTAS->tasPar[DQL]->fVal,
pTAS->tasPar[DEN]->fVal);
SCWrite(pCon,pLine,eWarning);
if(iTas > 0)