FEM: GUI: pref: add new CalculiX Solver attributes to a new CalculiX tab
This commit is contained in:
parent
7760c5cce1
commit
4ea7fc6e89
|
@ -34,6 +34,7 @@
|
|||
#include <Gui/Language/Translator.h>
|
||||
#include "PropertyFemMeshItem.h"
|
||||
#include "DlgSettingsFemImp.h"
|
||||
#include "DlgSettingsFemCcxImp.h"
|
||||
#include "ViewProviderFemMesh.h"
|
||||
#include "ViewProviderFemMeshShape.h"
|
||||
#include "ViewProviderFemMeshShapeNetgen.h"
|
||||
|
@ -139,7 +140,8 @@ PyMODINIT_FUNC initFemGui()
|
|||
|
||||
|
||||
// register preferences pages
|
||||
new Gui::PrefPageProducer<FemGui::DlgSettingsFemImp> ("FEM");
|
||||
new Gui::PrefPageProducer<FemGui::DlgSettingsFemImp> (QT_TRANSLATE_NOOP("QObject","FEM"));
|
||||
new Gui::PrefPageProducer<FemGui::DlgSettingsFemCcxImp> (QT_TRANSLATE_NOOP("QObject","FEM"));
|
||||
|
||||
// add resources and reloads the translators
|
||||
loadFemResource();
|
||||
|
|
|
@ -52,6 +52,7 @@ SOURCE_GROUP("Python" FILES ${Python_SRCS})
|
|||
|
||||
set(FemGui_MOC_HDRS
|
||||
DlgSettingsFemImp.h
|
||||
DlgSettingsFemCcxImp.h
|
||||
PropertyFemMeshItem.h
|
||||
TaskObjectName.h
|
||||
TaskCreateNodeSet.h
|
||||
|
@ -84,6 +85,7 @@ SOURCE_GROUP("Moc" FILES ${FemGui_MOC_SRCS})
|
|||
|
||||
set(FemGui_UIC_SRCS
|
||||
DlgSettingsFem.ui
|
||||
DlgSettingsFemCcx.ui
|
||||
TaskCreateNodeSet.ui
|
||||
TaskObjectName.ui
|
||||
TaskFemConstraint.ui
|
||||
|
@ -117,6 +119,9 @@ SET(FemGui_DLG_SRCS
|
|||
DlgSettingsFem.ui
|
||||
DlgSettingsFemImp.cpp
|
||||
DlgSettingsFemImp.h
|
||||
DlgSettingsFemCcx.ui
|
||||
DlgSettingsFemCcxImp.cpp
|
||||
DlgSettingsFemCcxImp.h
|
||||
TaskFemConstraint.ui
|
||||
TaskFemConstraint.cpp
|
||||
TaskFemConstraint.h
|
||||
|
|
|
@ -347,6 +347,15 @@
|
|||
<normaloff>:/icons/fem-frequency-analysis.svg</normaloff>:/icons/fem-frequency-analysis.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Thermomech</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="Resources/Fem.qrc">
|
||||
<normaloff>:/icons/fem-new-analysis.svg</normaloff>:/icons/fem-new-analysis.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
|
|
331
src/Mod/Fem/Gui/DlgSettingsFemCcx.ui
Normal file
331
src/Mod/Fem/Gui/DlgSettingsFemCcx.ui
Normal file
|
@ -0,0 +1,331 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FemGui::DlgSettingsFemCcxImp</class>
|
||||
<widget class="QWidget" name="FemGui::DlgSettingsFemCcxImp">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>555</width>
|
||||
<height>518</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>CalculiX</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gb_calculix_anpreferences">
|
||||
<property name="title">
|
||||
<string>Solver preferences</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gl_ccx_solver">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="l_ccx_numcpu">
|
||||
<property name="text">
|
||||
<string>Number of CPU's to use (Spooles only)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="Gui::PrefSpinBox" name="sb_ccx_numcpu">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>40</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>AnalysisNumCPUs</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Fem/Ccx</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="l_solver">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Matrix Solver</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="Gui::PrefComboBox" name="cmb_solver">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>Solver</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Fem/Ccx</cstring>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Default</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Spooles</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Iterative Scaling</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Iterative Cholesky</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="l_non_lin_geom">
|
||||
<property name="text">
|
||||
<string>Non-Linear Geometry</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="Gui::PrefCheckBox" name="cb_ccx_non_lin_geom">
|
||||
<property name="text">
|
||||
<string>Non linear geometry</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>NonlinearGeometry</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Fem/Ccx</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="l_hide_constraint">
|
||||
<property name="text">
|
||||
<string>Hide Constraints when plotting results</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="Gui::PrefCheckBox" name="cb_hide_constraint">
|
||||
<property name="text">
|
||||
<string>Hide</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>HideConstraint</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Fem/Ccx</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="thermal_analysis_params">
|
||||
<property name="title">
|
||||
<string>Thermo mechanical analysis settings</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="thermasl_op">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="l_static">
|
||||
<property name="text">
|
||||
<string>Analysis type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="Gui::PrefCheckBox" name="cb_static">
|
||||
<property name="text">
|
||||
<string>Steady State</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>StaticAnalysis</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Fem/Ccx</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="l_ccx_max_iterations">
|
||||
<property name="text">
|
||||
<string>Maximum Number of iterations</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="Gui::PrefSpinBox" name="sb_ccx_max_iterations">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10000000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>2000</number>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>AnalysisMaxIterations</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Fem/Ccx</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="l_ccx_initial_time_step">
|
||||
<property name="text">
|
||||
<string>Initial time step</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="dsb_ccx_initial_time_step">
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>99999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>AnalysisInitialTimeStep</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Fem/Ccx</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="l_ccx_analysis_time">
|
||||
<property name="text">
|
||||
<string>End Time</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="dsb_ccx_analysis_time">
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>99999999.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>AnalysisTime</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Fem/Ccx</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::PrefSpinBox</class>
|
||||
<extends>QSpinBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefCheckBox</class>
|
||||
<extends>QCheckBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefComboBox</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefDoubleSpinBox</class>
|
||||
<extends>QDoubleSpinBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="Resources/Fem.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
94
src/Mod/Fem/Gui/DlgSettingsFemCcxImp.cpp
Normal file
94
src/Mod/Fem/Gui/DlgSettingsFemCcxImp.cpp
Normal file
|
@ -0,0 +1,94 @@
|
|||
/***************************************************************************
|
||||
* Copyright (c) 2015 FreeCAD Developers *
|
||||
* Author: Przemo Firszt <przemo@firszt.eu> *
|
||||
* Based on src/Mod/Raytracing/Gui/DlgSettingsRayImp.cpp *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include "Gui/Application.h"
|
||||
#include "DlgSettingsFemCcxImp.h"
|
||||
#include <Gui/PrefWidgets.h>
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
DlgSettingsFemCcxImp::DlgSettingsFemCcxImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
{
|
||||
this->setupUi(this);
|
||||
}
|
||||
|
||||
DlgSettingsFemCcxImp::~DlgSettingsFemCcxImp()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Mod/Fem/Ccx");
|
||||
int index = hGrp->GetInt("Solver", 0);
|
||||
if (index > -1) cmb_solver->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the strings of the subwidgets using the current language.
|
||||
*/
|
||||
void DlgSettingsFemCcxImp::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
}
|
||||
else {
|
||||
QWidget::changeEvent(e);
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_DlgSettingsFemCcxImp.cpp"
|
50
src/Mod/Fem/Gui/DlgSettingsFemCcxImp.h
Normal file
50
src/Mod/Fem/Gui/DlgSettingsFemCcxImp.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
/**************************************************************************
|
||||
* Copyright (c) 2015 FreeCAD Developers *
|
||||
* Author: Przemo Firszt <przemo@firszt.eu> *
|
||||
* Based on src/Mod/Raytracing/Gui/DlgSettingsRayImp.h *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FEMGUI_DLGSETTINGSFEMCCXIMP_H
|
||||
#define FEMGUI_DLGSETTINGSFEMCCXIMP_H
|
||||
|
||||
#include "ui_DlgSettingsFemCcx.h"
|
||||
#include <Gui/PropertyPage.h>
|
||||
|
||||
namespace FemGui {
|
||||
|
||||
class DlgSettingsFemCcxImp : public Gui::Dialog::PreferencePage, public Ui_DlgSettingsFemCcxImp
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgSettingsFemCcxImp( QWidget* parent = 0 );
|
||||
~DlgSettingsFemCcxImp();
|
||||
|
||||
protected:
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
void changeEvent(QEvent *e);
|
||||
};
|
||||
|
||||
} // namespace FemGui
|
||||
|
||||
#endif // FEMGUI_DLGSETTINGSFEMCCXIMP_H
|
Loading…
Reference in New Issue
Block a user