# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2015 EDF R&D
+# Copyright (C) 2007-2013 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
from Editeur import comploader
from Editeur import Objecttreeitem
from desBaseWidget import Ui_baseWidget
-from monViewTexte import ViewText
-from monWidgetCreeParam import MonWidgetCreeParam
+from monViewTexte import ViewText
+from monViewTexte import ViewText2
+from monWidgetCreeParam import MonWidgetCreeParam
import browser
import readercata
def __init__ (self,appli,fichier = None, jdc = None, QWParent=None, units = None, include=0 , vm=None):
#----------------------------------------------------------------------------------------------------------#
- self.a=0
QtGui.QWidget.__init__(self,None)
self.setupUi(self)
- self.monOptionnel=None
+ self.widgetOptionnel=None
self.fenetreCentraleAffichee=None
self.dejaDansPlieTout=False
self.afficheCommandesPliees = True
+ self.listeDesListesOuvertes=set()
self.appliEficas = appli
self.appli = appli #---- attendu par IHM
self.vm = vm
self.fichier = fichier
self.jdc = jdc
- self.first = True
+ self.first = True
self.QWParent = QWParent
-
+
if appli != None :
self.salome = self.appliEficas.salome
else :
# ces attributs sont mis a jour par definitCode appelee par newEditor
self.code = self.appliEficas.CONFIGURATION.code
+ # tres vite a cause du tag. doit etre pase dans CONFIGURATION
+
+ self.afficheListesPliees=False
+ if self.code == "ASTER" : self.afficheListesPliees =True
+
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',] :
+ if self.code in ['MAP',] :
self.widgetTree.close()
self.widgetTree=None
self.appliEficas.resize(1440,self.appliEficas.height())
jdc_item=Objecttreeitem.make_objecttreeitem( self, "nom", self.jdc )
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()
- #-------------------#
- def runPSEN(self):
+ #-------------------# 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
- #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
+ #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]
- #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()
+ 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 : self.saveFile()
+
+ #lancement avec le .bat
+ 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,
appli=self,
cata=self.readercata.cata,
def readFromStdOut(self) :
a=self.monExe.readAllStandardOutput()
self.w.view.append(QString.fromUtf8(a.data(),len(a))) ;
-
+
#-----------------------#
def viewJdcRapport(self):
#-----------------------#
strRapport = unicode( self.jdc.report() )
+ # on ajoute les regles
+
self._viewText(strRapport, "JDC_RAPPORT")
+ #-----------------------#
+ def viewJdcRegles(self):
+ #-----------------------#
+ if self.tree :self.tree.AppelleBuildLBRegles()
+
+
#----------------#
def closeIt(self):
#----------------#
# appele par I_MACRO_ETAPE
QMessageBox.information( self, titre, message)
+ #-----------------------------------#
+ def affiche_commentaire(self,message):
+ #-----------------------------------#
+ self.labelCommentaire.setText(message)
+
#-------------------#
def init_modif(self):
#-------------------#
#---------------------#
def handleDeplier(self):
#---------------------#
- print "je passe ici"
if self.tree == None : return
#self.tree.collapseAll()
if self.deplier :
"""
fn = unicode(fn)
-
+
if txt == None :
txt = self.get_text_JDC(self.format,formatLigne=formatLigne)
eol = '\n'
#-----------------------------------------------------------#
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()
dicoCourant=self.generator.dico
return dicoCourant
-
+
#-----------------------------------------#
def handleAjoutGroup(self,listeGroup):
#texte=""
return texte
+ #---------------------------#
+ def _newPSEN(self):
+ #---------------------------#
+ texte="DIRECTORY() ; PSSE_PARAMETERS() ; SIMULATION() ; sansnom=DISTRIBUTION() ; sansnom=DISTRIBUTION() ; CORRELATION() ;"
+ #texte=""
+ return texte
+
#---------------------------#
#---------------------------#
def _newJDCCND(self):
#---------------------------#
extensions=tr('Fichiers Med (*.med);;''Tous les Fichiers (*)')
-
+
#if self.salome == 0 :
QMessageBox.information( self,
tr("Fichier Med"),
texteVcut=""
texteZs=""
for groupe in self.listeGroupes :
- if groupe[0:8]=='CURRENT_':
+ if groupe[0:8]=='CURRENT_':
texteSources +=groupe[8:]+"=SOURCE("
texteSources +="VecteurDirecteur=(1.0,2.0,3.0,),);\n"
if groupe[0:5]=='COND_': texteCond +=groupe[5:]+"=CONDUCTEUR();\n"