Skip to content

Commit

Permalink
fix: fixed average sampling time calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
klonyyy committed May 7, 2024
1 parent c2568bf commit ff131b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PlotHandler/PlotHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ void PlotHandler::dataHandler()

if (probeSettings.mode == IDebugProbe::Mode::HSS)
{
timer++;
auto maybeEntry = varReader->readSingleEntry();

if (!maybeEntry.has_value())
Expand All @@ -95,11 +94,11 @@ void PlotHandler::dataHandler()
}
plot->addTimePoint(entry.first);
}
timer++;
}

else if (t > ((1.0 / settings.sampleFrequencyHz) * timer))
{
timer++;
for (auto& [key, plot] : plotsMap)
{
if (!plot->getVisibility())
Expand All @@ -121,6 +120,7 @@ void PlotHandler::dataHandler()
plot->addPoint(name, ser->var->getValue());
plot->addTimePoint(t);
}
timer++;
}

sum += (t - lastT);
Expand Down

0 comments on commit ff131b6

Please sign in to comment.