仿真状态判断调整

This commit is contained in:
fan 2023-05-23 11:27:36 +08:00
parent 228c06e61d
commit 94a3693337
2 changed files with 4 additions and 4 deletions

View File

@ -103,10 +103,10 @@ function callback(Response) {
store.dispatch('socket/setSimulationTimeSync', Number.parseInt(Response.body));
} else if (Response.headers.destination.includes('state')) {
const msg = JSON.parse(Response.body);
if (msg.state) {
if (msg.hasOwnProperty('state')) {
store.dispatch('socket/handleSimulationState', Number.parseInt(msg.state));
}
if (msg.speed) {
if (msg.hasOwnProperty('speed')) {
store.dispatch('socket/setSimulationSpeed', Number.parseInt(msg.speed));
}
} else if (Response.headers.destination.includes('iscs/psd') || Response.headers.destination.includes('iscs/gate')) {

View File

@ -9,10 +9,10 @@ export function sysTimeCallback(Response) {
}
export function stateCallback(Response) {
const msg = JSON.parse(Response.body);
if (msg.state) {
if (msg.hasOwnProperty('state')) {
store.dispatch('socket/handleSimulationState', Number.parseInt(msg.state));
}
if (msg.speed) {
if (msg.hasOwnProperty('speed')) {
store.dispatch('socket/setSimulationSpeed', Number.parseInt(msg.speed));
}
}