Compare commits
	
		
			No commits in common. "d6f0543e9d11be16ba90fa2be86e56c75fa064b7" and "0d6fb0a2f4bddf7991e40a679ef9cc35bdab7728" have entirely different histories.
		
	
	
		
			d6f0543e9d
			...
			0d6fb0a2f4
		
	
		
@ -260,77 +260,46 @@ export async function takePhotoFn(context) {
 | 
				
			|||||||
let fd
 | 
					let fd
 | 
				
			||||||
const devPath="/dev/ttyS3"
 | 
					const devPath="/dev/ttyS3"
 | 
				
			||||||
function openChuankouFn() {
 | 
					function openChuankouFn() {
 | 
				
			||||||
  console.log('SerialOpen in indexservice, path=' + devPath)
 | 
					 | 
				
			||||||
  fd = testNapi.SerialOpen(devPath);
 | 
					  fd = testNapi.SerialOpen(devPath);
 | 
				
			||||||
  globalThis.num=0
 | 
					 | 
				
			||||||
  globalThis.fd=fd
 | 
					  globalThis.fd=fd
 | 
				
			||||||
  console.log('fdfd1111',globalThis.fd)
 | 
					  console.log('fdfd1111',globalThis.fd)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  let parity = 0x4e; // 'N'
 | 
					  let parity = 0x4e; // 'N'
 | 
				
			||||||
  let ret = testNapi.SerialSet(globalThis.fd, 115200, 0, 8, 1, parity);
 | 
					  let ret = testNapi.SerialSet(globalThis.fd, 115200, 0, 8, 1, parity);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
function getChuankouFnMsg() {
 | 
					function getChuankouFnMsg() {
 | 
				
			||||||
  let timeout = 50000; // 2秒超时
 | 
					  let timeout = 50000; // 2秒超时
 | 
				
			||||||
  let databuff = [0x61, 0xAA, 0x0A, 0X15, 0X00]; // send ABCDE
 | 
					  let databuff = [0x61, 0xAA, 0x0A, 0X15, 0X00]; // send ABCDE
 | 
				
			||||||
  console.log('fdfd',globalThis.fd)
 | 
					  console.log('fdfd',globalThis.fd)
 | 
				
			||||||
  console.log('zzc 1 try send msg')
 | 
					  let ret = testNapi.SerialSend(globalThis.fd, databuff);
 | 
				
			||||||
  testNapi.SerialSendAsync(globalThis.fd, databuff,(ret)=>{
 | 
					  console.log('mmmm',ret)
 | 
				
			||||||
    console.log('zzc 2 send finished')
 | 
					  let revTestInfo = testNapi?.SerialRecv(globalThis.fd, timeout);
 | 
				
			||||||
    console.log('zzc 3 try receive msg')
 | 
					
 | 
				
			||||||
    testNapi.SerialRecvAsync(globalThis.fd, timeout, (revTestInfo) => {
 | 
					 | 
				
			||||||
      console.log('zzc 4 received msg')
 | 
					 | 
				
			||||||
  console.log('revTestInfo',revTestInfo.recevedBuf.length)
 | 
					  console.log('revTestInfo',revTestInfo.recevedBuf.length)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const message = revTestInfo?.recevedBuf?.toString()
 | 
					  const message = revTestInfo?.recevedBuf?.toString()
 | 
				
			||||||
  console.log('chuankou',message)
 | 
					  console.log('chuankou',message)
 | 
				
			||||||
  if (message == '') {
 | 
					  if (message == '') {
 | 
				
			||||||
        console.log('zzc error msg is emptry')
 | 
					 | 
				
			||||||
        globalThis.num=1
 | 
					 | 
				
			||||||
        console.log('zzc 9 num=3 close serial')
 | 
					 | 
				
			||||||
        // clearInterval(chuankou)
 | 
					 | 
				
			||||||
        testNapi.SerialClose(globalThis.fd);
 | 
					 | 
				
			||||||
        globalThis.fd=null
 | 
					 | 
				
			||||||
        getChuankouFn()
 | 
					 | 
				
			||||||
    return
 | 
					    return
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  const msg = message?.split(',')
 | 
					  const msg = message?.split(',')
 | 
				
			||||||
  if(!msg?.length){
 | 
					  if(!msg?.length){
 | 
				
			||||||
 | 
					    return
 | 
				
			||||||
      } else if (msg[0] != '98' || msg[1] != '85' || msg.length < 9) {
 | 
					  }
 | 
				
			||||||
 | 
					  if (msg[0] != '98' || msg[1] != '85' || msg.length < 9) {
 | 
				
			||||||
      } else if(msg.length<12){
 | 
					    return
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
      } else {
 | 
					 | 
				
			||||||
  globalThis.chuankoMsg=msg[9]
 | 
					  globalThis.chuankoMsg=msg[9]
 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
      console.log('zzc 5 sleep 1s')
 | 
					 | 
				
			||||||
      setTimeout(()=>{
 | 
					 | 
				
			||||||
        console.log(`x=${globalThis.num}`)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        console.log('zzc 7 send next msg')
 | 
					 | 
				
			||||||
        getChuankouFnMsg()
 | 
					 | 
				
			||||||
      },1000)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      // hilog.info(0x0000, 'testTag', 'Test NAPI SerialRecvAsync callback in');
 | 
					 | 
				
			||||||
      // hilog.info(0x0000, 'testTag', 'Test NAPI SerialRecvAsync recevedLen = %{public}d', revTestInfo.recevedLen);
 | 
					 | 
				
			||||||
      // hilog.info(0x0000, 'testTag', 'Test NAPI SerialRecvAsync recevedBuf = %{public}s', revTestInfo.recevedBuf.toString());
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  });
 | 
					 | 
				
			||||||
  // let revTestInfo = testNapi?.SerialRecv(globalThis.fd, timeout);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
let chuankou
 | 
					 | 
				
			||||||
export async function getChuankouFn(){
 | 
					export async function getChuankouFn(){
 | 
				
			||||||
  if(globalThis.fd){
 | 
					  if(globalThis.fd){
 | 
				
			||||||
    return
 | 
					    return
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  openChuankouFn()
 | 
					  openChuankouFn()
 | 
				
			||||||
  // clearInterval(chuankou)
 | 
					  setInterval(()=>{
 | 
				
			||||||
  // chuankou=setInterval(()=>{
 | 
					 | 
				
			||||||
    getChuankouFnMsg()
 | 
					    getChuankouFnMsg()
 | 
				
			||||||
  // },1000)
 | 
					  },1000)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -40,7 +40,6 @@ export async function getCarInfo() {
 | 
				
			|||||||
          // }, router.RouterMode.Single);
 | 
					          // }, router.RouterMode.Single);
 | 
				
			||||||
    }else {
 | 
					    }else {
 | 
				
			||||||
        globalThis.carInfo=res.obtainCarExamInfoRsp.body
 | 
					        globalThis.carInfo=res.obtainCarExamInfoRsp.body
 | 
				
			||||||
        console.log('globalThis.carInfo',JSON.stringify(globalThis.carInfo));
 | 
					 | 
				
			||||||
        // globalThis.carInfo.carId=res.obtainCarExamInfoRsp.body.carId
 | 
					        // globalThis.carInfo.carId=res.obtainCarExamInfoRsp.body.carId
 | 
				
			||||||
        globalThis.carInfo.plateNo = decodeURIComponent(globalThis.carInfo.plateNo)
 | 
					        globalThis.carInfo.plateNo = decodeURIComponent(globalThis.carInfo.plateNo)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -132,10 +132,10 @@ export async function takePhoto(param, context,dir,flag=1,callback?) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
//type:1 是图片 2是视频
 | 
					
 | 
				
			||||||
export async function deleteAllFileByPiC(dirName,type=1) {
 | 
					export async function deleteAllFileByPiC(dirName) {
 | 
				
			||||||
  // const fileHelper = new FileHelper();
 | 
					  // const fileHelper = new FileHelper();
 | 
				
			||||||
  fileHelper.deleteFileOfAlbum(dirName,type);
 | 
					  fileHelper.deleteFileOfAlbum(dirName,1);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export async function deleteAllVideos(context,type: photoAccessHelper.AlbumType, subType: photoAccessHelper.AlbumSubtype): Promise<void> {
 | 
					export async function deleteAllVideos(context,type: photoAccessHelper.AlbumType, subType: photoAccessHelper.AlbumSubtype): Promise<void> {
 | 
				
			||||||
 | 
				
			|||||||
@ -1,46 +1,27 @@
 | 
				
			|||||||
import TcpClient from './TcpClient';
 | 
					import TcpClient from './TcpClient';
 | 
				
			||||||
import { getSyncData} from '../service/initable'
 | 
					import { getSyncData} from '../service/initable'
 | 
				
			||||||
import hilog from '@ohos.hilog';
 | 
					import hilog from '@ohos.hilog';
 | 
				
			||||||
export async function getTCP(flag=false) {
 | 
					export async function getTCP() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  getSyncData('IpConfigTable').then(async (result:Array<any>)=>{
 | 
					  getSyncData('IpConfigTable').then(async (result:Array<any>)=>{
 | 
				
			||||||
    console.log('result222',JSON.stringify(result))
 | 
					    console.log('result222',JSON.stringify(result))
 | 
				
			||||||
    if(result.length){
 | 
					    if(result.length){
 | 
				
			||||||
      if(globalThis.TcpClient&&globalThis.TcpClient.closeTcp){
 | 
					      if(globalThis.TcpClient&&globalThis.TcpClient.closeTcp){
 | 
				
			||||||
        if(!flag){
 | 
					 | 
				
			||||||
          return
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        globalThis.TcpClient.closeTcp(async ()=>{
 | 
					        globalThis.TcpClient.closeTcp(async ()=>{
 | 
				
			||||||
          // const tcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
 | 
					          // const tcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
 | 
				
			||||||
          // globalThis.TcpClient = tcpClient
 | 
					          // globalThis.TcpClient = tcpClient
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          await globalThis.TcpClient.rebindTcp(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
 | 
					          await globalThis.TcpClient.rebindTcp(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
 | 
				
			||||||
          await globalThis.TcpClient.connectTcp()
 | 
					          await globalThis.TcpClient.connectTcp()
 | 
				
			||||||
          await globalThis.TcpClient.sendMsg(globalThis.carInfo?.carNo||'402')//1002
 | 
					          await globalThis.TcpClient.sendMsg('1002')//1002
 | 
				
			||||||
 | 
					          globalThis.TcpClient.onError()
 | 
				
			||||||
          await globalThis.TcpClient.onMessage((val)=>{
 | 
					          await globalThis.TcpClient.onMessage((val)=>{
 | 
				
			||||||
            hilog.info(0x0000, 'testTag', "valvalval1" + JSON.stringify(val));
 | 
					            hilog.info(0x0000, 'testTag', "valvalval1" + JSON.stringify(val));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // console.log('valvalval',val)
 | 
					            // console.log('valvalval',val)
 | 
				
			||||||
            setTimeout(()=>{
 | 
					            setTimeout(()=>{
 | 
				
			||||||
              globalThis.TcpClient.sendMsg(globalThis.carInfo?.carNo||'402')//1002
 | 
					              globalThis.TcpClient.sendMsg('1002')//1002
 | 
				
			||||||
              if(val&&globalThis.udpClient&&globalThis.udpClient.sendMsg){
 | 
					              if(val){
 | 
				
			||||||
                // const msg=val.substring(5,val.length-1)
 | 
					 | 
				
			||||||
                globalThis.udpClient?.sendMsg(val)
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
            },1000)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          })
 | 
					 | 
				
			||||||
          globalThis.TcpClient.onError(async()=>{
 | 
					 | 
				
			||||||
            await globalThis.TcpClient.rebindTcp(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
 | 
					 | 
				
			||||||
            await globalThis.TcpClient.connectTcp()
 | 
					 | 
				
			||||||
            await globalThis.TcpClient.sendMsg(globalThis.carInfo?.carNo||'402')//1002
 | 
					 | 
				
			||||||
            await globalThis.TcpClient.onMessage((val)=>{
 | 
					 | 
				
			||||||
              hilog.info(0x0000, 'testTag', "valvalval1" + JSON.stringify(val));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
              // console.log('valvalval',val)
 | 
					 | 
				
			||||||
              setTimeout(()=>{
 | 
					 | 
				
			||||||
                globalThis.TcpClient.sendMsg(globalThis.carInfo?.carNo||'402')//1002
 | 
					 | 
				
			||||||
                if(val&&globalThis.udpClient&&globalThis.udpClient.sendMsg){
 | 
					 | 
				
			||||||
                // const msg=val.substring(5,val.length-1)
 | 
					                // const msg=val.substring(5,val.length-1)
 | 
				
			||||||
                globalThis.udpClient?.sendMsg(val)
 | 
					                globalThis.udpClient?.sendMsg(val)
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
@ -49,10 +30,7 @@ export async function getTCP(flag=false) {
 | 
				
			|||||||
          })
 | 
					          })
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        })
 | 
					      }else{
 | 
				
			||||||
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      else{
 | 
					 | 
				
			||||||
        // prompt.showToast({
 | 
					        // prompt.showToast({
 | 
				
			||||||
        //   message:'初始化localIp'+ result[0].localIp+ result[0].localIpPort+'oppositeIp'+result[0].oppositeIp+result[0].oppositeIpPort,
 | 
					        //   message:'初始化localIp'+ result[0].localIp+ result[0].localIpPort+'oppositeIp'+result[0].oppositeIp+result[0].oppositeIpPort,
 | 
				
			||||||
        //   duration: 1000
 | 
					        //   duration: 1000
 | 
				
			||||||
@ -61,39 +39,23 @@ export async function getTCP(flag=false) {
 | 
				
			|||||||
        globalThis.TcpClient = tcpClient
 | 
					        globalThis.TcpClient = tcpClient
 | 
				
			||||||
        await globalThis.TcpClient.bindTcp()
 | 
					        await globalThis.TcpClient.bindTcp()
 | 
				
			||||||
        await globalThis.TcpClient.connectTcp()
 | 
					        await globalThis.TcpClient.connectTcp()
 | 
				
			||||||
        await globalThis.TcpClient.sendMsg(globalThis.carInfo?.carNo||'402')//1002
 | 
					        await globalThis.TcpClient.sendMsg('1002')//1002
 | 
				
			||||||
 | 
					        // setInterval(()=>{
 | 
				
			||||||
 | 
					        //   globalThis.TcpClient.sendMsg('1002')//1002
 | 
				
			||||||
 | 
					        //
 | 
				
			||||||
 | 
					        // },2000)
 | 
				
			||||||
 | 
					        globalThis.TcpClient.onError()
 | 
				
			||||||
        await globalThis.TcpClient.onMessage((val)=>{
 | 
					        await globalThis.TcpClient.onMessage((val)=>{
 | 
				
			||||||
          hilog.info(0x0000, 'testTag', "valvalval2" + JSON.stringify(val));
 | 
					          hilog.info(0x0000, 'testTag', "valvalval2" + JSON.stringify(val));
 | 
				
			||||||
          setTimeout(()=>{
 | 
					          setTimeout(()=>{
 | 
				
			||||||
            globalThis.TcpClient.sendMsg(globalThis.carInfo?.carNo||'402')//1002
 | 
					            globalThis.TcpClient.sendMsg('1002')//1002
 | 
				
			||||||
            if(val&&globalThis.udpClient&&globalThis.udpClient.sendMsg){
 | 
					            if(val){
 | 
				
			||||||
              // const msg=val.substring(5,val.length-1)
 | 
					              // const msg=val.substring(5,val.length-1)
 | 
				
			||||||
              globalThis.udpClient?.sendMsg(val)
 | 
					              globalThis.udpClient?.sendMsg(val)
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          },1000)
 | 
					          },1000)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
        globalThis.TcpClient.onError(async()=>{
 | 
					 | 
				
			||||||
          const tcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
 | 
					 | 
				
			||||||
          globalThis.TcpClient = tcpClient
 | 
					 | 
				
			||||||
          await globalThis.TcpClient.bindTcp()
 | 
					 | 
				
			||||||
          await globalThis.TcpClient.connectTcp()
 | 
					 | 
				
			||||||
          await globalThis.TcpClient.sendMsg(globalThis.carInfo?.carNo||'402')//1002
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          await globalThis.TcpClient.onMessage((val)=>{
 | 
					 | 
				
			||||||
            hilog.info(0x0000, 'testTag', "valvalval2" + JSON.stringify(val));
 | 
					 | 
				
			||||||
            setTimeout(()=>{
 | 
					 | 
				
			||||||
              globalThis.TcpClient.sendMsg(globalThis.carInfo?.carNo||'402')//1002
 | 
					 | 
				
			||||||
              if(val&&globalThis.udpClient&&globalThis.udpClient.sendMsg){
 | 
					 | 
				
			||||||
                // const msg=val.substring(5,val.length-1)
 | 
					 | 
				
			||||||
                globalThis.udpClient?.sendMsg(val)
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
            },1000)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          })
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      // globalThis.udpClient = new UdpClient(result[0].localIp, result[0].localIpPort,result[0].oppositeIp,result[0].oppositeIpPort)
 | 
					      // globalThis.udpClient = new UdpClient(result[0].localIp, result[0].localIpPort,result[0].oppositeIp,result[0].oppositeIpPort)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -8,19 +8,14 @@ import {string2Bytes} from '../../common/utils/tools'
 | 
				
			|||||||
export async function sendMsg(val){
 | 
					export async function sendMsg(val){
 | 
				
			||||||
  // globalThis.udpClient1&&globalThis.udpClient1.sendMsg(val)
 | 
					  // globalThis.udpClient1&&globalThis.udpClient1.sendMsg(val)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
export async function getUDP(flag:Boolean=false) {
 | 
					export async function getUDP() {
 | 
				
			||||||
  getSyncData('IpConfigTable').then((result:Array<any>)=>{
 | 
					  getSyncData('IpConfigTable').then((result:Array<any>)=>{
 | 
				
			||||||
    if(result.length){
 | 
					    if(result.length){
 | 
				
			||||||
      if(!flag){
 | 
					 | 
				
			||||||
        return
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      if(globalThis.udpClient&&globalThis.udpClient.closeUdp){
 | 
					      if(globalThis.udpClient&&globalThis.udpClient.closeUdp){
 | 
				
			||||||
        globalThis.udpClient.closeUdp(()=>{
 | 
					        globalThis.udpClient.closeUdp(()=>{
 | 
				
			||||||
          globalThis.udpClient.rebindUdp(result[0].udplocalIp, result[0].udplocalIpPort,result[0].udpOppositeIp,result[0].udpOppositeIpPort)
 | 
					          globalThis.udpClient.rebindUdp(result[0].udplocalIp, result[0].udplocalIpPort,result[0].udpOppositeIp,result[0].udpOppositeIpPort)
 | 
				
			||||||
          globalThis.udpClient.sendMsg('111')
 | 
					          globalThis.udpClient.sendMsg('111')
 | 
				
			||||||
          globalThis.host=`http://${result[0].centerIp}:${result[0].centerPort}`
 | 
					          globalThis.host=`http://${result[0].centerIp}:${result[0].centerPort}`
 | 
				
			||||||
          globalThis.udpClient.onError(globalThis.udpClient.onMessage?globalThis.udpClient.onMessage:()=>{})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
      }else{
 | 
					      }else{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -29,8 +24,6 @@ export async function getUDP(flag:Boolean=false) {
 | 
				
			|||||||
        udpClient.sendMsg('111')
 | 
					        udpClient.sendMsg('111')
 | 
				
			||||||
        globalThis.udpClient = udpClient
 | 
					        globalThis.udpClient = udpClient
 | 
				
			||||||
        globalThis.host=`http://${result[0].centerIp}:${result[0].centerPort}`
 | 
					        globalThis.host=`http://${result[0].centerIp}:${result[0].centerPort}`
 | 
				
			||||||
        globalThis.udpClient.onError(globalThis.udpClient.onMessage?globalThis.udpClient.onMessage:()=>{})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }else{
 | 
					    }else{
 | 
				
			||||||
@ -41,18 +34,14 @@ export async function getUDP(flag:Boolean=false) {
 | 
				
			|||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export async function getUDP2(flag:Boolean=false) {
 | 
					export async function getUDP2() {
 | 
				
			||||||
  getSyncData('IpConfigTable').then(async (result:Array<any>)=>{
 | 
					  getSyncData('IpConfigTable').then(async (result:Array<any>)=>{
 | 
				
			||||||
    if(result.length){
 | 
					    if(result.length){
 | 
				
			||||||
      if(globalThis.udpClient2&&globalThis.udpClient2.closeUdp){
 | 
					      if(globalThis.udpClient2&&globalThis.udpClient2.closeUdp){
 | 
				
			||||||
        if(!flag){
 | 
					 | 
				
			||||||
          return
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        globalThis.udpClient2.closeUdp(async ()=>{
 | 
					        globalThis.udpClient2.closeUdp(async ()=>{
 | 
				
			||||||
          globalThis.udpClient2.rebindUdp(result[0].udplocalIp, '8800',globalThis.carInfo?.udpAddress,globalThis.carInfo?.messagePort)
 | 
					          globalThis.udpClient2.rebindUdp(result[0].udplocalIp, '8800',globalThis.carInfo?.udpAddress,globalThis.carInfo?.messagePort)
 | 
				
			||||||
          globalThis.udpClient2.onMessage((val)=>{
 | 
					          globalThis.udpClient2.onMessage((val)=>{
 | 
				
			||||||
          })
 | 
					          })
 | 
				
			||||||
          globalThis.udpClient2.onError()
 | 
					 | 
				
			||||||
          globalThis.udpClient2.setMsgCallBack=()=>{}
 | 
					          globalThis.udpClient2.setMsgCallBack=()=>{}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
@ -60,7 +49,6 @@ export async function getUDP2(flag:Boolean=false) {
 | 
				
			|||||||
        const udpClient: UdpClientByCenter =new UdpClientByCenter(result[0].udplocalIp, '8800',globalThis.carInfo?.udpAddress,globalThis.carInfo?.messagePort)
 | 
					        const udpClient: UdpClientByCenter =new UdpClientByCenter(result[0].udplocalIp, '8800',globalThis.carInfo?.udpAddress,globalThis.carInfo?.messagePort)
 | 
				
			||||||
        globalThis.udpClient2 = udpClient
 | 
					        globalThis.udpClient2 = udpClient
 | 
				
			||||||
        globalThis.udpClient2.bindUdp()
 | 
					        globalThis.udpClient2.bindUdp()
 | 
				
			||||||
        globalThis.udpClient2.onError()
 | 
					 | 
				
			||||||
        globalThis.udpClient2.onMessage((val)=>{
 | 
					        globalThis.udpClient2.onMessage((val)=>{
 | 
				
			||||||
          if(val.id=='32'){
 | 
					          if(val.id=='32'){
 | 
				
			||||||
            globalThis.signNum=val.body[1]
 | 
					            globalThis.signNum=val.body[1]
 | 
				
			||||||
 | 
				
			|||||||
@ -24,7 +24,8 @@ export default class TcpClient {
 | 
				
			|||||||
    onError(callback?){
 | 
					    onError(callback?){
 | 
				
			||||||
        this.tcp.on('error', err => {
 | 
					        this.tcp.on('error', err => {
 | 
				
			||||||
            hilog.info(0x0000, 'testTag', "on error, err:" + JSON.stringify(err));
 | 
					            hilog.info(0x0000, 'testTag', "on error, err:" + JSON.stringify(err));
 | 
				
			||||||
            callback()
 | 
					            this.bindTcp()
 | 
				
			||||||
 | 
					            this.connectTcp()
 | 
				
			||||||
            // this.closeUdp(()=>{
 | 
					            // this.closeUdp(()=>{
 | 
				
			||||||
            //   this.bindUdp()
 | 
					            //   this.bindUdp()
 | 
				
			||||||
            // })
 | 
					            // })
 | 
				
			||||||
@ -55,17 +56,13 @@ export default class TcpClient {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    bindTcp() {
 | 
					    bindTcp() {
 | 
				
			||||||
        console.log('tcpoppositeIp',this.oppositeIp,'localIp',this.localIp)
 | 
					 | 
				
			||||||
        return new Promise((resolve,reject)=>{
 | 
					        return new Promise((resolve,reject)=>{
 | 
				
			||||||
            let promise=this.tcp.bind({ address:  this.localIp, port:parseInt(this.localIpPort), family: 1 }, err => {
 | 
					            let promise=this.tcp.bind({ address:  this.localIp, port:parseInt(this.localIpPort), family: 1 }, err => {
 | 
				
			||||||
                if (err) {
 | 
					                if (err) {
 | 
				
			||||||
                    console.log('testTag tcp bind faile');
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    hilog.info(0x0000, 'testTag', "tcpBinderror:" + JSON.stringify(err));
 | 
					                    hilog.info(0x0000, 'testTag', "tcpBinderror:" + JSON.stringify(err));
 | 
				
			||||||
                    resolve(true)
 | 
					                    resolve(true)
 | 
				
			||||||
                    return
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                console.log('testTag tcp bind success');
 | 
					                console.log('bind success');
 | 
				
			||||||
                resolve(false)
 | 
					                resolve(false)
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
@ -80,13 +77,10 @@ export default class TcpClient {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    connectTcp(){
 | 
					    connectTcp(){
 | 
				
			||||||
        console.log('testTagtcpoppositeIp',this.oppositeIp,'localIp',this.localIp)
 | 
					 | 
				
			||||||
        console.log('22323')
 | 
					        console.log('22323')
 | 
				
			||||||
        return new Promise((resolve,reject)=>{
 | 
					        return new Promise((resolve,reject)=>{
 | 
				
			||||||
            let promise = this.tcp.connect({ address: {address: this.oppositeIp, port:  parseInt(this.oppositeIpPort), family: 1} , timeout: 6000});
 | 
					            let promise = this.tcp.connect({ address: {address: this.oppositeIp, port:  parseInt(this.oppositeIpPort), family: 1} , timeout: 6000});
 | 
				
			||||||
            promise.then(() => {
 | 
					            promise.then(() => {
 | 
				
			||||||
                console.log('testTagbindSuccess')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                this.tcp.setExtraOptions({
 | 
					                this.tcp.setExtraOptions({
 | 
				
			||||||
                    keepAlive: true,
 | 
					                    keepAlive: true,
 | 
				
			||||||
                    // OOBInline: true,
 | 
					                    // OOBInline: true,
 | 
				
			||||||
@ -103,15 +97,13 @@ export default class TcpClient {
 | 
				
			|||||||
                });
 | 
					                });
 | 
				
			||||||
                resolve(true)
 | 
					                resolve(true)
 | 
				
			||||||
            }).catch(err => {
 | 
					            }).catch(err => {
 | 
				
			||||||
                console.log('testTagconnect,error')
 | 
					 | 
				
			||||||
                resolve(false)
 | 
					                resolve(false)
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    sendMsg(msg: string) {
 | 
					    sendMsg(msg: string) {console.log('oppositeIp',this.oppositeIp)
 | 
				
			||||||
        console.log('oppositeIp',this.oppositeIp)
 | 
					 | 
				
			||||||
        return new Promise((reslove,reject)=>{
 | 
					        return new Promise((reslove,reject)=>{
 | 
				
			||||||
            let promise = this.tcp.send({
 | 
					            let promise = this.tcp.send({
 | 
				
			||||||
                data:msg
 | 
					                data:msg
 | 
				
			||||||
@ -143,19 +135,19 @@ export default class TcpClient {
 | 
				
			|||||||
        // });
 | 
					        // });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    onMessage(callback?) {
 | 
					    onMessage(callback) {
 | 
				
			||||||
        this.tcp.on('message', value => {
 | 
					        this.tcp.on('message', value => {
 | 
				
			||||||
            // console.log('messageLengt',,value.message.length))
 | 
					            // console.log('messageLengt',,value.message.length))
 | 
				
			||||||
            console.log('tcpmsg')
 | 
					
 | 
				
			||||||
            // console.log("on message, message:" + value.message+ ", remoteInfo:" )
 | 
					            // console.log("on message, message:" + value.message+ ", remoteInfo:" )
 | 
				
			||||||
            if (value) {
 | 
					            if (value) {
 | 
				
			||||||
                let dataView = new DataView(value.message)
 | 
					                let dataView = new DataView(value.message)
 | 
				
			||||||
                // const Arraybuffer=buffer.from(value.message, 5, dataView?.byteLength);
 | 
					                // const Arraybuffer=buffer.from(value.message, 5, dataView?.byteLength);
 | 
				
			||||||
                const Arraybuffer=value.message.slice(5, dataView?.byteLength);
 | 
					                const Arraybuffer=value.message.slice(5, dataView?.byteLength);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                callback&&callback(Arraybuffer)
 | 
					                callback(Arraybuffer)
 | 
				
			||||||
            }else{
 | 
					            }else{
 | 
				
			||||||
                callback&&callback('')
 | 
					                callback('')
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            // callback(value.message)
 | 
					            // callback(value.message)
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
				
			|||||||
@ -64,9 +64,9 @@ export default class UdpClient {
 | 
				
			|||||||
    hilog.info(0x0000, 'udpCLient', 'bind'+ this.localIp+this.localIpPort);
 | 
					    hilog.info(0x0000, 'udpCLient', 'bind'+ this.localIp+this.localIpPort);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let promise = this.udp.bind({
 | 
					    let promise = this.udp.bind({
 | 
				
			||||||
      address: '192.168.7.170', port: 20122, family: 1
 | 
					      // address: '192.168.7.170', port: 20122, family: 1
 | 
				
			||||||
      // address: '192.168.7.170', port: 31013, family: 1
 | 
					      // address: '192.168.7.170', port: 31013, family: 1
 | 
				
			||||||
      // address: this.localIp, port: parseInt(this.localIpPort), family: 1
 | 
					      address: this.localIp, port: parseInt(this.localIpPort), family: 1
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    promise.then(() => {
 | 
					    promise.then(() => {
 | 
				
			||||||
      console.log(`${TAG}udpCLient udp bind success`);
 | 
					      console.log(`${TAG}udpCLient udp bind success`);
 | 
				
			||||||
@ -78,20 +78,19 @@ export default class UdpClient {
 | 
				
			|||||||
  setMsgCallBack(callback){
 | 
					  setMsgCallBack(callback){
 | 
				
			||||||
    // this.stashFn=callback?callback:()=>{}
 | 
					    // this.stashFn=callback?callback:()=>{}
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  sendMsg(msg) {
 | 
					  sendMsg(msg: string) {
 | 
				
			||||||
    console.log('sendsnd01')
 | 
					    console.log('sendsnd01')
 | 
				
			||||||
    hilog.info(0x0000, 'udpCLient', 'send');
 | 
					    hilog.info(0x0000, 'udpCLient', 'send');
 | 
				
			||||||
    console.log('udpdiushisend')
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let promise = this.udp.send({
 | 
					    let promise = this.udp.send({
 | 
				
			||||||
      data: msg,
 | 
					      data: msg,
 | 
				
			||||||
      address: {
 | 
					      address: {
 | 
				
			||||||
        // address: '192.168.7.124',
 | 
					        // address: '192.168.7.124',
 | 
				
			||||||
        // port: 30013,
 | 
					        // port: 30013,
 | 
				
			||||||
        address: '192.168.7.124',
 | 
					        // address: '192.168.7.124',
 | 
				
			||||||
        port: 20022,
 | 
					        // port: 20022,
 | 
				
			||||||
        // address: this.oppositeIp,
 | 
					        address: this.oppositeIp,
 | 
				
			||||||
        // port: parseInt(this.oppositeIpPort),
 | 
					        port: parseInt(this.oppositeIpPort),
 | 
				
			||||||
        family: 1
 | 
					        family: 1
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
@ -102,25 +101,18 @@ export default class UdpClient {
 | 
				
			|||||||
    });
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  onError(callback?){
 | 
					  onError(callback?){
 | 
				
			||||||
   this.udp.on('error',async err => {
 | 
					   this.udp.on('error', err => {
 | 
				
			||||||
     console.log('udpdiushierroring')
 | 
					     hilog.info(0x0000, 'udpCLient', 'error'+ JSON.stringify(err));
 | 
				
			||||||
     hilog.info(0x0000, 'udpCLientonerror', 'error'+ JSON.stringify(err));
 | 
					 | 
				
			||||||
     console.log("on error, err:" + JSON.stringify(err))
 | 
					     console.log("on error, err:" + JSON.stringify(err))
 | 
				
			||||||
     await this.bindUdp()
 | 
					 | 
				
			||||||
     await this.sendMsg('111')
 | 
					 | 
				
			||||||
     await this.onMessage(callback)
 | 
					 | 
				
			||||||
     // callback&&callback()
 | 
					 | 
				
			||||||
     // this.closeUdp(()=>{
 | 
					     // this.closeUdp(()=>{
 | 
				
			||||||
     //   this.bindUdp()
 | 
					     //   this.bindUdp()
 | 
				
			||||||
     // })
 | 
					     // })
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  onMessage(callback?) {
 | 
					  onMessage(callback) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    this.udp.on('message', value => {
 | 
					    this.udp.on('message', value => {
 | 
				
			||||||
      console.log('udpdiushimsg')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      // 收到的是ArrayBuffer 需要进行转换解析
 | 
					      // 收到的是ArrayBuffer 需要进行转换解析
 | 
				
			||||||
      hilog.info(0x0000, 'udpCLient', 'onmessage');
 | 
					      hilog.info(0x0000, 'udpCLient', 'onmessage');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -142,16 +134,15 @@ export default class UdpClient {
 | 
				
			|||||||
        if (strachArr[0] != '#DN_GD') {
 | 
					        if (strachArr[0] != '#DN_GD') {
 | 
				
			||||||
          return
 | 
					          return
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        console.log(`${TAG} udp222 on message array buffer:${str}`);
 | 
					        strachArr[28]=globalThis.chuankoMsg
 | 
				
			||||||
 | 
					 | 
				
			||||||
        strachArr[28]=globalThis.chuankoMsg||'0'
 | 
					 | 
				
			||||||
        // this.stashFn(str)
 | 
					        // this.stashFn(str)
 | 
				
			||||||
        const newArr=JSON.parse(JSON.stringify(strachArr))
 | 
					        const newArr=JSON.parse(JSON.stringify(strachArr))
 | 
				
			||||||
 | 
					        console.log('22222',strachArr[28],newArr)
 | 
				
			||||||
        // this.stashFn=()=>{}
 | 
					        // this.stashFn=()=>{}
 | 
				
			||||||
        callback&&callback(newArr.toString())
 | 
					        callback(newArr.toString())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        callback&&callback('')
 | 
					        callback('')
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      console.log('messageTimeEnd')
 | 
					      console.log('messageTimeEnd')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -68,6 +68,7 @@ export default class UdpClientByCenter {
 | 
				
			|||||||
        });
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    initHeartSendMsg(param,context){
 | 
					    initHeartSendMsg(param,context){
 | 
				
			||||||
 | 
					        console.log('1111param',JSON.stringify(param))
 | 
				
			||||||
        this.initParam=param
 | 
					        this.initParam=param
 | 
				
			||||||
        this.context=context
 | 
					        this.context=context
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -198,16 +199,7 @@ export default class UdpClientByCenter {
 | 
				
			|||||||
            callback({id,length,body:list,sendId:this.sendId})
 | 
					            callback({id,length,body:list,sendId:this.sendId})
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    onError(callback?){
 | 
					
 | 
				
			||||||
        this.udp.on('error', err => {
 | 
					 | 
				
			||||||
            console.log('udpbycenterdiushierroring')
 | 
					 | 
				
			||||||
            hilog.info(0x0000, 'udpCLientBycenteronerror', 'error'+ JSON.stringify(err));
 | 
					 | 
				
			||||||
            console.log("on error, err:" + JSON.stringify(err))
 | 
					 | 
				
			||||||
            // this.closeUdp(()=>{
 | 
					 | 
				
			||||||
            //   this.bindUdp()
 | 
					 | 
				
			||||||
            // })
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    closeUdp(callback) {
 | 
					    closeUdp(callback) {
 | 
				
			||||||
        this.udp.close(err=>{
 | 
					        this.udp.close(err=>{
 | 
				
			||||||
            if(err){
 | 
					            if(err){
 | 
				
			||||||
 | 
				
			|||||||
@ -226,8 +226,6 @@ struct Index {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  openChuankouFn() {
 | 
					  openChuankouFn() {
 | 
				
			||||||
    console.log('SerialOpen in carcheck, path=' + this.devPath)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    this.fd = testNapi.SerialOpen(this.devPath);
 | 
					    this.fd = testNapi.SerialOpen(this.devPath);
 | 
				
			||||||
    let parity = 0x4e; // 'N'
 | 
					    let parity = 0x4e; // 'N'
 | 
				
			||||||
    let ret = testNapi.SerialSet(this.fd, 115200, 0, 8, 1, parity);
 | 
					    let ret = testNapi.SerialSet(this.fd, 115200, 0, 8, 1, parity);
 | 
				
			||||||
 | 
				
			|||||||
@ -249,7 +249,7 @@ struct Index {
 | 
				
			|||||||
      getliushuiNum()
 | 
					      getliushuiNum()
 | 
				
			||||||
      this.heartMsg()
 | 
					      this.heartMsg()
 | 
				
			||||||
    }, 1000)
 | 
					    }, 1000)
 | 
				
			||||||
    // takePhotoFn(this.context)
 | 
					    takePhotoFn(this.context)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
    getTCP()
 | 
					    getTCP()
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,3 @@
 | 
				
			|||||||
 | 
					 | 
				
			||||||
import router from '@ohos.router'
 | 
					import router from '@ohos.router'
 | 
				
			||||||
import TopLogo from './compontents/topLogo'
 | 
					import TopLogo from './compontents/topLogo'
 | 
				
			||||||
import ethernet from '@ohos.net.ethernet';
 | 
					import ethernet from '@ohos.net.ethernet';
 | 
				
			||||||
@ -7,8 +6,6 @@ import { upDateTableByArray} from '../common/service/initable'
 | 
				
			|||||||
import { getSyncData} from '../common/service/initable'
 | 
					import { getSyncData} from '../common/service/initable'
 | 
				
			||||||
import { voiceService } from '../common/service/voiceService'
 | 
					import { voiceService } from '../common/service/voiceService'
 | 
				
			||||||
import { GlobalConfig } from '../config/index'
 | 
					import { GlobalConfig } from '../config/index'
 | 
				
			||||||
import { getUDP, getUDP2 } from '../common/utils/GlobleUdp';
 | 
					 | 
				
			||||||
import { getTCP } from '../common/utils/GlobleTcp';
 | 
					 | 
				
			||||||
@Entry
 | 
					@Entry
 | 
				
			||||||
@Component
 | 
					@Component
 | 
				
			||||||
struct Index {
 | 
					struct Index {
 | 
				
			||||||
@ -105,9 +102,6 @@ struct Index {
 | 
				
			|||||||
                });
 | 
					                });
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            getUDP(true)
 | 
					 | 
				
			||||||
            getUDP2(true)
 | 
					 | 
				
			||||||
            getTCP(true)
 | 
					 | 
				
			||||||
          })
 | 
					          })
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        .backgroundColor('#CCC4B8')
 | 
					        .backgroundColor('#CCC4B8')
 | 
				
			||||||
 | 
				
			|||||||
@ -172,6 +172,7 @@ struct Index {
 | 
				
			|||||||
              for (let i = 1; i <= 4; i++) {
 | 
					              for (let i = 1; i <= 4; i++) {
 | 
				
			||||||
                console.log('rocord_handle',i,JSON.stringify(this.rocordHandleObj))
 | 
					                console.log('rocord_handle',i,JSON.stringify(this.rocordHandleObj))
 | 
				
			||||||
                if (this.rocordHandleObj['rocord_handle'+i]) {
 | 
					                if (this.rocordHandleObj['rocord_handle'+i]) {
 | 
				
			||||||
 | 
					                  console.log('ttttt',i)
 | 
				
			||||||
                  endRecordVideo(this.rocordHandleObj['rocord_handle'+i])
 | 
					                  endRecordVideo(this.rocordHandleObj['rocord_handle'+i])
 | 
				
			||||||
                  this.rocordHandleObj['rocord_handle'+i] = 0
 | 
					                  this.rocordHandleObj['rocord_handle'+i] = 0
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
				
			|||||||
@ -3,6 +3,7 @@ import UdpClient from '../../common/utils/UdpClient';
 | 
				
			|||||||
import FileLog from '../judgeSDK/utils/file-log'
 | 
					import FileLog from '../judgeSDK/utils/file-log'
 | 
				
			||||||
import { voiceService } from '../../common/service/voiceService'
 | 
					import { voiceService } from '../../common/service/voiceService'
 | 
				
			||||||
import prompt from '@ohos.prompt'
 | 
					import prompt from '@ohos.prompt'
 | 
				
			||||||
 | 
					import SerialPortClient from '../../common/utils/SerialPortClient'
 | 
				
			||||||
import RealTime from '../compontents/judge/real-time'
 | 
					import RealTime from '../compontents/judge/real-time'
 | 
				
			||||||
@Component
 | 
					@Component
 | 
				
			||||||
struct SignDisplayCom {
 | 
					struct SignDisplayCom {
 | 
				
			||||||
@ -396,7 +397,20 @@ struct SignDisplayCom {
 | 
				
			|||||||
    const that = this
 | 
					    const that = this
 | 
				
			||||||
    const {showBack,getSignal} = this
 | 
					    const {showBack,getSignal} = this
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const serialPortClient = new SerialPortClient()
 | 
				
			||||||
 | 
					    serialPortClient.openSerial()
 | 
				
			||||||
 | 
					    serialPortClient.SerialSet()
 | 
				
			||||||
 | 
					    this.interval=setInterval(() => {
 | 
				
			||||||
 | 
					      serialPortClient.SerialSend()
 | 
				
			||||||
 | 
					      const data = serialPortClient.SerialRecv()
 | 
				
			||||||
 | 
					      // if (data?.recevedLen) {
 | 
				
			||||||
 | 
					      //   const msg = data.msg.split(',')
 | 
				
			||||||
 | 
					      //   if (msg[0] != '98' || msg[1] != '85' || msg.length < 9) {
 | 
				
			||||||
 | 
					      //     return
 | 
				
			||||||
 | 
					      //   }
 | 
				
			||||||
 | 
					      //   this.sjxhColum[18].value = msg[9]
 | 
				
			||||||
 | 
					      // }
 | 
				
			||||||
 | 
					    }, 1000)
 | 
				
			||||||
    if(showBack){
 | 
					    if(showBack){
 | 
				
			||||||
      globalThis.udpClient.onMessage((msg) => {
 | 
					      globalThis.udpClient.onMessage((msg) => {
 | 
				
			||||||
        console.log('msgmsg',msg)
 | 
					        console.log('msgmsg',msg)
 | 
				
			||||||
@ -427,8 +441,21 @@ struct SignDisplayCom {
 | 
				
			|||||||
    //     }
 | 
					    //     }
 | 
				
			||||||
    //   }
 | 
					    //   }
 | 
				
			||||||
    // });
 | 
					    // });
 | 
				
			||||||
 | 
					    const serialPortClient = new SerialPortClient()
 | 
				
			||||||
 | 
					    serialPortClient.openSerial()
 | 
				
			||||||
 | 
					    serialPortClient.SerialSet()
 | 
				
			||||||
    const getSignal = this.getSignal;
 | 
					    const getSignal = this.getSignal;
 | 
				
			||||||
 | 
					    this.interval=setInterval(() => {
 | 
				
			||||||
 | 
					      serialPortClient.SerialSend()
 | 
				
			||||||
 | 
					      const data = serialPortClient.SerialRecv()
 | 
				
			||||||
 | 
					      // if (data.recevedLen) {
 | 
				
			||||||
 | 
					      //   const msg = data.msg.split(',')
 | 
				
			||||||
 | 
					      //   if (msg[0] != '98' || msg[1] != '85' || msg.length < 9) {
 | 
				
			||||||
 | 
					      //     return
 | 
				
			||||||
 | 
					      //   }
 | 
				
			||||||
 | 
					      //   this.sjxhColum[18].value = msg[9]
 | 
				
			||||||
 | 
					      // }
 | 
				
			||||||
 | 
					    }, 1000)
 | 
				
			||||||
    const that = this
 | 
					    const that = this
 | 
				
			||||||
    const showBack = this.showBack;
 | 
					    const showBack = this.showBack;
 | 
				
			||||||
    if(showBack){
 | 
					    if(showBack){
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user