8 maClasseDelistesDB = listesDB.classeListesDB()
\r
9 monModele=listesDB.sModele().monModele
\r
12 # --------------------------------------
\r
13 # Fonctions appellees depuis le catalogue
\r
14 # --------------------------------------
\r
16 # --------------------------------------
\r
18 # --------------------------------------
\r
20 def recupereDicoEquation(monMC):
\r
21 # Equation_reaction (ds 2 blocs)
\r
22 # ou dans Equation b_type_show b_reaction_type
\r
23 # ou dans Equation b_type_show b_aging_type
\r
25 if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return
\r
26 editor=monMC.jdc.editor
\r
28 valeurDB=editor.getValeur('Equation','Equation_DB',())
\r
29 maClasseDelistesDB.metAJour(valeurDB)
\r
30 listEquation=maClasseDelistesDB.getListEquation()
\r
32 valeurEquationListe=editor.getValeur('Equation','Equation_Liste',('b_type_show',))
\r
33 valeurAgingType=editor.getValeur('Equation','Equation_reaction',('b_type_show','b_reaction_type',))
\r
34 if valeurAgingType == None :
\r
35 valeurAgingType=editor.getValeur('Equation','Equation_reaction',('b_type_show','b_aging_type',))
\r
36 if valeurAgingType == None : monMC.dsMaFunct = False; return
\r
38 listeEquationPourIhm = []
\r
39 listeReprEquationPourIhm = []
\r
40 dicoListAffiche = {}
\r
42 for equation in listEquation :
\r
43 if valeurEquationListe == 'aging_type' :
\r
44 if equation.type_vieil == valeurAgingType :
\r
45 listeEquationPourIhm.append(equation)
\r
46 listeReprEquationPourIhm.append(equation.representation)
\r
47 dicoListAffiche[equation.representation]=equation
\r
49 if equation.type_react == valeurAgingType :
\r
50 listeEquationPourIhm.append(equation)
\r
51 listeReprEquationPourIhm.append(equation.representation)
\r
52 dicoListAffiche[equation.representation]=equation
\r
53 maClasseDelistesDB.dicoListAffiche = dicoListAffiche
\r
55 change=editor.changeIntoDefMC('Equation', ('b_type_show','ListeEquation'), listeReprEquationPourIhm )
\r
57 editor.reCalculeValiditeMCApresChgtInto('Equation', 'listeEquation', ('b_type_show',))
\r
58 if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()
\r
59 monMC.dsMaFunct = False
\r
61 def afficheValeurEquation(monMC):
\r
62 # Equation b_modification modification
\r
63 if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return
\r
65 if valeur == None : return
\r
66 maClasseDelistesDB.valeurEquationChoisie=str(valeur)
\r
67 monEquation=maClasseDelistesDB.dicoListAffiche[str(valeur)]
\r
69 aAfficher='jkljkljk \n je ne sais plus \njfkqsljqfkl\nkfsjqklfjkl\n'
\r
70 editor=monMC.jdc.editor
\r
71 editor._viewText(aAfficher, "Rapport",largeur=30,hauteur=150)
\r
73 monMC.dsMaFunct = False
\r
76 def instancieChemicalFormulation(monMC):
\r
77 if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return
\r
78 if monMC.valeur == False : return
\r
80 editor=monMC.jdc.editor
\r
81 if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return
\r
82 editor.dsMaFunct = True
\r
84 print ('ds instancie')
\r
85 v=maClasseDelistesDB.valeurEquationChoisie
\r
86 monEquation=maClasseDelistesDB.dicoListAffiche[v]
\r
87 type_react=monEquation.type_react
\r
88 type_vieil=monEquation.type_vieil
\r
90 editor.changeIntoMCandSet('Equation', ('b_type_show','b_modification','b_modif','ChemicalFormulation'),( v,),v )
\r
92 #change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Reaction_Type'),type_react )
\r
93 change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Aging_Type'), type_vieil )
\r
95 for index,valeurConstituant in enumerate(monEquation.constituants):
\r
96 valeurEquation=monEquation.equation[index]
\r
97 editor.ajoutMC(monMC.etape,'OptionnelConstituant',None,('b_type_show','b_modification','b_modif',))
\r
98 print (index,valeurConstituant,valeurEquation)
\r
100 #OptionnelConstituant = FACT ( statut = 'f',max = '**',
\r
101 # Constituant = SIMP (statut = 'o', typ = 'TXM'),
\r
102 # Differential_Equation = SIMP(statut= 'o',typ= 'TXM'),
\r
104 for index,valeurConstituant in enumerate(monEquation.const_cine_nom):
\r
105 valeurArrhe=monEquation.arrhenius[index]
\r
106 if valeurArrhe : valeurConstanteType='Arrhenius type'
\r
107 else : valeurConstanteType='non Arrhenius type'
\r
108 print (index,valeurConstituant,valeurConstanteType)
\r
109 #OptionnelleConstante = FACT (statut = 'f', max = '**',
\r
110 # ConstanteName= SIMP (statut = 'o', typ = 'TXM',),
\r
111 # ConstanteType = SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),
\r
113 change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Commentaire'),monEquation.comment )
\r
114 print (monEquation.comment )
\r
115 if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()
\r
117 monMC.dsMaFunct = False
\r
118 editor.dsMaFunct = False
\r
126 def recupereDicoModele(monMC):
\r
127 if monMC.valeur == None: return
\r
128 if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return
\r
129 print ('je passe dans recupereDicoModele')
\r
130 listEquation, listModele,listPostTraitement=recupereDicoGenerique(monMC)
\r
131 editor=monMC.jdc.editor
\r
132 editor.maClasseVisuEquation = classeVisuEquation({},listEquation, listModele,listPostTraitement)
\r
133 monMC.dsMaFunct = False
\r
136 def creeListeEquation(monMC):
\r
137 if monMC.valeur == None: return
\r
138 if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return
\r
140 editor=monMC.jdc.editor
\r
143 listeEquationsAAfficher=[]
\r
144 listeConstantesAAfficher=[]
\r
145 for index,equation in enumerate( editor.maClasseVisuEquation.listEquation):
\r
146 if index in monModele.equa:
\r
147 listeEquationsAAfficher.append(equation.representation)
\r
148 listeConstantesAAfficher.append(equation.const_cine_nom)
\r
150 monMC.dsMaFunct = False
\r
152 # listeEquation_stabilization=SIMP(statut='o', homo='SansOrdreNiDoublon', max='**', min=0 ),
\r
154 def recupereModeleEquation(monMC):
\r
155 if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return
\r
156 if monMC.valeur==False : return
\r
157 editor=monMC.jdc.editor
\r
158 if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return
\r
160 editor.dsMaFunct = True
\r
161 dicoListeEquationAAfficher={}
\r
163 for valeurReactionType in monDico['Equation_Liste']:
\r
164 dicoListeEquationAAfficher[valeurReactionType] = []
\r
165 for index,equation in enumerate( editor.maClasseVisuEquation.listEquation):
\r
166 if equation.type_react==valeurReactionType :
\r
167 dicoListeEquationAAfficher[valeurReactionType].append(equation.representation)
\r
168 print (dicoListeEquationAAfficher)
\r
170 change=editor.changeIntoDefMC('Modele', ('b_type_creation','b_ajout_equation','listeEquation_initiation'),dicoListeEquationAAfficher['initiation'] )
\r
171 change=editor.changeIntoDefMC('Modele', ('b_type_creation','b_ajout_equation','listeEquation_propagation'),dicoListeEquationAAfficher['propagation'] )
\r
172 change=editor.changeIntoDefMC('Modele', ('b_type_creation','b_ajout_equation','listeEquation_termination'),dicoListeEquationAAfficher['termination'] )
\r
173 change=editor.changeIntoDefMC('Modele', ('b_type_creation','b_ajout_equation','listeEquation_stabilization'),dicoListeEquationAAfficher['stabilization'] )
\r
174 if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()
\r
175 editor.dsMaFunct = False
\r
177 def prepareDiffusion(monMC):
\r
178 print ('je suis dans prepareDiffusion')
\r
179 if monMC.valeur==False : return
\r
180 if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return
\r
181 monMC.dsMaFunct=True
\r
182 editor=monMC.jdc.editor
\r
183 if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return
\r
184 editor.dsMaFunct = True
\r
185 editor.dicoCoefS={}
\r
186 editor.dicoCoefD={}
\r
187 for c in monModele.coef[0].keys() :
\r
190 valeur= monModele.coef[0][c]
\r
191 editor.dicoCoefS[clef]=valeur
\r
194 valeur= monModele.coef[0][c]
\r
195 editor.dicoCoefD[clef]=valeur
\r
196 print (editor.dicoCoefS,editor.dicoCoefD)
\r
197 monMC.dsMaFunct=False
\r
198 editor.dsMaFunct = False
\r
201 def ajouteDiffusion(monMC):
\r
202 print ('je suis dans ajouteDiffusion')
\r
203 if monMC.valeur == None : return
\r
204 print (monMC.valeur)
\r
205 if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return
\r
206 monMC.dsMaFunct=True
\r
207 editor=monMC.jdc.editor
\r
208 if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return
\r
209 editor.dsMaFunct = True
\r
212 for v in monMC.valeur :
\r
214 mesValeurs=editor.dicoCoefS[v]
\r
215 print (editor.dicoCoefS)
\r
216 print (mesValeurs)
\r
218 for e in monMC.jdc.etapes:
\r
219 if e.nom == Modele :break
\r
222 editor.ajoutDefinitionMC(e,('b_type_creation','b_diffusion'),MCFils,typ='TXM',statut='o' )
\r
224 editor.ajoutMC(e,MCFils,mesValeurs,('b_type_creation','b_diffusion',))
\r
226 if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()
\r
227 monMC.dsMaFunct=False
\r
228 editor.dsMaFunct = False
\r