diff --git a/entry/src/main/ets/common/utils/UdpClientByCenter.ts b/entry/src/main/ets/common/utils/UdpClientByCenter.ts index 87156197..c497585d 100644 --- a/entry/src/main/ets/common/utils/UdpClientByCenter.ts +++ b/entry/src/main/ets/common/utils/UdpClientByCenter.ts @@ -353,6 +353,10 @@ export default class UdpClientByCenter { // getUDP(globalThis.context,true) globalThis.title='差分状态异常' globalThis.type='3' + prompt.showToast({ + message: '差分状态异常', + duration: 2000 + }); // AppStorage.SetOrCreate('errorCode', 1); // if(this.errorStep!=1){ // this.errorStep=1 @@ -424,6 +428,10 @@ export default class UdpClientByCenter { lightLineUdp?.send(this.plcUdpError ? arrRedBuffer : (isJudge ? arrGreenBugger : arrBlueBuffer)); if (this.plcUdpError) { num++ + this.writeLog({ + time:dateFormat(new Date()), + PLC: 'plc udp信号丢失', + }) console.log(TAG, 'plc udp信号丢失') if (num == 3) { getUDP(globalThis.context,true) diff --git a/entry/src/main/ets/pages/compontents/FaceCompare.ets b/entry/src/main/ets/pages/compontents/FaceCompare.ets index 26cfaf8e..fdf313f9 100644 --- a/entry/src/main/ets/pages/compontents/FaceCompare.ets +++ b/entry/src/main/ets/pages/compontents/FaceCompare.ets @@ -139,6 +139,7 @@ export default struct FaceCompare { .backgroundImageSize({ width: '100%', height: '100%' }) .onClick(() => { this.controller.stop() + clearInterval(this.interval) this.vocObj && this.vocObj.releasePlayer() this.showFaceCompare = !this.showFaceCompare this.showFaceCompareFlag = !this.showFaceCompareFlag @@ -250,6 +251,9 @@ export default struct FaceCompare { } }, 1000) globalThis.udpClient2.setMsgCallBack((val) => { + if(globalThis.statue!=3){ + return + } if (val.id == '48') { if (val.body[13] == '1') { this.showFaceCompareFlag = !this.showFaceCompareFlag @@ -322,7 +326,7 @@ export default struct FaceCompare { } async aboutToDisappear() { - + clearInterval(this.interval) } }