From: pascale.noyret Date: Wed, 30 May 2018 13:31:56 +0000 (+0200) Subject: essai de fact xml avec maxOccurs=4 X-Git-Tag: avantMenage~82 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8e39c7eaa9bdce152cef21a8f4863b6e3d6d361f;p=tools%2Feficas.git essai de fact xml avec maxOccurs=4 --- diff --git a/Accas/A_BLOC.py b/Accas/A_BLOC.py index 29571726..badd8d9d 100644 --- a/Accas/A_BLOC.py +++ b/Accas/A_BLOC.py @@ -20,9 +20,11 @@ from __future__ import absolute_import from Noyau import N_BLOC from Ihm import I_ENTITE -from . import A_MCBLOC +from Accas import A_MCBLOC +from Efi2Xsd.AccasXsd import X_BLOC -class BLOC(N_BLOC.BLOC,I_ENTITE.ENTITE): + +class BLOC(N_BLOC.BLOC,X_BLOC,I_ENTITE.ENTITE): class_instance=A_MCBLOC.MCBLOC def __init__(self,*tup,**args): I_ENTITE.ENTITE.__init__(self) diff --git a/Accas/A_ETAPE.py b/Accas/A_ETAPE.py index 0a9b8e94..4c72b812 100644 --- a/Accas/A_ETAPE.py +++ b/Accas/A_ETAPE.py @@ -21,10 +21,10 @@ from __future__ import absolute_import from Noyau import N_ETAPE from Validation import V_ETAPE from Ihm import I_ETAPE +from Efi2Xsd.MCAccasXsd import X_MCCOMPO -class ETAPE(I_ETAPE.ETAPE,V_ETAPE.ETAPE, - N_ETAPE.ETAPE): +class ETAPE(I_ETAPE.ETAPE,V_ETAPE.ETAPE,X_MCCOMPO,N_ETAPE.ETAPE): def __init__(self,oper=None,reuse=None,args={}): - # Pas de constructeur pour B_ETAPE.ETAPE + #print ('ETAPE accas', oper.nom) N_ETAPE.ETAPE.__init__(self,oper,reuse,args) V_ETAPE.ETAPE.__init__(self) diff --git a/Accas/A_FACT.py b/Accas/A_FACT.py index e26c97fa..ebccc614 100644 --- a/Accas/A_FACT.py +++ b/Accas/A_FACT.py @@ -20,10 +20,12 @@ from __future__ import absolute_import from Noyau import N_FACT from Ihm import I_ENTITE -from . import A_MCFACT -from . import A_MCLIST +from Accas import A_MCFACT +from Accas import A_MCLIST +from Efi2Xsd.AccasXsd import X_FACT -class FACT(N_FACT.FACT,I_ENTITE.ENTITE): + +class FACT(N_FACT.FACT,X_FACT,I_ENTITE.ENTITE): class_instance=A_MCFACT.MCFACT list_instance=A_MCLIST.MCList def __init__(self,*tup,**args): diff --git a/Accas/A_JDC.py b/Accas/A_JDC.py index 8ef54772..d17bd234 100644 --- a/Accas/A_JDC.py +++ b/Accas/A_JDC.py @@ -22,12 +22,14 @@ from Noyau import N_JDC from Validation import V_JDC from Extensions import jdc from Ihm import I_JDC +from Efi2Xsd.MCAccasXsd import X_JDC -class JDC(jdc.JDC,I_JDC.JDC,V_JDC.JDC,N_JDC.JDC): +class JDC(jdc.JDC,I_JDC.JDC,X_JDC,V_JDC.JDC,N_JDC.JDC): from .A_ASSD import CO,assd def __init__(self,*pos,**args): N_JDC.JDC.__init__(self,*pos,**args) + X_JDC.__init__(self) V_JDC.JDC.__init__(self) I_JDC.JDC.__init__(self) jdc.JDC.__init__(self) diff --git a/Accas/A_JDC_CATA.py b/Accas/A_JDC_CATA.py index 75e1c27e..fd8a248d 100644 --- a/Accas/A_JDC_CATA.py +++ b/Accas/A_JDC_CATA.py @@ -21,8 +21,9 @@ from __future__ import absolute_import from . import A_JDC from Noyau import N_JDC_CATA from Ihm import I_JDC_CATA +from Efi2Xsd.AccasXsd import X_JDC_CATA -class JDC_CATA(I_JDC_CATA.JDC_CATA,N_JDC_CATA.JDC_CATA): +class JDC_CATA(I_JDC_CATA.JDC_CATA,N_JDC_CATA.JDC_CATA,X_JDC_CATA): class_instance=A_JDC.JDC def __init__(self,*pos,**kw): #print pos diff --git a/Accas/A_MACRO_ETAPE.py b/Accas/A_MACRO_ETAPE.py index a9af4827..2bba807e 100644 --- a/Accas/A_MACRO_ETAPE.py +++ b/Accas/A_MACRO_ETAPE.py @@ -22,8 +22,10 @@ from Noyau import N_MACRO_ETAPE from Validation import V_MACRO_ETAPE from Ihm import I_MACRO_ETAPE from .A_ASSD import CO +from Efi2Xsd.MCAccasXsd import X_MCCOMPO class MACRO_ETAPE(I_MACRO_ETAPE.MACRO_ETAPE, + X_MCCOMPO, V_MACRO_ETAPE.MACRO_ETAPE, N_MACRO_ETAPE.MACRO_ETAPE): typeCO=CO diff --git a/Accas/A_MCBLOC.py b/Accas/A_MCBLOC.py index 0cc5047b..d6d1bcb5 100644 --- a/Accas/A_MCBLOC.py +++ b/Accas/A_MCBLOC.py @@ -21,8 +21,10 @@ from __future__ import absolute_import from Noyau import N_MCBLOC from Validation import V_MCBLOC from Ihm import I_MCBLOC +from Efi2Xsd.MCAccasXsd import X_MCCOMPO -class MCBLOC(I_MCBLOC.MCBLOC,N_MCBLOC.MCBLOC,V_MCBLOC.MCBLOC): + +class MCBLOC(I_MCBLOC.MCBLOC,N_MCBLOC.MCBLOC,X_MCCOMPO,V_MCBLOC.MCBLOC): def __init__(self,val,definition,nom,parent): N_MCBLOC.MCBLOC.__init__(self,val,definition,nom,parent) V_MCBLOC.MCBLOC.__init__(self) diff --git a/Accas/A_MCFACT.py b/Accas/A_MCFACT.py index 03128a79..31fe0a4e 100644 --- a/Accas/A_MCFACT.py +++ b/Accas/A_MCFACT.py @@ -21,8 +21,9 @@ from __future__ import absolute_import from Noyau import N_MCFACT from Validation import V_MCFACT from Ihm import I_MCFACT +from Efi2Xsd.MCAccasXsd import X_MCFACT -class MCFACT(I_MCFACT.MCFACT,N_MCFACT.MCFACT,V_MCFACT.MCFACT): +class MCFACT(I_MCFACT.MCFACT,N_MCFACT.MCFACT,X_MCFACT,V_MCFACT.MCFACT): def __init__(self,val,definition,nom,parent): N_MCFACT.MCFACT.__init__(self,val,definition,nom,parent) V_MCFACT.MCFACT.__init__(self) diff --git a/Accas/A_MCLIST.py b/Accas/A_MCLIST.py index 7ba5c53f..5554f5ec 100644 --- a/Accas/A_MCLIST.py +++ b/Accas/A_MCLIST.py @@ -21,7 +21,9 @@ from __future__ import absolute_import from Noyau import N_MCLIST from Validation import V_MCLIST from Ihm import I_MCLIST +from Efi2Xsd.MCAccasXsd import X_MCLIST -class MCList(I_MCLIST.MCList,N_MCLIST.MCList,V_MCLIST.MCList): + +class MCList(I_MCLIST.MCList,N_MCLIST.MCList,X_MCLIST,V_MCLIST.MCList): def __init__(self): N_MCLIST.MCList.__init__(self) diff --git a/Accas/A_MCSIMP.py b/Accas/A_MCSIMP.py index cc246e89..c3920907 100644 --- a/Accas/A_MCSIMP.py +++ b/Accas/A_MCSIMP.py @@ -21,8 +21,9 @@ from __future__ import absolute_import from Noyau import N_MCSIMP from Validation import V_MCSIMP from Ihm import I_MCSIMP +from Efi2Xsd.MCAccasXsd import X_MCSIMP -class MCSIMP(I_MCSIMP.MCSIMP,N_MCSIMP.MCSIMP,V_MCSIMP.MCSIMP): +class MCSIMP(I_MCSIMP.MCSIMP,N_MCSIMP.MCSIMP,X_MCSIMP,V_MCSIMP.MCSIMP): def __init__(self,val,definition,nom,parent): N_MCSIMP.MCSIMP.__init__(self,val,definition,nom,parent) V_MCSIMP.MCSIMP.__init__(self) diff --git a/Accas/A_OPER.py b/Accas/A_OPER.py index 7c1e59e4..c1a4f0a5 100644 --- a/Accas/A_OPER.py +++ b/Accas/A_OPER.py @@ -20,9 +20,11 @@ from __future__ import absolute_import from Noyau import N_OPER from Ihm import I_ENTITE -from . import A_ETAPE +from Accas import A_ETAPE +from Efi2Xsd.AccasXsd import X_OPER -class OPER(N_OPER.OPER,I_ENTITE.ENTITE): + +class OPER(N_OPER.OPER,X_OPER,I_ENTITE.ENTITE): class_instance=A_ETAPE.ETAPE def __init__(self,*tup,**args): I_ENTITE.ENTITE.__init__(self) diff --git a/Accas/A_PROC.py b/Accas/A_PROC.py index a920913d..0ae8bb48 100644 --- a/Accas/A_PROC.py +++ b/Accas/A_PROC.py @@ -20,13 +20,14 @@ from __future__ import absolute_import from Noyau import N_PROC from Ihm import I_ENTITE -from . import A_PROC_ETAPE +from Accas import A_PROC_ETAPE +from Efi2Xsd.AccasXsd import X_PROC -class PROC(N_PROC.PROC,I_ENTITE.ENTITE): +class PROC(N_PROC.PROC,X_PROC,I_ENTITE.ENTITE): class_instance=A_PROC_ETAPE.PROC_ETAPE def __init__(self,*tup,**args): - #print tup - #print args + #print (tup) + #print (args) I_ENTITE.ENTITE.__init__(self) N_PROC.PROC.__init__(self,*tup,**args) diff --git a/Accas/A_PROC_ETAPE.py b/Accas/A_PROC_ETAPE.py index b3ab7529..7db1db8b 100644 --- a/Accas/A_PROC_ETAPE.py +++ b/Accas/A_PROC_ETAPE.py @@ -21,9 +21,11 @@ from __future__ import absolute_import from Noyau import N_PROC_ETAPE from Validation import V_PROC_ETAPE from Ihm import I_PROC_ETAPE +from Efi2Xsd.MCAccasXsd import X_MCCOMPO class PROC_ETAPE(I_PROC_ETAPE.PROC_ETAPE, V_PROC_ETAPE.PROC_ETAPE, + X_MCCOMPO, N_PROC_ETAPE.PROC_ETAPE): def __init__(self,oper=None,args={}): N_PROC_ETAPE.PROC_ETAPE.__init__(self,oper=oper,args=args) diff --git a/Accas/A_SIMP.py b/Accas/A_SIMP.py index 9a438d15..584627ed 100644 --- a/Accas/A_SIMP.py +++ b/Accas/A_SIMP.py @@ -20,9 +20,10 @@ from __future__ import absolute_import from Noyau import N_SIMP from Ihm import I_ENTITE -from . import A_MCSIMP +from Accas import A_MCSIMP +from Efi2Xsd.AccasXsd import X_SIMP -class SIMP(N_SIMP.SIMP,I_ENTITE.ENTITE): +class SIMP(N_SIMP.SIMP,X_SIMP,I_ENTITE.ENTITE): class_instance=A_MCSIMP.MCSIMP def __init__(self,*tup,**args): #print tup diff --git a/Atmo/atmo.png b/Atmo/atmo.png deleted file mode 100755 index 2e8d4a5f..00000000 Binary files a/Atmo/atmo.png and /dev/null differ diff --git a/Atmo/cata_test_fact_genere.xsd b/Atmo/cata_test_fact_genere.xsd index b28391ae..06a1f004 100644 --- a/Atmo/cata_test_fact_genere.xsd +++ b/Atmo/cata_test_fact_genere.xsd @@ -12,32 +12,32 @@ - - + + - - + + - + - - + + - + - - + + - + - + diff --git a/Atmo/cata_test_types.py b/Atmo/cata_test_types.py new file mode 100755 index 00000000..d0f75fe8 --- /dev/null +++ b/Atmo/cata_test_types.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2012-2013 EDF +# +# This file is part of SALOME HYDRO module. +# +# SALOME HYDRO module is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# SALOME HYDRO module is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with SALOME HYDRO module. If not, see . + +import types +from Accas import * + + + +JdC = JDC_CATA(code='Atmos',regles = (UN_PARMI('Wind',)), + ) +Wind = PROC( nom="Wind", op = None, + FACTA = FACT( statut='o', + VinAetBnotC = SIMP(statut = "o", typ = 'I'), + SousFactInAetBnotC = FACT( statut='o', + S1 = SIMP(statut = "o", typ = 'I'), + S2 = SIMP(statut = "o", typ = 'I'), + ), + ), + FACTB = FACT( statut='o', + VinAetBnotC = SIMP(statut = "o", typ = 'I'), + SousFactInAetBnotC = FACT( statut='o', + S1 = SIMP(statut = "o", typ = 'I'), + S2 = SIMP(statut = "o", typ = 'I'), + ), + ), + FACTC = FACT( statut='o', + VinAetBnotC = SIMP(statut = "o", typ = 'R'), + SousFactInAetBnotC = FACT( statut='o', + S1 = SIMP(statut = "o", typ = 'I'), + S2 = SIMP(statut = "o", typ = 'R'), + ), + ), + FACTD = FACT( statut='o', + # identique FACTC + # donc pas de creation de Type mais utilisation de ceux de FACTC + VinAetBnotC = SIMP(statut = "o", typ = 'R'), + SousFactInAetBnotC = FACT( statut='o', + S1 = SIMP(statut = "o", typ = 'I'), + S2 = SIMP(statut = "o", typ = 'R'), + ), + ), + FACTE = FACT( statut='o', + S3 = SIMP(statut = "o", typ = 'I'), + BinEetFNotG = BLOC(condition="S3 == 0", + S4 = SIMP(statut = "o", typ = 'I'), + ), + ), + FACTF = FACT( statut='o', + S3 = SIMP(statut = "o", typ = 'I'), + BinEetFNotG = BLOC(condition="S3 == 0", + S4 = SIMP(statut = "o", typ = 'I'), + ), + ), + FACTG = FACT( statut='o', + S3 = SIMP(statut = "o", typ = 'I'), + BinEetFNotG = BLOC(condition="S3 == 1", + S4 = SIMP(statut = "o", typ = 'I'), + ), + ), +) + diff --git a/Atmo/cree_essai1_fact_xml.py b/Atmo/cree_essai1_fact_xml.py new file mode 100644 index 00000000..0d51a13c --- /dev/null +++ b/Atmo/cree_essai1_fact_xml.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +import raw.cata_genere_fact as mdm +s1=mdm.T_Niveau1SIMP(1) +s2=mdm.T_Niveau2SIMP(2) +s31=mdm.T_Niveau3SIMP(3) +s4=mdm.T_Niveau4SIMP(4) +s32=mdm.T_Niveau3SIMP(5) +s6=mdm.T_Niveau4SIMP(6) + +f31=mdm.T_Niveau3Fact(s4) +f32=mdm.T_Niveau3Fact(s6) + +#f2=mdm.T_Niveau2Fact(s31,f31) +f2=mdm.T_Niveau2Fact(s32,f32) +# ligne suivante nonok ? +#f2=mdm.T_Niveau2Fact(s31,f31,s32,f32) +#f2=mdm.T_Niveau2Fact(s31) # ok --> s obligatoire et f facultatif +#f2=mdm.T_Niveau2Fact(f31) # nok +f1=mdm.T_Niveau1Fact(s2,f2) +wind=mdm.T_Wind(s1,f1) +jdd=mdm.Atmos(wind) +#print (jdd.toxml()) +print(jdd.toDOM().toprettyxml()) diff --git a/Atmo/essai1_fact.xml b/Atmo/essai1_fact.xml new file mode 100644 index 00000000..2266d6ba --- /dev/null +++ b/Atmo/essai1_fact.xml @@ -0,0 +1,16 @@ + + + + 1 + + 2 + + 5 + + 6 + + + + + + diff --git a/Atmo/essai2_fact.xml b/Atmo/essai2_fact.xml new file mode 100644 index 00000000..3d771100 --- /dev/null +++ b/Atmo/essai2_fact.xml @@ -0,0 +1,20 @@ + + + + 1 + + 2 + + 3 + + 4 + + 5 + + 6 + + + + + +