From: Pascale Noyret Date: Thu, 10 Jan 2013 17:23:59 +0000 (+0000) Subject: pour run de MAP X-Git-Tag: V6_6_0p1~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4aca906a2bc85c04ad54ebf6ed320996e3d096c6;p=tools%2Feficas.git pour run de MAP --- diff --git a/InterfaceQT4/editor.py b/InterfaceQT4/editor.py index 353807d4..dc5171f5 100644 --- a/InterfaceQT4/editor.py +++ b/InterfaceQT4/editor.py @@ -308,13 +308,13 @@ class JDCEditor(QSplitter): self.w.setWindowTitle( "execution" ) self.monExe=QProcess(self.w) pid=self.monExe.pid() - nomFichier='/tmp/map_'+str(pid)+'.py' + nomFichier='/tmp/map_'+str(pid)+'.sh' f=open(nomFichier,'w') f.write(txt) f.close() self.connect(self.monExe, SIGNAL("readyReadStandardOutput()"), self.readFromStdOut ) self.connect(self.monExe, SIGNAL("readyReadStandardError()"), self.readFromStdErr ) - exe='python ' + nomFichier + exe='sh ' + nomFichier self.monExe.start(exe) self.monExe.closeWriteChannel() self.w.show() @@ -673,22 +673,26 @@ class JDCEditor(QSplitter): QMessageBox.critical( self, "Format "+self.format+" non reconnu","EFICAS ne sait pas convertir le JDC selon le format "+self.format) return "" - #-----------------------------# - def run(self,execution="oui"): - #-----------------------------# - if self.code == "MAP" and not(generator.plugins.has_key(format)): - self.format="MAP" - if generator.plugins.has_key(self.format): - self.generator=generator.plugins[self.format]() - else : - QMessageBox.critical( self, "Execution impossible ","EFICAS ne sait pas executer ce JDC ") - return "" - + #------------# + def run(self): + #------------# # - self.textePython =self.generator.generRUN(self.jdc,self.appli.ssCode) - if execution=="oui" : - self._viewTextExecute( self.textePython) - return self.textePython + if not(self.jdc.isvalid()): + QMessageBox.critical( self, "Execution impossible ","le JDC doit etre valide pour une execution MAP") + return + if len(self.jdc.etapes) != 1 : + QMessageBox.critical( self, "Execution impossible ","le JDC doit contenir un et un seul composant") + return + if self.modified : + QMessageBox.critical( self, "Execution impossible ","le JDC doit ĂȘtre sauvegarde avant execution") + return + if self.fichier==None : + QMessageBox.critical( self, "Execution impossible ","le JDC doit ĂȘtre sauvegarde avant execution") + return + composant=self.jdc.etapes[0].nom.lower()[0:-5] + textePython=("map run -n "+composant +" -i "+self.fichier) + #print textePython + self._viewTextExecute( textePython) #-----------------------------------------------------#