diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index e41f7b862..a7b3d5eaa 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -298,6 +298,7 @@ void DialogArc::LineAngles() void DialogArc::RadiusChanged() { labelEditFormula = ui->labelEditRadius; + labelResultCalculation = ui->labelResultRadius; ValFormulaChanged(flagRadius, ui->plainTextEditFormula, timerRadius); } @@ -308,6 +309,7 @@ void DialogArc::RadiusChanged() void DialogArc::F1Changed() { labelEditFormula = ui->labelEditF1; + labelResultCalculation = ui->labelResultF1; ValFormulaChanged(flagF1, ui->plainTextEditF1, timerF1); } @@ -318,6 +320,7 @@ void DialogArc::F1Changed() void DialogArc::F2Changed() { labelEditFormula = ui->labelEditF2; + labelResultCalculation = ui->labelResultF2; ValFormulaChanged(flagF2, ui->plainTextEditF2, timerF2); } @@ -341,7 +344,7 @@ void DialogArc::EvalRadius() { labelEditFormula = ui->labelEditRadius; const QString postfix = VDomDocument::UnitsToStr(qApp->patternUnit(), true); - Eval(ui->plainTextEditFormula->toPlainText(), flagRadius, timerRadius, ui->labelResultRadius, postfix); + Eval(ui->plainTextEditFormula->toPlainText(), flagRadius, ui->labelResultRadius, postfix); } //--------------------------------------------------------------------------------------------------------------------- @@ -352,7 +355,7 @@ void DialogArc::EvalF1() { labelEditFormula = ui->labelEditF1; const QString postfix = QStringLiteral("°"); - Eval(ui->plainTextEditF1->toPlainText(), flagF1, timerF1, ui->labelResultF1, postfix, false); + Eval(ui->plainTextEditF1->toPlainText(), flagF1, ui->labelResultF1, postfix, false); } //--------------------------------------------------------------------------------------------------------------------- @@ -363,7 +366,7 @@ void DialogArc::EvalF2() { labelEditFormula = ui->labelEditF2; const QString postfix = QStringLiteral("°"); - Eval(ui->plainTextEditF2->toPlainText(), flagF2, timerF2, ui->labelResultF2, postfix, false); + Eval(ui->plainTextEditF2->toPlainText(), flagF2, ui->labelResultF2, postfix, false); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp index 6c81c10bb..3f9ed69a7 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.cpp +++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp @@ -102,7 +102,7 @@ void DialogEditWrongFormula::EvalFormula() { SCASSERT(plainTextEditFormula != nullptr); SCASSERT(labelResultCalculation != nullptr); - Eval(plainTextEditFormula->toPlainText(), flagFormula, timerFormula, labelResultCalculation, postfix, checkZero); + Eval(plainTextEditFormula->toPlainText(), flagFormula, labelResultCalculation, postfix, checkZero); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index e1009d46a..4d02ddc91 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -97,8 +97,7 @@ void DialogEndLine::EvalAngle() { labelEditFormula = ui->labelEditAngle; const QString postfix = QStringLiteral("°"); - Eval(ui->plainTextEditAngle->toPlainText(), flagError, timerFormula, ui->labelResultCalculationAngle, postfix, - false); + Eval(ui->plainTextEditAngle->toPlainText(), flagError, ui->labelResultCalculationAngle, postfix, false); labelEditFormula = ui->labelEditFormula; } diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index f3c2e443f..dab266e3b 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -413,15 +413,12 @@ void DialogTool::ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer *tim * @brief Eval evaluate formula and show result * @param text formula * @param flag flag state of formula - * @param timer timer of formula * @param label label for signal error * @param postfix unit name * @param checkZero true - if formula can't be equal zero */ -void DialogTool::Eval(const QString &text, bool &flag, QTimer *timer, QLabel *label, const QString& postfix, - bool checkZero) +void DialogTool::Eval(const QString &text, bool &flag, QLabel *label, const QString& postfix, bool checkZero) { - SCASSERT(timer != nullptr); SCASSERT(label != nullptr); SCASSERT(labelEditFormula != nullptr); if (text.isEmpty()) @@ -484,7 +481,6 @@ void DialogTool::Eval(const QString &text, bool &flag, QTimer *timer, QLabel *la } } CheckState(); - //timer->stop(); } //--------------------------------------------------------------------------------------------------------------------- @@ -834,7 +830,7 @@ void DialogTool::EvalFormula() SCASSERT(plainTextEditFormula != nullptr); SCASSERT(labelResultCalculation != nullptr); const QString postfix = VDomDocument::UnitsToStr(qApp->patternUnit()); - Eval(plainTextEditFormula->toPlainText(), flagFormula, timerFormula, labelResultCalculation, postfix); + Eval(plainTextEditFormula->toPlainText(), flagFormula, labelResultCalculation, postfix); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index 659cc7069..afbf27350 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -221,7 +221,7 @@ protected: void PutValHere(QPlainTextEdit *plainTextEdit, QListWidget *listWidget); void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer); void ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer * timer); - void Eval(const QString &text, bool &flag, QTimer *timer, QLabel *label, const QString &postfix, + void Eval(const QString &text, bool &flag, QLabel *label, const QString &postfix, bool checkZero = true); void setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value) const; void setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value,