@@ -2045,10 +2045,20 @@ TaskPostCalculator::TaskPostCalculator(ViewProviderFemPostCalculator* view, QWid
2045
2045
ui->let_function ->setText (QString::fromUtf8 (obj->Function .getValue ()));
2046
2046
ui->let_function ->blockSignals (false );
2047
2047
2048
+ ui->ckb_replace_invalid ->setChecked (obj->ReplaceInvalid .getValue ());
2049
+ ui->dsb_replacement_value ->setEnabled (obj->ReplaceInvalid .getValue ());
2050
+ ui->dsb_replacement_value ->setValue (obj->ReplacementValue .getValue ());
2051
+ ui->dsb_replacement_value ->setMaximum (FLOAT_MAX);
2052
+ ui->dsb_replacement_value ->setMinimum (FLOAT_MIN);
2053
+
2054
+ // fill completer with available fields
2048
2055
QCompleter* completer = new QCompleter (this );
2049
2056
auto fields = view->Field .getEnumVector ();
2050
2057
QStringList qlist;
2051
- for (const auto & f : fields) {
2058
+ for (const auto & f : obj->getScalarVariables ()) {
2059
+ qlist << QString::fromStdString (f);
2060
+ }
2061
+ for (const auto & f : obj->getVectorVariables ()) {
2052
2062
qlist << QString::fromStdString (f);
2053
2063
}
2054
2064
@@ -2072,6 +2082,14 @@ void TaskPostCalculator::setupConnections()
2072
2082
&QLineEdit::editingFinished,
2073
2083
this ,
2074
2084
&TaskPostCalculator::onFunctionChanged);
2085
+ connect (ui->dsb_replacement_value ,
2086
+ qOverload<double >(&QDoubleSpinBox::valueChanged),
2087
+ this ,
2088
+ &TaskPostCalculator::onReplacementValueChanged);
2089
+ connect (ui->ckb_replace_invalid ,
2090
+ &QCheckBox::toggled,
2091
+ this ,
2092
+ &TaskPostCalculator::onReplaceInvalidChanged);
2075
2093
}
2076
2094
2077
2095
void TaskPostCalculator::onFieldNameChanged ()
@@ -2090,8 +2108,22 @@ void TaskPostCalculator::onFunctionChanged()
2090
2108
obj->Function .setValue (function);
2091
2109
auto view = getTypedView<ViewProviderFemPostCalculator>();
2092
2110
recompute ();
2093
- view->updateMaterial ();
2111
+ // view->updateMaterial();
2094
2112
}
2095
2113
2114
+ void TaskPostCalculator::onReplaceInvalidChanged (bool state)
2115
+ {
2116
+ auto obj = static_cast <Fem::FemPostCalculatorFilter*>(getObject ());
2117
+ obj->ReplaceInvalid .setValue (state);
2118
+ ui->dsb_replacement_value ->setEnabled (state);
2119
+ recompute ();
2120
+ }
2121
+
2122
+ void TaskPostCalculator::onReplacementValueChanged (double value)
2123
+ {
2124
+ auto obj = static_cast <Fem::FemPostCalculatorFilter*>(getObject ());
2125
+ obj->ReplacementValue .setValue (value);
2126
+ recompute ();
2127
+ }
2096
2128
2097
2129
#include " moc_TaskPostBoxes.cpp"
0 commit comments