Limited ErrorPlotter buffer size

main
mandlm 2015-11-16 17:27:42 +01:00
parent 0f7c617f9c
commit c5fbe764a6
2 changed files with 7 additions and 0 deletions

View File

@ -28,6 +28,11 @@ void ErrorPlotter::clear()
void ErrorPlotter::addErrorValue(double errorValue)
{
if (m_errorValues.size() == m_bufferSize)
{
m_errorValues.pop_front();
}
m_errorValues.push_back(errorValue);
m_maxErrorValue = std::max<double>(m_maxErrorValue, errorValue);

View File

@ -11,6 +11,8 @@ private:
std::list<double> m_errorValues;
double m_maxErrorValue;
size_t m_bufferSize = 10000;
public:
explicit ErrorPlotter(QWidget *parent = 0);