]> SALOME platform Git repositories - tools/eficas.git/blob - Ihm/I_PROC_ETAPE.py
Salome HOME
CCAR: merge du developpement realise dans la branche BR_PN_VAL
[tools/eficas.git] / Ihm / I_PROC_ETAPE.py
1 #            CONFIGURATION MANAGEMENT OF EDF VERSION
2 # ======================================================================
3 # COPYRIGHT (C) 1991 - 2002  EDF R&D                  WWW.CODE-ASTER.ORG
4 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
5 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
6 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
7 # (AT YOUR OPTION) ANY LATER VERSION.
8 #
9 # THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
10 # WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
11 # MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
12 # GENERAL PUBLIC LICENSE FOR MORE DETAILS.
13 #
14 # YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
15 # ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
16 #    1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
17 #
18 #
19 # ======================================================================
20 import I_ETAPE
21
22
23 # import rajoutés suite à l'ajout de Build_sd --> à résorber
24 import sys
25 import traceback,types,string
26 import Noyau
27 from Noyau import N_Exception
28 from Noyau.N_Exception import AsException
29 # fin import à résorber
30
31 class PROC_ETAPE(I_ETAPE.ETAPE):
32    def get_sdname(self):
33       return ""
34
35    def get_sdprods(self,nom_sd):
36       """ 
37          Fonction : retourne le concept produit par l etape de nom nom_sd
38          s il existe sinon None
39          Une PROC ne produit aucun concept
40       """
41       return None
42
43    def delete_concept(self,sd):
44       """
45           Inputs :
46              - sd=concept detruit
47           Fonction :
48           Mettre a jour les mots cles de l etape 
49           suite à la disparition du concept sd
50           Seuls les mots cles simples MCSIMP font un traitement autre
51           que de transmettre aux fils
52       """
53       for child in self.mc_liste :
54         child.delete_concept(sd)
55
56    def replace_concept(self,old_sd,sd):
57       """
58           Inputs :
59              - old_sd=concept remplacé
60              - sd=nouveau concept
61           Fonction :
62           Mettre a jour les mots cles de l etape
63           suite au remplacement du concept old_sd
64       """
65       for child in self.mc_liste :
66         child.replace_concept(old_sd,sd)
67
68 #ATTENTION SURCHARGE: a garder en synchro ou a reintegrer dans le Noyau
69    def Build_sd(self):
70       """
71            Methode de Noyau surchargee pour poursuivre malgre tout
72            si une erreur se produit pendant la creation du concept produit
73       """
74       try:
75          sd=Noyau.N_PROC_ETAPE.PROC_ETAPE.Build_sd(self)
76       except AsException,e:
77          # Une erreur s'est produite lors de la construction du concept
78          # Comme on est dans EFICAS, on essaie de poursuivre quand meme
79          # Si on poursuit, on a le choix entre deux possibilités :
80          # 1. on annule la sd associée à self
81          # 2. on la conserve mais il faut la retourner
82          # En plus il faut rendre coherents sdnom et sd.nom
83          self.sd=None
84          self.sdnom=None
85          self.state="unchanged"
86          self.valid=0
87
88    def Build_sd_old(self):
89       """
90           Cette methode applique la fonction op_init au contexte du parent
91           et lance l'exécution en cas de traitement commande par commande
92           Elle doit retourner le concept produit qui pour une PROC est toujours None
93           En cas d'erreur, elle leve une exception : AsException ou EOFError
94       """
95       if not self.isactif():return
96       try:
97          if self.parent:
98             if type(self.definition.op_init) == types.FunctionType: 
99                apply(self.definition.op_init,(self,self.parent.g_context))
100          else:
101             pass
102          if self.jdc.par_lot == "NON" :
103             self.Execute()
104       except AsException,e:
105         raise AsException("Etape ",self.nom,'ligne : ',self.appel[0],
106                               'fichier : ',self.appel[1],e)
107       except EOFError:
108         raise
109       except :
110         l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2])
111         raise AsException("Etape ",self.nom,'ligne : ',self.appel[0],
112                           'fichier : ',self.appel[1]+'\n',
113                           string.join(l))