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) +}