From: Pascale Noyret Date: Tue, 8 Jun 2010 15:15:32 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: V2_0~62 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=00a794aa8e11a837ab145d1c6d6ef63a49a1b94e;p=tools%2Feficas.git *** empty log message *** --- diff --git a/Aster/Cata/cataSTA10/Macro/calc_miss_ops.py b/Aster/Cata/cataSTA10/Macro/calc_miss_ops.py index ccb1665f..dae87e78 100644 --- a/Aster/Cata/cataSTA10/Macro/calc_miss_ops.py +++ b/Aster/Cata/cataSTA10/Macro/calc_miss_ops.py @@ -1,22 +1,5 @@ -#@ MODIF calc_miss_ops Macro DATE 16/02/2010 AUTEUR COURTOIS M.COURTOIS +#@ AJOUT calc_miss_ops Macro # -*- coding: iso-8859-1 -*- -# CONFIGURATION MANAGEMENT OF EDF VERSION -# ====================================================================== -# COPYRIGHT (C) 1991 - 2010 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. -# ====================================================================== # RESPONSABLE COURTOIS M.COURTOIS import os diff --git a/Aster/Cata/cataSTA10/Macro/defi_sol_miss_ops.py b/Aster/Cata/cataSTA10/Macro/defi_sol_miss_ops.py index 0b40350d..3a5b8c7f 100644 --- a/Aster/Cata/cataSTA10/Macro/defi_sol_miss_ops.py +++ b/Aster/Cata/cataSTA10/Macro/defi_sol_miss_ops.py @@ -1,22 +1,5 @@ -#@ MODIF defi_sol_miss_ops Macro DATE 28/12/2009 AUTEUR COURTOIS M.COURTOIS +#@ AJOUT defi_sol_miss_ops Macro # -*- coding: iso-8859-1 -*- -# CONFIGURATION MANAGEMENT OF EDF VERSION -# ====================================================================== -# COPYRIGHT (C) 1991 - 2009 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. -# ====================================================================== # RESPONSABLE COURTOIS M.COURTOIS import os diff --git a/Aster/Cata/cataSTA10/Macro/macr_recal_ops.py b/Aster/Cata/cataSTA10/Macro/macr_recal_ops.py index bc6067c5..8c9b7d66 100644 --- a/Aster/Cata/cataSTA10/Macro/macr_recal_ops.py +++ b/Aster/Cata/cataSTA10/Macro/macr_recal_ops.py @@ -26,7 +26,6 @@ import math import glob import numpy as NP -from recal import * debug = False @@ -75,17 +74,6 @@ def force_list(obj, typref=list): return obj -# -------------------------------------------------------------------------------------------------- -def get_absolute_path(path): - """Retourne le chemin absolu en suivant les liens éventuels. - """ - if os.path.islink(path): - path = os.path.realpath(path) - res = os.path.normpath(os.path.abspath(path)) - return res - - - # -------------------------------------------------------------------------------------------------- def macr_recal_ops(self,UNITE_ESCL, RESU_EXP, POIDS, LIST_PARA, RESU_CALC, ITER_MAXI, ITER_FONC_MAXI, RESI_GLOB_RELA,UNITE_RESU,PARA_DIFF_FINI, GRAPHIQUE, METHODE, INFO, **args ): """ Macro commande realisant le recalage de modeles Aster """ @@ -461,7 +449,7 @@ def macr_recal(self, UNITE_ESCL, RESU_EXP, POIDS, LIST_PARA, RESU_CALC, # Calcul de F et G erreur, residu, A_nodim, A = CALCUL_ASTER.calcul_FG(val) - E = CALC_ERROR(experience=RESU_EXP, X0=val, calcul=RESU_CALC, poids=POIDS) + E = recal.CALC_ERROR(experience=RESU_EXP, X0=val, calcul=RESU_CALC, poids=POIDS) E.CalcError(CALCUL_ASTER.Lcalc) E.CalcSensibilityMatrix(CALCUL_ASTER.Lcalc, val, dX=None, pas=PARA_DIFF_FINI) diff --git a/Aster/Cata/cataSTA10/Macro/recal.py b/Aster/Cata/cataSTA10/Macro/recal.py index a4a03926..a9d9fd54 100644 --- a/Aster/Cata/cataSTA10/Macro/recal.py +++ b/Aster/Cata/cataSTA10/Macro/recal.py @@ -46,8 +46,6 @@ try: import aster import Macro from Accas import _F - from Cata import cata - from Cata.cata import * except ImportError: pass diff --git a/Aster/Cata/cataSTA10/cata.py b/Aster/Cata/cataSTA10/cata.py index af312af0..ea93f30d 100755 --- a/Aster/Cata/cataSTA10/cata.py +++ b/Aster/Cata/cataSTA10/cata.py @@ -22,9 +22,6 @@ # faire que la division soit toujours réelle from __future__ import division -__version__ = "$Name: $" -__Id__ = "$Id: cata_aster_v6.py,v 1.12 2001/01/16 15:55:05 iliade Exp $" - import Accas from Accas import * from Accas import _F @@ -5448,8 +5445,6 @@ CALC_ESSAI = MACRO(nom = 'CALC_ESSAI', # RESPONSABLE ASSIRE A.ASSIRE from Macro.calc_europlexus_ops import calc_europlexus_ops -import types - def calc_europlexus_prod(self,COURBE=None,**args): if COURBE is not None: self.type_sdprod(args['TABLE_COURBE'],table_sdaster) @@ -15924,10 +15919,10 @@ EXTR_RESU=OPER(nom="EXTR_RESU",op=176,sd_prod=extr_resu_prod,reentrant='f', # RESPONSABLE COURTOIS M.COURTOIS def extr_table_prod(TYPE_RESU,**args): - from Cata import cata + defs = globals() typ = TYPE_RESU.lower() - if hasattr(cata, typ): - return getattr(cata, typ) + if defs.get(typ) is not None: + return defs[typ] raise AsException("type de concept resultat non prevu") EXTR_TABLE=OPER(nom="EXTR_TABLE",op=173,sd_prod=extr_table_prod,reentrant='n', @@ -17524,8 +17519,6 @@ INTE_MAIL_3D=OPER(nom="INTE_MAIL_3D",op=96,sd_prod=surface_sdaster, def lire_champ_prod(TYPE_CHAM=None,**args): # Remarque : si cette liste évolue, il faut penser à mettre à jour son # homologue dans macr_adap_mail - import string -# if TYPE_CHAM[0:5] == "NOEU_" : return cham_no_sdaster if TYPE_CHAM[0:2] == "EL" : return cham_elem raise AsException("type de concept resultat non prevu") diff --git a/Aster/editeur.ini b/Aster/editeur.ini index 6fe1cde4..e02e77ab 100644 --- a/Aster/editeur.ini +++ b/Aster/editeur.ini @@ -42,6 +42,6 @@ rep_mat_v96=os.path.join(rep_cata,'cataSTA9','materiau') rep_mat_v10=os.path.join(rep_cata,'cataSTA10','materiau') # catalogues=( +#('ASTER','v9.6',os.path.join(rep_cata,'cataSTA9'),'python'), ('ASTER','v10.0',os.path.join(rep_cata,'cataSTA10'),'python','defaut'), -('ASTER','v9.6',os.path.join(rep_cata,'cataSTA9'),'python'), ) diff --git a/InterfaceQT4/monChoixCata.py b/InterfaceQT4/monChoixCata.py index 6cedb517..162207a3 100644 --- a/InterfaceQT4/monChoixCata.py +++ b/InterfaceQT4/monChoixCata.py @@ -44,7 +44,7 @@ class MonChoixCata(Ui_DChoixCata,QtGui.QDialog): self.listeCata=listeCata self.readercata=readercata for cata in self.listeCata : - self.CBChoixCata.insertItem(0,cata) + self.CBChoixCata.insertItem(100,cata) lab = QString(repr(len(listeCata))) lab += QString(" versions du catalogue sont disponibles") self.TLNb.setText(lab) diff --git a/InterfaceQT4/readercata.py b/InterfaceQT4/readercata.py index 6d01db18..aa75f513 100644 --- a/InterfaceQT4/readercata.py +++ b/InterfaceQT4/readercata.py @@ -94,7 +94,7 @@ class READERCATA: self.fic_cata = liste_cata_possibles[0][2] self.version_code = liste_cata_possibles[0][1] self.appliEficas.format_fichier=liste_cata_possibles[0][3] - lab=QString("Eficas V1.") + lab=QString("Eficas ") lab+=QString(self.VERSION_EFICAS) lab+=QString(" pour ") lab+=QString(self.code) @@ -212,14 +212,16 @@ class READERCATA: """ # construction du dictionnaire et de la liste des catalogues self.dico_catalogues = {} - defaut = None + liste_choix=[] for catalogue in self.appliEficas.CONFIGURATION.catalogues: if catalogue[0] == self.code : self.dico_catalogues[catalogue[1]] = catalogue if len(catalogue) == 5 : - if catalogue[4]=='defaut' : defaut = catalogue[1] - liste_choix = self.dico_catalogues.keys() - liste_choix.sort() + if catalogue[4]=='defaut' : + liste_choix.insert(0,catalogue[1]) + else : + liste_choix.append(catalogue[1]) + lab=QString(self.VERSION_EFICAS) lab+=QString(" pour ") @@ -261,7 +263,7 @@ class READERCATA: print self.fic_cata_clef f=open(self.fic_cata_clef) except: - print "Pas de fichier associé contenant des clefs documentaires" + #print "Pas de fichier associé contenant des clefs documentaires" return dict_clef_docu={} diff --git a/Noyau/N_VALIDATOR.py b/Noyau/N_VALIDATOR.py index ffd65710..7a60b914 100644 --- a/Noyau/N_VALIDATOR.py +++ b/Noyau/N_VALIDATOR.py @@ -128,6 +128,10 @@ class TypeProtocol(PProtocol): if is_str(obj): return obj elif type_permis == 'shell': if is_str(obj): return obj + elif type_permis == 'Fichier' : + import os + if os.path.isfile(obj):return obj + else : raise ValError("%s n'est pas un fichier valide" % repr(obj)) elif type(type_permis) == types.ClassType or isinstance(type_permis,type): try: if self.is_object_from(obj,type_permis): return obj diff --git a/generator/generator_map.py b/generator/generator_map.py index 76646cf6..e8e00268 100644 --- a/generator/generator_map.py +++ b/generator/generator_map.py @@ -53,41 +53,47 @@ class MapGenerator(PythonGenerator): # Les extensions de fichier permis? extensions=('.map',) - def gener(self,obj,format='brut',config=None): - print 'generation dans generator_map' + def initialise(self,config): self.config=config self.dictMCVal={} - self.text=PythonGenerator.gener(self,obj,format) - self.generePythonMap() - return self.text + self.listeCODE=[] + self.text="" + self.textCode="" + + def verifie(self): + print 'verification generique' + + def gener(self,obj,format='brut',config=None): + print 'generation dans generator_map' + self.initialise(config) + text=PythonGenerator.gener(self,obj,format) + self.verifie() + self.generePythonMap("non") + return text def generRUN(self,obj,format='brut',config=None,): print 'generRUN dans generator_map' - self.config=config - self.dictMCVal={} + self.initialise(config) text=PythonGenerator.gener(self,obj,format) - self.texteExecution="" - for code in self.dictMCVal.keys(): - if code in self.__class__.__dict__.keys(): - texteCode=apply(self.__class__.__dict__[code],(self,"oui")) - self.texteExecution=self.texteExecution+texteCode + self.verifie() + self.generePythonMap("oui") return self.texteExecution def generRUNYACS(self,obj,format='brut',config=None,): print 'generRUNYACS dans generator_map' - self.config=config - self.dictMCVal={} + self.initialise(config) text=PythonGenerator.gener(self,obj,format) - self.texteExecution="" - for code in self.dictMCVal.keys(): + self.verifie() + for code in self.listeCODE: + print code if code in self.__class__.__dict__.keys(): codeYACS=str(code)+"YACS" texteCode=apply(self.__class__.__dict__[codeYACS],(self,)) self.texteExecution=self.texteExecution+texteCode return self.texteExecution - def generePythonMap(self) : + def generePythonMap(self,execution) : ''' self.dictMCVal est un dictionnaire qui est indexe par le nom du code (exple PYGMEE) la valeur associee a la clef est egalement un dictionnaire @@ -96,10 +102,11 @@ class MapGenerator(PythonGenerator): ''' for code in self.dictMCVal.keys(): if code in self.__class__.__dict__.keys(): - texte=apply(self.__class__.__dict__[code],(self,"non")) + texteCode=apply(self.__class__.__dict__[code],(self,execution)) + self.texteExecution=self.texteExecution+texteCode def generPROC_ETAPE(self,obj): - #print "PN: generPROC_ETAPE dans generatorMap" + self.listeCODE.append(obj.nom) self.clefDico=obj.nom if not( self.dictMCVal.has_key(self.clefDico)): self.dictMCVal[self.clefDico]={} @@ -114,6 +121,8 @@ class MapGenerator(PythonGenerator): else: self.dictMCVal[self.clefDico]=[tempo,self.DictTemp] s=PythonGenerator.generPROC_ETAPE(self,obj) + print self.listeCODE + print self.dictMCVal return s diff --git a/generator/generator_s_poly_st_1.py b/generator/generator_s_poly_st_1.py index bc1b191d..158c829c 100644 --- a/generator/generator_s_poly_st_1.py +++ b/generator/generator_s_poly_st_1.py @@ -83,6 +83,10 @@ class s_poly_st_1Generator(MapGenerator): """ + def verifie(self): + if len(self.listeCODE) != len(set(self.listeCODE)): + raise AsException("il n'est pas prevu d avoir deux fois le meme code dans ce schema") + def PYGMEE(self,execution) : dicoPygmee=self.dictMCVal["PYGMEE"]