Skip to content

Commit

Permalink
FEM: Update TaskFemConstraintHeatflux.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
FEA-eng authored Apr 12, 2024
1 parent 50572d4 commit fbd88b0
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ TaskFemConstraintHeatflux::TaskFemConstraintHeatflux(
qOverload<double>(&InputField::valueChanged),
this,
&TaskFemConstraintHeatflux::onEmissivityChanged);
connect(ui->if_ambienttemp2,
qOverload<double>(&InputField::valueChanged),
this,
&TaskFemConstraintHeatflux::onAmbientTempChanged);
connect(ui->lw_references,
&QListWidget::itemClicked,
this,
Expand All @@ -93,6 +97,7 @@ TaskFemConstraintHeatflux::TaskFemConstraintHeatflux(
// ui->if_facetemp->blockSignals(true);
ui->if_filmcoef->blockSignals(true);
ui->if_emissivity->blockSignals(true);
ui->if_ambienttemp2->blockSignals(true);
ui->lw_references->blockSignals(true);
ui->btnAdd->blockSignals(true);
ui->btnRemove->blockSignals(true);
Expand All @@ -113,6 +118,9 @@ TaskFemConstraintHeatflux::TaskFemConstraintHeatflux(
ui->if_emissivity->setMinimum(0);
ui->if_emissivity->setMaximum(FLOAT_MAX);

ui->if_ambienttemp2->setMinimum(0);
ui->if_ambienttemp2->setMaximum(FLOAT_MAX);

std::string constraint_type = pcConstraint->ConstraintType.getValueAsString();
if (constraint_type == "Convection") {
ui->rb_convection->setChecked(true);
Expand All @@ -129,7 +137,7 @@ TaskFemConstraintHeatflux::TaskFemConstraintHeatflux(
ui->sw_heatflux->setCurrentIndex(1);
Base::Quantity t =

Check warning on line 138 in src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

variable name 't' is too short, expected at least 2 characters [readability-identifier-length]
Base::Quantity(pcConstraint->AmbientTemp.getValue(), Base::Unit::Temperature);
ui->if_ambienttemp->setValue(t);
ui->if_ambienttemp2->setValue(t);
Base::Quantity e = Base::Quantity(pcConstraint->Emissivity.getValue(), Base::Unit());

Check warning on line 141 in src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

variable name 'e' is too short, expected at least 2 characters [readability-identifier-length]
ui->if_emissivity->setValue(e);
}
Expand All @@ -156,6 +164,7 @@ TaskFemConstraintHeatflux::TaskFemConstraintHeatflux(
// ui->if_facetemp->blockSignals(false);
ui->if_filmcoef->blockSignals(false);
ui->if_emissivity->blockSignals(false);
ui->if_ambienttemp2->blockSignals(false);
ui->lw_references->blockSignals(false);
ui->btnAdd->blockSignals(false);
ui->btnRemove->blockSignals(false);
Expand Down Expand Up @@ -230,7 +239,7 @@ void TaskFemConstraintHeatflux::Rad()
name.c_str(),
get_constraint_type().c_str());
Base::Quantity t = Base::Quantity(300, Base::Unit::Temperature);
ui->if_ambienttemp->setValue(t);
ui->if_ambienttemp2->setValue(t);
pcConstraint->AmbientTemp.setValue(300);
Base::Quantity e = Base::Quantity(1, Base::Unit());
ui->if_emissivity->setValue(e);
Expand Down Expand Up @@ -407,7 +416,13 @@ const std::string TaskFemConstraintHeatflux::getReferences() const

double TaskFemConstraintHeatflux::getAmbientTemp() const
{
Base::Quantity temperature = ui->if_ambienttemp->getQuantity();
Base::Quantity temperature;
if (ui->rb_convection->isChecked()) {
temperature = ui->if_ambienttemp->getQuantity();
}
else if (ui->rb_radiation->isChecked()){
temperature = ui->if_ambienttemp2->getQuantity();
}
double temperature_in_kelvin = temperature.getValueAs(Base::Quantity::Kelvin);
return temperature_in_kelvin;
}
Expand Down Expand Up @@ -454,10 +469,12 @@ void TaskFemConstraintHeatflux::changeEvent(QEvent* e)
ui->if_ambienttemp->blockSignals(true);
ui->if_filmcoef->blockSignals(true);
ui->if_emissivity->blockSignals(true);
ui->if_ambienttemp2->blockSignals(true);
ui->retranslateUi(proxy);
ui->if_ambienttemp->blockSignals(false);
ui->if_filmcoef->blockSignals(false);
ui->if_emissivity->blockSignals(true);
ui->if_ambienttemp2->blockSignals(false);
}
}

Expand Down

0 comments on commit fbd88b0

Please sign in to comment.