]> SALOME platform Git repositories - tools/eficas.git/blob - VirtualPolymer/VP_Cata_V2.py
Salome HOME
91ad8d220e9b90ff34f4b63df89b271c8228bf75
[tools/eficas.git] / VirtualPolymer / VP_Cata_V2.py
1 # coding: utf-8\r
2 import types\r
3 from Accas import *\r
4 \r
5 import lienDB\r
6 import listesDB\r
7 \r
8 monDico= { 'Equation_Liste' : ('initiation', 'propagation', 'termination', 'stabilization'),\r
9            'Modele_TechnicalUse' : ('cable', 'coating', 'pipes'),\r
10          }\r
11 \r
12 monModele=listesDB.sModele().monModele\r
13 \r
14 JdC = JDC_CATA(code='VP',\r
15                execmodul=None,\r
16                 )\r
17 \r
18 \r
19   \r
20 #---------------------------------\r
21 Equation = PROC (nom="Equation",\r
22       op=None,\r
23 #---------------------------------\r
24       Equation_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base") ),\r
25       Equation_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show equation database", "Equation creation"),),\r
26 \r
27       \r
28 #     ---------------------------------------------------------------------------\r
29        b_type_show = BLOC(condition = " Equation_Type == 'Show equation database'",\r
30 #      ---------------------------------------------------------------------------\r
31         Equation_Liste=SIMP(statut= 'o',typ= 'TXM', into=('reaction_type','aging_type')),\r
32 \r
33          b_reaction_type =  BLOC(condition = " Equation_Liste  == 'reaction_type'",\r
34            Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=monDico['Equation_Liste'],siValide=lienDB.recupereDicoEquation),\r
35          ), # Fin b_reaction_type\r
36 \r
37          b_aging_type =  BLOC(condition = " Equation_Liste  == 'aging_type'",\r
38               Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=('All', 'thermo', 'radio'),siValide=lienDB.recupereDicoEquation),\r
39          ), # Fin b_reaction_type\r
40 \r
41          ListeEquation = SIMP(statut='o', typ='TXM',  homo='SansOrdreNiDoublon',siValide=lienDB.afficheValeurEquation),\r
42          b_modification = BLOC(condition = " ListeEquation != None ",\r
43            modification = SIMP(typ = bool, statut = 'o',defaut = False, fr='toto', ang='toto en anglais', siValide=lienDB.instancieChemicalFormulation),\r
44            \r
45            b_modif = BLOC(condition = "modification == True",\r
46             Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],),\r
47             Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'),),\r
48             ChemicalFormulation = SIMP(statut='o', typ='TXM', defaut = 'POOH -> 2P'),\r
49 \r
50             OptionnelConstituant =  FACT ( statut = 'f',max = '**',\r
51                 Constituant = SIMP (statut = 'o', typ = 'TXM'),\r
52                 Differential_Equation =  SIMP(statut= 'o',typ= 'TXM'),\r
53                ), # fin Const_Equa\r
54             OptionnelleConstante  = FACT (statut = 'f', max = '**',\r
55                   ConstanteName= SIMP (statut = 'o', typ = 'TXM',),\r
56                   ConstanteType =  SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),\r
57                   ),# fin ConstanteOptionnelle\r
58             Commentaire =  SIMP (statut = 'f', typ = 'TXM', defaut = ' '),\r
59 \r
60            ),# fin b_modif\r
61          \r
62          ), # fin b_modification\r
63        ), # Fin b_type_show\r
64 \r
65 \r
66 #     ---------------------------------------------------------------------------\r
67       b_type_creation = BLOC(condition = " Equation_Type == 'Equation creation'",\r
68 #         ---------------------------------------------------------------------------\r
69          Equation_Modification = FACT ( statut = 'o',\r
70  \r
71             ChemicalFormulation = SIMP(statut='o', typ='TXM', defaut = 'POOH -> 2P'),\r
72 \r
73             Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],),\r
74             Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'),),\r
75 \r
76             Constituants = FACT ( statut = 'o',\r
77                ConstituantPOOH = SIMP (statut = 'f', typ = 'TXM', into = ('POOH',)),\r
78                b_pooh =  BLOC(condition = " ConstituantPOOH == 'POOH'" ,\r
79                   Differential_Equation_POOH =  SIMP(statut= 'o',typ= 'TXM', defaut = '-ku1*POOH'),\r
80                ), # Fin b_pooh\r
81                #ConstituantP = SIMP (statut = 'f', typ = 'TXM', into = ('P',)),\r
82                #b_p =  BLOC(condition = " ConstituantP == 'P'" ,\r
83                #  Differential_Equation_P =  SIMP(statut= 'o',typ= 'TXM', defaut = '2*ku1*POOH'),\r
84                #), # Fin b_p\r
85                ConstituantP = FACT ( statut = 'f',\r
86                   ConstituantP = SIMP (statut = 'f', typ = 'TXM', into = ('P',)),\r
87                   Differential_Equation_P =  SIMP(statut= 'o',typ= 'TXM', defaut = '2*ku1*POOH'),\r
88                ), # Fin ConstituantP\r
89 \r
90             OptionnelConstituant =  FACT ( statut = 'f',max = '**',\r
91                 Constituant = SIMP (statut = 'o', typ = 'TXM'),\r
92                 Differential_Equation =  SIMP(statut= 'o',typ= 'TXM'),\r
93                ), # fin Const_Equa\r
94             ),# Fin Constituants\r
95 \r
96             Constante = FACT ( statut = 'o',\r
97                Constanteku1 = SIMP (statut = 'f', typ = 'TXM', into = ('ku1',), defaut= 'ku1'),\r
98                b_cku1 =  BLOC(condition = "Constanteku1 == 'ku1'" ,\r
99                   ConstanteType =  SIMP(statut= 'o',typ= 'TXM', into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),\r
100                   ),\r
101                OptionnelleConstante  = FACT (statut = 'f', max = '**',\r
102                   ConstanteName= SIMP (statut = 'o', typ = 'TXM',),\r
103                   ConstanteType =  SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),\r
104                   ),# fin ConstanteOptionnelle\r
105             ), # fin constante\r
106             Commentaire =  SIMP (statut = 'f', typ = 'TXM', defaut = ' '),\r
107                   \r
108          ), # Fin Equation_Modification\r
109         ),  # fin b_type_creation\r
110                  \r
111       \r
112 ) # Fin Equation\r
113 \r
114 #---------------------------------\r
115 Modele = PROC (nom="Modele",\r
116       op=None,\r
117       Modele_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base"),siValide=lienDB.recupereDicoModele ),\r
118       Modele_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show modele database", "Modele creation"),siValide=lienDB.creeListeEquation),\r
119 #     ---------------------------------------------------------------------------\r
120       b_type_creation = BLOC(condition = " Modele_Type == 'Modele creation'",\r
121 #         ---------------------------------------------------------------------------\r
122         technicalUse= SIMP(statut= 'o',typ= 'TXM',into=monDico['Modele_TechnicalUse'],defaut=monModele.technical_use ),\r
123         modeleName=SIMP(statut='o',typ='TXM',defaut=monModele.nom,),\r
124         material=SIMP(statut='o',typ='TXM',defaut=monModele.materiaux[0],),\r
125         stabilizer = SIMP(typ = bool, statut = 'o',defaut = monModele.stabilise),\r
126         model_developed_by_for_EDF = SIMP(typ = bool, statut = 'o',defaut = monModele.dvt_EDF[0]),\r
127         documentation=SIMP(statut='o',typ='TXM',defaut=monModele.reference,),\r
128         \r
129        # ajouter la liste des equations et le remove (il faut garder ceux qu on a enlever)\r
130       \r
131 \r
132        AjoutEquation=SIMP(statut= 'o',typ= bool, defaut=False, siValide=lienDB.recupereModeleEquation),\r
133        b_ajout_equation = BLOC(condition = " AjoutEquation == True",\r
134           listeEquation_initiation=SIMP(statut='o', typ='TXM',homo='SansOrdreNiDoublon', max='**', min=0, defaut=[] ),\r
135           listeEquation_propagation=SIMP(statut='o', typ='TXM',homo='SansOrdreNiDoublon', max='**', min=0, defaut=[] ),\r
136           listeEquation_termination=SIMP(statut='o', typ='TXM',homo='SansOrdreNiDoublon', max='**', min=0, defaut=[] ),\r
137           listeEquation_stabilization=SIMP(statut='o',typ='TXM', homo='SansOrdreNiDoublon', max='**', min=0, defaut=[] ),\r
138        ),# fin b_ajout_equation\r
139        \r
140         # coefficients monModele.coef = liste de dictionnaire mais il faut prendre que le 0\r
141         # on enleve ceux qui commence par D, S et B(casse imprtante)\r
142         # la clef est le coef, puis les valeurs\r
143 \r
144         Aging_Type=SIMP(statut= 'o',typ='TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'), defaut=monModele.type_vieil),\r
145         Diffusion = SIMP(typ = bool, statut = 'o',defaut = monModele.diffusion,siValide = lienDB.prepareDiffusion),\r
146 \r
147         b_diffusion = BLOC(condition = " Diffusion == True",\r
148          #coefficients monModele.coef = liste de dictionnaire mais il faut prendre que le 0\r
149         # on met ceux qui commence par D, S et pas les B ni les aitres( casse imprtante)\r
150            listeProduitPourLaDiffusion=SIMP(statut='o', typ='TXM', max='**', min=1,homo='SansOrdreNiDoublon', into = monModele.param_ini.keys(),siValide=lienDB.ajouteDiffusion), \r
151        ),  # fin b_diffusion\r
152  \r
153        ),  # fin b_type_creation\r
154 \r
155 \r
156        #AjoutEquation=Fact(statut='f',\r
157        #     Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],siValide=lienDB.recupereModeleEquation),\r
158        #), # fin AjoutEquation\r
159 \r
160       Commentaire =  SIMP (statut = 'f', typ = 'TXM'),\r
161 ) # Fin Modele\r