From: Pascale Noyret Date: Fri, 21 Jan 2011 15:51:48 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: LOGILAB~337 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0fc140272ccb7c11a3fefac4b0ed86024fb8ebde;p=tools%2Feficas.git *** empty log message *** --- diff --git a/Ihm/I_MCSIMP.py b/Ihm/I_MCSIMP.py index 60cdc817..71a2c014 100644 --- a/Ihm/I_MCSIMP.py +++ b/Ihm/I_MCSIMP.py @@ -564,7 +564,7 @@ class MCSIMP(I_OBJECT.OBJECT): if self.definition.validators: valid=self.definition.validators.verif_item(item) except ValError,e: - #traceback.print_exc() + traceback.print_exc() valid=0 return valid diff --git a/InterfaceQT4/monChoixMap.py b/InterfaceQT4/monChoixMap.py index 41a6739c..0cdbac6b 100644 --- a/InterfaceQT4/monChoixMap.py +++ b/InterfaceQT4/monChoixMap.py @@ -36,7 +36,8 @@ labels = { "s_scc_st_2" : "Analyse statistique de données locales et expérimentales \nou numériques", "s_scc_st_3" : "taux de couverture des joints de grains par des précipités", "s_polymers_st_1" : "Estimation numérique 3D de la diffusion effective des gaz dans les polymères chargés", - +"s_rpv2" : "Essai Pascale", +"s_DIC" : "Essai Felix", } dico={"oxides" : {"irradiation" : "s_oxides_st_1", @@ -46,13 +47,15 @@ dico={"oxides" : {"irradiation" : "s_oxides_st_1", "analyse statistique" : "s_scc_st_2", "taux de couverture" : "s_scc_st_3"}, "concrete" : {}, - "polycristals" : {}, + "polycristals" : {"essai Pascale" : "s_rpv2",}, "polymers" : {"numerique 3D" : "s_polymers_st_1"}, "micro" : {}, "seal" : {}, "mox" : {}, "nano" : {}, - "insulator" : {}} + "insulator" : {}, + "images" : {"Felix" : "s_DIC"} +} # Import des panels @@ -96,6 +99,7 @@ class MonChoixMap(Ui_ChoixMap,QtGui.QDialog): self.groupModules.addButton(self.RBM8) self.groupModules.addButton(self.RBM9) self.groupModules.addButton(self.RBM10) + self.groupModules.addButton(self.RBM11) self.groupScheme=QButtonGroup(self.groupBoxScheme) self.connect(self.groupModules,SIGNAL("buttonClicked (QAbstractButton*)"),self.modifieModule) self.connect(self.groupScheme,SIGNAL("buttonClicked (QAbstractButton*)"),self.choisitSchema) diff --git a/InterfaceQT4/readercata.py b/InterfaceQT4/readercata.py index d6119edb..5e4eb22b 100644 --- a/InterfaceQT4/readercata.py +++ b/InterfaceQT4/readercata.py @@ -87,10 +87,15 @@ class READERCATA: # TODO: Remove this filter. Normally, CONFIGURATION should only define the catalogs for this code anyway. # Non pas pour Map qui a une notion de sscode for catalogue in all_cata_list: + print catalogue.code + print catalogue.file_format if catalogue.code == self.code : if (self.ssCode == None) or (self.ssCode == catalogue.file_format): liste_cata_possibles.append(catalogue) + print "___________" + print self.ssCode + print self.code if len(liste_cata_possibles)==0: QMessageBox.critical( self.QWParent, "Import du catalogue","Pas de catalogue defini pour le code %s" % self.code) self.appliEficas.close() diff --git a/MAP/Templates/s_DIC/s_DIC_YACS_nodes.py b/MAP/Templates/s_DIC/s_DIC_YACS_nodes.py new file mode 100644 index 00000000..bd82b032 --- /dev/null +++ b/MAP/Templates/s_DIC/s_DIC_YACS_nodes.py @@ -0,0 +1,60 @@ +import os +import sys + +try : + sys.path.append(os.path.join(os.getenv('MAP_DIRECTORY'),'classes/python/')) + from class_MAP_parameters import * +except : + pass + + +#------------------------- +class component_RBM: +#------------------------- + + def __init__(self,CS,CSJ,GS,GSJ,VMAX,VMAXJ,study_path): + print "RBM - BEGIN" + composant="RBM" + RBM_input = study_path+"/RBM.input" + parameter=MAP_parameters() + parameter.add_component(composant) + parameter.add_parameter(composant, 'CS', CS) + parameter.add_parameter(composant, 'CSJ', CSJ) + parameter.add_parameter(composant, 'GS', GS) + parameter.add_parameter(composant, 'GSJ', GSJ) + parameter.add_parameter(composant, 'VMAX', VMAX) + parameter.add_parameter(composant, 'VMAXJ', VMAXJ) + parameter.write(RBM_input) + + #commande= "cd "+ commponent_dir +";" + #commande+= "python rbm.py -i "+RBM_input+";\n" + #os.system(commande) + + print "RBM - END" + + +#------------------------- +class component_DISPL: +#------------------------- + + def __init__(self,CS,CSJ,GS,GSJ,VMAXJ,VMAX,study_path): + print "DISPL - BEGIN" + composant="DISPL" + DISPL_input = study_path+"/DISPL.input" + parameter=MAP_parameters() + parameter.add_component(composant) + parameter.add_parameter(composant, 'CS', CS) + parameter.add_parameter(composant, 'CSJ', CSJ) + parameter.add_parameter(composant, 'GS', GS) + parameter.add_parameter(composant, 'GSJ', GSJ) + parameter.add_parameter(composant, 'VMAX', VMAX) + parameter.add_parameter(composant, 'VMAXJ', VMAXJ) + parameter.write(DISPL_input) + + #commande= "cd "+ commponent_dir +";" + #commande+= "python rbm.py -i "+DISPL_input+";\n" + #os.system(commande) + + print "DISPL - END" + + diff --git a/MAP/catalogues_MAP.ini b/MAP/catalogues_MAP.ini index 00d58556..74e21f9b 100644 --- a/MAP/catalogues_MAP.ini +++ b/MAP/catalogues_MAP.ini @@ -7,5 +7,7 @@ catalogues = ( # (code, ssCode, catalogue, formatOut, formatIN) ('MAP','s_polymers_st_1_V1',os.path.join(rep_cata,'s_polymers_st_1_V1.py'),'s_polymers_st_1','MAP'), ('MAP','s_scc_st_2_V1',os.path.join(rep_cata,'s_scc_st_2_V1.py'),'s_scc_st_2','MAP'), + ('MAP','s_rpv2_V0',os.path.join(rep_cata,'s_rpv2_V0.py'),'s_rpv2','MAP'), + ('MAP','s_DIC_V1',os.path.join(rep_cata,'s_DIC_V1.py'),'s_DIC','MAP'), ) diff --git a/UiQT4/desChoixMap.ui b/UiQT4/desChoixMap.ui index dc8e8a83..c196095c 100644 --- a/UiQT4/desChoixMap.ui +++ b/UiQT4/desChoixMap.ui @@ -90,7 +90,7 @@ 390 20 261 - 311 + 331 @@ -103,7 +103,7 @@ 110 20 261 - 311 + 331 @@ -180,6 +180,13 @@ + + + + images + + + diff --git a/generator/generator_map.py b/generator/generator_map.py index a690c2b9..4766a880 100644 --- a/generator/generator_map.py +++ b/generator/generator_map.py @@ -72,7 +72,7 @@ class MapGenerator(PythonGenerator): self.ssCode=self.config.appli.ssCode self.INSTALLDIR=self.config.appli.INSTALLDIR self.ssCodeDir=os.path.join(self.INSTALLDIR,'MAP/Templates',self.ssCode) - self.fichierYacs=self.ssCode+"YACS_nodes" + self.fichierYacs=self.ssCode+"_YACS_nodes" self.texteExecution="import os,sys\n" self.texteExecution+="sys.path.append('"+self.ssCodeDir+"')\n" self.texteExecution+="from " + self.fichierYacs +" import *\n" @@ -87,6 +87,7 @@ class MapGenerator(PythonGenerator): text=PythonGenerator.gener(self,obj,format) for elt in self.listeCODE: code=elt.keys()[0] + self.dico=elt[code] if code in self.__class__.__dict__.keys(): texteCode=apply(self.__class__.__dict__[code],(self,)) self.texteExecution += texteCode @@ -148,10 +149,10 @@ class MapGenerator(PythonGenerator): Convertit un objet MCSIMP en texte python """ s=PythonGenerator.generMCSIMP(self,obj) - clef="" - for i in obj.get_genealogie() : - clef=clef+"_"+i - self.DictTemp[clef]=obj.valeur + #clef="" + #for i in obj.get_genealogie() : + # clef=clef+"_"+i + self.DictTemp[obj.nom]=obj.valeur if hasattr(obj.definition,'equiv') and obj.definition.equiv!= None: setattr(self,obj.definition.equiv,obj.valeur) else : diff --git a/generator/generator_s_DIC.py b/generator/generator_s_DIC.py new file mode 100644 index 00000000..cc0ffeb0 --- /dev/null +++ b/generator/generator_s_DIC.py @@ -0,0 +1,85 @@ +# -* coding: utf-8 -*- +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== +""" + Ce module contient le plugin generateur de fichier au format + SEP pour EFICAS. + +""" +import traceback +import types,string,re,os + +from generator_map import MapGenerator + +import sys +try : + sys.path.append(os.path.join(os.getenv('MAP_DIRECTORY'),'classes/python/')) + from class_MAP_parameters import * +except : + pass + + +def entryPoint(): + """ + Retourne les informations necessaires pour le chargeur de plugins + + Ces informations sont retournees dans un dictionnaire + """ + return { + # Le nom du plugin + 'name' : 's_DIC', + # La factory pour creer une instance du plugin + 'factory' : s_DICGenerator, + } + + +class s_DICGenerator(MapGenerator): + """ + Ce generateur parcourt un objet de type JDC et produit + un texte au format eficas et + un texte au format py + + """ + + def LIST_IMAGES(self): + print "je ne sais pas ce qu il faut faire" + commande="print 'je ne sais pas ce qu il faut faire avec le fichier :" + commande += str(self.FILE) +" '\n" + return commande + + def RBM(self): + print self.dico + if not self.dico.has_key('CSJ') : self.dico['CSJ']=self.dico['CS'] + if not self.dico.has_key('GSJ') : self.dico['GSJ']=self.dico['GS'] + if not self.dico.has_key('VMAXJ') : self.dico['VMAXJ']=self.dico['VMAX'] + commande="execRBM=component_RBM("+str(self.dico['CS'])+","+str(self.dico['CSJ'])+"," + commande+=str(self.dico['GS'])+","+str(self.dico['GSJ'])+"," + commande+=str(self.dico['VMAX'])+","+str(self.dico['VMAXJ'])+",'"+str(self.study_path)+"')\n" + return commande + + def DISPL(self): + print self.dico + if not self.dico.has_key('CSJ') : self.dico['CSJ']=self.dico['CS'] + if not self.dico.has_key('GSJ') : self.dico['GSJ']=self.dico['GS'] + if not self.dico.has_key('VMAXJ') : self.dico['VMAXJ']=self.dico['VMAX'] + commande="execDISPL=component_DISPL("+str(self.dico['CS'])+","+str(self.dico['CSJ'])+"," + commande+=str(self.dico['GS'])+","+str(self.dico['GSJ'])+"," + commande+=str(self.dico['VMAX'])+","+str(self.dico['VMAXJ'])+",'"+str(self.study_path)+"')\n" + return commande