From: PASCALE NOYRET Date: Mon, 29 Aug 2022 14:19:06 +0000 (+0200) Subject: ajout de la projection des elements constants X-Git-Tag: merge_uncertainty_odysee_1210~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5606dfdc93cf01977d9b0b1cc3ae4b1e5d7ec50a;p=tools%2Feficas.git ajout de la projection des elements constants --- diff --git a/Efi2Xsd/AccasXsd.py b/Efi2Xsd/AccasXsd.py index 3a3749b0..a5a232bf 100755 --- a/Efi2Xsd/AccasXsd.py +++ b/Efi2Xsd/AccasXsd.py @@ -1126,15 +1126,27 @@ class X_SIMP (X_definition): if not multiple : self.texteSimple += debutSimpleType.format(self.nomDuTypePyxb) else : self.texteSimple += debutSimpleTypeSsNom + + # gestion des elements constants + if self.homo == "constant" : + if type(self.defaut) in ( 'tuple', 'list'): + self.intoConstant = self.defaut + else : + self.intoConstant = [self.defaut,] + else : + self.intoConstant = None + + # On est dans une liste if self.max > 1 or self.max == '**' or self.max == float('inf') or hasattr(self.type[0], 'ntuple') : self.texteSimple += debutTypeSimpleListe self.texteSimple += "\t\t\t\t"+debutRestrictionBase.format(self.nomDuTypeDeBase) if self.val_min != float('-inf') : self.texteSimple += "\t\t\t\t"+minInclusiveBorne.format(self.val_min) if self.val_max != float('inf') and self.val_max != '**' : self.texteSimple +="\t\t\t\t"+ maxInclusiveBorne.format(self.val_max) - if self.into != None: + if self.into != None or self.intoConstant != None: # PN --> traduction des into into=self.into + if self.intoConstant != None : into = self.intoConstant if self.intoXML != None : into = self.intoXML for val in into : self.texteSimple += "\t\t\t\t"+enumeration.format(val) if PourTraduction : @@ -1148,8 +1160,9 @@ class X_SIMP (X_definition): self.texteSimple += debutRestrictionBase.format(self.nomDuTypeDeBase) if self.val_min != float('-inf') : self.texteSimple += minInclusiveBorne.format(self.val_min) if self.val_max != float('inf') and self.val_max != '**' : self.texteSimple += maxInclusiveBorne.format(self.val_max) - if self.into != None: + if self.into != None or self.intoConstant != None: into=self.into + if self.intoConstant != None : into = self.intoConstant if self.intoXML != None : into = self.intoXML for val in into : self.texteSimple += enumeration.format(val) if PourTraduction :