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,
def _create_cells(self) -> list[NrCellDu]:
result: list[NrCellDu] = []
- cell_angle: int = (
- self.parent.parent.parent.parent.parent.parent.configuration[
- "pattern"
- ]["nr-cell-du"]["cell-angle"]
+ cell_config: dict = (
+ self.parent.parent.parent.parent.parent.parent
+ .configuration["pattern"]["nrCellDu"]
)
+ cell_angle: int = cell_config["cellAngle"]
+ cell_scale_factor: int = (
+ cell_config["cellScaleFactorForHandoverArea"]
+ )
+ maxReach: int = cell_config["maxReach"]
for index in range(self._cell_count):
s: str = "00" + str(index)
name: str = "-".join(
"layout": self.layout,
"parent": self,
"cellAngle": cell_angle,
+ "cellScaleFactorForHandoverArea": cell_scale_factor,
+ "maxReach": maxReach,
"azimuth": azimuth,
}
)
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)