ISCS状态显示调整

This commit is contained in:
fan 2021-09-09 17:22:47 +08:00
parent 66636a53fb
commit 9060e0efe2
11 changed files with 121 additions and 12 deletions

View File

@ -180,14 +180,64 @@ class Iscs {
update(list) {
(list || []).forEach(elem => {
const code = elem.code;
const oDevice = this.iscsDevice[code];
if (elem.dispose) {
this.$painter.delete(oDevice);
console.log(elem, '---------', elem.deviceType);
if (elem.deviceType === 'IBP') {
if (this.iscsDevice['IscsCircle_20']) {
elem.upStatus.operate ? this.iscsDevice['IscsCircle_20'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_20'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_20']);
}
if (this.iscsDevice['IscsCircle_17']) {
elem.upStatus.openCommand ? this.iscsDevice['IscsCircle_17'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_17'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_17']);
}
if (this.iscsDevice['IscsCircle_18']) {
elem.upStatus.openSideCommand ? this.iscsDevice['IscsCircle_18'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_18'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_18']);
}
if (this.iscsDevice['IscsCircle_19']) {
elem.upStatus.closeCommand ? this.iscsDevice['IscsCircle_19'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_19'].model.fillColor = '008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_19']);
}
} else if (elem.deviceType === 'PSL') {
if (this.iscsDevice['IscsCircle_12']) {
elem.upStatus.operate ? this.iscsDevice['IscsCircle_12'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_12'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_12']);
}
if (this.iscsDevice['IscsCircle_9']) {
elem.upStatus.openCommand ? this.iscsDevice['IscsCircle_9'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_9'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_9']);
}
if (this.iscsDevice['IscsCircle_35']) {
elem.upStatus.closeCommand ? this.iscsDevice['IscsCircle_35'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_35'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_35']);
}
if (this.iscsDevice['IscsCircle_37']) {
elem.upStatus.interlockRelease ? this.iscsDevice['IscsCircle_37'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_37'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_37']);
}
} else if (elem.deviceType === 'SAFETY_CIRCLE') {
if (this.iscsDevice['IscsCircle_26']) {
elem.upStatus.pfdcFault ? this.iscsDevice['IscsCircle_26'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_26'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_26']);
}
if (this.iscsDevice['IscsCircle_25']) {
elem.upStatus.busFault ? this.iscsDevice['IscsCircle_25'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_25'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_25']);
}
if (this.iscsDevice['IscsCircle_27']) {
elem.upStatus.safetyCircle ? this.iscsDevice['IscsCircle_27'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_27'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_27']);
}
} else {
const oDevice = this.iscsDevice[code];
if (oDevice && elem.dispose) {
this.$painter.delete(oDevice);
} else if (oDevice) {
if (this.hookHandle(oDevice.model, elem)) {
this.$painter.update(oDevice);
}
}
}
});
if (this.methods.stateUpdate instanceof Function) { this.methods.stateUpdate(list); }

View File

@ -97,7 +97,7 @@ class Painter {
} else {
const instance = device.instance;
if (instance) {
instance.setState(device);
instance.setState(device.model);
}
}
}

View File

@ -68,15 +68,29 @@ export default class fuzhouPsd extends Group {
this.add(this.grouper);
}
setState(model) {
if (model.alarm) {
this.fuzhouPsdBorder.setStyle('lineWidth', 1);
}
if (model.noStatus) {
// if (model.alarm) {
// this.fuzhouPsdBorder.setStyle('lineWidth', 1);
// }
if (model.status === 'UNDEFINED') {
this.fuzhouPsdLeft.attr({shape:{x: 2}});
this.fuzhouPsdRight.attr({shape:{x: this.model.height * 0.9 - 0.4}});
this.fuzhouPsdBorder.setStyle('fill', '#0f96dc');
this.fuzhouPsdRight.setStyle('fill', '#0f96dc');
this.fuzhouPsdLeft.setStyle('fill', '#0f96dc');
} else if (model.status === 'DCU_FAULT') {
this.fuzhouPsdBorder.setStyle('lineWidth', 1);
} else if (model.status === 'OPEN') {
this.fuzhouPsdLeft.attr({shape:{x: 2 + (this.model.height * 1.5 - 4) * 0.1}});
this.fuzhouPsdRight.attr({shape:{x: (this.model.height * 1.5 - 4) * 0.5 + 2}});
this.fuzhouPsdBorder.setStyle('fill', '#33CC00');
this.fuzhouPsdRight.setStyle('fill', '#33CC00');
this.fuzhouPsdLeft.setStyle('fill', '#33CC00');
} else if (model.status === 'CLOSE') {
this.fuzhouPsdLeft.attr({shape:{x: 2 + (this.model.height * 1.5 - 4) * 0.1}});
this.fuzhouPsdRight.attr({shape:{x: (this.model.height * 1.5 - 4) * 0.5 + 2}});
this.fuzhouPsdBorder.setStyle('fill', '#33CC00');
this.fuzhouPsdRight.setStyle('fill', '#33CC00');
this.fuzhouPsdLeft.setStyle('fill', '#33CC00');
}
}
setModel(dx, dy) {

View File

@ -181,6 +181,9 @@ const iscs = {
},
setCloseMusic: (state, num) => {
state.closeMusicNum = num;
},
updateIscsState: (state, deviceStatus) => {
Vue.prototype.$iscs && Vue.prototype.$iscs.update(deviceStatus);
}
},
@ -188,6 +191,9 @@ const iscs = {
setIscsData: ({ commit }, iscs) => {
commit('setIscsData', iscs);
},
updateIscsState: ({ commit }, deviceStatus) => {
commit('updateIscsState', deviceStatus);
},
updateIscsDevices: ({ commit }, models) => {
return new Promise((resolve) => {
if (!(models instanceof Array)) {

View File

@ -340,6 +340,7 @@ const socket = {
competitionPracticeFinish:0, // 竞赛场景结束标识
simulationAlarmInfo: [], // 仿真报警信息
deviceStateMessages: null, // 新版订阅设备状态消息
iscsStateMessages: null, // iscs设备状态消息
simulationSpeed: 1, // 仿真倍速
simulationPause: false,
simulationPslStatus: [], // PSL面板按钮状态信息
@ -421,6 +422,9 @@ const socket = {
},
setSimulationSpeed: (state, speed) => {
state.simulationSpeed = speed;
},
setIscsStateMessages: (state, speed) => {
state.iscsStateMessages = speed;
}
},
@ -506,6 +510,9 @@ const socket = {
},
setSimulationTimeSync:({ commit }, time) => {
commit('setSimulationTimeSync', time);
},
handleIscsState:({ commit }, state) => {
commit('setIscsStateMessages', state.body);
}
}
};

View File

@ -2,7 +2,7 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.2.175:9000'; // 旭强 有线
// BASE_API = 'http://192.168.8.167:9000'; // 旭强 无线
@ -10,7 +10,7 @@ export function getBaseUrl() {
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
} else {
BASE_API = process.env.VUE_APP_BASE_API;
}

View File

@ -8,6 +8,7 @@ export const perpetualTopic = '/user/topic/message'; // 公用topic
export const roomTopic = '/user/queue/room'; // 房间topic
export const jl3dTopic = '/user/queue/simulation/jl3d'; // 三维topic
export const LPFTopic = '/user/queue/simulation/passenger'; // 客流topic
export const iscsTopic = '/topic/simulation/iscs'; // iscs topic
export function getTopic(type, group) {
let topic = '';
@ -24,6 +25,9 @@ export function getTopic(type, group) {
// topic = `/user/queue/simulation/${group}/state`;
topic = `/queue/simulation/${group}/state`;
break;
case 'ISCS':
topic = '/topic/simulation/iscs';
break;
}
return topic;
}
@ -49,6 +53,8 @@ function callback(Response) {
store.dispatch('socket/setSimulationTimeSync', Number.parseInt(Response.body));
} else if (Response.headers.destination.includes('state')) {
store.dispatch('socket/handleSimulationState', Number.parseInt(Response.body));
} else if (Response.headers.destination.includes('iscs')) {
store.dispatch('socket/handleIscsState', JSON.parse(Response.body));
} else {
const data = JSON.parse(Response.body);
store.dispatch('socket/setStomp', data);

View File

@ -1,6 +1,9 @@
<template>
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
<el-form-item label="编码:" prop="code">
<el-input v-model="form.code" :disabled="true" size="small" />
</el-form-item>
<el-form-item label="图层:" prop="z2">
<el-input-number v-model="form.z2" controls-position="right" :min="0" size="small" />
</el-form-item>

View File

@ -1,6 +1,9 @@
<template>
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
<el-form-item label="门高:" prop="height">
<el-input v-model="form.code" :disabled="true" size="small" />
</el-form-item>
<el-form-item label="门高:" prop="height">
<el-input-number v-model="form.height" controls-position="right" :min="20" size="small" />
</el-form-item>

View File

@ -23,6 +23,8 @@ import TopNav from './nav.vue';
import GroupNav from './groupNav.vue';
import StationNav from './stationNav.vue';
import MenuBar from './menuBar.vue';
import { getToken } from '@/utils/auth';
import { creatSubscribe, clearSubscribe, iscsTopic } from '@/utils/stomp';
export default {
components: {
@ -41,7 +43,22 @@ export default {
return this.$route.query.lineCode;
}
},
mounted() {
this.subscribe();
},
beforeDestroy() { this.clearSubscribe(); },
methods: {
async subscribe() {
this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(iscsTopic, header);
// creatSubscribe(`${LPFTopic}\/${this.$route.query.group}`, header);
// await this.$store.dispatch('training/setHasSubscribed');
this.$store.dispatch('app/animationsClose');
},
clearSubscribe() {
clearSubscribe(iscsTopic);
}
}
};
</script>

View File

@ -58,6 +58,9 @@ export default {
this.$store.dispatch('runPlan/setRunPlanInfo', res.data.runPlan);
loadRunPlanData(this.group);
});
},
'$store.state.socket.iscsStateMessages': function (list) {
this.$store.dispatch('iscs/updateIscsState', list);
}
},
mounted() {