diff --git a/src/Mod/Fem/FemCommands.py b/src/Mod/Fem/FemCommands.py
index d31ffa503..635691fda 100644
--- a/src/Mod/Fem/FemCommands.py
+++ b/src/Mod/Fem/FemCommands.py
@@ -103,6 +103,11 @@ class FemCommands(object):
for acnstrmesh in FemGui.getActiveAnalysis().Member:
# if "Constraint" in acnstrmesh.TypeId:
# acnstrmesh.ViewObject.Visibility = False
+ fem_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem")
+ hide_constraints = fem_prefs.GetBool("HideConstraint", False)
+ if hide_constraints:
+ if "Constraint" in acnstrmesh.TypeId:
+ acnstrmesh.ViewObject.Visibility = False
if "Mesh" in acnstrmesh.TypeId:
aparttoshow = acnstrmesh.Name.replace("_Mesh", "")
for apart in FreeCAD.activeDocument().Objects:
diff --git a/src/Mod/Fem/FemToolsCcx.py b/src/Mod/Fem/FemToolsCcx.py
index 83ea7f8ad..59e90151c 100644
--- a/src/Mod/Fem/FemToolsCcx.py
+++ b/src/Mod/Fem/FemToolsCcx.py
@@ -110,8 +110,8 @@ class FemToolsCcx(FemTools.FemTools):
def setup_ccx(self, ccx_binary=None, ccx_binary_sig="CalculiX"):
from platform import system
if not ccx_binary:
- self.fem_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem")
- ccx_binary = self.fem_prefs.GetString("ccxBinaryPath", "")
+ self.ccx_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Ccx")
+ ccx_binary = self.ccx_prefs.GetString("ccxBinaryPath", "")
if not ccx_binary:
if system() == "Linux":
ccx_binary = "ccx"
diff --git a/src/Mod/Fem/Gui/DlgSettingsFem.ui b/src/Mod/Fem/Gui/DlgSettingsFem.ui
index d632ec2f4..9f7c6fdd9 100644
--- a/src/Mod/Fem/Gui/DlgSettingsFem.ui
+++ b/src/Mod/Fem/Gui/DlgSettingsFem.ui
@@ -14,7 +14,16 @@
FEM
-
+
+ 9
+
+
+ 9
+
+
+ 9
+
+
9
@@ -95,133 +104,6 @@
- -
-
-
-
- 0
- 0
-
-
-
- Qt::LeftToRight
-
-
- CalculiX
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
-
-
-
- QLayout::SetNoConstraint
-
-
-
-
-
-
-
-
- Use internal editor for .inp files
-
-
- true
-
-
- UseInternalEditor
-
-
- Mod/Fem
-
-
-
- -
-
-
-
-
-
- false
-
-
-
- 100
- 0
-
-
-
- External editor:
-
-
-
- -
-
-
- false
-
-
- ExternalEditorPath
-
-
- Mod/Fem
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 0
- 0
-
-
-
-
- 0
- 0
-
-
-
-
- 0
- 0
-
-
-
- Leave blank to use default CalculiX ccx binary file
-
-
- ccxBinaryPath
-
-
- Mod/Fem
-
-
-
- -
-
-
-
- 100
- 0
-
-
-
- ccx binary
-
-
-
-
-
-
-
-
-
-
-
@@ -304,170 +186,6 @@
- -
-
-
- Default solver settings
-
-
-
-
-
-
-
-
-
-
- 148
- 0
-
-
-
- Default type on analysis
-
-
- AnalysisType
-
-
- Mod/Fem
-
-
-
-
- Static
-
-
-
- :/icons/fem-new-analysis.svg:/icons/fem-new-analysis.svg
-
-
- -
-
- Frequency
-
-
-
- :/icons/fem-frequency-analysis.svg:/icons/fem-frequency-analysis.svg
-
-
- -
-
- Thermomech
-
-
-
- :/icons/fem-new-analysis.svg:/icons/fem-new-analysis.svg
-
-
-
-
- -
-
-
- Eigenmode number
-
-
-
- -
-
-
- Type
-
-
-
- -
-
-
- 100
-
-
- 10
-
-
- NumberOfEigenmode
-
-
- Mod/Fem
-
-
-
- -
-
-
- High frequency limit
-
-
-
- -
-
-
- 1
-
-
- 1000000.000000000000000
-
-
- 10000.000000000000000
-
-
- 1000000.000000000000000
-
-
- EigenmodeHighLimit
-
-
- Mod/Fem
-
-
-
- -
-
-
- Low frequency limit
-
-
-
- -
-
-
- 1
-
-
- 0.000000000000000
-
-
- 1000000.000000000000000
-
-
- 10000.000000000000000
-
-
- 0.000000000000000
-
-
- EigenmodeLowLimit
-
-
- Mod/Fem
-
-
-
- -
-
-
- Hz
-
-
-
- -
-
-
- Hz
-
-
-
-
-
-
-
-
-
@@ -617,6 +335,28 @@
+ -
+
+
+ true
+
+
+ Hide Constraints when plotting results
+
+
+ true
+
+
+ false
+
+
+ HideConstraint
+
+
+ Mod/Fem
+
+
+
@@ -641,6 +381,11 @@
+
+ Gui::PrefCheckBox
+ QCheckBox
+
+
Gui::FileChooser
QWidget
@@ -651,95 +396,11 @@
Gui::FileChooser
-
- Gui::PrefSpinBox
- QSpinBox
-
-
-
- Gui::PrefCheckBox
- QCheckBox
-
-
-
- Gui::PrefComboBox
- QComboBox
-
-
-
- Gui::PrefDoubleSpinBox
- QDoubleSpinBox
-
-
-
- cb_int_editor
- toggled(bool)
- l_ext_editor
- setEnabled(bool)
-
-
- 100
- 47
-
-
- 99
- 76
-
-
-
-
- cb_int_editor
- toggled(bool)
- fc_ext_editor
- setEnabled(bool)
-
-
- 327
- 54
-
-
- 323
- 79
-
-
-
-
- cb_int_editor
- toggled(bool)
- l_ext_editor
- setDisabled(bool)
-
-
- 125
- 49
-
-
- 120
- 74
-
-
-
-
- cb_int_editor
- toggled(bool)
- fc_ext_editor
- setDisabled(bool)
-
-
- 409
- 50
-
-
- 406
- 78
-
-
-
cb_use_mat_from_custom_dir
toggled(bool)
diff --git a/src/Mod/Fem/Gui/DlgSettingsFemCcx.ui b/src/Mod/Fem/Gui/DlgSettingsFemCcx.ui
index 0adb95b99..dce9aac6e 100644
--- a/src/Mod/Fem/Gui/DlgSettingsFemCcx.ui
+++ b/src/Mod/Fem/Gui/DlgSettingsFemCcx.ui
@@ -7,7 +7,7 @@
0
0
555
- 518
+ 628
@@ -16,21 +16,141 @@
-
+
-
+
+
+
+ 0
+ 0
+
+
+
+ Qt::LeftToRight
+
+
+ CalculiX
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+
+ QLayout::SetNoConstraint
+
+
-
+
+
-
+
+
+ Use internal editor for .inp files
+
+
+ true
+
+
+ UseInternalEditor
+
+
+ Mod/Fem
+
+
+
+ -
+
+
-
+
+
+ false
+
+
+
+ 100
+ 0
+
+
+
+ External editor:
+
+
+
+ -
+
+
+ false
+
+
+ ExternalEditorPath
+
+
+ Mod/Fem
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+ Leave blank to use default CalculiX ccx binary file
+
+
+ ccxBinaryPath
+
+
+ Mod/Fem
+
+
+
+ -
+
+
+
+ 100
+ 0
+
+
+
+ ccx binary
+
+
+
+
+
+
+
+
+
+
-
- Solver preferences
+ Solver defaults
-
-
-
-
-
- Number of CPU's to use (Spooles only)
-
-
-
-
@@ -127,27 +247,64 @@
- -
-
+
-
+
- Hide Constraints when plotting results
+ Number of CPU's to use (Spooles only)
+
+
+
+ -
+
+
+ Type
-
-
-
- Hide
+
+
+
+ 148
+ 0
+
-
- false
+
+ Default type on analysis
- HideConstraint
+ AnalysisType
- Mod/Fem/Ccx
+ Mod/Fem
+
-
+
+ Static
+
+
+
+ :/icons/fem-new-analysis.svg:/icons/fem-new-analysis.svg
+
+
+ -
+
+ Frequency
+
+
+
+ :/icons/fem-frequency-analysis.svg:/icons/fem-frequency-analysis.svg
+
+
+ -
+
+ Thermomech
+
+
+
+ :/icons/fem-new-analysis.svg:/icons/fem-new-analysis.svg
+
+
@@ -158,7 +315,7 @@
-
- Thermo mechanical analysis settings
+ Thermo mechanical defaults
-
@@ -284,6 +441,117 @@
+ -
+
+
+ Frequency defaults
+
+
+
-
+
+
-
+
+
+ 100
+
+
+ 10
+
+
+ NumberOfEigenmode
+
+
+ Mod/Fem
+
+
+
+ -
+
+
+ Eigenmode number
+
+
+
+ -
+
+
+ High frequency limit
+
+
+
+ -
+
+
+ 1
+
+
+ 1000000.000000000000000
+
+
+ 10000.000000000000000
+
+
+ 1000000.000000000000000
+
+
+ EigenmodeHighLimit
+
+
+ Mod/Fem
+
+
+
+ -
+
+
+ Low frequency limit
+
+
+
+ -
+
+
+ 1
+
+
+ 0.000000000000000
+
+
+ 1000000.000000000000000
+
+
+ 10000.000000000000000
+
+
+ 0.000000000000000
+
+
+ EigenmodeLowLimit
+
+
+ Mod/Fem
+
+
+
+ -
+
+
+ Hz
+
+
+
+ -
+
+
+ Hz
+
+
+
+
+
+
+
+
-
@@ -323,6 +591,16 @@
QDoubleSpinBox
+
+ Gui::FileChooser
+ QWidget
+
+
+
+ Gui::PrefFileChooser
+ Gui::FileChooser
+
+
diff --git a/src/Mod/Fem/Gui/DlgSettingsFemCcxImp.cpp b/src/Mod/Fem/Gui/DlgSettingsFemCcxImp.cpp
index a7bb2944e..0640ce27e 100644
--- a/src/Mod/Fem/Gui/DlgSettingsFemCcxImp.cpp
+++ b/src/Mod/Fem/Gui/DlgSettingsFemCcxImp.cpp
@@ -47,36 +47,53 @@ void DlgSettingsFemCcxImp::saveSettings()
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Mod/Fem/Ccx");
hGrp->SetInt("Solver", cmb_solver->currentIndex());
-
- //OvG: Solver settings
+ hGrp->SetInt("AnalysisType", cb_analysis_type->currentIndex());
+
sb_ccx_numcpu->onSave(); //Number of CPUs
cmb_solver->onSave();
cb_ccx_non_lin_geom->onSave();
- cb_hide_constraint->onSave();
-
+
cb_static->onSave();
sb_ccx_max_iterations->onSave(); //Max number of iterations
dsb_ccx_initial_time_step->onSave(); //Initial time step
dsb_ccx_analysis_time->onSave(); //Analysis time
+
+ cb_analysis_type->onSave();
+ sb_eigenmode_number->onSave();
+ dsb_eigenmode_high_limit->onSave();
+ dsb_eigenmode_low_limit->onSave();
+
+ cb_int_editor->onSave();
+ fc_ext_editor->onSave();
+ fc_ccx_binary->onSave();
}
void DlgSettingsFemCcxImp::loadSettings()
{
- //OvG: Solver settings
sb_ccx_numcpu->onRestore(); //Number of CPUs
cmb_solver->onRestore();
cb_ccx_non_lin_geom->onRestore();
- cb_hide_constraint->onRestore();
-
+
cb_static->onRestore();
sb_ccx_max_iterations->onRestore(); //Max number of iterations
dsb_ccx_initial_time_step->onRestore(); //Initial time step
dsb_ccx_analysis_time->onRestore(); //Analysis time
+ cb_analysis_type->onRestore();
+ sb_eigenmode_number->onRestore();
+ dsb_eigenmode_high_limit->onRestore();
+ dsb_eigenmode_low_limit->onRestore();
+
+ cb_int_editor->onRestore();
+ fc_ext_editor->onRestore();
+ fc_ccx_binary->onRestore();
+
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Mod/Fem/Ccx");
- int index = hGrp->GetInt("Solver", 0);
+ int index = hGrp->GetInt("Solver", 0);
if (index > -1) cmb_solver->setCurrentIndex(index);
+ index = hGrp->GetInt("AnalysisType", 0);
+ if (index > -1) cb_analysis_type->setCurrentIndex(index);
}
/**
@@ -85,6 +102,9 @@ void DlgSettingsFemCcxImp::loadSettings()
void DlgSettingsFemCcxImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
+ int c_index = cb_analysis_type->currentIndex();
+ retranslateUi(this);
+ cb_analysis_type->setCurrentIndex(c_index);
}
else {
QWidget::changeEvent(e);
diff --git a/src/Mod/Fem/Gui/DlgSettingsFemImp.cpp b/src/Mod/Fem/Gui/DlgSettingsFemImp.cpp
index c72e949db..cb666e617 100644
--- a/src/Mod/Fem/Gui/DlgSettingsFemImp.cpp
+++ b/src/Mod/Fem/Gui/DlgSettingsFemImp.cpp
@@ -44,49 +44,34 @@ DlgSettingsFemImp::~DlgSettingsFemImp()
void DlgSettingsFemImp::saveSettings()
{
- ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
- ("User parameter:BaseApp/Preferences/Mod/Fem");
- hGrp->SetInt("AnalysisType", cb_analysis_type->currentIndex());
-
fc_analysis_working_directory->onSave();
- cb_int_editor->onSave();
- fc_ext_editor->onSave();
- fc_ccx_binary->onSave();
+
fc_z88_binary->onSave();
- cb_analysis_type->onSave();
- sb_eigenmode_number->onSave();
- dsb_eigenmode_high_limit->onSave();
- dsb_eigenmode_low_limit->onSave();
+
cb_use_built_in_materials->onSave();
cb_use_mat_from_config_dir->onSave();
cb_use_mat_from_custom_dir->onSave();
fc_custom_mat_dir->onSave();
+
cb_restore_result_dialog->onSave();
cb_keep_results_on_rerun->onSave();
+ cb_hide_constraint->onSave();
}
void DlgSettingsFemImp::loadSettings()
{
fc_analysis_working_directory->onRestore();
- cb_int_editor->onRestore();
- fc_ext_editor->onRestore();
- fc_ccx_binary->onRestore();
+
fc_z88_binary->onRestore();
- cb_analysis_type->onRestore();
- sb_eigenmode_number->onRestore();
- dsb_eigenmode_high_limit->onRestore();
- dsb_eigenmode_low_limit->onRestore();
+
cb_use_built_in_materials->onRestore();
cb_use_mat_from_config_dir->onRestore();
cb_use_mat_from_custom_dir->onRestore();
fc_custom_mat_dir->onRestore();
+
cb_restore_result_dialog->onRestore();
cb_keep_results_on_rerun->onRestore();
-
- ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
- ("User parameter:BaseApp/Preferences/Mod/Fem");
- int index = hGrp->GetInt("AnalysisType", 0);
- if (index > -1) cb_analysis_type->setCurrentIndex(index);
+ cb_hide_constraint->onRestore();
}
/**
@@ -95,9 +80,6 @@ void DlgSettingsFemImp::loadSettings()
void DlgSettingsFemImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
- int c_index = cb_analysis_type->currentIndex();
- retranslateUi(this);
- cb_analysis_type->setCurrentIndex(c_index);
}
else {
QWidget::changeEvent(e);
diff --git a/src/Mod/Fem/_FemSolverCalculix.py b/src/Mod/Fem/_FemSolverCalculix.py
index cfe707472..73581968c 100644
--- a/src/Mod/Fem/_FemSolverCalculix.py
+++ b/src/Mod/Fem/_FemSolverCalculix.py
@@ -47,7 +47,7 @@ class _FemSolverCalculix():
obj.addProperty("App::PropertyEnumeration", "AnalysisType", "Fem", "Type of the analysis")
obj.AnalysisType = FemToolsCcx.FemToolsCcx.known_analysis_types
- analysis_type = fem_prefs.GetInt("AnalysisType", 0)
+ analysis_type = ccx_prefs.GetInt("AnalysisType", 0)
obj.AnalysisType = FemToolsCcx.FemToolsCcx.known_analysis_types[analysis_type]
known_geom_nonlinear_types = ["linear", "nonlinear"]
@@ -60,16 +60,16 @@ class _FemSolverCalculix():
obj.GeometricalNonlinearity = known_geom_nonlinear_types[0] # linear
obj.addProperty("App::PropertyIntegerConstraint", "NumberOfEigenmodes", "Fem", "Number of modes for frequency calculations")
- noe = fem_prefs.GetInt("NumberOfEigenmodes", 10)
+ noe = ccx_prefs.GetInt("NumberOfEigenmodes", 10)
obj.NumberOfEigenmodes = (noe, 1, 100, 1)
obj.addProperty("App::PropertyFloatConstraint", "EigenmodeLowLimit", "Fem", "Low frequency limit for eigenmode calculations")
# Not yet in prefs, so it will always default to 0.0
- ell = fem_prefs.GetFloat("EigenmodeLowLimit", 0.0)
+ ell = ccx_prefs.GetFloat("EigenmodeLowLimit", 0.0)
obj.EigenmodeLowLimit = (ell, 0.0, 1000000.0, 10000.0)
obj.addProperty("App::PropertyFloatConstraint", "EigenmodeHighLimit", "Fem", "High frequency limit for eigenmode calculations")
- ehl = fem_prefs.GetFloat("EigenmodeHighLimit", 1000000.0)
+ ehl = ccx_prefs.GetFloat("EigenmodeHighLimit", 1000000.0)
obj.EigenmodeHighLimit = (ehl, 0.0, 1000000.0, 10000.0)
def execute(self, obj):