- 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:
42
scan.c
42
scan.c
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user