diff --git a/entry/src/main/ets/common/utils/GlobalTcp.ts b/entry/src/main/ets/common/utils/GlobalTcp.ts index 04485318..f515627d 100644 --- a/entry/src/main/ets/common/utils/GlobalTcp.ts +++ b/entry/src/main/ets/common/utils/GlobalTcp.ts @@ -27,13 +27,13 @@ export async function getTCP(flag=false) { // await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 console.log('ttttttt00') - clearInterval(globalThis.intervalSendmsg) - globalThis.intervalSendmsg=setInterval(()=>{ - console.log('getCloseTcp',globalThis.carInfo.carNo) - if(!globalThis.getCloseTcp){ - globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 - } - },1000/3) + // clearInterval(globalThis.intervalSendmsg) + // globalThis.intervalSendmsg=setInterval(()=>{ + // console.log('getCloseTcp',globalThis.carInfo.carNo) + // if(!globalThis.getCloseTcp){ + // globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 + // } + // },1000/3) globalThis.TcpClient.onError((val) => { setTimeout(() => { getTCP() @@ -62,13 +62,13 @@ export async function getTCP(flag=false) { await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 console.log('ttttttt12') - clearInterval(globalThis.intervalSendmsg) - globalThis.intervalSendmsg=setInterval(()=>{ - // console.log('getCloseTcp',globalThis.getCloseTcp) - if(!globalThis.getCloseTcp){ - globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 - } - },1000/3) + // clearInterval(globalThis.intervalSendmsg) + // globalThis.intervalSendmsg=setInterval(()=>{ + // // console.log('getCloseTcp',globalThis.getCloseTcp) + // if(!globalThis.getCloseTcp){ + // globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 + // } + // },1000/3) globalThis.TcpClient.onError((val) => { setTimeout(() => { getTCP() diff --git a/entry/src/main/ets/common/utils/UdpClientByCenter.ts b/entry/src/main/ets/common/utils/UdpClientByCenter.ts index d1891209..372a5535 100644 --- a/entry/src/main/ets/common/utils/UdpClientByCenter.ts +++ b/entry/src/main/ets/common/utils/UdpClientByCenter.ts @@ -337,6 +337,9 @@ export default class UdpClientByCenter { // PLC: JSON.stringify(newArr.toString()), // }) if(strachArr[83]!='4'){ + if(!globalThis.getCloseTcp){ + globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 + } console.log('差分状态异常',strachArr[83],strachArr[92]) this.writeLog({ time:dateFormat(new Date()),