"""
A Class representing a 3GPP new radio cell du (NrCellDu)
"""
+from typing import overload
+
+from model.python.o_ran_termination_point import ORanTerminationPoint
from model.python.o_ran_object import IORanObject
from model.python.o_ran_node import ORanNode
import model.python.hexagon as Hexagon
class INrCellDu(IORanObject):
def __init__(self, cell_angel: int, azimuth: int, **kwargs):
super().__init__(**kwargs)
- self._cell_angle = cell_angle
+ self._cell_angle = cell_angel
self._azimuth = azimuth
cell_data["azimuth"] if cell_data and "azimuth" in cell_data else 0
)
+ @property
+ def termination_points(self) -> list[ORanTerminationPoint]:
+ result: list[ORanTerminationPoint] = super().termination_points
+ result.append(ORanTerminationPoint({"id": self.name, "name": self.name}))
+ return result
+
+ def to_topology_nodes(self) -> list[dict[str, dict]]:
+ # a cell is not a node it is a Termination Point
+ result: list[dict[str, dict]] = [] # super().to_topology_nodes()
+ return result
+
+ def to_topology_links(self) -> list[dict[str, dict]]:
+ # as a cell is not a node, it does not have links
+ result: list[dict[str, dict]] = [] # super().to_topology_links()
+ return result
+
def toKml(self) -> ET.Element:
placemark: ET.Element = ET.Element("Placemark")
name: ET.Element = ET.SubElement(placemark, "name")
geo_locations: list[GeoLocation] = list(map(method, points))
text: list[str] = []
-
- index: int = 1 + int(self._azimuth/self._cell_angle)
- network_center:GeoLocation = GeoLocation(self.parent.parent.parent.parent.parent.parent.geoLocation)
+ index: int = 1 + int(self._azimuth / self._cell_angle)
+ network_center: GeoLocation = GeoLocation(
+ self.parent.parent.parent.parent.parent.parent.geoLocation
+ )
intersect1: Point = Point(
- (points[(2 * index +1) % 6].x + points[(2 * index +2) % 6].x) / 2,
- (points[(2 * index +1) % 6].y + points[(2 * index +2) % 6].y) / 2,
+ (points[(2 * index + 1) % 6].x + points[(2 * index + 2) % 6].x) / 2,
+ (points[(2 * index + 1) % 6].y + points[(2 * index + 2) % 6].y) / 2,
+ )
+ intersect_geo_location1: GeoLocation = network_center.point_to_geo_location(
+ intersect1
)
- intersect_geo_location1: GeoLocation = network_center.point_to_geo_location(intersect1)
-
+
intersect2: Point = Point(
- (points[(2 * index +3) % 6].x + points[(2 * index +4) % 6].x) / 2,
- (points[(2 * index +3) % 6].y + points[(2 * index +4) % 6].y) / 2,
+ (points[(2 * index + 3) % 6].x + points[(2 * index + 4) % 6].x) / 2,
+ (points[(2 * index + 3) % 6].y + points[(2 * index + 4) % 6].y) / 2,
+ )
+ intersect_geo_location2: GeoLocation = network_center.point_to_geo_location(
+ intersect2
)
- intersect_geo_location2: GeoLocation = network_center.point_to_geo_location(intersect2)
- tower:GeoLocation = GeoLocation(self.geoLocation)
+ tower: GeoLocation = GeoLocation(self.geoLocation)
cell_polygon: list[GeoLocation] = []
cell_polygon.append(tower)
cell_polygon.append(intersect_geo_location2)
# close polygon
cell_polygon.append(tower)
-
+
for geo_location in cell_polygon:
text.append(
f"{'%.6f' % geo_location.longitude},{'%.6f' % geo_location.latitude},{'%.6f' % geo_location.aboveMeanSeaLevel}"