Salome HOME
general crack dialog, working dir and result file
authorPaul RASCLE <paul.rascle@edf.fr>
Thu, 25 Feb 2016 16:57:05 +0000 (17:57 +0100)
committerPaul RASCLE <paul.rascle@edf.fr>
Thu, 25 Feb 2016 16:57:05 +0000 (17:57 +0100)
src/Tools/blocFissure/ihm/fissureGenerale.ui
src/Tools/blocFissure/ihm/fissureGenerale_plugin.py

index 503b56e..cbe389c 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>629</width>
-    <height>536</height>
+    <width>666</width>
+    <height>589</height>
    </rect>
   </property>
   <property name="windowTitle">
          </spacer>
         </item>
        </layout>
-       <zorder>groupBox_3</zorder>
-       <zorder>groupBox_7</zorder>
-       <zorder>horizontalSpacer_3</zorder>
        <zorder>verticalSpacer</zorder>
-       <zorder>horizontalSpacer_3</zorder>
-       <zorder>horizontalSpacer_9</zorder>
       </widget>
      </item>
      <item>
     </layout>
    </item>
    <item>
+    <layout class="QGridLayout" name="gridLayout_5">
+     <item row="0" column="0">
+      <widget class="QPushButton" name="pb_reptrav">
+       <property name="text">
+        <string>répertoire de travail</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QLineEdit" name="le_reptrav">
+       <property name="toolTip">
+        <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Répertoire dans lequel seront rangés le maillage final, les objets intermédiaires, la log d'exécution.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0">
+      <widget class="QPushButton" name="pb_nomres">
+       <property name="text">
+        <string>nom résultat</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1">
+      <widget class="QLineEdit" name="le_nomres">
+       <property name="toolTip">
+        <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;nom du fichier maillage résultat&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
     <spacer name="verticalSpacer_2">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
index e7c0ef3..c8c495a 100644 (file)
@@ -74,6 +74,10 @@ def fissureGeneraleDlg(context):
                    self.selectMaillage)
       self.connect(self.ui.pb_facefiss, QtCore.SIGNAL("clicked()"),
                    self.selectFacefiss)
+      self.connect(self.ui.pb_reptrav, QtCore.SIGNAL("clicked()"),
+                   self.selectReptrav)
+      self.connect(self.ui.pb_nomres, QtCore.SIGNAL("clicked()"),
+                   self.selectNomres)
       self.disconnect(self.ui.bb_OkCancel, QtCore.SIGNAL("accepted()"), self.accept)
       self.connect(self.ui.bb_OkCancel, QtCore.SIGNAL("accepted()"),
                    self.execute)
@@ -90,7 +94,9 @@ def fissureGeneraleDlg(context):
         lenSegPipe        = 2.5,
         nbSegRad          = 5,
         nbSegCercle       = 32,
-        areteFaceFissure  = 10)
+        areteFaceFissure  = 10,
+        reptrav           = '.',
+        nomres            = 'casStandard_fissure.med')
 
       
     def initDialog(self, dico):
@@ -105,6 +111,8 @@ def fissureGeneraleDlg(context):
       self.ui.sb_couronnes.setValue(dico['nbSegRad'])
       self.ui.sb_secteurs.setValue(dico['nbSegCercle'])
       self.ui.dsb_areteFaceFissure.setValue(dico['areteFaceFissure'])
+      self.ui.le_reptrav.setText(os.path.abspath(dico['reptrav']))
+      self.ui.le_nomres.setText(os.path.split(dico['nomres'])[1])
       incomplet = self.testval(dico)
       pass
   
@@ -256,6 +264,35 @@ def fissureGeneraleDlg(context):
         print filedef
         self.ui.le_facefiss.setText(filedef)
          
+    def selectReptrav(self):
+      fileDiag = QFileDialog(self)
+      fileDiag.setFileMode(QFileDialog.Directory)
+      fileDiag.setViewMode(QFileDialog.Detail)
+      fileDiag.setDirectory(self.ui.le_reptrav.text())
+      if fileDiag.exec_() :
+        fileNames = fileDiag.selectedFiles()
+        reptrav = str(fileNames[0])
+        print "reptrav ", reptrav
+        self.ui.le_reptrav.setText(os.path.abspath(reptrav))
+        
+         
+    def selectNomres(self):
+      fileDiag = QFileDialog(self)
+      fileDiag.setFileMode(QFileDialog.AnyFile)
+      fileDiag.setViewMode(QFileDialog.Detail)
+      nomres=str(os.path.split(str(self.ui.le_nomres.text()))[1])
+      fileDiag.setDirectory(self.ui.le_reptrav.text())
+      fileDiag.selectFile(nomres)
+      fileDiag.setNameFilter("Maillage *.med (*.med)")
+      self.ui.le_nomres.setText(nomres)
+      if fileDiag.exec_() :
+        fileNames = fileDiag.selectedFiles()
+        tempnom = os.path.split(str(fileNames[0]))[1]
+        print "nomres ", tempnom
+        self.ui.le_nomres.setText(tempnom)
+      else:
+        self.ui.le_nomres.setText(nomres)
+         
     def creeDico(self):
       dico = dict(
                   maillageSain     = str(self.ui.le_maillage.text()),
@@ -267,7 +304,9 @@ def fissureGeneraleDlg(context):
                   lenSegPipe       = self.ui.dsb_lenSegPipe.value(),
                   nbSegRad         = self.ui.sb_couronnes.value(),
                   nbSegCercle      = self.ui.sb_secteurs.value(),
-                  areteFaceFissure = self.ui.dsb_areteFaceFissure.value()
+                  areteFaceFissure = self.ui.dsb_areteFaceFissure.value(),
+                  reptrav          = str(self.ui.le_reptrav.text()),
+                  nomres           = str(self.ui.le_nomres.text()),
                   )
       print dico
       return dico