scan/diffscan enhancements to do with timestamps

This commit is contained in:
Douglas Clowes
2012-12-13 13:54:47 +11:00
parent 3a81b3a5c8
commit 4c82c0b1cb
2 changed files with 6 additions and 3 deletions

View File

@ -254,6 +254,9 @@ static float normalizeEntry(pCountEntry pCount, pCountEntry last,
pCount->Monitors[i] =
(pCount->Monitors[i] - last->Monitors[i]) * fScale;
}
fScale = pCount->fTime - last->fTime;
if (fScale > 0)
value /= fScale;
return value;
}
@ -369,9 +372,9 @@ static int DiffScanTask(void *pData)
/*
print progress
*/
snprintf(pBueffel, 255, "%5d %12.4f %12.4f RAW: %10ld %10ld",
snprintf(pBueffel, 255, "%5d %12.4f %12.4f RAW: %10ld %10ld %10.3f",
self->scanObject->iCounts - 1,
fPos, countValue, rawCount, rawMon);
fPos, countValue, rawCount, rawMon, data->fTime);
SCWrite(self->scanObject->pCon, pBueffel, eLog);
InvokeCallBack(self->scanObject->pCall, SCANPOINT, self->scanObject);
traceSys("diffscan","RUN: pos, count, rawcount, rawmon: %f, %d, %d, %d",

View File

@ -540,7 +540,7 @@ int WriteScanPoints(pScanData self, int iPoint)
strlcat(pLine, pItem,1024);
snprintf(pItem,sizeof(pItem)-1, "%-11ld ", pData->Monitors[2]);
strlcat(pLine, pItem,1024);
snprintf(pItem,sizeof(pItem)-1, "%-5.1f ", pData->fTime);
snprintf(pItem,sizeof(pItem)-1, "%-8.3f ", pData->fTime);
strlcat(pLine, pItem,1024);
}
fprintf(self->fd, "%s\n", pLine);