version: 0.0.8
This commit is contained in:
		
							parent
							
								
									52a8cec532
								
							
						
					
					
						commit
						9d95f11282
					
				| @ -184,6 +184,37 @@ export default class Judge { | ||||
|   private isExamEnd: boolean | ||||
|   // 是否发送udp | ||||
|   private isUdpEnd: boolean = false | ||||
|   // 处理udp plc信号 | ||||
|   handleUdp = async (msg: string) => { | ||||
|     const stachArr = msg.split(',') | ||||
|     if (stachArr[0] != '#DN_GD' || this.isUdpEnd) { | ||||
|       return | ||||
|     } | ||||
|     const plcData = await this.getPlcData(msg); | ||||
|     // 4.过程数据 | ||||
|     await this.fileLog?.setExamJudgeData(JSON.stringify(plcData)) | ||||
|     //检测到有无锡所设备接入,需要发送特定的数据,供检测 | ||||
|     // if (this.usbService.isWXUSBDevice) { | ||||
|     //   const str = await senorToWXDataStr(msg); | ||||
|     //   this.usbService.sendUSB(str) | ||||
|     // } | ||||
|     const param350: number = Reflect.get(this.judgeUI.judgeConfigObj, '350') | ||||
|     this.judgeUI.sd = ((param350 == 0 ? plcData.gps.sd : plcData.sensor.cs) as number * 1.852).toFixed(0) + '' | ||||
|     this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + '' | ||||
|     //TODO 暂时关闭差分检测异常 | ||||
|     // await this.checkDwzt(plcData.gps.dwzt,plcData.gps.jdzt); | ||||
|     if (!this.isExamEnd) { | ||||
|       await examJudgeRealExam(plcData) | ||||
|     } | ||||
|     // let udpIndex = AppStorage.get<number>('udpIndex') || 0; | ||||
|     // if (udpIndex % 5 === 0 && !this.isUdpEnd) { | ||||
|     // TODO UPD缺失 | ||||
|     // const judgeUdp = globalThis.judgeUdp | ||||
|     // const bytes = await this.getMessageHeartbeat(this.isExamEnd); | ||||
|     // judgeUdp.send(bytes) | ||||
|     // } | ||||
|     // AppStorage.setOrCreate('udpIndex', udpIndex++) | ||||
|   } | ||||
|   //是否手动结束考试 | ||||
|   private isManual: boolean = false | ||||
|   //UDP服务序列号 | ||||
| @ -278,37 +309,26 @@ export default class Judge { | ||||
|     AppStorage.setOrCreate('msgStr', plc) | ||||
|     return tempData | ||||
|   } | ||||
|   // 处理udp plc信号 | ||||
|   handleUdp = async (msg: string) => { | ||||
|     const stachArr = msg.split(',') | ||||
|     if (stachArr[0] != '#DN_GD' || this.isUdpEnd) { | ||||
|   private isEndTip: boolean = false; | ||||
|   //本地轨迹回放地址 | ||||
|   private trajectoryPath: string | ||||
|   // private currentKm2ItemsObj: any | ||||
|   private isTrajectoryOpen: boolean; | ||||
|   // 调代理接口是否断网了 | ||||
|   private isJudgeDisConnect: boolean = false; | ||||
|   // 断网数据补传 | ||||
|   uploadDisConnectData = async () => { | ||||
|     if (!this.isJudgeDisConnect) { | ||||
|       return | ||||
|     } | ||||
|     const plcData = await this.getPlcData(msg); | ||||
|     // 4.过程数据 | ||||
|     await this.fileLog?.setExamJudgeData(JSON.stringify(plcData)) | ||||
|     //检测到有无锡所设备接入,需要发送特定的数据,供检测 | ||||
|     // if (this.usbService.isWXUSBDevice) { | ||||
|     //   const str = await senorToWXDataStr(msg); | ||||
|     //   this.usbService.sendUSB(str) | ||||
|     // } | ||||
|     const param350: number = Reflect.get(this.judgeUI.judgeConfigObj, '350') | ||||
|     this.judgeUI.sd = ((param350 == 0 ? plcData.gps.sd : plcData.sensor.cs) as number * 1.852).toFixed(0) + '' | ||||
|     this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + '' | ||||
|     //TODO 暂时关闭差分检测异常 | ||||
|     // await this.checkDwzt(plcData.gps.dwzt,plcData.gps.jdzt); | ||||
|     if (!this.isExamEnd) { | ||||
|       await examJudgeRealExam(plcData) | ||||
|     const folderPath = this.fileLog?.folderPath | ||||
|     const examDataStr = await this.fileUtil.readFile(`${folderPath}/wuxi_dis_progress_data.txt`); | ||||
|     const examDataArr = examDataStr.split('\n'); | ||||
|     for (let examDataStr of examDataArr) { | ||||
|       const code = await writeObjectOut(JSON.parse(examDataStr), "", this.context); | ||||
|     } | ||||
|     // let udpIndex = AppStorage.get<number>('udpIndex') || 0; | ||||
|     // if (udpIndex % 5 === 0 && !this.isUdpEnd) { | ||||
|     // TODO UPD缺失 | ||||
|     // const judgeUdp = globalThis.judgeUdp | ||||
|     // const bytes = await this.getMessageHeartbeat(this.isExamEnd); | ||||
|     // judgeUdp.send(bytes) | ||||
|     // } | ||||
|     // AppStorage.setOrCreate('udpIndex', udpIndex++) | ||||
|   } | ||||
|   private artSubject3ProjectsCodesArr: number[] = [3, 9, 4, 10, 12, 11] | ||||
|   // 处理轨迹plc信号 | ||||
|   handleTrajectoryUdp = async (strArr: string[]) => { | ||||
|     let num = 2; | ||||
| @ -398,26 +418,6 @@ export default class Judge { | ||||
|       return true | ||||
|     } | ||||
|   } | ||||
|   private isEndTip: boolean = false; | ||||
|   //本地轨迹回放地址 | ||||
|   private trajectoryPath: string | ||||
|   // private currentKm2ItemsObj: any | ||||
|   private isTrajectoryOpen: boolean; | ||||
|   // 调代理接口是否断网了 | ||||
|   private isJudgeDisConnect: boolean = false; | ||||
|   // 断网数据补传 | ||||
|   uploadDisConnectData = async () => { | ||||
|     if (!this.isJudgeDisConnect) { | ||||
|       return | ||||
|     } | ||||
|     const folderPath = this.fileLog?.folderPath | ||||
|     const examDataStr = await this.fileUtil.readFile(`${folderPath}/wuxi_dis_progress_data.txt`); | ||||
|     const examDataArr = examDataStr.split('\n'); | ||||
|     for (let examDataStr of examDataArr) { | ||||
|       const code = await writeObjectOut(JSON.parse(examDataStr), "", this.context); | ||||
|     } | ||||
|   } | ||||
|   private artSubject3ProjectsCodesArr: number[] = [3, 9, 4, 10, 12, 11] | ||||
|   // 项目开始接口同步 | ||||
|   beginProject = async (ksxm: number) => { | ||||
|     const carInfo = AppStorage.get<CarInfoType>('carInfo'); | ||||
| @ -521,6 +521,9 @@ export default class Judge { | ||||
|     UploadRegulatoryCodeConversion('17C54', temp.code || 0) | ||||
|     dConsole.info(JudgeTag, '上传照片 end') | ||||
|   } | ||||
|   private lane: LANE = { | ||||
|     road: '', num: 0, count: 0 | ||||
|   } | ||||
|   private disConnectNum: number = 0; | ||||
|   //调用监管接口 | ||||
|   sendWriteObjectOut: SendWriteObjectOut = async (data, filePath) => { | ||||
| @ -543,9 +546,6 @@ export default class Judge { | ||||
|     this.disConnectNum = 0 | ||||
|     return temp | ||||
|   } | ||||
|   private lane: LANE = { | ||||
|     road: '', num: 0, count: 0 | ||||
|   } | ||||
|   // 校验考试是否结束 | ||||
|   checkExamIsEnd = async (isManual?: boolean) => { | ||||
|     dConsole.log(JudgeTag, "校验考试是否结束") | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user