tms订阅调整

This commit is contained in:
joylink_fanyuhong 2024-06-28 14:04:27 +08:00
parent 0c4c5bebb0
commit 364bd1e539
2 changed files with 15 additions and 5 deletions

View File

@ -35,7 +35,7 @@ export function getTopic(type, group, param) {
topic = `/queue/simulation/${group}/iscs/gate/${param.stationCode}`;
break;
case 'TMS':
topic = `/queue/simulation/${group}/train/001/tms`;
topic = `/queue/simulation/${group}/train/${param.groupNumber}/tms`;
break;
case 'PIS_STAND':
topic = `/queue/simulation/${group}/standPis/${param.standCode}`;

View File

@ -8,7 +8,7 @@
<td>网压</td>
<td>网流</td>
<td>速度</td>
<td>牵引/制动级位</td>
<td>牵引/制动级位111</td>
<td>里程标</td>
<td>下一站</td>
<td>目的站</td>
@ -143,7 +143,7 @@
</div>
</td></template
>
<template v-else-if="k === '交流输出电压'">
<template v-else-if="k === '交流输出电压111'">
<td v-for="(item, j) in v" :key="j">
{{ item }}
</td></template
@ -230,6 +230,7 @@ export default {
data() {
return {
localStatic: JL3D_LOCAL_STATIC,
groupNumber: '001',
trainInfo: {
voltage: 1600,
current: 317,
@ -260,6 +261,14 @@ export default {
牵引脉冲使能: [true, false, false, false, false, true]
}
};
},
watch: {
'$store.state.training.roleDeviceCode': function (val) {
if(val) {
this.unsubscribe();
this.subscribe();
}
}
},
mounted() {
this.group = this.$route.query.group;
@ -275,7 +284,8 @@ export default {
methods: {
subscribe() {
const header = { group: this.group || "", "X-Token": getToken() };
creatSubscribe(getTopic("TMS", this.group), header, msg => {
this.groupNumber = this.$store.state.training.roleDeviceCode
creatSubscribe(getTopic("TMS", this.group, { groupNumber: this.groupNumber }), header, msg => {
let res = JSON.parse(msg.body);
console.log(res);
console.log(res.parkingBreakPressure);
@ -315,7 +325,7 @@ export default {
});
},
unsubscribe() {
clearSubscribe(getTopic("TMS", this.group));
clearSubscribe(getTopic("TMS", this.group, { groupNumber: this.groupNumber }));
},
setTractionWave(flag) {
if (timer) {