3 #include <QDoubleValidator> 6 _widget(new QWidget()),
11 ui->lineEditCustom->setValidator(
new QDoubleValidator(0.0001, 1000, 4,
ui->lineEditCustom) );
13 connect(
ui->buttonCompute, &QPushButton::clicked,
16 connect(
ui->lineEditCustom, &QLineEdit::editingFinished,
18 _dT = ui->lineEditCustom->text().toDouble();
19 emit parametersChanged();
22 connect(
ui->radioActual, &QRadioButton::toggled,
23 this, [=](
bool toggled){
26 emit parametersChanged();
30 connect(ui->radioCustom, &QRadioButton::toggled,
31 this, [=](
bool toggled){
33 _dT = ui->lineEditCustom->text().toDouble();
34 emit parametersChanged();
56 double dt = (
_dT == 0.0) ? (p.x - prev.x) :
_dT;
63 double val = (p.y + prev.y) * dt / (2.0);
83 TimeSeriesTransform::init();
88 QDomElement widget_el = doc.createElement(
"options");
90 if(
ui->radioActual->isChecked() )
92 widget_el.setAttribute(
"radioChecked",
"radioActual");
95 widget_el.setAttribute(
"radioChecked",
"radioCustom");
97 widget_el.setAttribute(
"lineEdit",
ui->lineEditCustom->text() );
99 parent_element.appendChild( widget_el );
105 QDomElement widget_el = parent_element.firstChildElement(
"options");
107 ui->lineEditCustom->setText( widget_el.attribute(
"lineEdit") );
109 if( widget_el.attribute(
"radioChecked") ==
"radioActual")
111 ui->radioActual->setChecked(
true);
114 ui->radioCustom->setChecked(
true);
129 std::vector<double> diff;
130 diff.reserve(data_size-1);
132 for(
size_t i=1; i<data_size; i++)
135 double delta = t - prev_t;
137 diff.push_back(delta);
141 size_t last = diff.size();
149 for(
size_t i=first; i<last; i++) {
152 double estimated_dt = total /
static_cast<double>(last-first);
153 ui->lineEditCustom->setText(QString::number(estimated_dt,
'g', 4));
155 if(
ui->radioCustom->isChecked() )
const Point & at(size_t index) const
static int sort(lua_State *L)
virtual size_t size() const
typename PlotDataBase< Value >::Point Point