1 # -*- coding: utf-8 -*-
2 # CONFIGURATION MANAGEMENT OF EDF VERSION
3 # ======================================================================
4 # COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
5 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
6 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
7 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
8 # (AT YOUR OPTION) ANY LATER VERSION.
10 # THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
11 # WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
12 # MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
13 # GENERAL PUBLIC LICENSE FOR MORE DETAILS.
15 # YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
16 # ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
17 # 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
20 # ======================================================================
22 Ce module contient la classe BUREAU qui gere les JDC ouverts
28 from widgets import askopenfilename,asksaveasfilename
29 from widgets import showinfo,askyesno,showerror
37 from jdcdisplay import JDCDISPLAY
38 from utils import extension_fichier,stripPath,save_in_file
39 from widgets import Fenetre,Ask_Format_Fichier
40 from fenetre_mc_inconnus import fenetre_mc_inconnus
41 from Ihm import CONNECTOR
48 ('Nouveau','newJDC','<Control-n>'),
49 ('Ouvrir','openJDC','<Control-o>'),
50 ('Enregistrer','saveJDC','<Control-e>'),
51 ('Enregistrer sous','saveasJDC','<Control-s>'),
53 ('Fermer','closeJDC','<Control-f>'),
54 ('Quitter','exitEFICAS','<Control-q>'),
58 ('Copier','copy','<Control-c>'),
59 ('Couper','cut','<Control-x>'),
60 ('Coller','paste','<Control-v>'),
64 ('Rapport de validation','visuCRJDC','<Control-r>'),
65 ('Fichier à plat','visu_a_plat','<Control-p>'),
66 ('Fichier .py','visuJDC_py'),
67 ('Fichier source','visu_txt_brut_JDC','<Control-b>'),
68 ('Paramètres Eficas','affichage_fichier_ini'),
69 ('Mots-clés inconnus','mc_inconnus'),
73 ('Aide EFICAS','aideEFICAS'),
78 button_defs = (('New24',"newJDC","Création d'un nouveau fichier",'always'),
79 ('Open24',"openJDC","Ouverture d'un fichier existant",'always'),
80 ('Save24',"saveJDC","Sauvegarde du fichier courant",'always'),
81 ('Fermer24',"closeJDC","Fermeture du fichier courant",'always'),
82 ('Zoom24',"visuJDC","Visualisation du fichier de commandes",'always'),
84 ('Copy24',"copy","Copie l'objet courant",'jdc'),
85 ('Cut24',"cut","Coupe l'objet courant",'jdc'),
86 ('Paste24',"paste","Colle l'objet copié après l'objet courant",'jdc'),
88 ('Delete24',"delete","Supprime l'objet courant",'jdc'),
89 ('Help24',"view_doc","Documentation de l'objet courant",'jdc')
92 menu_defs=prefs.menu_defs['bureau']
96 button_defs=prefs.button_defs['bureau']
100 def __init__(self,appli,parent):
103 if self.appli.test == 0 :
104 splash._splash.configure(text = "Création du bureau")
105 self.nb = Pmw.NoteBook(self.parent,raisecommand=self.selectJDC)
106 self.nb.pack(fill='both',expand=1)
107 self.JDCDisplay_courant=None
109 self.liste_JDCDisplay=[]
110 comploader.charger_composants()
113 self.initialdir = self.appli.CONFIGURATION.initialdir
115 def cree_cataitem(self):
117 On récupère dans l'appli_composant readercata les variables
118 qui servent par la suite pour la création des JDC
120 self.cataitem=self.appli.readercata.cataitem
121 self.cata=self.appli.readercata.cata
122 self.cata_ordonne_dico=self.appli.readercata.cata_ordonne_dico
123 self.code=self.appli.readercata.code
124 self.version_code=self.appli.readercata.version_code
125 self.fic_cata=self.appli.readercata.fic_cata
127 def selectJDC(self,event=None):
129 Cette méthode est appelée chaque fois que l'on sélectionne
130 l'onglet d'un JDC dans le NoteBook des JDC.
131 Elle permet de stocker dans les variable self.JDC et
132 self.JDCDisplay_courant les valeurs concernant le JDC courant
134 if len(self.liste_JDCDisplay) == 0 : return
135 #if self.JDCDisplay_courant : self.JDCDisplay_courant.jdc.unset_context()
136 numero_jdc = self.nb.index(self.nb.getcurselection())
137 self.JDCDisplay_courant.unselect()
138 self.JDCDisplay_courant = self.liste_JDCDisplay[numero_jdc]
139 self.JDC = self.JDCDisplay_courant.jdc
140 self.JDCName = self.JDC.nom
141 self.JDCDisplay_courant.select()
142 #print "selectJDC",numero_jdc,self.JDCDisplay_courant,self.JDCName
145 def newJDC_include(self,event=None):
147 Initialise un nouveau JDC vierge
149 import Extensions.jdc_include
150 JdC_aux=Extensions.jdc_include.JdC_include
152 self.appli.statusbar.reset_affichage_infos()
154 CONTEXT.unset_current_step()
155 jaux=self.cata[0].JdC(procedure="",appli=self.appli,
156 cata=self.cata,cata_ord_dico=self.cata_ordonne_dico,
157 rep_mat=self.appli.CONFIGURATION.rep_mat,
161 J=JdC_aux(procedure="",appli=self.appli,
162 cata=self.cata,cata_ord_dico=self.cata_ordonne_dico,
164 rep_mat=self.appli.CONFIGURATION.rep_mat,
169 self.ShowJDC(J,self.JDCName)
170 self.appli.toolbar.active_boutons()
172 def newJDC(self,event=None):
174 Initialise un nouveau JDC include vierge
176 self.appli.statusbar.reset_affichage_infos()
178 CONTEXT.unset_current_step()
179 J=self.cata[0].JdC(procedure="",appli=self.appli,
180 cata=self.cata,cata_ord_dico=self.cata_ordonne_dico,
181 rep_mat=self.appli.CONFIGURATION.rep_mat,
186 self.ShowJDC(J,self.JDCName)
187 self.appli.toolbar.active_boutons()
189 def ShowJDC(self,JDC,nom,label_onglet=None,JDCDISPLAY=JDCDISPLAY,enregistre="non"):
191 Lance l'affichage du JDC cad création du JDCDisplay
192 Rajoute le JDCDisplay à la liste des JDCDisplay si label_onglet == None cad si on crée
193 bien un nouveau JDCDisplay et non si on remplace (renommage de l'onglet)
196 self.JDCName = self.JDC.nom = nom
197 if label_onglet == None :
198 # On veut un nouvel onglet
199 label_onglet = self.GetLabelJDC()
200 self.nb.add(label_onglet,tab_text = nom,tab_width=20)
204 self.JDCDisplay_courant=JDCDISPLAY(self.JDC,nom,appli=self.appli,parent=self.nb.page(label_onglet))
206 self.liste_JDCDisplay.append(self.JDCDisplay_courant)
207 self.JDCDisplay_courant.modified='n'
208 if enregistre != "non" :
209 self.JDCDisplay_courant.fichier=self.fileName
211 self.initialdir = self.appli.CONFIGURATION.rep_user
212 self.nb.selectpage(label_onglet)
213 self.nb.setnaturalsize()
214 self.nb.bind_all("<Key-Next>",lambda e,s=self:s.selectArbreDown())
215 self.nb.bind_all("<Key-Prior>",lambda e,s=self:s.selectArbreUp())
216 self.nb.bind_all("<Insert>",lambda e,s=self:s.deplieReplieNode())
217 texte = "Jeu de commandes :" + self.JDCName+" ouvert"
218 CONNECTOR.Connect(JDC,"close",self.onClose,(self.JDCDisplay_courant,))
219 self.appli.affiche_infos(texte)
221 def onClose(self,jdcdisplay):
222 #print "onClose",jdcdisplay
223 self.closeJDCDISPLAY(jdcdisplay)
225 def closeJDCDISPLAY(self,jdc):
227 Ferme le jdcdisplay spécifié par l'argument jdc
229 if jdc is self.JDCDisplay_courant:
230 # on ferme le jdcdisplay courant
231 self.closeSelectedJDC()
233 # on ferme un autre jdcdisplay que le courant
234 old_JDCDisplay=self.JDCDisplay_courant
235 old_page=self.nb.getcurselection()
237 self.JDCDisplay_courant=jdc
239 numero_jdc=self.liste_JDCDisplay.index(jdc)
240 self.nb.selectpage(numero_jdc)
243 self.closeSelectedJDC()
244 self.JDCDisplay_courant=old_JDCDisplay
245 self.JDC=old_JDCDisplay.jdc
246 self.nb.selectpage(old_page)
248 def closeJDC (self,event=None) :
250 Ferme le JDC associé au JDCDISPLAY selectionné
252 if self.JDCDisplay_courant :
253 self.JDCDisplay_courant.jdc.close()
255 def closeSelectedJDC (self) :
257 Ferme le JDC courant et détruit l'onglet associé dans le notebook self.nb
259 if self.JDCDisplay_courant.modified == 'o' :
260 message = "Voulez-vous sauvegarder le jeu de commandes "+self.JDC.nom+" courant ?"
261 reponse = askyesno(title="Sauvegarde du jdc courant",
264 test = self.saveJDC()
266 self.appli.affiche_infos("Sauvegarde impossible")
269 CONNECTOR.Disconnect(self.JDCDisplay_courant.jdc,"close",self.onClose,(self.JDCDisplay_courant,))
270 self.JDCDisplay_courant.supprime()
271 self.JDCDisplay_courant.jdc.supprime()
272 self.liste_JDCDisplay.remove(self.JDCDisplay_courant)
273 # Active le mecanisme de selection du notebook (selectJDC)
274 self.nb.delete(self.nb.getcurselection())
277 index = self.nb.index(self.nb.getcurselection())
278 self.JDCDisplay_courant = self.liste_JDCDisplay[index]
279 self.JDC = self.JDCDisplay_courant.jdc
282 self.JDCDisplay_courant = None
283 self.appli.toolbar.inactive_boutons()
285 def visuCRJDC(self,event=None):
286 return self.visuCR(mode='JDC')
288 def visuCR(self,mode):
290 Méthode permettant l'affichage du rapport de validation
293 if not hasattr(self,'JDC') : return
294 titre="rapport de validation du jeu de commandes courant"
295 cr = self.JDC.report()
296 #self.update_jdc_courant()
298 from Noyau.N_CR import CR
300 cr.debut = "Début rapport de validation du catalogue"
301 cr.fin = "Fin rapport de validation du catalogue"
302 titre="rapport de validation du catalogue"
303 if hasattr(self,'cata_ordonne_cr') :
304 cr.add(self.cata_ordonne_cr)
305 if hasattr(self,'cata_dev_ordonne_cr') :
306 cr.add(self.cata_dev_ordonne_cr)
307 for cata in self.cata:
308 if hasattr(cata,'JdC'):
309 cr.add(cata.JdC.report())
311 self.visu_texte_cr = Fenetre(self.appli,titre=titre,texte=texte_cr)
313 def openJDC(self,event=None,file=None,units=None,enregistre="oui"):
315 Demande à l'utilisateur quel JDC existant il veut ouvrir
317 if self.code == 'ASTER':
318 filetypes = ( ("format "+self.appli.format_fichier.get(), ".com*"),("Tous",'*'))
319 elif self.code == 'HOMARD' :
320 filetypes = ( ("format "+self.appli.format_fichier.get(), ".py"),("Tous",'*'))
322 filetypes = ( ("format "+self.appli.format_fichier.get(), ".py"),)
323 if not hasattr(self,'initialdir'):
324 self.initialdir = self.appli.CONFIGURATION.initialdir
327 file = askopenfilename(title="Ouverture d'un fichier de commandes Aster",
328 defaultextension=".comm",
329 filetypes = filetypes,
330 initialdir = self.initialdir)
333 e=extension_fichier(file)
334 self.JDCName=stripPath(file)
335 self.initialdir = os.path.dirname(os.path.abspath(file))
339 format=self.appli.format_fichier.get()
340 # Il faut convertir le contenu du fichier en fonction du format
341 if convert.plugins.has_key(format):
342 # Le convertisseur existe on l'utilise
343 p=convert.plugins[format]()
345 text=p.convert('exec',self.appli)
346 if not p.cr.estvide():
347 self.appli.affiche_infos("Erreur à la conversion")
349 titre="compte-rendu d'erreurs, EFICAS ne sait pas convertir ce fichier",
350 texte = str(p.cr)).wait()
352 if enregistre == "oui" :
353 self.appli.listeFichiers.aOuvert(file)
355 # Il n'existe pas c'est une erreur
356 self.appli.affiche_infos("Type de fichier non reconnu")
357 showerror("Type de fichier non reconnu","EFICAS ne sait pas ouvrir ce type de fichier")
360 # On se met dans le repertoire ou se trouve le fichier de commandes
361 # pour trouver les eventuels fichiers include ou autres
362 # localises a cote du fichier de commandes
363 os.chdir(self.initialdir)
364 CONTEXT.unset_current_step()
365 J=self.cata[0].JdC(procedure=text,appli=self.appli,
366 cata=self.cata,cata_ord_dico=self.cata_ordonne_dico,
368 rep_mat=self.appli.CONFIGURATION.rep_mat,
370 if units is not None:
371 J.recorded_units=units
372 J.old_recorded_units=units
375 txt_exception = J.cr.get_mess_exception()
377 # des exceptions ont été levées à la création du JDC
378 # --> on affiche les erreurs mais pas le JDC
380 self.appli.affiche_infos("Erreur fatale au chargement de %s" %file)
381 if self.appli.test == 0 :
382 showerror("Erreur fatale au chargement d'un fichier",txt_exception)
384 self.ShowJDC(J,self.JDCName,enregistre=enregistre)
385 self.appli.toolbar.active_boutons()
386 # si le JDC ne contient rien (vide), on retourne ici
387 if len(self.JDC.etapes) == 0 : return
388 # dans le cas où le JDC est invalide, on affiche son CR
389 if not self.JDC.isvalid():
390 self.appli.top.update()
391 self.visuCR(mode='JDC')
393 def deplieReplieNode(self):
394 self.JDCDisplay_courant.tree.tree.deplieReplieNode()
396 def selectArbreDown(self):
397 self.JDCDisplay_courant.tree.tree.canvas.focus_set()
398 self.JDCDisplay_courant.tree.tree.mot_down_force()
400 def selectArbreUp(self):
401 self.JDCDisplay_courant.tree.tree.canvas.focus_set()
402 self.JDCDisplay_courant.tree.tree.mot_up_force()
404 def GetLabelJDC(self,nb_jdc = 'absent'):
406 Retourne le label de l'onglet du NoteBook associé au JDC à afficher
408 if nb_jdc == 'absent':
409 nb_jdc = len(self.nb.pagenames())
411 label_onglet = 'JDC'+`nb_jdc`
412 if label_onglet not in self.nb.pagenames() :
415 return self.GetLabelJDC(nb_jdc)
417 def saveasJDC(self,event=None):
419 Sauvegarde le JDC courant en demandant impérativement à l'utilisateur de
420 donner le nom du fichier de sauvegarde
422 self.saveJDC(echo='oui')
424 def saveJDC(self,echo='non'):
426 Sauvegarde le JDC courant.
427 Retourne 1 si la sauvegarde s'est bien faite, 0 sinon.
428 Si echo = 'oui' : interactif (l'utilisateur donne le nom sous lequel il
430 Si echo = 'non' : muet (sauvegarde le JDC dans JDC.procedure)
433 if not hasattr(self,'JDC') : return 0
434 format=self.appli.format_fichier.get()
435 if generator.plugins.has_key(format):
436 # Le generateur existe on l'utilise
437 g=generator.plugins[format]()
438 jdc_formate=g.gener(self.JDC,format='beautifie')
439 if format == 'homard':
440 self.jdc_homard=g.get_homard()
441 if not g.cr.estvide():
442 self.appli.affiche_infos("Erreur à la generation")
443 showerror("Erreur à la generation","EFICAS ne sait pas convertir ce JDC")
446 # Il n'existe pas c'est une erreur
447 self.appli.affiche_infos("Format %s non reconnu" % format)
448 showerror("Format %s non reconnu" % format,"EFICAS ne sait pas convertir le JDC")
450 self.jdc_fini = string.replace(jdc_formate,'\r\n','\n')
452 if echo =='oui' or self.JDCDisplay_courant.fichier == None:
453 ok = self.asknomsauvegardeJDC()
454 elif self.JDCDisplay_courant.fichier != None :
455 # le JDC a déjà un nom : on sauvegarde directement sans demander
456 # un autre nom au développeur
457 if not save_in_file(self.JDCDisplay_courant.fichier,self.jdc_fini,self.appli.dir) :
458 showinfo("Erreur","Problème à la sauvegarde du fichier :" + `self.JDCDisplay_courant.fichier`)
462 if self.appli.format_fichier.get() == 'homard':
463 self.save_homard(self.JDCDisplay_courant.fichier,self.jdc_homard)
464 self.JDCDisplay_courant.stop_modif()
465 self.appli.affiche_infos("sauvegarde de "+`self.JDCDisplay_courant.fichier`+" effectuée")
468 if ok and hasattr( self.appli, 'salome'):
469 # eficas a été lancé à partir deSalome
470 #1)ajout dans l'arbre d'étude du nom du jdc
471 ok, msg = self.appli.addJdcInSalome( self.JDCDisplay_courant.fichier )
474 from panelsSalome import SALOME_UNIQUE_BASE_Panel
475 if len(SALOME_UNIQUE_BASE_Panel.dict_fichier_unite) > 0 :
476 print 'CS_pbruno if len(SALOMchier_unite) > 0 :???????'
477 self.appli.creeConfigTxt( self.appli.CONFIGURATION.initialdir, SALOME_UNIQUE_BASE_Panel.dict_fichier_unite )
479 #3)création/mise à jours d'un maillage dans Salome
480 self.appli.createOrUpdateMesh()
483 def asknomsauvegardeJDC(self):
484 """ Demande à l'utilsateur le nom sous lequel il veut sauvegarder le JDC courant """
485 titre = "Sauvegarde d'un fichier de commandes "+self.code
486 if self.code == 'ASTER':
488 filtyp = ( ("ASTER", ".comm"),)
491 filtyp = ( (self.code, ".py"),)
492 sauvegarde = asksaveasfilename(title=titre,
493 defaultextension=defext,
495 initialdir = self.initialdir)
496 #initialdir = self.appli.CONFIGURATION.initialdir)
497 #initialdir = self.appli.CONFIGURATION.rep_user)
499 if not save_in_file(sauvegarde,self.jdc_fini,None) :
500 showinfo("Erreur","Problème à la sauvegarde du fichier "+`sauvegarde`)
503 if self.appli.format_fichier.get() == 'homard':
504 self.save_homard(sauvegarde,self.jdc_homard)
505 self.JDCDisplay_courant.stop_modif()
506 self.appli.affiche_infos("Sauvegarde effectuée")
507 if sauvegarde != self.JDCDisplay_courant.fichier :
508 # l'utilisateur a sauvegardé le JDC sous un autre nom
509 self.JDCDisplay_courant.fichier = sauvegarde
510 self.JDCName = self.JDC.nom = stripPath(sauvegarde)
511 self.JDC.changefichier(sauvegarde)
517 def changeNomPage(self):
518 """ Change le nom de l'onglet contenant le JDC courant : en fait détruit l'actuel
519 et recrée un autre onglet à la même place avec le bon nom
522 self.JDCDisplay_courant.jdc.nom = nom
523 nom_page = self.nb.getcurselection()
524 num_page = self.nb.index(nom_page)
525 tab = self.nb.tab(num_page)
526 tab.configure(text = nom)
528 def exitEFICAS(self,event=None):
530 Permet de sortir d'EFICAS en demandant à l'utilisateur
531 s'il veut sauvegarder les modifications en cours
533 liste = self.GetListeJDCaSauvegarder()
535 # Certains fichiers n'ont pas été sauvegardés ...
536 if askyesno("Enregistrer modifications","Enregistrer les modifications ?") :
537 test = self.saveall(liste)
540 if askyesno ("Quitter","Voulez-vous vraiment quitter l'application ?") :
541 for JDCDisplay in self.liste_JDCDisplay:
542 JDCDisplay.jdc.supprime()
546 def GetListeJDCaSauvegarder(self) :
547 """ Retourne parmi la liste de tous les JDC ouverts la liste de ceux qui ont été modifiés """
548 if not self.JDCDisplay_courant : return []
549 if len(self.liste_JDCDisplay) == 0 : return l
551 for JDCDisplay in self.liste_JDCDisplay:
552 if JDCDisplay.modified == 'o' :
556 def copy(self,event=None):
558 Lance la copie sur le JDC courant
560 if self.JDCDisplay_courant : self.JDCDisplay_courant.doCopy()
562 def paste(self,event=None):
564 Lance le collage sur le JDC courant
566 if self.JDCDisplay_courant : self.JDCDisplay_courant.doPaste()
568 def cut(self,event=None):
570 Lance le cut sur le JDC courant
572 if self.JDCDisplay_courant: self.JDCDisplay_courant.doCut()
576 Lance la suppression du noeud courant
578 if not self.JDCDisplay_courant : return
579 self.JDCDisplay_courant.init_modif()
580 self.JDCDisplay_courant.node_selected.delete()
582 def visuJDC_py(self,event=None):
584 Méthode permettant d'afficher dans une fenêtre à part l'écho au
585 format python du jdc courant
587 if not hasattr(self,'JDC') : return
588 jdc_fini = self.get_text_JDC('python')
589 if jdc_fini == None : return
591 titre = 'fichier '+ self.JDCName + ' à la syntaxe Python',
596 Méthode permettant d'afficher dans une fenêtre à part l'écho au
597 format .comm ou .py du jdc courant
599 if not hasattr(self,'JDC') : return
600 titre = 'fichier '+ self.JDCName + ' à la syntaxe '+ self.code
601 format=self.appli.format_fichier.get()
602 self.jdc_fini = self.get_text_JDC(format)
603 if self.jdc_fini == None : return
604 self.visu_fichier_cmd = Fenetre(self.appli,titre=titre,texte = self.jdc_fini)
606 def get_text_JDC(self,format):
607 if generator.plugins.has_key(format):
608 # Le generateur existe on l'utilise
609 g=generator.plugins[format]()
610 jdc_formate=g.gener(self.JDC,format='beautifie')
611 if not g.cr.estvide():
612 self.appli.affiche_infos("Erreur à la generation")
613 showerror("Erreur à la generation","EFICAS ne sait pas convertir ce JDC")
618 # Il n'existe pas c'est une erreur
619 self.appli.affiche_infos("Format %s non reconnu" % format)
620 showerror("Format %s non reconnu" % format,"EFICAS ne sait pas convertir le JDC en format %s "% format)
625 Permet d'ouvrir le fichier doc U de la commande au format pdf avec Acrobat Reader
626 - Ne fonctionne pas sous UNIX (chemin d'accès Acrobat Reader)
627 - indication du chemin d'accès aux fichiers pdf à revoir : trop statique
629 if not self.JDCDisplay_courant : return
631 cle_doc = self.JDCDisplay_courant.node_selected.item.get_docu()
632 if cle_doc == None : return
633 cle_doc = string.replace(cle_doc,'.','')
634 cle_doc = string.replace(cle_doc,'-','')
635 commande = self.appli.CONFIGURATION.exec_acrobat
636 nom_fichier = cle_doc+".pdf"
637 fichier = os.path.abspath(os.path.join(self.appli.CONFIGURATION.path_doc,nom_fichier))
639 os.spawnv(os.P_NOWAIT,commande,(commande,fichier,))
640 elif os.name == 'posix':
641 script ="#!/usr/bin/sh \n%s %s&" %(commande,fichier)
642 pid = os.system(script)
643 except AttributeError:
644 traceback.print_exc()
647 def visu_a_plat(self,event=None):
649 Méthode permettant d'afficher dans une fenêtre à part l'écho 'à plat' du jdc courant
651 if not hasattr(self,'JDC') : return
652 titre = 'fichier '+ self.JDCName + ' à plat '
653 self.jdc_fini = self.get_text_JDC('aplat')
654 if self.jdc_fini == None : return
655 self.visu_fichier_cmd = Fenetre(self.appli,titre=titre,texte = self.jdc_fini)
657 def visu_txt_brut_JDC(self,event=None):
659 Méthode permettant d'afficher le jeu de commandes tel qu'il a été passé au JDC
661 if not hasattr(self,'JDC') : return
662 titre = "fichier de commandes utilisateur"
663 #texte = self.JDC.procedure
665 if self.JDCDisplay_courant.fichier == None:
666 self.appli.affiche_infos("Pas de fichier initial")
667 showerror("Impossible de visualiser le fichier initial",
668 "EFICAS ne peut visualiser le fichier initial.\nIl s'agit d'un nouveau JDC")
670 os.chdir(self.appli.dir)
671 f=open(self.JDCDisplay_courant.fichier,'r')
674 self.visu_texte_JDC = Fenetre(self.appli,titre=titre,texte=texte)
676 def affichage_fichier_ini(self):
678 Affichage des valeurs des paramètres relus par Eficas
680 self.appli.CONFIGURATION.affichage_fichier_ini()
682 def saveall(self,liste):
684 Sauvegarde tous les JDC contenus dans liste
687 for JDCDisplay in liste :
688 self.JDCDisplay_courant=JDCDisplay
689 self.JDC = JDCDisplay.jdc
690 test = test * self.saveJDC(echo = 'non')
693 def save_homard(self,nom,texte):
694 file_homard=nom+'.conf_homard'
696 f=open(file_homard,'w')
702 print "Pb a la sauvegarde sous le format homard"
703 if hasattr( self.appli, 'salome'):
705 self.appli.salome.rangeInStudy(file_homard,"_CONF")
707 # ---------------------------------------------------------------------------
708 # Méthodes liées aux mots-clés inconnus
709 # ---------------------------------------------------------------------------
711 def mc_inconnus(self):
712 l_mc = self.JDCDisplay_courant.jdc.get_liste_mc_inconnus()
713 o = fenetre_mc_inconnus(l_mc)
714 l = o.wait_new_list()
715 #print "mc_inconnus_new_list: ",l
716 #CCAR: Il n' y a pas de retour vers le JDC
718 def aideEFICAS(self,event=None):
719 AIDE.go(master=self.parent)
721 def update_jdc_courant(self):
722 self.JDCDisplay_courant.update()