This commit is contained in:
2026-06-14 11:39:28 +08:00
2 changed files with 384 additions and 5 deletions
+9 -5
View File
@@ -193,7 +193,7 @@ const clearQueue = () => {
const getQueueSize = () => {
return queue.length
}
// ========== 统一消息队列 END ==========
// ========== RS485 优先级消息队列 END ==========
export default {
// 开左门指令 (通过RS485站号03) - 高优先级
@@ -237,28 +237,32 @@ export default {
let op = status ? '01' : '00'
let cmd = '5AA5EE02' + op
store.state.relay.wind = status
return enqueue('RS232', cmd, PRIORITY.HIGH)
let RS232 = getApp().globalData.RS232
await RS232.sendDataString(cmd);
},
// 开灯指令 03 (通过RS232) - 高优先级
Light: async (status) => {
let op = status ? '01' : '00'
let cmd = '5AA5EE03' + op
store.state.relay.light = status
return enqueue('RS232', cmd, PRIORITY.HIGH)
let RS232 = getApp().globalData.RS232
await RS232.sendDataString(cmd);
},
// 开真空指令 04 (通过RS232) - 高优先级
Vacuum: async (status) => {
let op = status ? '01' : '00'
let cmd = '5AA5EE04' + op
store.state.relay.vacuum = status
return enqueue('RS232', cmd, PRIORITY.HIGH)
let RS232 = getApp().globalData.RS232
await RS232.sendDataString(cmd);
},
// 开关消毒指令 05 (通过RS232) - 高优先级
Disinfect: async (status) => {
let op = status ? '01' : '00'
let cmd = '5AA5EE05' + op
store.state.relay.disinfect = status
return enqueue('RS232', cmd, PRIORITY.HIGH)
let RS232 = getApp().globalData.RS232
await RS232.sendDataString(cmd);
},
// 获取温湿度(通过RS485站号02)- 低优先级
getTemp: () => {