- fixed a bug in amorstat which resulted in bad scan axis to be sent

- added GetSoftVar to scan module.
- Made sps moddule give up only after three tries to get command through
- Added build script
This commit is contained in:
cvs
2000-09-07 10:09:38 +00:00
parent 1552604aa6
commit 63f8406f52
18 changed files with 192 additions and 38 deletions

42
scan.c
View File

@ -1467,6 +1467,48 @@ extern void SNXFormatTime(char *pBuffer, int iLen);
return 0;
}
/* not reached */
assert(0);
}
/*--------------------------------------------------------------------------*/
int GetSoftScanVar(pScanData self, int iWhich, float *fData, int iDataLen)
{
int iEnd, i;
pVarEntry pVar = NULL;
void *pPtr = NULL;
/* does it exist ?*/
if( (iWhich < 0) || (iWhich >= self->iScanVar) )
{
return 0;
}
/* handle iEnd */
if(self->iCounts < iDataLen)
{
iEnd = self->iCounts;
}
else
{
iEnd = iDataLen;
}
DynarGet(self->pScanVar,iWhich,&pPtr);
pVar = (pVarEntry)pPtr;
if(pVar)
{
/* initialise to theoretical values */
for(i = 0; i < self->iNP; i++)
{
fData[i] = pVar->fStart + i * pVar->fStep;
}
return 1;
}
else
{
return 0;
}
/* not reached */
assert(0);
}