diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp index 94e9b8048..c72dcdad6 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp @@ -319,8 +319,13 @@ void DialogEditWrongFormula::AngleLines() */ void DialogEditWrongFormula::Increments() { - ui->checkBoxHideEmpty->setEnabled(false); - ShowVariable(data->DataIncrements()); + ShowIncrementsInPreviewCalculation(false); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogEditWrongFormula::PreviewCalculations() +{ + ShowIncrementsInPreviewCalculation(true); } //--------------------------------------------------------------------------------------------------------------------- @@ -439,6 +444,9 @@ void DialogEditWrongFormula::InitVariables() connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogEditWrongFormula::Increments); connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, ClearFilterFormulaInputs); + connect(ui->radioButtonPC, &QRadioButton::clicked, this, &DialogEditWrongFormula::PreviewCalculations); + connect(ui->radioButtonPC, &QRadioButton::clicked, this, ClearFilterFormulaInputs); + connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogEditWrongFormula::LengthLines); connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, ClearFilterFormulaInputs); @@ -583,6 +591,27 @@ void DialogEditWrongFormula::ShowFunctions() ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogEditWrongFormula::ShowIncrementsInPreviewCalculation(bool show) +{ + ui->checkBoxHideEmpty->setEnabled(false); + + QMap > increments; + + const QMap > list = data->DataIncrements(); + QMap >::const_iterator i = list.constBegin(); + while (i != list.constEnd()) + { + if(i.value()->IsPreviewCalculation() == show) + { + increments.insert(i.key(), i.value()); + } + ++i; + } + + ShowVariable(increments); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogEditWrongFormula::FilterVariablesEdited(const QString &filter) { diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.h b/src/libs/vtools/dialogs/support/dialogeditwrongformula.h index 957b9f49f..4d536f06b 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.h +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.h @@ -87,6 +87,7 @@ public slots: void CurvesCLength(); void AngleLines(); void Increments(); + void PreviewCalculations(); void Functions(); protected: virtual void CheckState() Q_DECL_FINAL; @@ -116,6 +117,7 @@ private: void ShowVariable(const QMap &var); void ShowMeasurements(const QMap > &var); void ShowFunctions(); + void ShowIncrementsInPreviewCalculation(bool show); void SetDescription(const QString &name, qreal value, const QString &unit, const QString &description); }; diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui b/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui index 211bf7b3f..6ff4ad1fb 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui @@ -10,7 +10,7 @@ 0 0 448 - 425 + 526 @@ -255,6 +255,13 @@ + + + + Preview calculations + + +