|
|
@ -10,6 +10,7 @@ export default class EnvManager { |
|
|
private amrMessageManager: AmrMessageManager = new AmrMessageManager() |
|
|
private amrMessageManager: AmrMessageManager = new AmrMessageManager() |
|
|
public client: mqtt.MqttClient = null |
|
|
public client: mqtt.MqttClient = null |
|
|
readonly stopSubscribe: StopSubscribe[] = [] |
|
|
readonly stopSubscribe: StopSubscribe[] = [] |
|
|
|
|
|
public env: EnvInfo = null |
|
|
|
|
|
|
|
|
onMqttConnect = (packet: IConnackPacket) => { |
|
|
onMqttConnect = (packet: IConnackPacket) => { |
|
|
console.log('Connected') |
|
|
console.log('Connected') |
|
|
@ -27,7 +28,7 @@ export default class EnvManager { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
onMqttError = (error: Error | ErrorWithReasonCode) => { |
|
|
onMqttError = (error: Error | ErrorWithReasonCode) => { |
|
|
console.error('Error:', error) |
|
|
console.error('EnvManager (' + this.env.envConfig.mqtt.websocket + ') error:', error) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async connectEnv() { |
|
|
async connectEnv() { |
|
|
@ -56,7 +57,8 @@ export default class EnvManager { |
|
|
|
|
|
|
|
|
system.showLoading() |
|
|
system.showLoading() |
|
|
worldModel.state.runState.isLoading = true |
|
|
worldModel.state.runState.isLoading = true |
|
|
const env = worldModel.state.runState.currentEnv |
|
|
const env = _.cloneDeep(worldModel.state.runState.currentEnv) |
|
|
|
|
|
this.env = env |
|
|
try { |
|
|
try { |
|
|
worldModel.backendMessageReceiver.setProjectEnv(worldModel.state.project_uuid, worldModel.state.runState.currentEnvId) |
|
|
worldModel.backendMessageReceiver.setProjectEnv(worldModel.state.project_uuid, worldModel.state.runState.currentEnvId) |
|
|
|
|
|
|
|
|
|