Base: Quantity: return std::string

This commit is contained in:
Ladislav Michl
2024-07-13 13:07:27 +02:00
committed by Yorik van Havre
parent c11b37e312
commit 2ea8a633ac
58 changed files with 573 additions and 592 deletions

View File

@@ -473,12 +473,12 @@ const std::string TaskFemConstraintContact::getReferences() const
const std::string TaskFemConstraintContact::getSlope() const
{
return ui->spbSlope->value().getSafeUserString().toStdString();
return ui->spbSlope->value().getSafeUserString();
}
const std::string TaskFemConstraintContact::getAdjust() const
{
return ui->spbAdjust->value().getSafeUserString().toStdString();
return ui->spbAdjust->value().getSafeUserString();
}
bool TaskFemConstraintContact::getFriction() const
@@ -493,7 +493,7 @@ double TaskFemConstraintContact::getFrictionCoeff() const
const std::string TaskFemConstraintContact::getStickSlope() const
{
return ui->spbStickSlope->value().getSafeUserString().toStdString();
return ui->spbStickSlope->value().getSafeUserString();
}
void TaskFemConstraintContact::changeEvent(QEvent*)

View File

@@ -378,32 +378,32 @@ const std::string TaskFemConstraintDisplacement::getReferences() const
std::string TaskFemConstraintDisplacement::get_spinxDisplacement() const
{
return ui->spinxDisplacement->value().getSafeUserString().toStdString();
return ui->spinxDisplacement->value().getSafeUserString();
}
std::string TaskFemConstraintDisplacement::get_spinyDisplacement() const
{
return ui->spinyDisplacement->value().getSafeUserString().toStdString();
return ui->spinyDisplacement->value().getSafeUserString();
}
std::string TaskFemConstraintDisplacement::get_spinzDisplacement() const
{
return ui->spinzDisplacement->value().getSafeUserString().toStdString();
return ui->spinzDisplacement->value().getSafeUserString();
}
std::string TaskFemConstraintDisplacement::get_spinxRotation() const
{
return ui->spinxRotation->value().getSafeUserString().toStdString();
return ui->spinxRotation->value().getSafeUserString();
}
std::string TaskFemConstraintDisplacement::get_spinyRotation() const
{
return ui->spinyRotation->value().getSafeUserString().toStdString();
return ui->spinyRotation->value().getSafeUserString();
}
std::string TaskFemConstraintDisplacement::get_spinzRotation() const
{
return ui->spinzRotation->value().getSafeUserString().toStdString();
return ui->spinzRotation->value().getSafeUserString();
}
std::string TaskFemConstraintDisplacement::get_xFormula() const

View File

@@ -338,7 +338,7 @@ void TaskFemConstraintForce::onCheckReverse(const bool pressed)
const std::string TaskFemConstraintForce::getForce() const
{
return ui->spinForce->value().getSafeUserString().toStdString();
return ui->spinForce->value().getSafeUserString();
}
const std::string TaskFemConstraintForce::getReferences() const

View File

@@ -401,29 +401,24 @@ const std::string TaskFemConstraintHeatflux::getReferences() const
std::string TaskFemConstraintHeatflux::getAmbientTemp() const
{
std::string temp;
if (ui->rb_convection->isChecked()) {
temp = ui->qsb_ambienttemp_conv->value().getSafeUserString().toStdString();
return ui->qsb_ambienttemp_conv->value().getSafeUserString();
}
else if (ui->rb_radiation->isChecked()) {
temp = ui->qsb_ambienttemp_rad->value().getSafeUserString().toStdString();
if (ui->rb_radiation->isChecked()) {
return ui->qsb_ambienttemp_rad->value().getSafeUserString();
}
else {
auto obj = ConstraintView->getObject<Fem::ConstraintHeatflux>();
temp = obj->AmbientTemp.getQuantityValue().getSafeUserString().toStdString();
}
return temp;
auto obj = ConstraintView->getObject<Fem::ConstraintHeatflux>();
return obj->AmbientTemp.getQuantityValue().getSafeUserString();
}
std::string TaskFemConstraintHeatflux::getFilmCoef() const
{
return ui->qsb_film_coef->value().getSafeUserString().toStdString();
return ui->qsb_film_coef->value().getSafeUserString();
}
std::string TaskFemConstraintHeatflux::getDFlux() const
{
return ui->qsb_heat_flux->value().getSafeUserString().toStdString();
return ui->qsb_heat_flux->value().getSafeUserString();
}
double TaskFemConstraintHeatflux::getEmissivity() const

View File

@@ -70,7 +70,7 @@ TaskFemConstraintInitialTemperature::~TaskFemConstraintInitialTemperature() = de
std::string TaskFemConstraintInitialTemperature::get_temperature() const
{
return ui->if_temperature->value().getSafeUserString().toStdString();
return ui->if_temperature->value().getSafeUserString();
}
void TaskFemConstraintInitialTemperature::changeEvent(QEvent*)

View File

@@ -250,7 +250,7 @@ const std::string TaskFemConstraintPressure::getReferences() const
std::string TaskFemConstraintPressure::getPressure() const
{
return ui->if_pressure->value().getSafeUserString().toStdString();
return ui->if_pressure->value().getSafeUserString();
}
bool TaskFemConstraintPressure::getReverse() const

View File

@@ -116,7 +116,7 @@ TaskFemConstraintRigidBody::TaskFemConstraintRigidBody(
Base::Vector3d rotDir;
double rotAngleRad;
pcConstraint->Rotation.getValue().getValue(rotDir, rotAngleRad);
Base::Quantity rotAngle(rotAngleRad, QString::fromUtf8("rad"));
Base::Quantity rotAngle(rotAngleRad, "rad");
Base::Quantity forceX = pcConstraint->ForceX.getQuantityValue();
Base::Quantity forceY = pcConstraint->ForceY.getQuantityValue();
Base::Quantity forceZ = pcConstraint->ForceZ.getQuantityValue();
@@ -581,18 +581,18 @@ Base::Rotation TaskFemConstraintRigidBody::getRotation() const
std::vector<std::string> TaskFemConstraintRigidBody::getForce() const
{
std::string x = ui->qsb_force_x->value().getSafeUserString().toStdString();
std::string y = ui->qsb_force_y->value().getSafeUserString().toStdString();
std::string z = ui->qsb_force_z->value().getSafeUserString().toStdString();
std::string x = ui->qsb_force_x->value().getSafeUserString();
std::string y = ui->qsb_force_y->value().getSafeUserString();
std::string z = ui->qsb_force_z->value().getSafeUserString();
return {x, y, z};
}
std::vector<std::string> TaskFemConstraintRigidBody::getMoment() const
{
std::string x = ui->qsb_moment_x->value().getSafeUserString().toStdString();
std::string y = ui->qsb_moment_y->value().getSafeUserString().toStdString();
std::string z = ui->qsb_moment_z->value().getSafeUserString().toStdString();
std::string x = ui->qsb_moment_x->value().getSafeUserString();
std::string y = ui->qsb_moment_y->value().getSafeUserString();
std::string z = ui->qsb_moment_z->value().getSafeUserString();
return std::vector<std::string>({x, y, z});
}

View File

@@ -248,12 +248,12 @@ const std::string TaskFemConstraintSpring::getReferences() const
std::string TaskFemConstraintSpring::getNormalStiffness() const
{
return ui->qsb_norm->value().getSafeUserString().toStdString();
return ui->qsb_norm->value().getSafeUserString();
}
std::string TaskFemConstraintSpring::getTangentialStiffness() const
{
return ui->qsb_tan->value().getSafeUserString().toStdString();
return ui->qsb_tan->value().getSafeUserString();
}
std::string TaskFemConstraintSpring::getElmerStiffness() const

View File

@@ -306,12 +306,12 @@ const std::string TaskFemConstraintTemperature::getReferences() const
std::string TaskFemConstraintTemperature::get_temperature() const
{
return ui->qsb_temperature->value().getSafeUserString().toStdString();
return ui->qsb_temperature->value().getSafeUserString();
}
std::string TaskFemConstraintTemperature::get_cflux() const
{
return ui->qsb_cflux->value().getSafeUserString().toStdString();
return ui->qsb_cflux->value().getSafeUserString();
}
std::string TaskFemConstraintTemperature::get_constraint_type() const

View File

@@ -118,7 +118,7 @@ TaskFemConstraintTransform::TaskFemConstraintTransform(
ui->spb_rot_axis_x->setValue(axis.x);
ui->spb_rot_axis_y->setValue(axis.y);
ui->spb_rot_axis_z->setValue(axis.z);
Base::Quantity rotAngle(angle, QString::fromUtf8("rad"));
Base::Quantity rotAngle(angle, "rad");
ui->qsb_rot_angle->setValue(rotAngle.getValueAs(Base::Quantity::Degree));
ui->spb_rot_axis_x->bind(
@@ -406,7 +406,7 @@ void TaskFemConstraintTransform::addToSelection()
ui->spb_rot_axis_x->setValue(axis.x);
ui->spb_rot_axis_y->setValue(axis.y);
ui->spb_rot_axis_z->setValue(axis.z);
Base::Quantity rotAngle(angle, QString::fromUtf8("rad"));
Base::Quantity rotAngle(angle, "rad");
ui->qsb_rot_angle->setValue(rotAngle.getValueAs(Base::Quantity::Degree));
}
}