|
@@ -147,7 +147,6 @@ class MqttManager {
|
|
|
device6.onlineStatus = 0
|
|
|
device7.onlineStatus = 0
|
|
|
device8.onlineStatus = 0
|
|
|
- let onlineNum: number = 0
|
|
|
for (const element of updateData.d) {
|
|
|
if (CommonConstants.attrMap.has(element.tag)) {
|
|
|
let deviceType: string = CommonConstants.attrMap.get(element.tag) ?? '';
|
|
@@ -174,7 +173,6 @@ class MqttManager {
|
|
|
} else {
|
|
|
device1.devicePowerStatus = element.value
|
|
|
}
|
|
|
- onlineNum++
|
|
|
} else if (CommonConstants.stationLightMap.get('装调工位2')?.indexOf(element.tag!)! >= 0) {
|
|
|
device2.onlineStatus = 1
|
|
|
if (element.tag! === CommonConstants.stationLightMap.get('装调工位2')![0]) {
|
|
@@ -182,7 +180,6 @@ class MqttManager {
|
|
|
} else {
|
|
|
device2.devicePowerStatus = element.value
|
|
|
}
|
|
|
- onlineNum++
|
|
|
} else if (CommonConstants.stationLightMap.get('出入库工位')?.indexOf(element.tag!)! >= 0) {
|
|
|
device3.onlineStatus = 1
|
|
|
if (element.tag! === CommonConstants.stationLightMap.get('出入库工位')![0]) {
|
|
@@ -190,7 +187,6 @@ class MqttManager {
|
|
|
} else {
|
|
|
device3.devicePowerStatus = element.value
|
|
|
}
|
|
|
- onlineNum++
|
|
|
} else if (CommonConstants.stationLightMap.get('检验工位')?.indexOf(element.tag!)! >= 0) {
|
|
|
device4.onlineStatus = 1
|
|
|
if (element.tag! === CommonConstants.stationLightMap.get('检验工位')![0]) {
|
|
@@ -198,7 +194,6 @@ class MqttManager {
|
|
|
} else {
|
|
|
device4.devicePowerStatus = element.value
|
|
|
}
|
|
|
- onlineNum++
|
|
|
} else if (CommonConstants.stationLightMap.get('包装工位')?.indexOf(element.tag!)! >= 0) {
|
|
|
device5.onlineStatus = 1
|
|
|
if (element.tag! === CommonConstants.stationLightMap.get('包装工位')![0]) {
|
|
@@ -206,15 +201,12 @@ class MqttManager {
|
|
|
} else {
|
|
|
device5.devicePowerStatus = element.value
|
|
|
}
|
|
|
- onlineNum++
|
|
|
} else if (element.tag! === 'Charging1Set') {
|
|
|
device6.onlineStatus = 1
|
|
|
device6.controlPowerStatus = element.value
|
|
|
- onlineNum++
|
|
|
} else if (element.tag! === 'Charging2Set') {
|
|
|
device7.onlineStatus = 1
|
|
|
device7.controlPowerStatus = element.value
|
|
|
- onlineNum++
|
|
|
}
|
|
|
break;
|
|
|
case DeviceType.RGV1:
|
|
@@ -232,8 +224,15 @@ class MqttManager {
|
|
|
AppStorage.setOrCreate<StationControl[]>('stationArray', [device1, device2, device3, device4, device5, device6, device7]);
|
|
|
AppStorage.setOrCreate<RobotInfo[]>('robotArray', [device8]);
|
|
|
AppStorage.setOrCreate<number[]>('lightControlArray', this.lightControlArray);
|
|
|
+ let onlineNum: number = 0
|
|
|
+ this.stationArray = [device1, device2, device3, device4, device5, device6, device7]
|
|
|
+ for (const station of this.stationArray) {
|
|
|
+ if (station.onlineStatus === 1) {
|
|
|
+ onlineNum++
|
|
|
+ }
|
|
|
+ }
|
|
|
AppStorage.setOrCreate<number>('onlineNum', onlineNum);
|
|
|
- AppStorage.setOrCreate<number>('offlineNum', this.stationArray.length! - onlineNum > 0 ? this.stationArray.length - onlineNum : 0);
|
|
|
+ AppStorage.setOrCreate<number>('offlineNum', this.stationArray.length! - onlineNum >= 0 ? this.stationArray.length - onlineNum : 0);
|
|
|
} else {
|
|
|
AppStorage.setOrCreate<TempHumiditySensor>('tempHumiditySensor', device0);
|
|
|
}
|