From 7dabecf9147036c97c8425a362e07a3ca4f3ad78 Mon Sep 17 00:00:00 2001 From: Jack Medrek Date: Tue, 2 Jan 2024 18:36:32 -0500 Subject: [PATCH 1/5] improved layout/style of TopoEditBox.vue --- src/components/TopoEditToolbox.vue | 124 +++++++++++++++++++---------- 1 file changed, 80 insertions(+), 44 deletions(-) diff --git a/src/components/TopoEditToolbox.vue b/src/components/TopoEditToolbox.vue index 32b11f0..33f3290 100644 --- a/src/components/TopoEditToolbox.vue +++ b/src/components/TopoEditToolbox.vue @@ -42,59 +42,95 @@ const finishEdit = () => { From ca6896588619846f6dc3c0a1e0f680ef134f7da7 Mon Sep 17 00:00:00 2001 From: Jack Medrek Date: Wed, 3 Jan 2024 17:04:38 -0500 Subject: [PATCH 2/5] added logic for different node types in ConstructTopology --- src/core/network.ts | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/core/network.ts b/src/core/network.ts index 34dd2c6..c1b7a4d 100644 --- a/src/core/network.ts +++ b/src/core/network.ts @@ -94,12 +94,37 @@ export class NetworkHub { for (const n of this.Nodes.value) { if (n.id == 0) continue - if (n.type == NODE_TYPE.TSN || n.type == NODE_TYPE.TSCH) { - n.neighbors = this.kdTree.FindKNearest(n.pos, 4, 20) - } else { - n.neighbors = this.kdTree.FindKNearest(n.pos, 1, this.Config.value.grid_size) + let neighbors: any = [] + + switch (n.type) { + // 5G UE connects to one 5G tower and wired end systems + case NODE_TYPE.FIVE_G_UE: + neighbors = this.kdTree.FindKNearest(n.pos, 1, 20) + break + + // 5G tower / base station connects one TSN bridge and end systems + multiple 5G UEs + case NODE_TYPE.FIVE_G_BS: + neighbors = this.kdTree.FindKNearest(n.pos, 1000, 20) // k = 1000, arbitrarily large + break + + // TSCH node connects to multiple other TSCH nodes and wired end systems + case NODE_TYPE.TSCH: + neighbors = this.kdTree.FindKNearest(n.pos, 4, 20) + break + + // TSN bridge connects multiple TSN bridges, 5G tower and end systems + case NODE_TYPE.TSN: + neighbors = this.kdTree.FindKNearest(n.pos, 4, 20) + break + + // end system connects to one network node + default: + neighbors = this.kdTree.FindKNearest(n.pos, 1, 20) + break } + n.neighbors = neighbors + n.neighbors.forEach((nn: number) => { this.AddLink(n.id, nn) }) From cea8ac613bb7b4679ad9dc371213b244b1fd8d5c Mon Sep 17 00:00:00 2001 From: Jack Medrek Date: Wed, 3 Jan 2024 18:50:28 -0500 Subject: [PATCH 3/5] reduced padding and el-select option line height --- src/components/TopoEditToolbox.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/TopoEditToolbox.vue b/src/components/TopoEditToolbox.vue index 33f3290..63fbce5 100644 --- a/src/components/TopoEditToolbox.vue +++ b/src/components/TopoEditToolbox.vue @@ -47,7 +47,7 @@ const finishEdit = () => {
Load preset: - + {