From 7ecac3776643be89ad7f0679f7adcbe0787f1d8b Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Thu, 11 Apr 2024 17:31:27 +0800 Subject: [PATCH 01/18] =?UTF-8?q?url=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/configs/UrlManage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/configs/UrlManage.ts b/src/configs/UrlManage.ts index 14206ce..d22c5bd 100644 --- a/src/configs/UrlManage.ts +++ b/src/configs/UrlManage.ts @@ -10,7 +10,7 @@ function getHost(): string { // return '192.168.3.47:9091'; // return '192.168.3.37:9091'; //return '192.168.33.207:9091'; // 张骞 - return '192.168.33.93:9091'; + // return '192.168.33.93:9091'; // return '192.168.3.37:9091'; //卫志宏 // return 'test.joylink.club/bjrtsts-service'; // 测试 return '192.168.33.233:9091'; From 917630d0994c9a7c995c19c43090e79594c94c60 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Fri, 26 Apr 2024 15:50:09 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E5=88=97=E8=BD=A6=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../draw-app/dialogs/SetTrainParam.vue | 12 +++---- src/components/line-app/infos/TrainInfo.vue | 31 +++++++++++++------ 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/components/draw-app/dialogs/SetTrainParam.vue b/src/components/draw-app/dialogs/SetTrainParam.vue index f0d0856..260ec31 100644 --- a/src/components/draw-app/dialogs/SetTrainParam.vue +++ b/src/components/draw-app/dialogs/SetTrainParam.vue @@ -23,7 +23,7 @@ v-model.number="model.trainEndsA.radarCheckSpeedDiff" clearable @clear="() => (model.trainEndsA.radarCheckSpeedDiff = 0)" - label="雷达测速差值(m/s)" + label="雷达测速差值(km/h)" hint="" /> @@ -45,7 +45,7 @@ v-model.number="model.trainEndsA.radarOutSpeed" clearable @clear="() => (model.trainEndsA.radarOutSpeed = 0)" - label="雷达速度输出(m/s)" + label="雷达速度输出(km/h)" hint="" /> @@ -82,7 +82,7 @@ v-model.number="model.trainEndsA.accOutSpeed" clearable @clear="() => (model.trainEndsA.accOutSpeed = 0)" - label="速传速度输出(m/s)" + label="速传速度输出(km/h)" hint="" /> @@ -137,7 +137,7 @@ v-model.number="model.trainEndsB.radarCheckSpeedDiff" clearable @clear="() => (model.trainEndsB.radarCheckSpeedDiff = 0)" - label="雷达测速差值(m/s)" + label="雷达测速差值(km/h)" hint="" /> @@ -159,7 +159,7 @@ v-model.number="model.trainEndsB.radarOutSpeed" clearable @clear="() => (model.trainEndsB.radarOutSpeed = 0)" - label="雷达速度输出(m/s)" + label="雷达速度输出(km/h)" hint="" /> @@ -196,7 +196,7 @@ v-model.number="model.trainEndsB.accOutSpeed" clearable @clear="() => (model.trainEndsB.accOutSpeed = 0)" - label="速传速度输出(m/s)" + label="速传速度输出(km/h)" hint="" /> diff --git a/src/components/line-app/infos/TrainInfo.vue b/src/components/line-app/infos/TrainInfo.vue index 5d06c13..25b1ae5 100644 --- a/src/components/line-app/infos/TrainInfo.vue +++ b/src/components/line-app/infos/TrainInfo.vue @@ -336,44 +336,52 @@ const list4: KeyType[] = [ // { label: '尾车速传2速度值', key: 'tailSensorSpeed2', formatFn: speedFormat }, { label: '1端速传1是否有效', key: 'aSpeedSensorEnableA', formatFn: upFormat }, { label: '1端速传2是否有效', key: 'aSpeedSensorEnableB', formatFn: upFormat }, - { label: '1端速度输出', key: 'aAccOutSpeed', formatFn: msFormat }, + { label: '1端速度输出', key: 'aAccOutSpeed', formatFn: kmhFormat }, { label: '2端速传1是否有效', key: 'bSpeedSensorEnableA', formatFn: upFormat }, { label: '2端速传2是否有效', key: 'bSpeedSensorEnableB', formatFn: upFormat }, - { label: '2端速度输出', key: 'bAccOutSpeed', formatFn: msFormat }, + { label: '2端速度输出', key: 'bAccOutSpeed', formatFn: kmhFormat }, ]; const list5: KeyType[] = [ // { label: '头车雷达速度值', key: 'headRadarSpeed', formatFn: speedFormat }, // { label: '尾车雷达速度值', key: 'tailRadarSpeed', formatFn: speedFormat }, { label: '1端雷达是否有效', key: 'aRadarEnable', formatFn: upFormat }, - { label: '1端雷达测速差值', key: 'aRadarCheckSpeedDiff', formatFn: msFormat }, { - label: '1端雷达检测时间(秒)', + label: '1端雷达测速差值', + key: 'aRadarCheckSpeedDiff', + formatFn: kmhFormat, + }, + { + label: '1端雷达检测设置剩余时间(秒)', key: 'aRadarCheckTime', formatFn: timeFormat, }, - { label: '1端雷达速度输出', key: 'aRadarOutSpeed', formatFn: msFormat }, + { label: '1端雷达速度输出', key: 'aRadarOutSpeed', formatFn: kmhFormat }, { label: '2端雷达是否有效', key: 'bRadarEnable', formatFn: upFormat }, - { label: '2端雷达测速差值', key: 'bRadarCheckSpeedDiff', formatFn: msFormat }, { - label: '2端雷达检测时间', + label: '2端雷达测速差值', + key: 'bRadarCheckSpeedDiff', + formatFn: kmhFormat, + }, + { + label: '2端雷达检测设置剩余时间', key: 'bRadarCheckTime', formatFn: timeFormat, }, - { label: '2端雷达速度输出', key: 'bRadarOutSpeed', formatFn: msFormat }, + { label: '2端雷达速度输出', key: 'bRadarOutSpeed', formatFn: kmhFormat }, ]; const list6: KeyType[] = [ { label: '加速度', key: 'acceleration', formatFn: accelerationFormat }, { label: '1端加速度计是否有效', key: 'aAccEnable', formatFn: upFormat }, { label: '1端加速度测速差值', key: 'aAccCheckSpeedDiff', formatFn: msFormat }, { - label: '1端加速度持续时间', + label: '1端加速度持续设置剩余时间', key: 'aAccCheckTime', formatFn: timeFormat, }, { label: '2端加速度计是否有效', key: 'bAccEnable', formatFn: upFormat }, { label: '2端加速度测速差值', key: 'bAccCheckSpeedDiff', formatFn: msFormat }, { - label: '2端加速度持续时间', + label: '2端加速度持续设置剩余时间', key: 'bAccCheckTime', formatFn: timeFormat, }, @@ -393,6 +401,9 @@ function percentFormat(v: number) { function msFormat(v: number) { return v + 'm/s'; } +function kmhFormat(v: number) { + return v + 'km/h'; +} function timeFormat(v: number) { return v + 's'; } From 203525e371454274bb277fd04d88fdef46a7d2f3 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Fri, 26 Apr 2024 15:52:15 +0800 Subject: [PATCH 03/18] message --- rts-sim-testing-message | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts-sim-testing-message b/rts-sim-testing-message index 8919d6e..56e1948 160000 --- a/rts-sim-testing-message +++ b/rts-sim-testing-message @@ -1 +1 @@ -Subproject commit 8919d6e5d6de5d46332eb5eb6b6c052215fa0ad2 +Subproject commit 56e1948393aa51e0bf16d754292a211f348df161 From ac8c1935860e38ee24cae4cc91329a0dd06196fe Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Mon, 29 Apr 2024 14:40:34 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E5=88=97=E8=BD=A6=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/draw-app/dialogs/SetTrainLink.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/draw-app/dialogs/SetTrainLink.vue b/src/components/draw-app/dialogs/SetTrainLink.vue index c1902f7..e1f1e7a 100644 --- a/src/components/draw-app/dialogs/SetTrainLink.vue +++ b/src/components/draw-app/dialogs/SetTrainLink.vue @@ -53,7 +53,7 @@ const props = defineProps({ required: true, }, }); -const connType = ref(0); +const connType = ref(); const connectOptions = ref<{ label: string; value: number }[]>([]); const showLoadTransData = ref(true); @@ -85,7 +85,7 @@ function onCreate() { updateTrainConn({ id: props.trainId + '', simulationId: props.simulationId, - connType: connType.value, + connType: connType.value as number, }) .then(() => { successNotify('列车连接成功!'); From e71ff9a5c7e9fdbb17cbef849bd90de815289adf Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Tue, 30 Apr 2024 14:21:47 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=97=E8=BD=A6foode?= =?UTF-8?q?r=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../draw-app/dialogs/AddTrainDialog.vue | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/components/draw-app/dialogs/AddTrainDialog.vue b/src/components/draw-app/dialogs/AddTrainDialog.vue index 3f76693..a10546f 100644 --- a/src/components/draw-app/dialogs/AddTrainDialog.vue +++ b/src/components/draw-app/dialogs/AddTrainDialog.vue @@ -79,18 +79,27 @@ lazy-rules :rules="wheelDiameterRules" /> - - - - + From a33721623609e3c3879a6c571fec88c19f1742f8 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 7 May 2024 13:09:16 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E5=88=97=E8=BD=A6=E9=A9=BE=E9=A9=B6?= =?UTF-8?q?=E5=8F=B0=E5=8A=A0=E5=AF=B9=E5=BA=94=E5=88=97=E8=BD=A6=E7=B4=A2?= =?UTF-8?q?=E5=BC=95+=E7=94=9F=E6=88=90=E7=BB=A7=E7=94=B5=E5=99=A8?= =?UTF-8?q?=E6=97=B6=E5=8A=A0=E6=98=AF=E5=90=A6=E8=A6=86=E7=9B=96=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E7=9A=84=E9=87=87=E9=9B=86=E9=A9=B1=E5=8A=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/LineLayout.vue | 1 + .../RelayCabinetLayout/RelayCabinetLayout.vue | 320 +++++++++--------- 2 files changed, 165 insertions(+), 156 deletions(-) diff --git a/src/layouts/LineLayout.vue b/src/layouts/LineLayout.vue index dc4f3ce..dffa183 100644 --- a/src/layouts/LineLayout.vue +++ b/src/layouts/LineLayout.vue @@ -83,6 +83,7 @@ :width="tccCanvasWidth" :height="tccCanvasHeight" @hide="tccHide" + :title="`列车${tccStore.tccId}`" >
diff --git a/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue b/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue index d59951d..5032f4a 100644 --- a/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue +++ b/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue @@ -197,6 +197,10 @@ label="集中站" :rules="[(val) => val != '' || '集中站不能为空']" > +
({ publishId: '', centralizedStation: 0 }); + generateCJQD: boolean; +}>({ publishId: '', centralizedStation: 0, generateCJQD: true }); let publishIdOption = ref<{ label: string; value: number }[]>(); let centralizedStationsOption = ref<{ label: string; value: number }[]>([ @@ -827,180 +832,183 @@ function oneClickGeneraterRelayLayout() { ); } }); - - //根据生成的组合类型列表生成采集列表 - const deviceRelateRelayList = loadDeviceRelateRelayList(); - const allCjData: relayCabinetGraphicData.CjData[] = []; - deviceRelateRelayList.forEach((deviceRelateRelay) => { - let deviceCiCjConfig; - if (deviceRelateRelay.deviceType !== DeviceType.CarWashing) { - deviceCiCjConfig = ciCjMap.get( - `${deviceRelateRelay.deviceType}+${allDeviceModelMap.get( - `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}` - )}` - ); - } else { - deviceCiCjConfig = ciCjMap.get( - `${deviceRelateRelay.deviceType}+undefined` - ); - } - let copyDeviceCiCjConfig: CjData[] = - deviceCiCjConfig === undefined - ? undefined - : JSON.parse(JSON.stringify(deviceCiCjConfig)); - //动态配置车站EMP的采集配置 - if ( - deviceRelateRelay.deviceType == DeviceType.station && - deviceCiCjConfig - ) { - const handleCopyDeviceCiCjConfig: CjData[] = []; - if (hasEMP_MKX_SPKS.hasEMP) { - const refDeviceCodesAndPos: { - code: string; - position: relayCabinetGraphicData.CjDataItem.PostionType; - }[][] = []; - deviceRelateRelay.combinationtypes[0].refRelays.forEach( - (relayId) => { - const code = generateRelays.find((g) => g.id == relayId)?.code; - if (code) { - refDeviceCodesAndPos.push( - [ - { - code, - position: PostionType.Q, - }, - ], - [ - { - code, - position: PostionType.H, - }, - ] - ); - } - } + if (generaterRelayLayout.value.generateCJQD) { + //根据生成的组合类型列表生成采集列表 + const deviceRelateRelayList = loadDeviceRelateRelayList(); + const allCjData: relayCabinetGraphicData.CjData[] = []; + deviceRelateRelayList.forEach((deviceRelateRelay) => { + let deviceCiCjConfig; + if (deviceRelateRelay.deviceType !== DeviceType.CarWashing) { + deviceCiCjConfig = ciCjMap.get( + `${deviceRelateRelay.deviceType}+${allDeviceModelMap.get( + `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}` + )}` + ); + } else { + deviceCiCjConfig = ciCjMap.get( + `${deviceRelateRelay.deviceType}+undefined` ); - handleCopyDeviceCiCjConfig?.push({ - code: 'EMP', - refDeviceCodesAndPos, - }); } - if (hasEMP_MKX_SPKS.hasMKX) { - handleCopyDeviceCiCjConfig.push(deviceCiCjConfig[0]); + let copyDeviceCiCjConfig: CjData[] = + deviceCiCjConfig === undefined + ? undefined + : JSON.parse(JSON.stringify(deviceCiCjConfig)); + //动态配置车站EMP的采集配置 + if ( + deviceRelateRelay.deviceType == DeviceType.station && + deviceCiCjConfig + ) { + const handleCopyDeviceCiCjConfig: CjData[] = []; + if (hasEMP_MKX_SPKS.hasEMP) { + const refDeviceCodesAndPos: { + code: string; + position: relayCabinetGraphicData.CjDataItem.PostionType; + }[][] = []; + deviceRelateRelay.combinationtypes[0].refRelays.forEach( + (relayId) => { + const code = generateRelays.find( + (g) => g.id == relayId + )?.code; + if (code) { + refDeviceCodesAndPos.push( + [ + { + code, + position: PostionType.Q, + }, + ], + [ + { + code, + position: PostionType.H, + }, + ] + ); + } + } + ); + handleCopyDeviceCiCjConfig?.push({ + code: 'EMP', + refDeviceCodesAndPos, + }); + } + if (hasEMP_MKX_SPKS.hasMKX) { + handleCopyDeviceCiCjConfig.push(deviceCiCjConfig[0]); + } + if (hasEMP_MKX_SPKS.hasSPKS) { + handleCopyDeviceCiCjConfig.push(deviceCiCjConfig[1]); + } + copyDeviceCiCjConfig = handleCopyDeviceCiCjConfig; } - if (hasEMP_MKX_SPKS.hasSPKS) { - handleCopyDeviceCiCjConfig.push(deviceCiCjConfig[1]); - } - copyDeviceCiCjConfig = handleCopyDeviceCiCjConfig; - } - //动态配置洗车机的采集配置 - if ( - deviceRelateRelay.deviceType == DeviceType.CarWashing && - deviceCiCjConfig - ) { - const duanNum = allDeviceModelMap.get( - `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}` - ) as string; - for (let i = 2; i <= +duanNum; i++) { - copyDeviceCiCjConfig[0].refDeviceCodesAndPos.push([ - { - code: `TWJ${i}`, - position: PostionType.Q, - }, - ]); - copyDeviceCiCjConfig[1].refDeviceCodesAndPos.push( - [ + //动态配置洗车机的采集配置 + if ( + deviceRelateRelay.deviceType == DeviceType.CarWashing && + deviceCiCjConfig + ) { + const duanNum = allDeviceModelMap.get( + `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}` + ) as string; + for (let i = 2; i <= +duanNum; i++) { + copyDeviceCiCjConfig[0].refDeviceCodesAndPos.push([ { - code: `CFJ${i}`, + code: `TWJ${i}`, position: PostionType.Q, }, - ], - [ - { - code: `CFJ${i}`, - position: PostionType.H, - }, - ] - ); + ]); + copyDeviceCiCjConfig[1].refDeviceCodesAndPos.push( + [ + { + code: `CFJ${i}`, + position: PostionType.Q, + }, + ], + [ + { + code: `CFJ${i}`, + position: PostionType.H, + }, + ] + ); + } } - } - copyDeviceCiCjConfig?.forEach((combinationtype) => { - combinationtype.refDeviceCodesAndPos.forEach((items) => { - const cjData: relayCabinetGraphicData.CjDataItem[] = []; - items.forEach((relay) => { - cjData.push( - new relayCabinetGraphicData.CjDataItem({ - relayId: generateRelaysMap.get( - `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}+${combinationtype.code}+${relay.code}` - ), - position: relay.position, - }) + copyDeviceCiCjConfig?.forEach((combinationtype) => { + combinationtype.refDeviceCodesAndPos.forEach((items) => { + const cjData: relayCabinetGraphicData.CjDataItem[] = []; + items.forEach((relay) => { + cjData.push( + new relayCabinetGraphicData.CjDataItem({ + relayId: generateRelaysMap.get( + `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}+${combinationtype.code}+${relay.code}` + ), + position: relay.position, + }) + ); + }); + allCjData.push( + new relayCabinetGraphicData.CjData({ refRelays: cjData }) ); }); - allCjData.push( - new relayCabinetGraphicData.CjData({ refRelays: cjData }) - ); }); }); - }); - creatCiCjListByCombinationtype( - 32, - Math.ceil(allCjData.length / 32), - allCjData - ); + creatCiCjListByCombinationtype( + 32, + Math.ceil(allCjData.length / 32), + allCjData + ); - //根据生成的组合类型列表生成驱动列表 - const allQdData: relayCabinetGraphicData.QdData[] = []; - deviceRelateRelayList.forEach((deviceRelateRelay) => { - let deviceCiQdConfig: QdData[] | undefined; - let changeDeviceCiQdConfig: QdData[]; - if (deviceRelateRelay.deviceType !== DeviceType.CarWashing) { - deviceCiQdConfig = ciQdMap.get( - `${deviceRelateRelay.deviceType}+${allDeviceModelMap.get( + //根据生成的组合类型列表生成驱动列表 + const allQdData: relayCabinetGraphicData.QdData[] = []; + deviceRelateRelayList.forEach((deviceRelateRelay) => { + let deviceCiQdConfig: QdData[] | undefined; + let changeDeviceCiQdConfig: QdData[]; + if (deviceRelateRelay.deviceType !== DeviceType.CarWashing) { + deviceCiQdConfig = ciQdMap.get( + `${deviceRelateRelay.deviceType}+${allDeviceModelMap.get( + `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}` + )}` + ); + changeDeviceCiQdConfig = + deviceCiQdConfig === undefined + ? undefined + : JSON.parse(JSON.stringify(deviceCiQdConfig)); + } else { + deviceCiQdConfig = ciQdMap.get( + `${deviceRelateRelay.deviceType}+undefined` + ); + changeDeviceCiQdConfig = + deviceCiQdConfig === undefined + ? undefined + : JSON.parse(JSON.stringify(deviceCiQdConfig)); + const duanNum = allDeviceModelMap.get( `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}` - )}` - ); - changeDeviceCiQdConfig = - deviceCiQdConfig === undefined - ? undefined - : JSON.parse(JSON.stringify(deviceCiQdConfig)); - } else { - deviceCiQdConfig = ciQdMap.get( - `${deviceRelateRelay.deviceType}+undefined` - ); - changeDeviceCiQdConfig = - deviceCiQdConfig === undefined - ? undefined - : JSON.parse(JSON.stringify(deviceCiQdConfig)); - const duanNum = allDeviceModelMap.get( - `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}` - ) as string; - for (let i = 2; i <= +duanNum; i++) { - changeDeviceCiQdConfig[0].refDeviceCodes.push([`TWJ${i}`]); + ) as string; + for (let i = 2; i <= +duanNum; i++) { + changeDeviceCiQdConfig[0].refDeviceCodes.push([`TWJ${i}`]); + } } - } - changeDeviceCiQdConfig?.forEach((combinationtype) => { - combinationtype.refDeviceCodes.forEach((items) => { - const qdData: number[] = []; - items.forEach((relayCode) => { - qdData.push( - generateRelaysMap.get( - `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}+${combinationtype.code}+${relayCode}` - ) as number + changeDeviceCiQdConfig?.forEach((combinationtype) => { + combinationtype.refDeviceCodes.forEach((items) => { + const qdData: number[] = []; + items.forEach((relayCode) => { + qdData.push( + generateRelaysMap.get( + `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}+${combinationtype.code}+${relayCode}` + ) as number + ); + }); + allQdData.push( + new relayCabinetGraphicData.QdData({ refRelays: qdData }) ); }); - allQdData.push( - new relayCabinetGraphicData.QdData({ refRelays: qdData }) - ); }); }); - }); - creatCiQdListByCombinationtype( - 32, - Math.ceil(allQdData.length / 32), - allQdData - ); + creatCiQdListByCombinationtype( + 32, + Math.ceil(allQdData.length / 32), + allQdData + ); + } //生成继电器图并保存数据 generateRelayLayout(generateRelays); From 2e3fc1a1f218f2172288c21ff8e87682b49cf73f Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 7 May 2024 15:12:28 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=88=97=E8=BD=A6?= =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E5=8F=B0=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=EF=BC=88=E8=AE=A2=E9=98=85=E8=B7=AF=E5=BE=84=E5=8F=98=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/tcc-store.ts | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/stores/tcc-store.ts b/src/stores/tcc-store.ts index 77dad4b..1357e6b 100644 --- a/src/stores/tcc-store.ts +++ b/src/stores/tcc-store.ts @@ -7,6 +7,7 @@ import { errorNotify } from 'src/utils/CommonNotify'; import { request } from 'src/protos/request'; import { TccHandle } from 'src/graphics/tccHandle/TccHandle'; import { TccKey } from 'src/graphics/tccKey/TccKey'; +import { IGraphicApp } from 'jl-graphic'; export const useTccStore = defineStore('tcc', { state: () => ({ @@ -23,12 +24,8 @@ export const useTccStore = defineStore('tcc', { getTccScene() { const lineApp = getLineApp(); if (!lineApp) throw Error('未初始化app'); - try { - return lineApp.getScene('tcc'); - } catch (error) { - const tccScene = initTccScene(lineApp, 'tcc'); - return tccScene; - } + lineApp.removeScene('tcc'); + return initTccScene(lineApp, 'tcc'); }, setTccParam(tccId: number, trainControlMapId: number) { this.tccId = tccId; @@ -42,9 +39,9 @@ export const useTccStore = defineStore('tcc', { }, onMouseUpFromTccHandle() { const simulationId = useLineStore().simulationId; - const tccHandle = this.getTccScene().queryStore.queryById( - this.tccHandleId - ); + const tccHandle = (getLineApp() as IGraphicApp) + .getScene('tcc') + .queryStore.queryById(this.tccHandleId); if (!simulationId) return; const handleVal = Number( (-(tccHandle._tccHandle.y / 144) * 100).toFixed() @@ -62,9 +59,9 @@ export const useTccStore = defineStore('tcc', { }); }, onMouseUpFromTccKeyDir() { - const tccKeyDir = this.getTccScene().queryStore.queryById( - this.tccKeyDirId - ); + const tccKeyDir = (getLineApp() as IGraphicApp) + .getScene('tcc') + .queryStore.queryById(this.tccKeyDirId); let position = 0; switch (tccKeyDir._tccKey.rotation) { case Math.PI / 4: From bdefc71cef37783e539fcecf4803f1d0012a02e0 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Thu, 9 May 2024 15:43:27 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=E5=88=97=E8=BD=A6=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=B5=AE=E7=82=B9=E6=95=B0=E8=AF=AF=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rts-sim-testing-message | 2 +- src/graphics/train/Train.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rts-sim-testing-message b/rts-sim-testing-message index 56e1948..e4c55ea 160000 --- a/rts-sim-testing-message +++ b/rts-sim-testing-message @@ -1 +1 @@ -Subproject commit 56e1948393aa51e0bf16d754292a211f348df161 +Subproject commit e4c55ea4b6f9f5f875d59fc5bba51fc21bc8ef97 diff --git a/src/graphics/train/Train.ts b/src/graphics/train/Train.ts index c8a0be6..53981ab 100644 --- a/src/graphics/train/Train.ts +++ b/src/graphics/train/Train.ts @@ -637,9 +637,10 @@ export class Train extends JlGraphic { } const offset = this.states.headOffset / allLength; // 百分比偏移 let offsetL = totalLength * offset; + // 0.01为保证浮点数计算误差 const indexP = lengths.findIndex((l) => { offsetL -= l; - return offsetL <= 0; + return offsetL <= 0.001; }); const startP = points[indexP]; const endP = points[indexP + 1]; From 89012e62906f01af3f9e9071b5f8bab5cae4fa99 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 9 May 2024 16:08:02 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E5=88=97=E8=BD=A6=E9=A9=BE=E9=A9=B6?= =?UTF-8?q?=E5=8F=B0=E6=96=B9=E5=90=91=E6=8C=89=E9=92=AE=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E4=BC=9A=E5=9B=9E=E5=88=B0=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/graphics/TccKeyInteraction.ts | 6 ++---- src/stores/tcc-store.ts | 12 +++++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/drawApp/graphics/TccKeyInteraction.ts b/src/drawApp/graphics/TccKeyInteraction.ts index df0f6c5..d8477c6 100644 --- a/src/drawApp/graphics/TccKeyInteraction.ts +++ b/src/drawApp/graphics/TccKeyInteraction.ts @@ -107,7 +107,6 @@ export abstract class KeyInteraction< mouseDownBeginRotation = 0; changeRotation = 0; keyInteractionConfig: IKeyInteractionConfig; - lastTimenRotation = 0; constructor( name: string, app: IGraphicScene, @@ -155,7 +154,7 @@ export abstract class KeyInteraction< this.mouseDownBeginPos = this.app.toCanvasCoordinates(e.global); this.mouseDownBeginRotation = this.ratatingSprite.rotation; this.changeRotation = this.mouseDownBeginRotation; - this.lastTimenRotation = this.ratatingSprite.rotation; + useTccStore().tccKeyLastRotation = this.ratatingSprite.rotation; } onMousemove(e: FederatedMouseEvent) { const target = e.target as DisplayObject; @@ -204,8 +203,7 @@ export abstract class KeyInteraction< this.changeRotation = this.mouseDownBeginRotation - Math.PI / 2; } } - if (this.lastTimenRotation !== this.changeRotation) { - this.lastTimenRotation = this.changeRotation; + if (this.ratatingSprite.rotation !== this.changeRotation) { this.ratatingSprite.rotation = this.changeRotation; useTccStore().onMouseUpFromTccKeyDir(); } diff --git a/src/stores/tcc-store.ts b/src/stores/tcc-store.ts index 1357e6b..a107219 100644 --- a/src/stores/tcc-store.ts +++ b/src/stores/tcc-store.ts @@ -19,6 +19,7 @@ export const useTccStore = defineStore('tcc', { tccHandleId: 0, mouseDownOnTccKeyDir: false, tccKeyDirId: 0, + tccKeyLastRotation: 0, }), actions: { getTccScene() { @@ -84,9 +85,14 @@ export const useTccStore = defineStore('tcc', { dirKey: { val: position, }, - }).catch((err) => { - errorNotify('操作失败', { message: err.origin.response.data.title }); - }); + }) + .then(() => { + this.tccKeyLastRotation = tccKeyDir._tccKey.rotation; + }) + .catch((err) => { + errorNotify('操作失败', { message: err.origin.response.data.title }); + tccKeyDir._tccKey.rotation = this.tccKeyLastRotation; + }); }, }, }); From 9738678e547fcbc5c87405d3c66429c657b11f17 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 9 May 2024 17:23:28 +0800 Subject: [PATCH 10/18] =?UTF-8?q?=E6=89=93=E5=BC=80=E5=88=97=E8=BD=A6?= =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E5=8F=B0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/LineLayout.vue | 2 +- src/stores/tcc-store.ts | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/layouts/LineLayout.vue b/src/layouts/LineLayout.vue index dffa183..4523bed 100644 --- a/src/layouts/LineLayout.vue +++ b/src/layouts/LineLayout.vue @@ -288,8 +288,8 @@ watch( ); function tccHide() { + lineApp.getScene(`tcc${tccStore.tccId}`).unbindDom(); tccStore.clearTccParam(); - lineApp.getScene('tcc').unbindDom(); } watch( diff --git a/src/stores/tcc-store.ts b/src/stores/tcc-store.ts index a107219..67892f8 100644 --- a/src/stores/tcc-store.ts +++ b/src/stores/tcc-store.ts @@ -25,8 +25,12 @@ export const useTccStore = defineStore('tcc', { getTccScene() { const lineApp = getLineApp(); if (!lineApp) throw Error('未初始化app'); - lineApp.removeScene('tcc'); - return initTccScene(lineApp, 'tcc'); + try { + return lineApp.getScene(`tcc${this.tccId}`); + } catch (error) { + const tccScene = initTccScene(lineApp, `tcc${this.tccId}`); + return tccScene; + } }, setTccParam(tccId: number, trainControlMapId: number) { this.tccId = tccId; @@ -34,14 +38,13 @@ export const useTccStore = defineStore('tcc', { this.isTccDialogOpen = true; }, clearTccParam() { - this.tccId = 0; this.trainControlMapId = 0; this.isTccDialogOpen = false; }, onMouseUpFromTccHandle() { const simulationId = useLineStore().simulationId; const tccHandle = (getLineApp() as IGraphicApp) - .getScene('tcc') + .getScene(`tcc${this.tccId}`) .queryStore.queryById(this.tccHandleId); if (!simulationId) return; const handleVal = Number( @@ -61,7 +64,7 @@ export const useTccStore = defineStore('tcc', { }, onMouseUpFromTccKeyDir() { const tccKeyDir = (getLineApp() as IGraphicApp) - .getScene('tcc') + .getScene(`tcc${this.tccId}`) .queryStore.queryById(this.tccKeyDirId); let position = 0; switch (tccKeyDir._tccKey.rotation) { From 00b61a28913cf533d4b401dea57d3e636e5095a5 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Fri, 10 May 2024 15:27:30 +0800 Subject: [PATCH 11/18] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=8C=BA=E6=AE=B5=E7=BB=A7=E7=94=B5=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dialogs/DeviceRelateRelayList.vue | 1 + .../draw-app/properties/RelateRelayConfig.vue | 1 + .../RelayCabinetLayout/GeneraterCiCjConfig.ts | 22 +++++++++++++ .../RelayCabinetLayout/GeneraterCiQdConfig.ts | 9 ++++++ .../RelayCabinetLayout/GeneraterDevice.ts | 26 +++++++++++++-- .../GeneraterRelayLayoutConfig.ts | 14 ++++++++ .../RelayCabinetLayout/RelayCabinetLayout.vue | 32 ++++++++++++++++++- 7 files changed, 101 insertions(+), 4 deletions(-) diff --git a/src/components/draw-app/dialogs/DeviceRelateRelayList.vue b/src/components/draw-app/dialogs/DeviceRelateRelayList.vue index b49c731..3e8d79b 100644 --- a/src/components/draw-app/dialogs/DeviceRelateRelayList.vue +++ b/src/components/draw-app/dialogs/DeviceRelateRelayList.vue @@ -59,6 +59,7 @@ const relayCabinetStore = useRelayCabinetStore(); const $q = useQuasar(); const tableRef = ref(); const deviceTypeMap = { + 0: '区段', 1: '道岔', 5: '信号机', 6: '车站', diff --git a/src/components/draw-app/properties/RelateRelayConfig.vue b/src/components/draw-app/properties/RelateRelayConfig.vue index fc53996..e4fc775 100644 --- a/src/components/draw-app/properties/RelateRelayConfig.vue +++ b/src/components/draw-app/properties/RelateRelayConfig.vue @@ -89,6 +89,7 @@ const optionsType = [ { label: '车库门', value: graphicData.RelatedRef.DeviceType.GarageDoor }, { label: '洗车机', value: graphicData.RelatedRef.DeviceType.CarWashing }, { label: '防淹门', value: graphicData.RelatedRef.DeviceType.FloodGate }, + { label: '区段', value: graphicData.RelatedRef.DeviceType.Section }, ]; const noShowType = [ diff --git a/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts b/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts index 63b21aa..cf6d47c 100644 --- a/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts +++ b/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts @@ -793,6 +793,27 @@ const carWashingCjList = [ }, ]; +//区段继电器 +const sectionCjList = [ + { + code: 'GJ', + refDeviceCodesAndPos: [ + [ + { + code: 'GJ', + position: PostionType.Q, + }, + ], + [ + { + code: 'GJ', + position: PostionType.H, + }, + ], + ], + }, +]; + const DeviceType = graphicData.RelatedRef.DeviceType; export const ciCjMap = new Map([ [ @@ -838,4 +859,5 @@ export const ciCjMap = new Map([ [`${DeviceType.GarageDoor}+undefined`, garageDoorCjList], [`${DeviceType.CarWashing}+undefined`, carWashingCjList], [`${DeviceType.FloodGate}+undefined`, floodGateCjList], + [`${DeviceType.Section}+undefined`, sectionCjList], ]); diff --git a/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts b/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts index 4fa8855..92252e0 100644 --- a/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts +++ b/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts @@ -138,6 +138,14 @@ watch(changeScreenDoorGroup, (group) => { }); }); +//区段继电器 +const sectionQdList = [ + { + code: 'GJ', + refDeviceCodes: [['GJ']], + }, +]; + const DeviceType = graphicData.RelatedRef.DeviceType; export const ciQdMap = new Map([ [ @@ -179,4 +187,5 @@ export const ciQdMap = new Map([ [`${DeviceType.GarageDoor}+undefined`, garageDoorQdList], [`${DeviceType.CarWashing}+undefined`, carWashingQdList], [`${DeviceType.FloodGate}+undefined`, floodGateQdList], + [`${DeviceType.Section}+undefined`, sectionQdList], ]); diff --git a/src/layouts/RelayCabinetLayout/GeneraterDevice.ts b/src/layouts/RelayCabinetLayout/GeneraterDevice.ts index 625362b..60497a7 100644 --- a/src/layouts/RelayCabinetLayout/GeneraterDevice.ts +++ b/src/layouts/RelayCabinetLayout/GeneraterDevice.ts @@ -150,22 +150,42 @@ export function generateRelayLayout(relays: GenerateRelaysCongig[]) { relayGroupElement.push(relays[i]); } else if ( relays[i].deviceCode == relays[i - 1].deviceCode && - relays[i].combinationCode == relays[i - 1].combinationCode + relays[i].combinationCode == relays[i - 1].combinationCode && + relays[i].code != 'GJ' && + relays[i].combinationCode != 'GJ' ) { relayGroupElement.push(relays[i]); + } else if (relays[i].code == 'GJ' && relays[i].combinationCode == 'GJ') { + relayGroupElement.push(relays[i]); } else { relayGroup.push(relayGroupElement); relayGroupElement = []; relayGroupElement.push(relays[i]); } } + const lastCombination = relayGroupElement.filter( - (item) => item.deviceCode !== undefined + (item) => + item.deviceCode !== undefined && + item.code !== 'GJ' && + item.combinationCode !== 'GJ' ); const LSCombination = relayGroupElement.filter( (item) => item.deviceCode == undefined ); - relayGroup.push(lastCombination, LSCombination); + const allSectionCombination = relayGroupElement.filter( + (item) => item.code == 'GJ' && item.combinationCode == 'GJ' + ); + if (allSectionCombination.length) { + relayGroup.push(lastCombination); + for (let i = 0; i < allSectionCombination.length; i += 11) { + relayGroup.push(allSectionCombination.slice(i, i + 11)); + } + relayGroup.push(LSCombination); + } else { + relayGroup.push(lastCombination, LSCombination); + } + const relayCabinet = generateRelayCabinet(relayGroup.length / 10); for (let i = 0; i < relayCabinet.length; i++) { generateRelaysFormat( diff --git a/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts b/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts index 97cc5f8..a51cad3 100644 --- a/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts +++ b/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts @@ -513,6 +513,19 @@ const carWashingCombinations = [ }, ]; +//区段继电器 +const sectionCombinations = [ + { + code: 'GJ', + refDeviceCodesAndModel: [ + { + code: 'GJ', + model: RelayModelType.JWXC_1700, + }, + ], + }, +]; + const DeviceType = graphicData.RelatedRef.DeviceType; export const combinationsMap = new Map([ [ @@ -558,4 +571,5 @@ export const combinationsMap = new Map([ [`${DeviceType.GarageDoor}`, garageDoorCombinations], [`${DeviceType.CarWashing}`, carWashingCombinations], [`${DeviceType.FloodGate}`, floodGateCombinations], + [`${DeviceType.Section}`, sectionCombinations], ]); diff --git a/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue b/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue index 5032f4a..2511a03 100644 --- a/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue +++ b/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue @@ -201,6 +201,10 @@ v-model="generaterRelayLayout.generateCJQD" label="是否覆盖采集驱动数据" /> +
({ publishId: '', centralizedStation: 0, generateCJQD: true }); + generateSectionRelay: boolean; +}>({ + publishId: '', + centralizedStation: 0, + generateCJQD: true, + generateSectionRelay: false, +}); let publishIdOption = ref<{ label: string; value: number }[]>(); let centralizedStationsOption = ref<{ label: string; value: number }[]>([ @@ -809,6 +819,26 @@ function oneClickGeneraterRelayLayout() { ); } }); + //区段继电器 + if (generaterRelayLayout.value.generateSectionRelay) { + storage.section.forEach((section) => { + if (section.sectionType == graphicData.Section.SectionType.Physical) { + const deviceCombinations = combinationsMap.get( + `${DeviceType.Section}` + ); + if ( + section.centralizedStations.includes(concentrationStation) && + deviceCombinations + ) { + creatDeviceRelateRelays( + deviceCombinations, + DeviceType.Section, + section.code + ); + } + } + }); + } //信号机故障报警仪-电源屏-断路器 const aboveCombinations = [ { From 959592c17bc88d1abf035b9ecceafef40099a097 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Sat, 11 May 2024 08:27:32 +0800 Subject: [PATCH 12/18] =?UTF-8?q?=E5=90=8C=E6=AD=A5protoc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/protos/common_data.ts | 69 +++++++++ src/protos/device_state.ts | 291 ++++++++++++++++++++++++++----------- src/protos/request.ts | 32 +--- 3 files changed, 278 insertions(+), 114 deletions(-) diff --git a/src/protos/common_data.ts b/src/protos/common_data.ts index 08d76ef..47810d5 100644 --- a/src/protos/common_data.ts +++ b/src/protos/common_data.ts @@ -25,6 +25,7 @@ export namespace common { idlingD?: number; stopSign?: number; slide?: number; + trainLoad?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -80,6 +81,9 @@ export namespace common { if ("slide" in data && data.slide != undefined) { this.slide = data.slide; } + if ("trainLoad" in data && data.trainLoad != undefined) { + this.trainLoad = data.trainLoad; + } } } get davisParamA() { @@ -184,6 +188,12 @@ export namespace common { set slide(value: number) { pb_1.Message.setField(this, 18, value); } + get trainLoad() { + return pb_1.Message.getFieldWithDefault(this, 19, 0) as number; + } + set trainLoad(value: number) { + pb_1.Message.setField(this, 19, value); + } static fromObject(data: { davisParamA?: number; davisParamB?: number; @@ -202,6 +212,7 @@ export namespace common { idlingD?: number; stopSign?: number; slide?: number; + trainLoad?: number; }): TrainDynamicConfig { const message = new TrainDynamicConfig({}); if (data.davisParamA != null) { @@ -255,6 +266,9 @@ export namespace common { if (data.slide != null) { message.slide = data.slide; } + if (data.trainLoad != null) { + message.trainLoad = data.trainLoad; + } return message; } toObject() { @@ -276,6 +290,7 @@ export namespace common { idlingD?: number; stopSign?: number; slide?: number; + trainLoad?: number; } = {}; if (this.davisParamA != null) { data.davisParamA = this.davisParamA; @@ -328,6 +343,9 @@ export namespace common { if (this.slide != null) { data.slide = this.slide; } + if (this.trainLoad != null) { + data.trainLoad = this.trainLoad; + } return data; } serialize(): Uint8Array; @@ -368,6 +386,8 @@ export namespace common { writer.writeInt32(17, this.stopSign); if (this.slide != 0) writer.writeFloat(18, this.slide); + if (this.trainLoad != 0) + writer.writeInt32(19, this.trainLoad); if (!w) return writer.getResultBuffer(); } @@ -428,6 +448,9 @@ export namespace common { case 18: message.slide = reader.readFloat(); break; + case 19: + message.trainLoad = reader.readInt32(); + break; default: reader.skipField(); } } @@ -453,6 +476,8 @@ export namespace common { accCheckTime?: number; accOutSpeed?: number; radarOutSpeed?: number; + radarCheckTimeOverAt?: number; + accCheckTimeOverAt?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -487,6 +512,12 @@ export namespace common { if ("radarOutSpeed" in data && data.radarOutSpeed != undefined) { this.radarOutSpeed = data.radarOutSpeed; } + if ("radarCheckTimeOverAt" in data && data.radarCheckTimeOverAt != undefined) { + this.radarCheckTimeOverAt = data.radarCheckTimeOverAt; + } + if ("accCheckTimeOverAt" in data && data.accCheckTimeOverAt != undefined) { + this.accCheckTimeOverAt = data.accCheckTimeOverAt; + } } } get speedSensorEnableA() { @@ -549,6 +580,18 @@ export namespace common { set radarOutSpeed(value: number) { pb_1.Message.setField(this, 10, value); } + get radarCheckTimeOverAt() { + return pb_1.Message.getFieldWithDefault(this, 11, 0) as number; + } + set radarCheckTimeOverAt(value: number) { + pb_1.Message.setField(this, 11, value); + } + get accCheckTimeOverAt() { + return pb_1.Message.getFieldWithDefault(this, 12, 0) as number; + } + set accCheckTimeOverAt(value: number) { + pb_1.Message.setField(this, 12, value); + } static fromObject(data: { speedSensorEnableA?: boolean; speedSensorEnableB?: boolean; @@ -560,6 +603,8 @@ export namespace common { accCheckTime?: number; accOutSpeed?: number; radarOutSpeed?: number; + radarCheckTimeOverAt?: number; + accCheckTimeOverAt?: number; }): TrainEndsState { const message = new TrainEndsState({}); if (data.speedSensorEnableA != null) { @@ -592,6 +637,12 @@ export namespace common { if (data.radarOutSpeed != null) { message.radarOutSpeed = data.radarOutSpeed; } + if (data.radarCheckTimeOverAt != null) { + message.radarCheckTimeOverAt = data.radarCheckTimeOverAt; + } + if (data.accCheckTimeOverAt != null) { + message.accCheckTimeOverAt = data.accCheckTimeOverAt; + } return message; } toObject() { @@ -606,6 +657,8 @@ export namespace common { accCheckTime?: number; accOutSpeed?: number; radarOutSpeed?: number; + radarCheckTimeOverAt?: number; + accCheckTimeOverAt?: number; } = {}; if (this.speedSensorEnableA != null) { data.speedSensorEnableA = this.speedSensorEnableA; @@ -637,6 +690,12 @@ export namespace common { if (this.radarOutSpeed != null) { data.radarOutSpeed = this.radarOutSpeed; } + if (this.radarCheckTimeOverAt != null) { + data.radarCheckTimeOverAt = this.radarCheckTimeOverAt; + } + if (this.accCheckTimeOverAt != null) { + data.accCheckTimeOverAt = this.accCheckTimeOverAt; + } return data; } serialize(): Uint8Array; @@ -663,6 +722,10 @@ export namespace common { writer.writeInt32(9, this.accOutSpeed); if (this.radarOutSpeed != 0) writer.writeInt32(10, this.radarOutSpeed); + if (this.radarCheckTimeOverAt != 0) + writer.writeInt64(11, this.radarCheckTimeOverAt); + if (this.accCheckTimeOverAt != 0) + writer.writeInt64(12, this.accCheckTimeOverAt); if (!w) return writer.getResultBuffer(); } @@ -702,6 +765,12 @@ export namespace common { case 10: message.radarOutSpeed = reader.readInt32(); break; + case 11: + message.radarCheckTimeOverAt = reader.readInt64(); + break; + case 12: + message.accCheckTimeOverAt = reader.readInt64(); + break; default: reader.skipField(); } } diff --git a/src/protos/device_state.ts b/src/protos/device_state.ts index 7d3106d..4e306fd 100644 --- a/src/protos/device_state.ts +++ b/src/protos/device_state.ts @@ -1146,9 +1146,9 @@ export namespace state { headDeviceId?: number; headOffset?: number; devicePort?: string; - pointTo?: boolean; - runDirection?: boolean; - headDirection?: boolean; + driftTo?: boolean; + trainRunUp?: boolean; + trainActiveDirection?: number; dynamicState?: TrainDynamicState; vobcState?: TrainVobcState; trainKilometer?: number; @@ -1163,6 +1163,7 @@ export namespace state { btmState?: BTMState; tcc?: TrainControlState; connState?: TrainConnState; + pluseCount?: SensorSpeedPulseCount; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -1191,14 +1192,14 @@ export namespace state { if ("devicePort" in data && data.devicePort != undefined) { this.devicePort = data.devicePort; } - if ("pointTo" in data && data.pointTo != undefined) { - this.pointTo = data.pointTo; + if ("driftTo" in data && data.driftTo != undefined) { + this.driftTo = data.driftTo; } - if ("runDirection" in data && data.runDirection != undefined) { - this.runDirection = data.runDirection; + if ("trainRunUp" in data && data.trainRunUp != undefined) { + this.trainRunUp = data.trainRunUp; } - if ("headDirection" in data && data.headDirection != undefined) { - this.headDirection = data.headDirection; + if ("trainActiveDirection" in data && data.trainActiveDirection != undefined) { + this.trainActiveDirection = data.trainActiveDirection; } if ("dynamicState" in data && data.dynamicState != undefined) { this.dynamicState = data.dynamicState; @@ -1242,6 +1243,9 @@ export namespace state { if ("connState" in data && data.connState != undefined) { this.connState = data.connState; } + if ("pluseCount" in data && data.pluseCount != undefined) { + this.pluseCount = data.pluseCount; + } } } get id() { @@ -1292,22 +1296,22 @@ export namespace state { set devicePort(value: string) { pb_1.Message.setField(this, 8, value); } - get pointTo() { + get driftTo() { return pb_1.Message.getFieldWithDefault(this, 9, false) as boolean; } - set pointTo(value: boolean) { + set driftTo(value: boolean) { pb_1.Message.setField(this, 9, value); } - get runDirection() { + get trainRunUp() { return pb_1.Message.getFieldWithDefault(this, 10, false) as boolean; } - set runDirection(value: boolean) { + set trainRunUp(value: boolean) { pb_1.Message.setField(this, 10, value); } - get headDirection() { - return pb_1.Message.getFieldWithDefault(this, 11, false) as boolean; + get trainActiveDirection() { + return pb_1.Message.getFieldWithDefault(this, 11, 0) as number; } - set headDirection(value: boolean) { + set trainActiveDirection(value: number) { pb_1.Message.setField(this, 11, value); } get dynamicState() { @@ -1418,6 +1422,15 @@ export namespace state { get has_connState() { return pb_1.Message.getField(this, 25) != null; } + get pluseCount() { + return pb_1.Message.getWrapperField(this, SensorSpeedPulseCount, 26) as SensorSpeedPulseCount; + } + set pluseCount(value: SensorSpeedPulseCount) { + pb_1.Message.setWrapperField(this, 26, value); + } + get has_pluseCount() { + return pb_1.Message.getField(this, 26) != null; + } static fromObject(data: { id?: string; up?: boolean; @@ -1427,9 +1440,9 @@ export namespace state { headDeviceId?: number; headOffset?: number; devicePort?: string; - pointTo?: boolean; - runDirection?: boolean; - headDirection?: boolean; + driftTo?: boolean; + trainRunUp?: boolean; + trainActiveDirection?: number; dynamicState?: ReturnType; vobcState?: ReturnType; trainKilometer?: number; @@ -1444,6 +1457,7 @@ export namespace state { btmState?: ReturnType; tcc?: ReturnType; connState?: ReturnType; + pluseCount?: ReturnType; }): TrainState { const message = new TrainState({}); if (data.id != null) { @@ -1470,14 +1484,14 @@ export namespace state { if (data.devicePort != null) { message.devicePort = data.devicePort; } - if (data.pointTo != null) { - message.pointTo = data.pointTo; + if (data.driftTo != null) { + message.driftTo = data.driftTo; } - if (data.runDirection != null) { - message.runDirection = data.runDirection; + if (data.trainRunUp != null) { + message.trainRunUp = data.trainRunUp; } - if (data.headDirection != null) { - message.headDirection = data.headDirection; + if (data.trainActiveDirection != null) { + message.trainActiveDirection = data.trainActiveDirection; } if (data.dynamicState != null) { message.dynamicState = TrainDynamicState.fromObject(data.dynamicState); @@ -1521,6 +1535,9 @@ export namespace state { if (data.connState != null) { message.connState = TrainConnState.fromObject(data.connState); } + if (data.pluseCount != null) { + message.pluseCount = SensorSpeedPulseCount.fromObject(data.pluseCount); + } return message; } toObject() { @@ -1533,9 +1550,9 @@ export namespace state { headDeviceId?: number; headOffset?: number; devicePort?: string; - pointTo?: boolean; - runDirection?: boolean; - headDirection?: boolean; + driftTo?: boolean; + trainRunUp?: boolean; + trainActiveDirection?: number; dynamicState?: ReturnType; vobcState?: ReturnType; trainKilometer?: number; @@ -1550,6 +1567,7 @@ export namespace state { btmState?: ReturnType; tcc?: ReturnType; connState?: ReturnType; + pluseCount?: ReturnType; } = {}; if (this.id != null) { data.id = this.id; @@ -1575,14 +1593,14 @@ export namespace state { if (this.devicePort != null) { data.devicePort = this.devicePort; } - if (this.pointTo != null) { - data.pointTo = this.pointTo; + if (this.driftTo != null) { + data.driftTo = this.driftTo; } - if (this.runDirection != null) { - data.runDirection = this.runDirection; + if (this.trainRunUp != null) { + data.trainRunUp = this.trainRunUp; } - if (this.headDirection != null) { - data.headDirection = this.headDirection; + if (this.trainActiveDirection != null) { + data.trainActiveDirection = this.trainActiveDirection; } if (this.dynamicState != null) { data.dynamicState = this.dynamicState.toObject(); @@ -1626,6 +1644,9 @@ export namespace state { if (this.connState != null) { data.connState = this.connState.toObject(); } + if (this.pluseCount != null) { + data.pluseCount = this.pluseCount.toObject(); + } return data; } serialize(): Uint8Array; @@ -1648,12 +1669,12 @@ export namespace state { writer.writeInt64(7, this.headOffset); if (this.devicePort.length) writer.writeString(8, this.devicePort); - if (this.pointTo != false) - writer.writeBool(9, this.pointTo); - if (this.runDirection != false) - writer.writeBool(10, this.runDirection); - if (this.headDirection != false) - writer.writeBool(11, this.headDirection); + if (this.driftTo != false) + writer.writeBool(9, this.driftTo); + if (this.trainRunUp != false) + writer.writeBool(10, this.trainRunUp); + if (this.trainActiveDirection != 0) + writer.writeUint32(11, this.trainActiveDirection); if (this.has_dynamicState) writer.writeMessage(12, this.dynamicState, () => this.dynamicState.serialize(writer)); if (this.has_vobcState) @@ -1682,6 +1703,8 @@ export namespace state { writer.writeMessage(24, this.tcc, () => this.tcc.serialize(writer)); if (this.has_connState) writer.writeMessage(25, this.connState, () => this.connState.serialize(writer)); + if (this.has_pluseCount) + writer.writeMessage(26, this.pluseCount, () => this.pluseCount.serialize(writer)); if (!w) return writer.getResultBuffer(); } @@ -1716,13 +1739,13 @@ export namespace state { message.devicePort = reader.readString(); break; case 9: - message.pointTo = reader.readBool(); + message.driftTo = reader.readBool(); break; case 10: - message.runDirection = reader.readBool(); + message.trainRunUp = reader.readBool(); break; case 11: - message.headDirection = reader.readBool(); + message.trainActiveDirection = reader.readUint32(); break; case 12: reader.readMessage(message.dynamicState, () => message.dynamicState = TrainDynamicState.deserialize(reader)); @@ -1766,6 +1789,9 @@ export namespace state { case 25: reader.readMessage(message.connState, () => message.connState = TrainConnState.deserialize(reader)); break; + case 26: + reader.readMessage(message.pluseCount, () => message.pluseCount = SensorSpeedPulseCount.deserialize(reader)); + break; default: reader.skipField(); } } @@ -1778,6 +1804,96 @@ export namespace state { return TrainState.deserialize(bytes); } } + export class SensorSpeedPulseCount extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + pulseCount1?: number; + pulseCount2?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("pulseCount1" in data && data.pulseCount1 != undefined) { + this.pulseCount1 = data.pulseCount1; + } + if ("pulseCount2" in data && data.pulseCount2 != undefined) { + this.pulseCount2 = data.pulseCount2; + } + } + } + get pulseCount1() { + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; + } + set pulseCount1(value: number) { + pb_1.Message.setField(this, 1, value); + } + get pulseCount2() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set pulseCount2(value: number) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + pulseCount1?: number; + pulseCount2?: number; + }): SensorSpeedPulseCount { + const message = new SensorSpeedPulseCount({}); + if (data.pulseCount1 != null) { + message.pulseCount1 = data.pulseCount1; + } + if (data.pulseCount2 != null) { + message.pulseCount2 = data.pulseCount2; + } + return message; + } + toObject() { + const data: { + pulseCount1?: number; + pulseCount2?: number; + } = {}; + if (this.pulseCount1 != null) { + data.pulseCount1 = this.pulseCount1; + } + if (this.pulseCount2 != null) { + data.pulseCount2 = this.pulseCount2; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.pulseCount1 != 0) + writer.writeUint32(1, this.pulseCount1); + if (this.pulseCount2 != 0) + writer.writeUint32(2, this.pulseCount2); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SensorSpeedPulseCount { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SensorSpeedPulseCount(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.pulseCount1 = reader.readUint32(); + break; + case 2: + message.pulseCount2 = reader.readUint32(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): SensorSpeedPulseCount { + return SensorSpeedPulseCount.deserialize(bytes); + } + } export class TrainDynamicState extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { @@ -4085,9 +4201,9 @@ export namespace state { headDeviceId?: number; headOffset?: number; devicePort?: string; - pointTo?: boolean; - runDirection?: boolean; - headDirection?: boolean; + driftTo?: boolean; + trainRunUp?: boolean; + trainActiveDirection?: number; trainKilometer?: number; controlDelayTime?: number; wheelDiameter?: number; @@ -4175,14 +4291,14 @@ export namespace state { if ("devicePort" in data && data.devicePort != undefined) { this.devicePort = data.devicePort; } - if ("pointTo" in data && data.pointTo != undefined) { - this.pointTo = data.pointTo; + if ("driftTo" in data && data.driftTo != undefined) { + this.driftTo = data.driftTo; } - if ("runDirection" in data && data.runDirection != undefined) { - this.runDirection = data.runDirection; + if ("trainRunUp" in data && data.trainRunUp != undefined) { + this.trainRunUp = data.trainRunUp; } - if ("headDirection" in data && data.headDirection != undefined) { - this.headDirection = data.headDirection; + if ("trainActiveDirection" in data && data.trainActiveDirection != undefined) { + this.trainActiveDirection = data.trainActiveDirection; } if ("trainKilometer" in data && data.trainKilometer != undefined) { this.trainKilometer = data.trainKilometer; @@ -4411,22 +4527,22 @@ export namespace state { set devicePort(value: string) { pb_1.Message.setField(this, 8, value); } - get pointTo() { + get driftTo() { return pb_1.Message.getFieldWithDefault(this, 9, false) as boolean; } - set pointTo(value: boolean) { + set driftTo(value: boolean) { pb_1.Message.setField(this, 9, value); } - get runDirection() { + get trainRunUp() { return pb_1.Message.getFieldWithDefault(this, 10, false) as boolean; } - set runDirection(value: boolean) { + set trainRunUp(value: boolean) { pb_1.Message.setField(this, 10, value); } - get headDirection() { - return pb_1.Message.getFieldWithDefault(this, 11, false) as boolean; + get trainActiveDirection() { + return pb_1.Message.getFieldWithDefault(this, 11, 0) as number; } - set headDirection(value: boolean) { + set trainActiveDirection(value: number) { pb_1.Message.setField(this, 11, value); } get trainKilometer() { @@ -4807,9 +4923,9 @@ export namespace state { headDeviceId?: number; headOffset?: number; devicePort?: string; - pointTo?: boolean; - runDirection?: boolean; - headDirection?: boolean; + driftTo?: boolean; + trainRunUp?: boolean; + trainActiveDirection?: number; trainKilometer?: number; controlDelayTime?: number; wheelDiameter?: number; @@ -4895,14 +5011,14 @@ export namespace state { if (data.devicePort != null) { message.devicePort = data.devicePort; } - if (data.pointTo != null) { - message.pointTo = data.pointTo; + if (data.driftTo != null) { + message.driftTo = data.driftTo; } - if (data.runDirection != null) { - message.runDirection = data.runDirection; + if (data.trainRunUp != null) { + message.trainRunUp = data.trainRunUp; } - if (data.headDirection != null) { - message.headDirection = data.headDirection; + if (data.trainActiveDirection != null) { + message.trainActiveDirection = data.trainActiveDirection; } if (data.trainKilometer != null) { message.trainKilometer = data.trainKilometer; @@ -5093,9 +5209,9 @@ export namespace state { headDeviceId?: number; headOffset?: number; devicePort?: string; - pointTo?: boolean; - runDirection?: boolean; - headDirection?: boolean; + driftTo?: boolean; + trainRunUp?: boolean; + trainActiveDirection?: number; trainKilometer?: number; controlDelayTime?: number; wheelDiameter?: number; @@ -5180,14 +5296,14 @@ export namespace state { if (this.devicePort != null) { data.devicePort = this.devicePort; } - if (this.pointTo != null) { - data.pointTo = this.pointTo; + if (this.driftTo != null) { + data.driftTo = this.driftTo; } - if (this.runDirection != null) { - data.runDirection = this.runDirection; + if (this.trainRunUp != null) { + data.trainRunUp = this.trainRunUp; } - if (this.headDirection != null) { - data.headDirection = this.headDirection; + if (this.trainActiveDirection != null) { + data.trainActiveDirection = this.trainActiveDirection; } if (this.trainKilometer != null) { data.trainKilometer = this.trainKilometer; @@ -5388,12 +5504,12 @@ export namespace state { writer.writeInt64(7, this.headOffset); if (this.devicePort.length) writer.writeString(8, this.devicePort); - if (this.pointTo != false) - writer.writeBool(9, this.pointTo); - if (this.runDirection != false) - writer.writeBool(10, this.runDirection); - if (this.headDirection != false) - writer.writeBool(11, this.headDirection); + if (this.driftTo != false) + writer.writeBool(9, this.driftTo); + if (this.trainRunUp != false) + writer.writeBool(10, this.trainRunUp); + if (this.trainActiveDirection != 0) + writer.writeUint32(11, this.trainActiveDirection); if (this.trainKilometer != 0) writer.writeInt64(12, this.trainKilometer); if (this.controlDelayTime != 0) @@ -5546,13 +5662,13 @@ export namespace state { message.devicePort = reader.readString(); break; case 9: - message.pointTo = reader.readBool(); + message.driftTo = reader.readBool(); break; case 10: - message.runDirection = reader.readBool(); + message.trainRunUp = reader.readBool(); break; case 11: - message.headDirection = reader.readBool(); + message.trainActiveDirection = reader.readUint32(); break; case 12: message.trainKilometer = reader.readInt64(); @@ -9325,7 +9441,8 @@ export namespace state { export enum Type { Undefined = 0, Dynamics = 1, - SemiPhysicalTrain = 2 + SemiPhysicalTrain = 2, + Train_pc_sim = 3 } export enum State { Normal = 0, diff --git a/src/protos/request.ts b/src/protos/request.ts index 09c9241..ebcb81b 100644 --- a/src/protos/request.ts +++ b/src/protos/request.ts @@ -5,10 +5,6 @@ * git: https://github.com/thesayyn/protoc-gen-ts */ import * as pb_1 from "google-protobuf"; export namespace request { - export enum DriverType { - ONE_END = 0, - TWO_END = 1 - } export class Relay extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { @@ -1665,6 +1661,11 @@ export namespace request { DIRECTION_KEY_SWITCH = 2, HANDLER = 3 } + export enum Direction { + BACKWARD = 0, + FORWARD = 1, + NEUTRALWARD = 2 + } export class EmergentButton extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { @@ -1736,7 +1737,6 @@ export namespace request { #one_of_decls: number[][] = []; constructor(data?: any[] | { val?: boolean; - dt?: DriverType; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -1744,9 +1744,6 @@ export namespace request { if ("val" in data && data.val != undefined) { this.val = data.val; } - if ("dt" in data && data.dt != undefined) { - this.dt = data.dt; - } } } get val() { @@ -1755,36 +1752,22 @@ export namespace request { set val(value: boolean) { pb_1.Message.setField(this, 1, value); } - get dt() { - return pb_1.Message.getFieldWithDefault(this, 2, DriverType.ONE_END) as DriverType; - } - set dt(value: DriverType) { - pb_1.Message.setField(this, 2, value); - } static fromObject(data: { val?: boolean; - dt?: DriverType; }): DriverKeySwitch { const message = new DriverKeySwitch({}); if (data.val != null) { message.val = data.val; } - if (data.dt != null) { - message.dt = data.dt; - } return message; } toObject() { const data: { val?: boolean; - dt?: DriverType; } = {}; if (this.val != null) { data.val = this.val; } - if (this.dt != null) { - data.dt = this.dt; - } return data; } serialize(): Uint8Array; @@ -1793,8 +1776,6 @@ export namespace request { const writer = w || new pb_1.BinaryWriter(); if (this.val != false) writer.writeBool(1, this.val); - if (this.dt != DriverType.ONE_END) - writer.writeEnum(2, this.dt); if (!w) return writer.getResultBuffer(); } @@ -1807,9 +1788,6 @@ export namespace request { case 1: message.val = reader.readBool(); break; - case 2: - message.dt = reader.readEnum(); - break; default: reader.skipField(); } } From 182ea7c0993ff27828c393cf7a35c40f1538d3e0 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Sat, 11 May 2024 09:27:48 +0800 Subject: [PATCH 13/18] =?UTF-8?q?=E5=88=97=E8=BD=A6=E8=BD=A6=E5=A4=B4?= =?UTF-8?q?=E6=BF=80=E6=B4=BB=E7=AB=AF=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 +- src/configs/UrlManage.ts | 4 +- src/drawApp/graphics/TrainInteraction.ts | 24 +++---- src/graphics/train/Train.ts | 83 ++++++++++++------------ 4 files changed, 55 insertions(+), 58 deletions(-) diff --git a/rts-sim-testing-message b/rts-sim-testing-message index e4c55ea..0ed6b1d 160000 --- a/rts-sim-testing-message +++ b/rts-sim-testing-message @@ -1 +1 @@ -Subproject commit e4c55ea4b6f9f5f875d59fc5bba51fc21bc8ef97 +Subproject commit 0ed6b1d451f617804d608ede072121a0f1e36fb5 diff --git a/src/configs/UrlManage.ts b/src/configs/UrlManage.ts index d22c5bd..154ed06 100644 --- a/src/configs/UrlManage.ts +++ b/src/configs/UrlManage.ts @@ -10,7 +10,7 @@ function getHost(): string { // return '192.168.3.47:9091'; // return '192.168.3.37:9091'; //return '192.168.33.207:9091'; // 张骞 - // return '192.168.33.93:9091'; + return '192.168.33.93:9091'; // return '192.168.3.37:9091'; //卫志宏 // return 'test.joylink.club/bjrtsts-service'; // 测试 return '192.168.33.233:9091'; @@ -26,7 +26,7 @@ export function getHttpBase() { export function getWebsocketUrl() { let protocol = 'ws'; - let host = '192.168.33.233'; + let host = '192.168.33.93'; // let host = 'test.joylink.club'; let port = '8083'; let url = `${protocol}://${host}:${port}`; diff --git a/src/drawApp/graphics/TrainInteraction.ts b/src/drawApp/graphics/TrainInteraction.ts index 030f3d5..b7015da 100644 --- a/src/drawApp/graphics/TrainInteraction.ts +++ b/src/drawApp/graphics/TrainInteraction.ts @@ -77,23 +77,23 @@ export class TrainState extends GraphicStateBase implements ITrainState { set devicePort(v: string) { this.states.devicePort = v; } - get pointTo(): boolean { - return this.states.pointTo; + get driftTo(): boolean { + return this.states.driftTo; } - set pointTo(v: boolean) { - this.states.pointTo = v; + set driftTo(v: boolean) { + this.states.driftTo = v; } - get runDirection(): boolean { - return this.states.runDirection; + get trainRunUp(): boolean { + return this.states.trainRunUp; } - set runDirection(v: boolean) { - this.states.runDirection = v; + set trainRunUp(v: boolean) { + this.states.trainRunUp = v; } - get headDirection(): boolean { - return this.states.headDirection; + get trainActiveDirection(): number { + return this.states.trainActiveDirection; } - set headDirection(v: boolean) { - this.states.headDirection = v; + set trainActiveDirection(v: number) { + this.states.trainActiveDirection = v; } get trainKilometer(): number { return this.states.trainKilometer; diff --git a/src/graphics/train/Train.ts b/src/graphics/train/Train.ts index 53981ab..2870fa1 100644 --- a/src/graphics/train/Train.ts +++ b/src/graphics/train/Train.ts @@ -40,12 +40,12 @@ export interface ITrainState extends GraphicState { set headOffset(v: number); get devicePort(): string; set devicePort(v: string); - get pointTo(): boolean; - set pointTo(v: boolean); - get runDirection(): boolean; - set runDirection(v: boolean); - get headDirection(): boolean; - set headDirection(v: boolean); + get driftTo(): boolean; + set driftTo(v: boolean); + get trainRunUp(): boolean; + set trainRunUp(v: boolean); + get trainActiveDirection(): number; + set trainActiveDirection(v: number); get trainKilometer(): number; set trainKilometer(v: number); get controlDelayTime(): number; @@ -335,10 +335,7 @@ export class TrainHead extends Container { ]; // 道岔时运行x轴是否在增大决定箭头方向 // 区段时是否从A到B决定箭头方向 - if ( - (states.devicePort && this.train.isSyntropy) || - (!states.devicePort && states.pointTo) - ) { + if (states.devicePort && !this.train.arrowIsLeft) { const aP: Array = []; arrowPoint.forEach((item, index) => { if (index % 2 == 1) { @@ -349,25 +346,30 @@ export class TrainHead extends Container { }); arrowPoint = aP; } - if ( - (states.devicePort && this.train.isSyntropy) || - (!states.devicePort && states.pointTo) - ) { - const pP: Array = []; - pausePoint.forEach((item, index) => { - if (index % 2 == 1) { - const p = new Point(pausePoint[index - 1], item); - const newP = calculateMirrorPoint(new Point(0, 0), p); - pP.push(newP.x, newP.y); - } - }); - pausePoint = pP; + if (states.trainActiveDirection !== 0) { + const lineIsLeft = + this.train.arrowIsLeft && + states.driftTo === (states.trainActiveDirection === 1); + if (!lineIsLeft) { + const pP: Array = []; + pausePoint.forEach((item, index) => { + if (index % 2 == 1) { + const p = new Point(pausePoint[index - 1], item); + const newP = calculateMirrorPoint(new Point(0, 0), p); + pP.push(newP.x, newP.y); + } + }); + pausePoint = pP; + } + const pColor = DiriveModelColorEnum.AM; + this.pause.lineStyle(pauseW, pColor, 1); + this.pause.moveTo(pausePoint[0], pausePoint[1]); + this.pause.lineTo(pausePoint[2], pausePoint[3]); + } else { + this.pause.visible = false; } const aColor = DiriveModelColorEnum.AM; - const pColor = DiriveModelColorEnum.AM; - this.pause.lineStyle(pauseW, pColor, 1); - this.pause.moveTo(pausePoint[0], pausePoint[1]); - this.pause.lineTo(pausePoint[2], pausePoint[3]); + const arrow = this.arrow; arrow.beginFill(aColor, 1); arrow.drawPolygon(arrowPoint); @@ -377,11 +379,11 @@ export class TrainHead extends Container { } else { this.arrow.visible = false; } - if (states.tc1Active || states.tc2Active) { - this.pause.visible = true; - } else { - this.pause.visible = false; - } + // if (states.tc1Active || states.tc2Active) { + // this.pause.visible = true; + // } else { + // this.pause.visible = false; + // } } } @@ -488,14 +490,14 @@ export class Train extends JlGraphic { trainHead: TrainHead; trainbody: TrainBody; statusTextMap: Map = new Map(); - isSyntropy: boolean; //判断x坐标是否在增大 + arrowIsLeft: boolean; // 箭头是否在列车body的相对左侧 constructor() { super(Train.Type); this.trainbody = new TrainBody(this); this.trainHead = new TrainHead(this); this.addChild(this.trainHead); this.addChild(this.trainbody); - this.isSyntropy = false; + this.arrowIsLeft = true; } get datas(): ITrainData { @@ -562,15 +564,10 @@ export class Train extends JlGraphic { } allLength = getKmDistance(pKm, oKm); const portP = points[points.length - 1]; - const j = 10; - if (Math.abs(portP.x) < j) { - this.isSyntropy = this.states.runDirection; + if (this.states.driftTo) { + this.arrowIsLeft = 0 < portP.x; } else { - if (this.states.pointTo) { - this.isSyntropy = 0 > portP.x; - } else { - this.isSyntropy = portP.x > 0; - } + this.arrowIsLeft = portP.x < 0; } } else { dev = this.queryStore.queryById
(this.states.headDeviceId); @@ -610,7 +607,7 @@ export class Train extends JlGraphic { allLength = getKmDistance(BKm, AKm); const portS = points[0]; const portE = points[points.length - 1]; - this.isSyntropy = portE.x > portS.x; + this.arrowIsLeft = portE.x > portS.x && !this.states.driftTo; } } this.trainbody.doRepaint(); From a4231d1813435294675bf14889aee821b2de3d7d Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Sat, 11 May 2024 09:58:23 +0800 Subject: [PATCH 14/18] =?UTF-8?q?=E5=88=97=E8=BD=A6=E8=BD=A6=E5=A4=B4?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/lineScene.ts | 1 + src/graphics/train/Train.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/drawApp/lineScene.ts b/src/drawApp/lineScene.ts index 64bfa84..d94d2c9 100644 --- a/src/drawApp/lineScene.ts +++ b/src/drawApp/lineScene.ts @@ -470,6 +470,7 @@ function handleSubscribe(lineScene: IGraphicScene) { states.push(new CarWashingState(item)); } }); + console.log(storage.allStatus.trainState, '===='); storage.allStatus.trainState.forEach((item) => { // 列车 if (!item.show) { diff --git a/src/graphics/train/Train.ts b/src/graphics/train/Train.ts index 2870fa1..f64a29d 100644 --- a/src/graphics/train/Train.ts +++ b/src/graphics/train/Train.ts @@ -335,7 +335,7 @@ export class TrainHead extends Container { ]; // 道岔时运行x轴是否在增大决定箭头方向 // 区段时是否从A到B决定箭头方向 - if (states.devicePort && !this.train.arrowIsLeft) { + if (!this.train.arrowIsLeft) { const aP: Array = []; arrowPoint.forEach((item, index) => { if (index % 2 == 1) { @@ -346,6 +346,7 @@ export class TrainHead extends Container { }); arrowPoint = aP; } + this.pause.visible = true; if (states.trainActiveDirection !== 0) { const lineIsLeft = this.train.arrowIsLeft && @@ -369,7 +370,6 @@ export class TrainHead extends Container { this.pause.visible = false; } const aColor = DiriveModelColorEnum.AM; - const arrow = this.arrow; arrow.beginFill(aColor, 1); arrow.drawPolygon(arrowPoint); From aa7ad1edacc07dda19a8f83668a6e8f1b2a47e9e Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Sat, 11 May 2024 11:00:54 +0800 Subject: [PATCH 15/18] =?UTF-8?q?=E5=88=97=E8=BD=A6=E6=BF=80=E6=B4=BB?= =?UTF-8?q?=E7=AB=AF=E6=96=B9=E5=90=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/train/Train.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/graphics/train/Train.ts b/src/graphics/train/Train.ts index f64a29d..bb7e2c2 100644 --- a/src/graphics/train/Train.ts +++ b/src/graphics/train/Train.ts @@ -347,10 +347,14 @@ export class TrainHead extends Container { arrowPoint = aP; } this.pause.visible = true; + console.log(states.trainActiveDirection, this.train.code, states.driftTo); if (states.trainActiveDirection !== 0) { - const lineIsLeft = - this.train.arrowIsLeft && - states.driftTo === (states.trainActiveDirection === 1); + let lineIsLeft; + if (states.driftTo === (states.trainActiveDirection === 1)) { + lineIsLeft = this.train.arrowIsLeft; + } else { + lineIsLeft = !this.train.arrowIsLeft; + } if (!lineIsLeft) { const pP: Array = []; pausePoint.forEach((item, index) => { From 4acd4ccfe55b20411ef0d39f2fd04751943325b2 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Sat, 11 May 2024 15:34:35 +0800 Subject: [PATCH 16/18] =?UTF-8?q?=E5=89=8D=E7=AB=AFpixi=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e0e9751..02dfac9 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "default-passive-events": "^2.0.0", "echarts": "^5.4.3", "google-protobuf": "^3.21.2", - "jl-graphic": "git+http://120.46.212.6:3000/joylink/graphic-pixi.git#v0.1.11", + "jl-graphic": "git+http://120.46.212.6:3000/joylink/graphic-pixi.git#v0.1.14", "js-base64": "^3.7.5", "pinia": "^2.0.11", "quasar": "^2.6.0", From c4b35b3493dc125f58a9b5f15e56a74c71c4a337 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Sat, 11 May 2024 17:05:11 +0800 Subject: [PATCH 17/18] =?UTF-8?q?=E5=88=97=E8=BD=A6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/configs/UrlManage.ts | 7 +++++-- src/graphics/train/Train.ts | 21 ++++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/configs/UrlManage.ts b/src/configs/UrlManage.ts index 154ed06..19a909f 100644 --- a/src/configs/UrlManage.ts +++ b/src/configs/UrlManage.ts @@ -10,7 +10,7 @@ function getHost(): string { // return '192.168.3.47:9091'; // return '192.168.3.37:9091'; //return '192.168.33.207:9091'; // 张骞 - return '192.168.33.93:9091'; + // return '192.168.33.93:9091'; // return '192.168.3.37:9091'; //卫志宏 // return 'test.joylink.club/bjrtsts-service'; // 测试 return '192.168.33.233:9091'; @@ -26,7 +26,7 @@ export function getHttpBase() { export function getWebsocketUrl() { let protocol = 'ws'; - let host = '192.168.33.93'; + let host = '192.168.33.233'; // let host = 'test.joylink.club'; let port = '8083'; let url = `${protocol}://${host}:${port}`; @@ -40,6 +40,9 @@ export function getWebsocketUrl() { host = 'joylink.club/bjrtsts-server'; port = ''; url = `${protocol}://${host}`; + } else if (process.env.URL_ENV == 'local_test') { + host = '192.168.33.233'; } + return `${url}/mqtt`; } diff --git a/src/graphics/train/Train.ts b/src/graphics/train/Train.ts index bb7e2c2..fd6b88c 100644 --- a/src/graphics/train/Train.ts +++ b/src/graphics/train/Train.ts @@ -347,7 +347,6 @@ export class TrainHead extends Container { arrowPoint = aP; } this.pause.visible = true; - console.log(states.trainActiveDirection, this.train.code, states.driftTo); if (states.trainActiveDirection !== 0) { let lineIsLeft; if (states.driftTo === (states.trainActiveDirection === 1)) { @@ -568,10 +567,18 @@ export class Train extends JlGraphic { } allLength = getKmDistance(pKm, oKm); const portP = points[points.length - 1]; - if (this.states.driftTo) { - this.arrowIsLeft = 0 < portP.x; + if (portP.x === 0) { + if (this.states.driftTo) { + this.arrowIsLeft = 0 < portP.y; + } else { + this.arrowIsLeft = 0 > portP.y; + } } else { - this.arrowIsLeft = portP.x < 0; + if (this.states.driftTo) { + this.arrowIsLeft = 0 < portP.x; + } else { + this.arrowIsLeft = portP.x < 0; + } } } else { dev = this.queryStore.queryById
(this.states.headDeviceId); @@ -611,7 +618,11 @@ export class Train extends JlGraphic { allLength = getKmDistance(BKm, AKm); const portS = points[0]; const portE = points[points.length - 1]; - this.arrowIsLeft = portE.x > portS.x && !this.states.driftTo; + if (portE.x === portS.x) { + this.arrowIsLeft = portE.y < portS.y && !this.states.driftTo; + } else { + this.arrowIsLeft = portE.x > portS.x && !this.states.driftTo; + } } } this.trainbody.doRepaint(); From f0db718c54fa1a0877f2f6d9422c88d7de98c54e Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Mon, 13 May 2024 10:32:13 +0800 Subject: [PATCH 18/18] =?UTF-8?q?=E5=88=97=E8=BD=A6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/train/Train.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graphics/train/Train.ts b/src/graphics/train/Train.ts index fd6b88c..ac477db 100644 --- a/src/graphics/train/Train.ts +++ b/src/graphics/train/Train.ts @@ -569,9 +569,9 @@ export class Train extends JlGraphic { const portP = points[points.length - 1]; if (portP.x === 0) { if (this.states.driftTo) { - this.arrowIsLeft = 0 < portP.y; - } else { this.arrowIsLeft = 0 > portP.y; + } else { + this.arrowIsLeft = 0 < portP.y; } } else { if (this.states.driftTo) {