Salome HOME
bug 53033
[tools/eficas.git] / Ihm / I_PROC_ETAPE.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2007-2013   EDF R&D
3 #
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.
8 #
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.
13 #
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
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
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 from Extensions.eficas_exception import EficasException
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 supprime_sdprods(self):
44       """
45          Fonction: Lors d'une destruction d'etape, detruit tous les concepts produits
46          Une procedure n'en a aucun
47       """
48       return
49
50    def delete_concept(self,sd):
51       """
52           Fonction : Mettre a jour les mots cles de l etape 
53           suite à la disparition du concept sd
54           Seuls les mots cles simples MCSIMP font un traitement autre
55           que de transmettre aux fils
56
57           Inputs :
58              - sd=concept detruit
59       """
60       for child in self.mc_liste :
61         child.delete_concept(sd)
62
63    def replace_concept(self,old_sd,sd):
64       """
65           Fonction : Mettre a jour les mots cles de l etape
66           suite au remplacement du concept old_sd
67
68           Inputs :
69              - old_sd=concept remplacé
70              - sd=nouveau concept
71       """
72       for child in self.mc_liste :
73         child.replace_concept(old_sd,sd)
74
75 #ATTENTION SURCHARGE: a garder en synchro ou a reintegrer dans le Noyau
76    def Build_sd(self):
77       """
78            Methode de Noyau surchargee pour poursuivre malgre tout
79            si une erreur se produit pendant la creation du concept produit
80       """
81       try:
82          sd=Noyau.N_PROC_ETAPE.PROC_ETAPE.Build_sd(self)
83       except AsException  :
84          # Une erreur s'est produite lors de la construction du concept
85          # Comme on est dans EFICAS, on essaie de poursuivre quand meme
86          # Si on poursuit, on a le choix entre deux possibilités :
87          # 1. on annule la sd associée à self
88          # 2. on la conserve mais il faut la retourner
89          # En plus il faut rendre coherents sdnom et sd.nom
90          self.sd=None
91          self.sdnom=None
92          self.state="unchanged"
93          self.valid=0
94