Version: 9.15.0
yacsorb.YACS.YACS Class Reference
Inheritance diagram for yacsorb.YACS.YACS:
Collaboration diagram for yacsorb.YACS.YACS:

Public Member Functions

def __init__ (self, orb, poa, contID, containerName, instanceName, interfaceName)
 
def getVersion (self)
 
def LoadProc (self, xmlFile)
 
def convertSupervFile (self, xmlFile)
 

Detailed Description

To be a SALOME component, this Python class must have the component name
(YACS) and inherit the YACS_Gen class build from idl compilation
with omniidl and also the class SALOME_ComponentPy_i which defines general
SALOME component behaviour.

Definition at line 232 of file YACS.py.

Constructor & Destructor Documentation

◆ __init__()

def yacsorb.YACS.YACS.__init__ (   self,
  orb,
  poa,
  contID,
  containerName,
  instanceName,
  interfaceName 
)

Definition at line 241 of file YACS.py.

242  interfaceName ):
243  print("YACS.__init__: ", containerName, ';', instanceName)
244  SALOME_ComponentPy.SALOME_ComponentPy_i.__init__(self, orb, poa, contID,
245  containerName, instanceName,
246  interfaceName, False)
247  SALOME_DriverPy.SALOME_DriverPy_i.__init__(self, interfaceName)
248 
249  SALOMERuntime.RuntimeSALOME.setRuntime(1)
250  SALOMERuntime.SALOMEDispatcher_setSALOMEDispatcher()
251  r=pilot.getRuntime()
252 
253  try:
254  #try to load SALOME module catalogs
255  modul_catalog = self._naming_service.Resolve("/Kernel/ModulCatalog")
256  ior= orb.object_to_string(modul_catalog)
257  cata=r.loadCatalog("session",ior)
258  r.addCatalog(cata)
259  except :
260  pass
261 

Member Function Documentation

◆ convertSupervFile()

def yacsorb.YACS.YACS.convertSupervFile (   self,
  xmlFile 
)
load a SUPERV xml graph, convert it and return the new filename.

Definition at line 302 of file YACS.py.

302  def convertSupervFile(self,xmlFile):
303  """
304  load a SUPERV xml graph, convert it and return the new filename.
305  """
306  try:
307  r = pilot.getRuntime()
308  lo = salomeloader.SalomeLoader()
309  e = pilot.ExecutorSwig()
310  p = lo.load(xmlFile)
311  s = pilot.SchemaSave(p)
312  hnd, convertedFile = tempfile.mkstemp(".xml","yacs_","/tmp")
313  s.save(convertedFile)
314  return convertedFile
315  except (IndexError):
316  return ""
317 

◆ getVersion()

def yacsorb.YACS.YACS.getVersion (   self)

Definition at line 265 of file YACS.py.

265  def getVersion( self ):
266  try:
267  rt = SALOMERuntime.getSALOMERuntime()
268  version = rt.getVersion()
269  except:
270  version = ""
271  pass
272  return version
273 

◆ LoadProc()

def yacsorb.YACS.YACS.LoadProc (   self,
  xmlFile 
)
load an XML graph in a YACS::ENGINE::proc, create a CORBA servant
associated to the proc, and return a ref on the servant.

Definition at line 274 of file YACS.py.

274  def LoadProc(self,xmlFile):
275  """
276  load an XML graph in a YACS::ENGINE::proc, create a CORBA servant
277  associated to the proc, and return a ref on the servant.
278  """
279  try:
280  procExec_i = proc_i(xmlFile)
281  logger=procExec_i.p.getLogger("parser")
282  if not logger.isEmpty():
283  print("The imported file has errors :")
284  print(logger.getStr())
285  sys.stdout.flush()
286  return None
287  except IOError as ex:
288  print("IO Error: ", ex, file=sys.stderr)
289  return None
290  except ValueError as ex:
291  print("Caught ValueError Exception:",ex, file=sys.stderr)
292  return None
293  except pilot.Exception as ex:
294  print(ex.what(), file=sys.stderr)
295  return None
296  except:
297  traceback.print_exc()
298  return None
299  procExec_o = procExec_i._this()
300  return procExec_o
301 

The documentation for this class was generated from the following file: