From b9bd5f237e2bf5722cdbd25c2279718cdcebe5f1 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Tue, 9 Mar 2021 17:57:09 -0800 Subject: [PATCH] vr_profile2.py: adds related notes about how Netsmith handles a moved connection Signed-off-by: Jed Reynolds --- py-json/vr_profile2.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/py-json/vr_profile2.py b/py-json/vr_profile2.py index 066dcd1e..e896b324 100644 --- a/py-json/vr_profile2.py +++ b/py-json/vr_profile2.py @@ -354,6 +354,25 @@ class VRProfile(BaseProfile): def move_vrcx(self, vrcx_name=None, vr_eid=None, debug=False): """ + This is the Java psuedocode: + def moveConnection: + found_router = findRouter(x, y) + + if connection.getRouter() is None: + if found_router.addConnection(): + free_vrxc.remove(connection) + connection.setPosition(x, y) + return + + if found_router is not None: + router.remove(connection) + free_vrcx.add(connection) + else: + if found_router != router: + router.remove(connection) + found_router.add(connection) + + connection.setPosition(x, y) :param vrcx_name: :param vr_eid: