mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-26 09:20:34 +05:00
Imp of the ui design of padder plugin
This commit is contained in:
parent
b3c311b4d9
commit
4a30c75bfc
@ -41,7 +41,7 @@ GROUPNAME_MAXLENGTH=8
|
||||
class InputDialog(GenericDialog):
|
||||
|
||||
TBL_HEADER_LABEL=["Input Mesh", "Output group name"]
|
||||
|
||||
|
||||
inputValidated = pyqtSignal()
|
||||
|
||||
def __init__(self, parent=None, name="InputDialog", modal=0):
|
||||
@ -97,7 +97,7 @@ class InputDialog(GenericDialog):
|
||||
icon.addFile(os.path.join(iconfolder,"steelbar.png"))
|
||||
self.__ui.cmbMeshType.setItemIcon(meshTypeIndex, icon)
|
||||
self.MESHTYPE_ICONS[meshTypeIndex] = icon
|
||||
|
||||
|
||||
# The click on btnSmeshObject (signal clicked() emitted by the
|
||||
# button btnSmeshObject) is connected to the slot
|
||||
# onSelectSmeshObject, etc ...
|
||||
@ -113,7 +113,10 @@ class InputDialog(GenericDialog):
|
||||
self.__ui.tblListInput.horizontalHeader().setStretchLastSection(True)
|
||||
# Note that the type is not display explicitly in the Qt table
|
||||
# because it is specified using an icon on the text of the
|
||||
# name item.
|
||||
# name item.
|
||||
|
||||
# Setup default values for numerical parameters
|
||||
self.__ui.txtParamNbIter.setValue(3)
|
||||
|
||||
# Note that PADDER does not support group name longer than 8
|
||||
# characters. We apply then this limit in the gui field.
|
||||
@ -230,7 +233,7 @@ class InputDialog(GenericDialog):
|
||||
# new one
|
||||
if self.__dictInputData.has_key(meshName):
|
||||
self.__delInputFromMap(meshName)
|
||||
|
||||
|
||||
inputData = InputData()
|
||||
inputData.meshName = meshName
|
||||
inputData.meshObject = meshObject
|
||||
@ -247,7 +250,7 @@ class InputDialog(GenericDialog):
|
||||
print "meshType = ",inputData.meshType
|
||||
print "nb concrete mesh ",self.__nbConcreteMesh
|
||||
print "nb steelbar mesh ",self.__nbSteelbarMesh
|
||||
|
||||
|
||||
|
||||
def onDeleteInput(self):
|
||||
"""
|
||||
@ -267,7 +270,7 @@ class InputDialog(GenericDialog):
|
||||
def __delInputFromMap(self, meshName):
|
||||
"""
|
||||
This function removes the specified entry from the internal
|
||||
map (for data management purpose)
|
||||
map (for data management purpose)
|
||||
"""
|
||||
inputData = self.__dictInputData.pop(meshName)
|
||||
if inputData.meshType == InputData.MESHTYPES.CONCRETE:
|
||||
@ -292,7 +295,7 @@ class InputDialog(GenericDialog):
|
||||
meshObject = inputData.meshObject
|
||||
meshType = inputData.meshType
|
||||
groupName = inputData.groupName
|
||||
|
||||
|
||||
self.__addInputInGui(meshName, meshObject, meshType, groupName)
|
||||
self.__addInputInMap(meshName, meshObject, meshType, groupName)
|
||||
|
||||
@ -307,7 +310,7 @@ class InputDialog(GenericDialog):
|
||||
# Note that the values() function returns a copy of the list
|
||||
# of values.
|
||||
return self.__dictInputData.values()
|
||||
|
||||
|
||||
def checkData(self):
|
||||
"""
|
||||
This function checks if the data are valid, from the dialog
|
||||
@ -315,7 +318,7 @@ class InputDialog(GenericDialog):
|
||||
"""
|
||||
if self.__nbConcreteMesh == 0 and self.__nbSteelbarMesh == 0:
|
||||
self.checkDataMessage = "You must define at least one mesh (CONCRETE or STEELBAR)"
|
||||
return False
|
||||
return False
|
||||
if self.__nbConcreteMesh > 1:
|
||||
self.checkDataMessage = "You define multiple CONCRETE meshes."
|
||||
self.checkDataMessage += "You should verify first that your version of PADDER support this configuration."
|
||||
@ -325,6 +328,7 @@ class InputDialog(GenericDialog):
|
||||
|
||||
return True
|
||||
|
||||
#def setParameters(self,
|
||||
|
||||
# ==============================================================================
|
||||
# Basic use case
|
||||
@ -357,9 +361,9 @@ def TEST_InputDialog_setData():
|
||||
inputData.groupName = "myGroup"
|
||||
listInputData = []
|
||||
listInputData.append(inputData)
|
||||
|
||||
|
||||
dlg.setData2(listInputData)
|
||||
|
||||
|
||||
dlg.displayAndWait()
|
||||
if dlg.wasOk():
|
||||
print "OK has been pressed"
|
||||
|
@ -1,189 +1,179 @@
|
||||
<ui version="4.0" >
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>InputFrame</class>
|
||||
<widget class="QDialog" name="InputFrame" >
|
||||
<property name="geometry" >
|
||||
<widget class="QDialog" name="InputFrame">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>509</width>
|
||||
<height>307</height>
|
||||
<width>759</width>
|
||||
<height>656</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<property name="windowTitle">
|
||||
<string>Input parameters</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblSmeshObject" >
|
||||
<property name="text" >
|
||||
<string>Input MESH / Output group name / Type :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
<widget class="QLabel" name="lblSmeshObject">
|
||||
<property name="text">
|
||||
<string>Input MESH / Output group name / Type :</string>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnSmeshObject" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="maximumSize" >
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset>select.png</iconset>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnSmeshObject">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>select.png</normaloff>select.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="txtSmeshObject">
|
||||
<property name="toolTip">
|
||||
<string comment="Select the input mesh in the object browser"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="txtSmeshObject" >
|
||||
<property name="toolTip" >
|
||||
<string comment="Select the input mesh in the object browser" />
|
||||
<widget class="QLineEdit" name="txtGroupName">
|
||||
<property name="toolTip">
|
||||
<string comment="Specify the name of the associated group in the output mesh"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="cmbMeshType">
|
||||
<property name="toolTip">
|
||||
<string comment="Select the type of the mesh"/>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Béton</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>concrete.png</normaloff>concrete.png</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Acier</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>steelbar.png</normaloff>steelbar.png</iconset>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line" >
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="txtGroupName" >
|
||||
<property name="toolTip" >
|
||||
<string comment="Specify the name of the associated group in the output mesh" />
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_2" >
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="cmbMeshType" >
|
||||
<property name="toolTip" >
|
||||
<string comment="Select the type of the mesh" />
|
||||
</property>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Béton</string>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset>concrete.png</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Acier</string>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset>steelbar.png</iconset>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
<widget class="QTableView" name="tblListInput"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableView" name="tblListInput" />
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnAddInput" >
|
||||
<property name="text" >
|
||||
<widget class="QPushButton" name="btnAddInput">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset>addinput.png</iconset>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>addinput.png</normaloff>addinput.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnDeleteInput" >
|
||||
<property name="text" >
|
||||
<widget class="QPushButton" name="btnDeleteInput">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset>deleteinput.png</iconset>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>deleteinput.png</normaloff>deleteinput.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
@ -195,6 +185,56 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblNumericalParameters">
|
||||
<property name="text">
|
||||
<string>Paramètres numériques:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblParamNbIter">
|
||||
<property name="text">
|
||||
<string>Nb. Itérations</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblParamRminRmax">
|
||||
<property name="text">
|
||||
<string>Rmin / Rmax</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QSpinBox" name="txtParamNbIter"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="txtParamRminRmax"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
Loading…
Reference in New Issue
Block a user