Salome HOME
PN bug notation scientifique
[tools/eficas.git] / Ihm / I_PROC_ETAPE.py
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.
9 #
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.
14 #
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.
18 #
19 #
20 # ======================================================================
21 import I_ETAPE
22
23
24 # import rajoutés suite à l'ajout de Build_sd --> à résorber
25 import sys
26 import traceback,types,string
27 import Noyau
28 from Noyau import N_Exception
29 from Noyau.N_Exception import AsException
30 # fin import à résorber
31
32 class PROC_ETAPE(I_ETAPE.ETAPE):
33    def get_sdname(self):
34       return ""
35
36    def get_sdprods(self,nom_sd):
37       """ 
38          Fonction : retourne le concept produit par l etape de nom nom_sd
39          s il existe sinon None
40          Une PROC ne produit aucun concept
41       """
42       return None
43
44    def delete_concept(self,sd):
45       """
46           Inputs :
47              - sd=concept detruit
48           Fonction :
49           Mettre a jour les mots cles de l etape 
50           suite à la disparition du concept sd
51           Seuls les mots cles simples MCSIMP font un traitement autre
52           que de transmettre aux fils
53       """
54       for child in self.mc_liste :
55         child.delete_concept(sd)
56
57    def replace_concept(self,old_sd,sd):
58       """
59           Inputs :
60              - old_sd=concept remplacé
61              - sd=nouveau concept
62           Fonction :
63           Mettre a jour les mots cles de l etape
64           suite au remplacement du concept old_sd
65       """
66       for child in self.mc_liste :
67         child.replace_concept(old_sd,sd)
68
69 #ATTENTION SURCHARGE: a garder en synchro ou a reintegrer dans le Noyau
70    def Build_sd(self):
71       """
72            Methode de Noyau surchargee pour poursuivre malgre tout
73            si une erreur se produit pendant la creation du concept produit
74       """
75       try:
76          sd=Noyau.N_PROC_ETAPE.PROC_ETAPE.Build_sd(self)
77       except AsException,e:
78          # Une erreur s'est produite lors de la construction du concept
79          # Comme on est dans EFICAS, on essaie de poursuivre quand meme
80          # Si on poursuit, on a le choix entre deux possibilités :
81          # 1. on annule la sd associée à self
82          # 2. on la conserve mais il faut la retourner
83          # En plus il faut rendre coherents sdnom et sd.nom
84          self.sd=None
85          self.sdnom=None
86          self.state="unchanged"
87          self.valid=0
88