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 print ('instancieChemicalFormulation pour ', monMC.nom)
\r
78 if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return
\r
79 if monMC.valeur == False : return
\r
81 editor=monMC.jdc.editor
\r
82 if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return
\r
83 editor.dsMaFunct = True
\r
85 print ('ds instancie')
\r
86 v=maClasseDelistesDB.valeurEquationChoisie
\r
87 monEquation=maClasseDelistesDB.dicoListAffiche[v]
\r
88 type_react=monEquation.type_react
\r
89 type_vieil=monEquation.type_vieil
\r
91 editor.changeIntoMCandSet('Equation', ('b_type_show','b_modification','b_modif','ChemicalFormulation'),( v,),v )
\r
92 print ("je passe la")
\r
93 change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Reaction_Type'),type_react )
\r
94 change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Aging_Type'), type_vieil )
\r
96 for index,valeurConstituant in enumerate(monEquation.constituants):
\r
97 valeurEquation=monEquation.equation[index]
\r
99 #PNPNPN --> decider des noms SVP ave un nom python
\r
100 monMcl1=('Constituant','TXM',{'statut':'o','defaut':valeurConstituant})
\r
101 monMcl2=('Differential_Equation','TXM',{'statut':'o','defaut':valeurEquation})
\r
102 listeMC=(monMcl1,monMcl2)
\r
103 editor.ajoutDefinitionMCFact ('Equation',('b_type_show','b_modification','b_modif',),valeurConstituant,listeMC,statut='f')
\r
104 print (index,valeurConstituant,valeurEquation)
\r
106 #OptionnelConstituant = FACT ( statut = 'f',max = '**',
\r
107 # Constituant = SIMP (statut = 'o', typ = 'TXM'),
\r
108 # Differential_Equation = SIMP(statut= 'o',typ= 'TXM'),
\r
110 for index,valeurConstituant in enumerate(monEquation.const_cine_nom):
\r
111 valeurArrhe=monEquation.arrhenius[index]
\r
112 if valeurArrhe : valeurConstanteType='Arrhenius type'
\r
113 else : valeurConstanteType='non Arrhenius type'
\r
114 monMcl1=('ConstanteName','TXM',{'statut':'o','defaut':valeurConstituant})
\r
115 monMcl2=('ConstanteType','TXM',{'statut':'o','defaut':valeurConstanteType,'into': ('Arrhenius type','non Arrhenius type') })
\r
116 listeMC=(monMcl1,monMcl2)
\r
117 editor.ajoutDefinitionMCFact ('Equation',('b_type_show','b_modification','b_modif',),valeurConstituant,listeMC,statut='f')
\r
118 print (index,valeurConstituant,valeurConstanteType)
\r
120 change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Commentaire'),monEquation.comment )
\r
121 print (monEquation.comment )
\r
122 if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()
\r
124 monMC.dsMaFunct = False
\r
125 editor.dsMaFunct = False
\r
133 def recupereDicoModele(monMC):
\r
134 if monMC.valeur == None: return
\r
135 if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return
\r
136 print ('je passe dans recupereDicoModele')
\r
137 listEquation, listModele,listPostTraitement=recupereDicoGenerique(monMC)
\r
138 editor=monMC.jdc.editor
\r
139 editor.maClasseVisuEquation = classeVisuEquation({},listEquation, listModele,listPostTraitement)
\r
140 monMC.dsMaFunct = False
\r
143 def creeListeEquation(monMC):
\r
144 if monMC.valeur == None: return
\r
145 if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return
\r
147 editor=monMC.jdc.editor
\r
150 listeEquationsAAfficher=[]
\r
151 listeConstantesAAfficher=[]
\r
152 for index,equation in enumerate( editor.maClasseVisuEquation.listEquation):
\r
153 if index in monModele.equa:
\r
154 listeEquationsAAfficher.append(equation.representation)
\r
155 listeConstantesAAfficher.append(equation.const_cine_nom)
\r
157 monMC.dsMaFunct = False
\r
159 # listeEquation_stabilization=SIMP(statut='o', homo='SansOrdreNiDoublon', max='**', min=0 ),
\r
161 def recupereModeleEquation(monMC):
\r
162 if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return
\r
163 if monMC.valeur==False : return
\r
164 editor=monMC.jdc.editor
\r
165 if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return
\r
167 editor.dsMaFunct = True
\r
168 dicoListeEquationAAfficher={}
\r
170 for valeurReactionType in monDico['Equation_Liste']:
\r
171 dicoListeEquationAAfficher[valeurReactionType] = []
\r
172 for index,equation in enumerate( editor.maClasseVisuEquation.listEquation):
\r
173 if equation.type_react==valeurReactionType :
\r
174 dicoListeEquationAAfficher[valeurReactionType].append(equation.representation)
\r
175 print (dicoListeEquationAAfficher)
\r
177 change=editor.changeIntoDefMC('Modele', ('b_type_creation','b_ajout_equation','listeEquation_initiation'),dicoListeEquationAAfficher['initiation'] )
\r
178 change=editor.changeIntoDefMC('Modele', ('b_type_creation','b_ajout_equation','listeEquation_propagation'),dicoListeEquationAAfficher['propagation'] )
\r
179 change=editor.changeIntoDefMC('Modele', ('b_type_creation','b_ajout_equation','listeEquation_termination'),dicoListeEquationAAfficher['termination'] )
\r
180 change=editor.changeIntoDefMC('Modele', ('b_type_creation','b_ajout_equation','listeEquation_stabilization'),dicoListeEquationAAfficher['stabilization'] )
\r
181 if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()
\r
182 editor.dsMaFunct = False
\r
184 def prepareDiffusion(monMC):
\r
185 print ('je suis dans prepareDiffusion')
\r
186 if monMC.valeur==False : return
\r
187 if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return
\r
188 monMC.dsMaFunct=True
\r
189 editor=monMC.jdc.editor
\r
190 if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return
\r
191 editor.dsMaFunct = True
\r
192 editor.dicoCoefS={}
\r
193 editor.dicoCoefD={}
\r
194 for c in monModele.coef[0].keys() :
\r
197 valeur= monModele.coef[0][c]
\r
198 editor.dicoCoefS[clef]=valeur
\r
201 valeur= monModele.coef[0][c]
\r
202 editor.dicoCoefD[clef]=valeur
\r
203 print (editor.dicoCoefS,editor.dicoCoefD)
\r
204 monMC.dsMaFunct=False
\r
205 editor.dsMaFunct = False
\r
208 def ajouteDiffusion(monMC):
\r
209 print ('je suis dans ajouteDiffusion')
\r
210 if monMC.valeur == None : return
\r
211 print (monMC.valeur)
\r
212 if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return
\r
213 monMC.dsMaFunct=True
\r
214 editor=monMC.jdc.editor
\r
215 if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return
\r
216 editor.dsMaFunct = True
\r
219 for v in monMC.valeur :
\r
221 mesValeurs=editor.dicoCoefS[v]
\r
222 print (editor.dicoCoefS)
\r
223 print (mesValeurs)
\r
225 for e in monMC.jdc.etapes:
\r
226 if e.nom == Modele :break
\r
229 editor.ajoutDefinitionMC(e,('b_type_creation','b_diffusion'),MCFils,typ='TXM',statut='o' )
\r
231 editor.ajoutMC(e,MCFils,mesValeurs,('b_type_creation','b_diffusion',))
\r
233 if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()
\r
234 monMC.dsMaFunct=False
\r
235 editor.dsMaFunct = False
\r