Create concrete classes for O-RAN Nodes 35/11935/1
authorMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Wed, 18 Oct 2023 13:22:43 +0000 (15:22 +0200)
committerMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Wed, 18 Oct 2023 13:22:47 +0000 (15:22 +0200)
- Add more properties for O-RAN-Object for kml generation

Issue-ID: OAM-368
Change-Id: I392292f0384ea36532eb9d2a594ce4a6b389a9bd
Signed-off-by: Martin Skorupski <martin.skorupski@highstreet-technologies.com>
code/network-generator/model/python/o_ran_object.py

index f938954..fc112da 100644 (file)
@@ -20,6 +20,9 @@ An abstract Class for O-RAN Objects
 from abc import ABC, abstractmethod
 from typing import Dict
 
+import model.python.hexagon as Hexagon
+from model.python.hexagon import Hex, Layout, Point
+from model.python.o_ran_spiral_radius_profile import SpiralRadiusProfile
 from model.python.top import ITop, Top
 from model.python.type_definitions import (
     AddressType,
@@ -34,12 +37,20 @@ class IORanObject(ITop):
         address: AddressType = None,
         geoLocation: GeoLocation = None,
         url: str = None,
+        position: Hex = None,
+        layout: Layout = None,
+        spiralRadiusProfile: SpiralRadiusProfile = None,
+        parent  = None,
         **kwargs
     ):
         super().__init__(**kwargs)
         self.address = address
         self.geoLocation = geoLocation
         self.url = url
+        self.position = position
+        self.layout = layout
+        self.spiralRadiusProfile  = spiralRadiusProfile,
+        self.parent  = parent
 
 
 # Define an abstract O-RAN Object class
@@ -51,6 +62,10 @@ class ORanObject(Top, IORanObject):
             of["geoLocation"] if of and "geoLocation" in of else GeoLocation()
         )
         self.url = of["url"] if of and "url" in of else self.id
+        self.position = of["position"] if of and "position" in of else Hex(0,0,0)
+        self.layout = of["layout"] if of and "layout" in of else Layout(Hexagon.layout_flat, Point(1,1), Point(0,0))
+        self.spiralRadiusProfile = of["spiralRadiusProfile"] if of and "spiralRadiusProfile" in of else SpiralRadiusProfile()
+        self.parent = of["parent"] if of and "parent" in of else None
 
     @property
     def address(self):
@@ -76,11 +91,46 @@ class ORanObject(Top, IORanObject):
     def url(self, value):
         self._url = value
 
+    @property
+    def position(self):
+        return self._position
+
+    @position.setter
+    def position(self, value):
+        self._position = value
+
+    @property
+    def layout(self):
+        return self._layout
+
+    @layout.setter
+    def layout(self, value):
+        self._layout = value
+
+    @property
+    def spiralRadiusProfile(self):
+        return self._spiralRadiusProfile
+
+    @spiralRadiusProfile.setter
+    def spiralRadiusProfile(self, value):
+        self._spiralRadiusProfile = value
+
+    @property
+    def parent(self):
+        return self._parent
+
+    @parent.setter
+    def parent(self, value):
+        self._parent = value
+
     def json(self):
         result :Dict = super().json()
         result['address'] = self.address
-        result['geoLocation'] = self.geoLocation.json()
+        result['geoLocation'] = self.geoLocation
         result['url'] = self.url
+        result['layout'] = self.layout
+        result['spiralRadiusProfile'] = self.spiralRadiusProfile
+        result['parent'] = self.parent
         return result
 
     def __str__(self):