ncc逻辑调整
This commit is contained in:
parent
034199ec23
commit
a79668095c
@ -73,7 +73,7 @@ export default class NccStation extends Group {
|
||||
if (this.stationMain) {
|
||||
return this.stationMain.getBoundingRect().clone();
|
||||
} else {
|
||||
return new BoundingRect(this.model.position.x, this.model.position.y, 0, 0);
|
||||
return new BoundingRect(0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,14 @@ export function iscsPaCallback(Response) {
|
||||
export function iscsPisCallback(Response) {
|
||||
store.dispatch('socket/handleIscsPisState', JSON.parse(Response.body));
|
||||
}
|
||||
export function diagramSimCallback(Response) {
|
||||
const msg = JSON.parse(Response.body);
|
||||
switch (msg.type) {
|
||||
case 'SIMULATION_NCC_STATION_DIAGRAM':
|
||||
store.dispatch('socket/handleNccRun', msg.body);
|
||||
break;
|
||||
}
|
||||
}
|
||||
export function defaultCallback(Response) {
|
||||
handle(JSON.parse(Response.body));
|
||||
}
|
||||
@ -200,9 +208,6 @@ function handle(data) {
|
||||
case 'Simulation_Control_Transfer_Result':
|
||||
store.dispatch('socket/setControlTransfer', msg);
|
||||
break;
|
||||
case 'SIMULATION_NCC_STATION_DIAGRAM':
|
||||
store.dispatch('socket/handleNccRun', msg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 仿真内部聊天
|
||||
|
@ -53,7 +53,7 @@
|
||||
import {getSimulationMemberList, getAllSimulationUser} from '@/api/simulation';
|
||||
import {getToken} from '@/utils/auth';
|
||||
import {creatSubscribe, clearSubscribe, getTopic} from '@/utils/stomp';
|
||||
import { defaultCallback, stateCallback } from '@/utils/subscribeCallback';
|
||||
import { defaultCallback, stateCallback, diagramSimCallback } from '@/utils/subscribeCallback';
|
||||
import DispatcherWork from './dispatchWork';
|
||||
import LocalWork from './localWork';
|
||||
import InterlockWork from './interlockWork';
|
||||
@ -197,6 +197,11 @@ export default {
|
||||
if (val) {
|
||||
this.simulationReset(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.simulationAlarmInfo': function(val) {
|
||||
if (val && val.handleMethod === 'NCC' && this.picture === 'nccWork') {
|
||||
this.picture = 'lineMonitor';
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -231,7 +236,13 @@ export default {
|
||||
},
|
||||
subscribe(type) { // 根据显示端分别订阅
|
||||
const header = {group: this.group || '', 'X-Token': getToken()};
|
||||
creatSubscribe(getTopic(type, this.group), header, type === 'STATE' ? stateCallback : defaultCallback);
|
||||
let callbackFun = defaultCallback;
|
||||
if (type === 'STATE') {
|
||||
callbackFun = stateCallback;
|
||||
} else if (type === 'NCC') {
|
||||
callbackFun = diagramSimCallback;
|
||||
}
|
||||
creatSubscribe(getTopic(type, this.group), header, callbackFun);
|
||||
},
|
||||
clearSubscribe() {
|
||||
clearSubscribe(getTopic('COMMON', this.group));
|
||||
|
Loading…
Reference in New Issue
Block a user