FEM: new solver framework, add gui for working path pref

This commit is contained in:
Markus Hovorka
2017-12-01 19:42:33 +01:00
committed by wmayer
parent 6f2dea1560
commit 24f47b3bbe
2 changed files with 232 additions and 3 deletions

View File

@@ -96,7 +96,221 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_2_mesh">
<widget class="QGroupBox" name="gb_2_workingdir">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Working Directory</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="Gui::PrefRadioButton" name="cb_wd_temp">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="accessibleDescription">
<string>sdfsdfsdfds</string>
</property>
<property name="text">
<string>Temporary Directories</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Fem/Elmer</cstring>
</property>
<property name="prefEntry" stdset="0">
<cstring>UseTempDirectory</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="l_wd_temp_desc">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Let FreeCAD manage (create, delete) the working directories for all solver. Use temporary directories.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="indent">
<number>10</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="Gui::PrefRadioButton" name="cb_wd_beside">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Beside .fcstd File</string>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Fem/Elmer</cstring>
</property>
<property name="prefEntry" stdset="0">
<cstring>UseBesideDirectory</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="l_wd_beside_desc">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Create a directory in the same folder in which the fcstd file of the document is located. Use Subfolder for each solver (e.g. for a file ./mydoc.fcstd and a solver with the label Elmer002 use ./mydoc/Elmer002).</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="indent">
<number>10</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_8">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="Gui::PrefRadioButton" name="cb_wd_custom">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Use Custom Directory</string>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Fem/Elmer</cstring>
</property>
<property name="prefEntry" stdset="0">
<cstring>UseCustomDirectory</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="l_custom_desc">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Use directory set below. Create own subdirectory for every solver. Name directory after the solver label prefixed with the document name.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="indent">
<number>10</number>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="l_wd_custom_path">
<property name="text">
<string>Path:</string>
</property>
<property name="indent">
<number>10</number>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefFileChooser" name="le_wd_custom" native="true">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximumSize">
<size>
<width>250</width>
<height>16777215</height>
</size>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Fem/Elmer</cstring>
</property>
<property name="prefEntry" stdset="0">
<cstring>CustomDirectoryPath</cstring>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_3_mesh">
<property name="title">
<string>Mesh</string>
</property>
@@ -125,7 +339,7 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_3_materials">
<widget class="QGroupBox" name="gb_4_materials">
<property name="title">
<string>Materials</string>
</property>
@@ -231,7 +445,7 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_4_results">
<widget class="QGroupBox" name="gb_5_results">
<property name="title">
<string>Results</string>
</property>
@@ -334,6 +548,11 @@
<extends>Gui::FileChooser</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefRadioButton</class>
<extends>QRadioButton</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="Resources/Fem.qrc"/>

View File

@@ -56,6 +56,11 @@ void DlgSettingsFemGeneralImp::saveSettings()
cb_restore_result_dialog->onSave();
cb_keep_results_on_rerun->onSave();
cb_hide_constraint->onSave();
cb_wd_temp->onSave();
cb_wd_beside->onSave();
cb_wd_custom->onSave();
le_wd_custom->onSave();
}
void DlgSettingsFemGeneralImp::loadSettings()
@@ -72,6 +77,11 @@ void DlgSettingsFemGeneralImp::loadSettings()
cb_restore_result_dialog->onRestore();
cb_keep_results_on_rerun->onRestore();
cb_hide_constraint->onRestore();
cb_wd_temp->onRestore();
cb_wd_beside->onRestore();
cb_wd_custom->onRestore();
le_wd_custom->onRestore();
}
/**