import readercata
import qtCommun
+DictExtensions= {"Map" : ".map"}
if generator.plugins.has_key(format):
# Le generateur existe on l'utilise
self.generator=generator.plugins[format]()
- self.dicoRun=self.generator.generRUN(self.jdc,format='beautifie',config=self.appliEficas.CONFIGURATION)
- if not self.generator.cr.estvide():
- self.affiche_infos("Erreur à la generation",Qt.red)
- QMessageBox.critical( self, "Erreur a la generation","EFICAS ne sait pas convertir ce JDC")
- return ""
- for code in self.dicoRun.keys():
- txt= apply(JDCEditor.__dict__[code],(self,))
- if txt !="" :
- self.textePython=self.textePython+txt
+ self.textePython =self.generator.generRUN(self.jdc,format='beautifie',config=self.appliEficas.CONFIGURATION)
if execution=="oui" :
os.system(self.textePython)
else:
return self.textePython
+
+ #-----------------------------#
+ def runYACS(self,execution="oui"):
+ #-----------------------------#
+ format=self.appliEficas.format_fichier
+ self.textePython=""
+ if generator.plugins.has_key(format):
+ # Le generateur existe on l'utilise
+ self.generator=generator.plugins[format]()
+ self.textePython =self.generator.generRUNYACS(self.jdc,format='beautifie',config=self.appliEficas.CONFIGURATION)
+ if execution=="oui" :
+ print "il faut faire le run dans Salome"
+ else:
+ return self.textePython
+
#-----------------------------#
- def saveRun(self):
+ def saveYACS(self):
#-----------------------------#
- texte=self.run(execution="non")
- print texte
+ texte=self.runYACS(execution="non")
+ path=self.CONFIGURATION.savedir
+ fn = QFileDialog.getSaveFileName( self,
+ self.trUtf8("sauvegarde"), path,
+ self.trUtf8("JDC (*.py);;" "All Files (*)"),None,
+ QFileDialog.DontConfirmOverwrite)
+ if fn.isNull(): return
+ ext = QFileInfo(fn).suffix()
+ if ext.isEmpty(): fn.append(".xml")
+
+ if QFileInfo(fn).exists():
+ abort = QMessageBox.warning(self,
+ self.trUtf8("Sauvegarde du Fichier"),
+ self.trUtf8("Le fichier <b>%1</b> existe deja.").arg(fn),
+ self.trUtf8("&Ecraser"),
+ self.trUtf8("&Abandonner"))
+ if abort == 1 : return
+
+ fn = unicode(QDir.convertSeparators(fn))
+ self.writeFile( fn, txt = texte)
#-----------------------------------------#e
self.appliEficas.CONFIGURATION.savedir=os.path.split(ulfile)[0]
ext = QFileInfo(fn).suffix()
- if ext.isEmpty(): fn.append(".comm")
+ if ext.isEmpty():
+ if DictExtensions.has_key(self.appli.code) :
+ fn.append(DictExtensions[self.appli.code])
+ else :
+ fn.append(".comm")
if QFileInfo(fn).exists():
abort = QMessageBox.warning(self,
pass
try :
- #if 1 :
self.generator.writeCuve2DG()
- #else :
except :
pass
-
try :
- #if 1 :
self.tubePy=self.generator.getTubePy()
fileTube = fn[:fn.rfind(".")] + '.py'
if self.tubePy != '' :
"s_oxides_st_1" : "Determination de l'allure de l'interface d'un oxyde donné \npour un niveau a determiner d'irradiation" ,
"s_oxides_st_2" : "Estimation du champ mecanique dans une couche de zircone" ,
"s_oxides_mt_1" : "Estimation du champ mecanique dans une couche de zircone \nprésentant des défauts et de l'énergie élastique relaxée",
-"c_scc_st_1" : "Analyse morphologique et mécanique d'une couche d'oxydes",
-"c_scc_st_2" : "Analyse statistique de données locales et expérimentales \nou numériques",
-"s_cc_st_3" : "taux de couverture des joints de grains par des précipités",
+"s_scc_st_1" : "Analyse morphologique et mécanique d'une couche d'oxydes",
+"s_scc_st_2" : "Analyse statistique de données locales et expérimentales \nou numériques",
+"s_scc_st_3" : "taux de couverture des joints de grains par des précipités",
"s_poly_st_1" : "Estimation numérique 3D de la diffusion effective des gaz dans les polymères chargés",
}
dico={"oxides" : {"irradiation" : "s_oxides_st_1",
"mecanique" : "s_oxides_st_2",
"mecanique avec defaut" : "s_oxides_mt_1"},
- "scc" : {"analyse morphologique" : "c_scc_st_1",
- "analyse statistique" : "c_scc_st_2",
- "taux de couverture" : "s_cc_st_3"},
+ "scc" : {"analyse morphologique" : "s_scc_st_1",
+ "analyse statistique" : "s_scc_st_2",
+ "taux de couverture" : "s_scc_st_3"},
"concrete" : {},
"polycristals" : {},
"polymers" : {"numerique 3D" : "s_poly_st_1"},
self.LENomConcept.setText("")
self.LENomConcept.setText(nomConcept)
self.LENomConcept.setFocus()
+ if self.node.item.is_reentrant():
+ self.makeConceptPage_reentrant()
+ else :
+ self.listBoxASSD.close()
+
+ def makeConceptPage_reentrant(self):
+ self.bOk.close()
+ self.LENomConcept.close()
+ self.Label2.close()
+ self.Label3.close()
+ self.typeConcept.close()
+ self.LENomConcept.close()
+ self.Label1.setText(QtGui.QApplication.translate("DUnASSD", "<font size=\"+1\"><p align=\"center\">Structures de données à enrichir\n"
+" par l\'operateur courant :</p></font>", None, QtGui.QApplication.CodecForTr))
+ listeNomsSD = self.node.item.get_noms_sd_oper_reentrant()
+ for aSD in listeNomsSD:
+ self.listBoxASSD.addItem( aSD)
+ QObject.connect(self.listBoxASSD, SIGNAL("itemDoubleClicked(QListWidgetItem*)" ), self.ClicASSD )
+
+ def ClicASSD(self):
+ if self.listBoxASSD.currentItem()== None : return
+ val=self.listBoxASSD.currentItem().text()
+ nom=str(val)
+ nom = string.strip(nom)
+ test,mess = self.node.item.nomme_sd(nom)
+ if (test== 0):
+ self.editor.affiche_infos(mess,Qt.red)
+
def LENomConceptReturnPressed(self):
"""
Nomme le concept SD retourne par l'etape
self.connect(self.actionTraduitV8V9,SIGNAL("activated()"),self.traductionV8V9)
+ def Map(self):
+ self.MAP()
+
def MAP(self):
self.actionExecution = QAction(self)
icon6 = QIcon(self.RepIcon+"/compute.png")
self.toolBar.addAction(self.actionExecution)
self.actionExecution.setText(QApplication.translate("Eficas", "Execution", None, QApplication.UnicodeUTF8))
self.connect(self.actionExecution,SIGNAL("activated()"),self.run)
+
self.actionEnregistrer_Python = QAction(self)
self.actionEnregistrer_Python.setObjectName("actionEnregistrer_Python")
self.menuFichier.addAction(self.actionEnregistrer_Python)
self.actionEnregistrer_Python.setText(QApplication.translate("Eficas", "Sauve Python", None,QApplication.UnicodeUTF8))
self.connect(self.actionEnregistrer_Python,SIGNAL("activated()"),self.saveRun)
+ self.actionEnregistrerYACS = QAction(self)
+ self.actionEnregistrerYACS.setObjectName("actionEnregistrerYACS")
+ self.menuFichier.addAction(self.actionEnregistrerYACS)
+ self.actionEnregistrerYACS.setText(QApplication.translate("Eficas", "Sauve Schema YACS", None,QApplication.UnicodeUTF8))
+ self.connect(self.actionEnregistrerYACS,SIGNAL("activated()"),self.saveYACS)
+
+ self.actionExecutionYACS = QAction(self)
+ icon7 = QIcon(self.RepIcon+"/application.gif")
+ self.actionExecutionYACS.setIcon(icon7)
+ self.actionExecutionYACS.setObjectName("actionExecutionYACS")
+ self.menuJdC.addAction(self.actionExecutionYACS)
+ self.toolBar.addAction(self.actionExecutionYACS)
+ self.actionExecutionYACS.setText(QApplication.translate("Eficas", "Execution YACS", None, QApplication.UnicodeUTF8))
+ self.connect(self.actionExecutionYACS,SIGNAL("activated()"),self.runYACS)
+
def ajoutIcones(self) :
# Pour pallier les soucis de repertoire d icone
icon = QIcon(self.RepIcon+"/New24.png")
def saveRun(self):
self.viewmanager.saveRun()
+ def runYACS(self):
+ self.viewmanager.runYACS()
+
+ def saveYACS(self):
+ self.viewmanager.saveYACS()
+
def supprimer(self):
self.viewmanager.handleSupprimer()
def traite_clefs_documentaires(self):
try:
self.fic_cata_clef=os.path.splitext(self.fic_cata_c)[0]+'_clefs_docu'
+ print self.fic_cata_clef
f=open(self.fic_cata_clef)
except:
- #print "Pas de fichier associé contenant des clefs documentaires"
+ print "Pas de fichier associé contenant des clefs documentaires"
return
dict_clef_docu={}
def viewDoc(self):
self.node=self.tree.currentItem()
cle_doc = self.node.item.get_docu()
+ print self.node.item.get_docu
if cle_doc == None :
QMessageBox.information( self.editor, "Documentation Vide", \
"Aucune documentation Aster n'est associée à ce noeud")
editor=self.dict_editors[index]
editor.saveRun()
+ def runYACS(self):
+ index=self.myQtab.currentIndex()
+ if index < 0 : return
+ editor=self.dict_editors[index]
+ editor.runYACS()
+
+ def saveYACS(self):
+ index=self.myQtab.currentIndex()
+ if index < 0 : return
+ editor=self.dict_editors[index]
+ editor.saveYACS()
+
def handleCloseAll(self):
res=0
self.appliEficas.sauveRecents()
<property name="windowTitle" >
<string>DComm</string>
</property>
- <layout class="QGridLayout" name="gridLayout_3" >
- <item row="1" column="0" >
- <widget class="QLabel" name="Commentaire" >
- <property name="maximumSize" >
- <size>
- <width>793</width>
- <height>20</height>
- </size>
- </property>
- <property name="frameShape" >
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow" >
- <enum>QFrame::Plain</enum>
- </property>
- <property name="text" >
- <string/>
- </property>
- <property name="wordWrap" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="0" >
- <layout class="QHBoxLayout" name="horizontalLayout" >
- <item>
- <spacer name="horizontalSpacer" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>263</width>
- <height>27</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="bOk" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize" >
- <size>
- <width>160</width>
- <height>30</height>
- </size>
- </property>
- <property name="maximumSize" >
- <size>
- <width>16777215</width>
- <height>30</height>
- </size>
- </property>
- <property name="toolTip" >
- <string>validation de la saisie</string>
- </property>
- <property name="text" >
- <string>&Valider</string>
- </property>
- <property name="shortcut" >
- <string>Shift+A, Alt+A, Alt+A, Alt+A</string>
- </property>
- <property name="autoDefault" >
- <bool>true</bool>
- </property>
- <property name="default" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_2" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>254</width>
- <height>27</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
+ <layout class="QGridLayout" name="gridLayout_11" >
<item row="0" column="0" >
<widget class="QTabWidget" name="TWChoix" >
<property name="currentIndex" >
- <number>0</number>
+ <number>1</number>
</property>
<widget class="QWidget" name="MotClef" >
<attribute name="title" >
<property name="title" >
<string>Concept</string>
</property>
- <layout class="QGridLayout" name="gridLayout_8" >
+ <layout class="QGridLayout" name="gridLayout_10" >
<item row="0" column="0" >
- <widget class="QSplitter" name="splitter" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <widget class="QLabel" name="textLabel1_3" >
- <property name="text" >
- <string><u>Nom du concept :</u></string>
- </property>
- <property name="wordWrap" >
- <bool>false</bool>
- </property>
- </widget>
- </widget>
- </item>
- <item row="1" column="0" >
- <layout class="QHBoxLayout" name="horizontalLayout_2" >
- <item>
+ <layout class="QGridLayout" name="gridLayout_3" >
+ <item row="0" column="0" colspan="2" >
+ <widget class="QLabel" name="Label1" >
+ <property name="text" >
+ <string><u>Nom du concept :</u></string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
<widget class="QLineEdit" name="LENomConcept" >
<property name="minimumSize" >
<size>
</property>
</widget>
</item>
- <item>
+ <item row="1" column="1" >
<spacer name="horizontalSpacer_3" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</item>
</layout>
</item>
- <item row="2" column="0" >
- <spacer name="verticalSpacer_3" >
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>20</width>
- <height>51</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="3" column="0" >
- <layout class="QVBoxLayout" name="verticalLayout" >
- <item>
- <layout class="QGridLayout" name="gridLayout_7" >
- <item row="0" column="0" >
- <widget class="QLabel" name="textLabel1_3_2" >
- <property name="text" >
- <string><u>Type du concept :</u></string>
- </property>
- <property name="wordWrap" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="0" >
- <widget class="QLabel" name="textLabel3" >
- <property name="text" >
- <string>L'opérateur retourne un concept de type :</string>
- </property>
- <property name="wordWrap" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1" >
- <widget class="QLabel" name="typeConcept" >
- <property name="text" >
- <string>TypeDuConcept</string>
- </property>
- <property name="wordWrap" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
+ <item row="1" column="0" >
+ <layout class="QGridLayout" name="gridLayout_8" >
+ <item row="0" column="0" >
+ <widget class="QListWidget" name="listBoxASSD" />
</item>
- <item>
+ <item row="1" column="0" >
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
- <height>338</height>
+ <height>168</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
+ <item row="2" column="0" >
+ <layout class="QGridLayout" name="gridLayout_7" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="Label2" >
+ <property name="text" >
+ <string><u>Type du concept :</u></string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="Label3" >
+ <property name="text" >
+ <string>L'opérateur retourne un concept de type :</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="typeConcept" >
+ <property name="text" >
+ <string>TypeDuConcept</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
</item>
</widget>
</widget>
</item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="Commentaire" >
+ <property name="maximumSize" >
+ <size>
+ <width>793</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>263</width>
+ <height>27</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="bOk" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>160</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>validation de la saisie</string>
+ </property>
+ <property name="text" >
+ <string>&Valider</string>
+ </property>
+ <property name="shortcut" >
+ <string>Shift+A, Alt+A, Alt+A, Alt+A</string>
+ </property>
+ <property name="autoDefault" >
+ <bool>true</bool>
+ </property>
+ <property name="default" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>254</width>
+ <height>27</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
--- /dev/null
+# -*- coding: utf-8 -*-
+# CONFIGURATION MANAGEMENT OF EDF VERSION
+# ======================================================================
+# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
+# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
+# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
+# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
+# (AT YOUR OPTION) ANY LATER VERSION.
+#
+# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
+# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
+# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
+# GENERAL PUBLIC LICENSE FOR MORE DETAILS.
+#
+# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
+# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
+# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
+#
+#
+# ======================================================================
+"""
+"""
+
+import parseur_python
+from convert_python import *
+
+def entryPoint():
+ """
+ Retourne les informations nécessaires pour le chargeur de plugins
+ Ces informations sont retournées dans un dictionnaire
+ """
+ return {
+ # Le nom du plugin
+ 'name' : 's_poly_st_1',
+ # La factory pour créer une instance du plugin
+ 'factory' : PythonParser,
+ }
+
+
--- /dev/null
+# -*- coding: utf-8 -*-
+# CONFIGURATION MANAGEMENT OF EDF VERSION
+# ======================================================================
+# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
+# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
+# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
+# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
+# (AT YOUR OPTION) ANY LATER VERSION.
+#
+# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
+# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
+# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
+# GENERAL PUBLIC LICENSE FOR MORE DETAILS.
+#
+# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
+# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
+# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
+#
+#
+# ======================================================================
+"""
+"""
+
+import parseur_python
+from convert_python import *
+
+def entryPoint():
+ """
+ Retourne les informations nécessaires pour le chargeur de plugins
+ Ces informations sont retournées dans un dictionnaire
+ """
+ return {
+ # Le nom du plugin
+ 'name' : 's_scc_st_2',
+ # La factory pour créer une instance du plugin
+ 'factory' : PythonParser,
+ }
+
+
print 'generation dans generator_map'
self.config=config
self.dictMCVal={}
- self.listeTemp=[]
self.text=PythonGenerator.gener(self,obj,format)
self.generePythonMap()
return self.text
print 'generRUN dans generator_map'
self.config=config
self.dictMCVal={}
- self.listeTemp=[]
- self.text=PythonGenerator.gener(self,obj,format)
- dicoRun={}
+ text=PythonGenerator.gener(self,obj,format)
+ self.texteExecution=""
for code in self.dictMCVal.keys():
if code in self.__class__.__dict__.keys():
- listeTexte=apply(self.__class__.__dict__[code],(self,))
- dicoRun[code]=listeTexte
- else :
- dicoRun[code]=""
- return dicoRun
+ texteCode=apply(self.__class__.__dict__[code],(self,"oui"))
+ self.texteExecution=self.texteExecution+texteCode
+ return self.texteExecution
+
+ def generRUNYACS(self,obj,format='brut',config=None,):
+ print 'generRUNYACS dans generator_map'
+ self.config=config
+ self.dictMCVal={}
+ text=PythonGenerator.gener(self,obj,format)
+ self.texteExecution=""
+ for code in self.dictMCVal.keys():
+ if code in self.__class__.__dict__.keys():
+ codeYACS=str(code)+"YACS"
+ texteCode=apply(self.__class__.__dict__[codeYACS],(self,))
+ self.texteExecution=self.texteExecution+texteCode
+ return self.texteExecution
def generePythonMap(self) :
'''
'''
for code in self.dictMCVal.keys():
if code in self.__class__.__dict__.keys():
- self.texte=apply(self.__class__.__dict__[code],(self,))
+ texte=apply(self.__class__.__dict__[code],(self,"non"))
def generPROC_ETAPE(self,obj):
#print "PN: generPROC_ETAPE dans generatorMap"
if not( self.dictMCVal.has_key(self.clefDico)):
self.dictMCVal[self.clefDico]={}
self.DictTemp=self.dictMCVal[self.clefDico]
+ else:
+ tempo=self.dictMCVal[self.clefDico]
+ self.DictTemp={}
+ import types
+ if type(tempo) == types.TupleType:
+ tempo.append(self.DictTemp)
+ self.dictMCVal[self.clefDico]=tempo
+ else:
+ self.dictMCVal[self.clefDico]=[tempo,self.DictTemp]
s=PythonGenerator.generPROC_ETAPE(self,obj)
return s
+++ /dev/null
-# -*- coding: utf-8 -*-
-# CONFIGURATION MANAGEMENT OF EDF VERSION
-# ======================================================================
-# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
-# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
-# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
-# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
-# (AT YOUR OPTION) ANY LATER VERSION.
-#
-# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
-# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
-# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
-# GENERAL PUBLIC LICENSE FOR MORE DETAILS.
-#
-# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
-# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
-# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
-#
-#
-# ======================================================================
-"""
- Ce module contient le plugin generateur de fichier au format
- SEP pour EFICAS.
-
-"""
-import traceback
-import types,string,re,os
-
-from generator_python import PythonGenerator
-
-
-CONFIGliste=()
-MOTCLEFListe=("_CODE_NOMCODE",)
-
-def entryPoint():
- """
- Retourne les informations necessaires pour le chargeur de plugins
-
- Ces informations sont retournees dans un dictionnaire
- """
- return {
- # Le nom du plugin
- 'name' : 'map_OT',
- # La factory pour creer une instance du plugin
- 'factory' : MapGenerator,
- }
-
-
-class MapGenerator(PythonGenerator):
- """
- Ce generateur parcourt un objet de type JDC et produit
- un texte au format eficas et
- un texte au format py
-
- """
- # Les extensions de fichier permis?
- extensions=('.comm',)
-
- def gener(self,obj,format='brut',config=None):
- self.config=config
- self.dictMCVal={}
- self.text=PythonGenerator.gener(self,obj,format)
- self.generePythonOT()
- return self.text
-
-
- def generePythonOT(self) :
- '''
- self.dictMCVal est un dictionnaire.
- ce dictionnaire a pour clef la genealogie du MCSimp suivi de sa valeur
-
- '''
- f = file(self.config.repIni+"/schema-openturns-template.xml","r")
- chaine = f.read()
- f.close()
- chaine2=self.remplaceCONFIG(chaine)
- chaine=self.remplaceDICO(chaine2,MOTCLEFListe)
- f=open("/tmp/nouveau_scema.xml",'wb')
- f.write(chaine)
- f.close()
-
-
- def generMCSIMP(self,obj) :
- """
- Convertit un objet MCSIMP en texte python
- Remplit le dictionnaire des MCSIMP si nous ne sommes ni dans une loi, ni dans une variable
- """
- s=PythonGenerator.generMCSIMP(self,obj)
- clef=""
- for i in obj.get_genealogie() :
- clef=clef+"_"+i
- self.dictMCVal[clef]=obj.valeur
- return s
-
-
- def remplaceCONFIG(self,chaine) :
- for mot in CONFIGliste :
- rplact="%_"+mot+"%"
- result=chaine.replace(rplact,self.config.__dict__[mot])
- chaine=result
- return chaine
-
- def remplaceDICO(self,chaine,dico) :
- for mot in MOTCLEFListe :
- rplact="%"+mot+"%"
- try :
- result=chaine.replace(rplact,str(self.dictMCVal[mot]))
- except :
- result=chaine
- chaine=result
- return chaine
-
-# -*- coding: utf-8 -*-
+# -* coding: utf-8 -*-
# CONFIGURATION MANAGEMENT OF EDF VERSION
# ======================================================================
# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
"""
- def PYGMEE(self) :
- print "Generation de PYGMEE"
+ def PYGMEE(self,execution) :
dicoPygmee=self.dictMCVal["PYGMEE"]
monFichier=self.config.PATH_PYGMEE+"/pygmee_input.txt"
chaine=self.remplaceDICO(chaine2,dicoPygmee)
if os.path.isfile(monFichier) :
- #print "je detruis pygmee_input.txt"
+ print "je detruis pygmee_input.txt"
commande="rm -rf " + monFichier
os.system (commande)
f=open(monFichier,'wb')
f.write(chaine)
f.close()
+ if execution=="non" : return ""
+
if ('_PYGMEE_LANCEMENT' in dicoPygmee.keys()) and dicoPygmee['_PYGMEE_LANCEMENT'] == 'oui':
- commande="cd "+self.config.PATH_PYGMEE+";"
- commande=commande + "python "+self.config.PATH_PYGMEE+"/pygmee_v1.py"
- #print commande
- os.system(commande)
+ commande="echo '__________________';\n"
+ commande=commande + "echo 'execution de PYGMEE';\n"
+ commande=commande + "cd "+self.config.PATH_PYGMEE+";\n"
+ commande=commande + "python "+self.config.PATH_PYGMEE+"/pygmee_v1.py;\n"
+ commande=commande + "echo 'fin execution de PYGMEE';\n"
+ commande=commande + "echo '_____________________';\n\n\n"
+ return commande
else:
- return ""
+ return ""
- def BENHUR(self) :
- print "Generation de BENHUR"
+ def BENHUR(self,execution) :
dicoBenhur=self.dictMCVal["BENHUR"]
if ("PYGMEE" in self.dictMCVal.keys()) and '_PYGMEE_TAILLE' in self.dictMCVal['PYGMEE']:
dicoBenhur["_PYGMEE_TAILLE"]=self.dictMCVal["PYGMEE"]['_PYGMEE_TAILLE']
print "Attention la variable Taille_VER non definie"
finesse=str(dicoBenhur["_BENHUR_FINESSE"])
- nom_fichier_BHR=self.config.PATH_STUDY+"/"+self.config.NAME_SCHEME+"_benhur_"+finesse+".bhr"\r
+ nom_fichier_BHR=self.config.PATH_STUDY+"/"+self.config.NAME_SCHEME+"_benhur_"+finesse+".bhr"
nom_BHR_Files=self.config.PATH_BENHUR+"/BHR_files.txt"
#Lecture du fichier a trous
chaine = f.read()
f.close()
chaine2=self.remplaceCONFIG(chaine,CONFIGliste)
- print "chaine2 =", chaine2
chaine=self.remplaceDICO(chaine2,dicoBenhur)
- print "chaine =", chaine
- f=open(nom_fichier_BHR,'wb')
+ try :
+ f=open(nom_fichier_BHR,'wb')
+ except :
+ print "Pb de Generation de BENHUR"
+ return ""
f.write(chaine)
f.close()
f.write("\n\n\n")
f.close()
+ if execution=="non" : return ""
if ('_BENHUR_LANCEMENT' in dicoBenhur.keys()) and dicoBenhur['_BENHUR_LANCEMENT'] == 'oui':
- commande="cd "+self.config.PATH_BENHUR+";"
- commande=commande + "./benhur"
- print commande
- os.system(commande)
+ commande="echo '__________________';\n"
+ commande=commande + "echo 'execution de BENHUR';\n"
+ commande=commande + "cd "+self.config.PATH_BENHUR+";\n"
+ commande=commande + "./benhur;\n"
+ commande=commande + "echo 'fin execution de BENHUR';\n"
+ commande=commande + "echo '________________________';\n\n\n"
+ return commande
else:
return ""
+ def BENHURYACS(self) :
+ print "dans BENHURYACS"
+ return ""
+
+ def PYGMEEYACS(self) :
+ print "dans PYGMEEYACS"
+ return ""
def ASTER(self) :
print "Generation de ASTER"
commande="cd "+self.config.PATH_MODULE+";"
commande=commande + self.config.PATH_ASTER + "/as_run "+self.config.PATH_MODULE
commande=commande + "/"+self.config.NAME_SCHEME+"/"+self.config.NAME_SCHEME+"_aster.export"
- print commande
os.system(commande)
else:
return ""
os.system(commande)
else:
return ""
+
+
+
--- /dev/null
+# -* coding: utf-8 -*-
+# CONFIGURATION MANAGEMENT OF EDF VERSION
+# ======================================================================
+# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
+# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
+# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
+# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
+# (AT YOUR OPTION) ANY LATER VERSION.
+#
+# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
+# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
+# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
+# GENERAL PUBLIC LICENSE FOR MORE DETAILS.
+#
+# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
+# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
+# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
+#
+#
+# ======================================================================
+"""
+ Ce module contient le plugin generateur de fichier au format
+ SEP pour EFICAS.
+
+"""
+import traceback
+import types,string,re,os
+
+from generator_map import MapGenerator
+
+#____________________________________________________________________________________
+# PYGMEEDict contient une equivalence entre le catalogue Map et les lignes generees
+# comme entete (commentaire ?) dans le fichier d'input de pygmee
+#
+
+CONFIGliste=('NAME_SCHEME', 'PATH_ASTER', 'PATH_BENHUR', 'PATH_MODULE', 'PATH_PYGMEE', 'PATH_STUDY', 'repIni')
+
+
+def entryPoint():
+ """
+ Retourne les informations necessaires pour le chargeur de plugins
+
+ Ces informations sont retournees dans un dictionnaire
+ """
+ return {
+ # Le nom du plugin
+ 'name' : 's_scc_st_2',
+ # La factory pour creer une instance du plugin
+ 'factory' : s_scc_st_2Generator,
+ }
+
+
+class s_scc_st_2Generator(MapGenerator):
+ """
+ Ce generateur parcourt un objet de type JDC et produit
+ un texte au format eficas et
+ un texte au format py
+
+ """
+
+
+ def TABLEAU(self,execution):
+ dico=self.dictMCVal["TABLEAU"]
+ try :
+ a=dico['_TABLEAU_FICHIER']
+ commande='echo '+a+';'
+ return commande
+ except :
+ print "aie aie aie"
+
+