A Class representing an O-RAN radio unit (ORanRu)
"""
import xml.etree.ElementTree as ET
+import os
from typing import Any, cast
from network_generation.model.python.nr_cell_du import NrCellDu
)
self._cells: list[NrCellDu] = self._create_cells()
name: str = self.name.replace("RU", "DU")
+ self.type = "ntsim-ng-o-ru"
o_ran_du_data: dict[str, Any] = {
"name": name,
result: list[NrCellDu] = []
cell_config: dict = (
self.parent.parent.parent.parent.parent.parent
- .configuration["pattern"]["nr-cell-du"]
+ .configuration["pattern"]["nrCellDu"]
)
- cell_angle: int = cell_config["cell-angle"]
+ cell_angle: int = cell_config["cellAngle"]
cell_scale_factor: int = (
cell_config["cellScaleFactorForHandoverArea"]
)
def toSvg(self) -> ET.Element:
return ET.Element("to-be-implemented")
+
+ def to_directory(self, parent_dir: str) -> None:
+ self.oRanDu.to_directory(parent_dir)
+ parent_path = os.path.join(parent_dir, self.type)
+ path = os.path.join(parent_path, self.name)
+ if not os.path.exists(parent_path):
+ os.makedirs(parent_path, exist_ok=True)
+ if not os.path.exists(path):
+ os.mkdir(path)