1 #@ MODIF calc_essai_ops Macro DATE 14/12/2010 AUTEUR PELLET J.PELLET
2 # -*- coding: iso-8859-1 -*-
3 # CONFIGURATION MANAGEMENT OF EDF VERSION
4 # ======================================================================
5 # COPYRIGHT (C) 1991 - 2010 EDF R&D WWW.CODE-ASTER.ORG
6 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
7 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
8 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
9 # (AT YOUR OPTION) ANY LATER VERSION.
11 # THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
12 # WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
13 # MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
14 # GENERAL PUBLIC LICENSE FOR MORE DETAILS.
16 # YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
17 # ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
18 # 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
19 # ======================================================================
21 ## \package calc_essai_ops Implémentation de la macro CALC_ESSAI
23 # Ce module contient la partie controle de la macro CALC_ESSAI
24 # les autres fichiers sources sont situes dans ../Calc_essai
27 def calc_essai_ops( self,
31 IDENTIFICATION = None,
34 GROUP_NO_CAPTEURS = None,
35 GROUP_NO_EXTERIEUR = None,
36 RESU_IDENTIFICATION = None,
37 RESU_MODIFSTRU = None,
40 from Calc_essai.cata_ce import CalcEssaiObjects
44 # La macro compte pour 1 dans la numerotation des commandes
47 prev = aster.onFatalError()
49 # gestion des concepts sortants de la macro, declares a priori
55 if not RESU_MODIFSTRU:
58 out_modifstru = RESU_MODIFSTRU[0] # max=1 dans le capy
61 if not RESU_IDENTIFICATION:
62 RESU_IDENTIFICATION = []
64 for res in RESU_IDENTIFICATION:
65 table_fonction.append(res['TABLE'])
66 out_identification = {"DeclareOut" : self.DeclareOut,
67 "TypeTables" : 'TABLE_FONCTION',
69 "TablesOut" : table_fonction}
72 # Mode interactif : ouverture d'une fenetre Tk
73 if INTERACTIF == "OUI":
74 aster.onFatalError('EXCEPTION')
76 create_interactive_window(self,
81 from Calc_essai.ce_test import MessageBox
82 from Calc_essai.ce_test import TestCalcEssai
83 mess = MessageBox(UNITE_RESU)
84 mess.disp_mess("Mode non intéractif")
86 objects = CalcEssaiObjects(self, mess)
88 # importation des concepts aster existants de la memoire jeveux
102 aster.onFatalError(prev)
107 def create_tab_mess_widgets(tk,tabskeys):
108 """Construits les objects table et boîte à messages."""
110 from Pmw import PanedWidget
114 from Calc_essai.outils_ihm import MessageBoxInteractif, TabbedWindow
118 tk.rowconfigure(0, weight=2)
119 tk.rowconfigure(1, weight=1)
121 tabs = TabbedWindow(tabsw, tabskeys)
123 tabs.grid(row=0, column=0, sticky='nsew')
124 # pack(side='top',expand=1,fill='both')
126 # ecriture des message dans un fichier message
127 mess = MessageBoxInteractif(msgw)
128 mess.grid(row=1, column=0, sticky='nsew')
133 class FermetureCallback:
134 """Opérations à appliquer lors de la fermeture de la
138 def __init__(self, main_tk, turbulent):
139 self.main_tk = main_tk
140 self.turbulent = turbulent
143 """Enlève les fichiers temporaires de Xmgrace"""
144 if self.turbulent.param_visu.logiciel_courbes is not None:
145 self.turbulent.param_visu.logiciel_courbes.fermer()
149 def create_interactive_window(macro,
153 """Construit la fenêtre interactive comprenant une table pour
154 les 4 domaines de CALC_ESSAI."""
155 from Tkinter import Tk
157 from Calc_essai.cata_ce import CalcEssaiObjects
158 from Calc_essai.ce_ihm_expansion import InterfaceCorrelation
159 from Calc_essai.ce_ihm_modifstruct import InterfaceModifStruct
160 from Calc_essai.ce_ihm_identification import InterfaceIdentification
161 from Calc_essai.ce_ihm_parametres import InterfaceParametres
162 from Calc_essai.ce_calc_spec import InterfaceCalcSpec
166 tk.title("CALC_ESSAI")
167 tk.rowconfigure(0,weight=1)
168 tk.rowconfigure(1,weight=20)
169 tk.rowconfigure(2,weight=1)
171 tabskeys = ["Expansion de modeles",
172 "Modification structurale",
173 "Identification de chargement",
174 "Traitement du signal",
175 "Parametres de visualisation" ]
177 tabs, mess = create_tab_mess_widgets(tk, tabskeys)
180 # importation des concepts aster de la memoire jeveux
181 objects = CalcEssaiObjects(macro, mess)
182 tabs.set_objects(objects)
184 param_visu = InterfaceParametres(main, mess)
186 iface = InterfaceCorrelation(main, objects, macro, mess,param_visu)
187 imodifstruct = InterfaceModifStruct(main, objects, macro,mess, out_modifstru, param_visu)
188 identification = InterfaceIdentification(main, objects, mess, out_identification, param_visu)
189 calc_spec= InterfaceCalcSpec(main,objects,mess,param_visu)
191 tabs.set_tab(tabskeys[0], iface.main)
192 tabs.set_tab(tabskeys[1], imodifstruct.main)
193 tabs.set_tab(tabskeys[2], identification)
194 tabs.set_tab(tabskeys[3], calc_spec)
195 tabs.set_tab(tabskeys[4], param_visu)
197 tabs.set_current_tab(tabskeys[4])
199 tk.protocol("WM_DELETE_WINDOW", FermetureCallback(tk, identification).apply)
204 print "CALC_ESSAI : *ERREUR*"