import traceback
import types,re,os
import Accas
+import sys
-from .generator_dicoImbrique import DicoImbriqueGenerator
-from .generator_python import PythonGenerator
+from .generator_dico import DicoGenerator
from MapIdentification.mesScripts_MAPIDENTIFICATION import writeMAPinput, writeXMLmaterialparameters, writeXMLexperiences
+
def entryPoint():
"""
Retourne les informations necessaires pour le chargeur de plugins
}
-class MapIdentificationGenerator(DicoImbriqueGenerator):
+class MapIdentificationGenerator(DicoGenerator):
"""
Ce generateur parcourt un objet de type JDC et produit
un texte au format eficas et
def gener(self,obj,format='brut',config=None,appli=None):
self.initDico()
- self.text=PythonGenerator.gener(self,obj,format)
+ self.text=DicoGenerator.gener(self,obj,format)
return self.text
def writeDefault(self, fn):
"""Convert comm file into XML file"""
print("je rentre dans writeDefault")
- print(self.Dico)
-
- if self.Dico.has_key("Parameters_list"):
- writeXMLmaterialparameters(self.Dico["Parameters_list"], fn)
+ print("="*50)
+ print (self.Dico)
+ print("-"*80)
- elif self.Dico.has_key("Experiences"):
- writeXMLexperiences(self.Dico["Experiences"], fn)
- elif self.Dico.has_key("MAP_input_file"):
+ if self.Dico.has_key("MAP_input_file"):
dico = self.Dico["MAP_input_file"]
- print(dico)
+
writeMAPinput(dico, fn)
if dico["constitutive_law_parameters_status"]=="New":
- writeXMLmaterialparameters(dico,
- dico["constitutive_law_parameters"])
+ writeXMLmaterialparameters(dico["b_constitutive_law_parameters_new"])
if dico["exp_filename_list_status"]=="New":
- writeXMLexperiences(dico,
- "tmp_exp.xml")
+ writeXMLexperiences(dico["b_exp_filename_list_new"])
+ else:
+ if self.Dico.has_key("Parameters_list"):
+ writeXMLmaterialparameters(self.Dico["Parameters_list"], fn)
+
+ elif self.Dico.has_key("Experiences_list"):
+ writeXMLexperiences(self.Dico["Experiences_list"], fn)
+
+
+ def generMCSIMP(self,obj) :
+ """recuperation de l objet MCSIMP"""
+ s=DicoGenerator.generMCSIMP(self,obj)
+ courant=self.Dico
+ for p in obj.getGenealogiePrecise()[0:-1]:
+ if not (p in courant.keys()) : courant[p]={}
+ courant=courant[p]
+ courant[obj.nom]=obj.valeur
+ self.texteDico+=obj.nom+ "=" + s[0:-1]+ "\n"
+ return s
+
+ #def generMCSIMP(self,obj) :
+ #"""recuperation de l objet MCSIMP"""
+
+ #s=PythonGenerator.generMCSIMP(self,obj)
+ #if obj.isInformation() : return s
+ #if not obj.isValid() : return s
+
+ #liste=obj.getGenealogiePrecise()
+ #print(obj.getGenealogiePrecise() )
+ #print(obj.valeur )
+ #return s