2 #include "ui_moving_variance.h"
7 , _widget(new QWidget())
9 , _ring_view(_buffer.begin(), _buffer.end())
13 connect(
ui->spinBoxSamples, qOverload<int>(&QSpinBox::valueChanged),
this,
14 [=](
int) { emit parametersChanged(); });
16 connect(
ui->checkBoxStdDev, &QCheckBox::toggled,
this,
17 [=]() { emit parametersChanged(); });
36 if (buffer_size !=
_buffer.size())
56 const double avg = total / N;
61 const auto v = point.y - avg;
65 if (
ui->checkBoxStdDev->isChecked())
78 QDomElement& parent_element)
const
80 QDomElement widget_el = doc.createElement(
"options");
81 if (widget_el.isNull())
85 widget_el.setAttribute(
"value",
ui->spinBoxSamples->value());
86 widget_el.setAttribute(
"apply_sqrt",
87 ui->checkBoxStdDev->isChecked() ?
"true" :
"false");
88 parent_element.appendChild(widget_el);
94 QDomElement widget_el = parent_element.firstChildElement(
"options");
95 ui->spinBoxSamples->setValue(widget_el.attribute(
"value").toInt());
96 bool checked = widget_el.attribute(
"apply_sqrt") ==
"true";
97 ui->checkBoxStdDev->setChecked(checked);