From 167d8f3e915b924898f954b56b99a10f1366b586 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Sun, 15 Jun 2025 11:10:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E8=AF=95=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libs/utils.ts | 4 ++ src/stores/debugStore.ts | 4 ++ src/types/debug.d.ts | 10 +++-- src/views/debug/index.vue | 93 +++++++++++++++++++++++++++++++++++++++++++++++ src/views/home/index.vue | 2 +- 5 files changed, 109 insertions(+), 4 deletions(-) diff --git a/src/libs/utils.ts b/src/libs/utils.ts index 502c2f8..b4f8c4e 100644 --- a/src/libs/utils.ts +++ b/src/libs/utils.ts @@ -58,6 +58,10 @@ export const cmdNameMap = { debug_show_smog: '展示烟雾', debug_vacuum_valve_open: '开启真空泵阀门', debug_vacuum_valve_close: '关闭真空泵阀门', + debug_fill_light_open: '开启补光灯', + debug_fill_light_close: '关闭补光灯', + debug_tri_color_light_open: '开启三色灯', + debug_tri_color_light_close: '关闭三色灯', } export const generateColors = (count: number): string[] => { diff --git a/src/stores/debugStore.ts b/src/stores/debugStore.ts index fa67abf..d3178c9 100644 --- a/src/stores/debugStore.ts +++ b/src/stores/debugStore.ts @@ -7,6 +7,10 @@ import { useSystemStore } from 'stores/systemStore' export const useDebugStore = defineStore('debug', { state: (): Debug.DebugStore => ({ formData: { + light: { + lightIntensity: 100, + color: 'RED', + }, // 加液机械臂 liquidArmData: { largeArmAngle: undefined, diff --git a/src/types/debug.d.ts b/src/types/debug.d.ts index 8f41266..bb4234e 100644 --- a/src/types/debug.d.ts +++ b/src/types/debug.d.ts @@ -9,6 +9,10 @@ declare namespace Debug { heatArea: HeatArea transferModule: TransferModule lidData: LidData + light: { + lightIntensity: number + color: 'RED' | 'GREEN' | 'BLUE' + } } interface LiquidArmData { largeArmAngle: number | undefined @@ -53,7 +57,7 @@ declare namespace Debug { xDimVelocity: number | undefined times: number | undefined direction: 'forward' | 'backward' - position: number | undefined + position?: number | undefined } interface YMotorData { @@ -61,7 +65,7 @@ declare namespace Debug { yDimVelocity: number | undefined times: number | undefined direction: 'forward' | 'backward' - position: number | undefined + position?: number | undefined } interface ZMotorData { @@ -69,7 +73,7 @@ declare namespace Debug { zDimVelocity: number | undefined times: number | undefined direction: 'forward' | 'backward' - position: number | undefined + position?: number | undefined } interface JawData { diff --git a/src/views/debug/index.vue b/src/views/debug/index.vue index bc3247c..e17a158 100644 --- a/src/views/debug/index.vue +++ b/src/views/debug/index.vue @@ -631,6 +631,50 @@ const debug_stop_all_motor = async () => { } const savePositionVisible = ref(false) + +const debug_fill_light_open = async () => { + currentCommandId = Date.now().toString() + const params = { + commandId: currentCommandId, + command: 'debug_fill_light_open', + params: { + ...debugStore.formData.light, + }, + } + await debugStore.sendControl(params) +} +const debug_fill_light_close = async () => { + currentCommandId = Date.now().toString() + const params = { + commandId: currentCommandId, + command: 'debug_fill_light_close', + params: { + }, + } + await debugStore.sendControl(params) +} + +const debug_tri_color_light_open = async () => { + currentCommandId = Date.now().toString() + const params = { + commandId: currentCommandId, + command: 'debug_tri_color_light_open', + params: { + ...debugStore.formData.light, + }, + } + await debugStore.sendControl(params) +} +const debug_tri_color_light_close = async () => { + currentCommandId = Date.now().toString() + const params = { + commandId: currentCommandId, + command: 'debug_tri_color_light_close', + params: { + }, + } + await debugStore.sendControl(params) +}