From a7e3aa2650e5bb26454aa314fa11e658fd49e6e1 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Thu, 25 Feb 2016 17:57:05 +0100 Subject: [PATCH] general crack dialog, working dir and result file --- src/Tools/blocFissure/ihm/fissureGenerale.ui | 41 +++++++++++++++--- .../blocFissure/ihm/fissureGenerale_plugin.py | 43 ++++++++++++++++++- 2 files changed, 75 insertions(+), 9 deletions(-) diff --git a/src/Tools/blocFissure/ihm/fissureGenerale.ui b/src/Tools/blocFissure/ihm/fissureGenerale.ui index 503b56e6c..cbe389c62 100644 --- a/src/Tools/blocFissure/ihm/fissureGenerale.ui +++ b/src/Tools/blocFissure/ihm/fissureGenerale.ui @@ -6,8 +6,8 @@ 0 0 - 629 - 536 + 666 + 589 @@ -269,12 +269,7 @@ - groupBox_3 - groupBox_7 - horizontalSpacer_3 verticalSpacer - horizontalSpacer_3 - horizontalSpacer_9 @@ -461,6 +456,38 @@ + + + + + + répertoire de travail + + + + + + + <html><head/><body><p>Répertoire dans lequel seront rangés le maillage final, les objets intermédiaires, la log d'exécution.</p></body></html> + + + + + + + nom résultat + + + + + + + <html><head/><body><p>nom du fichier maillage résultat</p></body></html> + + + + + diff --git a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py index e7c0ef357..c8c495abe 100644 --- a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py +++ b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py @@ -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 -- 2.39.2