From e5347abfda4e24f54aa41239531205f3021cf331 Mon Sep 17 00:00:00 2001 From: William Bruno Date: Wed, 10 Jun 2026 11:15:15 -0400 Subject: [PATCH] updated compiled app --- src/components/LocationItem.vue | 8 ++- src/components/leaflet/LocationDrawer.vue | 2 +- src/components/{models_bu.ts => models} | 0 src/stores/simulation.ts | 74 ++++++++++------------- 4 files changed, 39 insertions(+), 45 deletions(-) rename src/components/{models_bu.ts => models} (100%) diff --git a/src/components/LocationItem.vue b/src/components/LocationItem.vue index 540dd3c..4378602 100644 --- a/src/components/LocationItem.vue +++ b/src/components/LocationItem.vue @@ -53,7 +53,11 @@ const myData = computed(() => { }); const isDeleted = computed(() => { - return myData.value.status === 'deleted' ? true : false; + if (myData.value) { + return myData.value.status === 'deleted' ? true : false; + } else { + return false; + } }); const currentTime = ref(new Date()); @@ -202,7 +206,7 @@ const itemClass = computed(() => { }); const customIcon = computed(() => { - if (myData.value.status === 'deleted') { + if (isDeleted.value) { return new Icon({ color: 'black', accentColor: 'black', diff --git a/src/components/leaflet/LocationDrawer.vue b/src/components/leaflet/LocationDrawer.vue index 54d5173..4796162 100644 --- a/src/components/leaflet/LocationDrawer.vue +++ b/src/components/leaflet/LocationDrawer.vue @@ -4,7 +4,7 @@ import { storeToRefs } from 'pinia'; import { computed, ref, watch } from 'vue'; import { useLeafletStore } from 'stores/leaflet'; import { useQuasar } from 'quasar'; -import { zoomTo } from 'src/composables/useZoom'; +//import { zoomTo } from 'src/composables/useZoom'; // Draggable imports import { VueDraggable } from 'vue-draggable-plus'; diff --git a/src/components/models_bu.ts b/src/components/models similarity index 100% rename from src/components/models_bu.ts rename to src/components/models diff --git a/src/stores/simulation.ts b/src/stores/simulation.ts index a433ed8..8b035d2 100644 --- a/src/stores/simulation.ts +++ b/src/stores/simulation.ts @@ -138,28 +138,24 @@ export const useSimulationStore = defineStore('simulationStore', { if (debugLog) { console.log('Emitting simulation_control: start'); } - socket.emit( - 'simulation_control', - { command: 'start' }, - (response: CommandResponse) => { - if (response.command_status == 'ERROR') { - functionReturn = { status: 'error', message: response.message?.toString() }; + socket.emit('simulation_control', { command: 'start' }, (response: CommandResponse) => { + if (response.command_status == 'ERROR') { + functionReturn = { status: 'error', message: response.message?.toString() }; + throw new Error(response.message); + } else { + if (!response.data?.simulation) { + functionReturn = { status: 'error', message: 'Simulation queue data missing' }; throw new Error(response.message); } else { - if (!response.data?.simulation) { - functionReturn = { status: 'error', message: 'Simulation queue data missing' }; - throw new Error(response.message); - } else { - functionReturn = { status: 'OK', message: response.message?.toString() }; - this.digestUpdate(response.data.simulation); - } - if (debugLog) { - console.log('response from simulate_control_start: ', response); - } - // return response.message; + functionReturn = { status: 'OK', message: response.message?.toString() }; + this.digestUpdate(response.data.simulation); } - }, - ); + if (debugLog) { + console.log('response from simulate_control_start: ', response); + } + // return response.message; + } + }); break; case 'test-mode': socket.emit( @@ -212,27 +208,23 @@ export const useSimulationStore = defineStore('simulationStore', { if (this.simulationState !== 'RUNNING') { throw new Error('Simulation is not running'); } - socket.emit( - 'simulation_control', - { command: 'pause' }, - (response: CommandResponse) => { - if (response.command_status === 'ERROR') { + socket.emit('simulation_control', { command: 'pause' }, (response: CommandResponse) => { + if (response.command_status === 'ERROR') { + throw new Error(response.message); + } else { + if (!response.data?.simulation) { + functionReturn = { status: 'error', message: 'Simulation queue data missing' }; throw new Error(response.message); } else { - if (!response.data?.simulation) { - functionReturn = { status: 'error', message: 'Simulation queue data missing' }; - throw new Error(response.message); - } else { - functionReturn = { status: 'OK', message: response.message?.toString() }; - this.digestUpdate(response.data.simulation); - } - if (debugLog) { - console.log('response from simulate_control_pause: ', response); - } - return response.message; + functionReturn = { status: 'OK', message: response.message?.toString() }; + this.digestUpdate(response.data.simulation); } - }, - ); + if (debugLog) { + console.log('response from simulate_control_pause: ', response); + } + return response.message; + } + }); break; case 'resume': if (this.simulationState !== 'PAUSED') { @@ -382,8 +374,7 @@ export const useSimulationStore = defineStore('simulationStore', { }); break; case 'next': - socket.emit('simulation_control', { command: 'next' }, - (response: CommandResponse) => { + socket.emit('simulation_control', { command: 'next' }, (response: CommandResponse) => { if (response.command_status == 'ERROR') { throw new Error(response.message); } else { @@ -562,8 +553,8 @@ export const useSimulationStore = defineStore('simulationStore', { return functionReturn; }); }, - getLocationData(loc_id: strong): LocationMark { - return this.locationQueueData[loc_id] + getLocationData(loc_id: string) { + return this.locationQueueData[loc_id]; }, digestUpdate(data: SimulationStatusUpdate): void { if (data.current_location) this.updateCurrentLocation(data.current_location); @@ -592,7 +583,6 @@ export const useSimulationStore = defineStore('simulationStore', { } else { this.locationQueueData = data; } - }, }, });