]> SALOME platform Git repositories - modules/eficas.git/commitdiff
Salome HOME
Ajout methode generDico
authorpascale.noyret <pascale.noyret@edf.fr>
Thu, 16 Mar 2017 10:34:33 +0000 (11:34 +0100)
committerpascale.noyret <pascale.noyret@edf.fr>
Thu, 16 Mar 2017 10:34:33 +0000 (11:34 +0100)
InterfaceQT4/editor.py
generator/generator_dico.py

index 9b79350fff63c6cb855925f45314b8e24fe243d0..291798a33a85f0a63db795b4c4857ff021fdd466 100755 (executable)
@@ -522,7 +522,15 @@ class JDCEditor(Ui_baseWidget,QWidget):
         a=self.monExe.readAllStandardOutput()
         self.w.view.append(QString.fromUtf8(a.data(),len(a))) ;
         
-
+    #-----------------------#
+    def generDico(self):
+    #-----------------------#
+       print ('jkljlkjklj')
+       if 'dicoImbrique' in generator.plugins:
+         self.generator=generator.plugins['dico']()
+         jdc_formate=self.generator.gener(self.jdc)
+         dico=self.generator.Dico
+         return dico
 
     #-----------------------#
     def gestionParam(self):
@@ -1221,6 +1229,7 @@ class JDCEditor(Ui_baseWidget,QWidget):
             the name of the saved file
         """
 
+        print (self.generDico())
         self.modified=1
         if not self.modified and not saveas:
             return (0, None)      # do nothing if text wasn't changed
index bf935fbad6096436c43ac329a95d678a027e9288..1b08fdf9fd73b41a242f1ae3aa486f841563f10f 100644 (file)
@@ -70,6 +70,7 @@ class DicoGenerator(PythonGenerator):
    
    def initDico(self) :
  
+      self.Dico={}
       self.texteDico = ""
 
 
@@ -91,6 +92,11 @@ class DicoGenerator(PythonGenerator):
    def generMCSIMP(self,obj) :
         """recuperation de l objet MCSIMP"""
         s=PythonGenerator.generMCSIMP(self,obj)
+        courant=self.Dico
+        for p in obj.get_genealogie_precise()[0:-1]:
+            if not (p in courant.keys()) : courant[p]={}
+            courant=courant[p]
+        courant[obj.nom]=obj.val
         self.texteDico+=obj.nom+ "=" + s[0:-1]+ "\n"
         return s