]> SALOME platform Git repositories - tools/eficas.git/blob - VirtualPolymer/VP_Cata_V1.py.ok
Salome HOME
1e7206787509ef730a38efe59b548e910b28c9c0
[tools/eficas.git] / VirtualPolymer / VP_Cata_V1.py.ok
1 # coding: utf-8\r
2 import types\r
3 from Accas import *\r
4 \r
5 \r
6 class Tuple:\r
7   def __init__(self,ntuple):\r
8     self.ntuple=ntuple\r
9 \r
10   def __convert__(self,valeur):\r
11     if type(valeur) == types.StringType: return None\r
12     if len(valeur) != self.ntuple: return None\r
13     return valeur\r
14 \r
15   def info(self):\r
16     return "Tuple de %s elements" % self.ntuple\r
17 \r
18   __repr__=info\r
19   __str__=info\r
20 \r
21 #class ObjetUtilisateur(ASSD): pass\r
22 \r
23 def maFunc():\r
24     return ('a1','a2','a3')\r
25      \r
26 def maFuncWithArg(monMC):\r
27     if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return\r
28     monMC.dsMaFunct = True\r
29 \r
30     editor=monMC.jdc.editor\r
31     if monMC.valeur == 'POOH->P' : monInto=('a1','a2','a3')\r
32     else : monInto=('b1','b2','b3')\r
33 \r
34     change=editor.changeIntoDefMC('AGING', ('Equation', 'b_approved','b_type_creation','Equation_Modification','Type2'), monInto )\r
35     if change :\r
36        print ('j ai change le into')\r
37        editor.reCalculeValiditeMCApresChgtInto('AGING', 'Type2', ('Equation', 'b_approved','b_type_creation','Equation_Modification')) \r
38        if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()\r
39 \r
40     monMC.dsMaFunct = False\r
41 \r
42 \r
43 \r
44 monDico= { 'Equation_Liste' : ('initiation', 'propagation', 'termination', 'stabilization')}\r
45 \r
46 JdC = JDC_CATA(code='VP',\r
47                execmodul=None,\r
48                 )\r
49 \r
50 \r
51 AGING = PROC (nom="AGING",\r
52     op=None,\r
53   \r
54 #---------------------------------\r
55     Equation  = FACT(statut= 'o',\r
56 #---------------------------------\r
57       Equation_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base") ),\r
58       Equation_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show equation database", "Equation creation"),),\r
59 \r
60 #     ---------------------------------------------------------------------------\r
61        b_type_show = BLOC(condition = " Equation_Type == 'Show equation database'",\r
62 #      ---------------------------------------------------------------------------\r
63         Equation_Liste=SIMP(statut= 'o',typ= 'TXM', into=('reaction_type','aging_type')),\r
64 \r
65          b_reaction_type =  BLOC(condition = " Equation_Liste  == 'reaction_type'",\r
66            Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=monDico['Equation_Liste'],),\r
67          ), # Fin b_reaction_type\r
68 \r
69          b_aging_type =  BLOC(condition = " Equation_Liste  == 'aging_type'",\r
70               Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=('All', 'thermo', 'radio'),),\r
71          ), # Fin b_reaction_type\r
72 \r
73          ), # Fin b_type_show\r
74 \r
75 #     ---------------------------------------------------------------------------\r
76       b_type_creation = BLOC(condition = " Equation_Type == 'Equation creation'",\r
77 #         ---------------------------------------------------------------------------\r
78          Equation_Modification = FACT ( statut = 'o',\r
79             Chemical_Formulation =  SIMP(statut= 'o',typ= 'TXM', defaut = 'POOH->P'),\r
80             Equation_reaction1=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],),\r
81             Equation_reaction2=SIMP(statut= 'o',typ= 'TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'),),\r
82 \r
83             Constituants = FACT ( statut = 'o',\r
84                ConstituantPOOH = SIMP (statut = 'f', typ = 'TXM', into = ('POOH',), defaut= 'POOH'),\r
85                b_pooh =  BLOC(condition = " ConstituantPOOH == 'POOH'" ,\r
86                   Differential_Equation =  SIMP(statut= 'o',typ= 'TXM', defaut = '-ku1*POOH'),\r
87                ), # Fin b_pooh\r
88                ConstituantP = SIMP (statut = 'f', typ = 'TXM', into = ('P',),defaut='P'),\r
89                b_p =  BLOC(condition = " ConstituantP == 'P'" ,\r
90                  Differential_Equation =  SIMP(statut= 'o',typ= 'TXM', defaut = '2*ku1*POOH'),\r
91                ), # Fin b_p\r
92             OptionnelConstituant =  FACT ( statut = 'f',max = '**',\r
93                 Constituant = SIMP (statut = 'o', typ = 'TXM'),\r
94                 Differential_Equation =  SIMP(statut= 'o',typ= 'TXM'),\r
95                ), # fin Const_Equa\r
96             ),# Fin Constituants\r
97 \r
98             Constante = FACT ( statut = 'o',\r
99                Constanteku1 = SIMP (statut = 'f', typ = 'TXM', into = ('ku1',), defaut= 'ku1'),\r
100                b_cku1 =  BLOC(condition = "Constanteku1 == 'ku1'" ,\r
101                   ConstanteType =  SIMP(statut= 'o',typ= 'TXM', into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),\r
102                   ),\r
103                ConstanteOptionnelle  = FACT (statut = 'f', max = '**',\r
104                   ConstanteName= SIMP (statut = 'o', typ = 'TXM',),\r
105                   ConstanteType =  SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),\r
106                   ),# fin ConstanteOptionnelle\r
107             ), # fin constante\r
108             Commentaire =  SIMP (statut = 'f', typ = 'TXM'),\r
109                   \r
110          ), # Fin Equation_Modification\r
111 \r
112 \r
113                  #Chemical_Formulation =  SIMP(statut= 'o',typ= 'TXM', defaut = 'POOH->P',siValide=maFuncWithArg),\r
114                  #Type1 = SIMP(statut='o', typ = 'TXM', into=maFunc),\r
115                  #Type2 = SIMP(statut='o', typ = 'TXM'),\r
116 \r
117         ),  # fin b_type_creation\r
118                  \r
119       \r
120     ), # Fin Equation\r
121 )\r
122 \r
123 TEXTE_NEW_JDC="AGING()"\r