diff --git a/src/App.vue b/src/App.vue index 6ea3b21..423bd6e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,12 +1,20 @@ - diff --git a/src/router/index.ts b/src/router/index.ts index aa46f1e..5444b59 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -8,6 +8,8 @@ import SprayView from "../views/SprayView.vue"; import PrintView from "../views/PrintView.vue"; import Debug from '../views/debug/index.vue' import SpurtPrint from '../views/spurtPrint/index.vue' +import MatrixManage from '../views/matrixManage/matrixList.vue' + const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -49,6 +51,10 @@ const router = createRouter({ path: "/spurtPrint", name: "spurtPrint", component: SpurtPrint + },{ + path: "/matrixManage", + name: "matrixManage", + component: MatrixManage } ], }, diff --git a/src/services/globalCmd/cmdTypes.ts b/src/services/globalCmd/cmdTypes.ts index 2d6b87c..ed733c1 100644 --- a/src/services/globalCmd/cmdTypes.ts +++ b/src/services/globalCmd/cmdTypes.ts @@ -6,9 +6,11 @@ export type ControlType = { }; export type SyringeType = { - rotationSpeed: string | number; - direction: string | number; - time: string | number; + params : { + rotationSpeed: number; + direction: string | number; + time: number; + } }; type PositionType = { x: number; @@ -27,3 +29,63 @@ export type WorkType = { movementSpeed: number; position: PositionListType; }; + + +export type MachineryType = { + axis: string, + position: string | number +} + +export type ControlNitrogen = 'Dehumidification' | 'Cleaning' | 'Nozzle' + +export type VoltageType = { + params:{ + voltage: number + } +} + +export type ControlValueType = { + params: { + valveType: ControlNitrogen, + isOpen:boolean + } +} + +export type EquipmentStatusType = { + emergencyStop: boolean //急停状态 + pause: boolean, + + //X轴电机状态 + xAxisPosition: number //电机位置 + xAxisSpeed: number //电机速度 + xAxisMovementEnded: boolean + xAxisAtOrigin: boolean + xAxisLimited: boolean + + //Y轴电机状态 + yAxisPosition: number + yAxisSpeed: number + yAxisMovementEnded: boolean + yAxisAtOrigin: boolean + yAxisLimited:boolean + + //Z轴电机状态 + zAxisPosition: number + zAxisSpeed: number + zAxisMovementEnded: boolean + zAxisAtOrigin: boolean + zAxisLimited:boolean + + //三通阀状态 + threeWayValvePosition: string + + // 流量计状态 + flowRate: number + + // 温湿度传感器状态 + temperature:number + humidity: number + + //注射泵状态 + syringePumpNormal: boolean +} \ No newline at end of file diff --git a/src/services/globalCmd/globalCmd.ts b/src/services/globalCmd/globalCmd.ts index aae1d2a..976d171 100644 --- a/src/services/globalCmd/globalCmd.ts +++ b/src/services/globalCmd/globalCmd.ts @@ -1,6 +1,6 @@ import httpRequest, { type BaseResponse } from "../httpRequest"; import { addTxnRecord } from "../txn"; -import type { OperationCmd, ControlType, SyringeType, WorkType } from "./cmdTypes"; +import type { VoltageType, ControlValueType, SyringeType, WorkType } from "./cmdTypes"; //移动电机 export function moveMotorToPosition(params: { commandName: string; params: Record }) { @@ -23,13 +23,13 @@ export function switchThreeWayValve(params: { type: string }) { } //氮气三路 -export function controlValve(params: ControlType) { +export function controlValve(params: ControlValueType) { const commandId = addTxnRecord({ ...params, category: "debug" }); return httpRequest>({ url: "/api/cmd/controlValve", params: { ...params, commandId }, method: "POST" }); } //电压控制 开启 -export function turnOnHighVoltage(params: { voltage: string | number }) { +export function turnOnHighVoltage(params: VoltageType) { const commandId = addTxnRecord({ ...params, category: "debug" }); return httpRequest>({ url: "/api/cmd/turnOnHighVoltage", @@ -60,3 +60,7 @@ export function startWork(params: WorkType) { export function stopWork() { return httpRequest>({ url: "/api/cmd/stopWork", method: "POST" }); } + +export function rotate(params:any){ + return httpRequest>({ url: "/api/cmd/rotate",params, method: "POST" }); +} \ No newline at end of file diff --git a/src/stores/equipmentStatus.ts b/src/stores/equipmentStatus.ts new file mode 100644 index 0000000..a90fa2d --- /dev/null +++ b/src/stores/equipmentStatus.ts @@ -0,0 +1,18 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; +import * as R from "ramda"; +import type { EquipmentStatusType } from '../services/globalCmd/cmdTypes' + +export const useEquipmentStatusStore = defineStore("equipmentStatus", () => { + const equipmentStatus = ref(); + const setEquipmentStatus = (data: EquipmentStatusType[]) => { + if (!R.equals(equipmentStatus.value, data)) { + equipmentStatus.value = data; + } + }; + + return { + equipmentStatus, + setEquipmentStatus + } +}) \ No newline at end of file diff --git a/src/views/debug/index.vue b/src/views/debug/index.vue index b882c60..109c59e 100644 --- a/src/views/debug/index.vue +++ b/src/views/debug/index.vue @@ -10,7 +10,7 @@
X轴:
- +
毫米
移动 @@ -18,7 +18,7 @@
Y轴: - +
毫米
移动 @@ -26,7 +26,7 @@
Z轴: - +
毫米
移动 @@ -42,7 +42,7 @@ 电压控制器: - + 开启 @@ -56,10 +56,10 @@
- 毫米/秒杀 + 毫米/秒杀
- 秒 +
方向: @@ -76,44 +76,42 @@ 湿度: - + 确定 + - - 电机速度: - - - - 毫米 - - - 确定 - - - - - 电机移动时间: - - - - 秒 + + - - 确定 + +
指定转速      指定时间:
+ + X + Y + Z + +
+ 转速:转 + 时间:毫秒 +
+
+ 确定 + 停止 +
- - + +
@@ -140,8 +138,8 @@
切换三通
- 管路切换到基质 - 管路切换到清洗 + 管路切换到基质 + 管路切换到清洗
@@ -157,6 +155,7 @@
状态反馈区
+
@@ -179,49 +178,49 @@
行间距: - + 毫米
氮气流速: - + 毫米/秒
氮气气压: - + Mp
电压: - + V
喷针距离玻片高度: - + 毫米
移速: - + 毫米/秒
起始坐标:
- X: - Y: + X: + Y:
结束坐标:
- X: - Y: + X: + Y:
@@ -236,7 +235,13 @@ \ No newline at end of file