self.monExe.readyReadStandardOutput.connect( self.readFromStdOut )
self.monExe.readyReadStandardError.connect( self.readFromStdErr )
+ self.monExe.finished.connect( self.finished )
""" for test set environment
env = QProcessEnvironment().systemEnvironment()
cmds = ''
ext = ''
if sys.platform == "win32":
- cmds += 'delete %s\n' % self.parent().fichierOut
+ if os.path.exists(self.parent().fichierOut):
+ cmds += 'del %s\n' % self.parent().fichierOut
ext = '.bat'
else:
cmds += '#!/bin/bash\n'
a=self.monExe.readAllStandardOutput()
aa=unicode(a.data())
self.TB_Exe.append(aa)
- if "END_OF_MGCleaner" in aa:
- self.parent().enregistreResultat()
- self.enregistreResultatsDone=True
- #self.theClose()
+
+ def finished(self):
+ self.parent().enregistreResultat()
+ self.enregistreResultatsDone=True
def theClose(self):
if not self.enregistreResultatsDone:
self.monExe.readyReadStandardOutput.connect( self.readFromStdOut )
self.monExe.readyReadStandardError.connect( self.readFromStdErr )
+ self.monExe.finished.connect( self.finished )
cmds = ''
ext = ''
if sys.platform == "win32":
- cmds += 'delete %s\n' % self.parent().fichierOut
+ if os.path.exists(self.parent().fichierOut):
+ cmds += 'del %s\n' % self.parent().fichierOut
+ ext = '.bat'
else:
cmds += '#!/bin/bash\n'
cmds += 'pwd\n'
def readFromStdOut(self) :
a=self.monExe.readAllStandardOutput()
aa=unicode(a.data())
- self.TB_Exe.append(aa)
- if "END_OF_MGSurfOpt" in aa:
- self.parent().enregistreResultat()
- self.enregistreResultatsDone=True
- #self.theClose()
+ self.TB_Exe.append(aa)
+
+ def finished(self):
+ self.parent().enregistreResultat()
+ self.enregistreResultatsDone=True
def theClose(self):
if not self.enregistreResultatsDone:
self.fichierIn=""
def prepareFichier(self):
- self.fichierIn=tempfile.mktemp(suffix=".meshb",prefix="ForSurfOpt_")
+ self.fichierIn=tempfile.mktemp(suffix=".mesh",prefix="ForSurfOpt_")
if os.path.exists(self.fichierIn):
os.remove(self.fichierIn)
self.__selectedMesh.ExportGMF(self.__selectedMesh, self.fichierIn, True)
self.commande+= " -O G" # This option has not been updated to the new option style yet
deb=os.path.splitext(self.fichierIn)
- self.fichierOut=deb[0] + "_output.meshb"
+ self.fichierOut=deb[0] + "_output.mesh"
tolerance=self.SP_toStr(self.SP_Tolerance)
if not self.RB_Absolute.isChecked():