小红球udp
This commit is contained in:
		
							parent
							
								
									6ef29e8144
								
							
						
					
					
						commit
						970221509c
					
				| @ -30,7 +30,7 @@ class JudgeUdpBusiness { | |||||||
|   private carInfo: CarInfoType = {} |   private carInfo: CarInfoType = {} | ||||||
|   private singlePlay: boolean = false |   private singlePlay: boolean = false | ||||||
|   private lsh: string = "" |   private lsh: string = "" | ||||||
|   private serialIndex: number = 0 |   private serialIndex: number = 1 | ||||||
| 
 | 
 | ||||||
|   constructor() { |   constructor() { | ||||||
|     if (!JudgeUdpBusiness.instance) { |     if (!JudgeUdpBusiness.instance) { | ||||||
| @ -39,7 +39,7 @@ class JudgeUdpBusiness { | |||||||
|     return JudgeUdpBusiness.instance |     return JudgeUdpBusiness.instance | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   async getMessageHeartbeat(msg: string): Promise<number[]> { |   async getMessageHeartbeat(msg: string, isEnd: boolean = false): Promise<number[]> { | ||||||
|     let gpsDigit = JudgeConfig.fourInOneScreen.gpsDigit |     let gpsDigit = JudgeConfig.fourInOneScreen.gpsDigit | ||||||
|     const asclshArr = StringToASCII(FillZero( |     const asclshArr = StringToASCII(FillZero( | ||||||
|       this.singlePlay |       this.singlePlay | ||||||
| @ -77,7 +77,7 @@ class JudgeUdpBusiness { | |||||||
|       //科目类型(0:未考试 1:科目二 2:科目三) + 考试开始时间 |       //科目类型(0:未考试 1:科目二 2:科目三) + 考试开始时间 | ||||||
|       NumberToByteArray(`${0}${'00:00:000'}`, 4 * 8), |       NumberToByteArray(`${0}${'00:00:000'}`, 4 * 8), | ||||||
|       // 消息序号 |       // 消息序号 | ||||||
|       NumberToByteArray(this.serialIndex, 2 * 8), |       NumberToByteArray(isEnd ? 0 : this.serialIndex, 2 * 8), | ||||||
|       translateSignals, |       translateSignals, | ||||||
|       NumberToByteArray(tempSd * 100, 2 * 8), |       NumberToByteArray(tempSd * 100, 2 * 8), | ||||||
|       NumberToByteArray(plcData.sensor.fdjzs / 100, 8), |       NumberToByteArray(plcData.sensor.fdjzs / 100, 8), | ||||||
| @ -128,7 +128,11 @@ class JudgeUdpBusiness { | |||||||
|       result = result.concat(itemArr) |       result = result.concat(itemArr) | ||||||
|     }) |     }) | ||||||
|     // AppStorage.setOrCreate("serialIndex", 0) |     // AppStorage.setOrCreate("serialIndex", 0) | ||||||
|     this.serialIndex = 0 |     if (isEnd) { | ||||||
|  |       this.serialIndex = 1 | ||||||
|  |     } else { | ||||||
|  |       this.serialIndex += 1 | ||||||
|  |     } | ||||||
|     return [...new Uint8Array(result)] |     return [...new Uint8Array(result)] | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user