return
self.fenetre=self.getPanel()
+ #print "hhhhhhhhhh", self.editor.splitter.sizes()
for indiceWidget in range(self.editor.widgetCentraleLayout.count()):
widget=self.editor.widgetCentraleLayout.itemAt(indiceWidget)
self.editor.widgetCentraleLayout.removeItem(widget)
# ceinture et bretelle
#print 'old fenetre = ',self.editor.fenetreCentraleAffichee
+ #print "iiiiiiiiiiiiiii", self.editor.splitter.sizes()
if self.editor.fenetreCentraleAffichee != None :
#print "j enleve ", self.editor.fenetreCentraleAffichee, self.editor.fenetreCentraleAffichee.node.item.nom
self.editor.widgetCentraleLayout.removeWidget(self.editor.fenetreCentraleAffichee)
+
+ self.editor.fenetreCentraleAffichee.setParent(None)
self.editor.fenetreCentraleAffichee.close()
self.editor.widgetCentraleLayout.addWidget(self.fenetre)
encorevalide=self.valide_liste_partielle(item,listeActuelle)
if encorevalide :
listevalideliste.append(item)
- print listevalideliste
+ #print listevalideliste
return listevalideliste
def get_liste_param_possible(self):
#------------------------------------
if self.inhibeSplitter : return
if not hasattr(self,'splitter') : return
- print "______________________"
- print "saveSplitterSizes"
- print self.splitterSizes
if self.splitterSizes[2] != 0 : self.oldSizeWidgetOptionnel = self.splitterSizes[2]
- for i in range(len(self.splitter.sizes())):
+ # print self.splitterSizes
+ #print self.splitter.sizes()
+ # PNPNPNPN parfoir self.splitter.sizes() a une longueur de 4...
+ nbAGarder=len(self.splitter.sizes())
+ if nbAGarder > 3 : nbAGarder=3
+ for i in range(nbAGarder):
self.splitterSizes[i] = self.splitter.sizes()[i]
self.splitter.widget(i).resizeEvent=self.saveSplitterSizes
- print self.splitterSizes
- print "______________________"
#-----------------------------------------
if not(hasattr(self,'splitter')) : return
newSizes=self.splitterSizes[:nbWigdet]
self.splitter.setSizes(newSizes)
- print self.splitterSizes
self.inhibeSplitter = 0
#------------------------
def reaffiche(self):
#print "dans reaffiche de feuille", self.nom
if self.editor.jdc.aReafficher==True :
- #print " j appelle le reaffiche de parentQt"
self.parentQt.reaffiche()
#PN PN PN pas satisfaisant
from determine import monEnvQT5
if monEnvQT5:
from PyQt5.QtWidgets import QLineEdit, QLabel
- from PyQt5.QtCore import QEvent
+ from PyQt5.QtCore import QEvent, Qt
from PyQt5.QtGui import QIcon
else :
from PyQt4.QtGui import *
self.connect(self.RBMoins,SIGNAL("clicked()"),self.moinsPushed)
self.connect(self.RBPlus,SIGNAL("clicked()"),self.plusPushed)
self.connect(self.RBVoisListe,SIGNAL("clicked()"),self.voisListePushed)
+ if hasattr(self,'PBAlpha'):
+ self.connect(self.PBAlpha,SIGNAL("clicked()"),self.alphaPushed)
+ self.connect(self.PBCata,SIGNAL("clicked()"),self.cataPushed)
+ self.connect(self.PBFind,SIGNAL("clicked()"),self.findPushed)
+ self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEFiltreReturnPressed)
def connecterSignaux(self):
self.RBHaut.clicked.connect(self.hautPushed)
self.RBMoins.clicked.connect(self.moinsPushed)
self.RBPlus.clicked.connect(self.plusPushed)
self.RBVoisListe.clicked.connect(self.voisListePushed)
+ if hasattr(self,'PBAlpha'):
+ self.PBCata.clicked.connect(self.cataPushed)
+ self.PBAlpha.clicked.connect(self.alphaPushed)
+ self.PBFind.clicked.connect(self.findPushed)
+ self.LEFiltre.returnPressed.connect(self.LEFiltreReturnPressed)
+
+ def filtreListe(self):
+ print self.alpha
+ l=[]
+ if self.filtre != "" :
+ for i in self.listeAAfficher :
+ if i.find(self.filtre) == 0 :l.append(i)
+ self.listeAAfficher=l
+ if self.alpha : self.listeAAfficher.sort()
+
+ def LEFiltreReturnPressed(self):
+ self.filtre= self.LEFiltre.text()
+ self.prepareListeResultat()
+
+ def findPushed(self):
+ self.filtre= self.LEFiltre.text()
+ self.prepareListeResultat()
+
+ def alphaPushed(self):
+ print "alphaPushed" ,self.alpha
+ if self.alpha == 1 : return
+ print "lllllllmmmmmmmmmmmmmm"
+ self.alpha=1
+ self.prepareListeResultat()
+
+ def cataPushed(self):
+ if self.alpha == 0 : return
+ self.alpha=0
+ self.prepareListeResultat()
def hautPushed(self):
if self.NumLineEditEnCours == 1 : return
def plusPushed(self):
if self.indexDernierLabel == self.monSimpDef.max:
- self.editor.affiche_infos('nb max de valeurs : '+str(self.monSimpDef.max)+' atteint',Qt.red)
+ if len(self.listeValeursCourantes) < self.monSimpDef.max : self.chercheLigneVide()
+ else : self.editor.affiche_infos('nb max de valeurs : '+str(self.monSimpDef.max)+' atteint',Qt.red)
return
self.ajoutLineEdit()
self.descendLesLignes()
+ def chercheLigneVide(self):
+ for i in range(self.indexDernierLabel) :
+ nomLineEdit=self.nomLine+str(i+1)
+ courant=getattr(self,nomLineEdit)
+ valeur=courant.getValeur()
+ if valeur=="" : courant.setFocus(7);return
+
+
def descendLesLignes(self):
if self.NumLineEditEnCours==self.indexDernierLabel : return
nomLineEdit=self.nomLine+str(self.NumLineEditEnCours+1)
discrètes
"""
def __init__(self, QWparent, listeCata, title = None):
- QtGui.QDialog.__init__(self, QWparent)
+ QDialog.__init__(self, QWparent)
self.setModal(True)
self.setupUi(self)
self.CBChoixCata.addItems(listeCata)
#self.editor.labelCommentaire.setText("")
if self.editor.widgetOptionnel!= None :
- self.editor.widgetOptionnel.close()
+ self.editor.fermeOptionnel()
self.editor.widgetOptionnel=None
self.name=None
from politiquesValidation import PolitiqueUnique
from qtSaisie import SaisieValeur
+from determine import monEnvQT5
+if monEnvQT5:
+ from PyQt5.QtWidgets import QComboBox, QCompleter
+else :
+ from PyQt4.QtGui import *
+ from PyQt4.QtCore import *
+
class MonWidgetCBCommun (Ui_WidgetCB,Feuille):
self.politique=PolitiqueUnique(self.node,self.editor)
self.determineChoix()
self.setValeursApresBouton()
- self.connect(self.CBChoix,SIGNAL("currentIndexChanged(int)"),self.ChoixSaisi)
+ if monEnvQT5:
+ self.CBChoix.currentIndexChanged.connect(self.ChoixSaisi)
+ else :
+ self.connect(self.CBChoix,SIGNAL("currentIndexChanged(int)"),self.ChoixSaisi)
#self.CBChoix.lineEdit().setText(tr("Select"))
self.parentQt.commandesLayout.insertWidget(-1,self)
self.maCommande.listeAffichageWidget.append(self.CBChoix)
self.CBChoix.setCurrentIndex(self.CBChoix.findText(valeur))
def determineChoix(self):
- listeChoix=QStringList()
+ if monEnvQT5: listeChoix=[]
+ else : listeChoix=QStringList()
for choix in self.maListeDeValeur:
if not(type(choix) in types.StringTypes) : choix=str(choix)
- listeChoix<<choix
+ if monEnvQT5: listeChoix.append(choix)
+ else : listeChoix<<choix
self.CBChoix.addItem(choix)
self.CBChoix.setEditable(True)
monCompleteur=QCompleter(listeChoix,self)
from qtSaisie import SaisieValeur
+from determine import monEnvQT5
+if monEnvQT5:
+ from PyQt5.QtWidgets import QComboBox, QCompleter
+else :
+ from PyQt4.QtGui import *
+ from PyQt4.QtCore import *
+
+
class MonWidgetCB (Ui_WidgetCB,Feuille):
def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
self.politique=PolitiqueUnique(self.node,self.editor)
self.determineChoix()
self.setValeursApresBouton()
- self.connect(self.CBChoix,SIGNAL("currentIndexChanged(int)"),self.ChoixSaisi)
+ if monEnvQT5:
+ self.CBChoix.currentIndexChanged.connect(self.ChoixSaisi)
+ else :
+ self.connect(self.CBChoix,SIGNAL("currentIndexChanged(int)"),self.ChoixSaisi)
+
self.parentQt.commandesLayout.insertWidget(-1,self)
self.maCommande.listeAffichageWidget.append(self.CBChoix)
print self.objSimp.isoblig()
self.CBChoix.setCurrentIndex(self.CBChoix.findText(valeur))
def determineChoix(self):
- listeChoix=QStringList()
+ if monEnvQT5:
+ self.CBChoix.currentIndexChanged.connect(self.ChoixSaisi)
+ else :
+
for choix in self.monSimpDef.into:
if not(type(choix) in types.StringTypes) : choix=str(choix)
- listeChoix<<choix
+ if monEnvQT5: self.CBChoix.currentIndexChanged.connect(self.ChoixSaisi)
+ else : self.connect(self.CBChoix,SIGNAL("currentIndexChanged(int)"),self.ChoixSaisi)
self.CBChoix.addItem(choix)
self.CBChoix.setEditable(True)
monCompleteur=QCompleter(listeChoix,self)
from determine import monEnvQT5
if monEnvQT5:
- from PyQt5.QtWidgets import QApplication, QWidget
+ from PyQt5.QtWidgets import QApplication, QWidget, QSpacerItem, QSizePolicy
from PyQt5.QtGui import QFont, QIcon
from PyQt5.QtCore import QTimer
else :
self.afficheOptionnel()
self.editor.restoreSplitterSizes()
- print "fin init de widget Commande"
+ #print "fin init de widget Commande"
def donnePremier(self):
self.setIconePoubelle()
self.setIconesGenerales()
+ self.setValeurs()
self.setValide()
self.listeAffichageWidget[0].setFocus(7)
+ def setValeurs(self):
+ self.LENomFormule.setText(self.node.item.get_nom())
+ self.LECorpsFormule.setText(self.node.item.get_corps())
+ texte_args=""
+ if self.node.item.get_args() != None :
+ for i in self.node.item.get_args() :
+ if texte_args != "" : texte_args = texte_args +","
+ texte_args=texte_args + i
+ self.LENomsArgs.setText(texte_args)
+
def nomChange(self):
nom = str(self.LENom.text())
"""
"""
def __init__(self,parentQt):
- print "dans init de monWidgetOptionnel ", parentQt, parentQt.node.item.nom
+ #print "dans init de monWidgetOptionnel ", parentQt, parentQt.node.item.nom
QWidget.__init__(self,None)
self.setupUi(self)
self.dicoCb={}
self.parentQt.editor.splitterSizes[2]=self.parentQt.editor.oldSizeWidgetOptionnel
if self.parentQt.editor.splitterSizes[2] == 0 : self.parentQt.editor.splitterSizes[2] = 400
self.parentQt.editor.restoreSplitterSizes()
- print "fin init de monWidgetOptionnel ", parentQt, parentQt.node.item.nom
+ #print "fin init de monWidgetOptionnel ", parentQt, parentQt.node.item.nom
def affiche(self,liste):
- print "dans Optionnel ____ affiche", liste
+ #print "dans Optionnel ____ affiche", liste
self.show()
labeltext,fonte,couleur = self.parentMC.node.item.GetLabelText()
l=labeltext
self.dicoCb[cb]=mot
self.commandesOptionnellesLayout.insertWidget(0,cb)
self.scrollAreaCommandesOptionnelles.horizontalScrollBar().setSliderPosition(0)
- print "Fin Optionnel ____ affiche", liste
+ #print "Fin Optionnel ____ affiche", liste
def CBChecked(self):
# ordre ?
from determine import monEnvQT5
if monEnvQT5:
- from PyQt5.QtGui import Qicon,
+ from PyQt5.QtGui import Qicon
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import QTimer, QSize, Qt
else :
from determine import monEnvQT5
if monEnvQT5:
from PyQt5.QtWidgets import QCheckBox, QScrollbar, QFrame, QApplication
- from PyQt5.QtCore import QT
+ from PyQt5.QtCore import Qt
else :
from PyQt4.QtGui import *
- from PyQt4.QtCore import
+ from PyQt4.QtCore import *
from Extensions.i18n import tr
from gereListe import GerePlie
from gereListe import LECustom
from gereListe import MonLabelListeClic
+from Extensions.i18n import tr
from determine import monEnvQT5
if monEnvQT5:
- from PyQt5.QtWidgets import Qicon, QScrollbar, QFrame, QApplication
+ from PyQt5.QtWidgets import QFrame, QApplication, QScrollBar
from PyQt5.QtCore import QTimer, QSize, Qt
+ from PyQt5.QtGui import QIcon
else :
from PyQt4.QtGui import *
- from PyQt4.QtCore import
+ from PyQt4.QtCore import *
class MonWidgetPlusieursIntoOrdonne (Ui_WidgetPlusieursIntoOrdonne, Feuille,GereListe,GerePlie):
- def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
- #print "MonWidgetPlusieursInto", nom, self
+ def __init__(self,node,monSimpDef,nom,objSimp,parent,commande):
+ print "MonWidgetPlusieursInto", nom, self
self.nomLine="LEResultat"
self.listeLE=[]
self.ouAjouter=0
self.NumLineEditEnCours=0
- Feuille.__init__(self,node,monSimpDef,nom,objSimp,parent,commanme)
+ self.alpha=0
+ self.filtre=""
+ Feuille.__init__(self,node,monSimpDef,nom,objSimp,parent,commande)
GereListe.__init__(self)
self.finCommentaireListe()
self.gereIconePlier()
+ self.listeValeursCourantes=self.node.item.GetListeValeurs()
try :
self.maCommande.listeAffichageWidget.append(self.lineEditVal1)
except :
def prepareListeResultat(self):
- print "prepareListeResultat"
for i in self.listeLE: i.close()
self.listeLE=[]
self.vScrollBar = self.scrollArea.verticalScrollBar()
- listeValeursCourantes=self.node.item.GetListeValeurs()
+ self.listeValeursCourantes=self.node.item.GetListeValeurs()
if hasattr(self.node.item.definition.validators,'set_MCSimp'):
obj=self.node.item.getObject()
self.node.item.definition.validators.set_MCSimp(obj)
if self.node.item.isvalid() == 0 :
liste=[]
- for item in listeValeursCourantes:
+ for item in self.listeValeursCourantes:
if self.node.item.definition.validators.verif_item(item)==1: liste.append(item)
self.listeAAfficher=self.node.item.get_liste_possible(liste)
else:
self.listeAAfficher=self.node.item.get_liste_possible([])
else :
- self.listeAAfficher=self.node.item.get_liste_possible(listeValeursCourantes)
+ self.listeAAfficher=self.node.item.get_liste_possible(self.listeValeursCourantes)
if self.listeAAfficher==[] :
self.ajoutLE(0)
return
+ self.filtreListe()
if len(self.listeAAfficher)*20 > 400 : self.setMinimumHeight(400)
else : self.setMinimumHeight(len(self.listeAAfficher)*30)
def setValeurs(self):
- listeValeursCourantes=self.node.item.GetListeValeurs()
+ self.listeValeursCourantes=self.node.item.GetListeValeurs()
if self.monSimpDef.max == "**" : aConstruire=7
else : aConstruire=self.monSimpDef.max
- if len(listeValeursCourantes) > aConstruire : aConstruire=len(listeValeursCourantes)
+ if len(self.listeValeursCourantes) > aConstruire : aConstruire=len(self.listeValeursCourantes)
for i in range(1,aConstruire+1): self.ajoutLEResultat(i)
self.indexDernierLabel=aConstruire
index=1
- for val in listeValeursCourantes :
+ for val in self.listeValeursCourantes :
nomLE="LEResultat"+str(index)
courant=getattr(self,nomLE)
courant.setText(str(val))
if liste ==[] : return
listeVal=[]
- listeValeursCourantes=self.node.item.GetListeValeurs()
+ self.listeValeursCourantes=self.node.item.GetListeValeurs()
min,max = self.node.item.GetMinMax()
- if len(listeValeursCourantes) +1 > max :
+ if len(self.listeValeursCourantes) +1 > max :
self.editor.affiche_infos(tr("Nombre maximal de valeurs : ") + str(max),Qt.red)
return
else :
- self.editor.affiche_infos(tr(""))
+ self.editor.affiche_infos("")
affiche=False
for i in range(1,self.indexDernierLabel+1):
validite,comm,comm2,listeRetour=self.politique.AjoutValeurs(listeVal,-1,[])
- listeValeursCourantes=self.node.item.GetListeValeurs()
+ self.listeValeursCourantes=self.node.item.GetListeValeurs()
min,max = self.node.item.GetMinMax()
- if len(listeValeursCourantes) < min :
+ if len(self.listeValeursCourantes) < min :
self.editor.affiche_infos(tr("Nombre minimal de valeurs : ") + str(min),Qt.red)
else :
self.editor.affiche_infos("")
# Modules Eficas
from determine import monEnvQT5
if monEnvQT5:
- from PyQt5.QtWidgets import Qicon, QScrollbar, QFrame
- from PyQt5.QtCore import QTimer, QSize, QT
+ from PyQt5.QtWidgets import QFrame
+ from PyQt5.QtCore import QTimer, QSize, Qt
+ from PyQt5.QtGui import QIcon
else :
from PyQt4.QtGui import *
- from PyQt4.QtCore import
+ from PyQt4.QtCore import *
from Extensions.i18n import tr
self.maCommande.listeAffichageWidget.append(self.lineEditVal)
if monEnvQT5 :
- self.BVisuListe.clicked(self.selectWidgetDeplie)
+ self.BVisuListe.clicked.connect(self.selectWidgetDeplie)
else :
self.connect(self.BVisuListe,SIGNAL("clicked()"), self.selectWidgetDeplie)
# Modules Python
import string,types,os
+from determine import monEnvQT5
if monEnvQT5:
from PyQt5.QtCore import Qt
else :
courant=getattr(self,nomLineEdit)
if valeur !=None: courant.setText(str(valeur[i]))
setattr(self,nomLineEdit,courant)
- self.connect(courant,SIGNAL("returnPressed()"),self.valeursPressed)
+ if monEnvQT5: courant.returnPressed.connect(self.valeursPressed)
+ else : self.connect(courant,SIGNAL("returnPressed()"),self.valeursPressed)
def valeursPressed(self):
aLeFocus=self.focusWidget()
from determine import monEnvQT5
if monEnvQT5 :
- from PyQt5.QtWidgets import QMessageBox
+ from PyQt5.QtWidgets import QMessageBox, QApplication, QDialog
else :
from PyQt4.QtGui import *
lab=str(self.VERSION_EFICAS)+" "
lab+=tr(" pour ")
- lab+=QString(self.code)
+ lab+=str(self.code)
lab+=tr(" avec le catalogue ")
if ret == QDialog.Accepted:
cata = cata_choice_list[widgetChoix.CBChoixCata.currentIndex()]
if dict_clef_docu.has_key(oper.nom):
oper.docu=dict_clef_docu[oper.nom]
-
def cree_dico_inverse(self):
self.dicoInverse={}
- self.dico={}
+ self.dicoMC={}
listeEtapes=self.cata[0].JdC.commandes
for e in self.cata[0].JdC.commandes:
+ #for e in (self.cata[0].JdC.commandes[0],):
+ #print e.nom
self.traite_entite(e)
- #print self.dicoInverse.keys()
#for e in self.cata[0].JdC.commandes:
- # print "___________", e. nom , '__________________'
# self.cree_rubrique(e,self.dico,0)
-
+ #print self.dicoInverse
+
+ from Extensions import localisation
+ app=QApplication
+ # tres dommage A Revoir
+ localisation.localise(app,"fr")
+ self.dicoInverseFrancais={}
+ self.dicoFrancaisAnglais={}
+ self.dicoAnglaisFrancais={}
+ for k in self.dicoInverse.keys():
+ listefr=[]
+ for nom, obj in self.dicoInverse[k] :
+ listefr.append((tr(nom),obj))
+ self.dicoFrancaisAnglais[tr(nom)]=nom
+ self.dicoAnglaisFrancais[nom]=tr(nom)
+ self.dicoInverseFrancais[tr(k)]=listefr
+ #print tr(k),listefr
+ if self.appliEficas.langue=="ang" : localisation.localise(app,"en")
+
def traite_entite(self,e):
+ #print "_______________"
+ #print e
+ #print e.nom
boolIn=0
for (nomFils, fils) in e.entites.items() :
+ self.dicoMC[nomFils]=fils
self.traite_entite(fils)
boolIn=1
if boolIn==0 :
def cree_rubrique(self,e,dico, niveau):
from Accas import A_BLOC
decale=niveau*" "
- if niveau != 0 :
- if isinstance(e,A_BLOC.BLOC): print decale, e.condition
- else : print decale, e. nom
+ #if niveau != 0 :
+ # if isinstance(e,A_BLOC.BLOC): print decale, e.condition
+ # else : print decale, e. nom
for (nom, fils) in e.entites.items() :
if fils.entites.items() != [] : self.cree_rubrique(fils,dico,niveau+1)
- else : print (niveau+1)*" ", nom
+ #else : print (niveau+1)*" ", nom
-
-
--- /dev/null
+# -*- coding: utf-8 -*-
+# 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
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+"""Ce module contient le plugin generateur de fichier au format Code_Carmel3D pour EFICAS.
+"""
+
+listeSupprime = ( 'DAY', 'MONTH', 'YEAR', 'HOUR', 'MINUTE', 'SECOND', 'CONSIGNE'
+ 'LIMIT VALUES H', 'LIMIT VALUES U', 'LIMIT VALUES V', 'LIMIT VALUES T',
+ 'SISYPHE', 'TOMAWAC', 'DELWAQ',
+ 'ADVECTION U AND V', 'ADVECTION H',
+ 'ADVECTION TRACERS', 'ADVECTION K AND EPSILON',
+ 'TOLERANCE FOR H', 'TOLERANCE FOR U', 'TOLERANCE FOR V', 'TOLERANCE FOR COUT',
+ 'SUPG OPTION U AND V', 'SUPG OPTION H', 'SUPG OPTION TRACERS', 'SUPG OPTION K AND EPSILON',
+ 'UPWIND COEFFICIENTS Of U AND V', 'UPWIND COEFFICIENTS OF H',
+)
+
+DicoAglomere= {
+'LIMIT VALUES' : ( 'Limit_Values_H', 'Limit_Values_U', 'Limit_Values_V', 'Limit_Values_T'),
+'COUPLING WITH' : ( 'Sisyphe', 'Tomawac', 'Delwaq'),
+'TYPE OF ADVECTION' : ( 'Advection_U_And_V', 'Advection_H', 'Advection_Tracers','Advection_K_And_Epsilon'),
+'TOLERANCE' : ( 'Tolerance_For_H', 'Tolerance_For_U', 'Tolerance_For_V', 'Tolerance_For_cout',),
+'SUPG OPTION' : ( 'Supg_Option_U_And_V', 'Supg_Option_H', 'Supg_Option_Tracers', 'Supg_Option_K_And_Epsilon',),
+'UPWIND COEFFICIENTS' : ( 'Upwind_Coefficients_Of_U_And_V', 'Upwind_Coefficients_Of_H', ),
+}
+
+DicoEficasToCas= {
+ 'C U PRECONDITIONING' : 'C-U PRECONDITIONING' ,
+ 'INFORMATION ABOUT K EPSILON MODEL' : 'INFORMATION ABOUT K-EPSILON MODEL' ,
+ 'MANNING DEFAULT VALUE FOR COLEBROOK WHITE LAW' : 'MANNING DEFAULT VALUE FOR COLEBROOK-WHITE LAW' ,
+ 'MASS BALANCE' : 'MASS-BALANCE' ,
+ 'MASS LUMPING FOR WEAK CHARACTERISTICS' : 'MASS-LUMPING FOR WEAK CHARACTERISTICS',
+ 'MASS LUMPING ON H' : 'MASS-LUMPING ON H' ,
+ 'MASS LUMPING ON TRACERS' : 'MASS-LUMPING ON TRACERS' ,
+ 'MASS LUMPING ON VELOCITY' : 'MASS-LUMPING ON VELOCITY' ,
+ 'MATRIX VECTOR PRODUCT' : 'MATRIX-VECTOR PRODUCT' ,
+ 'NON DIMENSIONAL DISPERSION COEFFICIENTS' : 'NON-DIMENSIONAL DISPERSION COEFFICIENTS' ,
+ 'NON SUBMERGED VEGETATION FRICTION' : 'NON-SUBMERGED VEGETATION FRICTION' ,
+ 'NUMBER OF SUB ITERATIONS FOR NON LINEARITIES' : 'NUMBER OF SUB-ITERATIONS FOR NON-LINEARITIES' ,
+ 'OPTION FOR THE SOLVER FOR K EPSILON MODEL' : 'OPTION FOR THE SOLVER FOR K-EPSILON MODEL' ,
+ 'PRECONDITIONING FOR K EPSILON MODEL' : 'PRECONDITIONING FOR K-EPSILON MODEL' ,
+ 'SOLVER FOR K EPSILON MODEL' : 'SOLVER FOR K-EPSILON MODEL' ,
+ 'STAGE DISCHARGE CURVES FILE' : 'STAGE-DISCHARGE CURVES FILE' ,
+ 'STAGE DISCHARGE CURVES' : 'STAGE-DISCHARGE CURVES' ,
+ 'TIME STEP REDUCTION FOR K EPSILON MODEL' : 'TIME STEP REDUCTION FOR K-EPSILON MODEL' ,
+ 'VARIABLE TIME STEP' : 'VARIABLE TIME-STEP' ,
+
+}
+
+DicoCasToEficas = {}
+for k in DicoCasToEficas.keys() : DicoCasToEficas[DicoEficasToCas[k]]=k
+
+
+DicoFrancaisAvecApostrophe= {
+ "Coordonnees_De_L_Origine" : "Coordonnees_De_L'origine",
+ "Modele_De_Nappes_D_Hydrocarbures" : "Modele_De_Nappes_D'hydrocarbures",
+ "Maximum_D_Iterations_Pour_La_Diffusion_Des_Traceurs" : "Maximum_D'iterations_Pour_La_Diffusion_Des_Traceurs",
+ "Coefficient_D_Implicitation_Des_Traceurs" : "Coefficient_D'implicitation_Des_Traceurs",
+ "Coefficient_D_Influence_Du_Vent" : "Coefficient_D'influence_Du_Vent",
+ "Date_De_L_Origine_Des_Temps" : "Date_De_L'origine_Des_Temps",
+ "Elements_Masques_Par_L_Utilisateur" : "Elements_Masques_Par_L'utilisateur",
+ "Maximum_D_Iterations_Pour_L_Identification" : "Maximum_D'iterations_Pour_L'identification",
+ "Heure_De_L_Origine_Des_Temps" : "Heure_De_L'origine_Des_Temps",
+ "Methode_D_Identification" : "Methode_D'identification",
+ "Masse_Volumique_De_L_Eau" : "Masse_Volumique_De_L'eau",
+ "Coefficient_D_Integration_En_Temps_De_Newmark" : "Coefficient_D'integration_En_Temps_De_Newmark",
+ "Bornes_En_Temps_Pour_L_Analyse_De_Fourier" : "Bornes_En_Temps_Pour_L'analyse_De_Fourier",
+ "Periodes_D_Analyse_De_Fourier" : "Periodes_D'analyse_De_Fourier",
+ "Precisions_Pour_L_Identification" : "Precisions_Pour_L'identification",
+ "Maximum_D_Iterations_Pour_K_Et_Epsilon" : "Maximum_D'iterations_Pour_K_Et_Epsilon",
+ "Maximum_D_Iterations_Pour_Les_Schemas_De_Convection" : "Maximum_D'iterations_Pour_Les_Schemas_De_Convection",
+ "Numero_De_L_Enregistrement_Dans_Le_Fichier_De_Houle" : "Numero_De_L'enregistrement_Dans_Le_Fichier_De_Houle",
+ "Criteres_D_Arret" : "Criteres_D'arret",
+}
+
+ListeSupprimeCasToEficas = ('Validation','Parallel_Processors')
+ListeCalculEficasToCas = ('Validation',)
+ListeCalculCasToEficas = ('Option_De_Supg', 'Forme_De_La_Convection')
--- /dev/null
+DicoEnumCasEn={
+'PSI SCHEME OPTION' : {
+ 1 : "Explicit",
+ 2 : "Predictor-corrector"
+ },
+
+'TYPE OF ADVECTION' : {
+ 1 : "Characteristics",
+ 2 : "SUPG",
+ 3 : "Conservative N-scheme",
+ 4 : "Conservative N-scheme",
+ 5 : "Conservative PSI-scheme",
+ 6 : "Non conservative PSI-scheme",
+ 7 : "Implicit non conservative N-scheme",
+ 13 : "Edge-based N-scheme",
+ 14 : "Edge-based N-scheme"
+ },
+
+'GEOMETRY FILE FORMAT' : {
+ 'SERAFIN': 'Serafin',
+ 'MED': 'MED',
+ 'SERAFIND': 'SerafinD',
+ },
+
+'PREVIOUS COMPUTATION FILE FORMAT' : {
+ 'SERAFIN': 'Serafin',
+ 'MED': 'MED',
+ 'SERAFIND': 'SerafinD',
+ },
+
+'REFERENCE FILE FORMAT' : {
+ 'SERAFIN': 'Serafin',
+ 'MED': 'MED',
+ 'SERAFIND': 'SerafinD',
+ },
+
+'RESULTS FILE FORMAT' : {
+ 'SERAFIN': 'Serafin',
+ 'MED': 'MED',
+ 'SERAFIND': 'SerafinD',
+ },
+
+'PRECONDITIONING' : {
+ 0 : "No preconditioning",
+ 2 : "Diagonal",
+ 3 : "Diagonal condensee",
+ 7 : "Crout",
+ 11 : "Gauss-Seidel",
+ 14 : "Diagonal and Crout",
+ 21 : "Diagonal condensed and Crout"
+ },
+
+'INITIAL GUESS FOR H' : {
+ 1 : "Previous",
+ 0 : "Zero",
+ 2 : "Extrapolation"
+ },
+
+'LAW OF BOTTOM FRICTION' : {
+ 0 : "No friction",
+ 1 : "Haaland",
+ 2 : "Chezy",
+ 3 : "Strickler",
+ 4 : "Manning",
+ 5 : "Nikuradse"
+ },
+
+'SOLVER FOR DIFFUSION OF TRACERS' : {
+ 1 : "Conjugate gradient",
+ 2 : "Conjugate residual",
+ 3 : "Conjugate gradient on a normal equation",
+ 4 : "Minimum error",
+ 5 : "Squared conjugate gradient",
+ 6 : "CGSTAB",
+ 7 : "GMRES",
+ 8 : "Direct"
+ },
+
+'SOLVER' : {
+ 3 : "Conjugate gradient on a normal equation",
+ 1 : "Conjugate gradient",
+ 2 : "Conjugate residual",
+ 4 : "Minimum error",
+ 6 : "CGSTAB",
+ 7 : "GMRES",
+ 8 : "Direct"
+ },
+
+'PRECONDITIONING FOR DIFFUSION OF TRACERS' : {
+ 2 : "Diagonal",
+ 0 : "No preconditioning",
+ 3 : "Diagonal condensed",
+ 7 : "Crout",
+ 14 : "Diagonal and Crout",
+ 21 : "Diagonal condensed and Crout"
+ },
+
+'SOLVER FOR K-EPSILON MODEL' : {
+ 1 : "Conjugate gradient",
+ 2 : "Conjugate residuals",
+ 3 : "Conjugate gradient on normal equation",
+ 4 : "Minimum error",
+ 5 : "Conjugate gradient squared",
+ 6 : "Conjugate gradient squared stabilised (CGSTAB)",
+ 7 : "GMRES",
+ 8 : "Direct"
+ },
+
+'PRECONDITIONING FOR K-EPSILON MODEL' : {
+ 2 : "Diagonal",
+ 0 : "No preconditioning",
+ 3 : "Diagonal condensed",
+ 7 : "Crout",
+ 14 : "Diagonal and Crout",
+ 21 : "Diagonal condensed and Crout"
+ },
+
+'TURBULENCE MODEL FOR SOLID BOUNDARIES' : {
+ 1 : "Smooth",
+ 2 : "Rough"
+ },
+
+'FRICTION COEFFICIENT' : {
+ 1 : "Linear coefficient",
+ 2 : "Chezy coefficient",
+ 3 : "Strickler coefficient",
+ 4 : "Manning coefficient",
+ 5 : "Nikuradse grain size",
+ },
+
+
+'TURBULENCE MODEL' : {
+ 1 : "Constant viscosity",
+ 2 : "Elder",
+ 3 : "K-Epsilon Model",
+ 4 : "Smagorinski",
+ },
+
+
+
+'ROUGHNESS COEFFICIENT OF BOUNDARIES' : {
+ 1 : "Non programme",
+ 2 : "Coefficient de Chezy",
+ 3 : "Coefficient de Strickler",
+ 4 : "Coefficient de Manning",
+ 5 : "Hauteur de rugosite de Nikuradse",
+ },
+
+
+'VARIABLES FOR GRAPHIC PRINTOUTS' : {
+ "U" : "Velocity along X axis (m/s)",
+ "V" : "Velocity along Y axis (m/s)",
+ "C" : "Wave celerity (m/s)",
+ "H" : "Water depth (m)",
+ "S" : "Free surface elevation (m)",
+ "B" : "Bottom elevation (m)",
+ "F" : "Froude number ",
+ "Q" : "Scalar flowrate of fluid (m2/s)",
+ "T1" : "Tracer 1 etc. ",
+ "K" : "Turbulent kinetic energy in k-epsilon model (J/kg)",
+ "E" : "Dissipation of turbulent energy (W/kg)",
+ "D" : "Turbulent viscosity of k-epsilon model (m2/s)",
+ "I" : "Flowrate along X axis (m2/s)",
+ "J" : "Flowrate along Y axis (m2/s)",
+ "M" : "Scalar velocity (m/s)",
+ "X" : "Wind along X axis (m/s)",
+ "Y" : "Wind along Y axis (m/s)",
+ "P" : "Air pressure (Pa)",
+ "W" : "Friction coefficient",
+ "A" : "Drift along X (m)",
+ "G" : "Drift along Y (m)",
+ "L" : "Courant number",
+ "N" : "Supplementary variable N ",
+ "O" : "Supplementary variable O ",
+ "R" : "Supplementary variable R ",
+ "Z" : "Supplementary variable Z ",
+ "MAXZ" : "Maximum elevation",
+ "TMXZ" : "Time of maximum elevation ",
+ "MAXV" : "Maximum velocity",
+ "TMXV" : "Time of maximum velocity",
+ "US" : "Friction velocity "
+ },
+
+'VARIABLES TO BE PRINTED' : {
+ "U" : "Velocity along X axis (m/s)",
+ "V" : "Velocity along Y axis (m/s)",
+ "C" : "Wave celerity (m/s)",
+ "H" : "Water depth (m)",
+ "S" : "Free surface elevation (m)",
+ "B" : "Bottom elevation (m)",
+ "F" : "Froude number",
+ "Q" : "Scalar flowrate of fluid (m2/s)",
+ "T" : "Tracer",
+ "K" : "Turbulent kinetic energy in k-epsilon model (J/kg)",
+ "E" : "Dissipation of turbulent energy (W/kg)",
+ "D" : "Turbulent viscosity of k-epsilon model (m2/s)",
+ "I" : "Flowrate along X axis (m2/s)",
+ "J" : "Flowrate along Y axis (m2/s)",
+ "M" : "Scalar velocity (m/s)",
+ "X" : "Wind along X axis (m/s)",
+ "Y" : "Wind along Y axis (m/s)",
+ "P" : "Air pressure (Pa)",
+ "W" : "Friction coefficient",
+ "A" : "Drift along X (m)",
+ "G" : "Drift along Y (m)",
+ "L" : "Nombre de courants ",
+ "N" : "Supplementary variable N",
+ "O" : "Supplementary variable O",
+ "R" : "Supplementary variable R",
+ "Z" : "Supplementary variable Z"
+ },
+
+
+'INITIAL CONDITIONS' : {
+ "ZERO ELEVATION" : "Zero elevation",
+ "CONSTANT ELEVATION" : "Constant elevation",
+ "ZERO DEPTH" : "Zero depth",
+ "CONSTANT DEPTH" : "Constant depth",
+ "SPECIAL" : "Special" ,
+ "TPXO SATELLITE ALTIMETRY" : "TPXO satellite altimetry",
+ },
+
+'SUPG_OPTION_U_AND_V' : {
+ 0 : "No upwinding",
+ 1 : "Classical SUPG",
+ 2 : "Modified SUPG"
+ },
+
+'OPTION FOR THE TREATMENT OF TIDAL FLATS' : {
+ 1 : "Equations solved everywhere with correction on tidal flats",
+ 2 : "Dry elements frozen",
+ 3 : "1 but with porosity (defina method)",
+ },
+
+'INITIAL GUESS FOR U' : {
+ 0 : "Zero",
+ 1 : "Previous",
+ 2 : "Extrapolation",
+ },
+
+'DISCRETIZATIONS IN SPACE' : {
+ 11 : "Linear",
+ 12 : "Quasi-bubble",
+ 13 : "Quadratic",
+ },
+
+'MATRIX VECTOR PRODUCT' : {
+ 1 : "Classic",
+ 2 : "Frontal"
+ },
+
+'MATRIX STORAGE' : {
+ 1 : "Classical EBE" ,
+ 3 : "Edge-based storage"
+ },
+'OPTION FOR LIQUID BOUNDARIES' : {
+ 1 : "Classical boundary conditions",
+ 2 : "Thompson method based on characteristics",
+ },
+
+'TREATMENT OF THE LINEAR SYSTEM' : {
+ 1 : "Coupled",
+ 2 : "Wave equation"
+},
+
+'EQUATIONS' : {
+ "SAINT-VENANT EF" : "Saint-Venant EF",
+ "SAINT-VENANT VF" : "Saint-Venant VF",
+ "BOUSSINESQ" : "Boussinesq"
+ },
+
+'VELOCITY PROFILES' : {
+ 1 : "Constant normal profile",
+ 2 : "U and V given in the conlim file",
+ 3 : "Normal velocity given in ubor in the conlim file",
+ 4 : "Velocity proportional to square root of depth",
+ 5 : "Velocity proportional to square root of depth, variant",
+ 5 : "QRT(depth) profile, variant",
+ },
+
+'OPTION FOR THE DIFFUSION OF TRACERS' : {
+ 1 : "Div( nu grad(T) )",
+ 2 : "1/h Div ( h nu grad(T)" ,
+ },
+
+'OPTION FOR THE DIFFUSION OF VELOCITIES' : {
+ 1 : "Normal",
+ 2 : "Dirac"
+ },
+
+
+'PARAMETER ESTIMATION' : {
+ "FRICTION" : "Friction",
+ "FROTTEMENT" : "Frottement",
+ "STEADY" : "Steady"
+ },
+
+
+'IDENTIFICATION METHOD' : {
+ 0 : "List of tests",
+ 1 : "Gradient simple",
+ 2 : "Conj gradient",
+ 3 : "Lagrange interp."
+ },
+
+
+'FINITE VOLUME SCHEME' : {
+ 0 : "Roe scheme",
+ 1 : "kinetic order 1",
+ 2 : "kinetic order 2",
+ 3 : "Zokagoa scheme order 1",
+ 4 : "Tchamen scheme order 1",
+ 5 : "HLLC scheme order 1",
+ 6 : "WAF scheme order 2"
+ },
+
+'STAGE-DISCHARGE CURVES' : {
+ 0 : "No one",
+ 1 : "Z(Q)",
+ 2 : "Q(Z)"
+ },
+
+'TREATMENT OF NEGATIVE DEPTHS' : {
+ 0 : "No treatment",
+ 1 : "Smoothing",
+ 2 : "Flux control",
+ },
+
+'DEPTH IN FRICTION TERMS' : {
+ 1 : "Nodal",
+ 2 : "Average",
+ },
+
+'LAW OF FRICTION ON LATERAL BOUNDARIES' : {
+ 0 : "No friction",
+ 1 : "Haaland",
+ 2 : "Chezy",
+ 3 : "Strickler",
+ 4 : "Manning",
+ 5 : "Nikuradse",
+ 6 : "Log law",
+ 7 : "Colebrook-white"
+ },
+
+
+'TREATMENT OF FLUXES AT THE BOUNDARIES': {
+ 1 : "Priority to prescribed values",
+ 2 : "Priority to fluxes",
+ },
+
+'OPTION FOR TIDAL BOUNDARY CONDITIONS': {
+ 0 : "No tide",
+ 1 : "Real tide (recommended methodology)",
+ 2 : "Astronomical tide",
+ 3 : "Mean spring tide",
+ 4 : "Mean tide",
+ 5 : "Mean neap tide",
+ 6 : "Astronomical neap tide",
+ 7 : "Real tide (methodology before 2010)"
+ },
+
+'OPTION FOR TSUNAMI GENERATION': {
+ 0 : "No Tsunami",
+ 1 : "Tsunami generated on the basis of the Okada model 1992"
+ },
+
+#'PHYSICAL CHARACTERISTICS OF THE TSUNAMI': {
+#AIDE1 : '
+# Physical characteristics of the chosen Tsunami model:
+# - the focal depth (HH),
+# - the fault length (L),
+# - the fault width (W)
+# - the dislocation (D),
+# - the strike direction (TH),
+# - the dip angle (DL),
+# - the slip (RD),
+# - the epicentre latitude (Y0) and
+# - the epicentre longitude (X0)
+# - the ellipse ( WxL ) area of influence
+# },
+
+'TIDAL DATA BASE': {
+ 1 : "JMJ",
+ 2 : "TPXO",
+ 3 : "Miscellaneous (LEGOS-NEA, FES20XX, PREVIMER...)"
+ },
+
+'GEOGRAPHIC SYSTEM': {
+ 0 : "Defined by user",
+ 1 : "WGS84 longitude/latitude in real degrees",
+ 2 : "WGS84 northern UTM",
+ 3 : "WGS84 southern UTM",
+ 4 : "Lambert",
+ 5 : "Mercator"
+ },
+
+
+'ZONE NUMBER IN GEOGRAPHIC SYSTEM': {
+ 1 : "Lambert 1 north",
+ 2 : "Lambert 2 center",
+ 3 : "Lambert 3 south",
+ 4 : "Lambert 4 corsica",
+ 22 : "Lambert 2 extended",
+ 30 : "UTM zone, E.G."
+ },
+
+
+'LAW OF TRACERS DEGRADATION': {
+ 0 : "No degradation",
+ 1 : "F(T90) law"
+ },
+
+'SPATIAL PROJECTION TYPE': {
+ 1 : "Cartesian, not georeferenced",
+ 2 : "Mercator",
+ 3 : "Latitude longitude"
+ },
+
+'ALGAE TYPE': {
+ 1 : "Sphere",
+ 2 : "Iridaea flaccida (close to ulva)",
+ 3 : "Pelvetiopsis limitata",
+ 4 : "Gigartina leptorhynchos"
+ },
+
+'OPTION FOR CHARACTERISTICS': {
+ 1 : "Strong",
+ 2 : "Weak"
+ },
+
+'STOCHASTIC DIFFUSION MODEL' : {
+ 0 : "No model",
+ 2 : "??"
+ },
+
+'NUMBER OF GAUSS POINTS FOR WEAK CHARACTERISTICS' : {
+ 1 : "1 point",
+ 3 : "3 points",
+ 6 : "6 points"
+ },
+
+'TYPE OF WEIRS': {
+ 1 : "Horizontal with same number of nodes upstream/downstream (Historical solution with bord)",
+ 2 : "General (New solution with sources points)"
+ },
+
+'SCHEME FOR ADVECTION OF VELOCITIES': {
+ 1 : "Characteristics",
+ 2 : "Explicit + SUPG",
+ 3 : "Explicit leo postma",
+ 4 : "Explicit + murd scheme N",
+ 5 : "Explicit + murd scheme PSI",
+ 13 : "N-scheme for tidal flats",
+ 14 : "N-scheme for tidal flats"
+ },
+
+'SCHEME FOR ADVECTION OF TRACERS': {
+ 0 : "No advection",
+ 1 : "Characteristics",
+ 2 : "Explicit + SUPG",
+ 3 : "Explicit leo postma",
+ 4 : "Explicit + murd scheme N",
+ 5 : "Explicit + murd scheme PSI",
+ 13 : "Leo postma for tidal flats",
+ 14 : "N-scheme for tidal flats"
+ },
+
+
+'SCHEME FOR ADVECTION OF K-EPSILON': {
+ 0 : "No advection",
+ 1 : "Characteristics",
+ 2 : "Explicit + SUPG",
+ 3 : "Explicit leo postma",
+ 4 : "Explicit + murd scheme N",
+ 5 : "Explicit + murd scheme PSI",
+ 13 : "Leo postma for tidal flats",
+ 14 : "N-scheme for tidal flats"
+ },
+
+
+'SCHEME OPTION FOR ADVECTION OF TRACERS': {
+ 1 : "explicit",
+ 2 : "predictor-corrector",
+ },
+
+
+'SCHEME OPTION FOR ADVECTION OF VELOCITIES': {
+ 1 : "Explicit",
+ 2 : "Predictor-corrector",
+ },
+
+'SCHEME OPTION FOR ADVECTION OF K-EPSILON': {
+ 1 : "Explicit",
+ 2 : "Predictor-corrector",
+ },
+
+'OPTION FOR WIND': {
+ 0 : "No wind",
+ 1 : "Constant in time and space",
+ 2 : "Variable in time and (constant in space)",
+ 3 : "Variable in time and space"
+ },
+
+'NEWMARK TIME INTEGRATION COEFFICIENT' :{
+ 1. : "Euler explicit",
+ 0.5 : "order 2 in time",
+ },
+}
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
- <property name="leftMargin">
- <number>0</number>
- </property>
- <property name="topMargin">
- <number>0</number>
- </property>
- <property name="rightMargin">
- <number>0</number>
- </property>
- <property name="bottomMargin">
- <number>0</number>
- </property>
<item>
<layout class="QVBoxLayout" name="commandesLayout">
<property name="spacing">
</property>
</layout>
</item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>5</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
</widget>
</item>
</layout>
- <zorder>scrollAreaCommandes</zorder>
- <zorder>frameAffichage</zorder>
</widget>
<layoutdefault spacing="6" margin="11"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
</customwidget>
</customwidgets>
<tabstops>
- <tabstop>scrollAreaCommandes</tabstop>
<tabstop>LENom</tabstop>
</tabstops>
<resources/>
<x>0</x>
<y>0</y>
<width>300</width>
- <height>99</height>
+ <height>122</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
- <widget class="QPushButton" name="pushButton_5">
+ <widget class="QPushButton" name="PBCata">
<property name="text">
<string>Catalogue</string>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="pushButton_6">
+ <widget class="QPushButton" name="PBAlpha">
<property name="text">
<string>Alpha</string>
</property>
</property>
<property name="icon">
<iconset>
- <normaloff>../Editeur/icons/minusnode.png</normaloff>../Editeur/icons/minusnode.png</iconset>
+ <normaloff>../../../.designer/Editeur/icons/minusnode.png</normaloff>../../../.designer/Editeur/icons/minusnode.png</iconset>
</property>
<property name="iconSize">
<size>
</property>
<property name="icon">
<iconset>
- <normaloff>../Editeur/icons/ast-green-ball.png</normaloff>../Editeur/icons/ast-green-ball.png</iconset>
+ <normaloff>../../../.designer/Editeur/icons/ast-green-ball.png</normaloff>../../../.designer/Editeur/icons/ast-green-ball.png</iconset>
</property>
<property name="iconSize">
<size>
</property>
<property name="icon">
<iconset theme="find">
- <normaloff>.</normaloff>.</iconset>
+ <normaloff>../../../.designer/backup</normaloff>../../../.designer/backup</iconset>
</property>
<property name="iconSize">
<size>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
- <widget class="QPushButton" name="pushButton_5">
+ <widget class="QPushButton" name="PBCata">
<property name="text">
<string>Catalogue</string>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="pushButton_6">
+ <widget class="QPushButton" name="PBAlpha">
<property name="text">
<string>Alpha</string>
</property>
</property>
<property name="icon">
<iconset theme="go-up">
- <normaloff>.</normaloff>.</iconset>
+ <normaloff>../../../.designer/backup</normaloff>../../../.designer/backup</iconset>
</property>
<property name="iconSize">
<size>
</property>
<property name="icon">
<iconset theme="go-down">
- <normaloff>.</normaloff>.</iconset>
+ <normaloff>../../../.designer/backup</normaloff>../../../.designer/backup</iconset>
</property>
<property name="iconSize">
<size>
</property>
<property name="icon">
<iconset>
- <normaloff>../Editeur/icons/MoinsBleu.png</normaloff>../Editeur/icons/MoinsBleu.png</iconset>
+ <normaloff>../../../.designer/Editeur/icons/MoinsBleu.png</normaloff>../../../.designer/Editeur/icons/MoinsBleu.png</iconset>
</property>
<property name="iconSize">
<size>
</property>
<property name="icon">
<iconset>
- <normaloff>../Editeur/icons/PlusBleu.png</normaloff>../Editeur/icons/PlusBleu.png</iconset>
+ <normaloff>../../../.designer/Editeur/icons/PlusBleu.png</normaloff>../../../.designer/Editeur/icons/PlusBleu.png</iconset>
</property>
<property name="iconSize">
<size>
</property>
<property name="icon">
<iconset>
- <normaloff>../Editeur/icons/verre-loupe-icone-6087-64.png</normaloff>../Editeur/icons/verre-loupe-icone-6087-64.png</iconset>
+ <normaloff>../../../.designer/Editeur/icons/verre-loupe-icone-6087-64.png</normaloff>../../../.designer/Editeur/icons/verre-loupe-icone-6087-64.png</iconset>
</property>
<property name="iconSize">
<size>
</property>
<property name="icon">
<iconset>
- <normaloff>../Editeur/icons/deleteRond.png</normaloff>../Editeur/icons/deleteRond.png</iconset>
+ <normaloff>../../../.designer/Editeur/icons/deleteRond.png</normaloff>../../../.designer/Editeur/icons/deleteRond.png</iconset>
</property>
<property name="iconSize">
<size>
<property name="maximumSize">
<size>
<width>16777215</width>
- <height>16777215</height>
+ <height>90</height>
</size>
</property>
<property name="windowTitle">
<x>0</x>
<y>0</y>
<width>1065</width>
- <height>62</height>
+ <height>56</height>
</rect>
</property>
<property name="sizePolicy">
<property name="maximumSize">
<size>
<width>1493</width>
- <height>85</height>
+ <height>56</height>
</size>
</property>
<property name="windowTitle">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Minimum</enum>
+ </property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<!DOCTYPE TS><TS version="1.1" language="en">
<context>
<name>@default</name>
+ <message>
+ <source>Hauteur constante</source>
+ <translation>Constant depth</translation>
+ </message>
<message>
<location filename="../../convert/convert_ini.py" line="81"/>
<source>lecture du fichier impossible :</source>
<!DOCTYPE TS><TS version="1.1">
<context>
<name>@default</name>
+ <message>
+ <source>Hauteur constante</source>
+ <translation>Constant depth</translation>
+ </message>
+ <message>
+ <source>Mass_Lumping_On_H</source>
+ <translation>Mass_Lumping_Sur_H</translation>
+ </message>
+ <message>
+ <source>Mass_Lumping_On_Velocity</source>
+ <translation>Mass_Lumping_Sur_La_Vitesse</translation>
+ </message>
+ <message>
+ <source>Mass_Lumping_On_Tracers</source>
+ <translation>Mass_Lumping_Sur_Les_Traceurs</translation>
+ </message>
+ <message>
+ <source>Mass_Lumping_For_Weak_Characteristics</source>
+ <translation>Mass_Lumping_Pour_Les_Caracteristiques_Faibles</translation>
+ </message>
+ <message>
+ <source>INITIALIZATION</source>
+ <translation>INITIALISATION</translation>
+ </message>
+ <message>
+ <source>Input_Files</source>
+ <translation>Fichiers_D_Entree</translation>
+ </message>
+ <message>
+ <source>Formatted_And_Binary_Files</source>
+ <translation>Fichiers_Formates_Et_Binaires</translation>
+ </message>
+ <message>
+ <source>Initial_State</source>
+ <translation>Etat_Initial</translation>
+ </message>
+ <message>
+ <source>Coupling</source>
+ <translation>Couplage</translation>
+ </message>
+ <message>
+ <source>Mass_Balance</source>
+ <translation>Bilan_De_Masse</translation>
+ </message>
+ <message>
+ <source>BOUNDARY_CONDITIONS</source>
+ <translation>CONDITIONS_AUX_LIMITES</translation>
+ </message>
+ <message>
+ <source>NUMERICAL_PARAMETERS</source>
+ <translation>PARAMETRES_NUMERIQUES</translation>
+ </message>
+ <message>
+ <source>PHYSICAL_PARAMETERS</source>
+ <translation>PARAMETRES_PHYSIQUES</translation>
+ </message>
+ <message>
+ <source>OUTPUT_FILES</source>
+ <translation>FICHIERS_DE_SORTIE</translation>
+ </message>
+ <message>
+ <source>CONSTRUCTION_WORKS_MODELLING</source>
+ <translation>MODELISATION_DES_OUVRAGES</translation>
+ </message>
+ <message>
+ <source>GENERAL_PARAMETERS</source>
+ <translation>PARAMETRES_GENERAUX</translation>
+ </message>
+ <message>
+ <source>PARTICLE_TRANSPORT</source>
+ <translation>TRANSPORT_DE_PARTICULE</translation>
+ </message>
+ <message>
+ <source>Computation_Continued_Settings </source>
+ <translation>Parametres_De_Continuation_Du_Calcul</translation>
+ </message>
+ <message>
+ <source>Inputs_Outputs_For_Tide </source>
+ <translation>Entrees_Sorties_Pour_La_Maree</translation>
+ </message>
+ <message>
+ <source>Location</source>
+ <translation>Localisation</translation>
+ </message>
+ <message>
+ <source>Physical_Parameters </source>
+ <translation>Parametres_Physiques</translation>
+ </message>
+ <message>
+ <source>Liquid_Boundaries </source>
+ <translation>Frontieres_Liquide</translation>
+ </message>
+ <message>
+ <source>Solver_Definition </source>
+ <translation>Definition_Du_Solver</translation>
+ </message>
+ <message>
+ <source>Linearity </source>
+ <translation>Linearite</translation>
+ </message>
+ <message>
+ <source>Precondionning_Setting </source>
+ <translation>Parametres_Preconditionnement</translation>
+ </message>
+ <message>
+ <source>Matrix_Informations </source>
+ <translation>Stockage_Des_Matrices</translation>
+ </message>
+ <message>
+ <source>Advection </source>
+ <translation>Advection</translation>
+ </message>
+ <message>
+ <source>Propagation </source>
+ <translation>Propagation</translation>
+ </message>
+ <message>
+ <source>Diffusion </source>
+ <translation>Diffusion</translation>
+ </message>
+ <message>
+ <source>Discretization_Implicitation </source>
+ <translation>Discretisation</translation>
+ </message>
+ <message>
+ <source>Tidal</source>
+ <translation>Maree</translation>
+ </message>
+ <message>
+ <source>Various </source>
+ <translation>Divers</translation>
+ </message>
+ <message>
+ <source>Friction_Setting </source>
+ <translation>Parametres_De_Friction</translation>
+ </message>
+ <message>
+ <source>Meteorology </source>
+ <translation>Meteorologie</translation>
+ </message>
+ <message>
+ <source>Wave</source>
+ <translation>Houle</translation>
+ </message>
+ <message>
+ <source>Parameters_Estimation</source>
+ <translation>Parametres_A_Estimer</translation>
+ </message>
+ <message>
+ <source>Tolerances_For_Identification </source>
+ <translation>Tolerances_Pour_L_Identification</translation>
+ </message>
+ <message>
+ <source>Sources</source>
+ <translation>Sources</translation>
+ </message>
+ <message>
+ <source>Coriolis_Settings </source>
+ <translation>Parametres_Pour_Coriolis</translation>
+ </message>
+ <message>
+ <source>Various_For_Numerical </source>
+ <translation>Divers_Parametres_Numeriques</translation>
+ </message>
+ <message>
+ <source>Secondary_Currents_Settings </source>
+ <translation>Parametres_Pour_Les_Courants_Secondaires</translation>
+ </message>
+ <message>
+ <source>Tsunami </source>
+ <translation>Tsunami</translation>
+ </message>
+ <message>
+ <source>Graphic_And_Listing_Printouts </source>
+ <translation>Sorties_Listing_Et_Graphiques</translation>
+ </message>
+ <message>
+ <source>Controls</source>
+ <translation>Controles</translation>
+ </message>
+ <message>
+ <source>Fourier </source>
+ <translation>Fourier</translation>
+ </message>
+ <message>
+ <source>General_Location </source>
+ <translation>Localisation_Generale</translation>
+ </message>
+ <message>
+ <source>Time</source>
+ <translation>Temps</translation>
+ </message>
+ <message>
+ <source>Original_Date_Of_Time </source>
+ <translation>Date_A_L_Origine</translation>
+ </message>
+ <message>
+ <source>Original_Hour_Of_Time </source>
+ <translation>Temps_A_L_Origine</translation>
+ </message>
+ <message>
+ <source>Limit_Values</source>
+ <translation>Valeurs_Limites</translation>
+ </message>
+ <message>
+ <source>Tracers_Setting </source>
+ <translation>Parametres_Des_Traceurs</translation>
+ </message>
+ <message>
+ <source>Tracer</source>
+ <translation>Traceur</translation>
+ </message>
+ <message>
+ <source>Boundary_Conditions_For_Tracers</source>
+ <translation>Conditions_Aux_Limites_Pour_Les_Traceurs</translation>
+ </message>
+ <message>
+ <source>Solving</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>Accuracy </source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>Source</source>
+ <translation>Source</translation>
+ </message>
+ <message>
+ <source>Metereology </source>
+ <translation>Metereologie</translation>
+ </message>
+ <message>
+ <source>Numerical</source>
+ <translation>Numerique</translation>
+ </message>
+ <message>
+ <source>Degradation</source>
+ <translation>Degradation</translation>
+ </message>
+
+
<message>
<source>Values_Of_Tracers_In_The_Rain</source>
<translation>Valeurs_Des_Traceurs_Dans_La_Pluie</translation>
</message>
<message>
<source>Origin_Coordinates</source>
- <translation>Coordonnees_De_L'origine</translation>
+ <translation>Coordonnees_De_L_Origine</translation>
</message>
<message>
<source>Thickness_Of_Algae</source>
</message>
<message>
<source>Oil_Spill_Model</source>
- <translation>Modele_De_Nappes_D'hydrocarbures</translation>
+ <translation>Modele_De_Nappes_D_Hydrocarbures</translation>
</message>
<message>
<source>Definition_Of_Zones</source>
</message>
<message>
<source>Maximum_Number_Of_Iterations_For_Diffusion_Of_Tracers</source>
- <translation>Maximum_D'iterations_Pour_La_Diffusion_Des_Traceurs</translation>
+ <translation>Maximum_D_Iterations_Pour_La_Diffusion_Des_Traceurs</translation>
</message>
<message>
<source>Binary_Results_File</source>
</message>
<message>
<source>Implicitation_Coefficient_Of_Tracers</source>
- <translation>Coefficient_D'implicitation_Des_Traceurs</translation>
+ <translation>Coefficient_D_Implicitation_Des_Traceurs</translation>
</message>
<message>
<source>Formatted_Results_File</source>
</message>
<message>
<source>Coefficient_Of_Wind_Influence</source>
- <translation>Coefficient_D'influence_Du_Vent</translation>
+ <translation>Coefficient_D_Influence_Du_Vent</translation>
</message>
<message>
<source>Depth_In_Friction_Terms</source>
</message>
<message>
<source>Original_Date_Of_Time</source>
- <translation>Date_De_L'origine_Des_Temps</translation>
+ <translation>Date_De_L_origine_Des_Temps</translation>
</message>
<message>
<source>Mean_Temperature</source>
</message>
<message>
<source>Listing_Printout_Period</source>
- <translation>Periode_Pour_Les_Sorties_Listing</translation>
+ <translation>Periode_De_Sortie_Listing</translation>
</message>
<message>
<source>Initial_Guess_For_H</source>
</message>
<message>
<source>Elements_Masked_By_User</source>
- <translation>Elements_Masques_Par_L'utilisateur</translation>
+ <translation>Elements_Masques_Par_L_Utilisateur</translation>
</message>
<message>
<source>Control_Sections</source>
</message>
<message>
<source>Maximum_Number_Of_Iterations_For_Identification</source>
- <translation>Maximum_D'iterations_Pour_L'identification</translation>
+ <translation>Maximum_D_Iterations_Pour_L_Identification</translation>
</message>
<message>
<source>Coefficient_For_Diffusion_Of_Tracers</source>
</message>
<message>
<source>Original_Hour_Of_Time</source>
- <translation>Heure_De_L'origine_Des_Temps</translation>
+ <translation>Heure_De_L_origine_Des_Temps</translation>
</message>
<message>
<source>Law_Of_Friction_On_Lateral_Boundaries</source>
</message>
<message>
<source>Identification_Method</source>
- <translation>Methode_D'identification</translation>
+ <translation>Methode_D_Identification</translation>
</message>
<message>
<source>Names_Of_Points</source>
</message>
<message>
<source>Water_Density</source>
- <translation>Masse_Volumique_De_L'eau</translation>
+ <translation>Masse_Volumique_De_L_Eau</translation>
</message>
<message>
<source>Newmark_Time_Integration_Coefficient</source>
- <translation>Coefficient_D'integration_En_Temps_De_Newmark</translation>
+ <translation>Coefficient_D_Integration_En_Temps_De_Newmark</translation>
</message>
<message>
<source>Friction_Data_File</source>
<source>Implicitation_For_Diffusion_Of_Velocity</source>
<translation>Implicitation_Pour_La_Diffusion_Des_Vitesses</translation>
</message>
- <message>
- <source>Limit_Values</source>
- <translation>Valeurs_Limites</translation>
- </message>
<message>
<source>Advection</source>
<translation>Convection</translation>
</message>
<message>
<source>Time_Range_For_Fourier_Analysis</source>
- <translation>Bornes_En_Temps_Pour_L'analyse_De_Fourier</translation>
+ <translation>Bornes_En_Temps_Pour_L_Analyse_De_Fourier</translation>
</message>
<message>
<source>Graphic_Printout_Period</source>
</message>
<message>
<source>Fourier_Analysis_Periods</source>
- <translation>Periodes_D'analyse_De_Fourier</translation>
+ <translation>Periodes_D_Analyse_De_Fourier</translation>
</message>
<message>
<source>H_Clipping</source>
</message>
<message>
<source>Tolerances_For_Identification</source>
- <translation>Precisions_Pour_L'identification</translation>
+ <translation>Precisions_Pour_L_Identification</translation>
</message>
<message>
<source>Previous_Computation_File_Format</source>
</message>
<message>
<source>Maximum_Number_Of_Iterations_For_K_And_Epsilon</source>
- <translation>Maximum_D'iterations_Pour_K_Et_Epsilon</translation>
+ <translation>Maximum_D_Iterations_Pour_K_Et_Epsilon</translation>
</message>
<message>
<source>Tidal_Data_Base</source>
</message>
<message>
<source>Maximum_Number_Of_Iterations_For_Solver</source>
- <translation>Maximum_D'iterations_Pour_Le_Solveur</translation>
+ <translation>Maximum_D_Iterations_Pour_Le_Solveur</translation>
</message>
<message>
<source>Number_Of_Tracers</source>
</message>
<message>
<source>Maximum_Number_Of_Iterations_For_Advection_Schemes</source>
- <translation>Maximum_D'iterations_Pour_Les_Schemas_De_Convection</translation>
+ <translation>Maximum_D_Iterations_Pour_Les_Schemas_De_Convection</translation>
</message>
<message>
<source>Turbulence_Model_For_Solid_Boundaries</source>
</message>
<message>
<source>Record_Number_In_Wave_File</source>
- <translation>Numero_De_L'enregistrement_Dans_Le_Fichier_De_Houle</translation>
+ <translation>Numero_De_L_Enregistrement_Dans_Le_Fichier_De_Houle</translation>
</message>
<message>
<source>Abscissae_Of_Sources</source>
</message>
<message>
<source>Stop_Criteria</source>
- <translation>Criteres_D'arret</translation>
+ <translation>Criteres_D_Arret</translation>
</message>
<message>
<source>Prescribed_Velocities</source>
<message>
<location filename="../../UiQT4/myMain.ui" line="219"/>
<source>&Nouveau</source>
- <translation>ME VOILA</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location filename="../../UiQT4/myMain.ui" line="222"/>
-QM_FILES=eficas_en.qm
+QM_FILES=eficas_en.qm eficas_fr.qm
%.py:%.ui
${PYUIC} -x -o $@ $<
-# -*- coding: utf-8 -*-
# Copyright (C) 2007-2013 EDF R&D
#
# This library is free software; you can redistribute it and/or
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-"""
- Ce module contient le plugin convertisseur de fichier
- au format python pour EFICAS.
-
- Un plugin convertisseur doit fournir deux attributs de classe :
- extensions et formats et deux methodes : readfile,convert.
+import re, string
+from Extensions.i18n import tr
+from Accas.A_BLOC import BLOC
+from Accas import *
- L'attribut de classe extensions est une liste d'extensions
- de fichiers preconisees pour ce type de format. Cette information
- est seulement indicative.
+
+from convert_python import PythonParser
- L'attribut de classe formats est une liste de formats de sortie
- supportes par le convertisseur. Les formats possibles sont :
- eval, dict ou exec.
- Le format eval est un texte source Python qui peut etre evalue. Le
- resultat de l'evaluation est un objet Python quelconque.
- Le format dict est un dictionnaire Python.
- Le format exec est un texte source Python qui peut etre execute.
+pattern_comment_slash = re.compile(r"^\s*/")
+pattern_eta = re.compile(r".*&ETA.*")
+pattern_fin = re.compile(r".*&FIN.*")
+pattern_blanc = re.compile(r"^ *$")
+pattern_OUI = re.compile(r"^ *OUI *")
+pattern_oui = re.compile(r"^ *oui *")
+pattern_NON = re.compile(r"^ *NON *")
+pattern_non = re.compile(r"^ *non *")
- La methode readfile a pour fonction de lire un fichier dont le
- nom est passe en argument de la fonction.
- - convertisseur.readfile(nom_fichier)
+from aideAuxConvertisseurs import DicoEficasToCas, ListeSupprimeCasToEficas
+from aideAuxConvertisseurs import ListeCalculCasToEficas, DicoAvecMajuscules
+from enumDicoTelemac import DicoEnumCasEn
- La methode convert a pour fonction de convertir le fichier
- prealablement lu dans un objet du format passe en argument.
- - objet=convertisseur.convert(outformat)
+from Extensions import localisation
- Ce convertisseur supporte le format de sortie exec
+from determine import monEnvQT5
-"""
-import sys,string,traceback
-import parseur_cas
-from Noyau import N_CR
-from Extensions.i18n import tr
-from Extensions.eficas_exception import EficasException
def entryPoint():
"""
- Retourne les informations necessaires pour le chargeur de plugins
- Ces informations sont retournees dans un dictionnaire
+ Return a dictionary containing the description needed to load the plugin
"""
return {
- # Le nom du plugin
'name' : 'TELEMAC',
- # La factory pour creer une instance du plugin
- 'factory' : PythonParser,
+ 'factory' : TELEMACParser
}
-
-class PythonParser:
+class TELEMACParser(PythonParser):
"""
- Ce convertisseur lit un fichier au format python avec la
- methode readfile : convertisseur.readfile(nom_fichier)
- et retourne le texte au format outformat avec la
- methode convertisseur.convert(outformat)
-
- Ses caracteristiques principales sont exposees dans 2 attributs
- de classe :
- - extensions : qui donne une liste d'extensions de fichier preconisees
- - formats : qui donne une liste de formats de sortie supportes
+ This converter works like PythonParser, except that it also initializes all
+ model variables to None in order to avoid Python syntax errors when loading
+ a file with a different or inexistent definition of variables.
"""
- # Les extensions de fichier preconisees
- extensions=('.py',)
- # Les formats de sortie supportes (eval dict ou exec)
- # Le format exec est du python executable (commande exec) converti avec PARSEUR_PYTHON
- # Le format execnoparseur est du python executable (commande exec) non converti
- formats=('exec','execnoparseur')
-
- def __init__(self,cr=None):
- # Si l'objet compte-rendu n'est pas fourni, on utilise le
- # compte-rendu standard
- self.text=''
- if cr :
- self.cr=cr
- else:
- self.cr=N_CR.CR(debut='CR convertisseur format python',
- fin='fin CR format python')
-
- def readfile(self,filename):
- self.filename=filename
- try:
- self.text=open(filename).read()
- except:
- self.cr.exception(tr("Impossible d'ouvrir le fichier %s" ,str(filename)))
- self.cr.fatal(tr("Impossible d'ouvrir le fichier %s" ,str(filename)))
- return
+
+ def convert(self, outformat, appli=None):
+ self.dicoInverseFrancais=appli.readercata.dicoInverseFrancais
+ self.dicoAnglaisFrancais=appli.readercata.dicoAnglaisFrancais
+ self.dicoFrancaisAnglais=appli.readercata.dicoFrancaisAnglais
+ self.dicoMC=appli.readercata.dicoMC
+ self.Ordre_Des_Commandes=appli.readercata.Ordre_Des_Commandes
- def convert(self,outformat,appli=None):
- print "je passe la"
- if outformat == 'exec':
- #try:
- if 1:
- print parseur_cas.PARSEUR_CAS
- return parseur_cas.PARSEUR_CAS(self.text).get_texte(appli)
- else :
- #except EficasException:
- # Erreur lors de la conversion
- l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],
- sys.exc_info()[2])
- self.cr.exception(tr("Impossible de convertir le fichier Python qui doit contenir des erreurs.\n\
- On retourne le fichier non converti. Prevenir la maintenance.\n\n %s", string.join(l)))
- # On retourne neanmoins le source initial non converti (au cas ou)
- return self.text
- elif outformat == 'execnoparseur':
- return self.text
- else:
- raise EficasException(tr("Format de sortie : %s, non supporte", outformat))
- return None
+
+ #print self.dicoInverseFrancais
+ #text = PythonParser.convert(self, outformat, appli)
+
+ text=""
+ l_lignes = string.split(self.text,'\n')
+ self.dictSimp={}
+ for ligne in l_lignes :
+ if pattern_comment_slash.match(ligne) : continue
+ if pattern_eta.match(ligne) : continue
+ if pattern_fin.match(ligne) : continue
+ if pattern_blanc.match(ligne) : continue
+ ligne=re.sub('\t',' ',ligne)
+ ligne=re.sub("'",' ',ligne)
+ ligne=re.sub(":",'=',ligne)
+ if ligne.count('=') != 1 :
+ print "pb avec la ligne " , ligne
+ continue
+
+ motsInLigne=string.split(ligne,' ')
+ listeMotsSimp=()
+ simp=""
+ for mot in motsInLigne:
+ if mot == "" : continue
+ if mot == "=" :
+ simp=simp[0:-1]
+ while simp[-1] == " " : simp=simp[0:-1]
+ if simp.find('-') > 0 : simp=self.redecoupeSimp(simp)
+ break
+
+ mot=mot.replace('_','__')
+ simp=simp+mot[0].upper() +mot[1:].lower()+'_'
+ valeur=ligne.split('=')[1]
+ self.dictSimp[simp]=valeur
+
+
+
+ #print dictSimp
+ #print self.dicoInverseFrancais
+
+ dicoParMC={}
+ #print ListeCalculCasToEficas
+
+ if 'Titre' not in self.dictSimp.keys():
+ import os
+ self.dictSimp['Titre']=os.path.basename(self.filename)
+
+ for simp in self.dictSimp.keys():
+ if simp in ListeSupprimeCasToEficas: continue
+ if simp in TELEMACParser.__dict__.keys() : apply(TELEMACParser.__dict__[simp],(self,))
+
+ for simp in self.dictSimp.keys():
+ if simp not in self.dicoInverseFrancais.keys() :
+ print "************"
+ print "pb avec ", simp,'------'
+ print "************"
+ continue
+ listeGenea=self.dicoInverseFrancais[simp]
+ listeGeneaReverse=[]
+ for (u,v) in listeGenea :
+ if isinstance(v,BLOC): continue
+ listeGeneaReverse.append(u)
+ listeGeneaReverse.reverse()
+ dicoTravail=dicoParMC
+ i=0
+ #print (listeGeneaReverse[0:-1])
+ while i < len(listeGeneaReverse[0:-1]) :
+ mot=listeGeneaReverse[i]
+ i=i+1
+ if mot not in dicoTravail.keys(): dicoTravail[mot]={}
+ dicoTravail=dicoTravail[mot]
+ dicoTravail[simp]=self.dictSimp[simp]
+
+ self.textePy=""
+ #print "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
+ #print dicoParMC
+ #print "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
+ listeMC=self.tri(dicoParMC.keys())
+ for k in listeMC :
+ print "----------- traitement de " , k
+ self.textePy += self.dicoFrancaisAnglais[k] + "("
+ self.traiteMC(dicoParMC[k])
+ self.textePy += ");\n"
+ print "----------- "
+
+
+ print self.textePy
+ return self.textePy
+
+ def traiteMC(self,dico) :
+ for k in dico.keys() :
+ valeur= dico[k]
+ if k not in self.dicoMC.keys() : kA=self.dicoFrancaisAnglais[k]
+ else : kA=k
+ obj=self.dicoMC[kA]
+ if isinstance(obj,FACT): self.generFACT(obj,kA,valeur)
+ elif isinstance(obj,BLOC): self.generBLOC(obj,kA,valeur)
+ elif isinstance(obj,SIMP): self.generSIMP(obj,kA,valeur)
+ else : print "%%%%%%%%%%%\n", "pb generation pour", k, obj, "\n%%%%%%%%%%%"
+
+ #print "_____________"
+
+ def generFACT(self,obj,nom,valeur):
+ if nom in TELEMACParser.__dict__.keys() :
+ apply(TELEMACParser.__dict__[nom],(self,))
+ return
+ self.textePy += nom + "=_F( "
+ self.traiteMC(valeur)
+ self.textePy += '),\n'
+
+
+ def generBLOC(self,obj,nom,valeur):
+ print "BLOC "
+ print nom
+
+ def generSIMP(self,obj,nom,valeur):
+ if nom in ("Prescribed_Flowrates", "Prescribed_Velocities", "Prescribed_Elevations" ): return
+ if obj.max==1 :
+ if 'TXM' in obj.type :
+ valeur=str(valeur)
+ while valeur[-1] == " " : valeur=valeur[0:-1]
+ while valeur[0] == " " : valeur=valeur[1:]
+ valeur=valeur[0].upper()+valeur[1:].lower()
+ valeur=tr(valeur)
+ if 'Fichier' in obj.type or 'TXM' in obj.type or 'Repertoire' in obj.type :
+ valeur=str(valeur)
+ while valeur[-1] == " " : valeur=valeur[0:-1]
+ while valeur[0] == " " : valeur=valeur[1:]
+ self.textePy += nom + "= '" + str(valeur) +"' ,"
+ return
+ if bool in obj.type :
+ if pattern_OUI.match(valeur) or pattern_oui.match(valeur) : self.textePy += nom + "= True,"
+ if pattern_NON.match(valeur) or pattern_non.match(valeur) : self.textePy += nom + "= False,"
+ return
+ if nom in DicoEnumCasEn.keys():
+ valeur=DicoEnumCasEn[nom][valeur]
+ self.textePy += nom + "=" + str(valeur) +","
+
+
+
+ def tri(self, listeIn):
+ if len(listeIn) == 1 : return listeIn
+ if self.Ordre_Des_Commandes == None : return listeIn
+ #print self.Ordre_Des_Commandes
+ listeOut=[listeIn[0],]
+ for kF in listeIn[1:]:
+ k=str(self.dicoFrancaisAnglais[kF])
+ ordreK=self.Ordre_Des_Commandes.index(k)
+ i=0
+ while i < len(listeOut):
+ ordreI=self.Ordre_Des_Commandes.index(self.dicoFrancaisAnglais[listeOut[i]])
+ if ordreK < ordreI : break
+ i=i+1
+ listeOut.insert(i,kF)
+ return listeOut
+
+ def Processeurs_Paralleles(self):
+ #YOANN
+ if self.dictSimp["Processeurs_Paralleles"] == 0 : del self.dictSimp["Processeurs_Paralleles"]
+ else : self.dictSimp["Parallel_Computation"]="Parallel"
+
+
+ def Option_De_Supg(self):
+ print "ds Option_De_Supg"
+ return
+
+ def Forme_De_La_Convection(self):
+ print "ds Forme_De_La_Convection"
+ return
+
+ def redecoupeSimp(self,simp):
+ # replace('-','_') uniquement dans les identifiants
+ while simp.find('-') > 0 :
+ ind=simp.find('-')
+ if ind==len(simp)-1 : break
+ simp=simp[0:ind]+'_'+simp[ind+1].upper()+simp[ind+2:]
+ return simp
+
+
+
+ def Liquid_Boundaries(self):
+ texte_Boundaries="Liquid_Boundaries=( "
+ premier=0
+ if 'Prescribed_Elevations' in self.dictSimp.keys():
+ valeurs=self.dictSimp["Prescribed_Elevations"].split(";")
+ elif 'Cotes_Imposees' in self.dictSimp.keys():
+ valeurs=self.dictSimp["Cotes_Imposees"].split(";")
+ else : valeurs=()
+ for e in range(len(valeurs)):
+ if valeurs[e] == "" or valeurs[e] == "\n" : continue
+ if eval(valeurs[e],{})==0 : continue
+ if not premier : premier=1
+ texte_Boundaries += "_F(Type_Condition = 'Prescribed Elevations',\n"
+ texte_Boundaries += "Prescribed_Elevations = " + str(valeurs[e]) + "),\n"
+
+ if 'Prescribed_Flowrates' in self.dictSimp.keys():
+ valeurs=self.dictSimp["Prescribed_Flowrates"].split(";")
+ elif 'Debits_Imposes' in self.dictSimp.keys():
+ valeurs=self.dictSimp["Debits_Imposes"].split(";")
+ else : valeurs=()
+ for e in range(len(valeurs)):
+ if valeurs[e] == "" or valeurs[e] == "\n" : continue
+ if eval(valeurs[e],{})==0 : continue
+ if not premier : premier=1
+ texte_Boundaries += "_F(Type_Condition = 'Prescribed Flowrates',\n"
+ texte_Boundaries += "Prescribed_Flowrates = " + str(valeurs[e]) + "),\n"
+
+ if 'Prescribed_Velocity' in self.dictSimp.keys():
+ valeurs=self.dictSimp["Prescribed_Velocity"].split(";")
+ elif 'Vitesses_Imposees' in self.dictSimp.keys():
+ valeurs=self.dictSimp["Vitesses_Imposees"].split(";")
+ else : valeurs=()
+ for e in range(len(valeurs)):
+ if valeurs[e] == "" or valeurs[e] == "\n" : continue
+ if eval(valeurs[e],{})==0 : continue
+ if not premier : premier=1
+ texte_Boundaries += "_F(Type_Condition = 'Prescribed Velocity',\n"
+ texte_Boundaries += "Prescribed_Velocity = " + str(valeurs[e]) + "),\n"
+ if premier : texte_Boundaries +="),\n"
+ else : texte_Boundaries="" ; print "pb texte_Boundaries "
+ self.textePy += texte_Boundaries
+
from generator_python import PythonGenerator
extensions=('.comm',)
-listeSupprime=('Jour','Mois','An','Heure','Minute','Seconde')
-DicoTransforme= {'MASS LUMPING':'MASS-LUMPING','MATRIX VECTOR' : 'MATRIX-VECTOR' ,
- 'C U PRECON':'C-U PRECON','STAGE DISCHARGE' : 'STAGE-DISCHARGE'}
+#listeSupprime=()
+#DicoAglomere=()
+#DicoEficasToCas=()
+from aideAuxConvertisseurs import listeSupprime, DicoAglomere, DicoEficasToCas
+
def entryPoint():
"""
def gener(self,obj,format='brut',config=None):
self.initDico()
+ print self.texteDico
# Cette instruction genere le contenu du fichier de commandes (persistance)
self.text=PythonGenerator.gener(self,obj,format)
self.texteDico = ""
+
#----------------------------------------------------------------------------------------
# ecriture
#----------------------------------------------------------------------------------------
fileDico = fn[:fn.rfind(".")] + '.py'
f = open( str(fileDico), 'wb')
f.write( self.texteDico )
- print self.texteDico
f.close()
#----------------------------------------------------------------------------------------
nomMajuscule=obj.nom.upper()
nom=nomMajuscule.replace('_',' ')
if nom in listeSupprime : return s
- nomNouveau=nom
- for k in DicoTransforme.keys() :
- if k in nom :
- nomNouveau=nom.replace(k,DicoTransforme[k])
- self.texteDico+=nomNouveau+ "=" + s[0:-1]+ "\n"
+ if nom in DicoEficasToCas.keys() : nom=DicoEficasToCas[nom]
+ self.texteDico+=nom+ ":" + s[0:-1]+ "\n"
return s
def generMCFACT(self,obj):