Skip to content

Commit

Permalink
+ issue #2546: FEM constraint parameters can't be smaller than 0,01 (N)
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Aug 14, 2016
1 parent c5d0e08 commit 99ad0b7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
10 changes: 6 additions & 4 deletions src/Mod/Fem/Gui/TaskFemConstraintForce.cpp
Expand Up @@ -116,7 +116,7 @@ TaskFemConstraintForce::TaskFemConstraintForce(ViewProviderFemConstraintForce *C
ui->listReferences->addItem(makeRefText(Objects[i], SubElements[i]));
if (Objects.size() > 0)
ui->listReferences->setCurrentRow(0, QItemSelectionModel::ClearAndSelect);
ui->lineDirection->setText(dir.isEmpty() ? tr("") : dir);
ui->lineDirection->setText(dir.isEmpty() ? QString() : dir);
ui->checkReverse->setChecked(reversed);

ui->spinForce->blockSignals(false);
Expand Down Expand Up @@ -267,7 +267,7 @@ void TaskFemConstraintForce::onCheckReverse(const bool pressed)

double TaskFemConstraintForce::getForce(void) const
{
return ui->spinForce->value();
return ui->spinForce->value().getValue();
}

const std::string TaskFemConstraintForce::getReferences() const
Expand Down Expand Up @@ -357,13 +357,15 @@ bool TaskDlgFemConstraintForce::accept()

if (parameterForce->getForce()<=0)
{
QMessageBox::warning(parameter, tr("Input error"), tr("Please specify a force greater than 0"));
QMessageBox::warning(parameter, tr("Input error"), tr("Please specify a force greater than 0"));
return false;
}
else
{
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Force = %f",name.c_str(), parameterForce->getForce());
QByteArray num = QByteArray::number(parameterForce->getForce());
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Force = %s",name.c_str(), num.data());
}

std::string dirname = parameterForce->getDirectionName().data();
std::string dirobj = parameterForce->getDirectionObject().data();
std::string scale = "1";
Expand Down
15 changes: 8 additions & 7 deletions src/Mod/Fem/Gui/TaskFemConstraintForce.ui
Expand Up @@ -34,13 +34,7 @@
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="spinForce">
<property name="minimum">
<double>-99999.000000000000000</double>
</property>
<property name="maximum">
<double>99999.000000000000000</double>
</property>
<widget class="Gui::QuantitySpinBox" name="spinForce">
<property name="value">
<double>500.000000000000000</double>
</property>
Expand Down Expand Up @@ -84,6 +78,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Gui::QuantitySpinBox</class>
<extends>QWidget</extends>
<header>Gui/QuantitySpinBox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

0 comments on commit 99ad0b7

Please sign in to comment.