-# Copyright (C) 2006-2008 CEA/DEN, EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2006-2012 CEA/DEN, EDF R&D
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# -*- coding: iso-8859-1 -*-
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
"""This module is used to parse a supervision graph Salome (XML) and convert it into
YACS calculation schema
except ImportError:
import ElementTree
-from sets import Set
+#from sets import Set
+Set=set
import graph
import pilot
import SALOMERuntime
class UnknownKind(Exception):pass
+#global variables
debug=0
typeMap={}
objref=None
+_containers={}
+currentProc=None
def typeName(name):
"""Replace :: in type name by /"""
'3':"CALCIUM_real",
}
-currentProc=None
class SalomeLoader:
"""This class parses a Salome graph (version 3.2.x) and converts it into YACS schema.
The load method calls the loadxml method and creates a YACS object of class Proc
"""
-
def loadxml(self,filename):
"""
Parse a XML file from Salome SUPERV and return a list of SalomeProc objects.
def load(self,filename):
"""Parse a SUPERV XML file (method loadxml) and return a YACS Proc object.
"""
- global currentProc
+ global typeMap,_containers,objref,currentProc
+ typeMap.clear()
+ objref=None
+ _containers.clear()
+ currentProc=None
+
procs=self.loadxml(filename)
#Split the master proc from the possible macros.
proc=procs.pop(0)
def getName(self):
return self.mach+"/"+self.name
-_containers={}
def getContainer(name):
if not name:
name="localhost/FactoryServer"