<rect>
<x>0</x>
<y>0</y>
- <width>850</width>
+ <width>851</width>
<height>651</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="2" column="0">
- <widget class="QFrame" name="frame">
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Plain</enum>
- </property>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <property name="spacing">
- <number>0</number>
- </property>
- <property name="leftMargin">
- <number>0</number>
- </property>
- <property name="topMargin">
- <number>0</number>
- </property>
- <property name="rightMargin">
- <number>0</number>
- </property>
- <property name="bottomMargin">
- <number>0</number>
- </property>
- <item>
- <widget class="QPushButton" name="ApplyClose">
- <property name="text">
- <string>Apply and Close</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="Apply">
- <property name="text">
- <string>Apply</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="Close">
- <property name="text">
- <string>Close</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="Help">
- <property name="text">
- <string>Help</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="lblMEDFile">
+ <property name="text">
+ <string>Input MED file:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="MEDFile">
+ <property name="toolTip">
+ <string><html><head/><body><p>MED file containing the mesh, that will receive a new or updated field with altitude</p></body></html></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="btnMEDFile">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
- <item row="1" column="0">
- <widget class="QGroupBox" name="grpPaths">
- <property name="title">
- <string>Paths</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_4">
- <item row="0" column="0">
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="1" column="3">
- <widget class="QToolButton" name="btnMEDFile">
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QToolButton" name="btnOutputPath">
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLineEdit" name="OutputPath"/>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="lblOutputPath">
- <property name="text">
- <string>Output path:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLineEdit" name="MEDFile"/>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="lblMEDFile">
- <property name="text">
- <string>MED file:</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item row="0" column="0">
+ <item>
<widget class="QTabWidget" name="tabWidget">
+ <property name="toolTip">
+ <string><html><head/><body><p>Set the bathymetry, using an active Calculation Case from HYDRO module:</p><p><span style=" font-weight:600;">Calculation Case</span>: set the bathymetry for all the groups of faces.</p><p><span style=" font-weight:600;">MED group bathymetry</span>: set the bathymetry for only one MED group of faces (other groups unchanged).</p></body></html></string>
+ </property>
<property name="currentIndex">
<number>1</number>
</property>
</widget>
</item>
<item row="0" column="2">
- <widget class="QLineEdit" name="CalcCase"/>
+ <widget class="QLineEdit" name="CalcCase">
+ <property name="toolTip">
+ <string>Select an active calculation case from HYDRO module in SALOME Object Browser</string>
+ </property>
+ </widget>
</item>
</layout>
</item>
</widget>
</item>
<item row="1" column="1">
- <widget class="QComboBox" name="InterpMethod"/>
+ <widget class="QComboBox" name="InterpMethod">
+ <property name="toolTip">
+ <string><html><head/><body><p>select the method used to interpolate the bathymetry:</p><p>use the z value of the nearest bathymetry point, </p><p>interpolate between 3 bathymetry points (linear triangle interpolation),</p><p>...</p></body></html></string>
+ </property>
+ </widget>
</item>
<item row="0" column="1">
- <widget class="QDoubleSpinBox" name="UndefZ"/>
+ <widget class="QDoubleSpinBox" name="UndefZ">
+ <property name="toolTip">
+ <string><html><head/><body><p>Z value to set when no bathymetry is available for some point</p><p>(Mainly used to help in case of problem, when some points are not associated with any bathymetry)</p><p><br/></p></body></html></string>
+ </property>
+ </widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QTableWidget" name="Groups">
+ <property name="toolTip">
+ <string>Associate MED groups with Regions from Calculation Case</string>
+ </property>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>250</number>
</attribute>
</widget>
<widget class="QWidget" name="bathy_tab">
<attribute name="title">
- <string>Bathymetry</string>
+ <string>MED Group bathymetry</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_14">
<item row="2" column="0">
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_13">
<item row="0" column="2">
- <widget class="QComboBox" name="medGroupNames"/>
+ <widget class="QComboBox" name="medGroupNames">
+ <property name="toolTip">
+ <string>^Select a Med group of faces in the list</string>
+ </property>
+ </widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="lblMedGroup">
</widget>
</item>
<item row="0" column="2">
- <widget class="QLineEdit" name="BathyName"/>
+ <widget class="QLineEdit" name="BathyName">
+ <property name="toolTip">
+ <string>Select an active bathymetry from HYDRO module in SALOME Object Browser</string>
+ </property>
+ </widget>
</item>
</layout>
</item>
</widget>
</widget>
</item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QLabel" name="lblOutputPath">
+ <property name="text">
+ <string>Script output path:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="OutputPath">
+ <property name="toolTip">
+ <string><html><head/><body><p>path of the script to create, for generation of bathymetry (altitude) field</p></body></html></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="btnOutputPath">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cb_scriptExec">
+ <property name="toolTip">
+ <string>if checked the script is generated and executed on apply, otherwise it is only generated for later use</string>
+ </property>
+ <property name="text">
+ <string>Execute the script</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="frame">
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QPushButton" name="ApplyClose">
+ <property name="text">
+ <string>Apply and Close</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="Apply">
+ <property name="text">
+ <string>Apply</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="Close">
+ <property name="text">
+ <string>Close</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="Help">
+ <property name="text">
+ <string>Help</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
</layout>
</widget>
<resources/>
path = str(self.OutputPath.text())
med_file = str(self.MEDFile.text())
print('current TAB = ', self.tabWidget.currentIndex())
+ isScriptExec = self.cb_scriptExec.isChecked()
+
if self.tabWidget.currentIndex() == 0: #calc case tab
calc_case = str(self.CalcCase.text())
med_groups_regions = {}
# iinterp = 1
#generate( path, calc_case, med_file, med_groups_regions, z_undef, iinterp )
generate( path, calc_case, med_file, med_groups_regions, z_undef, regions_interp_method )
- msg = "InterpolZ script is successfully generated"
+ msg = "InterpolZ script is successfully generated"
result = True
+
+ if isScriptExec:
+ msg = msg + " and executed"
+ exec(open(path).read())
QMessageBox.information( self, "", msg )
return result
if len(msg)==0:
iinterp = 0
if 'Linear' in interp:
- iinterp = 1
+ iinterp = 1
generate_B( path, bathy_name, med_file, group_name, z_undef, iinterp )
msg = "InterpolZ_B script is successfully generated"
result = True
+
+ if isScriptExec:
+ msg = msg + " and executed"
+ exec(open(path).read())
QMessageBox.information( self, "", msg )
return result
"""Shows help page"""
def onHelp( self ):
msg = """
- <h2>Interpolz dialog</h2>
+ <h1>Interpolz dialog</h1>
- This dialog is a tool for automation the writing of the script <b>interpolz.py</b>.
+ This dialog is a tool for generation and execution of the script <b>interpolz.py</b>.
- <h3>Calculation case</h3>
- The name of the calculation case. It can be filled automatically on the base of selection or can be input by user.
+ <h3>Input MED file</h3>
+ The path to MED file where MED groups are extracted.
- <h3>Output path</h3>
- The path for the output, i.e. the path of the target script interpolz.
+ <h2>TAB: Calculation Case</h2>
- <h3>MED file</h3>
- The path to MED file where MED groups are extracted.
+ <ol><h3>Calculation case</h3>
+ The name of the calculation case. It can be filled automatically on the base of selection or can be set by user.
<h3>Method</h3>
The interpolation method (interpolation at the nearest point and linear interpolation from a triangulation of the cloud of points).
The Z value for nodes outside the regions.
<h3>Table</h3>
- The table with MED groups and regions names.
+ The table with MED groups and regions names.</ol>
+
+ <h2>TAB: MED group bathymetry</h2>
+
+ <ol><h3>Calculation case</h3>
+ The name of the bathymetry. It can be filled automatically on the base of selection or can be set by user.
+
+ <h3>Method</h3>
+ The interpolation method (interpolation at the nearest point and linear interpolation from a triangulation of the cloud of points).
+
+ <h3>Undefined Z</h3>
+ The Z value for nodes outside the regions.</ol>
+
+ <h3>Script output path</h3>
+ The path for the output, i.e. the path of the target script interpolz.
+
+ <h3>Execute the script</h3>
+ Execute the script on Apply if checked, or just keep it for later use.
- When the data is input, the user clicks on "Apply" or "Apply and Close" button to perform the script generation.
+ When the data is set, the user clicks on "Apply" or "Apply and Close" button to perform the script generation.
"""
- QMessageBox.about(self, self.tr("About boundary conditions dialog"), msg);
+ QMessageBox.about(self, self.tr("About bathymetry interpolation dialog"), msg);
if __name__=='__main__':