1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2007-2017 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
20 from __future__ import absolute_import
24 # import rajoutes suite a l'ajout de buildSd --> a resorber
26 import traceback,types
28 from Noyau import N_Exception
29 from Noyau.N_Exception import AsException
30 from Extensions.eficas_exception import EficasException
32 class PROC_ETAPE(I_ETAPE.ETAPE):
36 def getSdprods(self,nom_sd):
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
44 def supprimeSdProds(self):
46 Fonction: Lors d'une destruction d'etape, detruit tous les concepts produits
47 Une procedure n'en a aucun
51 def deleteConcept(self,sd):
53 Fonction : Mettre a jour les mots cles de l etape
54 suite a la disparition du concept sd
55 Seuls les mots cles simples MCSIMP font un traitement autre
56 que de transmettre aux fils
61 for child in self.mcListe :
62 child.deleteConcept(sd)
64 def replaceConcept(self,old_sd,sd):
66 Fonction : Mettre a jour les mots cles de l etape
67 suite au remplacement du concept old_sd
70 - old_sd=concept remplace
73 for child in self.mcListe :
74 child.replaceConcept(old_sd,sd)
76 #ATTENTION SURCHARGE: a garder en synchro ou a reintegrer dans le Noyau
79 Methode de Noyau surchargee pour poursuivre malgre tout
80 si une erreur se produit pendant la creation du concept produit
83 sd=Noyau.N_PROC_ETAPE.PROC_ETAPE.buildSd(self)
85 # Une erreur s'est produite lors de la construction du concept
86 # Comme on est dans EFICAS, on essaie de poursuivre quand meme
87 # Si on poursuit, on a le choix entre deux possibilites :
88 # 1. on annule la sd associee a self
89 # 2. on la conserve mais il faut la retourner
90 # En plus il faut rendre coherents sdnom et sd.nom
93 self.state="unchanged"