From 85a5ad1d356463b7dbd280e67ed0c5d5fa92d222 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Sun, 7 Apr 2024 10:59:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=97=E8=BD=A6=E9=A9=BE=E9=A9=B6?= =?UTF-8?q?=E5=8F=B0=E8=B0=83=E6=95=B4--=E6=94=B9=E5=8F=98=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E5=90=8E=E8=B0=83=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/graphics/TccHandleInteraction.ts | 6 ++++++ src/drawApp/graphics/TccKeyInteraction.ts | 1 + src/drawApp/tccScene.ts | 2 -- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/drawApp/graphics/TccHandleInteraction.ts b/src/drawApp/graphics/TccHandleInteraction.ts index c625b47..d793c42 100644 --- a/src/drawApp/graphics/TccHandleInteraction.ts +++ b/src/drawApp/graphics/TccHandleInteraction.ts @@ -86,6 +86,7 @@ export class TccHandleInteraction extends GraphicInteractionPlugin { isMouseDown = false; mouseDownBeginPos = 0; mouseDownTccHandleBeginPos = 0; + timeout: string | number | NodeJS.Timeout | undefined; constructor(app: IGraphicScene) { super(TccHandleInteraction.Name, app); } @@ -116,6 +117,7 @@ export class TccHandleInteraction extends GraphicInteractionPlugin { g._tccHandle.onmousedown = null; g._tccHandle.onmouseup = null; g.onmousemove = null; + clearTimeout(this.timeout); } onMouseDown(e: FederatedMouseEvent) { const target = e.target as DisplayObject; @@ -144,6 +146,10 @@ export class TccHandleInteraction extends GraphicInteractionPlugin { } else if (tccHandle._tccHandle.y <= -145) { tccHandle._tccHandle.y = -144; } + clearTimeout(this.timeout); + this.timeout = setTimeout(() => { + useTccStore().onMouseUpFromTccHandle(); + }, 100); } } onMouseUp() { diff --git a/src/drawApp/graphics/TccKeyInteraction.ts b/src/drawApp/graphics/TccKeyInteraction.ts index 25b61ea..a79e4d5 100644 --- a/src/drawApp/graphics/TccKeyInteraction.ts +++ b/src/drawApp/graphics/TccKeyInteraction.ts @@ -207,6 +207,7 @@ export abstract class KeyInteraction< if (this.lastTimenRotation !== this.changeRotation) { this.lastTimenRotation = this.changeRotation; this.ratatingSprite.rotation = this.changeRotation; + useTccStore().onMouseUpFromTccKeyDir(); } } else { if (direction == 'ssz') { diff --git a/src/drawApp/tccScene.ts b/src/drawApp/tccScene.ts index 1e5fb60..5beeca6 100644 --- a/src/drawApp/tccScene.ts +++ b/src/drawApp/tccScene.ts @@ -60,11 +60,9 @@ export function initTccScene(lineApp: IGraphicApp, sceneName: string) { tccScene.canvas.onmouseup = () => { tccStore.canvasMouseDown = false; if (tccStore.mouseDownOnTccHandle) { - tccStore.onMouseUpFromTccHandle(); tccStore.mouseDownOnTccHandle = false; } if (tccStore.mouseDownOnTccKeyDir) { - tccStore.onMouseUpFromTccKeyDir(); tccStore.mouseDownOnTccKeyDir = false; } }; From fde31acc724d5edca194dc1f15901efe5994ae75 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Sun, 7 Apr 2024 17:54:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rts-sim-testing-message | 2 +- .../line-app/states/CarWashingState.vue | 169 +++++++++++++++++- .../line-app/states/FloodGateState.vue | 1 + .../line-app/states/GarageDoorState.vue | 1 + src/configs/UrlManage.ts | 2 +- src/drawApp/graphics/FloodGateInteraction.ts | 6 + src/drawApp/graphics/GarageDoorInteraction.ts | 6 + src/drawApp/graphics/PslButtonInteraction.ts | 6 + src/drawApp/pslApp.ts | 1 - src/drawApp/pslScene.ts | 14 +- src/graphics/carWashing/CarWashing.ts | 6 +- src/graphics/floodGate/FloodGate.ts | 2 + src/graphics/garageDoor/GarageDoor.ts | 2 + src/graphics/pslButton/pslButton.ts | 2 + src/protos/device_state.ts | 23 +++ 15 files changed, 222 insertions(+), 21 deletions(-) diff --git a/rts-sim-testing-message b/rts-sim-testing-message index 208bcae..e4728f0 160000 --- a/rts-sim-testing-message +++ b/rts-sim-testing-message @@ -1 +1 @@ -Subproject commit 208bcaedccf71e7bfd2535e2889ca4cf7c4bdbb6 +Subproject commit e4728f0f732904f543a86aabb2c3da2653dd139f diff --git a/src/components/line-app/states/CarWashingState.vue b/src/components/line-app/states/CarWashingState.vue index 6322a64..9e7f20a 100644 --- a/src/components/line-app/states/CarWashingState.vue +++ b/src/components/line-app/states/CarWashingState.vue @@ -21,7 +21,147 @@ - + + + {{ item.label }} + + + {{ + item.formatFn + ? item.formatFn(carWashingState[item.key]) + : carWashingState[item.key] + }} + + + + + + + + + + {{ item.label }} + + + {{ + item.formatFn + ? item.formatFn(carWashingState[item.key]) + : carWashingState[item.key] + }} + + + + + {{ item.label }} + + + [ + {{ + `1:${carWashingState.twjList[0] ? '结束' : '未结束'}` + }} + {{ + `2:${carWashingState.twjList[1] ? '结束' : '未结束'}` + }} + {{ + `3:${carWashingState.twjList[2] ? '结束' : '未结束'}` + }} + ] + + + + + {{ item.label }} + + + {{ + item.formatFn + ? item.formatFn(carWashingState[item.key]) + : carWashingState[item.key] + }} + + + + + + + + + + {{ item.label }} + + + {{ + item.formatFn + ? item.formatFn(carWashingState[item.key]) + : carWashingState[item.key] + }} + + + + + {{ item.label }} + + + + [ + {{ + `1:${carWashingState.cfjList[0] ? '结束' : '未结束'}` + }} + {{ + `2:${carWashingState.cfjList[1] ? '结束' : '未结束'}` + }} + {{ + `3:${carWashingState.cfjList[2] ? '结束' : '未结束'}` + }} + ] + + + + {{ item.label }} @@ -64,15 +204,27 @@ interface KeyType { formatFn?(v: CarWashingState[keyof CarWashingState]): string; } -const list: KeyType[] = [ +const list1: KeyType[] = [ { label: '洗车机索引', key: 'id' }, { label: '洗车机名称', key: 'code', formatFn: getNameFormat }, +]; +const list2: KeyType[] = [ { label: '洗车请求', key: 'xqj', formatFn: getBoolFormat }, - { label: '是否停稳', key: 'twjList', formatFn: getTwFormat }, +]; +const list3: KeyType[] = [ + { label: '端洗停稳 ', key: 'twjList', formatFn: getTwFormat }, +]; +const list4: KeyType[] = [ { label: '通过请求', key: 'tgqj', formatFn: getBoolFormat }, +]; +const list5: KeyType[] = [ { label: '洗车就绪', key: 'xcjxj', formatFn: getBoolFormat }, { label: '洗车允许', key: 'xcyxj', formatFn: getBoolFormat }, - { label: '移动允许', key: 'cfjList', formatFn: getYXFormat }, +]; +const list6: KeyType[] = [ + { label: '端洗结束', key: 'cfjList', formatFn: getYXFormat }, +]; +const list7: KeyType[] = [ { label: '紧急停车', key: 'jtj', formatFn: getBoolFormat }, { label: '通过允许', key: 'tgyxj', formatFn: getBoolFormat }, ]; @@ -107,11 +259,11 @@ function getBoolFormat(v: boolean) { } function getTwFormat(v: boolean[]) { if (v.length === 2) { - return `头部${v[0] ? '停稳' : '未停稳'};尾部${v[1] ? '停稳' : '未停稳'};`; + return `[1:${v[0] ? '停稳' : '未停稳'};2:${v[1] ? '停稳' : '未停稳'};]`; } else if (v.length === 3) { - return `头部${v[0] ? '停稳' : '未停稳'};中部${ - v[1] ? '停稳' : '未停稳' - };尾部${v[2] ? '停稳' : '未停稳'};`; + return `[1:${v[0] ? '停稳' : '未停稳'};2:${v[1] ? '停稳' : '未停稳'};3:${ + v[2] ? '停稳' : '未停稳' + };]`; } else { return '状态显示错误'; } @@ -132,7 +284,6 @@ function getYXFormat(v: boolean[]) { function initCarWashingState(carWashing: CarWashing) { copySelectGraphic = toRaw(carWashing); code.value = carWashing.datas.code; - console.log(code.value, carWashing); updateState(carWashing); subscribeState(carWashing); diff --git a/src/components/line-app/states/FloodGateState.vue b/src/components/line-app/states/FloodGateState.vue index 0594b9e..3520301 100644 --- a/src/components/line-app/states/FloodGateState.vue +++ b/src/components/line-app/states/FloodGateState.vue @@ -84,6 +84,7 @@ const list: KeyType[] = [ { label: '防淹门名称', key: 'code', formatFn: getNameFormat }, { label: '防淹门关闭', key: 'mgj', formatFn: getName }, { label: '控制端', key: 'local', formatFn: getLocal }, + { label: '门旁路', key: 'mplj', formatFn: getName }, { label: '防淹门强制', key: 'param', formatFn: getForceName }, { label: '设置故障', key: 'param', formatFn: getFaultName }, ]; diff --git a/src/components/line-app/states/GarageDoorState.vue b/src/components/line-app/states/GarageDoorState.vue index 439efcb..0f4c83c 100644 --- a/src/components/line-app/states/GarageDoorState.vue +++ b/src/components/line-app/states/GarageDoorState.vue @@ -84,6 +84,7 @@ const list: KeyType[] = [ { label: '车库门名称', key: 'code', formatFn: getNameFormat }, { label: '车库门关闭', key: 'mgj', formatFn: getName }, { label: '控制端', key: 'local', formatFn: getLocal }, + { label: '门旁路', key: 'mplj', formatFn: getName }, // { label: '状态丢失', key: 'stateLoss', formatFn: getName }, { label: '车库门强制', key: 'param', formatFn: getForceName }, { label: '设置故障', key: 'param', formatFn: getFaultName }, diff --git a/src/configs/UrlManage.ts b/src/configs/UrlManage.ts index de7f757..6a575cd 100644 --- a/src/configs/UrlManage.ts +++ b/src/configs/UrlManage.ts @@ -9,7 +9,7 @@ function getHost(): string { // return '192.168.3.7:9091'; // return '192.168.3.47:9091'; // return '192.168.3.37:9091'; - // return '192.168.33.207:9091'; // 张骞 + return '192.168.33.207:9091'; // 张骞 // return '192.168.33.93:9091'; // return '192.168.3.37:9091'; //卫志宏 // return 'test.joylink.club/bjrtsts-service'; // 测试 diff --git a/src/drawApp/graphics/FloodGateInteraction.ts b/src/drawApp/graphics/FloodGateInteraction.ts index fafc921..e6e076e 100644 --- a/src/drawApp/graphics/FloodGateInteraction.ts +++ b/src/drawApp/graphics/FloodGateInteraction.ts @@ -114,6 +114,12 @@ export class FloodGateState set local(v: boolean) { this.states.local = v; } + get mplj() { + return this.states.mplj; + } + set mplj(v: boolean) { + this.states.mplj = v; + } get states(): state.CkmState { return this.getState(); } diff --git a/src/drawApp/graphics/GarageDoorInteraction.ts b/src/drawApp/graphics/GarageDoorInteraction.ts index 545059f..80e5965 100644 --- a/src/drawApp/graphics/GarageDoorInteraction.ts +++ b/src/drawApp/graphics/GarageDoorInteraction.ts @@ -114,6 +114,12 @@ export class GarageDoorState set local(v: boolean) { this.states.local = v; } + get mplj() { + return this.states.mplj; + } + set mplj(v: boolean) { + this.states.mplj = v; + } get states(): state.CkmState { return this.getState(); } diff --git a/src/drawApp/graphics/PslButtonInteraction.ts b/src/drawApp/graphics/PslButtonInteraction.ts index c02e1dc..3ee9453 100644 --- a/src/drawApp/graphics/PslButtonInteraction.ts +++ b/src/drawApp/graphics/PslButtonInteraction.ts @@ -81,6 +81,12 @@ export class PslButtonState set down(v: boolean) { this.states.down = v; } + get active(): boolean { + return this.states.active; + } + set active(v: boolean) { + this.states.active = v; + } get states(): state.ButtonState { return this.getState(); } diff --git a/src/drawApp/pslApp.ts b/src/drawApp/pslApp.ts index 39d3689..f693602 100644 --- a/src/drawApp/pslApp.ts +++ b/src/drawApp/pslApp.ts @@ -260,7 +260,6 @@ export function loadGatedRelateDeviceList() { export function creatGatedRelateDevice(row: graphicData.DeviceCombinationtype) { refDevicesList.push(row); - console.log(refDevicesList, '===='); drawApp?.emit('postdataloaded'); } diff --git a/src/drawApp/pslScene.ts b/src/drawApp/pslScene.ts index 3c0d7ea..ba6dd11 100644 --- a/src/drawApp/pslScene.ts +++ b/src/drawApp/pslScene.ts @@ -69,15 +69,17 @@ function handleSubscribe(pslScene: IGraphicScene) { const states: GraphicState[] = []; const storage = state.PushedDevicesStatus.deserialize(message); if (storage.all) { - // storage.allStatus.buttonState.forEach((item) => { - // if (item.id) { - // states.push(new PslButtonState(item)); - // } - // }); + storage.allStatus.buttonState.forEach((item) => { + if (item.id) { + states.push(new PslButtonState(item)); + } + }); } - // console.log(states, 'states'); return states; }, + graphicQueryer: (state, store) => { + return store.queryById(+state.code); + }, }); } diff --git a/src/graphics/carWashing/CarWashing.ts b/src/graphics/carWashing/CarWashing.ts index 7c4223d..d43c7d2 100644 --- a/src/graphics/carWashing/CarWashing.ts +++ b/src/graphics/carWashing/CarWashing.ts @@ -128,10 +128,10 @@ export class CarWashing extends JlGraphic { } else if (this.states.tgyxj) { stateText = '通过'; } else if (this.states.cfjList.length === 2) { - if (this.states.cfjList[0]) { - stateText = '头部'; - } else if (this.states.cfjList[1]) { + if (this.states.cfjList[1]) { stateText = '尾部'; + } else if (this.states.cfjList[0]) { + stateText = '头部'; } } else if (this.states.cfjList.length === 3) { if (this.states.cfjList[1]) { diff --git a/src/graphics/floodGate/FloodGate.ts b/src/graphics/floodGate/FloodGate.ts index 52ce81c..dc8c2c2 100644 --- a/src/graphics/floodGate/FloodGate.ts +++ b/src/graphics/floodGate/FloodGate.ts @@ -33,6 +33,8 @@ export interface IFloodGateState extends GraphicState { set param(v: request.CkmParam); get local(): boolean; set local(v: boolean); + get mplj(): boolean; + set mplj(v: boolean); } const garageConsts = { diff --git a/src/graphics/garageDoor/GarageDoor.ts b/src/graphics/garageDoor/GarageDoor.ts index 70e493c..50da711 100644 --- a/src/graphics/garageDoor/GarageDoor.ts +++ b/src/graphics/garageDoor/GarageDoor.ts @@ -33,6 +33,8 @@ export interface IGarageDoorState extends GraphicState { set param(v: request.CkmParam); get local(): boolean; set local(v: boolean); + get mplj(): boolean; + set mplj(v: boolean); } const garageConsts = { diff --git a/src/graphics/pslButton/pslButton.ts b/src/graphics/pslButton/pslButton.ts index 3f00bba..89ba771 100644 --- a/src/graphics/pslButton/pslButton.ts +++ b/src/graphics/pslButton/pslButton.ts @@ -31,6 +31,8 @@ export interface IPslButtonState extends GraphicState { set code(v: string); get down(): boolean; set down(v: boolean); + get active(): boolean; + set active(v: boolean); } export class PslButton extends JlGraphic { diff --git a/src/protos/device_state.ts b/src/protos/device_state.ts index 328483c..7d3106d 100644 --- a/src/protos/device_state.ts +++ b/src/protos/device_state.ts @@ -8030,6 +8030,7 @@ export namespace state { mgj?: boolean; param?: dependency_3.request.CkmParam; local?: boolean; + mplj?: boolean; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -8046,6 +8047,9 @@ export namespace state { if ("local" in data && data.local != undefined) { this.local = data.local; } + if ("mplj" in data && data.mplj != undefined) { + this.mplj = data.mplj; + } } } get id() { @@ -8075,11 +8079,18 @@ export namespace state { set local(value: boolean) { pb_1.Message.setField(this, 4, value); } + get mplj() { + return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean; + } + set mplj(value: boolean) { + pb_1.Message.setField(this, 5, value); + } static fromObject(data: { id?: number; mgj?: boolean; param?: ReturnType; local?: boolean; + mplj?: boolean; }): CkmState { const message = new CkmState({}); if (data.id != null) { @@ -8094,6 +8105,9 @@ export namespace state { if (data.local != null) { message.local = data.local; } + if (data.mplj != null) { + message.mplj = data.mplj; + } return message; } toObject() { @@ -8102,6 +8116,7 @@ export namespace state { mgj?: boolean; param?: ReturnType; local?: boolean; + mplj?: boolean; } = {}; if (this.id != null) { data.id = this.id; @@ -8115,6 +8130,9 @@ export namespace state { if (this.local != null) { data.local = this.local; } + if (this.mplj != null) { + data.mplj = this.mplj; + } return data; } serialize(): Uint8Array; @@ -8129,6 +8147,8 @@ export namespace state { writer.writeMessage(3, this.param, () => this.param.serialize(writer)); if (this.local != false) writer.writeBool(4, this.local); + if (this.mplj != false) + writer.writeBool(5, this.mplj); if (!w) return writer.getResultBuffer(); } @@ -8150,6 +8170,9 @@ export namespace state { case 4: message.local = reader.readBool(); break; + case 5: + message.mplj = reader.readBool(); + break; default: reader.skipField(); } }