]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
partage avec eric
authorpascale.noyret <pascale.noyret@edf.fr>
Wed, 23 Sep 2020 09:19:55 +0000 (11:19 +0200)
committerpascale.noyret <pascale.noyret@edf.fr>
Wed, 23 Sep 2020 09:19:55 +0000 (11:19 +0200)
Efi2Xsd/MCAccasXML.py

index 22ea189ebe40a2d746c32732fdf5e908e1dbfcd6..d9dd432b7e9f2a1652b622b12168aaabbef67314 100755 (executable)
@@ -128,7 +128,11 @@ class X_MCSIMP(X_OBJECT):
               print ('self.maClasseModeleMetierFactory', self.maClasseModeleMetierFactory)
         else : self.needFactory=False
       else :
+        print ('_____________________uuuuuuuuuuuuuuuuuuuu')
+        print (self.cata.DicoNomTypeDifferentNomElt)
+        print ('_____________________uuuuuuuuuuuuuuuuuuuu')
         self.monNomClasseModeleMetier='T_'+self.nom
+        if self.monNomClasseModeleMetier=='T_termeLE' : monNomClasseModeleMetier= 'T_termeLE_1'
         if self.nom in list(self.cata.DicoNomTypeDifferentNomElt.keys()) : 
            self.monNomClasseModeleMetier=self.cata.DicoNomTypeDifferentNomElt[self.nom][self.nomComplet()]
         self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier)
@@ -139,7 +143,12 @@ class X_MCSIMP(X_OBJECT):
         else : self.needFactory=False
            
         if self.valeur != None : 
-           if self.needFactory :  self.objPyxb=self.maClasseModeleMetierFactory(self.valeur)
+           if self.needFactory :  
+              if self.definition.max > 1 : 
+                 print (self.monNomClasseModeleMetier)
+                 exit()
+                 self.objPyxb=self.maClasseModeleMetier(self.valeur)
+              else :  self.objPyxb=self.maClasseModeleMetierFactory(self.valeur)
            else                :  self.objPyxb=self.maClasseModeleMetier(self.valeur)
         else                   :  
            if self.needFactory : self.objPyxb=None
@@ -242,11 +251,12 @@ class X_MCCOMPO(X_OBJECT) :
                max=obj[0].definition.max 
            else : max = 1
            if  max == 1 :
-            print ('kkkkkkkkkkkkkkkkkkkkk',obj, type(obj))
-            if not(issubclass(type(obj), pyxb.binding.basis.enumeration_mixin) ):
-               newOrderedContent.append(self.objPyxb.orderedContent()[list(map(lambda o:id(o.value), self.objPyxb.orderedContent())).index(id(obj))] )
-            else :
-               newOrderedContent.append(self.objPyxb.orderedContent()[list(map(lambda o:type(o.value), self.objPyxb.orderedContent())).index(type(obj))] )
+            #if not(issubclass(type(obj), pyxb.binding.basis.enumeration_mixin) ):
+            #   newOrderedContent.append(self.objPyxb.orderedContent()[list(map(lambda o:id(o.value), self.objPyxb.orderedContent())).index(id(obj))] )
+            #else :
+            #   newOrderedContent.append(self.objPyxb.orderedContent()[list(map(lambda o:type(o.value), self.objPyxb.orderedContent())).index(type(obj))] )
+            # PN 22 sept 2020 . pourquoi pas toujours l id. le tyoe ne convient pas en cas d union d enum
+            newOrderedContent.append(self.objPyxb.orderedContent()[list(map(lambda o:id(o.value), self.objPyxb.orderedContent())).index(id(obj))] )
            else  : # element Pural
             for c in self.objPyxb.orderedContent() :
                if isinstance(c._Content__value,list) and  isinstance(c._Content__value[0], type(obj[0].objPyxb)): newOrderedContent.append(c)