3 #include <QDoubleValidator> 6 _widget(new QWidget()),
7 ui(new
Ui::FirstDerivariveForm),
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 der = (p.y - prev.y) / dt;
81 QDomElement widget_el = doc.createElement(
"options");
83 if(
ui->radioActual->isChecked() )
85 widget_el.setAttribute(
"radioChecked",
"radioActual");
88 widget_el.setAttribute(
"radioChecked",
"radioCustom");
90 widget_el.setAttribute(
"lineEdit",
ui->lineEditCustom->text() );
92 parent_element.appendChild( widget_el );
98 QDomElement widget_el = parent_element.firstChildElement(
"options");
100 ui->lineEditCustom->setText( widget_el.attribute(
"lineEdit") );
102 if( widget_el.attribute(
"radioChecked") ==
"radioActual")
104 ui->radioActual->setChecked(
true);
107 ui->radioCustom->setChecked(
true);
122 std::vector<double> diff;
123 diff.reserve(data_size-1);
125 for(
size_t i=1; i<data_size; i++)
128 double delta = t - prev_t;
130 diff.push_back(delta);
134 size_t last = diff.size();
142 for(
size_t i=first; i<last; i++) {
145 double estimated_dt = total /
static_cast<double>(last-first);
146 ui->lineEditCustom->setText(QString::number(estimated_dt,
'g', 4));
148 if(
ui->radioCustom->isChecked() )
const Point & at(size_t index) const
Ui::FirstDerivariveForm * ui
bool xmlSaveState(QDomDocument &doc, QDomElement &parent_element) const override
~FirstDerivative() override
bool xmlLoadState(const QDomElement &parent_element) override
nonstd::optional< PlotData::Point > calculateNextPoint(size_t index) override
QWidget * optionsWidget() override
static int sort(lua_State *L)
void on_buttonCompute_clicked()
virtual size_t size() const
typename PlotDataBase< Value >::Point Point