OspSystemStructureImporter

class ospx.importer.OspSystemStructureImporter

Bases: object

Class providing methods to convert an existing OspSystemStructure.xml file to an ospx caseDict file.

__init__()

Methods

__init__()

import_system_structure(system_structure_file, *)

Import an OspSystemStructure.xml file and save it as an ospx caseDict file.

static import_system_structure(system_structure_file: str | PathLike[str], *, enter_lib_source_as_relative_path: bool = False) None

Import an OspSystemStructure.xml file and save it as an ospx caseDict file.

Parameters:
  • system_structure_file (Union[str, os.PathLike[str]]) – the OspSystemStructure.xml file to be imported

  • enter_lib_source_as_relative_path (bool, optional) – whether lib_source shall be entered as relative path in the caseDict, by default False

Raises:
  • FileNotFoundError – if system_structure_file does not exist

  • NotImplementedError – if the OspSystemStructure contains connections of OSP-IS type ‘SignalConnection’ or ‘SignalGroupConnection’. These connection types are not implemented yet in ospx.

  • NotImplementedError – if the OspSystemStructure contains connections with OSP-IS endpoint type ‘Signal’ or ‘SignalGroup’. These endpoint types are not implemented yet in ospx.

  • TypeError – if the OspSystemStructure contains connections of an unknown type.

  • TypeError – if the OspSystemStructure contains connections with an unknown endpoint type.