X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=code%2Fnetwork-generator%2Fmodel%2Fpython%2Fo_ran_cu.py;fp=code%2Fnetwork-generator%2Fmodel%2Fpython%2Fo_ran_cu.py;h=e2f552045b86c4141ee0bd5d7c44c18b4bf920c2;hb=718e37645399f0d1be0c563c070b310d1ac66304;hp=fba55d7f673a86b7bde61e8126639cf9f60fd350;hpb=cbdb3c52ee47d804b4202c77082109ef3c561594;p=oam.git diff --git a/code/network-generator/model/python/o_ran_cu.py b/code/network-generator/model/python/o_ran_cu.py index fba55d7..e2f5520 100644 --- a/code/network-generator/model/python/o_ran_cu.py +++ b/code/network-generator/model/python/o_ran_cu.py @@ -18,6 +18,7 @@ A Class representing an O-RAN centralized unit (ORanCu) and at the same time a location for an O-Cloud resource pool """ +from typing import overload from model.python.cube import Cube from model.python.hexagon import Hex import model.python.hexagon as Hexagon @@ -25,6 +26,7 @@ from model.python.o_ran_cloud_du import ORanCloudDu from model.python.tower import Tower from model.python.o_ran_object import IORanObject from model.python.o_ran_node import ORanNode +from model.python.o_ran_termination_point import ORanTerminationPoint import xml.etree.ElementTree as ET @@ -80,6 +82,32 @@ class ORanCu(ORanNode, IORanCu): result.append(tower) return result + @property + def termination_points(self) -> list[ORanTerminationPoint]: + result: list[ORanTerminationPoint] = super().termination_points + phy_tp: str = "-".join([self.name, "phy".upper()]) + result.append({"tp-id": phy_tp, "name": phy_tp}) + for interface in ["e2", "o1"]: + id:str = "-".join([self.name, interface.upper()]) + result.append(ORanTerminationPoint({"id": id, "name":id, "supporter": phy_tp, "parent":self})) + return result + + def to_topology_nodes(self) -> list[dict[str, dict]]: + result: list[dict[str, dict]] = super().to_topology_nodes() + # for o_ran_du in self.o_ran_dus: # TODO + # result.extend(o_ran_du.to_topology_nodes()) + for o_ran_cloud_du in self.o_ran_cloud_dus: + result.extend(o_ran_cloud_du.to_topology_nodes()) + return result + + def to_topology_links(self) -> list[dict[str, dict]]: + result: list[dict[str, dict]] = super().to_topology_links() + # for o_ran_du in self.o_ran_dus: + # result.extend(o_ran_du.to_topology_links()) + for o_ran_cloud_du in self.o_ran_cloud_dus: + result.extend(o_ran_cloud_du.to_topology_links()) + return result + def toKml(self) -> ET.Element: o_ran_cu: ET.Element = ET.Element("Folder") open: ET.Element = ET.SubElement(o_ran_cu, "open")