From: Pascale Noyret Date: Fri, 19 Jun 2009 08:40:53 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: V1_0OpenTurns~90 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d41b1c52d0c35b655f6feabfe816a3c541f3a92a;p=modules%2Feficas.git *** empty log message *** --- diff --git a/Aster/Cata/cataSTA8/cata.py b/Aster/Cata/cataSTA8/cata.py index b3e12c0a..c313e98f 100755 --- a/Aster/Cata/cataSTA8/cata.py +++ b/Aster/Cata/cataSTA8/cata.py @@ -35,7 +35,11 @@ except: pass __version__="$Name: $" +<<<<<<< cata.py +__Id__="$Id: cata.py,v 1.7 2009-06-19 08:36:49 pnoyret Exp $" +======= __Id__="$Id: cata.py,v 1.5.4.4 2009-06-02 14:17:48 pnoyret Exp $" +>>>>>>> 1.5.4.4 EnumTypes = (ListType, TupleType) diff --git a/Aster/Cata/cataSTA9/SD/utilsd.py b/Aster/Cata/cataSTA9/SD/utilsd.py index e76c0461..7735bcd5 100644 --- a/Aster/Cata/cataSTA9/SD/utilsd.py +++ b/Aster/Cata/cataSTA9/SD/utilsd.py @@ -23,7 +23,11 @@ Utilitaire sur le catalogue des structures de données. """ +<<<<<<< utilsd.py +__revision__ = "$Id: utilsd.py,v 1.5 2009-06-19 08:36:49 pnoyret Exp $" +======= __revision__ = "$Id: utilsd.py,v 1.3.4.3 2009-04-30 14:38:01 pnoyret Exp $" +>>>>>>> 1.3.4.3 import sys import os diff --git a/Aster/Cata/cataSTA9/cata.py b/Aster/Cata/cataSTA9/cata.py index fb5f176c..4fdc56a7 100644 --- a/Aster/Cata/cataSTA9/cata.py +++ b/Aster/Cata/cataSTA9/cata.py @@ -23,7 +23,11 @@ from __future__ import division __version__ = "$Name: $" +<<<<<<< cata.py +__Id__ = "$Id: cata.py,v 1.5 2009-06-19 08:36:49 pnoyret Exp $" +======= __Id__ = "$Id: cata.py,v 1.3.4.5 2009-06-02 15:18:51 pnoyret Exp $" +>>>>>>> 1.3.4.5 import Accas from Accas import * diff --git a/Aster/configuration.py b/Aster/configuration.py index d357d232..39390d37 100644 --- a/Aster/configuration.py +++ b/Aster/configuration.py @@ -181,7 +181,7 @@ class CONFIGbase: items = self.l_param result = widgets.Formulaire(self.parent, obj_pere = self, - titre = "Saisie des données indispensables à la configuration d'EFICAS", + titre = "Saisie des donnees indispensables a la configuration d'EFICAS", texte = self.texte, items = items, mode='query') @@ -240,7 +240,7 @@ class CONFIG(CONFIGbase): self.repIni = repIni self.rep_ini = repIni self.fic_ini = os.path.join(self.repIni,self.fichier) - self.titre = "Paramètres nécessaires à la configuration d'EFICAS" + self.titre = 'Parametres necessaires a la configuration d\'EFICAS' self.texte_ini = "Voici les paramètres que requiert Eficas" self.commande = self.creation_fichier_ini_si_possible self.labels={"savedir" : "Répertoire initial pour Open/Save des fichiers", @@ -318,7 +318,7 @@ class CONFIGStyle(CONFIGbase): self.repIni = repIni self.rep_ini = repIni self.fic_ini = os.path.join(self.repIni,self.fichier) - self.titre = "Paramètres d affichage" + self.titre = "Parametres d affichage" self.texte_ini = "Voici les paramètres configurables : " self.commande = self.creation_fichier_ini_si_possible self.labels={"background":"couleur du fonds", @@ -328,14 +328,6 @@ class CONFIGStyle(CONFIGbase): "standard_gras_souligne":"police utilisée pour le gras souligné", "canvas_italique":"police italique", "standard_gras":"gras", - #"canvas":"police", - #"canvas_gras":"police gras", - #"canvas_gras_italique":"police gras italique", - #"standard12":"police 12", - #"standard12_gras":"police 12 gras", - #"standard12_gras_italique":"police 12 gras italique", - #"standardcourier10":"courrier " - "statusfont":"police utilisée dans la status Bar", } self.types ={"background":"mot", "foreground":"mot" , diff --git a/Aster/editeur.ini b/Aster/editeur.ini index 418bd663..bc1df286 100644 --- a/Aster/editeur.ini +++ b/Aster/editeur.ini @@ -27,7 +27,7 @@ rep_Pmw = os.path.join(prefs.REPINI,'../Pmw') # Accès à la documentation Aster path_doc = os.path.join(rep_cata,'..','Doc') -exec_acrobat = "acroread" +exec_acrobat = "/usr/bin/xpdf" # Utilisateur/Développeur isdeveloppeur = "NON" path_cata_dev = "/tmp/cata" @@ -38,11 +38,10 @@ initialdir=os.curdir # Choix des catalogues rep_mat_v88=os.path.join(rep_cata,'cataSTA8','materiau') -rep_mat_v94=os.path.join(rep_cata,'cataSTA9','materiau') +rep_mat_v95=os.path.join(rep_cata,'cataSTA9','materiau') catalogues = ( - ('ASTER','v7.8',os.path.join(rep_cata,'cataSTA7'),'python'), ('ASTER','v8.8',os.path.join(rep_cata,'cataSTA8'),'python'), - ('ASTER','v9.4',os.path.join(rep_cata,'cataSTA9'),'python','defaut'), + ('ASTER','v9.5',os.path.join(rep_cata,'cataSTA9'),'python','defaut'), ) diff --git a/Aster/editeur_salome.ini b/Aster/editeur_salome.ini index 9805411b..bc1df286 100644 --- a/Aster/editeur_salome.ini +++ b/Aster/editeur_salome.ini @@ -27,8 +27,7 @@ rep_Pmw = os.path.join(prefs.REPINI,'../Pmw') # Accès à la documentation Aster path_doc = os.path.join(rep_cata,'..','Doc') -#exec_acrobat = "acroread" -exec_acrobat = "/local01/assire/v0.5/SALOME-MECA-2008.2/SALOME-MECA/prerequis/xpdf-3.02-linux/xpdf" +exec_acrobat = "/usr/bin/xpdf" # Utilisateur/Développeur isdeveloppeur = "NON" path_cata_dev = "/tmp/cata" @@ -38,12 +37,11 @@ rep_travail = "/tmp" initialdir=os.curdir # Choix des catalogues -rep_mat_v85=os.path.join(rep_cata,'cataSTA8','materiau') -rep_mat_v91=os.path.join(rep_cata,'cataSTA9','materiau') +rep_mat_v88=os.path.join(rep_cata,'cataSTA8','materiau') +rep_mat_v95=os.path.join(rep_cata,'cataSTA9','materiau') catalogues = ( - ('ASTER','v7.8',os.path.join(rep_cata,'cataSTA7'),'python'), - ('ASTER','v8.7',os.path.join(rep_cata,'cataSTA8'),'python'), - ('ASTER','v9.3',os.path.join(rep_cata,'cataSTA9'),'python','defaut'), + ('ASTER','v8.8',os.path.join(rep_cata,'cataSTA8'),'python'), + ('ASTER','v9.5',os.path.join(rep_cata,'cataSTA9'),'python','defaut'), ) diff --git a/Aster/qtEficas_aster.py b/Aster/qtEficas_aster.py index e3736bd6..cf2dbf0e 100755 --- a/Aster/qtEficas_aster.py +++ b/Aster/qtEficas_aster.py @@ -27,6 +27,7 @@ # Modules Eficas import prefs +#from InterfaceQT4 import eficas_go from InterfaceQT import eficas_go eficas_go.lance_eficas(code=prefs.code) diff --git a/Aster/sdist.py b/Aster/sdist.py index ba37e082..04bd4347 100644 --- a/Aster/sdist.py +++ b/Aster/sdist.py @@ -66,8 +66,8 @@ def main(): # copyfiles('Cata/Utilitai',os.path.join(path_distrib,'Aster','Cata','Utilitai'),['*.py']) # copyfiles('Cata/pre74',os.path.join(path_distrib,'Aster','Cata','pre74'),['*.py']) - copyfiles('Cata/cataSTA6',os.path.join(path_distrib,'Aster','Cata','cataSTA6'),['*.py']) - copyfiles('Cata/cataSTA6/Macro',os.path.join(path_distrib,'Aster','Cata','cataSTA6','Macro'),['*.py']) + #copyfiles('Cata/cataSTA6',os.path.join(path_distrib,'Aster','Cata','cataSTA6'),['*.py']) + #copyfiles('Cata/cataSTA6/Macro',os.path.join(path_distrib,'Aster','Cata','cataSTA6','Macro'),['*.py']) copyfiles('Cata/cataSTA7',os.path.join(path_distrib,'Aster','Cata','cataSTA7'),['*.py']) copyfiles('Cata/cataSTA7/Macro',os.path.join(path_distrib,'Aster','Cata','cataSTA7','Macro'),['*.py']) @@ -83,7 +83,7 @@ def main(): copyfiles('Cata/cataSTA9/materiau',os.path.join(path_distrib,'Aster','Cata','cataSTA9/materiau'),['README.py']) copyfiles('Cata/cataSTA9/SD',os.path.join(path_distrib,'Aster','Cata','cataSTA9/SD'),['*.py']) - copyfiles('Cata',os.path.join(path_distrib,'Aster','Cata'),['*c_clefs_docu']) + copyfiles('Cata',os.path.join(path_distrib,'Aster','Cata'),['*9c_clefs_docu']) copyfiles('../Aster/Cata',os.path.join(path_distrib,'Aster'),['aster.py',]) # ______________________ diff --git a/Editeur/icons/About24.png b/Editeur/icons/About24.png new file mode 100644 index 00000000..b96d0726 Binary files /dev/null and b/Editeur/icons/About24.png differ diff --git a/Editeur/icons/Copy24.png b/Editeur/icons/Copy24.png new file mode 100644 index 00000000..45d31498 Binary files /dev/null and b/Editeur/icons/Copy24.png differ diff --git a/Editeur/icons/Cut24.png b/Editeur/icons/Cut24.png new file mode 100644 index 00000000..bf358b08 Binary files /dev/null and b/Editeur/icons/Cut24.png differ diff --git a/Editeur/icons/Delete24.png b/Editeur/icons/Delete24.png new file mode 100644 index 00000000..a8fc03a0 Binary files /dev/null and b/Editeur/icons/Delete24.png differ diff --git a/Editeur/icons/Fermer24.png b/Editeur/icons/Fermer24.png new file mode 100644 index 00000000..1a50a005 Binary files /dev/null and b/Editeur/icons/Fermer24.png differ diff --git a/Editeur/icons/Help24.png b/Editeur/icons/Help24.png new file mode 100644 index 00000000..3c5921b2 Binary files /dev/null and b/Editeur/icons/Help24.png differ diff --git a/Editeur/icons/New24.png b/Editeur/icons/New24.png new file mode 100644 index 00000000..96bc226e Binary files /dev/null and b/Editeur/icons/New24.png differ diff --git a/Editeur/icons/Open24.png b/Editeur/icons/Open24.png new file mode 100644 index 00000000..2693469b Binary files /dev/null and b/Editeur/icons/Open24.png differ diff --git a/Editeur/icons/Paste24.png b/Editeur/icons/Paste24.png new file mode 100644 index 00000000..6b1630bc Binary files /dev/null and b/Editeur/icons/Paste24.png differ diff --git a/Editeur/icons/Save24.png b/Editeur/icons/Save24.png new file mode 100644 index 00000000..8324c9fc Binary files /dev/null and b/Editeur/icons/Save24.png differ diff --git a/Editeur/icons/Zoom24.png b/Editeur/icons/Zoom24.png new file mode 100644 index 00000000..1cfb7af4 Binary files /dev/null and b/Editeur/icons/Zoom24.png differ diff --git a/Editeur/icons/arrow_left.png b/Editeur/icons/arrow_left.png new file mode 100644 index 00000000..07cb0d3c Binary files /dev/null and b/Editeur/icons/arrow_left.png differ diff --git a/Editeur/icons/arrow_right.png b/Editeur/icons/arrow_right.png new file mode 100644 index 00000000..cdb4232f Binary files /dev/null and b/Editeur/icons/arrow_right.png differ diff --git a/Editeur/icons/ast-green-ball.png b/Editeur/icons/ast-green-ball.png new file mode 100644 index 00000000..6a887c90 Binary files /dev/null and b/Editeur/icons/ast-green-ball.png differ diff --git a/Editeur/icons/ast-green-los.gif b/Editeur/icons/ast-green-los.gif index 0c9dbd02..44847265 100755 Binary files a/Editeur/icons/ast-green-los.gif and b/Editeur/icons/ast-green-los.gif differ diff --git a/Editeur/icons/ast-green-los.png b/Editeur/icons/ast-green-los.png new file mode 100644 index 00000000..10a27eef Binary files /dev/null and b/Editeur/icons/ast-green-los.png differ diff --git a/Editeur/icons/ast-green-percent.png b/Editeur/icons/ast-green-percent.png new file mode 100644 index 00000000..5e5ddec0 Binary files /dev/null and b/Editeur/icons/ast-green-percent.png differ diff --git a/Editeur/icons/ast-green-square.gif b/Editeur/icons/ast-green-square.gif index 04ad5adc..22bbac00 100755 Binary files a/Editeur/icons/ast-green-square.gif and b/Editeur/icons/ast-green-square.gif differ diff --git a/Editeur/icons/ast-green-square.png b/Editeur/icons/ast-green-square.png new file mode 100644 index 00000000..540db29d Binary files /dev/null and b/Editeur/icons/ast-green-square.png differ diff --git a/Editeur/icons/ast-green-text.png b/Editeur/icons/ast-green-text.png new file mode 100644 index 00000000..3dc6f1d1 Binary files /dev/null and b/Editeur/icons/ast-green-text.png differ diff --git a/Editeur/icons/ast-red-ball.png b/Editeur/icons/ast-red-ball.png new file mode 100644 index 00000000..9a2b3e26 Binary files /dev/null and b/Editeur/icons/ast-red-ball.png differ diff --git a/Editeur/icons/ast-red-los.png b/Editeur/icons/ast-red-los.png new file mode 100644 index 00000000..163b5c10 Binary files /dev/null and b/Editeur/icons/ast-red-los.png differ diff --git a/Editeur/icons/ast-red-percent.png b/Editeur/icons/ast-red-percent.png new file mode 100644 index 00000000..a5dec253 Binary files /dev/null and b/Editeur/icons/ast-red-percent.png differ diff --git a/Editeur/icons/ast-red-square.png b/Editeur/icons/ast-red-square.png new file mode 100644 index 00000000..501c7e9e Binary files /dev/null and b/Editeur/icons/ast-red-square.png differ diff --git a/Editeur/icons/ast-red-text.png b/Editeur/icons/ast-red-text.png new file mode 100644 index 00000000..32e1c929 Binary files /dev/null and b/Editeur/icons/ast-red-text.png differ diff --git a/Editeur/icons/ast-white-percent.png b/Editeur/icons/ast-white-percent.png new file mode 100644 index 00000000..255a409f Binary files /dev/null and b/Editeur/icons/ast-white-percent.png differ diff --git a/Editeur/icons/ast-white-square.png b/Editeur/icons/ast-white-square.png new file mode 100644 index 00000000..c117825c Binary files /dev/null and b/Editeur/icons/ast-white-square.png differ diff --git a/Editeur/icons/ast-white-text.png b/Editeur/icons/ast-white-text.png new file mode 100644 index 00000000..7f1040f4 Binary files /dev/null and b/Editeur/icons/ast-white-text.png differ diff --git a/Editeur/icons/ast-yel-ball.png b/Editeur/icons/ast-yel-ball.png new file mode 100644 index 00000000..f64916d7 Binary files /dev/null and b/Editeur/icons/ast-yel-ball.png differ diff --git a/Editeur/icons/ast-yel-los.png b/Editeur/icons/ast-yel-los.png new file mode 100644 index 00000000..363a02ca Binary files /dev/null and b/Editeur/icons/ast-yel-los.png differ diff --git a/Editeur/icons/ast-yel-percent.png b/Editeur/icons/ast-yel-percent.png new file mode 100644 index 00000000..8983af32 Binary files /dev/null and b/Editeur/icons/ast-yel-percent.png differ diff --git a/Editeur/icons/ast-yel-square.png b/Editeur/icons/ast-yel-square.png new file mode 100644 index 00000000..046d91d8 Binary files /dev/null and b/Editeur/icons/ast-yel-square.png differ diff --git a/Editeur/icons/ast-yellow-square.png b/Editeur/icons/ast-yellow-square.png new file mode 100644 index 00000000..37d347b5 Binary files /dev/null and b/Editeur/icons/ast-yellow-square.png differ diff --git a/Editeur/icons/ast-yellow-text.png b/Editeur/icons/ast-yellow-text.png new file mode 100644 index 00000000..ebe65eaa Binary files /dev/null and b/Editeur/icons/ast-yellow-text.png differ diff --git a/Editeur/icons/minusnode.png b/Editeur/icons/minusnode.png new file mode 100644 index 00000000..9c9ffce7 Binary files /dev/null and b/Editeur/icons/minusnode.png differ diff --git a/Editeur/icons/plusnode.png b/Editeur/icons/plusnode.png new file mode 100644 index 00000000..57b164d3 Binary files /dev/null and b/Editeur/icons/plusnode.png differ diff --git a/Editeur/listePatrons.py b/Editeur/listePatrons.py index d6dbe89b..19f81ef5 100644 --- a/Editeur/listePatrons.py +++ b/Editeur/listePatrons.py @@ -3,7 +3,10 @@ import re sous_menus={"ASTER" : {0:{"3D":"3D.comm"},1:{"poutre":"pou.comm"},2:{"salome":"salome.comm"},3:{"divers":"comm"}}, "OPENTURNS_STUDY" : {0:{"Anne":"Std.comm"}}, - "OPENTURNS_WRAPPER" : {0:{"Anne":"wrapper_exemple.comm"}} + "OPENTURNS_WRAPPER" : {0:{"Anne":"wrapper_exemple.comm"}}, + "HOMARD" : {}, + "CUVE2DG" : {}, + 'SEP' : {} } class listePatrons : diff --git a/Homard/configuration.py b/Homard/configuration.py new file mode 100644 index 00000000..1f70895b --- /dev/null +++ b/Homard/configuration.py @@ -0,0 +1,193 @@ +# -*- 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 sert pour charger les paramètres de configuration d'EFICAS +""" +# Modules Python +print "passage dans la surcharge de configuration pour Homard" +import os, sys, string, types, re +import traceback +from PyQt4.QtGui import * + +# Modules Eficas +from Editeur import utils + +class CONFIG: + + #----------------------------------- + def __init__(self,appli,repIni): + #----------------------------------- + + # Classe de base permettant de lire, afficher + # et sauvegarder les fichiers utilisateurs + # On a deux directories : la directory generale (Repertoire d instal + Nom du code + # Par exemple : ~/Install_Eficas/EficasV1_14/Homard + # et la directorie de l utilisateur + # HOME/.Eficas_Homard + # Le fichier prefs.py va etre lu dans la directory generale puis surcharge eventuellement + # par celui de l utilisateur + # le fichier de catalogue va etre lu dans la directory de l utilisateur s il exite + # dans le fichier general sinon + self.appli = appli + self.code = appli.code + self.salome = appli.salome + self.repIni = repIni + self.fic_prefs ="prefs.py" + + if self.appli: + self.parent=appli.top + else: self.parent=None + + + self.labels=("rep_user","INSTALLDIR","path_doc","exec_acrobat","rep_cata","initialdir","savedir") + + # Valeurs par defaut + self.rep_user = os.path.join(os.environ['HOME'],'.Eficas_Homard') + self.initialdir = self.rep_user + self.path_doc = self.rep_user + self.savedir = self.rep_user + self.exec_acrobat = self.rep_user + + #Lecture des fichiers utilisateurs + self.lecture_fichier_ini_standard() + self.lecture_fichier_ini_utilisateur() + self.lecture_catalogues() + print self.initialdir + + #-------------------------------------- + def lecture_fichier_ini_standard(self): + #-------------------------------------- + # Verifie l'existence du fichier "standard" + # appelle la lecture de ce fichier + self.fic_ini = os.path.join(self.repIni,self.fic_prefs) + if not os.path.isfile(self.fic_ini): + QMessageBox.critical( None, "Import du fichier de Configuration", + "Erreur à la lecture du fichier de configuration "+self.fic_ini+".py" ) + sys.exit(0) + import prefs + for k in self.labels : + try : + valeur=getattr(prefs,k) + setattr(self,k,valeur) + except : + pass + + + #-------------------------------------- + def lecture_fichier_ini_utilisateur(self): + #-------------------------------------- + # Surcharge les paramètres standards par les paramètres utilisateur s'ils existent + self.fic_ini_utilisateur = os.path.join(self.rep_user,self.fic_prefs) + #if not os.path.isfile(self.fic_ini_utilisateur+".py"): + if not os.path.isfile(self.fic_ini_utilisateur): + return + from utils import read_file + txt = utils.read_file(self.fic_ini_utilisateur) + from styles import style + d=locals() + try: + exec txt in d + except : + l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2]) + QMessageBox.critical( None, "Import du fichier de Configuration", + "Erreur à la lecture du fichier de configuration " + self.fic_ini_utilisateur ) + sys.exit(0) + for k in self.labels : + try : + setattr(self,k,d[k]) + except : + pass + + + + #-------------------------------------- + def lecture_catalogues(self): + #-------------------------------------- + rep_mat=" " # Compatbilite Aster + fic_cata ="catalogues_homard.ini" + fic_ini = os.path.join(self.repIni,fic_cata) + fic_user= os.path.join(self.rep_user,fic_cata) + if os.path.isfile(fic_user): + fichier = fic_user + else : + fichier = fic_ini + if not os.path.isfile(fic_ini) : + QMessageBox.critical( None, "Erreur a l'import du fichier des Catalogues", + "Le fichier de configuration des catalogues "+fic_ini+" n a pas été trouvé" ) + sys.exit(0) + + from utils import read_file + txt = utils.read_file(fichier) + d=locals() + try: + exec txt in d + self.catalogues=d["catalogues"] + except : + l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2]) + QMessageBox.critical( None, "Import du fichier de Configuration", + "Erreur à la lecture du fichier de configuration " + fichier ) + sys.exit(0) + + + + #-------------------------------------- + def save_params(self): + #-------------------------------------- + # sauvegarde + # les nouveaux paramètres dans le fichier de configuration utilisateur + # + print "a ecrire PNPNPN" +# l_param=('exec_acrobat', 'repIni','catalogues','rep_travail','rep_mat','path_doc') +# texte="" +# for clef in l_param : +# if hasattr(self,clef): +# valeur=getattr(self,clef) +# texte= texte + clef+" = " + repr(valeur) +"\n" +# +# +# # recuperation des repertoires materiaux +# try : +# for item in self.catalogues : +# try : +# (code,version,cata,format,defaut)=item +# except : +# (code,version,cata,format)=item +# codeSansPoint=re.sub("\.","",version) +# chaine="rep_mat_"+codeSansPoint +# if hasattr(self,chaine): +# valeur=getattr(self,chaine) +# texte= texte + chaine+" = '" + str(valeur) +"'\n" +# except : +# pass +# +# f=open(self.fic_ini_utilisateur,'w+') +# f.write(texte) +# f.close() +# + + +def make_config(appli,rep): + return CONFIG(appli,rep) + +def make_config_style(appli,rep): + return None + + diff --git a/Homard/prefs.py b/Homard/prefs.py index 56bb96cd..f79fe6ef 100644 --- a/Homard/prefs.py +++ b/Homard/prefs.py @@ -19,74 +19,31 @@ # # ====================================================================== -import os +import os, sys +# Les variables pouvant positionnees sont : +print "import des prefs de Homard" -# REPINI sert à localiser le fichier editeur.ini -# Obligatoire +code = "Homard" + +# REPINI sert à localiser le fichier +# initialdir sert comme directory initial des QFileDialog +# positionnee a repin au debut mise a jour dans configuration REPINI=os.path.dirname(os.path.abspath(__file__)) +initialdir=REPINI # INSTALLDIR sert à localiser l'installation d'Eficas -# Obligatoire INSTALLDIR=os.path.join(REPINI,'..') +sys.path[:0]=[INSTALLDIR] -# CODE_PATH sert à localiser Noyau et Validation éventuellement -# non contenus dans la distribution EFICAS -# Par défaut on utilise les modules de INSTALLDIR -# Peut valoir None (defaut) -CODE_PATH = None -#CODE_PATH = os.path.join(REPINI,'../../Superv') - -# ICONDIR sert à localiser le répertoire contenant les icones -# Par défaut on utilise le répertoire icons dans Editeur -ICONDIR=os.path.join(INSTALLDIR,'Editeur','icons') +# Codage des strings qui accepte les accents (en remplacement de 'ascii') # lang indique la langue utilisée pour les chaines d'aide : fr ou ang lang='fr' - -# Codage des strings qui accepte les accents (en remplacement de 'ascii') encoding='iso-8859-1' -labels= ('Fichier','Edition','Jeu de commandes', -# 'Catalogue','Browsers', - 'Options', - 'Aide', - ) - -appli_composants=['readercata','bureau', -# 'browser', - 'options', - ] +# Acces a la documentation +rep_cata = INSTALLDIR +path_doc = os.path.join(rep_cata,'Doc') +exec_acrobat = "/usr/bin/xpdf" -menu_defs={ 'bureau': [ - ('Fichier',[ - ('Nouveau','newJDC',''), - ('Ouvrir','openJDC',''), - ('Enregistrer','saveJDC',''), - ('Enregistrer sous','saveasJDC',''), - None, - ('Fermer','closeJDC',''), - ('Quitter','exitEFICAS',''), - ] - ), - ('Edition',[ - ('Copier','copy',''), - ('Couper','cut',''), - ('Coller','paste',''), - ] - ), - ('Jeu de commandes',[ - ('Rapport de validation','visuCRJDC',''), - ('Fichier à plat','visu_a_plat',''), - ('Fichier format v6','visuJDC_py'), - ('Fichier source','visu_txt_brut_JDC',''), - ('Paramètres Eficas','affichage_fichier_ini'), - ('Mots-clés inconnus','mc_inconnus'), - ] - ), - ('Aide',[ - ('Aide EFICAS','aideEFICAS',''), - ] - ), - ] - } diff --git a/Homard/qtEficas_homard.py b/Homard/qtEficas_homard.py new file mode 100755 index 00000000..8ee037ea --- /dev/null +++ b/Homard/qtEficas_homard.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python +# -*- 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 sert à lancer EFICAS configuré pour Homard +""" +# Modules Python + +# Modules Eficas +import prefs +prefs.code="HOMARD" +from InterfaceQT4 import eficas_go + +eficas_go.lance_eficas(code=prefs.code) diff --git a/Ihm/I_MACRO_ETAPE.py b/Ihm/I_MACRO_ETAPE.py index 5aab780a..357fc5b7 100644 --- a/Ihm/I_MACRO_ETAPE.py +++ b/Ihm/I_MACRO_ETAPE.py @@ -774,7 +774,7 @@ class MACRO_ETAPE(I_ETAPE.ETAPE): self.fichier_err="Le fichier INCLUDE n est pas defini" self.parent.record_unit(999,self) try : - MCFils=self.get_child('FICHIER') + MCFils=self.get_child('FileName') MCFils.set_valeur(None) except : pass @@ -796,9 +796,9 @@ class MACRO_ETAPE(I_ETAPE.ETAPE): nom=maVariableListe[i].id_ type=maVariableListe[i].type_ if type : - ligneTexte=nom+"=VARI(type='IN',);\n" + ligneTexte="%s=DETERMINISTICVARIABLE(N='%s',T='in',R=%d);\n" % (nom, nom, i) else : - ligneTexte=nom+"=VARI(type='OUT',);\n" + ligneTexte="%s=DETERMINISTICVARIABLE(N='%s',T='out',R=%d);\n" % (nom, nom, i) self.fichier_text = self.fichier_text + ligneTexte except: self.make_incl2_except() @@ -816,7 +816,7 @@ class MACRO_ETAPE(I_ETAPE.ETAPE): self.make_contexte_include(self.fichier_ini ,self.fichier_text) self.parent.record_unit(unite,self) try : - MCFils=self.get_child('FICHIER') + MCFils=self.get_child('FileName') MCFils.set_valeur(fichier) except : pass @@ -838,7 +838,7 @@ class MACRO_ETAPE(I_ETAPE.ETAPE): self.fichier_err = string.join(l) self.contexte_fichier_init={} try : - MCFils=self.get_child('FICHIER') + MCFils=self.get_child('FileName') MCFils.set_valeur(None) except : pass diff --git a/Ihm/I_MCCOMPO.py b/Ihm/I_MCCOMPO.py index 9d60d37a..5ee3a1fd 100644 --- a/Ihm/I_MCCOMPO.py +++ b/Ihm/I_MCCOMPO.py @@ -407,6 +407,10 @@ class MCCOMPO(I_OBJECT.OBJECT): def delete_mc_global(self): for motcle in self.mc_liste : motcle.delete_mc_global() + try : + motcle.update_mc_global() + except : + pass def init_modif_up(self): Validation.V_MCCOMPO.MCCOMPO.init_modif_up(self) diff --git a/InterfaceQT/browser.py b/InterfaceQT/browser.py index 2b11541e..3f8103ba 100644 --- a/InterfaceQT/browser.py +++ b/InterfaceQT/browser.py @@ -22,7 +22,7 @@ class JDCTree( QListView ): self.addColumn(self.trUtf8('Commande')) self.addColumn(self.trUtf8('Concept/Valeur')) - #self.setMinimumSize(QSize(400,500)) + self.resize(QSize(400,500)) self.connect(self,SIGNAL('contextMenuRequested(QListViewItem *, const QPoint &, int)'), self.handleContextMenu) diff --git a/InterfaceQT/editor.py b/InterfaceQT/editor.py index b2391368..6346902a 100644 --- a/InterfaceQT/editor.py +++ b/InterfaceQT/editor.py @@ -18,7 +18,7 @@ import readercata import prefs import qtCommun -VERSION_EFICAS = "EFICAS v1.15" +VERSION_EFICAS = "EFICAS v1.16" # -------------------------- # @@ -137,6 +137,8 @@ class JDCEditor(QSplitter): self.connect(self.tree,SIGNAL('selectionChanged(QListViewItem *)'),self.updatePanel) sh = self.sizeHint() + if sh.width() < 300: + sh.setWidth(300) if sh.height() < 300: sh.setHeight(300) self.resize(sh) @@ -658,10 +660,10 @@ class JDCEditor(QSplitter): if QFileInfo(fn).exists(): abort = QMessageBox.warning( self, - self.trUtf8("Save File"), - self.trUtf8("The file %1 already exists.").arg(fn), - self.trUtf8("&Overwrite"), - self.trUtf8("&Abort") ) + self.trUtf8("Sauvegarde Fichier"), + self.trUtf8("Le fichier %1 existe deja.").arg(fn), + self.trUtf8("&Remplacer"), + self.trUtf8("&Abandonner") ) print abort if abort: return (0, None) diff --git a/InterfaceQT/monRacinePanel.py b/InterfaceQT/monRacinePanel.py index 678fc089..78f8e32a 100644 --- a/InterfaceQT/monRacinePanel.py +++ b/InterfaceQT/monRacinePanel.py @@ -41,6 +41,7 @@ class MonRacinePanel(DRac,QTPanelTBW2): QTPanel.__init__(self,node,parent) QTPanelTBW2.__init__(self,node,parent,racine=1) self.setMinimumSize(0,0) + self.LEFiltre.setFocus() def BSupPressed(self): QTPanel.BSupPressed(self) diff --git a/InterfaceQT/monUniqueBasePanel.py b/InterfaceQT/monUniqueBasePanel.py index 435e5590..75c9eb1e 100644 --- a/InterfaceQT/monUniqueBasePanel.py +++ b/InterfaceQT/monUniqueBasePanel.py @@ -65,10 +65,10 @@ class MonUniqueBasePanel(DUnBase,QTPanel,SaisieValeur): valeurTexte=self.politique.GetValeurTexte(valeur) if valeurTexte != None: try : - str=QString("").setNum(valeurTexte) + maString=QString("").setNum(valeurTexte) except : - str=QString(valeurTexte) - self.lineEditVal.setText(str) + maString=str(valeurTexte) + self.lineEditVal.setText(maString) def InitCommentaire(self): diff --git a/InterfaceQT/qtCommun.py b/InterfaceQT/qtCommun.py index 99a9afca..7e5b13e5 100644 --- a/InterfaceQT/qtCommun.py +++ b/InterfaceQT/qtCommun.py @@ -52,8 +52,8 @@ class QTPanel: QMessageBox.information( self.editor, "Documentation Vide", \ "Aucune documentation Aster n'est associée à ce noeud") return - cle_doc = string.replace(cle_doc,'.','') - cle_doc = string.replace(cle_doc,'-','') + #cle_doc = string.replace(cle_doc,'.','') + #cle_doc = string.replace(cle_doc,'-','') commande = self.editor.appliEficas.CONFIGURATION.exec_acrobat try : f=open(commande,"rb") @@ -61,7 +61,7 @@ class QTPanel: texte="impossible de trouver la commande " + commande QMessageBox.information( self.editor, "Lecteur PDF", texte) return - nom_fichier = cle_doc+".pdf" + nom_fichier = cle_doc fichier = os.path.abspath(os.path.join(self.editor.CONFIGURATION.path_doc, nom_fichier)) try : @@ -173,9 +173,26 @@ class QTPanelTBW2(QTPanel): self.editor = parent self.node = node self.BuildLBNouvCommande() - if racine == 1 : self.AppelleBuildLBRegles() + self.LEFiltre.setFocus() + if racine == 1 : + self.AppelleBuildLBRegles() + else : + self.connect(self.TWChoix, SIGNAL("currentChanged(QWidget *)"), self.handleCurrentChanged) + def handleCurrentChanged(self): + label=self.TWChoix.tabLabel(self.TWChoix.currentPage()) + if label==QString("Nouvelle Commande"): + try : + self.LEFiltre.setFocus() + except : + pass + if label==QString("Nommer Concept"): + try : + self.LENomConcept.setFocus() + except : + pass + def BuildLBNouvCommande(self): self.LBNouvCommande.clear() try : @@ -260,6 +277,7 @@ class QTPanelTBW3(QTPanel): self.typeConcept.setText(type_sd) self.LENomConcept.setText("") self.LENomConcept.setText(nomConcept) + self.LENomConcept.setFocus() @@ -317,11 +335,11 @@ class ViewText(QDialog): if not fn.isNull(): if QFileInfo(fn).exists(): abort = QMessageBox.warning(self, - self.trUtf8("Save File"), - self.trUtf8("The file %1 already exists.") + self.trUtf8("Sauvegarde Fichier"), + self.trUtf8("Le fichier %1 existe.") .arg(fn), - self.trUtf8("&Overwrite"), - self.trUtf8("&Abort"), None, 1) + self.trUtf8("&Remplacer"), + self.trUtf8("&Abandonner"), None, 1) if abort: return fn = unicode(QDir.convertSeparators(fn)) diff --git a/InterfaceQT/qtEficas.py b/InterfaceQT/qtEficas.py index df16582a..cb670c6d 100644 --- a/InterfaceQT/qtEficas.py +++ b/InterfaceQT/qtEficas.py @@ -130,7 +130,7 @@ class Appli(Eficas): titre = "version " monVisu=DVisu(parent=self.viewmanager,fl=Qt.WType_Dialog) monVisu.setCaption(titre) - monVisu.TB.setText("Eficas V1.15") + monVisu.TB.setText("Eficas V1.16") monVisu.adjustSize() monVisu.show() diff --git a/InterfaceQT/readercata.py b/InterfaceQT/readercata.py index b6f4c535..ffeb8273 100644 --- a/InterfaceQT/readercata.py +++ b/InterfaceQT/readercata.py @@ -42,7 +42,7 @@ from monChoixCata import MonChoixCata from qt import * -version="15" +version="16" class READERCATA: diff --git a/InterfaceQT4/browser.py b/InterfaceQT4/browser.py index dc260e10..785633a0 100644 --- a/InterfaceQT4/browser.py +++ b/InterfaceQT4/browser.py @@ -22,6 +22,7 @@ import string,re import types,sys,os import traceback +import typeNode from PyQt4 import * from PyQt4.QtGui import * from PyQt4.QtCore import * @@ -29,9 +30,7 @@ from PyQt4.QtCore import * class JDCTree( QTreeWidget ): def __init__( self, jdc_item, QWParent): QListView.__init__( self, QWParent ) - print QWParent.__class__ - print "je suis dans JDCTree et voilà ", jdc_item self.item = jdc_item self.tree = self self.editor = QWParent @@ -42,8 +41,7 @@ class JDCTree( QTreeWidget ): mesLabels << self.trUtf8('Commande ') << self.trUtf8('Concept/Valeur ') self.setHeaderLabels(mesLabels) - self.setMinimumSize(QSize(600,500)) - print self + self.setMinimumSize(QSize(600,505)) self.setColumnWidth(0,300) self.connect(self, SIGNAL("itemClicked ( QTreeWidgetItem * ,int) "), self.handleOnItem) @@ -101,7 +99,8 @@ class JDCNode(QTreeWidgetItem): mesColonnes << name << value QTreeWidgetItem.__init__(self,treeParent,mesColonnes) - monIcone = QIcon("/home/noyret/Install_Eficas/EficasV1/InterfaceQT4/icons/" +self.item.GetIconName() + ".gif") + RepIcon=QString(self.appliEficas.RepIcon) + monIcone = QIcon(RepIcon+"/" +self.item.GetIconName() + ".png") self.setIcon(0,monIcone) self.children = [] self.build_children() @@ -112,6 +111,7 @@ class JDCNode(QTreeWidgetItem): self.item.connect("supp" ,self.onAdd,()) self.item.connect("add" ,self.onSupp,()) + def build_children(self,posInsertion=10000): """ Construit la liste des enfants de self """ """ Se charge de remettre les noeuds Expanded dans le meme etat """ @@ -134,6 +134,7 @@ class JDCNode(QTreeWidgetItem): ind=ind+1 def affichePanneau(self) : + print self if self.item.isactif(): panel=self.getPanel() else: @@ -312,7 +313,8 @@ class JDCNode(QTreeWidgetItem): Elle appelle isvalid """ #print 'NODE update_node_valid', self.item.GetLabelText() - monIcone = QIcon("/home/noyret/Install_Eficas/EficasV1/InterfaceQT4/icons/" +self.item.GetIconName() + ".gif") + RepIcon=QString(self.appliEficas.RepIcon) + monIcone = QIcon(RepIcon+"/" +self.item.GetIconName() + ".png") self.setIcon(0,monIcone) def update_node_label(self): @@ -339,16 +341,6 @@ class JDCNode(QTreeWidgetItem): for child in self.children: if child.isHidden() == false : child.update_texte() -# def update_valid(self) : -# """Cette methode a pour but de mettre a jour la validite du noeud -# et de propager la demande de mise a jour a son Parent -# """ -# #print "NODE update_valid", self.item.GetLabelText() -# self.update_node_valid() -# try : -# self.treeParent.update_valid() -# except: -# pass def doPasteCommande(self,objet_a_copier): """ diff --git a/InterfaceQT4/compobloc.py b/InterfaceQT4/compobloc.py index e236eef5..d8060063 100644 --- a/InterfaceQT4/compobloc.py +++ b/InterfaceQT4/compobloc.py @@ -6,15 +6,20 @@ from Editeur import Objecttreeitem import compofact import browser +import typeNode -class Node(browser.JDCNode): +class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): def getPanel(self): """ """ from monMCFactPanel import MonMCFactPanel return MonMCFactPanel(self,parent=self.editor) + def createPopUpMenu(self): + typeNode.PopUpMenuNodeMinimal.createPopUpMenu(self) + + class BLOCTreeItem(compofact.FACTTreeItem): itemNode=Node diff --git a/InterfaceQT4/compofact.py b/InterfaceQT4/compofact.py index 76b81c63..1551befe 100644 --- a/InterfaceQT4/compofact.py +++ b/InterfaceQT4/compofact.py @@ -23,17 +23,22 @@ from PyQt4 import * from PyQt4.QtGui import * from PyQt4.QtCore import * import browser +import typeNode + from Editeur import Objecttreeitem -class Node(browser.JDCNode): +class Node(browser.JDCNode,typeNode.PopUpMenuNodePartiel): def getPanel(self): """ """ from monMCFactPanel import MonMCFactPanel return MonMCFactPanel(self,parent=self.editor) + def createPopUpMenu(self): + typeNode.PopUpMenuNodeMinimal.createPopUpMenu(self) + def doPaste(self,node_selected): objetACopier = self.item.get_copie_objet() child=node_selected.doPasteMCF(objetACopier) diff --git a/InterfaceQT4/compomacro.py b/InterfaceQT4/compomacro.py index 1afafa5d..c4e694cb 100644 --- a/InterfaceQT4/compomacro.py +++ b/InterfaceQT4/compomacro.py @@ -14,6 +14,7 @@ import typeNode class MACRONode(browser.JDCNode,typeNode.PopUpMenuNode): def getPanel(self): + print "MACRONode MACRONode" from monMacroPanel import MonMacroPanel return MonMacroPanel (self,parent=self.editor ) diff --git a/InterfaceQT4/compomclist.py b/InterfaceQT4/compomclist.py index 04a79132..b1104d4e 100644 --- a/InterfaceQT4/compomclist.py +++ b/InterfaceQT4/compomclist.py @@ -5,12 +5,14 @@ import traceback import compofact import browser +import typeNode + from Editeur import Objecttreeitem from Noyau.N_OBJECT import ErrorObj #import compoerror -class Node(browser.JDCNode): +class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): def getPanel(self): """ """ @@ -26,6 +28,10 @@ class Node(browser.JDCNode): else : print "MCList" + def createPopUpMenu(self): + typeNode.PopUpMenuNodeMinimal.createPopUpMenu(self) + + def doPaste(self,node_selected): objet_a_copier = self.item.get_copie_objet() child=node_selected.doPasteMCF(objet_a_copier) diff --git a/InterfaceQT4/componiveau.py b/InterfaceQT4/componiveau.py index 02743c71..3b9539b0 100644 --- a/InterfaceQT4/componiveau.py +++ b/InterfaceQT4/componiveau.py @@ -5,7 +5,14 @@ from Extensions import commentaire import browser class Node(browser.JDCNode): - pass + + def getPanel(self): + from monRacinePanel import MonRacinePanel + return MonRacinePanel(self,parent=self.editor) + + + def createPopUpMenu(self): + typeNode.PopUpMenuNode.createPopUpMenu(self) class NIVEAUTreeItem(Objecttreeitem.ObjectTreeItem): itemNode=Node @@ -22,11 +29,7 @@ class NIVEAUTreeItem(Objecttreeitem.ObjectTreeItem): - la fonte dans laquelle afficher ce texte - la couleur du texte """ - if self.isactif(): - fonte = Fonte_Niveau - else : - fonte = Fonte_Niveau_inactif - return self.labeltext,fonte,'#00008b' + return self.labeltext,None,None def GetIconName(self): if self.isactif(): diff --git a/InterfaceQT4/compoparam.py b/InterfaceQT4/compoparam.py index b21ae803..5c637496 100644 --- a/InterfaceQT4/compoparam.py +++ b/InterfaceQT4/compoparam.py @@ -23,6 +23,7 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodePartiel): def createPopUpMenu(self): typeNode.PopUpMenuNodePartiel.createPopUpMenu(self) + self.menu.removeAction(self.Documentation) diff --git a/InterfaceQT4/composimp.py b/InterfaceQT4/composimp.py index d1422bf5..fb0efe8b 100644 --- a/InterfaceQT4/composimp.py +++ b/InterfaceQT4/composimp.py @@ -4,26 +4,20 @@ import string,types,os from copy import copy,deepcopy import traceback +import typeNode # Modules Eficas from Editeur import Objecttreeitem import browser from Noyau.N_CR import justify_text -class Node(browser.JDCNode): +class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): def getPanel(self): """ """ klass = None # Attention l ordre des if est important - if self.item.wait_shell(): - # l'objet attend un shell - # a priori jamais - print "Pb : Panneau Shell attendu" - print "Pb : Prevenir la maintenance" - klass = None #CS_pbruno todo - return None # l'objet prend sa (ses) valeur(s) dans un ensemble discret de valeurs if self.item.has_into(): @@ -39,7 +33,10 @@ class Node(browser.JDCNode): # on attend une liste de valeurs if self.item.is_list() : # on attend une liste de SD - if self.item.wait_assd(): + if self.item.wait_tuple() : + from monFonctionPanel import MonFonctionPanel + klass = MonFonctionPanel + elif self.item.wait_assd(): from monPlusieursASSDPanel import MonPlusieursASSDPanel klass = MonPlusieursASSDPanel else: @@ -84,10 +81,14 @@ class Node(browser.JDCNode): from monFonctionPanel import MonFonctionPanel klass = MonFonctionPanel + print klass if not klass: return None return klass( self, self.editor ) + def createPopUpMenu(self): + typeNode.PopUpMenuNodeMinimal.createPopUpMenu(self) + class SIMPTreeItem(Objecttreeitem.AtomicObjectTreeItem): @@ -389,7 +390,6 @@ class SIMPTreeItem(Objecttreeitem.AtomicObjectTreeItem): # wait_geom # wait_complex # wait_reel - # wait_shell # wait_assd # GetType @@ -424,13 +424,13 @@ class SIMPTreeItem(Objecttreeitem.AtomicObjectTreeItem): else: return 0 - def wait_shell(self): + def wait_tuple(self): """ Méthode booléenne qui retourne 1 si l'objet pointé par self attend un shell, 0 sinon """ - if 'shell' in self.object.definition.type: - return 1 - else: - return 0 + for ss_type in self.object.definition.type: + if repr(ss_type).find('Tuple') != -1 : + return 1 + return 0 def wait_assd(self): """Méthode booléenne qui retourne 1 si l'objet pointé par self diff --git a/InterfaceQT4/editor.py b/InterfaceQT4/editor.py index 7ab8dc62..0e885a69 100644 --- a/InterfaceQT4/editor.py +++ b/InterfaceQT4/editor.py @@ -36,7 +36,7 @@ import readercata import qtCommun -VERSION_EFICAS = "EFICAS v1.15" +VERSION_EFICAS = "EFICAS v1.16" class JDCEditor(QSplitter): @@ -74,7 +74,9 @@ class JDCEditor(QSplitter): self.liste_simp_reel=[] self.ihm="QT" - import configuration + import prefs + nameConf='configuration_'+prefs.code + configuration=__import__(nameConf) self.CONFIGURATION = self.appliEficas.CONFIGURATION self.CONFIGStyle = self.appliEficas.CONFIGStyle @@ -93,10 +95,12 @@ class JDCEditor(QSplitter): if not hasattr( readercata, 'reader' ) : readercata.reader = readercata.READERCATA( self, self.appliEficas ) self.readercata = readercata.reader + self.Commandes_Ordre_Catalogue =self.readercata.Commandes_Ordre_Catalogue #------- construction du jdc -------------- jdc_item = None + self.mode_nouv_commande=self.readercata.mode_nouv_commande nouveau=0 if self.fichier is not None: # fichier jdc fourni @@ -299,16 +303,18 @@ class JDCEditor(QSplitter): #------------------------------# def affiche_infos(self,message): #------------------------------# - if self.salome : - if not hasattr(self.appliEficas,'MessageLabel') : - self.appliEficas.leLayout=QDockWindow(self.appliEficas) - self.appliEficas.MessageLabel = QLabel(self.appliEficas.leLayout,"MessageLabel") - self.appliEficas.MessageLabel.setAlignment(Qt.AlignBottom) - self.appliEficas.leLayout.setWidget(self.appliEficas.MessageLabel) - self.appliEficas.moveDockWindow(self.appliEficas.leLayout,Qt.DockBottom) - self.appliEficas.MessageLabel.setText(message) - self.appliEficas.MessageLabel.show() - self.appliEficas.leLayout.show() + #PN --> devenu inutile avec QT4 + #if self.salome : + # if not hasattr(self.appliEficas,'MessageLabel') : + # self.appliEficas.leLayout=QDockWidget(self.appliEficas) + # self.appliEficas.MessageLabel = QLabel("MessageLabel",self.appliEficas.leLayout) + # self.appliEficas.MessageLabel.setAlignment(Qt.AlignBottom) + # self.appliEficas.leLayout.setAllowedAreas(Qt.BottomDockWidgetArea) + # self.appliEficas.leLayout.setWidget(self.appliEficas.MessageLabel) + # #self.appliEficas.moveDockWindow(self.appliEficas.leLayout,Qt.DockBottom) + # self.appliEficas.MessageLabel.setText(message) + # self.appliEficas.MessageLabel.show() + # self.appliEficas.leLayout.show() if self.sb: self.sb.showMessage(message)#,2000) @@ -492,6 +498,12 @@ class JDCEditor(QSplitter): return "" + #-----------------------------------------# + def cherche_Groupes(self): + liste=self.get_text_JDC("GroupMA") + return liste + #-----------------------------------------# + #-----------------------------------------# def saveFile(self, path = None, saveas= 0): #-----------------------------------------# @@ -561,8 +573,28 @@ class JDCEditor(QSplitter): except : pass -# if self.salome : -# self.QWParent.appli.addJdcInSalome( self.fichier) + try : + #if 1 : + self.generator.writeCuve2DG() + #else : + except : + pass + + + try : + #if 1 : + self.tubePy=self.generator.getTubePy() + fileTube = '/tmp/tube.py' + if self.tubePy != '' : + f=open(fileTube,'w') + f.write(self.tubePy) + f.close() + except : + #else : + pass + + if self.salome : + self.appliEficas.addJdcInSalome( self.fichier) # if self.code == 'ASTER': # self.QWParent.appli.createOrUpdateMesh(self) # #PN ; TODO @@ -626,7 +658,10 @@ class JDCEditor(QSplitter): if __name__=='__main__': import prefs # dans main - if hasattr(prefs,'encoding'): + name='prefs_'+prefs.code + prefsCode=__import__(name) + + if hasattr(prefsCode,'encoding'): # Hack pour changer le codage par defaut des strings import sys reload(sys) diff --git a/InterfaceQT4/eficas_go.py b/InterfaceQT4/eficas_go.py index e79bea8b..1b2168c6 100644 --- a/InterfaceQT4/eficas_go.py +++ b/InterfaceQT4/eficas_go.py @@ -42,7 +42,27 @@ def lance_eficas(code=None,fichier=None): Eficas=Appli(code=code) Eficas.show() - res=app.exec_() sys.exit(res) + +def lance_eficas_ssIhm(code=None,fichier=None): + """ + Lance l'appli EFICAS pour trouver les noms des groupes + """ + # Analyse des arguments de la ligne de commande + options=session.parse(sys.argv) + code=options.code + + app = QApplication(sys.argv) + Eficas=Appli(code=code) + + from ssIhm import QWParentSSIhm + parent=QWParentSSIhm(code,Eficas,'v9.4') + + from readercata import READERCATA + readercata = READERCATA( parent, Eficas ) + + from editor import JDCEditor + monEditeur=JDCEditor(Eficas,fichier) + print monEditeur.cherche_Groupes() diff --git a/InterfaceQT4/monCommandePanel.py b/InterfaceQT4/monCommandePanel.py index 530142d5..210ffe59 100644 --- a/InterfaceQT4/monCommandePanel.py +++ b/InterfaceQT4/monCommandePanel.py @@ -69,29 +69,20 @@ class MonCommandePanel(DComm,QTPanelTBW1,QTPanelTBW2,QTPanelTBW3): self.connect(self.LBNouvCommande,SIGNAL("doubleClicked(QListBoxItem*)"),self.LBNouvCommandeClicked) self.connect(self.LEFiltre,SIGNAL("textChanged(const QString&)"),self.LEFiltreTextChanged) self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) - self.connect(self.bSup,SIGNAL("pressed()"),self.BSupPressed) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) self.connect(self.LENomConcept,SIGNAL("returnPressed()"),self.LENomConceptReturnPressed) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) + self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommandChanged) + self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommandChanged) self.connect(self.BNext,SIGNAL("pressed()"),self.BNextPressed) - - def ViewDoc(self): - QTPanel.ViewDoc(self) - - def BSupPressed(self): - QTPanel.BSupPressed(self) - def BOkPressed(self): QTPanel.BOkPressed(self) def BNextPressed(self): QTPanelTBW2.BNextPressed(self) - def BuildTabCommand(self): - QTPanelTBW2.BuildLBNouvCommande(self) + def BuildTabCommandChanged(self): + QTPanelTBW2.BuildLBNouvCommandChanged(self) def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) diff --git a/InterfaceQT4/monCommentairePanel.py b/InterfaceQT4/monCommentairePanel.py index 2449ac32..4bb85c4e 100644 --- a/InterfaceQT4/monCommentairePanel.py +++ b/InterfaceQT4/monCommentairePanel.py @@ -48,6 +48,7 @@ class DComment(Ui_DComment,QDialog): self.setupUi(self) + # Import des panels class MonCommentairePanel(DComment,QTPanelTBW2,QTPanel): @@ -68,11 +69,9 @@ class MonCommentairePanel(DComment,QTPanelTBW2,QTPanel): self.connect(self.LBNouvCommande,SIGNAL("doubleClicked(QListBoxItem*)"),self.LBNouvCommandeClicked) self.connect(self.LEFiltre,SIGNAL("textChanged(const QString&)"),self.LEFiltreTextChanged) self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) - self.connect(self.bSup,SIGNAL("pressed()"),self.BSupPressed) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) + self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommandChanged) + self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommandChanged) self.connect(self.BNext,SIGNAL("pressed()"),self.BNextPressed) self.connect(self.textCommentaire,SIGNAL("textChanged()"),self.TexteCommentaireEntre) @@ -86,9 +85,6 @@ class MonCommentairePanel(DComment,QTPanelTBW2,QTPanel): self.node.item.set_valeur(texte) self.node.onValid() - def BuildTabCommand(self): - QTPanelTBW2.BuildLBNouvCommande(self) - def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) @@ -104,6 +100,6 @@ class MonCommentairePanel(DComment,QTPanelTBW2,QTPanel): def BOkPressed(self): QTPanel.BOkPressed(self) - def ViewDoc(self): - QTPanel.ViewDoc(self) + def BuildTabCommandChanged(self): + QTPanelTBW2.BuildLBNouvCommandChanged(self) diff --git a/InterfaceQT4/monFonctionPanel.py b/InterfaceQT4/monFonctionPanel.py index 4dba067e..0909093f 100644 --- a/InterfaceQT4/monFonctionPanel.py +++ b/InterfaceQT4/monFonctionPanel.py @@ -43,6 +43,14 @@ class MonFonctionPanel(MonPlusieursBasePanel): MonPlusieursBasePanel.__init__(self,node,parent,name,fl) def SetNbValeurs(self): + self.nbValeurs = 1 + if self.node.item.wait_tuple()== 1 : + for a in self.node.item.definition.type : + try : + self.nbValeurs = a.ntuple + break + except : + pass genea=self.node.item.get_genealogie() if "VALE" in genea: self.nbValeurs=2 @@ -56,29 +64,34 @@ class MonFonctionPanel(MonPlusieursBasePanel): if (len(liste)% self.nbValeurs != 0): message="La cardinalité n'est pas correcte, la dernière valeur est ignorée" #self.Commentaire.setText(QString(commentaire)) - self.editor.affiche_infos(commentaire) - for i in range(len(liste)/ self.nbValeurs) : - if (self.nbValeurs==2): - t=(liste[i*self.nbValeurs], liste[i*self.nbValeurs+1]) - else: - t=(liste[i*self.nbValeurs], liste[i*self.nbValeurs+1], liste[i*self.nbValeurs+2]) + self.editor.affiche_infos(message) + i=0 + while ( i < (len(liste) - self.nbValeurs + 1)) : + t=tuple(liste[i:i+self.nbValeurs]) l_valeurs.append(t) + i=i+self.nbValeurs return l_valeurs def BuildLBValeurs(self): self.LBValeurs.clear() listeValeurs=self.node.item.GetListeValeurs() - for valeur in self.DecoupeListeValeurs(listeValeurs): - if (self.nbValeurs==2): - str_valeur=str(valeur[0])+","+str(valeur[1]) - else: - str_valeur=str(valeur[0])+","+str(valeur[1])+","+str(valeur[2]) - self.LBValeurs.addItem(str_valeur) + if self.node.item.wait_tuple()== 1 : + listeATraiter=listeValeurs + else : + listeATraiter=self.DecoupeListeValeurs(listeValeurs) + for valeur in listeATraiter: + str_valeur=str(valeur) + self.LBValeurs.addItem(str_valeur) def Ajout1Valeur(self,liste=[]): # Pour être appele a partir du Panel Importer (donc plusieurs fois par AjouterNValeur) if liste == [] : - liste,validite=SaisieValeur.TraiteLEValeur(self) + if self.node.item.wait_tuple()== 1 : + liste=SaisieValeur.TraiteLEValeurTuple(self) + if liste == [''] : return + validite=1 + else : + liste,validite=SaisieValeur.TraiteLEValeur(self) else : validite=1 if validite == 0 : return @@ -93,6 +106,9 @@ class MonFonctionPanel(MonPlusieursBasePanel): self.editor.affiche_infos(commentaire) return + if self.node.item.wait_tuple()== 1 : + liste2=tuple(liste) + liste=liste2 index=self.LBValeurs.currentRow() if ((self.LBValeurs.isItemSelected(self.LBValeurs.item(index )) == 0) and (index > 0 )): index=0 @@ -104,7 +120,11 @@ class MonFonctionPanel(MonPlusieursBasePanel): listeVal=[] for valeur in self.listeValeursCourantes : listeVal.append(valeur) - validite,comm,comm2,listeRetour=self.politique.AjoutValeurs(liste,index,listeVal) + if self.node.item.wait_tuple()== 1 : + indexListe = index + validite,comm,comm2,listeRetour=self.politique.AjoutTuple(liste,index,listeVal) + else : + validite,comm,comm2,listeRetour=self.politique.AjoutValeurs(liste,index,listeVal) self.Commentaire.setText(comm2) if not validite : self.editor.affiche_infos(comm) @@ -112,11 +132,12 @@ class MonFonctionPanel(MonPlusieursBasePanel): self.LEValeur.setText(QString("")) l1=self.listeValeursCourantes[:indexListe] l3=self.listeValeursCourantes[indexListe:] - for valeur in self.DecoupeListeValeurs(listeRetour) : - if (self.nbValeurs==2): - str_valeur=str(valeur[0])+","+str(valeur[1]) - else: - str_valeur=str(valeur[0])+","+str(valeur[1])+","+str(valeur[2]) + if self.node.item.wait_tuple()== 1 : + listeATraiter=listeRetour + else : + listeATraiter=self.DecoupeListeValeurs(listeRetour) + for valeur in listeATraiter : + str_valeur=str(valeur) self.LBValeurs.insertItem(index,str_valeur) item=self.LBValeurs.item(index) item.setSelected(1) @@ -135,21 +156,24 @@ class MonFonctionPanel(MonPlusieursBasePanel): for vals in listeDecoupee : self.Ajout1Valeur(vals) - def Sup1Valeur(self): index=self.LBValeurs.currentRow() if index == None : return self.LBValeurs.takeItem(index) listeVal=[] + indexInterdit=[] + for i in range(self.nbValeurs): + indexAOter=index*self.nbValeurs + i + indexInterdit.append(indexAOter) + if self.node.item.wait_tuple()== 1 : + indexInterdit=[index] + i=0 for valeur in self.listeValeursCourantes : - if self.nbValeurs == 2 : - if (i != index*2 and i != index*2+1 ) : listeVal.append(valeur) - elif self.nbValeurs == 3 : - if (i != index*3 and i != index*3+1 and i != index*3 +2) : listeVal.append(valeur) - else : - print "aiiiiiiiiiiiiiiiiiieeee" - i = i+1 + if not (i in indexInterdit) : + listeVal.append(valeur) + i = i+1 self.listeValeursCourantes=listeVal listeValeurs=self.listeValeursCourantes + diff --git a/InterfaceQT4/monFormulePanel.py b/InterfaceQT4/monFormulePanel.py index 570fc669..4a74051a 100644 --- a/InterfaceQT4/monFormulePanel.py +++ b/InterfaceQT4/monFormulePanel.py @@ -46,6 +46,7 @@ class DFormule(Ui_DFormule,QDialog): self.setupUi(self) + # Import des panels class MonFormulePanel(DFormule,QTPanelTBW2): @@ -76,30 +77,24 @@ class MonFormulePanel(DFormule,QTPanelTBW2): self.connect(self.LBNouvCommande,SIGNAL("doubleClicked(QListBoxItem*)"),self.LBNouvCommandeClicked) self.connect(self.LEFiltre,SIGNAL("textChanged(const QString&)"),self.LEFiltreTextChanged) self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) - self.connect(self.bSup,SIGNAL("pressed()"),self.BSupPressed) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommand) + self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommandChanged) + self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommandChanged) self.connect(self.BNext,SIGNAL("clicked()"),self.BNextPressed) self.connect(self.LENomFormule,SIGNAL("returnPressed()"),self.NomFormuleSaisi) self.connect(self.LENomsArgs,SIGNAL("returnPressed()"),self.argsSaisis) self.connect(self.LECorpsFormule,SIGNAL("returnPressed()"),self.FormuleSaisie) - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) - def BSupPressed(self): - QTPanel.BSupPressed(self) def BOkPressed(self): QTPanel.BOkPressed(self) - def ViewDoc(self): - QTPanel.ViewDoc(self) - def BNextPressed(self): QTPanelTBW2.BNextPressed(self) - def BuildTabCommand(self): - QTPanelTBW2.BuildLBNouvCommande(self) + def BuildTabCommandChanged(self): + QTPanelTBW2.BuildLBNouvCommandChanged(self) + def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) diff --git a/InterfaceQT4/monInactifPanel.py b/InterfaceQT4/monInactifPanel.py index bf544724..94cd999f 100644 --- a/InterfaceQT4/monInactifPanel.py +++ b/InterfaceQT4/monInactifPanel.py @@ -29,9 +29,9 @@ class PanelInactif( QTPanel, Ui_DInactif,QDialog ): parent.addWidget(parent.partieDroite) parent.leLayout.widgetActive=self self.setupUi(self) - - self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) + self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) def BSupPressed(self): - QTPanel.BSupPressed(self) + self.editor.init_modif() + self.node.delete() diff --git a/InterfaceQT4/monIncludePanel.py b/InterfaceQT4/monIncludePanel.py index 4d78b8d6..79aa092d 100644 --- a/InterfaceQT4/monIncludePanel.py +++ b/InterfaceQT4/monIncludePanel.py @@ -154,11 +154,9 @@ class MonIncludePanel(DInc,QTPanelTBW1,QTPanelTBW2,QTPanelTBW3): self.connect(self.LBNouvCommande,SIGNAL("doubleClicked(QListBoxItem*)"),self.LBNouvCommandeClicked) self.connect(self.LEFiltre,SIGNAL("textChanged(const QString&)"),self.LEFiltreTextChanged) self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) - self.connect(self.bSup,SIGNAL("pressed()"),self.BSupPressed) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) + self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommandChanged) + self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommandChanged) self.connect(self.BNext,SIGNAL("pressed()"),self.BNextPressed) self.connect(self.BBrowse,SIGNAL("clicked()"),self.BBrowsePressed) try : @@ -167,11 +165,6 @@ class MonIncludePanel(DInc,QTPanelTBW1,QTPanelTBW2,QTPanelTBW3): except : pass - def ViewDoc(self): - QTPanel.ViewDoc(self) - - def BSupPressed(self): - QTPanel.BSupPressed(self) def BOkPressed(self): QTPanel.BOkPressed(self) @@ -179,8 +172,8 @@ class MonIncludePanel(DInc,QTPanelTBW1,QTPanelTBW2,QTPanelTBW3): def BNextPressed(self): QTPanelTBW2.BNextPressed(self) - def BuildTabCommand(self): - QTPanelTBW2.BuildLBNouvCommande(self) + def BuildTabCommandChanged(self): + QTPanelTBW2.BuildLBNouvCommandChanged(self) def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) diff --git a/InterfaceQT4/monMCFactPanel.py b/InterfaceQT4/monMCFactPanel.py index 7f775ff5..c81d0b49 100644 --- a/InterfaceQT4/monMCFactPanel.py +++ b/InterfaceQT4/monMCFactPanel.py @@ -60,16 +60,9 @@ class MonMCFactPanel(DMCFact,QTPanelTBW1): self.connecterSignaux() def connecterSignaux(self): - self.connect(self.bSup,SIGNAL("pressed()"),self.BSupPressed) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) - - def BSupPressed(self): - QTPanel.BSupPressed(self) def BOkPressed(self): QTPanel.BOkPressed(self) - def ViewDoc(self): - QTPanel.ViewDoc(self) diff --git a/InterfaceQT4/monMCListAjoutPanel.py b/InterfaceQT4/monMCListAjoutPanel.py index 5a807680..8be5fd7c 100644 --- a/InterfaceQT4/monMCListAjoutPanel.py +++ b/InterfaceQT4/monMCListAjoutPanel.py @@ -27,6 +27,7 @@ from PyQt4.QtCore import * from qtCommun import QTPanel + class DMCListAjout(Ui_DMCListAjout,QDialog): def __init__(self,parent ,modal ) : QDialog.__init__(self,parent) @@ -61,17 +62,10 @@ class MonMCListAjoutPanel(DMCListAjout,QTPanel): self.connecterSignaux() def connecterSignaux(self): - self.connect(self.bOk,SIGNAL("clicked()"),self.BAjoutClicked) self.connect(self.bAjout,SIGNAL("clicked()"),self.BAjoutClicked) - self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) - def BSupPressed(self): - QTPanel.BSupPressed(self) def BAjoutClicked(self): self.node.treeParent.append_child(self.node.item.get_nom()) - def ViewDoc(self): - QTPanel.ViewDoc(self) diff --git a/InterfaceQT4/monMacroPanel.py b/InterfaceQT4/monMacroPanel.py index 7e6d744a..19f9f871 100644 --- a/InterfaceQT4/monMacroPanel.py +++ b/InterfaceQT4/monMacroPanel.py @@ -32,6 +32,7 @@ from PyQt4.QtCore import * class DMacro(Ui_DComm,QDialog): def __init__(self,parent ,modal ) : + self.appliEficas=parent.appliEficas QDialog.__init__(self,parent) if hasattr(parent,"leLayout"): parent.leLayout.removeWidget(parent.leLayout.widgetActive) @@ -70,19 +71,12 @@ class MonMacroPanel(DMacro,QTPanelTBW1,QTPanelTBW2,QTPanelTBW3): self.connect(self.LBNouvCommande,SIGNAL("doubleClicked(QListBoxItem*)"),self.LBNouvCommandeClicked) self.connect(self.LEFiltre,SIGNAL("textChanged(const QString&)"),self.LEFiltreTextChanged) self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) - self.connect(self.bSup,SIGNAL("pressed()"),self.BSupPressed) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) self.connect(self.LENomConcept,SIGNAL("returnPressed()"),self.LENomConceptReturnPressed) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) + self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommandChanged) + self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommandChanged) self.connect(self.BNext,SIGNAL("pressed()"),self.BNextPressed) - def ViewDoc(self): - QTPanel.ViewDoc(self) - - def BSupPressed(self): - QTPanel.BSupPressed(self) def BOkPressed(self): QTPanel.BOkPressed(self) @@ -90,8 +84,8 @@ class MonMacroPanel(DMacro,QTPanelTBW1,QTPanelTBW2,QTPanelTBW3): def BNextPressed(self): QTPanelTBW2.BNextPressed(self) - def BuildTabCommand(self): - QTPanelTBW2.BuildLBNouvCommande(self) + def BuildTabCommandChanged(self): + QTPanelTBW2.BuildLBNouvCommandChanged(self) def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) diff --git a/InterfaceQT4/monOptionsEditeur.py b/InterfaceQT4/monOptionsEditeur.py index d5542a1a..f1365093 100644 --- a/InterfaceQT4/monOptionsEditeur.py +++ b/InterfaceQT4/monOptionsEditeur.py @@ -34,7 +34,6 @@ class Options(desOptions): self.connect(self.Bok,SIGNAL("clicked()"),self.BokClicked) self.connect(self.LEVersionSup,SIGNAL("returnPressed()"),self.SupVersion) self.connect(self.PBajout,SIGNAL("clicked()"),self.AjoutVersion) - self.connect(self.PBSup,SIGNAL("clicked()"),self.SupVersion) self.connect(self.PBQuit,SIGNAL("clicked()"),self.close) self.connect(self.LERepDoc,SIGNAL("textChanged(const QString&)"),self.ChangePathDoc) @@ -154,7 +153,10 @@ class Options(desOptions): old_fic_ini_util=fic_ini_util+"_old" commande="mv "+fic_ini_util+" "+old_fic_ini_util os.system(commande) - import configuration + import prefs + nameConf='configuration_'+prefs.code + configuration=__import__(nameConf) + configNew=configuration.CONFIG(appli,repIni) self.configuration=configNew appli.CONFIGURATION=configNew diff --git a/InterfaceQT4/monParamPanel.py b/InterfaceQT4/monParamPanel.py index ccc25e7a..1a043712 100644 --- a/InterfaceQT4/monParamPanel.py +++ b/InterfaceQT4/monParamPanel.py @@ -64,11 +64,9 @@ class MonParamPanel(DParam,QTPanelTBW2,QTPanel): self.connect(self.LBNouvCommande,SIGNAL("doubleClicked(QListBoxItem*)"),self.LBNouvCommandeClicked) self.connect(self.LEFiltre,SIGNAL("textChanged(const QString&)"),self.LEFiltreTextChanged) self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) - self.connect(self.bSup,SIGNAL("pressed()"),self.BSupPressed) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) + self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommandChanged) + self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommandChanged) self.connect(self.BNext,SIGNAL("pressed()"),self.BNextPressed) self.connect(self.lineEditVal,SIGNAL("returnPressed()"),self.BOkPressed) @@ -96,12 +94,9 @@ class MonParamPanel(DParam,QTPanelTBW2,QTPanel): self.node.item.set_nom(nom) self.node.item.set_valeur(val) self.node.update_texte() - self.node.update_valid() self.editor.init_modif() self.InitLEs() - def BSupPressed(self): - QTPanel.BSupPressed(self) def LEValeurPressed(self): self.Commentaire.setText(QString("")) @@ -144,8 +139,8 @@ class MonParamPanel(DParam,QTPanelTBW2,QTPanel): commentaire="Les noms de parametre doivent commencer par une lettre ou un souligne" return None,commentaire - def BuildTabCommand(self): - QTPanelTBW2.BuildLBNouvCommande(self) + def BuildTabCommandChanged(self): + QTPanelTBW2.BuildLBNouvCommandChanged(self) def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) @@ -167,6 +162,3 @@ class MonParamPanel(DParam,QTPanelTBW2,QTPanel): def BOkPressed(self): QTPanel.BOkPressed(self) - def ViewDoc(self): - QTPanel.ViewDoc(self) - diff --git a/InterfaceQT4/monPlusieursASSDPanel.py b/InterfaceQT4/monPlusieursASSDPanel.py index 3af461a8..ce5888f7 100644 --- a/InterfaceQT4/monPlusieursASSDPanel.py +++ b/InterfaceQT4/monPlusieursASSDPanel.py @@ -76,8 +76,6 @@ class MonPlusieursASSDPanel(MonPlusieursIntoPanel): self.editor.affiche_infos("Valeur Acceptée") pass - def BSupPressed(self): - QTPanel.BSupPressed(self) def Sup1Valeur(self): indexCourant=self.LBValeurs.currentRow() diff --git a/InterfaceQT4/monPlusieursBasePanel.py b/InterfaceQT4/monPlusieursBasePanel.py index 6dd3588a..da889f1a 100644 --- a/InterfaceQT4/monPlusieursBasePanel.py +++ b/InterfaceQT4/monPlusieursBasePanel.py @@ -66,27 +66,21 @@ class MonPlusieursBasePanel(DPlusBase,QTPanel,SaisieValeur): self.connecterSignaux() def connecterSignaux(self) : - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPourListePressed) - self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) self.connect(self.bParam,SIGNAL("clicked()"),self.BParametresPressed) self.connect(self.bImport,SIGNAL("clicked()"),self.BImportPressed) self.connect(self.BAjout1Val,SIGNAL("clicked()"),self.Ajout1Valeur) self.connect(self.BSup1Val,SIGNAL("clicked()"),self.Sup1Valeur) self.connect(self.LEValeur,SIGNAL("returnPressed()"),self.LEValeurPressed) self.connect(self.BSalome,SIGNAL("clicked()"),self.BSalomePressed) - self.connect(self.BView2D,SIGNAL("clicked()"),self.BView2DPressed) def detruitBouton(self): mc = self.node.item.get_definition() type = mc.type[0] - print self.editor.salome if not(('grma' in repr(type)) or ('grno' in repr(type))) or not(self.editor.salome) : self.BSalome.close() self.BView2D.close() - def ViewDoc(self): - QTPanel.ViewDoc(self) def BuildLBValeurs(self): # redefinit en raison de l heritage par monFonctionPanel @@ -95,13 +89,11 @@ class MonPlusieursBasePanel(DPlusBase,QTPanel,SaisieValeur): def BOkPourListePressed(self): self.editor.init_modif() if self.listeValeursCourantes == [] : - self.editor.affiche_infos("Pas de validation d un groupe vide") + self.editor.affiche_infos("Aucune Valeur") return self.node.item.set_valeur(self.listeValeursCourantes) self.editor.affiche_infos("Valeur Acceptée") - def BSupPressed(self): - QTPanel.BSupPressed(self) def BParametresPressed(self): QTPanel.BParametresPressed(self) @@ -155,6 +147,11 @@ class MonPlusieursBasePanel(DPlusBase,QTPanel,SaisieValeur): self.listeValeursCourantes=l1+listeRetour+l3 self.editor.affiche_infos("Valeurs Ajoutées") + def AjoutNValeur(self,liste) : + for val in liste : + print val + self.Ajout1Valeur(val) + def BImportPressed(self): init=QString( self.editor.CONFIGURATION.savedir) fn = QFileDialog.getOpenFileName(self.node.appliEficas, diff --git a/InterfaceQT4/monPlusieursIntoPanel.py b/InterfaceQT4/monPlusieursIntoPanel.py index af2eaa45..c5b53d19 100644 --- a/InterfaceQT4/monPlusieursIntoPanel.py +++ b/InterfaceQT4/monPlusieursIntoPanel.py @@ -66,9 +66,7 @@ class MonPlusieursIntoPanel(DPlusInto,QTPanel,SaisieValeur): def connecterSignaux(self) : self.connect(self.listBoxVal, SIGNAL("itemDoubleClicked(QListWidgetItem*)" ), self.Ajout1Valeur ) self.connect(self.LBValeurs,SIGNAL("itemDoubleClicked(QListWidgetItem*)"),self.Sup1Valeur) - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPourListePressed) - self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) self.connect(self.BAjout1Val,SIGNAL("clicked()"),self.Ajout1Valeur) self.connect(self.BSup1Val,SIGNAL("clicked()"),self.Sup1Valeur) @@ -80,11 +78,6 @@ class MonPlusieursIntoPanel(DPlusInto,QTPanel,SaisieValeur): self.node.item.set_valeur(self.listeValeursCourantes) self.editor.affiche_infos("Valeur Acceptée") - def BSupPressed(self): - QTPanel.BSupPressed(self) - - def ViewDoc(self): - QTPanel.ViewDoc(self) def Sup1Valeur(self): indexCourant=self.LBValeurs.currentRow() diff --git a/InterfaceQT4/monPoursuitePanel.py b/InterfaceQT4/monPoursuitePanel.py index 2143f273..4623b46e 100644 --- a/InterfaceQT4/monPoursuitePanel.py +++ b/InterfaceQT4/monPoursuitePanel.py @@ -25,6 +25,8 @@ import os,traceback,sys from PyQt4 import * from PyQt4.QtGui import * from PyQt4.QtCore import * +import convert + from monMacroPanel import MonMacroPanel @@ -45,46 +47,106 @@ class MonPoursuitePanel(MonMacroPanel): def ajoutPageOk(self) : self.TabPage = QtGui.QWidget() - self.TabPage.setGeometry(QtCore.QRect(0,0,499,433)) self.TabPage.setObjectName("TabPage") - self.gridLayout_2 = QtGui.QGridLayout(self.TabPage) - self.gridLayout_2.setObjectName("gridLayout_2") self.textLabel1_3 = QtGui.QLabel(self.TabPage) + self.textLabel1_3.setGeometry(QtCore.QRect(9, 9, 481, 19)) self.textLabel1_3.setWordWrap(False) self.textLabel1_3.setObjectName("textLabel1_3") - self.gridLayout_2.addWidget(self.textLabel1_3,0,0,1,1) self.LENomFichier = QtGui.QLineEdit(self.TabPage) - self.LENomFichier.setMinimumSize(QtCore.QSize(470,40)) + self.LENomFichier.setGeometry(QtCore.QRect(9, 33, 481, 40)) + self.LENomFichier.setMinimumSize(QtCore.QSize(470, 40)) self.LENomFichier.setObjectName("LENomFichier") - self.gridLayout_2.addWidget(self.LENomFichier,1,0,1,1) - spacerItem = QtGui.QSpacerItem(21,190,QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Expanding) - self.gridLayout_2.addItem(spacerItem,2,0,1,1) - self.hboxlayout = QtGui.QHBoxLayout() - self.hboxlayout.setObjectName("hboxlayout") - spacerItem1 = QtGui.QSpacerItem(331,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) - self.hboxlayout.addItem(spacerItem1) + self.BFichier = QtGui.QPushButton(self.TabPage) + self.BFichier.setGeometry(QtCore.QRect(330, 170, 140, 50)) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.BFichier.sizePolicy().hasHeightForWidth()) + self.BFichier.setSizePolicy(sizePolicy) + self.BFichier.setMinimumSize(QtCore.QSize(140, 50)) + self.BFichier.setObjectName("BFichier") self.BBrowse = QtGui.QPushButton(self.TabPage) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,QtGui.QSizePolicy.Fixed) + self.BBrowse.setGeometry(QtCore.QRect(330, 110, 140, 50)) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.BBrowse.sizePolicy().hasHeightForWidth()) self.BBrowse.setSizePolicy(sizePolicy) - self.BBrowse.setMinimumSize(QtCore.QSize(140,50)) + self.BBrowse.setMinimumSize(QtCore.QSize(140, 50)) self.BBrowse.setObjectName("BBrowse") - self.hboxlayout.addWidget(self.BBrowse) - self.gridLayout_2.addLayout(self.hboxlayout,3,0,1,1) - spacerItem2 = QtGui.QSpacerItem(21,87,QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Expanding) - self.gridLayout_2.addItem(spacerItem2,4,0,1,1) - self.TWChoix.addTab(self.TabPage,"") - self.textLabel1_3.setText(QtGui.QApplication.translate("DPour", "La commande POURSUITE requiert un nom de Fichier :", None, QtGui.QApplication.UnicodeUTF8)) + self.TWChoix.addTab(self.TabPage, "") + self.gridlayout.addWidget(self.TWChoix, 0, 0, 1, 3) + + self.BFichier.setText(QtGui.QApplication.translate("DPour", "Autre Fichier", None, QtGui.QApplication.UnicodeUTF8)) self.BBrowse.setText(QtGui.QApplication.translate("DPour", "Edit", None, QtGui.QApplication.UnicodeUTF8)) self.TWChoix.setTabText(self.TWChoix.indexOf(self.TabPage), QtGui.QApplication.translate("DPour", "Fichier Poursuite", None, QtGui.QApplication.UnicodeUTF8)) - self.LENomFichier.setText(self.node.item.object.jdc_aux.nom) + if hasattr(self.node.item.object,"fichier_ini"): + self.LENomFichier.setText(self.node.item.object.fichier_ini) + self.connect(self.BBrowse,SIGNAL("clicked()"),self.BBrowsePressed) + self.connect(self.BFichier,SIGNAL("clicked()"),self.BFichierPressed) + self.connect(self.LENomFichier,SIGNAL("returnPressed()"),self.LENomFichReturnPressed) + def BBrowsePressed(self): - self.node.makeEdit() + if hasattr(self.node.item,'object'): + self.node.makeEdit() + + def BFichierPressed(self): + fichier = QFileDialog.getOpenFileName(self.appliEficas, + self.appliEficas.trUtf8('Ouvrir Fichier'), + self.appliEficas.CONFIGURATION.savedir, + self.appliEficas.trUtf8('JDC Files (*.comm);;''All Files (*)')) + if not(fichier.isNull()): + self.LENomFichier.setText(fichier) + self.LENomFichReturnPressed() + + def LENomFichReturnPressed(self): + nomFichier=str(self.LENomFichier.text()) + if not os.path.isfile(nomFichier) : + commentaire = "Fichier introuvable" + self.Commentaire.setText(QString(commentaire)) + self.editor.affiche_infos(commentaire) + return + + text=self.convert_file(nomFichier) + + # Si probleme a la lecture-conversion on arrete le traitement + if not text: + return + + try : + self.node.item.object.change_fichier_init(nomFichier,text) + commentaire = "Fichier modifie : " + self.node.item.get_nom() + self.Commentaire.setText(QString(commentaire)) + except: + l=traceback.format_exception_only("Fichier invalide",sys.exc_info()[1]) + QMessageBox.critical( self, "Erreur fatale au chargement du fichier Include", l[0]) + commentaire = "Fichier invalide" + self.Commentaire.setText(QString(commentaire)) + self.editor.affiche_infos(commentaire) + return + + def convert_file(self,file): + """ + Methode pour convertir le fichier file dans le format courant + """ + try : + format=self.editor.format_fichier + except : + format="python" + text=None + if convert.plugins.has_key(format): + # Le convertisseur existe on l'utilise + p=convert.plugins[format]() + p.readfile(file) + text=p.convert('execnoparseur') + else : + commentaire = "Impossible de lire le fichier : Format inconnu" + self.Commentaire.setText(QString(commentaire)) + self.editor.affiche_infos(commentaire) + return text diff --git a/InterfaceQT4/monRacinePanel.py b/InterfaceQT4/monRacinePanel.py index 2e542999..a614405e 100644 --- a/InterfaceQT4/monRacinePanel.py +++ b/InterfaceQT4/monRacinePanel.py @@ -46,6 +46,7 @@ class DRac(Ui_DRac,QWidget): self.setupUi(self) + # Import des panels class MonRacinePanel(DRac,QTPanelTBW2): @@ -66,27 +67,19 @@ class MonRacinePanel(DRac,QTPanelTBW2): self.connect(self.LBNouvCommande,SIGNAL("doubleClicked(QListBoxItem*)"),self.LBNouvCommandeClicked) self.connect(self.LEFiltre,SIGNAL("textChanged(const QString&)"),self.LEFiltreTextChanged) self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) - self.connect(self.bSup,SIGNAL("pressed()"),self.BSupPressed) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommand) + self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommandChanged) + self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommandChanged) self.connect(self.BNext,SIGNAL("clicked()"),self.BNextPressed) - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) - - def BSupPressed(self): - QTPanel.BSupPressed(self) def BOkPressed(self): self.DefCmd() - def ViewDoc(self): - QTPanel.ViewDoc(self) - def BNextPressed(self): QTPanelTBW2.BNextPressed(self) - def BuildTabCommand(self): - QTPanelTBW2.BuildLBNouvCommande(self) + def BuildTabCommandChanged(self): + QTPanelTBW2.BuildLBNouvCommandChanged(self) def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) diff --git a/InterfaceQT4/monSelectVal.py b/InterfaceQT4/monSelectVal.py index 24e88397..421682a3 100644 --- a/InterfaceQT4/monSelectVal.py +++ b/InterfaceQT4/monSelectVal.py @@ -56,6 +56,7 @@ class MonSelectVal(DSelVal): self.connect(self.BImportTout,SIGNAL("clicked()"),self.BImportToutPressed) def readVal(self): + if self.file == "" : return f = open(self.file, "rb") self.texte = f.read() f.close() @@ -92,6 +93,7 @@ class MonSelectVal(DSelVal): liste1=self.textTraite.split(self.separateur) liste=[] for val in liste1 : + if val != '' and val != ' ' and val != self.separateur : val=str(val) try : val=eval(val,{}) diff --git a/InterfaceQT4/monUniqueASSDPanel.py b/InterfaceQT4/monUniqueASSDPanel.py index 474f62fa..fae8cab9 100644 --- a/InterfaceQT4/monUniqueASSDPanel.py +++ b/InterfaceQT4/monUniqueASSDPanel.py @@ -66,20 +66,13 @@ class MonUniqueASSDPanel(DUnASSD,QTPanel,SaisieValeur): self.connecterSignaux() def connecterSignaux(self) : - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) self.connect(self.listBoxASSD,SIGNAL("itemDoubleClicked(QListWidgetItem*)"),self.ClicASSD) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) def BOkPressed(self): self.ClicASSD() - def BSupPressed(self): - QTPanel.BSupPressed(self) - - def ViewDoc(self): - QTPanel.ViewDoc(self) def InitCommentaire(self): mc = self.node.item.get_definition() diff --git a/InterfaceQT4/monUniqueBasePanel.py b/InterfaceQT4/monUniqueBasePanel.py index b53c79cb..b57e5141 100644 --- a/InterfaceQT4/monUniqueBasePanel.py +++ b/InterfaceQT4/monUniqueBasePanel.py @@ -33,6 +33,7 @@ from politiquesValidation import PolitiqueUnique class DUnBase(Ui_DUnBase,QDialog): def __init__(self,parent ,modal ) : QDialog.__init__(self,parent) + self.appliEficas=parent.appliEficas if hasattr(parent,"leLayout"): parent.leLayout.removeWidget(parent.leLayout.widgetActive) parent.leLayout.widgetActive.close() @@ -66,19 +67,18 @@ class MonUniqueBasePanel(DUnBase,QTPanel,SaisieValeur): self.connecterSignaux() def connecterSignaux(self) : - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) self.connect(self.bOk,SIGNAL("clicked()"),self.BOk2Pressed) - self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) self.connect(self.lineEditVal,SIGNAL("returnPressed()"),self.LEValeurPressed) self.connect(self.bParametres,SIGNAL("pressed()"),self.BParametresPressed) self.connect(self.BSalome,SIGNAL("pressed()"),self.BSalomePressed) self.connect(self.BView2D,SIGNAL("clicked()"),self.BView2DPressed) + self.connect(self.BFichier,SIGNAL("clicked()"),self.BFichierPressed) - def ViewDoc(self): - QTPanel.ViewDoc(self) def detruitBouton(self): mc = self.node.item.get_definition() + if self.node.item.get_nom() != "FileName" : + self.BFichier.close() type = mc.type[0] #if not('grma' in repr(type)) or not(self.editor.salome) : if not(('grma' in repr(type)) or ('grno' in repr(type))) or not(self.editor.salome) : @@ -112,16 +112,22 @@ class MonUniqueBasePanel(DUnBase,QTPanel,SaisieValeur): def BOk2Pressed(self): SaisieValeur.BOk2Pressed(self) - if self.node.item.parent.nom == "FICXML" : + if self.node.item.parent.nom == "MODEL" : self.node.item.parent.change_fichier="1" self.node.item.parent.build_include(None,"") - def BSupPressed(self): - QTPanel.BSupPressed(self) + def BFichierPressed(self): + fichier = QFileDialog.getOpenFileName(self.appliEficas, + self.appliEficas.trUtf8('Ouvrir Fichier'), + self.appliEficas.CONFIGURATION.savedir, + self.appliEficas.trUtf8('Wrapper Files (*.xml);;''All Files (*)')) + if not(fichier.isNull()): + self.lineEditVal.setText(fichier) + def LEValeurPressed(self): SaisieValeur.LEValeurPressed(self) - if self.node.item.parent.nom == "FICXML" : + if self.node.item.parent.nom == "MODEL" : self.node.item.parent.change_fichier="1" self.node.item.parent.build_include(None,"") diff --git a/InterfaceQT4/monUniqueCompPanel.py b/InterfaceQT4/monUniqueCompPanel.py index 22eb994f..481ba3da 100644 --- a/InterfaceQT4/monUniqueCompPanel.py +++ b/InterfaceQT4/monUniqueCompPanel.py @@ -64,9 +64,7 @@ class MonUniqueCompPanel(DUnComp,QTPanel,PolitiqueUnique): self.connecterSignaux() def connecterSignaux(self): - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) self.connect(self.LEImag,SIGNAL("returnPressed()"),self.LEImagRPressed) self.connect(self.LEReel,SIGNAL("returnPressed()"),self.LEReelRPressed) self.connect(self.LEcomp,SIGNAL("returnPressed()"),self.LEcompRPressed) @@ -181,9 +179,3 @@ class MonUniqueCompPanel(DUnComp,QTPanel,PolitiqueUnique): self.Commentaire.setText(QString(commentaire)) - def BSupPressed(self): - QTPanel.BSupPressed(self) - - def ViewDoc(self): - QTPanel.ViewDoc(self) - diff --git a/InterfaceQT4/monUniqueIntoPanel.py b/InterfaceQT4/monUniqueIntoPanel.py index ab634816..017ae9fe 100644 --- a/InterfaceQT4/monUniqueIntoPanel.py +++ b/InterfaceQT4/monUniqueIntoPanel.py @@ -63,9 +63,7 @@ class MonUniqueIntoPanel(DUnIn,QTPanel,SaisieValeur): def connecterSignaux(self) : self.connect(self.listBoxVal, SIGNAL("itemDoubleClicked(QListWidgetItem*)" ), self.ClicValeur ) - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) def ClicValeur(self): SaisieValeur.ClicValeur(self) @@ -74,9 +72,3 @@ class MonUniqueIntoPanel(DUnIn,QTPanel,SaisieValeur): def BOkPressed(self): SaisieValeur.BOkPressed(self) - def BSupPressed(self): - QTPanel.BSupPressed(self) - - def ViewDoc(self): - QTPanel.ViewDoc(self) - diff --git a/InterfaceQT4/monUniqueSDCOIntoPanel.py b/InterfaceQT4/monUniqueSDCOIntoPanel.py index 8c5e45dc..8126f442 100644 --- a/InterfaceQT4/monUniqueSDCOIntoPanel.py +++ b/InterfaceQT4/monUniqueSDCOIntoPanel.py @@ -88,10 +88,3 @@ class MonUniqueSDCOIntoPanel(DUnSDCOInto,QTPanel,SaisieSDCO): def BOkPressed(self): self.LESDCOReturnPressed() - - def BSupPressed(self): - QTPanel.BSupPressed(self) - - def ViewDoc(self): - QTPanel.ViewDoc(self) - diff --git a/InterfaceQT4/monUniqueSDCOPanel.py b/InterfaceQT4/monUniqueSDCOPanel.py index d00b6e04..ee545c61 100644 --- a/InterfaceQT4/monUniqueSDCOPanel.py +++ b/InterfaceQT4/monUniqueSDCOPanel.py @@ -63,18 +63,13 @@ class MonUniqueSDCOPanel(DUnSDCO,QTPanel,SaisieSDCO): self.connecterSignaux() def connecterSignaux(self) : - self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) self.connect(self.LESDCO,SIGNAL("returnPressed()"),self.LESDCOReturnPressed) - def BOkPressed(self): SaisieSDCO.LESDCOReturnPressed(self) - def BSupPressed(self): - QTPanel.BSupPressed(self) def BOuiPressed(self): self.Commentaire.setText("Aucun Objet de ce type n'est defini") @@ -87,6 +82,4 @@ class MonUniqueSDCOPanel(DUnSDCO,QTPanel,SaisieSDCO): """ SaisieSDCO.LESDCOReturnPressed(self) - def ViewDoc(self): - QTPanel.ViewDoc(self) diff --git a/InterfaceQT4/politiquesValidation.py b/InterfaceQT4/politiquesValidation.py index a976f971..062f9a87 100644 --- a/InterfaceQT4/politiquesValidation.py +++ b/InterfaceQT4/politiquesValidation.py @@ -120,8 +120,6 @@ class PolitiquePlusieurs: commentaire="Nouvelle valeur acceptée" commentaire2="" valide=1 - if listevaleur==None: return - if listevaleur=="": return if not( type(listevaleur) in (types.ListType,types.TupleType)) : listevaleur=tuple(listevaleur) for valeur in listevaleur : @@ -158,3 +156,35 @@ class PolitiquePlusieurs: listeRetour.append(valeur) return valide,commentaire,commentaire2,listeRetour + + def AjoutTuple(self,valeurTuple,index,listecourante): + listeRetour=[] + commentaire="Nouvelle valeur acceptée" + commentaire2="" + valide=1 + if valeurTuple==None: return + if valeurTuple==['']: return + # On teste le type de la valeur + valide=self.node.item.valide_item(valeurTuple) + if not valide : + try : + valeur,valide=self.node.item.eval_valeur(valeurTuple) + valide = self.node.item.valide_item(valeur) + except : + pass + if not valide: + commentaire="Valeur "+str(valeurTuple)+ " incorrecte : ajout à la liste refusé" + commentaire2=self.node.item.info_erreur_item() + return valide,commentaire,commentaire2,listeRetour + + # On valide la liste obtenue + encorevalide=self.node.item.valide_liste_partielle(valeurTuple,listecourante) + if not encorevalide : + commentaire2=self.node.item.info_erreur_liste() + # On traite le cas ou la liste n est pas valide pour un pb de cardinalite + min,max = self.node.item.GetMinMax() + if len(listecourante) + 1 >= max : + commentaire="La liste a déjà atteint le nombre maximum d'éléments,ajout refusé" + return valide,commentaire,commentaire2,listeRetour + listeRetour.append(valeurTuple) + return valide,commentaire,commentaire2,listeRetour diff --git a/InterfaceQT4/qtCommun.py b/InterfaceQT4/qtCommun.py index ad7b6df2..5e50d0e4 100644 --- a/InterfaceQT4/qtCommun.py +++ b/InterfaceQT4/qtCommun.py @@ -43,44 +43,10 @@ class QTPanel: self.editor = parent self.node = node - def BSupPressed(self): - self.editor.init_modif() - self.node.delete() - - def ViewDoc(self) : - cle_doc = self.node.item.get_docu() - if cle_doc == None : - QMessageBox.information( self.editor, "Documentation Vide", \ - "Aucune documentation Aster n'est associée à ce noeud") - return - cle_doc = string.replace(cle_doc,'.','') - cle_doc = string.replace(cle_doc,'-','') - commande = self.editor.appliEficas.CONFIGURATION.exec_acrobat - try : - f=open(commande,"rb") - except : - texte="impossible de trouver la commande " + commande - QMessageBox.information( self.editor, "Lecteur PDF", texte) - return - nom_fichier = cle_doc+".pdf" - fichier = os.path.abspath(os.path.join(self.editor.CONFIGURATION.path_doc, - nom_fichier)) - try : - f=open(fichier,"rb") - except : - texte="impossible d'ouvrir " + fichier - QMessageBox.information( self.editor, "Documentation Vide", texte) - return - if os.name == 'nt': - os.spawnv(os.P_NOWAIT,commande,(commande,fichier,)) - elif os.name == 'posix': - script ="#!/usr/bin/sh \n%s %s&" %(commande,fichier) - pid = os.system(script) - def BOkPressed(self): """ Impossible d utiliser les vrais labels avec designer ?? """ label=self.TWChoix.tabText(self.TWChoix.currentIndex()) - #print label + print label if label==QString("Nouvelle Commande"): self.DefCmd() if label==QString("Nommer Concept"): @@ -171,18 +137,33 @@ class QTPanelTBW2(QTPanel): self.node = node self.BuildLBNouvCommande() self.NbRecherches = 0 - if racine == 1 : self.AppelleBuildLBRegles() + if racine == 1 : + self.AppelleBuildLBRegles() + else : + self.connect(self.TWChoix, SIGNAL("currentChanged(QWidget *)"), self.handleCurrentChanged) + + + def handleCurrentChanged(self): + try : + self.LEFiltre.setFocus() + except : + pass def BuildLBNouvCommande(self): self.LBNouvCommande.clear() jdc=self.node.item.object.get_jdc_root() - if self.RBalpha.isChecked(): + if self.editor.mode_nouv_commande == "alpha": + self.RBalpha.setChecked(True) + self.RBGroupe.setChecked(False) listeCmd = jdc.get_liste_cmd() for aCmd in listeCmd: self.LBNouvCommande.addItem( aCmd ) - else : + elif self.editor.mode_nouv_commande== "groupe" : + self.RBGroupe.setChecked(True) + self.RBalpha.setChecked(False) + listeGroupes,dictGroupes=jdc.get_groups() for grp in listeGroupes: if grp == "CACHE":continue @@ -193,12 +174,24 @@ class QTPanelTBW2(QTPanel): for aCmd in listeCmd: self.LBNouvCommande.addItem( aCmd) self.LBNouvCommande.addItem( " " ) + elif self.editor.mode_nouv_commande== "initial" : + listeCmd = self.editor.Commandes_Ordre_Catalogue + listeCmd2=jdc.get_liste_cmd() + if len(listeCmd) != len(listeCmd2): + listeCmd = listeCmd2 + for aCmd in listeCmd: + self.LBNouvCommande.addItem( aCmd ) #QObject.connect( self.LBNouvCommande, SIGNAL("itemClicked(QListWidgetItem*)"),self.DefCmd ) QObject.connect( self.LBNouvCommande, SIGNAL("itemDoubleClicked(QListWidgetItem*)"),self.DefCmd ) + def BuildLBNouvCommandChanged(self) : + if self.RBalpha.isChecked(): + self.editor.mode_nouv_commande="alpha" + else : + self.editor.mode_nouv_commande="groupe" + self.BuildLBNouvCommande() + def DefCmd(self): - if (self.editor.focusWidget())!=self.LBNouvCommande : - return if self.LBNouvCommande.currentItem()== 0 : return if self.LBNouvCommande.currentItem()== None : return name=str(self.LBNouvCommande.currentItem().text()) @@ -283,7 +276,7 @@ class ViewText(Ui_dView,QDialog): self.parent=parent self.setupUi(self) - self.resize( QSize(600,507).expandedTo(self.minimumSizeHint()) ) + self.resize( QSize(600,600).expandedTo(self.minimumSizeHint()) ) self.connect( self.bclose,SIGNAL("clicked()"), self, SLOT("close()") ) self.connect( self.bsave,SIGNAL("clicked()"), self.saveFile ) diff --git a/InterfaceQT4/qtEficas.py b/InterfaceQT4/qtEficas.py index 54921093..5d27974e 100644 --- a/InterfaceQT4/qtEficas.py +++ b/InterfaceQT4/qtEficas.py @@ -10,8 +10,6 @@ from viewManager import MyTabview from Editeur import session -dirCode={"ASTER":"Aster","OPENTURNS_WRAPPER":"Openturns_Wrapper"} - class Appli(Ui_Eficas,QMainWindow): """ @@ -26,20 +24,30 @@ class Appli(Ui_Eficas,QMainWindow): self.salome=salome self.format_fichier="python" #par defaut self.top = self #(pour CONFIGURATION) + self.QWParent=None #(Pour lancement sans IHM) import prefs - self.REPINI=prefs.REPINI - import configuration - self.CONFIGURATION = configuration.make_config(self,prefs.REPINI) - self.CONFIGStyle = configuration.make_config_style(self,prefs.REPINI) - if hasattr(prefs,'encoding'): + if salome : + import sys + prefs.code=code + name='prefs_'+prefs.code + prefsCode=__import__(name) + nameConf='configuration_'+prefs.code + configuration=__import__(nameConf) + + self.REPINI=prefsCode.REPINI + self.RepIcon=prefsCode.INSTALLDIR+"/Editeur/icons" + self.CONFIGURATION = configuration.make_config(self,prefsCode.REPINI) + self.CONFIGStyle = configuration.make_config_style(self,prefsCode.REPINI) + if hasattr(prefsCode,'encoding'): import sys reload(sys) - sys.setdefaultencoding(prefs.encoding) + sys.setdefaultencoding(prefsCode.encoding) QMainWindow.__init__(self) Ui_Eficas.__init__(self) self.setupUi(self) + self.ajoutIcones() self.viewmanager = MyTabview(self) self.recentMenu=self.menuFichier.addMenu(self.trUtf8('&Recents')) self.connecterSignaux() @@ -63,6 +71,21 @@ class Appli(Ui_Eficas,QMainWindow): self.MenuBar.removeItem(6) self.MenuBar.removeItem(7) + def ajoutIcones(self) : + # Pour pallier les soucis de repertoire d icone + icon = QIcon(self.RepIcon+"/New24.png") + self.action_Nouveau.setIcon(icon) + icon1 = QIcon(self.RepIcon+"/Open24.png") + self.action_Ouvrir.setIcon(icon1) + icon2 = QIcon(self.RepIcon+"/Save24.png") + self.actionEnregistrer.setIcon(icon2) + icon3 = QIcon(self.RepIcon+"/Cut24.png") + self.actionCouper.setIcon(icon3) + icon4 = QIcon(self.RepIcon+"/Copy24.png") + self.actionCopier.setIcon(icon4) + icon5 = QIcon(self.RepIcon+"/Paste24.png") + self.actionColler.setIcon(icon5) + def connecterSignaux(self) : self.connect(self.recentMenu,SIGNAL('aboutToShow()'),self.handleShowRecentMenu) @@ -292,12 +315,12 @@ if __name__=='__main__': # Modules Eficas sys.path.append(INSTALLDIR+"/Aster") - from Aster import prefs - if hasattr(prefs,'encoding'): + from Aster import prefsCode + if hasattr(prefsCode,'encoding'): # Hack pour changer le codage par defaut des strings import sys reload(sys) - sys.setdefaultencoding(prefs.encoding) + sys.setdefaultencoding(prefsCode.encoding) del sys.setdefaultencoding # Fin hack diff --git a/InterfaceQT4/qtSaisie.py b/InterfaceQT4/qtSaisie.py index c0fd8a43..be089958 100644 --- a/InterfaceQT4/qtSaisie.py +++ b/InterfaceQT4/qtSaisie.py @@ -109,6 +109,18 @@ class SaisieValeur: self.editor.affiche_infos(commentaire) + def TraiteLEValeurTuple(self) : + listeValeurs=[] + valeurBrute=str(self.LEValeur.text()) + listeValeursSplit=valeurBrute.split(',') + for val in listeValeursSplit : + try : + valeur=eval(val,{}) + except : + valeur=val + listeValeurs.append(valeur) + return listeValeurs + def TraiteLEValeur(self,valeurTraitee=None) : # lit la chaine entree dans le line edit # et la tranforme en chaine de valeurs diff --git a/InterfaceQT4/readercata.py b/InterfaceQT4/readercata.py index 8a2f645c..7c11bbfe 100644 --- a/InterfaceQT4/readercata.py +++ b/InterfaceQT4/readercata.py @@ -35,6 +35,7 @@ from Noyau.N_CR import CR from Editeur.utils import init_rep_cata_dev import analyse_catalogue +import analyse_catalogue_initial import autre_analyse_cata import uiinfo from monChoixCata import MonChoixCata @@ -43,7 +44,7 @@ from PyQt4 import * from PyQt4.QtGui import * from PyQt4.QtCore import * -VERSION_EFICAS="Eficas V1.15" +VERSION_EFICAS="Eficas V1.16" class READERCATA: @@ -52,6 +53,10 @@ class READERCATA: self.appliEficas=self.QWParent.appliEficas self.code=self.QWParent.code self.appliEficas.format_fichier='python' + if hasattr(self.appliEficas,'mode_nouv_commande'): + self.mode_nouv_commande=self.appliEficas.mode_nouv_commande + else : + self.mode_nouv_commande='alpha' self.version_code=self.QWParent.version_code self.version_cata=None self.fic_cata=None @@ -63,7 +68,6 @@ class READERCATA: Ouvre le catalogue standard du code courant, cad le catalogue présent dans le répertoire Cata """ - message1 = "Compilation des fichiers Eficas \n\n Veuillez patienter ..." liste_cata_possibles=[] for catalogue in self.appliEficas.CONFIGURATION.catalogues: @@ -92,7 +96,7 @@ class READERCATA: lab+=QString(" avec le catalogue ") lab+=self.version_code try : - # souci pour les includes + # souci pour les includes et sans Ihm self.appliEficas.setWindowTitle(lab) except : pass @@ -125,6 +129,10 @@ class READERCATA: # remplacé par Retrouve_Ordre_Cata_Standard_autre qui utilise une numerotation # des mots clés a la création self.Retrouve_Ordre_Cata_Standard_autre() + if self.mode_nouv_commande== "initial" : + self.Retrouve_Ordre_Cata_Standard() + else: + self.Commandes_Ordre_Catalogue=[] # # analyse des données liées a  l'IHM : UIinfo @@ -183,52 +191,11 @@ class READERCATA: def Retrouve_Ordre_Cata_Standard(self): """ Retrouve l'ordre des mots-clés dans le catalogue, cad : - - si ce dernier a été modifié, relance l'analyse du catalogue pour déterminer - l'ordre des mots-clés dans le catalogue - - s'il n'a pas été modifié, relie le fichier pickle + Attention s appuie sur les commentaires """ - time1 = os.path.getmtime(self.fic_cata) - try : - time2 = os.path.getmtime(self.fic_cata_p) - except: - time2 = 0 - if time2 > time1 : - # l'objet catalogue n'a pas été modifié depuis le dernier "pickle" - self.Get_Ordre_Cata() - else : - # le catalogue a été modifié depuis le dernier "pickle" : - # il faut retrouver l'ordre du catalogue et refaire pickle - self.Get_Ordre_Cata(mode='cata') - self.appliEficas.affiche_infos("Catalogue standard chargé") - - - def Get_Ordre_Cata(self,mode='pickle'): - """ - Retrouve l'ordre du catalogue : - - mode='pickle ': tente de relire le fichier pickle et sinon lance l'analyse du catalogue - - mode='cata' : force l'analyse du catalogue directement sans relire le pickle - """ - if mode == 'pickle' : - try: - f = open(self.fic_cata_p) - u = cPickle.Unpickler(f) - self.cata_ordonne_dico = u.load() - f.close() - except : - # on peut ne pas arriver a  relire le fichier pickle s'il a été altéré - # ou (le plus probable) s'il a été créé sous un autre OS - self.Get_Ordre_Cata(mode='cata') - elif mode == 'cata': - cata_ordonne = analyse_catalogue.analyse_catalogue(self,self.fic_cata) - self.cata_ordonne_cr = cata_ordonne.cr - self.cata_ordonne_dico = cata_ordonne.entites - f = open(self.fic_cata_p,'w+') - p = cPickle.Pickler(f) - p.dump(self.cata_ordonne_dico) - f.close() - else : - raise Exception("Appel a  un mode inconnu de Get_Ordre_Cata : %s" % mode) - return + nom_cata = os.path.splitext(os.path.basename(self.fic_cata))[0] + rep_cata = os.path.dirname(self.fic_cata) + self.Commandes_Ordre_Catalogue = analyse_catalogue_initial.analyse_catalogue(self.fic_cata) def ask_choix_catalogue(self): """ @@ -246,8 +213,7 @@ class READERCATA: liste_choix = self.dico_catalogues.keys() liste_choix.sort() - lab=QString("Eficas V1.") - lab+=QString(version) + lab=QString(VERSION_EFICAS) lab+=QString(" pour ") lab+=QString(self.code) lab+=QString(" avec le catalogue ") @@ -262,8 +228,7 @@ class READERCATA: widgetChoix=MonChoixCata(liste_choix,self, self.appliEficas, "", True ) ret=widgetChoix.exec_() - lab=QString("Eficas V1.") - lab+=QString(version) + lab=QString(VERSION_EFICAS) lab+=QString(" pour ") lab+=QString(self.code) lab+=QString(" avec le catalogue ") @@ -279,46 +244,6 @@ class READERCATA: sys.exit(0) - def compile_cata(self,cata,catac): - """ - Teste si le catalogue a bien besoin d'etre recompilé et si oui, le compile et - affiche un message dans le splash . Retourne 1 si la compilation s'est bien déroulée, - 0 sinon. - """ - time1 = os.path.getmtime(cata) - try: - time2 = os.path.getmtime(catac) - except: - time2 = 0 - if time1 > time2: - try: - # le catalogue doit etre recompilé avant d'etre importé - if self.QWParent.test == 0 : - splash._splash.configure(text="Compilation du catalogue\nCela peut prendre plusieurs secondes ...") - py_compile.compile(cata) - except: - return 0 - return 1 - - - - def visuCRCATA(self): - """ - Méthode permettant l'affichage du rapport de validation - """ - cr = CR( debut = "Début rapport de validation du catalogue", - fin = "Fin rapport de validation du catalogue") - titre="rapport de validation du catalogue" - if hasattr(self,'cata_ordonne_cr') : - cr.add(self.cata_ordonne_cr) - if hasattr(self,'cata_dev_ordonne_cr') : - cr.add(self.cata_dev_ordonne_cr) - for cata in self.cata: - if hasattr(cata,'JdC'): - cr.add(cata.JdC.report()) - texte_cr = str(cr) - self.visu_texte_cr = Fenetre(self.appliEficas,titre=titre,texte=texte_cr) - def traite_clefs_documentaires(self): try: diff --git a/InterfaceQT4/typeNode.py b/InterfaceQT4/typeNode.py index f3e84ec1..a8443feb 100644 --- a/InterfaceQT4/typeNode.py +++ b/InterfaceQT4/typeNode.py @@ -4,21 +4,11 @@ from PyQt4.QtGui import * from PyQt4.QtCore import * #---------------------------# -class PopUpMenuNodePartiel : +class PopUpMenuNodeMinimal : #---------------------------# def createPopUpMenu(self): self.createActions() - self.menu = QMenu(self.tree) - #ss-menu Comment: - self.commentMenu=self.menu.addMenu('Commentaire') - self.commentMenu.addAction(self.CommApres) - self.commentMenu.addAction(self.CommAvant) - #ss-menu Parameters: - self.paramMenu =self.menu.addMenu('Parametre') - self.paramMenu.addAction(self.ParamApres) - self.paramMenu.addAction(self.ParamAvant) - #items du menu self.menu.addAction(self.Supprime) @@ -40,11 +30,46 @@ class PopUpMenuNodePartiel : self.Supprime = QAction('Supprimer',self.tree) self.tree.connect(self.Supprime,SIGNAL("activated()"),self.supprimeNoeud) self.Supprime.setStatusTip("supprime le mot clef ") + self.Documentation = QAction('Documentation',self.tree) + self.tree.connect(self.Documentation,SIGNAL("activated()"),self.viewDoc) + self.Documentation.setStatusTip("documentation sur la commande ") def supprimeNoeud(self): item= self.tree.currentItem() item.delete() + def viewDoc(self): + self.node=self.tree.currentItem() + cle_doc = self.node.item.get_docu() + if cle_doc == None : + QMessageBox.information( self.editor, "Documentation Vide", \ + "Aucune documentation Aster n'est associée à ce noeud") + return + #cle_doc = string.replace(cle_doc,'.','') + #cle_doc = string.replace(cle_doc,'-','') + #print dir(self) + commande = self.editor.appliEficas.CONFIGURATION.exec_acrobat + try : + f=open(commande,"rb") + except : + texte="impossible de trouver la commande " + commande + QMessageBox.information( self.editor, "Lecteur PDF", texte) + return + nom_fichier = cle_doc+".pdf" + fichier = os.path.abspath(os.path.join(self.editor.CONFIGURATION.path_doc, + nom_fichier)) + try : + f=open(fichier,"rb") + except : + texte="impossible d'ouvrir " + fichier + QMessageBox.information( self.editor, "Documentation Vide", texte) + return + if os.name == 'nt': + os.spawnv(os.P_NOWAIT,commande,(commande,fichier,)) + elif os.name == 'posix': + script ="#!/usr/bin/sh \n%s %s&" %(commande,fichier) + pid = os.system(script) + def addParametersApres(self): item= self.tree.currentItem() item.addParameters(True) @@ -61,6 +86,22 @@ class PopUpMenuNodePartiel : item= self.tree.currentItem() item.addComment(False) +#--------------------------------------------# +class PopUpMenuNodePartiel (PopUpMenuNodeMinimal): +#---------------------------------------------# + def createPopUpMenu(self): + PopUpMenuNodeMinimal.createPopUpMenu(self) + #ss-menu Comment: + self.commentMenu=self.menu.addMenu('Commentaire') + self.commentMenu.addAction(self.CommApres) + self.commentMenu.addAction(self.CommAvant) + #ss-menu Parameters: + self.paramMenu =self.menu.addMenu('Parametre') + self.paramMenu.addAction(self.ParamApres) + self.paramMenu.addAction(self.ParamAvant) + self.menu.addAction(self.Documentation) + + #-----------------------------------------# class PopUpMenuNode(PopUpMenuNodePartiel) : #-----------------------------------------# diff --git a/InterfaceQT4/viewManager.py b/InterfaceQT4/viewManager.py index 12a9f825..67e4c75e 100644 --- a/InterfaceQT4/viewManager.py +++ b/InterfaceQT4/viewManager.py @@ -73,32 +73,32 @@ class MyTabview: def handleCloseAll(self): self.appliEficas.sauveRecents() - print "passage dans CloseAll" + #print "passage dans CloseAll" print "self.dict_editors", self.dict_editors while len(self.dict_editors) > 0 : self.myQtab.setCurrentIndex(0) self.handleClose(0) def handleEditCopy(self): - print "passage dans handleEditCopy" + #print "passage dans handleEditCopy" index=self.myQtab.currentIndex() editor=self.dict_editors[index] editor.handleEditCopy() def handleEditCut(self): - print "passage dans handleEditCut" + #print "passage dans handleEditCut" index=self.myQtab.currentIndex() editor=self.dict_editors[index] editor.handleEditCut() def handleEditPaste(self): - print "passage dans handleEditPaste" + #print "passage dans handleEditPaste" index=self.myQtab.currentIndex() editor=self.dict_editors[index] editor.handleEditPaste() def newEditor(self,include=0): - print "passage dans newEditor" + #print "passage dans newEditor" maPage=self.getEditor() def newIncludeEditor(self): diff --git a/InterfaceTK/appli.py b/InterfaceTK/appli.py index f08b160d..668f0048 100644 --- a/InterfaceTK/appli.py +++ b/InterfaceTK/appli.py @@ -55,7 +55,7 @@ import listePatronsTK REPTK=os.path.dirname(os.path.abspath(__file__)) sys.path[:0]=[REPTK] -VERSION="EFICAS v1.15" +VERSION="EFICAS v1.16" class APPLI: def __init__ (self,master,code=prefs.code,fichier=None,test=0,ihm="TK",salome=0) : diff --git a/InterfaceTK/bureau.py b/InterfaceTK/bureau.py index 59b0ab86..2c2d6680 100644 --- a/InterfaceTK/bureau.py +++ b/InterfaceTK/bureau.py @@ -461,6 +461,7 @@ class BUREAU: jdc_formate=g.gener(self.JDC,format='beautifie') if format == 'homard': self.jdc_homard=g.get_homard() + #print "hhhhhhhh" elif format == 'openturns' : self.jdc_openturn_xml=g.getOpenturnsXML() self.jdc_openturn_std=g.getOpenturnsSTD() @@ -664,11 +665,11 @@ class BUREAU: try: cle_doc = self.JDCDisplay_courant.node_selected.item.get_docu() if cle_doc == None : return - cle_doc = string.replace(cle_doc,'.','') - cle_doc = string.replace(cle_doc,'-','') commande = self.appli.CONFIGURATION.exec_acrobat - nom_fichier = cle_doc+".pdf" - fichier = os.path.abspath(os.path.join(self.appli.CONFIGURATION.path_doc,nom_fichier)) + fichier = os.path.abspath(os.path.join(self.appli.CONFIGURATION.path_doc,cle_doc)) + if os.path.isfile(fichier) == 0: + showerror("Pas de Documentation", "Eficas ne trouve pas de fichier documentation associe a cette commande") + return if os.name == 'nt': os.spawnv(os.P_NOWAIT,commande,(commande,fichier,)) elif os.name == 'posix': @@ -794,14 +795,17 @@ class BUREAU: if (FichieraTraduire == "" or FichieraTraduire == () ) : return i=FichieraTraduire.rfind(".") Feuille=FichieraTraduire[0:i] - FichierTraduit=Feuille+"v8.comm" log=self.savedir+"/convert.log" - os.system("rm -rf "+log) - os.system("rm -rf "+FichierTraduit) Pmw.showbusycursor() + FichierTraduit="" + os.system("rm -rf "+log) if version == 7 : + FichierTraduit=Feuille+"v8.comm" + os.system("rm -rf "+FichierTraduit) traduitV7V8.traduc(FichieraTraduire,FichierTraduit,log) else : + FichierTraduit=Feuille+"v9.comm" + os.system("rm -rf "+FichierTraduit) traduitV8V9.traduc(FichieraTraduire,FichierTraduit,log) Pmw.hidebusycursor() Entete="Fichier Traduit : "+FichierTraduit +"\n\n" @@ -816,7 +820,7 @@ class BUREAU: commande="diff "+FichieraTraduire+" "+FichierTraduit+" >/dev/null" try : if os.system(commande) == 0 : - texte_cr = texte_cr + "Pas de difference entre le fichier V7 et le fichier traduit" + texte_cr = texte_cr + "Pas de difference entre le fichier initial et le fichier traduit" except : pass diff --git a/InterfaceTK/panels.py b/InterfaceTK/panels.py index b84a5697..d1f72491 100644 --- a/InterfaceTK/panels.py +++ b/InterfaceTK/panels.py @@ -26,7 +26,7 @@ import time import traceback import widgets -from widgets import ListeChoix +from widgets import ListeChoix, showerror from widgets import ListeChoixParGroupes import prefs import options @@ -184,12 +184,15 @@ class Panel(Frame) : - indication du chemin d'accès aux fichiers pdf à revoir : trop statique""" cle_doc = self.node.item.get_docu() if cle_doc == None : return - cle_doc = string.replace(cle_doc,'.','') - cle_doc = string.replace(cle_doc,'-','') + #cle_doc = string.replace(cle_doc,'.','') + #cle_doc = string.replace(cle_doc,'-','') commande = self.parent.appli.CONFIGURATION.exec_acrobat - nom_fichier = cle_doc+".pdf" + nom_fichier = cle_doc fichier = os.path.abspath(os.path.join(self.parent.appli.CONFIGURATION.path_doc, nom_fichier)) + if os.path.isfile(fichier) == 0: + showerror("Pas de Documentation", "Eficas ne trouve pas de fichier documentation associe a cette commande") + return if os.name == 'nt': os.spawnv(os.P_NOWAIT,commande,(commande,fichier,)) elif os.name == 'posix': diff --git a/InterfaceTK/styles.py b/InterfaceTK/styles.py index 2d5fc4a2..8febcbb9 100644 --- a/InterfaceTK/styles.py +++ b/InterfaceTK/styles.py @@ -8,7 +8,7 @@ inistylefile=os.path.join(prefs.REPINI,"style.py") if os.path.isfile(inistylefile): execfile(inistylefile) -userstylefile=os.path.expanduser("~/Eficas_install/style.py") +userstylefile=os.path.expanduser("~/.Eficas_install/style.py") if os.path.isfile(userstylefile): execfile(userstylefile) diff --git a/InterfaceTK/widgets.py b/InterfaceTK/widgets.py index e978db2a..13a6f92e 100644 --- a/InterfaceTK/widgets.py +++ b/InterfaceTK/widgets.py @@ -33,7 +33,7 @@ from tkFileDialog import * from tkMessageBox import showinfo,askyesno,showerror,askretrycancel import fontes -import prefs + from Editeur.utils import save_in_file from centerwindow import centerwindow @@ -707,7 +707,6 @@ class Formulaire: self.resultat = apply(self.command[1],(),{}) self.fenetre.destroy() else : - print "Nom de bouton inconnu" self.quit() def fini(self): diff --git a/Minicode/cata_saturne.py b/Minicode/cata_saturne.py index afddca07..0bd093ab 100755 --- a/Minicode/cata_saturne.py +++ b/Minicode/cata_saturne.py @@ -3,6 +3,7 @@ import Accas from Accas import * +import types #CONTEXT.debug=1 @@ -1753,3 +1754,38 @@ RETOUR=PROC(nom="RETOUR",op= -2,docu="U4.13.02-e", fr="Retour au fichier de commandes appelant", ) ; +class LongStr: + def __init__(self,min,max): + self.min=min + self.max=max + def __convert__(self,valeur): + if type(valeur) == types.StringType: + if self.min <= len(valeur) <= self.max: + return valeur + return None + def info(self): + return "Chaine de longueur comprise entre %s et %s" % (self.min,self.max) + __repr__=info + __str__=info + +class Tuple: + def __init__(self,ntuple): + self.ntuple=ntuple + + def __convert__(self,valeur): + if type(valeur) == types.StringType: + return None + if len(valeur) != self.ntuple: + return None + return valeur + + def info(self): + return "Tuple de %s elements" % self.ntuple + __repr__=info + __str__=info + +CCAR=PROC(nom="CCAR",op=15,MCS=SIMP(typ=Tuple(3),statut='o',min=1,max=5), + MCS1=SIMP(typ=(Tuple(2),LongStr(3,8)),statut='o',min=3,max=8), + MCS2=SIMP(typ=Tuple(2),statut='o',min=3,max=8), + MCS3=SIMP(typ='R',statut='o',min=3,max=8), + ) diff --git a/Minicode/configuration.py b/Minicode/configuration.py new file mode 100644 index 00000000..c885f3e7 --- /dev/null +++ b/Minicode/configuration.py @@ -0,0 +1,366 @@ +# -*- 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 sert pour charger les paramètres de configuration d'EFICAS +""" +# Modules Python +import os, sys, string, types, re +import traceback + +# Modules Eficas +from Editeur import utils + +class CONFIGbase: + + #----------------------------------- + def __init__(self,appli): + #----------------------------------- + + # Classe de base permettant de lire, afficher + # et sauvegarder les fichiers utilisateurs editeur.ini + # et style.py + # Classe Mere de : class CONFIG(CONFIGbase) + # class CONFIGStyle(CONFIGbase): + self.appli = appli + self.salome = appli.salome + self.dRepMat={} + if self.appli: + self.parent=appli.top + else: + self.parent=None + self.rep_user = utils.get_rep_user() + self.lecture_fichier_ini_standard() + self.lecture_catalogues_standard() + self.lecture_fichier_ini_utilisateur() + self.init_liste_param() + + #-------------------------------------- + def lecture_fichier_ini_standard(self): + #-------------------------------------- + # Verifie l'existence du fichier "standard" + # appelle la lecture de ce fichier + if not os.path.isfile(self.fic_ini): + if self.appli.ihm=="TK" : + from widgets import showerror + showerror("Erreur","Pas de fichier de configuration" + self.fic_ini+"\n") + print "Erreur à la lecture du fichier de configuration : %s" % self.fic_ini + sys.exit(0) + self.lecture_fichier(self.fic_ini) + + #----------------------------- + def lecture_fichier(self,fic): + #------------------------------ + # lit les paramètres du fichier eficas.ini ou style.py + # les transforme en attribut de l 'objet + # utilisation du dictionnaire local pour récuperer style + txt = utils.read_file(fic) + from styles import style + d=locals() + try: + exec txt in d + except: + l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2]) + if self.appli.ihm=="TK" : + from widgets import showerror + showerror("Erreur","Une erreur s'est produite lors de la lecture du fichier : " + fic + "\n") + print "Erreur à la lecture du fichier de configuration : %s" % fic + sys.exit() + + for k in d.keys() : + if k in self.labels.keys() : + setattr(self,k,d[k]) + # Glut horrible pour les repertoires materiau... + elif k[0:9]=="rep_mat_v" : + setattr(self,k,d[k]) + + for k in d['style'].__dict__.keys() : + setattr(self,k,d['style'].__dict__[k]) + + if hasattr(self,"catalogues") : + for ligne in self.catalogues : + version=ligne[1] + codeSansPoint=re.sub("\.","",version) + chaine="rep_mat_"+codeSansPoint + if hasattr(self,chaine): + rep_mat=getattr(self,chaine) + self.dRepMat[version]=str(rep_mat) + + + #-------------------------------------- + def lecture_fichier_ini_utilisateur(self): + #-------------------------------------- + # Surcharge les paramètres standards par les paramètres utilisateur s'ils existent + self.fic_ini_utilisateur = os.path.join(self.rep_user,self.fichier) + if not os.path.isfile(self.fic_ini_utilisateur): + return + self.lecture_fichier(self.fic_ini_utilisateur) + + #-------------------------------------- + def lecture_catalogues_standard(self): + #-------------------------------------- + # repertoires Materiau + if hasattr(self,"catalogues") : + for ligne in self.catalogues : + version=ligne[1] + cata=ligne[2] + self.dRepMat[version]=os.path.join(cata,'materiau') + + #-------------------------------------- + def affichage_fichier_ini(self): + #-------------------------------------- + """ + Affichage des valeurs des paramètres relus par Eficas + """ + import widgets + result = widgets.Formulaire(self.parent, + obj_pere = self, + titre = self.titre, + texte = self.texte_ini, + items = self.l_param, + mode='display', + commande=('Modifier',self.commande)) + if result.resultat : + #print 'on sauvegarde les nouveaux paramètres :',result.resultat + self.save_param_ini(result.resultat) + + #-------------------------------------- + def save_param_ini(self,dico): + #-------------------------------------- + # sauvegarde + # les nouveaux paramètres dans le fichier de configuration utilisateur + # + f=open(self.fic_ini_utilisateur,'w+') + for k,v in dico.items(): + if self.types[k] in ('mot2','mot3','mot4'): + v1=v[1:-1] + val=v1.split(",") + p = "(" + listeval="" + for valeur in val: + listeval = listeval+ p + str(valeur) + p=" , " + listeval = listeval + ")" + f.write(str(self.pref)+str(k) + '=' + str(listeval) + '\n') + elif k == 'catalogues' : + f.write(k + '\t=\t' + str(v) + '\n') + else: + f.write(str(self.pref)+str(k) + '\t=\t"' + str(v) + '"\n') + f.close() + self.lecture_fichier_ini_utilisateur() + + #------------------------------------------- + def creation_fichier_ini_si_possible(self): + #------------------------------------------- + return self.creation_fichier_ini(mode='ignorer_annuler') + + #-------------------------------------------------------- + def creation_fichier_ini(self,mode='considerer_annuler'): + #--------------------------------------------------------- + # Récupération des valeurs des paramétres requis pour la création du fichier + # eficas.ini + # + import widgets + items = self.l_param + result = widgets.Formulaire(self.parent, + obj_pere = self, + titre = "Saisie des données indispensables à la configuration d'EFICAS", + texte = self.texte, + items = items, + mode='query') + if not result.resultat : + if mode == 'considerer_annuler': + test=0 + if self.appli.ihm=="TK" : + from widgets import showerror,askretrycancel + test = askretrycancel("Erreur","Données incorrectes !") + if not test: + # XXX On sort d'EFICAS, je suppose + self.appli.exitEFICAS() + else: + self.creation_fichier_ini() + else: + return None + else : + self.save_param_ini(result.resultat) + return result.resultat + + #-------------------------- + def init_liste_param (self): + #-------------------------- + # construit self.l_param + # a partir de self.labels et des attributs + # de l objet (mis a jour lors de la lecture du fichier) + # l_param est une liste de tuples où chaque tuple est de la forme : + # (label,nature,nom_var,defaut) + + self.l_param=[] + for k in self.labels.keys() : + if hasattr(self,k) : + if k in self.YesNo.keys(): + self.l_param.append((self.labels[k],self.types[k],k,self.__dict__[k], + self.YesNo[k][0],self.YesNo[k][1])) + else : + self.l_param.append((self.labels[k],self.types[k],k,self.__dict__[k])) + self.l_param = tuple(self.l_param) + + +class CONFIG(CONFIGbase): + def __init__(self,appli,rep_ini): + + self.dFichierEditeur={"MINICODE" : "editeur.ini", } + self.texte = "EFICAS a besoin de certains renseignements pour se configurer\n"+\ + "Veuillez remplir TOUS les champs ci-dessous et appuyer sur 'Valider'\n"+\ + "Si vous annulez, EFICAS ne se lancera pas !!" + + self.salome=appli.salome + self.code=appli.code + clef=self.code + if self.salome != 0 : + clef = clef + "_SALOME" + self.fichier=self.dFichierEditeur[clef] + self.rep_ini = rep_ini + self.fic_ini = os.path.join(self.rep_ini,self.fichier) + self.titre = "Paramètres nécessaires à la configuration d'EFICAS" + self.texte_ini = "Voici les paramètres que requiert Eficas" + self.commande = self.creation_fichier_ini_si_possible + self.labels={"savedir" : "Répertoire initial pour Open/Save des fichiers", + "rep_travail" : "Répertoire de travail", + "rep_mat" : "Répertoire materiaux", + "path_doc" : "Chemin d'accès à la doc Aster", + "exec_acrobat" : "Ligne de commande Acrobat Reader", + "catalogues" : "Versions du code ", + "isdeveloppeur" : "Niveau de message ", + "path_cata_dev" : "Chemin d'accès aux catalogues développeurs"} + + + self.types ={"savedir":"rep", "rep_travail":"rep","rep_mat":"rep", + "path_doc": "rep","exec_acrobat":"file","exec_acrobat":"file", + "catalogues" :"cata","isdeveloppeur":"YesNo","path_cata_dev":"rep", + "DTDDirectory":"rep"} + + self.YesNo={} + self.YesNo['isdeveloppeur']=('Deboggage','Utilisation') + + # Valeurs par defaut + self.rep_user = utils.get_rep_user() + self.initialdir=self.rep_user + self.savedir = self.initialdir + self.rep_travail=os.path.join(self.rep_user,'uaster','tmp_eficas') + self.rep_mat="" + self.path_doc=self.rep_user + self.exec_acrobat=self.rep_user + self.catalogues= os.path.join(self.rep_ini,'..','Cata/cata.py') + self.isdeveloppeur='NON' + self.path_cata_dev=os.path.join(self.rep_user,'cata') + CONFIGbase.__init__ (self,appli) + self.pref="" + + #-------------------------------------- + def save_params(self): + #-------------------------------------- + # sauvegarde + # les nouveaux paramètres dans le fichier de configuration utilisateur + # + l_param=('exec_acrobat', 'rep_ini','catalogues','rep_travail','rep_mat','path_doc','savedir') + texte="" + for clef in l_param : + if hasattr(self,clef): + valeur=getattr(self,clef) + texte= texte + clef+" = " + repr(valeur) +"\n" + + + # recuperation des repertoires materiaux + try : + for item in self.catalogues : + try : + (code,version,cata,format,defaut)=item + except : + (code,version,cata,format)=item + codeSansPoint=re.sub("\.","",version) + chaine="rep_mat_"+codeSansPoint + if hasattr(self,chaine): + valeur=getattr(self,chaine) + texte= texte + chaine+" = '" + str(valeur) +"'\n" + except : + pass + + f=open(self.fic_ini_utilisateur,'w+') + f.write(texte) + f.close() + + +class CONFIGStyle(CONFIGbase): + def __init__(self,appli,rep_ini): + self.salome=appli.salome + self.texte = "Pour prendre en compte les modifications \n"+\ + " RELANCER EFICAS" + self.fichier="style.py" + self.rep_ini = rep_ini + self.fic_ini = os.path.join(self.rep_ini,self.fichier) + self.titre = "Paramètres d affichage" + self.texte_ini = "Voici les paramètres configurables : " + self.commande = self.creation_fichier_ini_si_possible + self.labels={"background":"couleur du fonds", + "foreground":"couleur de la police standard" , + "standard":" police et taille standard", + "standard_italique":"police utilisée pour l'arbre ", + "standard_gras_souligne":"police utilisée pour le gras souligné", + "canvas_italique":"police italique", + "standard_gras":"gras", + #"canvas":"police", + #"canvas_gras":"police gras", + #"canvas_gras_italique":"police gras italique", + #"standard12":"police 12", + #"standard12_gras":"police 12 gras", + #"standard12_gras_italique":"police 12 gras italique", + #"standardcourier10":"courrier " + "statusfont":"police utilisée dans la status Bar", + } + self.types ={"background":"mot", + "foreground":"mot" , + "standard":"mot2", + "standard_italique":"mot3", + "standard_gras":"mot3", + "standard_gras_souligne":"mot4", + "canvas":"mot2", + "canvas_italique":"mot3", + "canvas_gras":"mot3", + "canvas_gras_italique":"mot4", + "standard12":"mot2", + "standard12_gras":"mot3", + "standard12_gras_italique":"mot4", + "statusfont":"mot2", + "standardcourier10":"mot2"} + self.YesNo={} + self.l_param=[] + CONFIGbase.__init__ (self,appli) + self.pref="style." + + def affichage_style_ini(self): + self.affichage_fichier_ini() + +def make_config(appli,rep): + return CONFIG(appli,rep) + +def make_config_style(appli,rep): + return CONFIGStyle(appli,rep) + + diff --git a/Minicode/eficas_mini.py b/Minicode/eficas_mini.py index 41789389..aa40ebe1 100755 --- a/Minicode/eficas_mini.py +++ b/Minicode/eficas_mini.py @@ -4,30 +4,16 @@ Ce module sert à lancer EFICAS configuré pour Code_Mini """ # Modules Python -import sys,os # Modules Eficas import prefs -sys.path[:0]=[prefs.INSTALLDIR] - -args=sys.argv[1:] -for a in args: - if a == "-display": - os.environ['DISPLAY']=args[args.index("-display")+1] - -import Misc.Trace -import Editeur -from Editeur import eficas_go +#import Misc.Trace +from InterfaceTK import eficas_go def main(): #Misc.Trace.begin_trace() - if len(sys.argv) > 1 : - # on veut ouvrir un fichier directement au lancement d'Eficas - eficas_go.lance_eficas(code='MINICODE',fichier = sys.argv[1]) - else: - # on veut ouvrir Eficas 'vide' - eficas_go.lance_eficas(code='MINICODE') - Misc.Trace.end_trace() + eficas_go.lance_eficas(code=prefs.code) + #Misc.Trace.end_trace() def hidez(): from Misc import Cyclops diff --git a/Minicode/prefs.py b/Minicode/prefs.py index 3d28234a..7349c667 100644 --- a/Minicode/prefs.py +++ b/Minicode/prefs.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -import os +import os,sys # REPINI sert à localiser le fichier editeur.ini # Obligatoire @@ -9,9 +9,6 @@ REPINI=os.path.dirname(os.path.abspath(__file__)) # Obligatoire INSTALLDIR=os.path.join(REPINI,'..') -# la variable code donne le nom du code a selectionner -code="MINICODE" - # CODE_PATH sert à localiser Noyau et Validation éventuellement # non contenus dans la distribution EFICAS # Par défaut on utilise les modules de INSTALLDIR @@ -20,11 +17,17 @@ CODE_PATH = None #CODE_PATH = os.path.join(REPINI,'../../Superv') #CODE_PATH = "/home01/chris/projet_Eficas/Devel/SUPER6_3/Aster6_3/bibpyt" -# ICONDIR sert à localiser le répertoire contenant les icones -# Par défaut on utilise le répertoire icons dans Editeur -ICONDIR=os.path.join(INSTALLDIR,'Editeur','icons') +# la variable code donne le nom du code a selectionner +code="MINICODE" # lang indique la langue utilisée pour les chaines d'aide : fr ou ang lang='fr' +# Codage des strings qui accepte les accents (en remplacement de 'ascii') +encoding='iso-8859-1' + +sys.path[:0]=[INSTALLDIR] +# ICONDIR sert à localiser le répertoire contenant les icones +# Par défaut on utilise le répertoire icons dans Editeur +ICONDIR=os.path.join(INSTALLDIR,'Editeur','icons') diff --git a/Noyau/N_VALIDATOR.py b/Noyau/N_VALIDATOR.py index 61a79a4c..21fa1f26 100644 --- a/Noyau/N_VALIDATOR.py +++ b/Noyau/N_VALIDATOR.py @@ -1213,3 +1213,59 @@ class InstanceVal(ListVal): if not isinstance(valeur,self.aClass): return 0 return 1 +class VerifTypeTuple(Valid,ListVal) : + def __init__(self,typeDesTuples): + self.typeDesTuples=typeDesTuples + Valid.__init__(self) + self.cata_info="" + + def info(self): + return ": verifie les types dans un tuple" + + def info_erreur_liste(self): + return "Les types entres ne sont pas permis" + + def default(self,valeur): + #if valeur in self.liste : raise ValError("%s est un doublon" % valeur) + return valeur + + def is_list(self) : + return 1 + + def convert_item(self,valeur): + if len(valeur) != len(self.typeDesTuples): + raise ValError("%s devrait etre de type %s " %(valeur,self.typeDesTuples)) + for i in range(len(valeur)) : + ok=self.verifType(valeur[i],self.typeDesTuples[i]) + if ok!=1 : + raise ValError("%s devrait etre de type %s " %(valeur,self.typeDesTuples)) + return valeur + + def verif_item(self,valeur): + try : + if len(valeur) != len(self.typeDesTuples): return 0 + for i in range(len(valeur)) : + ok=self.verifType(valeur[i],self.typeDesTuples[i]) + if ok!=1 : return 0 + except : + return 0 + return 1 + + def verifType(self,valeur,type_permis): + if type_permis == 'R': + if type(valeur) in (types.IntType,types.FloatType,types.LongType):return 1 + elif type_permis == 'I': + if type(valeur) in (types.IntType,types.LongType):return 1 + elif type_permis == 'C': + if self.is_complexe(valeur):return 1 + elif type_permis == 'TXM': + if type(valeur)==types.StringType:return 1 + return 0 + + def verif(self,valeur): + if type(valeur) in (types.ListType,types.TupleType): + liste=list(valeur) + for val in liste: + if self.verif_item(val)!=1 : return 0 + return 1 + diff --git a/Openturns_Study/OpenTURNS_Cata_Study_V4.py b/Openturns_Study/OpenTURNS_Cata_Study_V4.py new file mode 100644 index 00000000..05fdd221 --- /dev/null +++ b/Openturns_Study/OpenTURNS_Cata_Study_V4.py @@ -0,0 +1,1630 @@ +# -*- coding: utf-8 -*- + +# -------------------------------------------------- +# debut entete +# -------------------------------------------------- + +# Les commentaires du style # Ordre Catalogue MOTCLEF sont utilises pour +# retrouver l ordre du catalogue + + +#from Accas import ASSD, JDC_CATA, AU_MOINS_UN, PROC, SIMP, FACT, OPER, MACRO, BLOC, A_VALIDATOR +from Accas import * + +class loi ( ASSD ) : pass +class variable ( ASSD ) : pass + +import types +class Tuple: + def __init__(self,ntuple): + self.ntuple=ntuple + + def __convert__(self,valeur): + if type(valeur) == types.StringType: + return None + if len(valeur) != self.ntuple: + return None + return valeur + + def info(self): + return "Tuple de %s elements" % self.ntuple + + __repr__=info + __str__=info + + +#CONTEXT.debug = 1 +JdC = JDC_CATA ( code = 'OPENTURNS_STUDY', + execmodul = None, + regles = ( AU_MOINS_UN ( 'CRITERIA' ), AU_MOINS_UN ( 'MODEL' ), + A_CLASSER(('LOG','DETERMINISTICVARIABLE'),'VARIABLE'),) + ) # Fin JDC_CATA + +# -------------------------------------------------- +# fin entete +# -------------------------------------------------- + +LOG = PROC ( nom = "LOG", + op = None, + docu = "", + + DebugMessages = SIMP ( statut = "o", + typ = "TXM", + into = ( 'yes', 'no' ), + defaut = 'no', + fr = "Affichage du niveau de debug de la bibliotheque Open TURNS", + ang = "Open TURNS library debug level print", + ), + + WrapperMessages = SIMP ( statut = "o", + typ = "TXM", + into = ( 'yes', 'no' ), + defaut = 'no', + fr = "Affichage du niveau de wrapper de la bibliotheque Open TURNS", + ang = "Open TURNS library debug level print", + ), + + UserMessages = SIMP ( statut = "o", + typ = "TXM", + into = ( 'yes', 'no' ), + defaut = 'no', + fr = "Affichage du niveau de user de la bibliotheque Open TURNS", + ang = "Open TURNS library user level print", + ), + + InfoMessages = SIMP ( statut = "o", + typ = "TXM", + into = ( 'yes', 'no' ), + defaut = 'yes', + fr = "Affichage du niveau de info de la bibliotheque Open TURNS", + ang = "Open TURNS library info level print", + ), + + WarningMessages = SIMP ( statut = "o", + typ = "TXM", + into = ( 'yes', 'no' ), + defaut = 'yes', + fr = "Affichage du niveau de warning de la bibliotheque Open TURNS", + ang = "Open TURNS library warning level print", + ), + + ErrorMessages = SIMP ( statut = "o", + typ = "TXM", + into = ( 'yes', 'no' ), + defaut = 'yes', + fr = "Affichage du niveau de error de la bibliotheque Open TURNS", + ang = "Open TURNS library error level print", + ), + +) # Fin PROC LOG +# Ordre Catalogue LOG + + + + +#================================ +# 0. Definition du modele physique +#================================ + + +DETERMINISTICVARIABLE = OPER ( nom = "DETERMINISTICVARIABLE", + sd_prod = variable, + op = None, + fr = "Variable deterministe", + ang = "Deterministic variable", + + N = SIMP ( statut = 'o', + typ = "TXM", + fr = "Nom", + ang = "Name", + ), + + T = SIMP ( statut = 'o', + defaut = "in", + into = ( "in" , "out", ), + typ = "TXM", + fr = "Type", + ang = "Type", + ), + + R = SIMP ( statut = 'o', + defaut = 0, + typ = "I", + fr = "Rang", + ang = "Rank", + ), + +) # Fin OPER DETERMINISTICVARIABLE +# Ordre Catalogue DETERMINISTICVARIABLE + + +import opsOT +MODEL = MACRO ( nom = "MODEL", + op = None, + UIinfo = { "groupes" : ( "Gestion du travail", ) }, + fr = "Chargement du wrapper du modele physique", + ang = "Physical model wrapper load", + sd_prod = opsOT.INCLUDE, + op_init = opsOT.INCLUDE_context, + fichier_ini = 1, + + FileName = SIMP ( statut = "o", + typ = "TXM", + fr = "Nom du modele physique", + ang = "Physical model identifier", + ), + +) # Fin PROC MODEL +# Ordre Catalogue MODEL + + + + +VARIABLE = PROC ( nom = "VARIABLE", + op = None, + docu = "", + fr = "Variable probabiliste", + ang = "Probabilistic variable", + + ModelVariable = SIMP ( statut = "o", + typ = ( variable, ), + ), + + Distribution = SIMP ( statut = "o", + typ = ( loi, ), + ), + +) # Fin PROC VARIABLE +# Ordre Catalogue VARIABLE + + + + +#================================ +# 1. Definition des LOIS +#================================ + +# Nota : les variables de type OPER doivent etre en majuscules ! +# Nota : les variables de type OPER doivent etre de premier niveau (pas imbriquees dans un autre type) +DISTRIBUTION = OPER ( nom = "DISTRIBUTION", + sd_prod = loi, + op = 68, + fr = "Definitions des lois marginales utilisees par les variables d'entree", + + +#==== +# Type de distribution +#==== + + Kind = SIMP ( statut = "o", typ = "TXM", + into = ( "Beta", + "Exponential", + "Gamma", + "Geometric", + "Gumbel", + "Histogram", + "Logistic", + "LogNormal", + "MultiNomial", + "Normal", + "TruncatedNormal", + "Poisson", + "Student", + "Triangular", + "Uniform", + #"UserDefined", + "Weibull", + ), + fr = "Choix du type de la loi marginale", + ang = "1D marginal distribution", + ), + +#==== +# Definition des parametres selon le type de la loi +#==== + + BETA = BLOC ( condition = " Kind in ( 'Beta', ) ", + + Settings = SIMP ( statut = "o", + typ = "TXM", + max = 1, + into = ( "RT", "MuSigma" ), + defaut = "RT", + fr = "Parametrage de la loi beta", + ang = "Beta distribution parameter set", + ), + + RT_Parameters = BLOC ( condition = " Settings in ( 'RT', ) ", + + R = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre R de la loi", + ang = "R parameter", + ), + + # T > R + T = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre T de la loi | T > R", + ang = "T parameter | T > R", + ), + + ), # Fin BLOC RT_Parameters + + + MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi", + ang = "Mu parameter", + ), + + Sigma = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Sigma de la loi | Sigma > 0", + ang = "Sigma parameter | Sigma > 0", + ), + + ), # Fin BLOC MuSigma_Parameters + + + A = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre A de la loi", + ang = "A parameter", + ), + + # B > A + B = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre B de la loi | B > A", + ang = "B parameter | B > A", + ), + + ), # Fin BLOC BETA + + + + EXPONENTIAL = BLOC ( condition = " Kind in ( 'Exponential', ) ", + + Lambda = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Lambda | Lambda > 0", + ang = "Lambda parameter | Lambda > 0", + ), + + Gamma = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Gamma", + ang = "Gamma parameter", + ), + + ), # Fin BLOC EXPONENTIAL + + + + GAMMA = BLOC ( condition = " Kind in ( 'Gamma', ) ", + + Settings = SIMP ( statut = "o", + typ = "TXM", + max = 1, + into = ( "KLambda", "MuSigma" ), + defaut = "KLambda", + fr = "Parametrage de la loi gamma", + ang = "Gamma distribution parameter set", + ), + + KLambda_Parameters = BLOC ( condition = " Settings in ( 'KLambda', ) ", + + K = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre K de la loi | K > 0", + ang = "K parameter | K > 0", + ), + + Lambda = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Lambda de la loi | Lambda > 0", + ang = "Lambda parameter | Lambda > 0", + ), + + ), # Fin BLOC KLambda_Parameters + + + MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + defaut = 0.0, + fr = "Parametre Mu de la loi", + ang = "Mu parameter", + ), + + Sigma = SIMP ( statut = "o", + typ = "R", + max = 1, + defaut = 1.0, + val_min = 0., + fr = "Parametre Sigma de la loi | Sigma > 0", + ang = "Sigma parameter | Sigma > 0", + ), + + ), # Fin BLOC MuSigma_Parameters + + Gamma = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Gamma", + ang = "Gamma parameter", + ), + + + ), # Fin BLOC GAMMA + + + + GEOMETRIC = BLOC ( condition = " Kind in ( 'Geometric', ) ", + + P = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + val_max = 1., + fr = "Parametre P | 0 < P < 1", + ang = "P parameter | 0 < P < 1", + ), + + ), # Fin BLOC GEOMETRIC + + + + GUMBEL = BLOC ( condition = " Kind in ( 'Gumbel', ) ", + + Settings = SIMP ( statut = "o", + typ = "TXM", + max = 1, + into = ( "AlphaBeta", "MuSigma" ), + defaut = "AlphaBeta", + fr = "Parametrage de la loi gumbel", + ang = "Gumbel distribution parameter set", + ), + + AlphaBeta_Parameters = BLOC ( condition = " Settings in ( 'AlphaBeta', ) ", + + Alpha = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Alpha de la loi | Alpha > 0", + ang = "Alpha parameter | Alpha > 0", + ), + + Beta = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Beta de la loi", + ang = "Beta parameter", + ), + + ), # Fin BLOC AlphaBeta_Parameters + + + MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi", + ang = "Mu parameter", + ), + + Sigma = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Sigma de la loi | Sigma > 0", + ang = "Sigma parameter | Sigma > 0", + ), + + ), # Fin BLOC MuSigma_Parameters + + ), # Fin BLOC GUMBEL + + + + HISTOGRAM = BLOC ( condition = " Kind in ( 'Histogram', ) ", + + First = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Premier point de la distribution", + ang = "First point", + ), + + # Il faut definir une collection de couples ( x,p ) + Values = SIMP ( statut = 'o', + typ = Tuple(2), + max = '**', + fr = "Liste de couples (point,probabilite)", + ang = "(point,probabiblity) couple list", + validators=VerifTypeTuple(('R','R')), + ), + + ), # Fin BLOC HISTOGRAM + + + + LOGNORMAL = BLOC ( condition = " Kind in ( 'LogNormal', ) ", + + Settings = SIMP ( statut = "o", + typ = "TXM", + max = 1, + into = ( "MuSigmaLog", "MuSigma", "MuSigmaOverMu" ), + defaut = "MuSigmaLog", + fr = "Parametrage de la loi lognormale", + ang = "Lognormal distribution parameter set", + ), + + MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi | Mu > Gamma", + ang = "Mu parameter | Mu > Gamma", + ), + + Sigma = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Sigma de la loi | Sigma > 0", + ang = "Sigma parameter | Sigma > 0", + ), + + ), # Fin BLOC MuSigma_Parameters + + MuSigmaOverMu_Parameters = BLOC ( condition = " Settings in ( 'MuSigmaOverMu', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi | Mu > Gamma", + ang = "Mu parameter | Mu > Gamma", + ), + + SigmaOverMu = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre SigmaOverMu de la loi | SigmaOverMu > 0", + ang = "SigmaOverMu parameter | SigmaOverMu > 0", + ), + + ), # Fin BLOC MuSigmaOverMu_Parameters + + MuSigmaLog_Parameters = BLOC ( condition = " Settings in ( 'MuSigmaLog', ) ", + + MuLog = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu log de la loi", + ang = "Mu log parameter", + ), + + SigmaLog = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Sigma log de la loi | SigmaLog > 0", + ang = "Sigma log parameter | SigmaLog > 0", + ), + + ), # Fin BLOC MuSigmaLog_Parameters + + Gamma = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Gamma", + ang = "Gamma parameter", + ), + + ), # Fin BLOC LOGNORMAL + + + + LOGISTIC = BLOC ( condition = " Kind in ( 'Logistic', ) ", + + Alpha = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Alpha de la loi", + ang = "Alpha parameter", + ), + + Beta = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Beta de la loi | Beta > = 0", + ang = "Beta parameter | Beta > = 0", + ), + + ), # Fin BLOC LOGISTIC + + + + MULTINOMIAL = BLOC ( condition = " Kind in ( 'MultiNomial', ) ", + + N = SIMP ( statut = "o", + typ = "I", + max = 1, + fr = "Dimension de la loi", + ang = "Distribution dimension", + ), + + # Il faut un vecteur P de taille N + Mu = SIMP ( statut = 'o', + typ = 'R', + max = '**', + ), + + ), # Fin BLOC MULTINOMIAL + + + + NORMAL = BLOC ( condition = " Kind in ( 'Normal', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi", + ang = "Mu parameter", + ), + + Sigma = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Sigma de la loi | Sigma > 0", + ang = "Sigma parameter | Sigma > 0", + ), + + ), # Fin BLOC NORMAL + + + + POISSON = BLOC ( condition = " Kind in ( 'Poisson', ) ", + + Lambda = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Lambda de la loi | Lambda > 0", + ang = "Lambda parameter | Lambda > 0", + ), + + ), # Fin BLOC POISSON + + + + STUDENT = BLOC ( condition = " Kind in ( 'Student', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi", + ang = "Mu parameter", + ), + + Nu = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 2., + fr = "Parametre Nu de la loi | V > = 2", + ang = "Nu parameter | V > = 2", + ), + + ), # Fin BLOC STUDENT + + + + TRIANGULAR = BLOC ( condition = " Kind in ( 'Triangular', ) ", + + A = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne inferieure de la loi | A < = M < = B", + ang = "Lower bound | A < = M < = B", + ), + + M = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Mode de la loi | A < = M < = B", + ang = "Mode | A < = M < = B", + ), + + B = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne superieure de la loi | A < = M < = B", + ang = "Upper bound | A < = M < = B", + ), + + ), # Fin BLOC TRIANGULAR + + + + TRUNCATEDNORMAL = BLOC ( condition = " Kind in ( 'TruncatedNormal', ) ", + + MuN = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi", + ang = "Mu parameter", + ), + + SigmaN = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre SigmaN de la loi | SigmaN > 0", + ang = "SigmaN parameter | SigmaN> 0", + ), + + A = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne inferieure de la loi | A < = B", + ang = "Lower bound | A < = B", + ), + + B = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne superieure de la loi | A < = B", + ang = "Upper bound | A < = B", + ), + + ), # Fin BLOC TRUNCATEDNORMAL + + + + UNIFORM = BLOC ( condition = " Kind in ( 'Uniform', ) ", + + A = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne inferieure de la loi | A < = B", + ang = "Lower bound | A < = B", + ), + + B = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne superieure de la loi | A < = B", + ang = "Upper bound | A < = B", + ), + + ), # Fin BLOC UNIFORM + + + + USERDEFINED = BLOC ( condition = " Kind in ( 'UserDefined', ) ", + + # Il faut definir une collection de couples ( x,p ) + Values = SIMP ( statut = 'o', + typ = 'R', + max = '**', + ), + + ), # Fin BLOC USERDEFINED + + + + WEIBULL = BLOC ( condition = " Kind in ( 'Weibull', ) ", + + Settings = SIMP ( statut = "o", + typ = "TXM", + max = 1, + into = ( "AlphaBeta", "MuSigma" ), + defaut = "AlphaBeta", + fr = "Parametrage de la loi weibull", + ang = "Weibull distribution parameter set", + ), + + AlphaBeta_Parameters = BLOC ( condition = " Settings in ( 'AlphaBeta', ) ", + + Alpha = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Alpha de la loi | Alpha > 0", + ang = "Alpha parameter | Alpha > 0", + ), + + Beta = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Beta de la loi | Beta > 0", + ang = "Beta parameter | Beta > 0", + ), + + ), # Fin BLOC AlphaBeta_Parameters + + + MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi", + ang = "Mu parameter", + ), + + Sigma = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Sigma de la loi | Sigma > 0", + ang = "Sigma parameter | Sigma > 0", + ), + + ), # Fin BLOC MuSigma_Parameters + + Gamma = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Gamma", + ang = "Gamma parameter", + ), + + ), # Fin BLOC WEIBULL + +) # Fin OPER DISTRIBUTION +# Ordre Catalogue DISTRIBUTION + + + + + + + +#================================ +# 3. Definition de l'etude +#================================ + +# Nota : les variables de type PROC doivent etre en majuscules ! +CRITERIA = PROC ( nom = "CRITERIA", + op = None, + docu = "", + fr = "Mise en donnee pour le fichier de configuration de OPENTURNS.", + ang = "Writes the configuration file for OPENTURNS.", + + + + Type = SIMP ( statut = "o", + typ = "TXM", + into = ( "Min/Max", "Central Uncertainty", "Threshold Exceedence" ), + fr = "Type d'Analyse", + ang = "Analysis", + ), + + + + + + + + MinMax = BLOC ( condition = " Type in ( 'Min/Max', ) ", + + Method = SIMP ( statut = "o", + typ = "TXM", + into = ( "Experiment Plane", "Random Sampling" ), + fr = "Methode", + ang = "Method", + ), + # UC 3.1.1 + ExperimentPlaneSettings = BLOC ( condition = " Method in ( 'Experiment Plane', ) ", + + ExperimentPlane = SIMP ( statut = "o", + typ = "TXM", + into = ( "Axial", "Factorial", "Composite", ), + fr = "Methode", + ang = "Method", + ), + + Levels = SIMP ( statut = "o", + typ = "R", + val_min = 0.0, + max = '**', + fr = "Nombre de niveaux dans chaque direction", + ang = "Levels in each direction", + ), + + # Scaled Vector + UnitsPerDimension = SIMP ( statut = "o", + typ = "R", + max = '**', + fr = "Unite par dimension (autant que de variables declarees)", + ang = "Units per dimension (as much as declared variables)", + ), + + # Translation Vector + Center = SIMP ( statut = "o", + typ = "R", + max = '**', + fr = "Unite par dimension", + ang = "Units per dimension", + ), + + ), # Fin BLOC ExperimentPlaneSettings + + + + RandomSamplingSettings = BLOC ( condition = " Method in ( 'Random Sampling', ) ", + + PointsNumber = SIMP ( statut = "o", + typ = "I", + val_min = 1, + fr = "Nombre de points", + ang = "Points number", + ), + + ), # Fin BLOC RandomSamplingSettings + + Result = SIMP ( statut = "o", + typ = "TXM", + into = ( "Min/Max", ), + defaut = "Min/Max", + fr = "Le minimum et le maximum", + ang = "The min and max values", + ), + + + ), # Fin BLOC MinMax + + + + + CentralUncertainty = BLOC ( condition = " Type in ( 'Central Uncertainty', ) ", + + Method = SIMP ( statut = "o", + typ = "TXM", + into = ( "Taylor Variance Decomposition", "Random Sampling" ), + fr = "Methode", + ang = "Method", + ), + + # UC 3.2. + TaylorVarianceDecompositionSettings = BLOC ( condition = " Method in ( 'Taylor Variance Decomposition', ) ", + + Result = FACT ( statut = "o", + min = 1, + max = "**", + + MeanFirstOrder = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Moyenne au premier ordre", + ang = "MeanFirstOrder", + ), + + StandardDeviationFirstOrder = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Ecart-type au premier ordre", + ang = "StandardDeviationFirstOrder", + ), + + MeanSecondOrder = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Moyenne au second ordre", + ang = "MeanSecondOrder", + ), + + ImportanceFactor = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Facteur d'importance pour variable de sortie scalaire", + ang = "ImportanceFactor", + ), + + ImportanceFactorSettings = BLOC ( condition = " ImportanceFactor in ( 'yes', ) ", + + NumericalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Resultats numeriques", + ang = "NumericalResults", + ), + + GraphicalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Resultats graphiques", + ang = "GraphicalResults", + ), + + ), # Fin BLOC ImportanceFactorSettings + + ), # Fin FACT Result + + ), # Fin BLOC TaylorVarianceDecompositionSettings + + + + RandomSamplingSettings = BLOC ( condition = " Method in ( 'Random Sampling', ) ", + + PointsNumber = SIMP ( statut = "o", + typ = "I", + val_min = 1, + fr = "Nombre de points", + ang = "Points number", + ), + + Result = FACT ( statut = "o", + min = 1, + max = "**", + + EmpiricalMean = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Moyenne empirique", + ang = "Empirical mean", + ), + + EmpiricalStandardDeviation = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Ecart-type empirique", + ang = "Empirical standard deviation", + ), + + EmpiricalQuantile = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Quantile empirique", + ang = "Empirical quantile", + ), + + EmpiricalQuantileSettings = BLOC ( condition = " EmpiricalQuantile in ( 'yes', ) ", + + EmpiricalQuantile_Order = SIMP ( statut = "o", + typ = 'R', + defaut = 0.95, + max = 1, + val_min = 0.0, + val_max = 1.0, + fr = "Ordre du quantile empirique", + ang = "Empirical quantile order", + ), + + ), # Fin BLOC EmpiricalQuantileSettings + + AnalysedCorrelations = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Correlations analysees", + ang = "Analysed correlations", + ), + + KernelSmoothing = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Kernel smoothing de l'echantillon", + ang = "Kernel smoothing of the sample", + ), + + ), # Fin FACT Result + + ), # Fin BLOC RandomSamplingSettings + + ), # Fin BLOC CentralUncertainty + + + + + ThresholdExceedence = BLOC ( condition = " Type in ( 'Threshold Exceedence', ) ", + + Event = FACT ( statut = "o", + min = 1, + max = 1, + + Threshold = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Le seuil de defaillance", + ang = "Failure threshold", + ), + + ComparisonOperator = SIMP ( statut = "o", + typ = "TXM", + max = 1, + into = ( "Less", "LessOrEqual", "Equal", "GreaterOrEqual", "Greater" ), + fr = "Que faut-il ne pas depasser : un maximum ou un minimum", + ang = "What is the failure threshold : maximum or minimum", + ), + ), # Fin FACT Event + + + Method = SIMP ( statut = "o", + typ = "TXM", + into = ( "Simulation", "Analytical" ), + fr = "Methode", + ang = "Method", + ), + + SimulationSettings = BLOC ( condition = " Method in ( 'Simulation', ) ", + + Algorithm = SIMP ( statut = "o", + typ = "TXM", + into = ( "MonteCarlo", "LHS", "ImportanceSampling" ), + fr = "Algorithme de simulation", + ang = "Simulation algorithm", + ), + + + RandomGenerator = FACT ( statut = "o", + min = 1, + max = 1, + + SeedToBeSet = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "La racine du generateur aleatoire doit-elle etre positionnee ?", + ang = "Does the random generator seed need to be set ?", + ), + + SeedSettings = BLOC ( condition = " SeedToBeSet in ( 'yes', ) ", + + RandomGeneratorSeed = SIMP ( statut = "o", + typ = "I", + max = 1, + fr = "Racine du generateur aleatoire", + ang = "Random generator seed", + ), + + ), # Fin BLOC SeedSettings + + ), # Fin FACT RandomGenerator + + + BlockSize = SIMP ( statut = "f", + typ = "I", + max = 1, + val_min = 1, + defaut = 1, + fr = "Nombre de calculs realises en bloc", + ang = "Number of computations as a block", + ), + + MaximumOuterSampling = SIMP ( statut = "o", + typ = "I", + max = 1, + val_min = 1, + fr = "Maximum d'iterations externes", + ang = "Maximum outer Sampling value", + ), + + MaximumCoefficientOfVariation = SIMP ( statut = "f", + typ = "R", + max = 1, + defaut = 0.1, + val_min = 0.0, + fr = " maximum ...", + ang = "Absolute maximum ...." + ), + + ImportanceSamplingSettings = BLOC ( condition = " Algorithm in ( 'ImportanceSampling', ) ", + + MeanVector = SIMP ( statut = "o", + typ = "R", + max = "**", + fr = "Moyenne", + ang = "Mean vector", + ), + + Correlation = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'Independent', 'Linear' ), + defaut = 'Linear', + max = 1, + fr = "Le type de correlation entre les variables", + ang = "Correlation between variables", + ), + + ), # Fin BLOC ImportanceSamplingSettings + + Result = FACT ( statut = "o", + min = 1, + max = "**", + + Probability = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', ), + defaut = 'yes', + max = 1, + fr = "Probabiblite", + ang = "Probability", + ), + + StandardDeviation = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', ), + defaut = 'yes', + max = 1, + fr = "Ecart type", + ang = "Standard deviation", + ), + + ConfidenceInterval = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Ecart-type empirique", + ang = "Empirical standard deviation", + ), + + ConfidenceIntervalSettings = BLOC ( condition = " ConfidenceInterval in ( 'yes', ) ", + + Level = SIMP ( statut = "o", + typ = 'R', + defaut = 0.9, + max = 1, + val_min = 0.0, + val_max = 1.0, + fr = "Niveau de confiance", + ang = "Confidence level", + ), + + ), # Fin BLOC ConfidenceIntervalSettings + + VariationCoefficient = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Coefficient de variation", + ang = "VariationCoefficient", + ), + + IterationNumber = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Nombre d'iterations", + ang = "Iteration number", + ), + + ConvergenceGraph = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Graphe de convergence", + ang = "Convergence graph", + ), + + ), # Fin FACT Result + + + + ), # Fin BLOC SimulationSettings + + + + AnalyticalSettings = BLOC ( condition = " Method in ( 'Analytical', ) ", + + Approximation = SIMP ( statut = "o", + typ = "TXM", + defaut = "FirstOrder", + into = ( "FirstOrder", "SecondOrder" ), + max = 1, + fr = "Approximation", + ang = "Approximation", + ), + + OptimizationAlgorithm = SIMP ( statut = "o", + typ = "TXM", + defaut = "Cobyla", + into = ( "Cobyla", "AbdoRackwitz" ), + max = 1, + fr = "Methode d'optimisation", + ang = "Optimisation method", + ), + + + PhysicalStartingPoint = SIMP ( statut = "f", + typ = "R", + max = "**", + fr = "Point de demarrage de l'algorithme iteratif", + ang = "Initial point for iterative process", + ), + + MaximumIterationsNumber = SIMP ( statut = "f", + typ = "I", + max = 1, + val_min = 1, + fr = "Nombre maximum d iterations", + ang = "Maximum number of iterations", + ), + + + MaximumAbsoluteError = SIMP ( statut = "f", + typ = "R", + max = 1, + defaut = 1E-4, + val_min = 0.0, + fr = "Distance maximum absolue entre 2 iterations successifs", + ang = "Absolute maximum distance between 2 successive iterates", + ), + + MaximumRelativeError = SIMP ( statut = "f", + typ = "R", + max = 1, + defaut = 1E-4, + val_min = 0.0, + fr = "Distance maximum relative entre 2 iterations successives", + ang = "Relative maximum distance between 2 successive iterates", + ), + + MaximumConstraintError = SIMP ( statut = "f", + typ = "R", + max = 1, + defaut = 1E-4, + val_min = 0.0, + fr = "Valeur maximum absolue de la fonction moins la valeur du niveau", + ang = "Maximum absolute value of the constraint function minus the level value", + ), + + ImportanceSampling = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Tirage d'importance au point de conception", + ang = "Importance sampling at design point", + ), + + FirstOrder = BLOC ( condition = " Approximation in ( 'FirstOrder', ) ", + + Probability = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', ), + defaut = 'yes', + max = 1, + fr = "Probabiblite", + ang = "Probability", + ), + + DesignPoint = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Point de conception", + ang = "Design point", + ), + + HasoferReliabilityIndex = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Indice de fiabilite", + ang = "Reliability index", + ), + + ImportanceFactor = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Facteur d'importance pour variable de sortie scalaire", + ang = "ImportanceFactor", + ), + + ImportanceFactorSettings = BLOC ( condition = " ImportanceFactor in ( 'yes', ) ", + + ImportanceFactorNumericalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Resultats numeriques", + ang = "NumericalResults", + ), + + ImportanceFactorGraphicalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Resultats graphiques", + ang = "GraphicalResults", + ), + + ), # Fin BLOC ImportanceFactorSettings + + + SensitivityAnalysis = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Analyse de sensibilite", + ang = "Sensitivity analysis", + ), + + SensitivityAnalysisSettings = BLOC ( condition = " SensitivityAnalysis in ( 'yes', ) ", + + FORMEventProbabilitySensitivity = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Indice de fiabilite de Hasofer", + ang = "Hasofer reliability index", + ), + + FORMEventProbabilitySensitivitySettings = BLOC ( condition = " FORMEventProbabilitySensitivity in ( 'yes', ) ", + + FORMEventProbabilitySensitivityNumericalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Resultats numeriques", + ang = "NumericalResults", + ), + + FORMEventProbabilitySensitivityGraphicalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Resultats graphiques", + ang = "GraphicalResults", + ), + + ), # Fin BLOC FORMEventProbabilitySensitivitySettings + + HasoferReliabilityIndexSensitivity = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Indice de fiabilite de Hasofer", + ang = "Hasofer reliability index", + ), + + HasoferReliabilityIndexSensitivitySettings = BLOC ( condition = " HasoferReliabilityIndexSensitivity in ( 'yes', ) ", + + HasoferReliabilityIndexSensitivityNumericalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Resultats numeriques", + ang = "NumericalResults", + ), + + HasoferReliabilityIndexSensitivityGraphicalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Resultats graphiques", + ang = "GraphicalResults", + ), + + ), # Fin BLOC HasoferReliabilityIndexSettings + + ), # Fin BLOC SensitivityAnalysisSettings + + FunctionCallsNumber = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Nombre d'appels a la fonction", + ang = "Function calls number", + ), + + + ), # Fin BLOC FirstOrder + + + SecondOrder = BLOC ( condition = " Approximation in ( 'SecondOrder', ) ", + + + TvedtApproximation = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Approximation de Tvedt", + ang = "Tvedt approximation", + ), + + HohenBichlerApproximation = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Approximation de HohenBichler", + ang = "HohenBichler approximation", + ), + + BreitungApproximation = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Approximation de Breitung", + ang = "Breitung approximation", + ), + + DesignPoint = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Point de conception", + ang = "Design point", + ), + + ImportanceFactor = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Facteur d'importance pour variable de sortie scalaire", + ang = "ImportanceFactor", + ), + + ImportanceFactorSettings = BLOC ( condition = " ImportanceFactor in ( 'yes', ) ", + + ImportanceFactorNumericalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Resultats numeriques", + ang = "NumericalResults", + ), + + ImportanceFactorGraphicalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Resultats graphiques", + ang = "GraphicalResults", + ), + + ), # Fin BLOC ImportanceFactorSettings + + SensitivityAnalysis = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Analyse de sensibilite", + ang = "Sensitivity analysis", + ), + + SensitivityAnalysisSettings = BLOC ( condition = " SensitivityAnalysis in ( 'yes', ) ", + + HasoferReliabilityIndexSensitivity = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Indice de fiabilite de Hasofer", + ang = "Hasofer reliability index", + ), + + HasoferReliabilityIndexSensitivitySettings = BLOC ( condition = " HasoferReliabilityIndexSensitivity in ( 'yes', ) ", + + HasoferReliabilityIndexSensitivityNumericalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Resultats numeriques", + ang = "NumericalResults", + ), + + HasoferReliabilityIndexSensitivityGraphicalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Resultats graphiques", + ang = "GraphicalResults", + ), + + ), # Fin BLOC HasoferReliabilityIndexSettings + + ), # Fin BLOC SensitivityAnalysisSettings + + FunctionCallsNumber = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Nombre d'appels a la fonction", + ang = "Function calls number", + ), + + + ), # Fin BLOC SecondOrder + + + + ), # Fin BLOC AnalyticalSettings + + + + ), # Fin BLOC ThresholdExceedence + + + +) # Fin PROC CRITERIA +# Ordre Catalogue CRITERIA + + + + + + + diff --git a/Openturns_Study/catalogues_openturns.ini b/Openturns_Study/catalogues_openturns.ini index 7cd5b3c1..7592ca46 100644 --- a/Openturns_Study/catalogues_openturns.ini +++ b/Openturns_Study/catalogues_openturns.ini @@ -6,7 +6,8 @@ rep_cata=os.getcwd() catalogues = ( # (code,version,catalogue,formatIn,formatOut) #('OPENTURNS_WRAPPER','V1',os.path.join(rep_cata,'OpenTURNS_Cata_Wrapper_V1.py'),'openturns_wrapper','wrapper'), - ('OPENTURNS_STUDY','V3',os.path.join(rep_cata,'OpenTURNS_Cata_Study_V3.py'),'openturns_study','wrapper'), + ('OPENTURNS_STUDY','V4',os.path.join(rep_cata,'OpenTURNS_Cata_Study_V4.py'),'openturns_study','wrapper'), + #('OPENTURNS_STUDY','V4',os.path.join(rep_cata,'OpenTURNS_Cata_Study_VPN.py'),'openturns_study','wrapper'), #('OPENTURNS','Wrapper',os.path.join(rep_cata,'OpenTURNS_Cata_Wrapper_V1.py'),'openturns'), ) diff --git a/Openturns_Study/prefs.py b/Openturns_Study/prefs.py index 5fff47f6..84f4d9a3 100644 --- a/Openturns_Study/prefs.py +++ b/Openturns_Study/prefs.py @@ -1,54 +1 @@ -# -*- 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 os, sys -# Les variables pouvant positionnees sont : -# "CODE_PATH_SURCHARGE","DTDDirectory","rep_user","INSTALLDIR","path_doc","exec_acrobat","rep_cata" -print "import des prefs de OPENTURNS_STUDY" - -code = "OPENTURNS_STUDY" - -# REPINI sert à localiser le fichier -# initialdir sert comme directory initial des QFileDialog -# positionnee a repin au debut mise a jour dans configuration -REPINI=os.path.dirname(os.path.abspath(__file__)) -initialdir=REPINI - -# INSTALLDIR sert à localiser l'installation d'Eficas -INSTALLDIR=os.path.join(REPINI,'..') - - -# Codage des strings qui accepte les accents (en remplacement de 'ascii') -# lang indique la langue utilisée pour les chaines d'aide : fr ou ang -lang='fr' -encoding='iso-8859-1' - -# Acces a la documentation -rep_cata = INSTALLDIR -path_doc = os.path.join(rep_cata,'Doc') -exec_acrobat = "/usr/bin/xpdf" - -# Repertoire initial -DTDDirectory="/local00/home/dutka/OpenTURNS/dutka/devel/build/install/share/openturns/wrappers/" - -# Choix des catalogues -sys.path[:0]=[INSTALLDIR] - +code='OPENTURNS_STUDY' diff --git a/Openturns_Study/qtEficas_openturns_study.py b/Openturns_Study/qtEficas_openturns_study.py index 76e0ad8a..5c865492 100755 --- a/Openturns_Study/qtEficas_openturns_study.py +++ b/Openturns_Study/qtEficas_openturns_study.py @@ -27,7 +27,9 @@ # Modules Eficas import prefs -prefs.code="OPENTURNS_STUDY" -from InterfaceQT4 import eficas_go +name='prefs_'+prefs.code +__import__(name) +import sys +from InterfaceQT4 import eficas_go eficas_go.lance_eficas(code=prefs.code) diff --git a/Traducteur/dictErreurs.py b/Traducteur/dictErreurs.py index a66aa137..85d9fe66 100644 --- a/Traducteur/dictErreurs.py +++ b/Traducteur/dictErreurs.py @@ -5,83 +5,9 @@ import sets jdcSet=sets.Set() -dict_erreurs={ -#STA8.4 - "DIST_LIGN_3D": "la commande DIST_LIGN_3D a ete supprimee", - "DEFI_THER_JOULE": "la commande DIST_LIGN_3D a ete supprimee", - "DIST_LIGN_3D": "la commande DIST_LIGN_3D a ete supprimee", - "AFFE_MODELE_AFFE": "Les modelisations APPUI_REP, ASSE_GRIL et 3D_JOINT_CT ont ete supprimees", - "AFFE_CHAR_MECA_CONTACT_FROTTEMENT": "Suppression d un mot clef FROTTEMENT", - "AFFE_CHAR_MECA_SECH_CALCULEE": "le sechage est maintenant une variable de commande", - "AFFE_CHAR_MECA_HYDR_CALCULEE": "l'hydratation est maintenant une variable de commande", - "AFFE_CHAR_MECA_EPSA_CALCULEE":"EPSA est maintenant une variable de commande", - "AFFE_CHAR_MECA_PRESSION_CALCULEE":"PRESSION_CALCULEE est remplace par EVOL_CHAR", - "MACR_LIGN_COUPE" : "MACR_LIGN_COUPE demande un traitement manuel", - "POST_RCCM" : "POST_RCCM demande un traitement manuel", - "DEFI_MATERIAU_CHABOCHE" : "remplacer la valeur CINx_CHAB", - "DEFI_MATERIAU_POLY_CFC" : "le materiau POLY_CFC est remplace par le comportement POLYCRISTAL", - "DEFI_MATERIAU_ECOU_PLAS1" : "le materiau ECOU_PLAS1 est supprime", - "DEFI_MATERIAU_COMP_THM_ELAS_THM" : "le materiau ELAS_THM a ete supprime", - "DEFI_MATERIAU_COMP_THM_SURF_ETAT_SATU" : "le materiau SURF_ETAT_SATU a ete supprime", - "DEFI_MATERIAU_COMP_THM_SURF_ETAT_NSAT" : "le materiau SURF_ETAT_NSAT a ete supprime", - "DEFI_MATERIAU_COMP_THM_CAM_CLAY_THM" : "le materiau CAM_CLAY_THM a ete supprime", - "DEFI_MATERIAU_COMP_THM_LIQU_SATU_GAT" : "le materiau LIQU_SATU_GAT a ete supprime", - "DEFI_MATERIAU_COMP_THM_LIQU_NSAT_GAT" : "le materiau LIQU_NSAT_GAT a ete supprime", - "DEFI_MATERIAU_GLRC" : "le materiau GLRC a ete remplace par GLRC_DAMAGE", - "DEFI_MATERIAU_GLRC_FO" : "le materiau GLRC_FO a ete remplace par GLRC_DAMAGE", - "DEFI_MATERIAU_OHNO" : "le materiau OHNO a ete remplace par TAHERI", - "DEFI_MATERIAU_OHNO_FO" : "le materiau OHNO a ete remplace par TAHERI", - "CALC_CHAM_ELEM":"reecrire la partie SOUR_ELGA_ELEC", - "CALC_G_THETA_T_OPTION_VALEUR":"verifier la valeur d OPTION", - "CALC_G_THETA_T_OPTION_DEFAUT":"verifier la valeur d OPTION donnee a la place du defaut", - "CALC_G_MODELE":"Mot Clef MODELE supprimé sous CALC_G", - "CALC_G_DEPL":"Mot Clef DEPL supprimé sous CALC_G", - "CALC_G_CHAM_MATER":"Mot Clef CHAM_MATER supprimé sous CALC_G", - "CALC_G_CARA_ELEM":"Mot Clef CARA_ELEM supprimé sous CALC_G", - "CALC_G_RESULTAT=XXX,":"Mot Clef RESULTAT à completer sous CALC_G", - "AFFE_MODELE_AFFE_MODELISATION_VALEUR":"verifier la valeur de MODELISATION", - "STAT_NON_LINE_COMP_INCR_RELATION_VALEUR":"verifier la valeur de RELATION", - "STAT_NON_LINE_COMP_INCR_RELATION_KIT_VALEUR":"verifier la valeur de RELATION_KIT", - "STAT_NON_LINE_VARI_COMM":"suppression des variables de commande", - "STAT_NON_LINE_INCREMENT_SUBD_PAS":"Si SUBD_PAS=1 il n'y a pas subdivision : le mot est clef est ote du STAT_NON_LINE", - "DYNA_NON_LINE_COMP_INCR_RELATION_VALEUR":"verifier la valeur de RELATION", - "DYNA_NON_LINE_COMP_INCR_RELATION_KIT_VALEUR":"verifier la valeur de RELATION_KIT", - "DYNA_NON_LINE_VARI_COMM":"suppression des variables de commande", - "DYNA_NON_LINE_INCREMENT_SUBD_PAS":"Si SUBD_PAS=1 il n'y a pas subdivision : le mot est clef est ote du DYNA_NON_LINE", - "CALC_PRECONT_SUBD_PAS":"Si SUBD_PAS=1 il n'y a pas subdivision : le mot est clef est ote du CALC_PRECONT", - "TEST_RESU_UNITE":"suppression du mot clef UNITE dans TEST_RESU", - "POST_SIMPLIFIE":"commande POST_SIMPLIFIE supprimee", - "POST_DYNA_ALEA_GAUSS":"la methode GAUSS a ete supprimee de POST_DYNA_ALEA", - "POST_DYNA_ALEA_VANMARCKE":"la methode VANMARCKE a ete supprimee de POST_DYNA_ALEA", - "POST_DYNA_ALEA_DEPASSEMENT":"la methode DEPASSEMENT a ete supprimee de POST_DYNA_ALEA", - "POST_DYNA_ALEA_RAYLEIGH":"la methode RAYLEIGH a ete supprimee de POST_DYNA_ALEA", - "DYNA_TRAN_MODAL_EXCIT_NUME_MODE":"le numero du mode utilise pour EXCIT DYNA_TRAN_MODAL est le numero d'ORDRE", - "DEFI_INTERF_DYNA_INTERFACE_DDL_ACTIF":"DDL_ACTIF supprime de DEFI_INTERF_DYNA; utiliser MASQUE", - "DEFI_TEXTURE":"le materiau POLY_CFC est remplace par le comportement POLYCRISTAL", - "CREA_RESU_NOM_CHAM_VALEUR":"HYDR_ELGA est remplace par HYDR_ELNO_ELGA et HYDR_NOEU_ELGA", - "COMB_CHAM_NO":"COMB_CHAM_NO est remplace par CREA_CHAMP", - "COMB_CHAM_ELEM":"COMB_CHAM_ELEM est remplace par CREA_CHAMP", - "IMPR_OAR":"IMPR_OAR demande un traitement manuel", - "IMPR_FICO_HOMARD":"IMPR_FICO_HOMARD a ete integre dans MACR_ADPA_MAIL", -# STA9.2 - "POST_RCCM_SITUATION_NUME_PASSAGE":"Utilisation de NUME_PASSAGE pour le type TUYAUTERIE impossible en 9.2. On ne traite pour le moment que les chemins de passage simples.", - "POST_RCCM_SITUATION_NB_CYCL_SEISME":"POST_RCCM : maintenant les SITUATIONS sismiques ont leur propre mot clef facteur SEISME, attention, traduction incomplete", - "DEFI_MATERIAU_BAZANT_FD" : "le materiau BAZANT_FD a ete supprime", - "DEFI_MATERIAU_APPUI_ELAS" : "le materiau APPUI_ELAS a ete supprime", - "DEFI_MATERIAU_PORO_JOINT" : "le materiau PORO_JOINT a ete supprime", - "DEFI_MATERIAU_ZIRC_CYRA2" : "le materiau ZIRC_CYRA2 a ete supprime", - "DEFI_MATERIAU_ZIRC_EPRI" : "le materiau ZIRC_EPRI a ete supprime", - "IMPR_MATRICE_MATR_ELEM_FORMAT=RESULTAT" : "IMPR_MATRICE au format RESULTAT a ete supprime", - "IMPR_MATRICE_MATR_ASSE_FORMAT=RESULTAT" : "IMPR_MATRICE au format RESULTAT a ete supprime", - "CALC_G_OPTION=G_LAGR" : "l'OPTION G_LAGR de CALC_G a ete supprimee", - "CALC_G_OPTION=G_LAGR_GLOB" : "l'OPTION G_LAGR_GLOB de CALC_G a ete supprimee", - "CALC_MATR_ELEM_THETA" : "l'OPTION RIGI_MECA_LAGR de CALC_MATR_ELEM a ete supprimee", - "TEST_FICHIER_NB_CHIFFRE" : "le fonctionnement de TEST_FICHIER a change entre la V8 et la V9, consultez la doc, en particulier pour entrer la bonne valeur de NB_VALE", - "DYNA_NON_LINE_PILOTAGE" : "le PILOTAGE n'est pas actif dans DYNA_NON_LINE ", - "DYNA_NON_LINE_RECH_LINEAIRE" : "la RECH_LINEAIRE n'est pas active dans DYNA_NON_LINE ", - } def EcritErreur(listeGena,ligne=None) : + from sys import dict_erreurs maCle="" for Mot in listeGena : maCle=maCle+"_"+Mot @@ -90,7 +16,7 @@ def EcritErreur(listeGena,ligne=None) : maClef=maCle[1:] if maClef in dict_erreurs.keys() : if ligne != None : - logging.warning("ligne %d : %s ligne ",ligne,dict_erreurs[maClef]) + logging.warning("ligne %d : %s ",ligne,dict_erreurs[maClef]) else : logging.warning("%s",dict_erreurs[maClef]) else : @@ -101,7 +27,7 @@ def EcritErreur(listeGena,ligne=None) : maClef=maCle+"_"+"VALEUR" if maClef in dict_erreurs.keys() : if ligne != None : - logging.warning("ligne %d : %s ligne ",ligne,dict_erreurs[maClef]) + logging.warning("ligne %d : %s ",ligne,dict_erreurs[maClef]) else : logging.warning("%s",dict_erreurs[maClef]) #except : @@ -116,3 +42,16 @@ def GenereErreurPourCommande(jdc,listeCommande) : if c.name != Mot :continue EcritErreur((Mot,),c.lineno) +def GenereErreurMotCleInFact(jdc,command,fact,mocle): + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + l=mc.childNodes[:] + for ll in l: + for n in ll.childNodes: + if n.name != mocle: + continue + else : + EcritErreur((command,fact,mocle,),c.lineno) + diff --git a/Traducteur/renamemocle.py b/Traducteur/renamemocle.py index e4f8448d..90c0aa35 100644 --- a/Traducteur/renamemocle.py +++ b/Traducteur/renamemocle.py @@ -100,7 +100,7 @@ def renameMotCleInFact(jdc,command,fact,mocle,new_name, ensemble=regles.SansRegl if erreur : EcritErreur((command,fact,mocle),c.lineno) else : - logging.info("Renommage de: %s, %s, %s, en %s",n.name,n.lineno,n.colno,new_name) + logging.info("Renommage de: %s, ligne %s, en %s",n.name,n.lineno,new_name) if boolChange : jdc.reset(jdc.getSource()) @@ -128,7 +128,7 @@ def renameCommande(jdc,command,new_name,ensemble=regles.SansRegle): if ensemble.verif(c) == 0 : continue boolChange=1 if debug:print "Renommage de:",c.name,new_name ,c.lineno,c.colno - logging.info("Renommage de: %s en ligne %d en %s",c.name,c.lineno,new_name) + logging.info("Renommage de: %s ligne %d en %s",c.name,c.lineno,new_name) s=jdc.getLines()[c.lineno-1] jdc.getLines()[c.lineno-1]=s[:c.colno]+new_name+s[c.colno+len(command):] diff --git a/Traducteur/traduitV7V8.py b/Traducteur/traduitV7V8.py index 1b53c44e..2b591a49 100644 --- a/Traducteur/traduitV7V8.py +++ b/Traducteur/traduitV7V8.py @@ -7,6 +7,7 @@ Typical use is: python traduitV7V8.py --infile=xxxx --outfile=yyyy """ +import sys import log import optparse @@ -18,7 +19,7 @@ from renamemocle import * from inseremocle import * from changeValeur import * from movemocle import * -from dictErreurs import GenereErreurPourCommande +from dictErreurs import GenereErreurPourCommande,GenereErreurMotCleInFact import calcG @@ -35,9 +36,71 @@ atraiter=( "IMPR_GENE","CALC_FONCTION", "DEFI_MATERIAU","STAT_NON_LINE", "CALC_PRECONT","DEFI_TEXTURE","TEST_RESU","COMB_CHAM_NO","COMB_CHAM_ELEM", "CALC_FATIGUE","IMPR_OAR", "AFFE_CHAR_MECA_F", "MACR_ASCOUF_CALC","MACR_ASPIC_CALC","MACR_CABRI_CALC", - "MACR_ADAP_MAIL","IMPR_FICO_HOMARD","DEFI_PART_FETI", + "MACR_ADAP_MAIL","IMPR_FICO_HOMARD","DEFI_PART_FETI" ) +dict_erreurs={ +#STA8 + "DIST_LIGN_3D": "la commande DIST_LIGN_3D a ete supprimee", + "DEFI_THER_JOULE": "la commande DIST_LIGN_3D a ete supprimee", + "DIST_LIGN_3D": "la commande DIST_LIGN_3D a ete supprimee", + "AFFE_MODELE_AFFE": "Les modelisations APPUI_REP, ASSE_GRIL et 3D_JOINT_CT ont ete supprimees", + "AFFE_CHAR_MECA_CONTACT_FROTTEMENT": "Suppression d un mot clef FROTTEMENT", + "AFFE_CHAR_MECA_SECH_CALCULEE": "le sechage est maintenant une variable de commande", + "AFFE_CHAR_MECA_HYDR_CALCULEE": "l'hydratation est maintenant une variable de commande", + "AFFE_CHAR_MECA_EPSA_CALCULEE":"EPSA est maintenant une variable de commande", + "AFFE_CHAR_MECA_PRESSION_CALCULEE":"PRESSION_CALCULEE est remplace par EVOL_CHAR", + "MACR_LIGN_COUPE" : "MACR_LIGN_COUPE demande un traitement manuel", + "POST_RCCM" : "POST_RCCM demande un traitement manuel", + "DEFI_MATERIAU_CHABOCHE" : "remplacer la valeur CINx_CHAB", + "DEFI_MATERIAU_POLY_CFC" : "le materiau POLY_CFC est remplace par le comportement POLYCRISTAL", + "DEFI_MATERIAU_ECOU_PLAS1" : "le materiau ECOU_PLAS1 est supprime", + "DEFI_MATERIAU_COMP_THM_ELAS_THM" : "le materiau ELAS_THM a ete supprime", + "DEFI_MATERIAU_COMP_THM_SURF_ETAT_SATU" : "le materiau SURF_ETAT_SATU a ete supprime", + "DEFI_MATERIAU_COMP_THM_SURF_ETAT_NSAT" : "le materiau SURF_ETAT_NSAT a ete supprime", + "DEFI_MATERIAU_COMP_THM_CAM_CLAY_THM" : "le materiau CAM_CLAY_THM a ete supprime", + "DEFI_MATERIAU_COMP_THM_LIQU_SATU_GAT" : "le materiau LIQU_SATU_GAT a ete supprime", + "DEFI_MATERIAU_COMP_THM_LIQU_NSAT_GAT" : "le materiau LIQU_NSAT_GAT a ete supprime", + "DEFI_MATERIAU_GLRC" : "le materiau GLRC a ete remplace par GLRC_DAMAGE", + "DEFI_MATERIAU_GLRC_FO" : "le materiau GLRC_FO a ete remplace par GLRC_DAMAGE", + "DEFI_MATERIAU_OHNO" : "le materiau OHNO a ete remplace par TAHERI", + "DEFI_MATERIAU_OHNO_FO" : "le materiau OHNO a ete remplace par TAHERI", + "CALC_CHAM_ELEM":"reecrire la partie SOUR_ELGA_ELEC", + "CALC_G_THETA_T_OPTION_VALEUR":"verifier la valeur d OPTION", + "CALC_G_THETA_T_OPTION_DEFAUT":"verifier la valeur d OPTION donnee a la place du defaut", + "CALC_G_MODELE":"Mot Clef MODELE supprimé sous CALC_G", + "CALC_G_DEPL":"Mot Clef DEPL supprimé sous CALC_G", + "CALC_G_CHAM_MATER":"Mot Clef CHAM_MATER supprimé sous CALC_G", + "CALC_G_CARA_ELEM":"Mot Clef CARA_ELEM supprimé sous CALC_G", + "CALC_G_RESULTAT=XXX,":"Mot Clef RESULTAT à completer sous CALC_G", + "AFFE_MODELE_AFFE_MODELISATION_VALEUR":"verifier la valeur de MODELISATION", + "STAT_NON_LINE_COMP_INCR_RELATION_VALEUR":"verifier la valeur de RELATION", + "STAT_NON_LINE_COMP_INCR_RELATION_KIT_VALEUR":"verifier la valeur de RELATION_KIT", + "STAT_NON_LINE_VARI_COMM":"suppression des variables de commande", + "STAT_NON_LINE_INCREMENT_SUBD_PAS":"Si SUBD_PAS=1 il n'y a pas subdivision : le mot est clef est ote du STAT_NON_LINE", + "DYNA_NON_LINE_COMP_INCR_RELATION_VALEUR":"verifier la valeur de RELATION", + "DYNA_NON_LINE_COMP_INCR_RELATION_KIT_VALEUR":"verifier la valeur de RELATION_KIT", + "DYNA_NON_LINE_VARI_COMM":"suppression des variables de commande", + "DYNA_NON_LINE_INCREMENT_SUBD_PAS":"Si SUBD_PAS=1 il n'y a pas subdivision : le mot est clef est ote du DYNA_NON_LINE", + "CALC_PRECONT_SUBD_PAS":"Si SUBD_PAS=1 il n'y a pas subdivision : le mot est clef est ote du CALC_PRECONT", + "TEST_RESU_UNITE":"suppression du mot clef UNITE dans TEST_RESU", + "POST_SIMPLIFIE":"commande POST_SIMPLIFIE supprimee", + "POST_DYNA_ALEA_GAUSS":"la methode GAUSS a ete supprimee de POST_DYNA_ALEA", + "POST_DYNA_ALEA_VANMARCKE":"la methode VANMARCKE a ete supprimee de POST_DYNA_ALEA", + "POST_DYNA_ALEA_DEPASSEMENT":"la methode DEPASSEMENT a ete supprimee de POST_DYNA_ALEA", + "POST_DYNA_ALEA_RAYLEIGH":"la methode RAYLEIGH a ete supprimee de POST_DYNA_ALEA", + "DYNA_TRAN_MODAL_EXCIT_NUME_MODE":"le numero du mode utilise pour EXCIT DYNA_TRAN_MODAL est le numero d'ORDRE", + "DEFI_INTERF_DYNA_INTERFACE_DDL_ACTIF":"DDL_ACTIF supprime de DEFI_INTERF_DYNA; utiliser MASQUE", + "DEFI_TEXTURE":"le materiau POLY_CFC est remplace par le comportement POLYCRISTAL", + "CREA_RESU_NOM_CHAM_VALEUR":"HYDR_ELGA est remplace par HYDR_ELNO_ELGA et HYDR_NOEU_ELGA", + "COMB_CHAM_NO":"COMB_CHAM_NO est remplace par CREA_CHAMP", + "COMB_CHAM_ELEM":"COMB_CHAM_ELEM est remplace par CREA_CHAMP", + "IMPR_OAR":"IMPR_OAR demande un traitement manuel", + "IMPR_FICO_HOMARD":"IMPR_FICO_HOMARD a ete integre dans MACR_ADPA_MAIL", + } + +sys.dict_erreurs=dict_erreurs + #atraiter=( "MACR_ADAP_MAIL",) def traduc(infile,outfile,flog=None): @@ -50,7 +113,7 @@ def traduc(infile,outfile,flog=None): parseKeywords(root) ####################### traitement erreurs ######################## - GenereErreurPourCommande(jdc,("POST_RCCM","DIST_LIGN_3D","IMPR_OAR","COMB_CHAM_NO","COMB_CHAM_ELEM")) + GenereErreurPourCommande(jdc,("DEBUT","POST_RCCM","DIST_LIGN_3D","IMPR_OAR","COMB_CHAM_NO","COMB_CHAM_ELEM")) ####################### traitement CALC_META ####################### renameMotCleInFact(jdc,"CALC_META","ETAT_INIT","META_INIT","META_INIT_ELNO") diff --git a/Traducteur/traduitV8V9.py b/Traducteur/traduitV8V9.py index 13647f1e..a17422e0 100644 --- a/Traducteur/traduitV8V9.py +++ b/Traducteur/traduitV8V9.py @@ -9,6 +9,7 @@ Typical use is: import log import optparse +import sys from load import getJDC from mocles import parseKeywords @@ -18,12 +19,45 @@ from renamemocle import * from inseremocle import * from changeValeur import * from movemocle import * -from dictErreurs import GenereErreurPourCommande +from dictErreurs import GenereErreurPourCommande,GenereErreurMotCleInFact import calcG -atraiter=( "DEFI_MAILLAGE","CALC_VECT_ELEM","DYNA_TRAN_EXPLI","DYNA_NON_LINE","STAT_NON_LINE","FACT_LDLT","FACT_GRAD","RESO_LDLT","RESO_GRAD","DYNA_TRAN_MODAL","NORM_MODE","MACRO_MODE_MECA","POST_RCCM","THER_NON_LINE","THER_LINEAIRE","THER_NON_LINE_MO","DEFI_CABLE_BP","GENE_VARI_ALEA","DEFI_MATERIAU","IMPR_MATRICE","CALC_G","CALC_MATR_ELEM","MACR_ADAP_MAIL","MACR_INFO_MAIL","REST_BASE_PHYS","COMB_SISM_MODAL","TEST_FICHIER","MACR_ELEM_DYNA","CREA_CHAMP","AFFE_CHAR_MECA","AFE_CHAR_MECA_F") +atraiter=( "DEFI_MAILLAGE","CALC_VECT_ELEM","DYNA_TRAN_EXPLI","DYNA_NON_LINE","STAT_NON_LINE","FACT_LDLT","FACT_GRAD","RESO_LDLT","RESO_GRAD","DYNA_TRAN_MODAL","NORM_MODE","MACRO_MODE_MECA","POST_RCCM","THER_NON_LINE","THER_NON_LINE_MO","THER_LINEAIRE","THER_NON_LINE_MO","DEFI_CABLE_BP","GENE_VARI_ALEA","DEFI_MATERIAU","IMPR_MATRICE","CALC_G","CALC_MATR_ELEM","MACR_ADAP_MAIL","MACR_INFO_MAIL","REST_BASE_PHYS","COMB_SISM_MODAL","TEST_FICHIER","MACR_ELEM_DYNA","CREA_CHAMP","AFFE_CHAR_MECA","AFE_CHAR_MECA_F","MODI_MAILLAGE","DEFI_FISS_XFEM","AFFE_MODELE","POST_MAIL_XFEM","CALC_NO","LIRE_CHAMP","AFFE_MATERIAU","MACR_ASCOUF_CALC","MACR_ASPIC_CALC","CALC_PRECONT","LIRE_INTE_SPEC","MACR_CARA_POUTRE","MACR_LIGN_COUPE") + +dict_erreurs={ +# STA9 + "POST_RCCM_SITUATION_NUME_PASSAGE":"Utilisation de NUME_PASSAGE pour le type TUYAUTERIE impossible en 9.2. On ne traite pour le moment que les chemins de passage simples.", + "POST_RCCM_SITUATION_NB_CYCL_SEISME":"POST_RCCM : maintenant les SITUATIONS sismiques ont leur propre mot clef facteur SEISME, attention, traduction incomplete", + "DEFI_MATERIAU_BAZANT_FD" : "le materiau BAZANT_FD a ete supprime", + "DEFI_MATERIAU_APPUI_ELAS" : "le materiau APPUI_ELAS a ete supprime", + "DEFI_MATERIAU_PORO_JOINT" : "le materiau PORO_JOINT a ete supprime", + "DEFI_MATERIAU_ZIRC_CYRA2" : "le materiau ZIRC_CYRA2 a ete supprime", + "DEFI_MATERIAU_ZIRC_EPRI" : "le materiau ZIRC_EPRI a ete supprime", + "IMPR_MATRICE_MATR_ELEM_FORMAT=RESULTAT" : "IMPR_MATRICE au format RESULTAT a ete supprime", + "IMPR_MATRICE_MATR_ASSE_FORMAT=RESULTAT" : "IMPR_MATRICE au format RESULTAT a ete supprime", + "CALC_G_OPTION=G_LAGR" : "l'OPTION G_LAGR de CALC_G a ete supprimee", + "CALC_G_OPTION=G_LAGR_GLOB" : "l'OPTION G_LAGR_GLOB de CALC_G a ete supprimee", + "CALC_MATR_ELEM_THETA" : "l'OPTION RIGI_MECA_LAGR de CALC_MATR_ELEM a ete supprimee", + "TEST_FICHIER_NB_CHIFFRE" : "le fonctionnement de TEST_FICHIER a change entre la V8 et la V9, consultez la doc, en particulier pour entrer la bonne valeur de NB_VALE", + "DYNA_NON_LINE_PILOTAGE" : "le PILOTAGE n'est pas actif dans DYNA_NON_LINE ", + "DYNA_NON_LINE_RECH_LINEAIRE" : "la RECH_LINEAIRE n'est pas active dans DYNA_NON_LINE ", + "DEFI_FISS_XFEM_CONTACT" : "en v9, le contact pour XFEM est defini dans un AFFE_CHAR_MECA(CONTACT=_F) en propre", + "POST_MAIL_XFEM" : "dans POST_MAIL_XFEM il faut entrer le MODELE et le MAILLAGE_SAIN", + "AFFE_MATERIAU_AFFE_TEMP_REF" : "Passage aux variables de commande : definir un materiau dependant de la temperature 'AFFE_MATERIAU(AFFE_VARC=_F(...))' et supprimer TEMP_CALCULEE dans les chargements", + "STAT_NON_LINE_LAGR_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "STAT_NON_LINE_SOLV_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "STAT_NON_LINE_ETAT_INIT_VARI_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "DYNA_NON_LINE_LAGR_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "DYNA_NON_LINE_SOLV_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "DYNA_NON_LINE_ETAT_INIT_VARI_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "CALC_PRECONT_LAGR_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "CALC_PRECONT_SOLV_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "CALC_PRECONT_ETAT_INIT_VARI_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + } + +sys.dict_erreurs=dict_erreurs def traduc(infile,outfile,flog=None): @@ -35,7 +69,7 @@ def traduc(infile,outfile,flog=None): parseKeywords(root) ####################### traitement erreurs ######################## - GenereErreurPourCommande(jdc,("POST_RCCM","DEFI_MATERIAU","TEST_FICHIER","DYNA_NON_LINE")) + GenereErreurPourCommande(jdc,("POST_RCCM","DEFI_MATERIAU","TEST_FICHIER","DYNA_NON_LINE","DEFI_FISS_XFEM","POST_MAIL_XFEM")) ####################### traitement Sous-Structuration ####################### renameMotCleInFact(jdc,"DEFI_MAILLAGE","DEFI_SUPER_MAILLE","MACR_ELEM_STAT","MACR_ELEM") @@ -48,10 +82,21 @@ def traduc(infile,outfile,flog=None): removeMotCle(jdc,"MACR_ELEM_DYNA","OPTION") ######################################################################### - ####################### traitement Resolution lineaire ###################### + ####################### traitement MODI_MAILLAGE ####################### + renameMotCle(jdc,"MODI_MAILLAGE","ORIE_SHB8","ORIE_SHB") + ######################################################################### + + ####################### traitement XFEM ####################### + dXFEM={"3D_XFEM":"3D", "C_PLAN_X":"C_PLAN", "D_PLAN_X":"D_PLAN"} + ChangementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",dXFEM) + renameMotCleInFact(jdc,"DEFI_FISS_XFEM","ORIE_FOND","PT_ORIGIN","POINT_ORIG") + removeMotCleAvecErreur(jdc,"DEFI_FISS_XFEM","CONTACT") + ######################################################################### + + ####################### traitement Resolution lineaire ##################### renameMotCle(jdc,"RESO_LDLT","MATR_FACT","MATR") renameMotCle(jdc,"RESO_GRAD","MATR_ASSE","MATR") - renameMotCle(jdc,"RESO_GRAD","MATR_FACT","MATR_FACT") + renameMotCle(jdc,"RESO_GRAD","MATR_FACT","MATR_PREC") renameOper(jdc,"RESO_LDLT","RESOUDRE") renameOper(jdc,"RESO_GRAD","RESOUDRE") renameOper(jdc,"FACT_LDLT","FACTORISER") @@ -84,6 +129,9 @@ def traduc(infile,outfile,flog=None): renameMotCle(jdc,"THER_NON_LINE","TEMP_INIT","ETAT_INIT",) renameMotCleInFact(jdc,"THER_NON_LINE","INCREMENT","NUME_INIT","NUME_INST_INIT") renameMotCleInFact(jdc,"THER_NON_LINE","INCREMENT","NUME_FIN","NUME_INST_FIN") + + renameMotCleInFact(jdc,"THER_NON_LINE_MO","TEMP_INIT","NUME_INIT","NUME_ORDRE") + renameMotCle(jdc,"THER_NON_LINE_MO","TEMP_INIT","ETAT_INIT",) ######################################################################### ####################### traitement THER_LINEAIRE ############################ @@ -91,6 +139,7 @@ def traduc(infile,outfile,flog=None): renameMotCle(jdc,"THER_LINEAIRE","TEMP_INIT","ETAT_INIT",) renameMotCleInFact(jdc,"THER_LINEAIRE","INCREMENT","NUME_INIT","NUME_INST_INIT") renameMotCleInFact(jdc,"THER_LINEAIRE","INCREMENT","NUME_FIN","NUME_INST_FIN") + renameMotCleInFact(jdc,"THER_LINEAIRE","ARCHIVAGE","LIST_ARCH","LIST_INST") ######################################################################### ####################### traitement THER_NON_LINE ############################ @@ -122,8 +171,8 @@ def traduc(infile,outfile,flog=None): moveMotCleFromFactToFact(jdc,"DEFI_MATERIAU","CAM_CLAY","PA","BARCELONE") renameMotCleInFact(jdc,"DEFI_MATERIAU","CAM_CLAY","PA","KCAM") # CAM_CLAY - AjouteMotClefDansFacteur(jdc,"DEFI_MATERIAU","CAM_CLAY","MU=xxx",) - AjouteMotClefDansFacteurSiRegle(jdc,"DEFI_MATERIAU","CAM_CLAY","PTRAC=XXX",((("CAM_CLAY","KCAM"),"existeMCsousMCF"),)) +# AjouteMotClefDansFacteur(jdc,"DEFI_MATERIAU","CAM_CLAY","MU=xxx",) +# AjouteMotClefDansFacteurSiRegle(jdc,"DEFI_MATERIAU","CAM_CLAY","PTRAC=XXX",((("CAM_CLAY","KCAM"),"existeMCsousMCF"),)) # VENDOCHAB renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB","S_VP","S") renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB","N_VP","N") @@ -147,7 +196,7 @@ def traduc(infile,outfile,flog=None): ######################################################################### ####################### traitement MACR_ADAP/INFO_MAIL ###################### - dadap_mail={"V8_11":"V9_5", "V8_N":"V9_N", "V8_N_PERSO":"V9_N_PERSO"} + dadap_mail={ "V8_5":"V9_5", "V8_N":"V9_N", "V8_N_PERSO":"V9_N_PERSO"} ChangementValeur(jdc,"MACR_ADAP_MAIL","VERSION_HOMARD",dadap_mail) ChangementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",dadap_mail) ######################################################################### @@ -238,7 +287,7 @@ def traduc(infile,outfile,flog=None): ChangementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","RELATION",dDis_Choc) renameMotCleInFact(jdc,"STAT_NON_LINE","COMP_INCR","DIS_CONTACT","DIS_CHOC") renameMotCleInFact(jdc,"DYNA_NON_LINE","COMP_INCR","DIS_CONTACT","DIS_CHOC") - dGrilles={"DIS_GRICRA":"GRILLE_CRAYONS"} + dGrilles={"GRILLE_CRAYONS":"DIS_GRICRA"} ChangementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_INCR","RELATION",dGrilles) ChangementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","RELATION",dGrilles) @@ -251,12 +300,103 @@ def traduc(infile,outfile,flog=None): dAppariement={"MAIT_ESCL_SYME":"MAIT_ESCL"} ChangementValeurDsMCF(jdc,"AFFE_CHAR_MECA","CONTACT","APPARIEMENT",dAppariement) + AjouteMotClefDansFacteurSiRegle(jdc,"AFFE_CHAR_MECA","CONTACT","TYPE_APPA='FIXE'",((("CONTACT","DIRE_APPA",),"existeMCsousMCF"),)) ######################################################################### ####################### traitement CREA_CHAMP ###################### chercheOperInsereFacteurSiRegle(jdc,"CREA_CHAMP","PRECISION=1.E-3,", ((("PRECISION",),"nexistepas"),(("CRITERE",),"existe"),),0) + dTypeChamp={"ELEM_ERREUR":"ELEM_ERRE_R"} + ChangementValeur(jdc,"CREA_CHAMP","TYPE_CHAM",dTypeChamp) + ######################################################################### + + ####################### traitement CALC_NO ###################### + chercheOperInsereFacteurSiRegle(jdc,"CALC_NO","PRECISION=1.E-3,", ((("PRECISION",),"nexistepas"),(("CRITERE",),"existe"),),0) + ######################################################################### + + ######### traitement variables de commandes TEMP_CALCULEE/TEMP_REF ############## + GenereErreurMotCleInFact(jdc,"AFFE_MATERIAU","AFFE","TEMP_REF") + ################################################################################ + + ################# traitement LIRE_CHAMP ####################################### +# dTypeChamp={"ELEM_ERREUR":"ELEM_ERRE_R"} + ChangementValeur(jdc,"LIRE_CHAMP","TYPE_CHAM",dTypeChamp) + ################################################################################ + + + ######### traitement SUIVI_DDL ################################################# +# en pre-traitement il faudrait une methode qui separe tous les mots clefs facteurs en les dupliquant +# par exemple ici mettre autant de mots clefs facteurs SUIVI_DDL qu'il a de _F + AjouteMotClefDansFacteur(jdc,"STAT_NON_LINE","SUIVI_DDL","SUIVI_DDL='OUI'") + renameMotCle(jdc,"STAT_NON_LINE","SUIVI_DDL","OBSERVATION") +# en post-traitement il faudrait une methode qui fusionne tous les mots clefs facteurs en double +# par exemple ici les OBSERVATION + ################################################################################ + + + ######### traitement EVOLUTION in STAT/DYNA_NON_LINE ########################### + removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT","EVOLUTION") + removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT","EVOLUTION") + ################################################################################ + + ######### traitement du MODELE GRILLE ############################################## + dGrille={"GRILLE":"GRILLE_EXCENTRE"} + ChangementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",dGrille) + ################################################################################ + + ######### traitement de MACR_ASPIC/ASCOUF_CALC GRILLE ########################## + removeMotCle(jdc,"MACR_ASCOUF_CALC","CHARGE") + removeMotCle(jdc,"MACR_ASPIC_CALC","CHARGE") + ################################################################################ + + + ############ suppression de NON_LOCAL ########################################## + removeMotCleAvecErreur(jdc,"STAT_NON_LINE","LAGR_NON_LOCAL") + removeMotCleAvecErreur(jdc,"STAT_NON_LINE","SOLV_NON_LOCAL") + removeMotCleInFact(jdc,"STAT_NON_LINE","ETAT_INIT","VARI_NON_LOCAL",erreur=1) + + removeMotCleAvecErreur(jdc,"DYNA_NON_LINE","LAGR_NON_LOCAL") + removeMotCleAvecErreur(jdc,"DYNA_NON_LINE","SOLV_NON_LOCAL") + removeMotCleInFact(jdc,"DYNA_NON_LINE","ETAT_INIT","VARI_NON_LOCAL",erreur=1) + + removeMotCleAvecErreur(jdc,"CALC_PRECONT","LAGR_NON_LOCAL") + removeMotCleAvecErreur(jdc,"CALC_PRECONT","SOLV_NON_LOCAL") + removeMotCleInFact(jdc,"CALC_PRECONT","ETAT_INIT","VARI_NON_LOCAL",erreur=1) + ################################################################################ + + ######### traitement de LIRE_INTE_SPEC ######################################### + renameMotCle(jdc,"LIRE_INTE_SPEC","FORMAT","FORMAT_C") + ################################################################################ + + ######### traitement de MACR_CARA_POUTRE ###################################### + chercheOperInsereFacteurSiRegle(jdc,"MACR_CARA_POUTRE","FORMAT='ASTER'", ((("UNITE_MAILLAGE",),"existe"),),0) + renameMotCle(jdc,"MACR_CARA_POUTRE","UNITE_MAILLAGE","UNITE") + ################################################################################ + + ######### traitement de MACR_LIGN_COUPE ###################################### +# il y a un probleme s'il y a plusieurs mots clefs facteurs LIGN_COUPE : la regle ne marche qu'une fois par commande + AjouteMotClefDansFacteurSiRegle(jdc,"MACR_LIGN_COUPE","LIGN_COUPE","REPERE='LOCAL'", ((("LIGN_COUPE","VECT_Y",),"existeMCsousMCF"),),0) +# autre probleme : s'il y a plusieurs mots clefs facteurs le traducteur peut, dans l'insertion, se tromper de mot clef facteur + AjouteMotClefDansFacteurSiRegle(jdc,"MACR_LIGN_COUPE","LIGN_COUPE","TYPE='GROUP_NO'", ((("LIGN_COUPE","GROUP_NO",),"existeMCsousMCF"),),0) + AjouteMotClefDansFacteurSiRegle(jdc,"MACR_LIGN_COUPE","LIGN_COUPE","TYPE='GROUP_MA'", ((("LIGN_COUPE","GROUP_MA",),"existeMCsousMCF"),),0) + ################################################################################ + + ####################### traitement DRUCKER_PRAGER ####################### + dPRAGER={"DRUCKER_PRAGER":"DRUCK_PRAGER",} + ChangementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_INCR","RELATION",dPRAGER) + ChangementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","RELATION",dPRAGER) + ChangementValeurDsMCF(jdc,"SIMU_POINT_MAT","COMP_INCR","RELATION",dPRAGER) + ChangementValeurDsMCF(jdc,"CALC_PRECONT","COMP_INCR","RELATION",dPRAGER) + ######################################################################### + + ####################### traitement RELATION_KIT ####################### + dKIT={"ELAS_THER":"ELAS",} + ChangementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_INCR","RELATION_KIT",dKIT) + ChangementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","RELATION_KIT",dKIT) + ChangementValeurDsMCF(jdc,"SIMU_POINT_MAT","COMP_INCR","RELATION_KIT",dKIT) + ChangementValeurDsMCF(jdc,"CALC_PRECONT","COMP_INCR","RELATION_KIT",dKIT) ######################################################################### + f=open(outfile,'w') f.write(jdc.getSource()) f.close() diff --git a/UiQT4/OptionsEditeur.py b/UiQT4/OptionsEditeur.py index efd47e7f..f674b1ed 100644 --- a/UiQT4/OptionsEditeur.py +++ b/UiQT4/OptionsEditeur.py @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file 'OptionsEditeur.ui' # -# Created: Tue Nov 18 17:37:26 2008 -# by: PyQt4 UI code generator 4.4.2 +# Created: Fri Apr 24 13:21:13 2009 +# by: PyQt4 UI code generator 4.4.3 # # WARNING! All changes made in this file will be lost! @@ -12,68 +12,82 @@ from PyQt4 import QtCore, QtGui class Ui_desOptions(object): def setupUi(self, desOptions): desOptions.setObjectName("desOptions") - desOptions.resize(570,474) + desOptions.resize(570, 474) + self.gridLayout = QtGui.QGridLayout(desOptions) + self.gridLayout.setObjectName("gridLayout") self.groupBox1 = QtGui.QGroupBox(desOptions) - self.groupBox1.setGeometry(QtCore.QRect(11,11,548,191)) + self.groupBox1.setMinimumSize(QtCore.QSize(548, 191)) self.groupBox1.setObjectName("groupBox1") self.textLabel1_3 = QtGui.QLabel(self.groupBox1) - self.textLabel1_3.setGeometry(QtCore.QRect(30,60,280,20)) + self.textLabel1_3.setGeometry(QtCore.QRect(30, 60, 280, 20)) self.textLabel1_3.setWordWrap(False) self.textLabel1_3.setObjectName("textLabel1_3") self.textLabel1_2_2 = QtGui.QLabel(self.groupBox1) - self.textLabel1_2_2.setGeometry(QtCore.QRect(30,120,280,20)) + self.textLabel1_2_2.setGeometry(QtCore.QRect(30, 120, 280, 20)) self.textLabel1_2_2.setWordWrap(False) self.textLabel1_2_2.setObjectName("textLabel1_2_2") self.CBVersions = QtGui.QComboBox(self.groupBox1) - self.CBVersions.setGeometry(QtCore.QRect(30,20,90,30)) + self.CBVersions.setGeometry(QtCore.QRect(30, 20, 90, 30)) self.CBVersions.setObjectName("CBVersions") self.LERepMat = QtGui.QLineEdit(self.groupBox1) - self.LERepMat.setGeometry(QtCore.QRect(30,140,501,31)) + self.LERepMat.setGeometry(QtCore.QRect(30, 140, 501, 31)) + self.LERepMat.setMinimumSize(QtCore.QSize(501, 31)) self.LERepMat.setObjectName("LERepMat") self.LERepCata = QtGui.QLineEdit(self.groupBox1) - self.LERepCata.setGeometry(QtCore.QRect(30,80,501,31)) + self.LERepCata.setGeometry(QtCore.QRect(30, 80, 501, 31)) + self.LERepCata.setMinimumSize(QtCore.QSize(501, 31)) self.LERepCata.setObjectName("LERepCata") self.Bok = QtGui.QPushButton(self.groupBox1) - self.Bok.setGeometry(QtCore.QRect(440,20,90,31)) + self.Bok.setGeometry(QtCore.QRect(440, 20, 90, 31)) + self.Bok.setMinimumSize(QtCore.QSize(90, 31)) self.Bok.setAutoDefault(False) self.Bok.setObjectName("Bok") + self.gridLayout.addWidget(self.groupBox1, 0, 0, 1, 2) self.groupBox2 = QtGui.QGroupBox(desOptions) - self.groupBox2.setGeometry(QtCore.QRect(11,208,548,90)) + self.groupBox2.setMinimumSize(QtCore.QSize(548, 90)) self.groupBox2.setObjectName("groupBox2") self.LEVersionAjout = QtGui.QLineEdit(self.groupBox2) - self.LEVersionAjout.setGeometry(QtCore.QRect(120,31,101,30)) + self.LEVersionAjout.setGeometry(QtCore.QRect(120, 31, 101, 30)) + self.LEVersionAjout.setMinimumSize(QtCore.QSize(101, 30)) self.LEVersionAjout.setObjectName("LEVersionAjout") self.LEVersionSup = QtGui.QLineEdit(self.groupBox2) - self.LEVersionSup.setGeometry(QtCore.QRect(410,30,101,30)) + self.LEVersionSup.setGeometry(QtCore.QRect(410, 30, 101, 30)) self.LEVersionSup.setObjectName("LEVersionSup") self.PBSup = QtGui.QPushButton(self.groupBox2) - self.PBSup.setGeometry(QtCore.QRect(300,20,101,41)) + self.PBSup.setGeometry(QtCore.QRect(300, 20, 101, 41)) + self.PBSup.setMinimumSize(QtCore.QSize(101, 41)) self.PBSup.setObjectName("PBSup") self.PBajout = QtGui.QPushButton(self.groupBox2) - self.PBajout.setGeometry(QtCore.QRect(10,20,101,41)) + self.PBajout.setGeometry(QtCore.QRect(10, 20, 101, 41)) + self.PBajout.setMinimumSize(QtCore.QSize(101, 41)) self.PBajout.setObjectName("PBajout") - self.PBQuit = QtGui.QPushButton(desOptions) - self.PBQuit.setGeometry(QtCore.QRect(400,420,151,31)) - self.PBQuit.setMinimumSize(QtCore.QSize(0,30)) - self.PBQuit.setObjectName("PBQuit") + self.gridLayout.addWidget(self.groupBox2, 1, 0, 1, 2) self.groupBox3 = QtGui.QGroupBox(desOptions) - self.groupBox3.setGeometry(QtCore.QRect(10,310,548,90)) + self.groupBox3.setMinimumSize(QtCore.QSize(548, 90)) self.groupBox3.setObjectName("groupBox3") self.LERepDoc = QtGui.QLineEdit(self.groupBox3) - self.LERepDoc.setGeometry(QtCore.QRect(20,50,520,31)) + self.LERepDoc.setGeometry(QtCore.QRect(20, 50, 520, 31)) + self.LERepDoc.setMinimumSize(QtCore.QSize(520, 31)) self.LERepDoc.setObjectName("LERepDoc") self.textLabel1 = QtGui.QLabel(self.groupBox3) - self.textLabel1.setGeometry(QtCore.QRect(20,20,280,30)) + self.textLabel1.setGeometry(QtCore.QRect(20, 20, 280, 30)) self.textLabel1.setWordWrap(False) self.textLabel1.setObjectName("textLabel1") + self.gridLayout.addWidget(self.groupBox3, 2, 0, 1, 2) self.Bdefaut = QtGui.QCheckBox(desOptions) - self.Bdefaut.setGeometry(QtCore.QRect(10,430,340,20)) + self.Bdefaut.setMinimumSize(QtCore.QSize(340, 20)) font = QtGui.QFont() font.setPointSize(12) self.Bdefaut.setFont(font) self.Bdefaut.setObjectName("Bdefaut") + self.gridLayout.addWidget(self.Bdefaut, 3, 0, 1, 1) + self.PBQuit = QtGui.QPushButton(desOptions) + self.PBQuit.setMinimumSize(QtCore.QSize(151, 31)) + self.PBQuit.setObjectName("PBQuit") + self.gridLayout.addWidget(self.PBQuit, 3, 1, 1, 1) self.retranslateUi(desOptions) + QtCore.QMetaObject.connectSlotsByName(desOptions) def retranslateUi(self, desOptions): desOptions.setWindowTitle(QtGui.QApplication.translate("desOptions", "Options Aster", None, QtGui.QApplication.UnicodeUTF8)) @@ -86,10 +100,10 @@ class Ui_desOptions(object): "Version :", None, QtGui.QApplication.UnicodeUTF8)) self.PBajout.setText(QtGui.QApplication.translate("desOptions", "Ajouter\n" "Version :", None, QtGui.QApplication.UnicodeUTF8)) - self.PBQuit.setText(QtGui.QApplication.translate("desOptions", "Quitter", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox3.setTitle(QtGui.QApplication.translate("desOptions", "Doc", None, QtGui.QApplication.UnicodeUTF8)) self.textLabel1.setText(QtGui.QApplication.translate("desOptions", "Repertoire d\'acces à la documentation :", None, QtGui.QApplication.UnicodeUTF8)) self.Bdefaut.setText(QtGui.QApplication.translate("desOptions", "Reinitialiser avec les valeurs par defaut", None, QtGui.QApplication.UnicodeUTF8)) + self.PBQuit.setText(QtGui.QApplication.translate("desOptions", "Quitter", None, QtGui.QApplication.UnicodeUTF8)) if __name__ == "__main__": diff --git a/UiQT4/OptionsEditeur.ui b/UiQT4/OptionsEditeur.ui index bbe72dd4..91f63f3f 100644 --- a/UiQT4/OptionsEditeur.ui +++ b/UiQT4/OptionsEditeur.ui @@ -1,258 +1,295 @@ - - - - - desOptions - - - - 0 - 0 - 570 - 474 - - - - Options Aster - + + desOptions + + + + 0 + 0 + 570 + 474 + + + + Options Aster + + + + + + 548 + 191 + + + + Configurer une Version + + - - 11 - 11 - 548 - 191 - - - - Configurer une Version - - - - - 30 - 60 - 280 - 20 - - - - Répertoire d'accès au catalogue : - - - false - - - - - - 30 - 120 - 280 - 20 - - - - Répertoire d'accès aux matériaux : - - - false - - - - - - 30 - 20 - 90 - 30 - - - - - - - 30 - 140 - 501 - 31 - - - - - - - - - - 30 - 80 - 501 - 31 - - - - - - - - - - 440 - 20 - 90 - 31 - - - - Valider - - - false - - + + 30 + 60 + 280 + 20 + + + + Répertoire d'accès au catalogue : + + + false + + + + + + 30 + 120 + 280 + 20 + + + + Répertoire d'accès aux matériaux : + + + false + + + + + + 30 + 20 + 90 + 30 + + + + + + + 30 + 140 + 501 + 31 + + + + + 501 + 31 + + + + + + + + + + 30 + 80 + 501 + 31 + + + + + 501 + 31 + + + + + + + + + + 440 + 20 + 90 + 31 + + + + + 90 + 31 + + + + Valider + + + false + + + + + + + 548 + 90 + + + + Gérer les versions + + - - 11 - 208 - 548 - 90 - - - - Gérer les versions - - - - - 120 - 31 - 101 - 30 - - - - - - - 410 - 30 - 101 - 30 - - - - - - - 300 - 20 - 101 - 41 - - - - Supprimer -Version : - - - - - - 10 - 20 - 101 - 41 - - - - Ajouter + + 120 + 31 + 101 + 30 + + + + + 101 + 30 + + + + + + + 410 + 30 + 101 + 30 + + + + + + + 300 + 20 + 101 + 41 + + + + + 101 + 41 + + + + Supprimer Version : - - - - + + + - - 400 - 420 - 151 - 31 - + + 10 + 20 + 101 + 41 + - - 0 - 30 - + + 101 + 41 + - Quitter + Ajouter +Version : + + + + + + 548 + 90 + + + + Doc + + - - 10 - 310 - 548 - 90 - - - - Doc - - - - - 20 - 50 - 520 - 31 - - - - - - - - - - 20 - 20 - 280 - 30 - - - - Repertoire d'acces à la documentation : - - - false - - - - + + 20 + 50 + 520 + 31 + + + + + 520 + 31 + + + + + + + - - 10 - 430 - 340 - 20 - - - - - 12 - + + 20 + 20 + 280 + 30 + - Reinitialiser avec les valeurs par defaut + Repertoire d'acces à la documentation : + + false + + + + + + + + + 340 + 20 + + + + + 12 + + + + Reinitialiser avec les valeurs par defaut + + + + + + + + 151 + 31 + + + + Quitter + - - - qPixmapFromMimeSource + + + + + qPixmapFromMimeSource + + diff --git a/UiQT4/OptionsPdf.py b/UiQT4/OptionsPdf.py index 6b8ac238..d23873c2 100644 --- a/UiQT4/OptionsPdf.py +++ b/UiQT4/OptionsPdf.py @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file 'OptionsPdf.ui' # -# Created: Tue Nov 18 17:37:26 2008 -# by: PyQt4 UI code generator 4.4.2 +# Created: Tue Jan 27 12:25:38 2009 +# by: PyQt4 UI code generator 4.4.3 # # WARNING! All changes made in this file will be lost! @@ -12,24 +12,24 @@ from PyQt4 import QtCore, QtGui class Ui_desPdf(object): def setupUi(self, desPdf): desPdf.setObjectName("desPdf") - desPdf.resize(538,142) + desPdf.resize(538, 142) self.textLabel1_2 = QtGui.QLabel(desPdf) - self.textLabel1_2.setGeometry(QtCore.QRect(20,10,280,20)) + self.textLabel1_2.setGeometry(QtCore.QRect(20, 10, 280, 20)) self.textLabel1_2.setWordWrap(False) self.textLabel1_2.setObjectName("textLabel1_2") self.BCancel = QtGui.QPushButton(desPdf) - self.BCancel.setGeometry(QtCore.QRect(450,90,70,31)) + self.BCancel.setGeometry(QtCore.QRect(450, 90, 70, 31)) self.BCancel.setObjectName("BCancel") self.LERepPdf = QtGui.QLineEdit(desPdf) - self.LERepPdf.setGeometry(QtCore.QRect(20,40,501,31)) + self.LERepPdf.setGeometry(QtCore.QRect(20, 40, 501, 31)) self.LERepPdf.setObjectName("LERepPdf") self.Bok = QtGui.QPushButton(desPdf) - self.Bok.setGeometry(QtCore.QRect(350,90,70,31)) + self.Bok.setGeometry(QtCore.QRect(350, 90, 70, 31)) self.Bok.setObjectName("Bok") self.retranslateUi(desPdf) - desPdf.setTabOrder(self.LERepPdf,self.Bok) - desPdf.setTabOrder(self.Bok,self.BCancel) + desPdf.setTabOrder(self.LERepPdf, self.Bok) + desPdf.setTabOrder(self.Bok, self.BCancel) def retranslateUi(self, desPdf): desPdf.setWindowTitle(QtGui.QApplication.translate("desPdf", "desPdf", None, QtGui.QApplication.UnicodeUTF8)) diff --git a/UiQT4/aideQT.py b/UiQT4/aideQT.py index 42b7e751..916f3b9f 100644 --- a/UiQT4/aideQT.py +++ b/UiQT4/aideQT.py @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file 'aideQT.ui' # -# Created: Tue Nov 18 17:37:26 2008 -# by: PyQt4 UI code generator 4.4.2 +# Created: Tue Jan 27 12:25:38 2009 +# by: PyQt4 UI code generator 4.4.3 # # WARNING! All changes made in this file will be lost! @@ -12,28 +12,28 @@ from PyQt4 import QtCore, QtGui class Ui_Aide(object): def setupUi(self, Aide): Aide.setObjectName("Aide") - Aide.resize(602,480) + Aide.resize(602, 480) self.gridLayout = QtGui.QGridLayout(Aide) self.gridLayout.setObjectName("gridLayout") self.TB1 = QtGui.QTextBrowser(Aide) self.TB1.setObjectName("TB1") - self.gridLayout.addWidget(self.TB1,0,0,1,4) + self.gridLayout.addWidget(self.TB1, 0, 0, 1, 4) self.PBIndex = QtGui.QPushButton(Aide) - self.PBIndex.setMinimumSize(QtCore.QSize(0,30)) + self.PBIndex.setMinimumSize(QtCore.QSize(0, 30)) self.PBIndex.setObjectName("PBIndex") - self.gridLayout.addWidget(self.PBIndex,1,0,1,1) + self.gridLayout.addWidget(self.PBIndex, 1, 0, 1, 1) self.PBBack = QtGui.QPushButton(Aide) self.PBBack.setEnabled(True) - self.PBBack.setMinimumSize(QtCore.QSize(0,30)) + self.PBBack.setMinimumSize(QtCore.QSize(0, 30)) self.PBBack.setObjectName("PBBack") - self.gridLayout.addWidget(self.PBBack,1,1,1,1) + self.gridLayout.addWidget(self.PBBack, 1, 1, 1, 1) self.PBForward = QtGui.QPushButton(Aide) self.PBForward.setEnabled(True) - self.PBForward.setMinimumSize(QtCore.QSize(0,30)) + self.PBForward.setMinimumSize(QtCore.QSize(0, 30)) self.PBForward.setObjectName("PBForward") - self.gridLayout.addWidget(self.PBForward,1,2,1,1) - spacerItem = QtGui.QSpacerItem(311,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) - self.gridLayout.addItem(spacerItem,1,3,1,1) + self.gridLayout.addWidget(self.PBForward, 1, 2, 1, 1) + spacerItem = QtGui.QSpacerItem(311, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.gridLayout.addItem(spacerItem, 1, 3, 1, 1) self.retranslateUi(Aide) QtCore.QMetaObject.connectSlotsByName(Aide) diff --git a/UiQT4/desChoixCata.py b/UiQT4/desChoixCata.py index 7da381db..4e7eecd6 100644 --- a/UiQT4/desChoixCata.py +++ b/UiQT4/desChoixCata.py @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file 'desChoixCata.ui' # -# Created: Tue Nov 18 17:37:24 2008 -# by: PyQt4 UI code generator 4.4.2 +# Created: Tue Jun 9 14:49:19 2009 +# by: PyQt4 UI code generator 4.4.3 # # WARNING! All changes made in this file will be lost! @@ -12,51 +12,52 @@ from PyQt4 import QtCore, QtGui class Ui_DChoixCata(object): def setupUi(self, DChoixCata): DChoixCata.setObjectName("DChoixCata") - DChoixCata.resize(547,192) + DChoixCata.resize(547, 215) DChoixCata.setSizeGripEnabled(True) self.gridLayout = QtGui.QGridLayout(DChoixCata) self.gridLayout.setObjectName("gridLayout") self.TLNb = QtGui.QLabel(DChoixCata) - self.TLNb.setMinimumSize(QtCore.QSize(30,0)) + self.TLNb.setMinimumSize(QtCore.QSize(30, 0)) self.TLNb.setWordWrap(False) self.TLNb.setObjectName("TLNb") - self.gridLayout.addWidget(self.TLNb,0,0,1,1) + self.gridLayout.addWidget(self.TLNb, 0, 0, 1, 1) self.CBChoixCata = QtGui.QComboBox(DChoixCata) self.CBChoixCata.setEnabled(True) - self.CBChoixCata.setMinimumSize(QtCore.QSize(125,41)) - self.CBChoixCata.setMaximumSize(QtCore.QSize(150,16777215)) + self.CBChoixCata.setMinimumSize(QtCore.QSize(125, 41)) + self.CBChoixCata.setMaximumSize(QtCore.QSize(150, 16777215)) self.CBChoixCata.setObjectName("CBChoixCata") - self.gridLayout.addWidget(self.CBChoixCata,0,1,2,1) + self.gridLayout.addWidget(self.CBChoixCata, 0, 1, 2, 1) self.textLabel1_2 = QtGui.QLabel(DChoixCata) - self.textLabel1_2.setMinimumSize(QtCore.QSize(60,60)) + self.textLabel1_2.setMinimumSize(QtCore.QSize(60, 60)) self.textLabel1_2.setWordWrap(False) self.textLabel1_2.setObjectName("textLabel1_2") - self.gridLayout.addWidget(self.textLabel1_2,1,0,1,1) + self.gridLayout.addWidget(self.textLabel1_2, 1, 0, 1, 1) self.frame3 = QtGui.QFrame(DChoixCata) self.frame3.setFrameShape(QtGui.QFrame.StyledPanel) self.frame3.setFrameShadow(QtGui.QFrame.Raised) self.frame3.setObjectName("frame3") - self.horizontalLayout = QtGui.QHBoxLayout(self.frame3) - self.horizontalLayout.setObjectName("horizontalLayout") self.buttonOk = QtGui.QPushButton(self.frame3) + self.buttonOk.setGeometry(QtCore.QRect(11, 13, 91, 41)) self.buttonOk.setAutoDefault(True) self.buttonOk.setDefault(True) self.buttonOk.setObjectName("buttonOk") - self.horizontalLayout.addWidget(self.buttonOk) - spacerItem = QtGui.QSpacerItem(334,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem) self.buttonCancel = QtGui.QPushButton(self.frame3) + self.buttonCancel.setGeometry(QtCore.QRect(437, 13, 81, 41)) + self.buttonCancel.setMinimumSize(QtCore.QSize(81, 41)) self.buttonCancel.setAutoDefault(True) self.buttonCancel.setObjectName("buttonCancel") - self.horizontalLayout.addWidget(self.buttonCancel) - self.gridLayout.addWidget(self.frame3,2,0,1,2) + self.gridLayout.addWidget(self.frame3, 2, 0, 1, 2) self.retranslateUi(DChoixCata) QtCore.QMetaObject.connectSlotsByName(DChoixCata) def retranslateUi(self, DChoixCata): DChoixCata.setWindowTitle(QtGui.QApplication.translate("DChoixCata", "Choix d\'une version du code Aster", None, QtGui.QApplication.UnicodeUTF8)) - self.TLNb.setText(QtGui.QApplication.translate("DChoixCata", "2 versions sont disponibles", None, QtGui.QApplication.UnicodeUTF8)) + self.TLNb.setText(QtGui.QApplication.translate("DChoixCata", "\n" +"\n" +"

2 versions sont disponibles

", None, QtGui.QApplication.UnicodeUTF8)) self.textLabel1_2.setText(QtGui.QApplication.translate("DChoixCata", "\n" "