Compare commits
	
		
			3 Commits
		
	
	
		
			main
			...
			main_suzho
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 39c5915344 | |||
| 34292f2fc9 | |||
| f4815003b0 | 
| @ -27,13 +27,13 @@ export async function getTCP(flag=false) { | |||||||
|           // await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
 |           // await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
 | ||||||
|           console.log('ttttttt00') |           console.log('ttttttt00') | ||||||
| 
 | 
 | ||||||
|           clearInterval(globalThis.intervalSendmsg) |           // clearInterval(globalThis.intervalSendmsg)
 | ||||||
|           globalThis.intervalSendmsg=setInterval(()=>{ |           // globalThis.intervalSendmsg=setInterval(()=>{
 | ||||||
|             console.log('getCloseTcp',globalThis.carInfo.carNo) |           //   console.log('getCloseTcp',globalThis.carInfo.carNo)
 | ||||||
|             if(!globalThis.getCloseTcp){ |           //   if(!globalThis.getCloseTcp){
 | ||||||
|               globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
 |           //     globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
 | ||||||
|             } |           //   }
 | ||||||
|           },1000/3) |           // },1000/3)
 | ||||||
|           globalThis.TcpClient.onError((val) => { |           globalThis.TcpClient.onError((val) => { | ||||||
|             setTimeout(() => { |             setTimeout(() => { | ||||||
|               getTCP() |               getTCP() | ||||||
| @ -62,13 +62,13 @@ export async function getTCP(flag=false) { | |||||||
|       await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
 |       await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
 | ||||||
|       console.log('ttttttt12') |       console.log('ttttttt12') | ||||||
| 
 | 
 | ||||||
|       clearInterval(globalThis.intervalSendmsg) |       // clearInterval(globalThis.intervalSendmsg)
 | ||||||
|       globalThis.intervalSendmsg=setInterval(()=>{ |       // globalThis.intervalSendmsg=setInterval(()=>{
 | ||||||
|         // console.log('getCloseTcp',globalThis.getCloseTcp)
 |       //   // console.log('getCloseTcp',globalThis.getCloseTcp)
 | ||||||
|         if(!globalThis.getCloseTcp){ |       //   if(!globalThis.getCloseTcp){
 | ||||||
|           globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
 |       //     globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
 | ||||||
|         } |       //   }
 | ||||||
|       },1000/3) |       // },1000/3)
 | ||||||
|       globalThis.TcpClient.onError((val) => { |       globalThis.TcpClient.onError((val) => { | ||||||
|         setTimeout(() => { |         setTimeout(() => { | ||||||
|           getTCP() |           getTCP() | ||||||
|  | |||||||
| @ -337,6 +337,9 @@ export default class UdpClientByCenter { | |||||||
|       //   PLC: JSON.stringify(newArr.toString()),
 |       //   PLC: JSON.stringify(newArr.toString()),
 | ||||||
|       // })
 |       // })
 | ||||||
|       if(strachArr[83]!='4'){ |       if(strachArr[83]!='4'){ | ||||||
|  |         if(!globalThis.getCloseTcp){ | ||||||
|  |           globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
 | ||||||
|  |         } | ||||||
|         console.log('差分状态异常',strachArr[83],strachArr[92]) |         console.log('差分状态异常',strachArr[83],strachArr[92]) | ||||||
|         this.writeLog({ |         this.writeLog({ | ||||||
|           time:dateFormat(new Date()), |           time:dateFormat(new Date()), | ||||||
|  | |||||||
| @ -5,6 +5,9 @@ import TopLogo from './compontents/TopLogo'; | |||||||
| import testNapi from '@ohos.hiserialsdk'; | import testNapi from '@ohos.hiserialsdk'; | ||||||
| import { dateFormat } from '../common/utils/tools'; | import { dateFormat } from '../common/utils/tools'; | ||||||
| import { DwMapData, PassData, RealNumData, StackValueData, WarnFlagData, WarnFlagTipData } from '../mock'; | import { DwMapData, PassData, RealNumData, StackValueData, WarnFlagData, WarnFlagTipData } from '../mock'; | ||||||
|  | import FileUtil from '../common/utils/File'; | ||||||
|  | import { GlobalConfig } from '../config'; | ||||||
|  | import common from '@ohos.app.ability.common'; | ||||||
| 
 | 
 | ||||||
| @Entry | @Entry | ||||||
| @Component | @Component | ||||||
| @ -37,6 +40,7 @@ export default struct Index { | |||||||
|   @State stopFlag: boolean = false |   @State stopFlag: boolean = false | ||||||
|   @State fromIndex: boolean = false |   @State fromIndex: boolean = false | ||||||
|   private vocObj = null; |   private vocObj = null; | ||||||
|  |   private context = getContext(this) as common.UIAbilityContext; | ||||||
| 
 | 
 | ||||||
|   // private AccountTable = new AccountTable(()=>{},CommonConstants); |   // private AccountTable = new AccountTable(()=>{},CommonConstants); | ||||||
|   aboutToAppear() { |   aboutToAppear() { | ||||||
| @ -114,26 +118,11 @@ export default struct Index { | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // |   // | ||||||
|   carConfigurationInfoFn() { |  async carConfigurationInfoFn() { | ||||||
|     // const fileUtil = new FileUtil(context) |     const fileUtil = new FileUtil(this.context) | ||||||
|     // const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/deviceNo.txt'); |     const checkListStr = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/carcheck.txt'); | ||||||
|     // if (data === '' || data === undefined) { | 
 | ||||||
|     //   promptAction.showToast({ |     if (globalThis.singlePlay&&(checkListStr === '' || checkListStr === undefined)) { | ||||||
|     //     message: `请先进行设备注册`, |  | ||||||
|     //     duration: 3000 |  | ||||||
|     //   }); |  | ||||||
|     //   globalThis.type='1' |  | ||||||
|     //   globalThis.title=decodeURIComponent('请先进行设备注册') |  | ||||||
|     //   globalThis.errorDialog.open() |  | ||||||
|     //   resolve('') |  | ||||||
|     // } else { |  | ||||||
|     //   const fileData=JSON.parse(data) |  | ||||||
|     //   globalThis.deviceNo = fileData.deviceName |  | ||||||
|     //   console.log('globalThis.deviceNo', globalThis.deviceNo) |  | ||||||
|     //   // getCarInfo() |  | ||||||
|     //   resolve(fileData.deviceName) |  | ||||||
|     // } |  | ||||||
|     if (globalThis.singlePlay) { |  | ||||||
|       const str = "1:5;2:5;3:5;4:5;5:5;6:5;7:5;8:5;9:5;10:5;11:5;12:5;13:5;14:5;15:5;16:5;17:5;18:5;19:5;20:5;21:5;22:2;23:5;24:5" |       const str = "1:5;2:5;3:5;4:5;5:5;6:5;7:5;8:5;9:5;10:5;11:5;12:5;13:5;14:5;15:5;16:5;17:5;18:5;19:5;20:5;21:5;22:2;23:5;24:5" | ||||||
|       const data = str.split(';') |       const data = str.split(';') | ||||||
|       this.checkList = [] |       this.checkList = [] | ||||||
| @ -146,6 +135,18 @@ export default struct Index { | |||||||
|       }) |       }) | ||||||
|       this.checkListCopy = JSON.parse(JSON.stringify(this.checkList)) |       this.checkListCopy = JSON.parse(JSON.stringify(this.checkList)) | ||||||
|       return |       return | ||||||
|  |     }else if(globalThis.singlePlay){ | ||||||
|  |       const data = checkListStr.split(';') | ||||||
|  |       this.checkList = [] | ||||||
|  |       const list = data | ||||||
|  |       list.map(res => { | ||||||
|  |         const arr = res.split(':') | ||||||
|  |         this.checkList.push({ | ||||||
|  |           'key': parseInt(arr[0]) + 2, 'time': arr[1] | ||||||
|  |         }) | ||||||
|  |       }) | ||||||
|  |       this.checkListCopy = JSON.parse(JSON.stringify(this.checkList)) | ||||||
|  |       return | ||||||
|     } |     } | ||||||
|     //模拟真实数据 |     //模拟真实数据 | ||||||
|     const param = { |     const param = { | ||||||
|  | |||||||
| @ -217,7 +217,15 @@ export default struct FaceCompare { | |||||||
|           }) |           }) | ||||||
| 
 | 
 | ||||||
|         } |         } | ||||||
|  |       }).catch(()=>{ | ||||||
|  |       console.log('Faceerror') | ||||||
|  |       this.times++; | ||||||
|  |       //3s后开始语音提示 | ||||||
|  |       this.vocObj.playAudio({ | ||||||
|  |         type: 1, | ||||||
|  |         name: 'face_fail.mp3' | ||||||
|       }) |       }) | ||||||
|  |     }) | ||||||
|     console.log('mmmmm8', 9) |     console.log('mmmmm8', 9) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -422,7 +422,8 @@ export default struct SignDisplayCom { | |||||||
|     const str2=this.signArr[93].substr(4.2) |     const str2=this.signArr[93].substr(4.2) | ||||||
|     this.signArr[93]=str2+str1+str0 |     this.signArr[93]=str2+str1+str0 | ||||||
|     this.GPSColum[10].value =  this.signArr[93] |     this.GPSColum[10].value =  this.signArr[93] | ||||||
| 
 |     const hours=Number(this.signArr[94].substr(0,2))+8 | ||||||
|  |     this.signArr[94]=(hours>9?hours:'0'+hours)+this.signArr[94].substr(2,this.signArr[94].length-2) | ||||||
|     // this.signArr[53]=192.168.7.170' |     // this.signArr[53]=192.168.7.170' | ||||||
|     this.sjxhColum = JSON.parse(JSON.stringify((this.sjxhColum))) |     this.sjxhColum = JSON.parse(JSON.stringify((this.sjxhColum))) | ||||||
|     that.signArr = JSON.parse(JSON.stringify((this.signArr))) |     that.signArr = JSON.parse(JSON.stringify((this.signArr))) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user