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