X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=code%2Fnetwork-topology-instance-generator%2Fmodel%2Fpython%2Ftapi_common_context.py;h=75381a80fc98d6619b78724de9973e8e226a1b76;hb=refs%2Fchanges%2F11%2F12011%2F1;hp=7c96391956e7f7bae9d063ada005709b8206ef45;hpb=f8cb37a11b5ebf6831bff4aa0370e62d6d2b0031;p=oam.git diff --git a/code/network-topology-instance-generator/model/python/tapi_common_context.py b/code/network-topology-instance-generator/model/python/tapi_common_context.py index 7c96391..75381a8 100644 --- a/code/network-topology-instance-generator/model/python/tapi_common_context.py +++ b/code/network-topology-instance-generator/model/python/tapi_common_context.py @@ -60,14 +60,18 @@ class TapiCommonContext(Top): """ return self.__data - def json(self) -> Dict: + def json(self, running: bool) -> Dict: """ Getter for a json object representing the TAPI Topology Context. :return TAPI Common Context as json object. """ result = self.data().copy() - if self.__context is not None: + if self.__context is not None and running is False: result["tapi-common:context"].update(self.__context.json()) + + if running is True and "tapi-topology:topology-context" in result["tapi-common:context"]: + result["tapi-common:context"].pop("tapi-topology:topology-context") + return result def identifier(self) -> str: @@ -86,7 +90,7 @@ class TapiCommonContext(Top): def __svg_width(self) -> int: p = self.configuration()['network']['pattern'] - return (p['smo'] * p['near-rt-ric'] * p['o-cu'] * p['o-du'] * p['fronthaul-gateway'] * p['o-ru'] * p['user-equipment'] + 1) * 2*2*self.FONTSIZE + return (p['smo'] * p['near-rt-ric'] * p['o-cu'] * p['o-du'] * p['fronthaul-gateway'] * p['o-ru'] * p['user-equipment'] + 1) * 4*2*self.FONTSIZE def __svg_height(self) -> int: return (8 * 11 + 6) * self.FONTSIZE @@ -113,7 +117,10 @@ class TapiCommonContext(Top): root.append(desc) title=etree.Element("title") - title.text=self.configuration()["network"]["name"] + if "name" in self.configuration()["network"]: + title.text=self.configuration()["network"]["name"] + else: + title.text="o-ran-sc-topology-view" root.append(title) root.append(self.__context.svg(x, y))