|
|
@ -77,6 +77,9 @@ export default class EnvManager { |
|
|
this.stopSubscribe.push( |
|
|
this.stopSubscribe.push( |
|
|
worldModel.backendMessageReceiver.subscribe('ServerState', this.onServerUpdateMessage.bind(this)) |
|
|
worldModel.backendMessageReceiver.subscribe('ServerState', this.onServerUpdateMessage.bind(this)) |
|
|
) |
|
|
) |
|
|
|
|
|
this.stopSubscribe.push( |
|
|
|
|
|
worldModel.backendMessageReceiver.subscribe('DeviceStatus', this.onDeviceStatusMessage.bind(this)) |
|
|
|
|
|
) |
|
|
await this.loadInvToModel() |
|
|
await this.loadInvToModel() |
|
|
|
|
|
|
|
|
this.client.on('connect', this.onMqttConnect) |
|
|
this.client.on('connect', this.onMqttConnect) |
|
|
@ -91,6 +94,16 @@ export default class EnvManager { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
* 处理设备状态消息 |
|
|
|
|
|
*/ |
|
|
|
|
|
onDeviceStatusMessage(type, topic, data: AgvStatusVo) { |
|
|
|
|
|
const object3D = Model.find3D(data.id) |
|
|
|
|
|
if (object3D) { |
|
|
|
|
|
object3D.agvStatusVo = data |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
* 监听在服务器停机之后,客户端连接也必须停机 |
|
|
* 监听在服务器停机之后,客户端连接也必须停机 |
|
|
*/ |
|
|
*/ |
|
|
onServerUpdateMessage(type: BackendTopicType, topic: string, data: ServerStatusVo) { |
|
|
onServerUpdateMessage(type: BackendTopicType, topic: string, data: ServerStatusVo) { |
|
|
|