- 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:
59
scan.c
59
scan.c
@ -217,11 +217,7 @@ static void ConfigureScanDict(pStringDict dict)
|
||||
int AddScanVar(pScanData self, SicsInterp *pSics, SConnection *pCon,
|
||||
char *name, float fStart, float fStep)
|
||||
{
|
||||
CommandList *pCom = NULL;
|
||||
pIDrivable pDriv = NULL;
|
||||
pDummy pData = NULL;
|
||||
pVarEntry pVar = NULL;
|
||||
char pBueffel[512];
|
||||
|
||||
if(self->iActive)
|
||||
{
|
||||
@ -240,6 +236,31 @@ static void ConfigureScanDict(pStringDict dict)
|
||||
DynarPut(self->pScanVar,self->iScanVar,pVar);
|
||||
self->iScanVar++;
|
||||
|
||||
return 1;
|
||||
}
|
||||
/*-------------------------------------------------------------------------*/
|
||||
int AddLogVar(pScanData self, SicsInterp *pSics, SConnection *pCon,
|
||||
char *name)
|
||||
{
|
||||
pVarEntry pVar = NULL;
|
||||
|
||||
if(self->iActive)
|
||||
{
|
||||
SCWrite(pCon,"ERROR: cannot change parameters while scan is running",
|
||||
eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pVar = MakeLogVar(pSics,pCon,name);
|
||||
if(pVar == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* put it away */
|
||||
DynarPut(self->pScanVar,self->iScanVar,pVar);
|
||||
self->iScanVar++;
|
||||
|
||||
return 1;
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@ -277,8 +298,15 @@ static void ConfigureScanDict(pStringDict dict)
|
||||
pVar = (pVarEntry)pData;
|
||||
if(pVar)
|
||||
{
|
||||
fprintf(fd,"%s add %s %f %f\n", self->objectName, ScanVarName(pVar),
|
||||
ScanVarStart(pVar), ScanVarStep(pVar));
|
||||
if(isLogVar(pVar))
|
||||
{
|
||||
fprintf(fd,"%s log %s\n", self->objectName, ScanVarName(pVar));
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(fd,"%s add %s %f %f\n", self->objectName, ScanVarName(pVar),
|
||||
ScanVarStart(pVar), ScanVarStep(pVar));
|
||||
}
|
||||
}
|
||||
pData = NULL;
|
||||
}
|
||||
@ -1961,7 +1989,7 @@ static int DumpScan(pScanData self, SConnection *pCon)
|
||||
return 0;
|
||||
}
|
||||
/*---------- add command */
|
||||
if(strcmp(argv[1],"add") == 0)
|
||||
if(strcmp(argv[1],"add") == 0)
|
||||
{
|
||||
if(argc < 5)
|
||||
{
|
||||
@ -1994,6 +2022,23 @@ static int DumpScan(pScanData self, SConnection *pCon)
|
||||
}
|
||||
return iRet;
|
||||
}
|
||||
else if(strcmp(argv[1],"log") == 0)
|
||||
{
|
||||
if(argc < 3)
|
||||
{
|
||||
sprintf(pBueffel,
|
||||
"ERROR: Insufficient number of arguments given for %s log",
|
||||
argv[0]);
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
return 0;
|
||||
}
|
||||
iRet = AddLogVar(self,pSics,pCon,argv[2]);
|
||||
if(iRet)
|
||||
{
|
||||
SCSendOK(pCon);
|
||||
}
|
||||
return iRet;
|
||||
}
|
||||
/* --------clear */
|
||||
else if(strcmp(argv[1],"clear") == 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user