From e91bf9bcdc2946cc48c68072f484a10e8db78915 Mon Sep 17 00:00:00 2001 From: AmyangXYZ Date: Mon, 15 Jan 2024 11:03:44 -0500 Subject: [PATCH] fix path --- .../models/es/{sensor => sensor_camera}/scene.glb | Bin src/components/TopoEditToolbox.vue | 7 ++++--- src/core/network.ts | 7 +++++-- src/core/typedefs.ts | 4 ++-- src/hooks/useDrawTopology.ts | 4 ++-- 5 files changed, 13 insertions(+), 9 deletions(-) rename public/models/es/{sensor => sensor_camera}/scene.glb (100%) diff --git a/public/models/es/sensor/scene.glb b/public/models/es/sensor_camera/scene.glb similarity index 100% rename from public/models/es/sensor/scene.glb rename to public/models/es/sensor_camera/scene.glb diff --git a/src/components/TopoEditToolbox.vue b/src/components/TopoEditToolbox.vue index 04ecd6b..fe3a975 100644 --- a/src/components/TopoEditToolbox.vue +++ b/src/components/TopoEditToolbox.vue @@ -18,9 +18,10 @@ const nodeTypes = [ { label: 'End systems', types: [ - { label: 'Edge server', value: NODE_TYPE.END_SYSTEM_SENSOR }, - { label: 'Sensor', value: NODE_TYPE.END_SYSTEM_SENSOR }, - { label: 'Robotic arm', value: NODE_TYPE.END_SYSTEM_ROBOTIC_ARM } + { label: 'Edge server', value: NODE_TYPE.END_SYSTEM_SERVER }, + { label: 'Temp Sensor', value: NODE_TYPE.END_SYSTEM_SENSOR_TEMP }, + { label: 'Camera', value: NODE_TYPE.END_SYSTEM_SENSOR_CAMERA }, + { label: 'Robotic arm', value: NODE_TYPE.END_SYSTEM_ACTUATOR_ROBOTIC_ARM } ] } ] diff --git a/src/core/network.ts b/src/core/network.ts index 5afc956..5cd1558 100644 --- a/src/core/network.ts +++ b/src/core/network.ts @@ -164,8 +164,11 @@ export class NetworkHub { for (let i = 1; i <= this.Config.value.num_nodes; i++) { const n = { id: this.Nodes.value.length, - type: [0, 1, 2, 3, 11, 12, 13, 14, 15, 16, 17][ - Math.floor((this.Rand.next() * Object.keys(NODE_TYPE).length) / 2) + // type: [0, 1, 2, 3, 11, 12, 13, 14, 15, 16, 17][ + // Math.floor((this.Rand.next() * Object.keys(NODE_TYPE).length) / 2) + // ], + type: [0, 1, 2, 3, 11, 12, 16][ + Math.floor(this.Rand.next() * 7) ], pos: [ Math.floor(this.Rand.next() * this.Config.value.grid_size) - diff --git a/src/core/typedefs.ts b/src/core/typedefs.ts index 07d92aa..72e1e19 100644 --- a/src/core/typedefs.ts +++ b/src/core/typedefs.ts @@ -13,7 +13,7 @@ export enum NODE_TYPE { FIVE_G_GNB, FIVE_G_UE, END_SYSTEM_SERVER = 11, - END_SYSTEM_SENSOR, + END_SYSTEM_SENSOR_CAMERA, END_SYSTEM_SENSOR_TEMP, END_SYSTEM_SENSOR_PRESSURE, END_SYSTEM_SENSOR_HUMIDITY, @@ -27,7 +27,7 @@ export const NODE_TYPE_DISPLAY_NAME = <{ [name: string]: string }>{ FIVE_G_GNB: '5G gNB', FIVE_G_UE: '5G UE', END_SYSTEM_SERVER: 'Edge Server', - END_SYSTEM_SENSOR: 'Sensor', + END_SYSTEM_SENSOR_CAMERA: 'Camera', END_SYSTEM_SENSOR_TEMP: 'Temperature Sensor', END_SYSTEM_SENSOR_PRESSURE: 'Pressure Sensor', END_SYSTEM_SENSOR_HUMIDITY: 'Humidity Sensor', diff --git a/src/hooks/useDrawTopology.ts b/src/hooks/useDrawTopology.ts index e39c4ba..fd242db 100644 --- a/src/hooks/useDrawTopology.ts +++ b/src/hooks/useDrawTopology.ts @@ -181,8 +181,8 @@ export async function useDrawTopology(dom: HTMLElement) { Math.PI / 2 ) await loadModel( - NODE_TYPE.END_SYSTEM_SENSOR, - '/models/es/sensor/scene.glb', + NODE_TYPE.END_SYSTEM_SENSOR_CAMERA, + '/models/es/sensor_camera/scene.glb', 2, -Math.PI / 3 )