modernize C++: use bool literals

This commit is contained in:
wmayer
2023-08-05 23:44:44 +02:00
committed by wwmayer
parent 51a34d1fbd
commit 2a88c7c7df
25 changed files with 46 additions and 46 deletions

View File

@@ -97,7 +97,7 @@ TaskFemConstraintHeatflux::TaskFemConstraintHeatflux(
std::string constraint_type = pcConstraint->ConstraintType.getValueAsString();
if (constraint_type == "Convection") {
ui->rb_convection->setChecked(1);
ui->rb_convection->setChecked(true);
ui->sw_heatflux->setCurrentIndex(0);
Base::Quantity t =
Base::Quantity(pcConstraint->AmbientTemp.getValue(), Base::Unit::Temperature);
@@ -107,7 +107,7 @@ TaskFemConstraintHeatflux::TaskFemConstraintHeatflux(
ui->if_filmcoef->setValue(f);
}
else if (constraint_type == "DFlux") {
ui->rb_dflux->setChecked(1);
ui->rb_dflux->setChecked(true);
ui->sw_heatflux->setCurrentIndex(1);
Base::Quantity c = Base::Quantity(pcConstraint->DFlux.getValue(), Base::Unit::HeatFlux);
ui->if_heatflux->setValue(c);

View File

@@ -70,14 +70,14 @@ TaskFemConstraintTemperature::TaskFemConstraintTemperature(
std::string constraint_type = pcConstraint->ConstraintType.getValueAsString();
if (constraint_type == "Temperature") {
ui->rb_temperature->setChecked(1);
ui->rb_temperature->setChecked(true);
ui->if_temperature->setValue(pcConstraint->Temperature.getQuantityValue());
ui->if_temperature->bind(pcConstraint->Temperature);
ui->if_temperature->setUnit(pcConstraint->Temperature.getUnit());
}
else if (constraint_type == "CFlux") {
ui->rb_cflux->setChecked(1);
ui->rb_cflux->setChecked(true);
std::string str = "Concentrated heat flux";
ui->if_temperature->setValue(pcConstraint->CFlux.getQuantityValue());
ui->if_temperature->bind(pcConstraint->CFlux);

View File

@@ -98,13 +98,13 @@ TaskFemConstraintTransform::TaskFemConstraintTransform(
std::string transform_type = pcConstraint->TransformType.getValueAsString();
if (transform_type == "Rectangular") {
ui->sw_transform->setCurrentIndex(0);
ui->rb_rect->setChecked(1);
ui->rb_cylin->setChecked(0);
ui->rb_rect->setChecked(true);
ui->rb_cylin->setChecked(false);
}
else if (transform_type == "Cylindrical") {
ui->sw_transform->setCurrentIndex(1);
ui->rb_rect->setChecked(0);
ui->rb_cylin->setChecked(1);
ui->rb_rect->setChecked(false);
ui->rb_cylin->setChecked(true);
}
ui->lw_Rect->clear();

View File

@@ -734,7 +734,7 @@ bool ViewProviderFemPostObject::setupPipeline()
// Therefore the only way is the hack to filter only if the used Elmer CPU cores are > 1.
auto hGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/Mod/Fem/Elmer");
bool FilterMultiCPUResults = hGrp->GetBool("FilterMultiCPUResults", 1);
bool FilterMultiCPUResults = hGrp->GetBool("FilterMultiCPUResults", true);
int UseNumberOfCores = hGrp->GetInt("UseNumberOfCores", 1);
// filtering is only necessary for pipelines and warp filters
if (FilterMultiCPUResults && (UseNumberOfCores > 1)