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 *
22 #from ExtractGeneratorLoadLineandTransfoDico import ExtractGeneratorLoadLineandTransfoDico2
24 def INCLUDE(self,PSSE_path,**args):
26 Fonction sd_prod pour la macro INCLUDE
30 CaseFolder = args['output_folder']
31 if CaseFolder==None: return
33 if hasattr(self,'fichier_ini'):
35 if self.fichier_ini == CaseFolder : return
36 if hasattr(self,'old_context_fichier_init' ):
37 for concept in self.old_context_fichier_init.values():
38 self.jdc.delete_concept(concept)
40 self.contexte_fichier_init={}
41 self.reevalue_sd_jdc()
42 self.jdc.reset_context()
44 self.fichier_ini=CaseFolder
45 self.contexte_fichier_init = {}
46 self.fichier_unite = 999
47 self.fichier_err = None
52 BusList = [138, 77, 69]
53 self.jdc.appli.changeIntoMC(self,'BusesList',BusList)
57 def INCLUDE_context(self,d):
59 Fonction op_init pour macro INCLUDE
61 for k,v in self.g_context.items():
65 def PROCESS_context(self,d):
66 print "dans le init du Process"
68 def PROCESS(self,XLS_file,**args):
69 if XLS_file == "" or XLS_file == None: return
70 if not (hasattr(self,'dico')) :
71 from Processor import getXLS
72 self.dico=getXLS(XLS_file)
73 self.jdc.appli.changeIntoMC(self,'Onglets',self.dico.keys())
74 self.OngletsValeurs=[]
76 # On teste si on a modifie la liste des onglets
77 OngletsValeurs= self.get_child('Onglets').getval()
80 if not (hasattr(self,'OngletsValeurs')) : self.OngletsValeurs=OngletsValeurs
81 elif self.OngletsValeurs == OngletsValeurs : print 'return' ;return
82 else : self.OngletsValeurs=OngletsValeurs
84 if OngletsValeurs==() or OngletsValeurs == []:
85 self.jdc.appli.deleteMC(self,'BusList')
86 self.jdc.appli.deleteMC(self,'ContList')
87 self.OngletsValeurs=[]
90 OldBusValeurs= self.get_child('BusList').getval()
91 OldContValeurs= self.get_child('ContList').getval()
92 if OldBusValeurs == None : OldBusValeurs=[]
93 if OldContValeurs == None : OldContValeurs=[]
99 for o in OngletsValeurs :
100 for b in self.dico[o][0]:
101 texte=b+" ("+ str(o) +" )"
102 listeBus.append(str(texte))
103 if texte in OldBusValeurs : listeBusCoches.append(str(texte))
104 for c in self.dico[o][1]:
105 texte=c+" ("+ str(o) +" )"
106 listeCont.append(str(texte))
107 if texte in OldContValeurs : listeContCoches.append(str(texte))
109 self.jdc.appli.changeIntoMCandSet(self,'BusList',listeBus,listeBusCoches)
110 self.jdc.appli.changeIntoMCandSet(self,'ContList',listeCont,listeContCoches)