仿真倍速同步
This commit is contained in:
parent
5e55daf3a4
commit
c23bf6ba72
@ -102,7 +102,13 @@ function callback(Response) {
|
||||
} else if (Response.headers.destination.includes('sysTime')) {
|
||||
store.dispatch('socket/setSimulationTimeSync', Number.parseInt(Response.body));
|
||||
} else if (Response.headers.destination.includes('state')) {
|
||||
store.dispatch('socket/handleSimulationState', Number.parseInt(Response.body));
|
||||
const msg = JSON.parse(Response.body);
|
||||
if (msg.state) {
|
||||
store.dispatch('socket/handleSimulationState', Number.parseInt(msg.state));
|
||||
}
|
||||
if (msg.speed) {
|
||||
store.dispatch('socket/setSimulationSpeed', Number.parseInt(msg.speed));
|
||||
}
|
||||
} else if (Response.headers.destination.includes('iscs/psd') || Response.headers.destination.includes('iscs/gate')) {
|
||||
store.dispatch('socket/handleIscsState', JSON.parse(Response.body));
|
||||
} else if (Response.headers.destination.includes('iscs/pa')) {
|
||||
|
@ -8,7 +8,13 @@ export function sysTimeCallback(Response) {
|
||||
store.dispatch('socket/setSimulationTimeSync', Number.parseInt(Response.body));
|
||||
}
|
||||
export function stateCallback(Response) {
|
||||
store.dispatch('socket/handleSimulationState', Number.parseInt(Response.body));
|
||||
const msg = JSON.parse(Response.body);
|
||||
if (msg.state) {
|
||||
store.dispatch('socket/handleSimulationState', Number.parseInt(msg.state));
|
||||
}
|
||||
if (msg.speed) {
|
||||
store.dispatch('socket/setSimulationSpeed', Number.parseInt(msg.speed));
|
||||
}
|
||||
}
|
||||
export function iscsPsdCallback(Response) {
|
||||
store.dispatch('socket/handleIscsState', JSON.parse(Response.body));
|
||||
|
@ -94,6 +94,9 @@ export default {
|
||||
watch: {
|
||||
'$store.state.socket.simulationTimeSync': function (time) { // 仿真时间更新
|
||||
this.initDate(time);
|
||||
},
|
||||
'$store.state.socket.simulationSpeed': function(speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
Loading…
Reference in New Issue
Block a user