From 3dcc189e8ba8a5e26677a6911a2fa2dbd804d6b7 Mon Sep 17 00:00:00 2001 From: Przemo Firszt Date: Tue, 20 Oct 2015 18:21:08 +0100 Subject: [PATCH] FEM: Add new properties to FEM preferences The new properties are NumberOfEigenmode, EigenmodeHighLimit and EigenmodeLowLimit. All 3 are linked with analysis object properties. Signed-off-by: Przemo Firszt --- src/Mod/Fem/Gui/DlgSettingsFem.ui | 202 +++++++++++++++++++------- src/Mod/Fem/Gui/DlgSettingsFemImp.cpp | 6 + src/Mod/Fem/_FemAnalysis.py | 4 +- 3 files changed, 157 insertions(+), 55 deletions(-) diff --git a/src/Mod/Fem/Gui/DlgSettingsFem.ui b/src/Mod/Fem/Gui/DlgSettingsFem.ui index c97dbfa1f7be..be4d9abbccb9 100644 --- a/src/Mod/Fem/Gui/DlgSettingsFem.ui +++ b/src/Mod/Fem/Gui/DlgSettingsFem.ui @@ -7,7 +7,7 @@ 0 0 555 - 453 + 518 @@ -196,64 +196,152 @@ - Default analysis type + Default analysis settings - - - + + + + + + 148 + 0 + + + + Default type on analysis + + + AnalysisType + + + Mod/Fem + - - - - 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 - - - + + Static + + + + :/icons/fem-new-analysis.svg:/icons/fem-new-analysis.svg + - - - Qt::Horizontal - - - - 40 - 20 - - - + + Frequency + + + + :/icons/fem-frequency-analysis.svg:/icons/fem-frequency-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 + + @@ -398,6 +486,11 @@ Gui::FileChooser
Gui/PrefWidgets.h
+ + Gui::PrefSpinBox + QSpinBox +
Gui/PrefWidgets.h
+
Gui::PrefCheckBox QCheckBox @@ -408,6 +501,11 @@ QComboBox
Gui/PrefWidgets.h
+ + Gui::PrefDoubleSpinBox + QDoubleSpinBox +
Gui/PrefWidgets.h
+
diff --git a/src/Mod/Fem/Gui/DlgSettingsFemImp.cpp b/src/Mod/Fem/Gui/DlgSettingsFemImp.cpp index 98d7cb00e5e7..f57f6d23666b 100644 --- a/src/Mod/Fem/Gui/DlgSettingsFemImp.cpp +++ b/src/Mod/Fem/Gui/DlgSettingsFemImp.cpp @@ -53,6 +53,9 @@ void DlgSettingsFemImp::saveSettings() fc_ext_editor->onSave(); fc_ccx_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(); @@ -66,6 +69,9 @@ void DlgSettingsFemImp::loadSettings() fc_ext_editor->onRestore(); fc_ccx_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(); diff --git a/src/Mod/Fem/_FemAnalysis.py b/src/Mod/Fem/_FemAnalysis.py index 36df4208f352..28454b91bfa7 100644 --- a/src/Mod/Fem/_FemAnalysis.py +++ b/src/Mod/Fem/_FemAnalysis.py @@ -42,7 +42,6 @@ def __init__(self, obj): obj.WorkingDir = fem_prefs.GetString("WorkingDir", "") obj.addProperty("App::PropertyIntegerConstraint", "NumberOfEigenmodes", "Fem", "Number of modes for frequency calculations") - #Not yet in prefs, so it will always default to 10 noe = fem_prefs.GetInt("NumberOfEigenmodes", 10) obj.NumberOfEigenmodes = (noe, 1, 100, 1) @@ -52,9 +51,8 @@ def __init__(self, obj): obj.EigenmodeLowLimit = (ell, 0.0, 1000000.0, 10000.0) obj.addProperty("App::PropertyFloatConstraint", "EigenmodeHighLimit", "Fem", "High frequency limit for eigenmode calculations") - #Not yet in prefs, so it will always default to 1000000.0 ehl = fem_prefs.GetFloat("EigenmodeHighLimit", 1000000.0) - obj.EigenmodeHighLimit = (ehl, 0.0, 1000000.0, 100000) + obj.EigenmodeHighLimit = (ehl, 0.0, 1000000.0, 10000.0) def execute(self, obj): return