from Editeur import Objecttreeitem
from desBaseWidget import Ui_baseWidget
from monViewTexte import ViewText
+from monViewTexte import ViewText2
from monWidgetCreeParam import MonWidgetCreeParam
import browser
import readercata
self.code = self.appliEficas.CONFIGURATION.code
self.mode_nouv_commande=self.appliEficas.CONFIGURATION.mode_nouv_commande
self.affiche=self.appliEficas.CONFIGURATION.affiche
+ #if self.code in ['MAP','CARMELCND','PSEN'] : self.afficheCommandesPliees=False
if self.code in ['MAP','CARMELCND'] : self.afficheCommandesPliees=False
if self.code in ['MAP',] :
self.widgetTree.close()
if (not self.jdc.isvalid()) and (not self.nouveau) and (self.appliEficas.ssIhm == False):
self.viewJdcRapport()
- # if self.code=="TELEMAC" : print "kkkkkkkk"
if jdc_item:
self.tree = browser.JDCTree( jdc_item, self )
self.appliEficas.construitMenu()
+ #-------------------# Pour execution avec output sans une fenetre EFICAS. (erreurs encore dans la fenetre bash)
+ def runPSEN_2(self):
#-------------------#
+ if self.modified or self.fichier==None :
+ QMessageBox.critical( self, tr( "Execution impossible "),tr("Sauvegarder SVP avant l'execution "))
+ return
+
+ #monPython="/home/A96028/salome75/prerequisites/install/Python-273-tcl8513-tk8513/bin/python"
+ #monWrapper="/local00/home/A96028/GitEficasTravail/eficas/PSEN_Eficas/PSSEWrapper.py"
+ path1 = os.path.abspath(os.path.join(os.path.abspath(__file__), '../','../','PSEN_Eficas','PSEN'))
+ monWrapper = os.path.join(path1, 'PSSEWrapper.py')
+ cmd=['python',monWrapper]
+
+ w = ViewText2( self.QWParent, cmd )
+ w.setWindowTitle( "execution" )
+ w.exec_()
+
+
+ #-------------------# Pour execution avec output et error dans le bash
def runPSEN(self):
#-------------------#
if self.modified or self.fichier==None :
return
#lancement avec le .bat
- textePython="PSEN_Path='EficasV2\PSEN_Eficas\PSEN\PSSEWrapper.py'\
- \nimport subprocess\
- \np=subprocess.Popen(['python',PSEN_Path])\
- \n(out,err)=p.communicate()"
-
- #lancement avec qteficas_psen.py
-
- #textePython='C:\Users\plscist\Desktop\Vico\sauveEficasPSEN~\EficasV1\PSEN_Eficas\PSEN\PSSEWrapper.py'
- try :
- self._viewTextExecute( textePython,"psen_run",".py")
- except Exception, e:
- print traceback.print_exc()
-
+ path1 = os.path.abspath(os.path.join(os.path.abspath(__file__), '../','../','PSEN_Eficas','PSEN'))
+ WrapperFilePath = os.path.join(path1, 'PSSEWrapper.py')
+ import subprocess
+ p = subprocess.Popen(['python',WrapperFilePath])
+ (out,err)=p.communicate()
+ print out
+ print err
#--------------------------------#
def _newJDC( self ,units = None):
if self.code == "CARMELCND" : texte=self._newJDCCND()
if self.code == "ZCRACKS" : texte=self._newZCRACKS()
if self.code == "TELEMAC" : texte=self._newTELEMAC()
+ if self.code == "PSEN" : texte = self._newPSEN()
# texte=self.newTexteCND
jdc=self.readercata.cata[0].JdC( procedure =texte,
f.close()
self.connect(self.monExe, SIGNAL("readyReadStandardOutput()"), self.readFromStdOut )
self.connect(self.monExe, SIGNAL("readyReadStandardError()"), self.readFromStdErr )
- exe='sh /tmp/test.sh'
+ exe='sh ' + nomFichier
self.monExe.start(exe)
self.monExe.closeWriteChannel()
self.w.exec_()
def viewJdcRapport(self):
#-----------------------#
strRapport = unicode( self.jdc.report() )
+ # on ajoute les regles
+
self._viewText(strRapport, "JDC_RAPPORT")
#----------------#
#-----------------------------------------------------------#
if self.code == "MAP" and not(generator.plugins.has_key(format)): format = "MAP"
if generator.plugins.has_key(format):
- print "get_text_JDC"
# Le generateur existe on l'utilise
self.generator=generator.plugins[format]()
#textePython="ls -l"
self._viewTextExecute( textePython,"map_run",".sh")
- try:
- commande="rm "+self.fichierMapInput
- os.system(commande)
- except :
- pass
+ #try:
+ # commande="rm "+self.fichierMapInput
+ # os.system(commande)
+ #except :
+ # pass
except Exception, e:
print traceback.print_exc()
#texte=""
return texte
+ #---------------------------#
+ def _newPSEN(self):
+ #---------------------------#
+ texte="DIRECTORY() ; PSSE_PARAMETERS() ; SIMULATION() ; sansnom=DISTRIBUTION() ; sansnom=DISTRIBUTION() ; CORRELATION() ;"
+ #texte=""
+ return texte
+
#---------------------------#
#---------------------------#