1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

hmm we missed it again. The old version did not take virt time into account

This commit is contained in:
Manuel Pitz 2020-11-10 19:00:17 +01:00
parent fb2d3a0d9e
commit 6ba78b34e1

View file

@ -121,7 +121,13 @@ public:
if (isEdge) {
if (isSynced) {
timeErr += 1.0 - (cntSmps * period);
//timeErr += 1.0 - (cntSmps * period);
if(tsVirt.tv_nsec > 0.5e9)
timeErr += 1.0 - (tsVirt.tv_nsec / 1.0e9);
else
timeErr -= (tsVirt.tv_nsec / 1.0e9);
filtWin[cntEdges % filtLen] = cntSmpsTotal;
/* Estimated sample period over last 'horizonEst' seconds */
unsigned int tmp = cntEdges < filtLen ? cntEdges : horizonEst;
@ -141,7 +147,7 @@ public:
cntSmps = 0;
cntEdges++;
//info("Time Error is: %f periodEst %f periodErrComp %f", timeErr, periodEst, periodErrComp);
info("Time Error is: %f periodEst %f periodErrComp %f", timeErr, periodEst, periodErrComp);
}
cntSmps++;