1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2013 EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #from ExtractGeneratorLoadLineandTransfoDico import ExtractGeneratorLoadLineandTransfoDico
22 from ExtractGeneratorLoadLineandTransfoDico import ExtractGeneratorLoadLineandTransfoDico2
24 def INCLUDE(self,PSSE_path,sav_file,**args):
26 Fonction sd_prod pour la macro INCLUDE
29 if sav_file==None: return
31 if hasattr(self,'fichier_ini'):
33 if self.fichier_ini == sav_file : return
34 if hasattr(self,'old_context_fichier_init' ):
35 for concept in self.old_context_fichier_init.values():
36 self.jdc.delete_concept(concept)
38 self.contexte_fichier_init={}
39 self.reevalue_sd_jdc()
40 self.jdc.reset_context()
42 self.fichier_ini=sav_file
43 self.contexte_fichier_init = {}
44 self.fichier_unite = 999
45 self.fichier_err = None
52 MachineDico,LoadDico,LineDico,TransfoDico = ExtractGeneratorLoadLineandTransfoDico2(sav_file,PSSE_path)
55 if self.jdc.appli is not None:
56 self.jdc.appli.affiche_alerte("Error", 'An error happened in ExtractGeneratorandLoadList execution ')
60 self.fichier_err = str(exc)
61 self.contexte_fichier_init = {}
63 for nom in MachineDico.keys():
64 self.fichier_text += "%s=MONGENER(ID='%s',);\n" % (nom, 'a')
66 for nom in LoadDico.keys():
67 self.fichier_text += "%s=MACHARGE(ID='%s',);\n" % (nom, 'a')
69 for nom in LineDico.keys():
70 self.fichier_text += "%s=MALIGNE(ID='%s',);\n" % (nom,'a')
72 for nom in TransfoDico.keys():
73 self.fichier_text += "%s=MONTRANSFO(ID='%s',);\n" % (nom,'a')
75 import Extensions.jdc_include
76 self.JdC_aux = Extensions.jdc_include.JDC_CATA_INCLUDE(code='PSEN', execmodul=None)
77 self.make_contexte_include(None, self.fichier_text)
78 self.old_context_fichier_init = self.contexte_fichier_init
79 self.parent.record_unit(unite, self)
81 self.jdc.MachineDico=MachineDico
82 self.jdc.LoadDico=LoadDico
83 self.jdc.LineDico=LineDico
84 self.jdc.TransfoDico=TransfoDico
86 def INCLUDE_context(self,d):
88 Fonction op_init pour macro INCLUDE
90 for k,v in self.g_context.items():