]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
Modification du dictionnaire pour prendre en compte la valeur par defaut
authorLUCIE BERTHON <C41270@dsp0887684.atlas.edf.fr>
Tue, 11 Sep 2018 09:45:20 +0000 (11:45 +0200)
committerLUCIE BERTHON <C41270@dsp0887684.atlas.edf.fr>
Tue, 11 Sep 2018 09:45:20 +0000 (11:45 +0200)
generator/generator_MapIdentification.py
generator/generator_dico.py

index 58285861cdf703dd0b275e7da188e2ef019f0250..71708e0052899c1fb0079ef78760956059de2ccd 100644 (file)
@@ -31,12 +31,13 @@ except : pass
 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
@@ -51,7 +52,7 @@ def entryPoint():
            }
 
 
-class MapIdentificationGenerator(DicoImbriqueGenerator):
+class MapIdentificationGenerator(DicoGenerator):
     """
        Ce generateur parcourt un objet de type JDC et produit
        un texte au format eficas et 
@@ -63,28 +64,53 @@ class MapIdentificationGenerator(DicoImbriqueGenerator):
 
     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
index 20cba9eb9c83540c96fabfc495d11abc8078c2e5..f44654d9fb710aca56f76440623ef46f968428f9 100644 (file)
@@ -95,7 +95,7 @@ class DicoGenerator(PythonGenerator):
         for p in obj.getGenealogiePrecise()[0:-1]:
             if not (p in courant.keys()) : courant[p]={}
             courant=courant[p]
-        courant[obj.nom]=obj.val
+        courant[obj.nom]=obj.valeur
         self.texteDico+=obj.nom+ "=" + s[0:-1]+ "\n"
         return s