- Fixes to hkl code

- Fixes to make RITA work
- tasub extended to calculate UB from cell alone, support for elastic mode
- New MultiCounter as abstraction for counting on HM's
- regression test driver for counters
This commit is contained in:
koennecke
2006-09-13 07:12:00 +00:00
parent 87d81cf474
commit cb3bf30bbf
33 changed files with 1961 additions and 671 deletions

33
scan.c
View File

@ -385,6 +385,7 @@ int AppendScanLine(pScanData self, char *line)
}
/*-------------------------------------------------------------------------*/
extern char *stptok(const char *s, char *t, int len, char *brk);
extern char *trim(char *txt);
int StoreScanCounts(pScanData self, char *data)
{
@ -402,7 +403,7 @@ int StoreScanCounts(pScanData self, char *data)
InitCountEntry(&sCount);
/* parse the data */
pPtr = data;
pPtr = trim(data);
pPtr = stptok(pPtr,pNumber,29," \t");
if(pPtr != NULL)
{
@ -1584,7 +1585,7 @@ static int PrintTimes(pScanData self, SConnection *pCon,
snprintf(pBueffel,59,"%s.scantimes = { ",name);
DynStringCopy(data,pBueffel);
for(i = 0; i < self->iNP; i++)
for(i = 0; i < self->iCounts; i++)
{
DynarGet(self->pCounts,i,&pPtr);
pData = (pCountEntry)pPtr;
@ -2127,12 +2128,17 @@ static int DumpScan(pScanData self, SConnection *pCon)
}
/*------------ functions */
else if(strcmp(argv[1],"function") == 0)
{
return InterpretScanFunctions(self, pCon, argc, argv);
{
return InterpretScanFunctions(self, pCon, argc, argv);
}
/*---------- scan */
else if(strcmp(argv[1],"run") == 0)
{
if (argc < 5) {
sprintf(pBueffel,"ERROR: not enough arguments for %s run",argv[0]);
SCWrite(pCon,pBueffel,eError);
return 0;
}
/* get NP */
iRet = Tcl_GetInt(InterpGetTcl(pSics),argv[2],&lNP);
if(iRet != TCL_OK)
@ -2181,6 +2187,11 @@ static int DumpScan(pScanData self, SConnection *pCon)
/*---------- silent */
else if(strcmp(argv[1],"silent") == 0)
{
if (argc < 5) {
sprintf(pBueffel,"ERROR: not enough arguments for %s silent",argv[0]);
SCWrite(pCon,pBueffel,eError);
return 0;
}
/* get NP */
iRet = Tcl_GetInt(InterpGetTcl(pSics),argv[2],&lNP);
if(iRet != TCL_OK)
@ -2404,6 +2415,20 @@ static int DumpScan(pScanData self, SConnection *pCon)
}
return AppendVarPos(pCon,self,i,(float)fStep);
}
else if(strcmp(argv[1],"softpos") == 0){
if(argc > 2) {
if(!SCMatchRights(pCon,usMugger)){
return 0;
}
self->posSoft = atoi(argv[2]);
SCSendOK(pCon);
return 1;
} else {
sprintf(pBueffel,"%s.softpos = %d", argv[0],self->posSoft);
SCWrite(pCon,pBueffel,eValue);
return 1;
}
}
/*------- savecounter */
else if(strcmp(argv[1],"savecounter") == 0)
{