fix:过程数据方法补全部分
This commit is contained in:
		
							parent
							
								
									9696924932
								
							
						
					
					
						commit
						4832904345
					
				
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							| @ -1,2 +1,2 @@ | |||||||
| gitLog: | gitLog: | ||||||
| 	  git log --since="2025-06-30 17:14" --until="2025-07-2 17:35"  --pretty=format:"<details>%n    <summary>%s</summary>%n     <span style=\"color: #888;\">[提交人]:</span><span style=\"color: #333;\">%an</span><br>%n     <span style=\"color: #888;\">[提交时间]:</span><span style=\"color: #333;\">%ad</span><br>%n    <span style=\"color: #888;\">[提交版本]:</span><span style=\"color: #333;\">%h</span>%n</details>%n" --date=format:"%Y-%m-%d %H:%M" > release_note.md | 	  git log --since="2025-06-30 17:14" --until="2025-07-15 10:00"  --pretty=format:"<details>%n    <summary>%s</summary>%n     <span style=\"color: #888;\">[提交人]:</span><span style=\"color: #333;\">%an</span><br>%n     <span style=\"color: #888;\">[提交时间]:</span><span style=\"color: #333;\">%ad</span><br>%n    <span style=\"color: #888;\">[提交版本]:</span><span style=\"color: #333;\">%h</span>%n</details>%n" --date=format:"%Y-%m-%d %H:%M" > release_note.md | ||||||
| @ -44,8 +44,6 @@ export enum WorkerMessageType { | |||||||
|   Init = 'init', |   Init = 'init', | ||||||
|   // 初始化过程数据,初始化到人员以及人员里面各个目录 |   // 初始化过程数据,初始化到人员以及人员里面各个目录 | ||||||
|   ProcessDataInit = 'processDataInit', |   ProcessDataInit = 'processDataInit', | ||||||
|   //   打开过程数据文件 |  | ||||||
|   OpenProcessDataFile = 'openProcessDataFile', |  | ||||||
|   // 初始化考试过程 |   // 初始化考试过程 | ||||||
|   ExamProcessInit = 'examProcessInit' |   ExamProcessInit = 'examProcessInit' | ||||||
| } | } | ||||||
|  | |||||||
| @ -19,6 +19,7 @@ import Prompt from '@system.prompt'; | |||||||
| import { DifferentialAndSignal } from '../utils/business/DifferentialAndSignalWorker'; | import { DifferentialAndSignal } from '../utils/business/DifferentialAndSignalWorker'; | ||||||
| import { dConsole } from '../utils/LogWorker'; | import { dConsole } from '../utils/LogWorker'; | ||||||
| import CarLoadingComponent from './Index/Loading'; | import CarLoadingComponent from './Index/Loading'; | ||||||
|  | import { CreateFile } from '../utils/Common'; | ||||||
| 
 | 
 | ||||||
| @Entry | @Entry | ||||||
| @Component | @Component | ||||||
| @ -77,6 +78,7 @@ struct Index { | |||||||
| 
 | 
 | ||||||
|   async onPageShow(): Promise<void> { |   async onPageShow(): Promise<void> { | ||||||
|     dConsole.log("权限首页 onPageShow2") |     dConsole.log("权限首页 onPageShow2") | ||||||
|  |     CreateFile("/mnt/hmdfs/100/account/device_view/local/files/duolun/logs/test.text") | ||||||
|     if (!this.isPlay) { |     if (!this.isPlay) { | ||||||
|       this.avPlayer.playAudio(['welcome.wav']) |       this.avPlayer.playAudio(['welcome.wav']) | ||||||
|       this.isPlay = true |       this.isPlay = true | ||||||
|  | |||||||
| @ -35,7 +35,7 @@ import { | |||||||
| } from '../model'; | } from '../model'; | ||||||
| import { BusinessError } from '@ohos.base'; | import { BusinessError } from '@ohos.base'; | ||||||
| import { GetSyncData, SqlInsertTable } from '../utils/table/Operation'; | import { GetSyncData, SqlInsertTable } from '../utils/table/Operation'; | ||||||
| import { GetCurrentUserKeyValue } from './UserInfo/utils'; | import { GetCurrentUserKeyValue, InitializeExamProcessData } from './UserInfo/utils'; | ||||||
| import dayTs from '../utils/Date'; | import dayTs from '../utils/Date'; | ||||||
| import { GetCurrentTime, NumberToByteArray } from '../utils/Common'; | import { GetCurrentTime, NumberToByteArray } from '../utils/Common'; | ||||||
| import DB from '../utils/DbSql'; | import DB from '../utils/DbSql'; | ||||||
| @ -174,10 +174,12 @@ struct UserInfoPage { | |||||||
|       } |       } | ||||||
|       if (this.singlePlay) { |       if (this.singlePlay) { | ||||||
|         this.currentUser.id = '0' |         this.currentUser.id = '0' | ||||||
|         dConsole.log('开始考试') |         dConsole.log('开始考试3') | ||||||
|         SqlInsertTable('USER', [this.currentUser]).catch((e: BusinessError) => { |         SqlInsertTable('USER', [this.currentUser]).catch((e: BusinessError) => { | ||||||
|           dConsole.log("error", JSON.stringify(e)) |           dConsole.log("error", JSON.stringify(e)) | ||||||
|         }) |         }) | ||||||
|  |         // 初始化开始考试过程数据文件夹 | ||||||
|  |         InitializeExamProcessData(this.currentUser) | ||||||
|         router.pushUrl({ |         router.pushUrl({ | ||||||
|           url: this.carInfo.examSubject == '3' ? 'pages/Roads' : 'pages/Judge', |           url: this.carInfo.examSubject == '3' ? 'pages/Roads' : 'pages/Judge', | ||||||
|           params: { |           params: { | ||||||
| @ -342,8 +344,11 @@ struct UserInfoPage { | |||||||
|         AppStorage.setOrCreate('examinerInfo', this.examinerLoginInfo) |         AppStorage.setOrCreate('examinerInfo', this.examinerLoginInfo) | ||||||
|         AppStorage.setOrCreate('lsh', res.lsh) |         AppStorage.setOrCreate('lsh', res.lsh) | ||||||
|         // const { examSubject } = this.carInfo; |         // const { examSubject } = this.carInfo; | ||||||
|  |         dConsole.log("开始考试2") | ||||||
|         if (this.singlePlay) { |         if (this.singlePlay) { | ||||||
|           this.stopDeviceById() |           this.stopDeviceById() | ||||||
|  |           // 初始化开始考试过程数据文件夹 | ||||||
|  |           InitializeExamProcessData(this.currentUser) | ||||||
|           router.pushUrl({ |           router.pushUrl({ | ||||||
|             url: this.carInfo.examSubject == "3" ? 'pages/Roads' : 'pages/Judge', |             url: this.carInfo.examSubject == "3" ? 'pages/Roads' : 'pages/Judge', | ||||||
|             params: { |             params: { | ||||||
| @ -874,6 +879,8 @@ struct UserInfoPage { | |||||||
|       await SqlInsertTable('USER', [this.currentUser]) |       await SqlInsertTable('USER', [this.currentUser]) | ||||||
|       this.stepFlag = false |       this.stepFlag = false | ||||||
|       this.startExamDialogController.close() |       this.startExamDialogController.close() | ||||||
|  |       // 初始化开始考试过程数据文件夹 | ||||||
|  |       InitializeExamProcessData(this.currentUser) | ||||||
|       router.pushUrl({ |       router.pushUrl({ | ||||||
|         url: 'pages/Judge', |         url: 'pages/Judge', | ||||||
|         params: { |         params: { | ||||||
|  | |||||||
| @ -1,4 +1,7 @@ | |||||||
|  | import { UserInfoTag } from '../../config'; | ||||||
| import { User } from '../../model'; | import { User } from '../../model'; | ||||||
|  | import dayTs from '../../utils/Date'; | ||||||
|  | import { dConsole } from '../../utils/LogWorker'; | ||||||
| 
 | 
 | ||||||
| export const GetCurrentUserKeyValue = (user: User, key: string): string => { | export const GetCurrentUserKeyValue = (user: User, key: string): string => { | ||||||
|   switch (key) { |   switch (key) { | ||||||
| @ -51,4 +54,14 @@ export const GetCurrentUserKeyValue = (user: User, key: string): string => { | |||||||
|     default: |     default: | ||||||
|       return ''; |       return ''; | ||||||
|   } |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | export const InitializeExamProcessData = (user: User) => { | ||||||
|  |   // 初始化考试过程数据 | ||||||
|  |   // 2025_07_04_11_35_26_0000000000000_342323199501470011_测试学员1 | ||||||
|  |   let date = dayTs().format("YYYY_MM_DD_HH_mm_ss") | ||||||
|  |   const examDir: string = date + "_" + user.lsh + "_" + user.sfzmhm + "_" + user.xm | ||||||
|  |   dConsole.log(UserInfoTag, "过程数据文件夹名", examDir) | ||||||
|  |   dConsole.initExam(examDir) | ||||||
|  |   dConsole.log("开始考试1") | ||||||
| } | } | ||||||
| @ -230,37 +230,6 @@ export default class Judge { | |||||||
|     dConsole.info(JudgeTag, '过程数据文件上传 end') |     dConsole.info(JudgeTag, '过程数据文件上传 end') | ||||||
|   } |   } | ||||||
|   private judgeTask: JudgeTask |   private judgeTask: JudgeTask | ||||||
|   // 处理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++) |  | ||||||
|   } |  | ||||||
|   // 检测扣分、结束项目时该项目是否开始 |   // 检测扣分、结束项目时该项目是否开始 | ||||||
|   checkProjectIsStart = async (xmdm: number, currentType: 1 | 2, kf?: MarkRule) => { |   checkProjectIsStart = async (xmdm: number, currentType: 1 | 2, kf?: MarkRule) => { | ||||||
|     if (xmdm == 20) { |     if (xmdm == 20) { | ||||||
| @ -338,6 +307,116 @@ export default class Judge { | |||||||
|     this.prevWd = tWD; |     this.prevWd = tWD; | ||||||
|   } |   } | ||||||
|   private performInfo?: JudgePerformInfo |   private performInfo?: JudgePerformInfo | ||||||
|  |   private ksjs?: JudgeKSJS | ||||||
|  |   private kfArr?: MarkRule[] | ||||||
|  |   //所有的科目考试项目(大车&小车) | ||||||
|  |   private kmItems: JudgeConfigObjKmItems | ||||||
|  |   private plcData?: PLCType | ||||||
|  |   // 处理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++) | ||||||
|  |   } | ||||||
|  |   // 获取plc数据 | ||||||
|  |   getPlcData = async (plc: string) => { | ||||||
|  |     await this.fileLog?.setPlcProgressData(plc) | ||||||
|  |     //plc字符串转化成评判初始化数据 | ||||||
|  |     const tempData = await PlcStrToJson(plc); | ||||||
|  |     //模拟灯光回放时刻 | ||||||
|  |     tempData.sensor.rmndg = this.rmndg; | ||||||
|  |     //模拟灯灯光灯光项目 | ||||||
|  |     tempData.sensor.mndg = this.mndgStr || ""; | ||||||
|  |     //plc字符串转化成无锡所过程数据 | ||||||
|  |     const wuXiDataStr = await PlcStrToWXJson(plc) | ||||||
|  |     this.plcData = tempData | ||||||
|  |     await this.fileLog?.setExamJudgeWuxiProgressData(wuXiDataStr) | ||||||
|  |     this.tempData = tempData | ||||||
|  |     this.plcStr = plc; | ||||||
|  |     this.mndgStr = ''; | ||||||
|  |     this.rmndg = 0; | ||||||
|  |     AppStorage.setOrCreate('msgStr', plc) | ||||||
|  |     return tempData | ||||||
|  |   } | ||||||
|  |   // 处理轨迹plc信号 | ||||||
|  |   handleTrajectoryUdp = async (strArr: string[]) => { | ||||||
|  |     let num = 2; | ||||||
|  |     const judgeTimer = setInterval(async () => { | ||||||
|  |       const msgStr = strArr[num]; | ||||||
|  |       if (msgStr == '') { | ||||||
|  |         dConsole.info(JudgeTag, '模拟数据考试结束') | ||||||
|  |         clearInterval(judgeTimer) | ||||||
|  |         this.checkExamIsEnd(true) | ||||||
|  |         return | ||||||
|  |       } | ||||||
|  |       const msg: PLCType = JSON.parse(strArr[num]); | ||||||
|  |       num++ | ||||||
|  |       // 4.过程数据 | ||||||
|  |       this.tempData = msg | ||||||
|  |       this.judgeUI.isDwztRight = (msg?.gps?.dwzt == 4 && msg?.gps?.jdzt == 3); | ||||||
|  |       this.judgeUI.sd = Math.floor(msg?.gps?.sd * 1.852) + ''; | ||||||
|  |       this.judgeUI.dw = Math.floor(msg?.sensor?.dw) + '' | ||||||
|  |       this.plcData = msg | ||||||
|  |       // this.judgeUI.isDwztRight = msg.gps.dwzt == 4; | ||||||
|  |       AppStorage.setOrCreate('msgStr', '') | ||||||
|  |       if (msg.method === 'examJudgeArtificialItem') { | ||||||
|  |         this.setJudgeItem(msg.itemno, msg.type) | ||||||
|  |       } | ||||||
|  |       if (msg.method === 'examJudgeArtificialMark') { | ||||||
|  |         this.setJudgeItem(msg.itemno, msg.serial) | ||||||
|  |       } | ||||||
|  |       await examJudgeRealExam(msg) | ||||||
|  |       // const bytes = await this.getMessageHeartbeat(); | ||||||
|  |       // bytes && globalThis.judgeUdp.send(bytes) | ||||||
|  | 
 | ||||||
|  |     }, 200) | ||||||
|  |     // TODO 定时器缺失 | ||||||
|  |     // globalThis.judgeTimer = judgeTimer; | ||||||
|  |   } | ||||||
|  |   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); | ||||||
|  |     } | ||||||
|  |   } | ||||||
|   // 校验考试是否结束 |   // 校验考试是否结束 | ||||||
|   checkExamIsEnd = async (isManual?: boolean) => { |   checkExamIsEnd = async (isManual?: boolean) => { | ||||||
|     dConsole.log(JudgeTag, "校验考试是否结束") |     dConsole.log(JudgeTag, "校验考试是否结束") | ||||||
| @ -453,86 +532,14 @@ export default class Judge { | |||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   private ksjs?: JudgeKSJS |  | ||||||
|   private kfArr?: MarkRule[] |  | ||||||
|   //所有的科目考试项目(大车&小车) |  | ||||||
|   private kmItems: JudgeConfigObjKmItems |  | ||||||
|   private plcData?: PLCType |  | ||||||
|   // 获取plc数据 |  | ||||||
|   getPlcData = async (plc: string) => { |  | ||||||
|     await this.fileLog?.setPlcProgressData(plc) |  | ||||||
|     //plc字符串转化成评判初始化数据 |  | ||||||
|     const tempData = await PlcStrToJson(plc); |  | ||||||
|     //模拟灯光回放时刻 |  | ||||||
|     tempData.sensor.rmndg = this.rmndg; |  | ||||||
|     //模拟灯灯光灯光项目 |  | ||||||
|     tempData.sensor.mndg = this.mndgStr || ""; |  | ||||||
|     //plc字符串转化成无锡所过程数据 |  | ||||||
|     const wuXiDataStr = await PlcStrToWXJson(plc) |  | ||||||
|     this.plcData = tempData |  | ||||||
|     await this.fileLog?.setExamJudgeWuxiProgressData(wuXiDataStr) |  | ||||||
|     this.tempData = tempData |  | ||||||
|     this.plcStr = plc; |  | ||||||
|     this.mndgStr = ''; |  | ||||||
|     this.rmndg = 0; |  | ||||||
|     AppStorage.setOrCreate('msgStr', plc) |  | ||||||
|     return tempData |  | ||||||
|   } |  | ||||||
|   private isEndTip: boolean = false; |  | ||||||
|   // 处理轨迹plc信号 |  | ||||||
|   handleTrajectoryUdp = async (strArr: string[]) => { |  | ||||||
|     let num = 2; |  | ||||||
|     const judgeTimer = setInterval(async () => { |  | ||||||
|       const msgStr = strArr[num]; |  | ||||||
|       if (msgStr == '') { |  | ||||||
|         dConsole.info(JudgeTag, '模拟数据考试结束') |  | ||||||
|         clearInterval(judgeTimer) |  | ||||||
|         this.checkExamIsEnd(true) |  | ||||||
|         return |  | ||||||
|       } |  | ||||||
|       const msg: PLCType = JSON.parse(strArr[num]); |  | ||||||
|       num++ |  | ||||||
|       // 4.过程数据 |  | ||||||
|       this.tempData = msg |  | ||||||
|       this.judgeUI.isDwztRight = (msg?.gps?.dwzt == 4 && msg?.gps?.jdzt == 3); |  | ||||||
|       this.judgeUI.sd = Math.floor(msg?.gps?.sd * 1.852) + ''; |  | ||||||
|       this.judgeUI.dw = Math.floor(msg?.sensor?.dw) + '' |  | ||||||
|       this.plcData = msg |  | ||||||
|       // this.judgeUI.isDwztRight = msg.gps.dwzt == 4; |  | ||||||
|       AppStorage.setOrCreate('msgStr', '') |  | ||||||
|       if (msg.method === 'examJudgeArtificialItem') { |  | ||||||
|         this.setJudgeItem(msg.itemno, msg.type) |  | ||||||
|       } |  | ||||||
|       if (msg.method === 'examJudgeArtificialMark') { |  | ||||||
|         this.setJudgeItem(msg.itemno, msg.serial) |  | ||||||
|       } |  | ||||||
|       await examJudgeRealExam(msg) |  | ||||||
|       // const bytes = await this.getMessageHeartbeat(); |  | ||||||
|       // bytes && globalThis.judgeUdp.send(bytes) |  | ||||||
| 
 |  | ||||||
|     }, 200) |  | ||||||
|     // TODO 定时器缺失 |  | ||||||
|     // globalThis.judgeTimer = judgeTimer; |  | ||||||
|   } |  | ||||||
|   //本地轨迹回放地址 |  | ||||||
|   private trajectoryPath: string |  | ||||||
|   // private currentKm2ItemsObj: any |  | ||||||
|   private isTrajectoryOpen: boolean; |  | ||||||
|   //当前科目二的考试项目 |   //当前科目二的考试项目 | ||||||
|   // 调代理接口是否断网了 |   private deductedPopShowTimer: number = 0; | ||||||
|   private isJudgeDisConnect: boolean = false; |   private artSubject3ProjectsCodesArr: number[] = [3, 9, 4, 10, 12, 11] | ||||||
|   // 断网数据补传 |   private lane: LANE = { | ||||||
|   uploadDisConnectData = async () => { |     road: '', num: 0, count: 0 | ||||||
|     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 videoData?: RecordHandleType | ||||||
|  |   private disConnectNum: number = 0; | ||||||
|   // 项目开始接口同步 |   // 项目开始接口同步 | ||||||
|   beginProject = async (ksxm: number) => { |   beginProject = async (ksxm: number) => { | ||||||
|     const carInfo = AppStorage.get<CarInfoType>('carInfo'); |     const carInfo = AppStorage.get<CarInfoType>('carInfo'); | ||||||
| @ -636,13 +643,6 @@ export default class Judge { | |||||||
|     UploadRegulatoryCodeConversion('17C54', temp.code || 0) |     UploadRegulatoryCodeConversion('17C54', temp.code || 0) | ||||||
|     dConsole.info(JudgeTag, '上传照片 end') |     dConsole.info(JudgeTag, '上传照片 end') | ||||||
|   } |   } | ||||||
|   private deductedPopShowTimer: number = 0; |  | ||||||
|   private artSubject3ProjectsCodesArr: number[] = [3, 9, 4, 10, 12, 11] |  | ||||||
|   private lane: LANE = { |  | ||||||
|     road: '', num: 0, count: 0 |  | ||||||
|   } |  | ||||||
|   private videoData?: RecordHandleType |  | ||||||
|   private disConnectNum: number = 0; |  | ||||||
|   //调用监管接口 |   //调用监管接口 | ||||||
|   sendWriteObjectOut: SendWriteObjectOut = async (data, filePath) => { |   sendWriteObjectOut: SendWriteObjectOut = async (data, filePath) => { | ||||||
|     const temp = await writeObjectOut(data, filePath, this.context); |     const temp = await writeObjectOut(data, filePath, this.context); | ||||||
|  | |||||||
| @ -222,9 +222,16 @@ export function CreateDir(path: string): Promise<boolean> { | |||||||
|  * @params path 文件具体路径 |  * @params path 文件具体路径 | ||||||
|  * @return 返回一个Promise |  * @return 返回一个Promise | ||||||
|  */ |  */ | ||||||
| export function CreateFile(path: string): Promise<boolean> { | export function CreateFile(path: string): Promise<number> { | ||||||
|   return new Promise((resolve, reject) => { |   return new Promise((resolve, reject) => { | ||||||
| 
 |     try { | ||||||
|  |       let file = fs.openSync(path, fs.OpenMode.READ_WRITE | fs.OpenMode.APPEND | fs.OpenMode.CREATE) | ||||||
|  |       console.log(CommonFileTag, "创建文件成功", path) | ||||||
|  |       resolve(file.fd) | ||||||
|  |     } catch (e) { | ||||||
|  |       console.log(CommonFileTag, "创建文件失败") | ||||||
|  |       reject(-1) | ||||||
|  |     } | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -44,7 +44,7 @@ class logWorker { | |||||||
|     console.log(`当前环境配置初始化: ${isOpenLog}`); |     console.log(`当前环境配置初始化: ${isOpenLog}`); | ||||||
|     this.isLogEnabled = isOpenLog; |     this.isLogEnabled = isOpenLog; | ||||||
|     if (this.isLogEnabled === "1") { |     if (this.isLogEnabled === "1") { | ||||||
|       this.workerInstance = new worker.ThreadWorker("entry/ets/workers/Log.ets"); |       this.workerInstance = new worker.ThreadWorker("entry/ets/workers/Log.ets") | ||||||
|       let data: LogWorkerMessage = { |       let data: LogWorkerMessage = { | ||||||
|         type: WorkerMessageType.Init |         type: WorkerMessageType.Init | ||||||
|       } |       } | ||||||
| @ -52,6 +52,17 @@ class logWorker { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   // 初始化考试过程数据文件夹以及文件 | ||||||
|  |   initExam(dirName: string) { | ||||||
|  |     let data: LogWorkerMessage = { | ||||||
|  |       type: WorkerMessageType.ExamProcessInit, | ||||||
|  |       studentDirName: dirName | ||||||
|  |     } | ||||||
|  |     if (this.isLogEnabled === "1") { | ||||||
|  |       this.workerInstance?.postMessage(JSON.stringify(data)) | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   //   过程数据初始化 |   //   过程数据初始化 | ||||||
|   processDataInit(carNo: string, name: string) { |   processDataInit(carNo: string, name: string) { | ||||||
|     let date = dayTs().format("YYYY_MM_DD_HH_mm_ss"); |     let date = dayTs().format("YYYY_MM_DD_HH_mm_ss"); | ||||||
|  | |||||||
| @ -1,11 +1,12 @@ | |||||||
| import worker, { ErrorEvent, MessageEvents, ThreadWorkerGlobalScope } from '@ohos.worker'; | import worker, { ErrorEvent, MessageEvents, ThreadWorkerGlobalScope } from '@ohos.worker'; | ||||||
| import { GlobalConfig } from '../config'; | import { GlobalConfig } from '../config'; | ||||||
| import { LogFileFd, LogPathType, LogWorkerMessage, WorkerMessageType } from '../model'; | import { LogFileFd, LogPathType, LogWorkerMessage, WorkerMessageType } from '../model'; | ||||||
| import { CreateDir, IsExit } from '../utils/Common'; | import { CreateDir, CreateFile, IsExit } from '../utils/Common'; | ||||||
| import dayTs from '../utils/Date'; | import dayTs from '../utils/Date'; | ||||||
| 
 | 
 | ||||||
| const workerPort: ThreadWorkerGlobalScope = worker.workerPort; | const workerPort: ThreadWorkerGlobalScope = worker.workerPort; | ||||||
| 
 | const fileNameArr: string[] = ["four_one_log_byte_data.text", "four_one_log_data.txt", "judge_exam_data.txt", "judge_log_data.txt", "judge_progress_callback_data.txt", "plc_data.txt", "wuxi_exam_data.txt", "wuxi_progress_data.txt"] | ||||||
|  | let fileFdArr: number[] = [] | ||||||
| workerPort.onmessage = (e: MessageEvents) => { | workerPort.onmessage = (e: MessageEvents) => { | ||||||
|   console.log("日志系统worker收到消息") |   console.log("日志系统worker收到消息") | ||||||
|   // 日志文件目录 |   // 日志文件目录 | ||||||
| @ -18,9 +19,6 @@ workerPort.onmessage = (e: MessageEvents) => { | |||||||
|   if (result.type === WorkerMessageType.Init) { |   if (result.type === WorkerMessageType.Init) { | ||||||
|     InitLog() |     InitLog() | ||||||
|   } |   } | ||||||
|   if (result.type === WorkerMessageType.OpenProcessDataFile) { |  | ||||||
|     OpenProcessDataFile(logPaths, logFileFd, result.data || "") |  | ||||||
|   } |  | ||||||
|   if (result.type === WorkerMessageType.ExamProcessInit && result.studentDirName) { |   if (result.type === WorkerMessageType.ExamProcessInit && result.studentDirName) { | ||||||
|     InitExam(result.studentDirName) |     InitExam(result.studentDirName) | ||||||
|   } |   } | ||||||
| @ -69,13 +67,14 @@ async function InitExam(dirName: string) { | |||||||
|     await CreateDir(path); |     await CreateDir(path); | ||||||
|   } |   } | ||||||
|   //   创建几个文件 |   //   创建几个文件 | ||||||
|   let fileNameArr: string[] = ["four_one_log_byte_data.text", "four_one_log_data.txt", "judge_exam_data.txt", "judge_log_data.txt", "judge_progress_callback_data.txt", "plc_data.txt", "wuxi_exam_data.txt", "wuxi_progress_data.txt"] |   fileNameArr.forEach(async (item: string, index: number) => { | ||||||
| 
 |     let filePath = path + "/" + item | ||||||
|  |     console.log("创建文件", filePath) | ||||||
|  |     let result = await CreateFile(filePath) | ||||||
|  |     fileFdArr[index] = result | ||||||
|  |   }) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function OpenProcessDataFile(logPaths: LogPathType, logFileFd: LogFileFd, name: string) { |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
| 
 | 
 | ||||||
| workerPort.onmessageerror = (e: MessageEvents) => { | workerPort.onmessageerror = (e: MessageEvents) => { | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,3 +1,38 @@ | |||||||
|  | <details> | ||||||
|  |     <summary>fix: 隐藏部分快速打印</summary> | ||||||
|  |      <span style="color: #888;">[提交人]:</span><span style="color: #333;">wangzhongjie</span><br> | ||||||
|  |      <span style="color: #888;">[提交时间]:</span><span style="color: #333;">2025-07-14 13:23</span><br> | ||||||
|  |     <span style="color: #888;">[提交版本]:</span><span style="color: #333;">78be17b</span> | ||||||
|  | </details> | ||||||
|  | 
 | ||||||
|  | <details> | ||||||
|  |     <summary>fix: 增加request打印请求信息</summary> | ||||||
|  |      <span style="color: #888;">[提交人]:</span><span style="color: #333;">wangzhongjie</span><br> | ||||||
|  |      <span style="color: #888;">[提交时间]:</span><span style="color: #333;">2025-07-04 16:31</span><br> | ||||||
|  |     <span style="color: #888;">[提交版本]:</span><span style="color: #333;">8838072</span> | ||||||
|  | </details> | ||||||
|  | 
 | ||||||
|  | <details> | ||||||
|  |     <summary>fix: 后置机拿不到信号问题</summary> | ||||||
|  |      <span style="color: #888;">[提交人]:</span><span style="color: #333;">wangzhongjie</span><br> | ||||||
|  |      <span style="color: #888;">[提交时间]:</span><span style="color: #333;">2025-06-26 14:27</span><br> | ||||||
|  |     <span style="color: #888;">[提交版本]:</span><span style="color: #333;">a52a13e</span> | ||||||
|  | </details> | ||||||
|  | 
 | ||||||
|  | <details> | ||||||
|  |     <summary>fix: 优化打印以及评判一个弹窗问题</summary> | ||||||
|  |      <span style="color: #888;">[提交人]:</span><span style="color: #333;">wangzhongjie</span><br> | ||||||
|  |      <span style="color: #888;">[提交时间]:</span><span style="color: #333;">2025-07-04 13:49</span><br> | ||||||
|  |     <span style="color: #888;">[提交版本]:</span><span style="color: #333;">7bd3689</span> | ||||||
|  | </details> | ||||||
|  | 
 | ||||||
|  | <details> | ||||||
|  |     <summary>fix: 增加一些日志</summary> | ||||||
|  |      <span style="color: #888;">[提交人]:</span><span style="color: #333;">wangzhongjie</span><br> | ||||||
|  |      <span style="color: #888;">[提交时间]:</span><span style="color: #333;">2025-07-04 10:50</span><br> | ||||||
|  |     <span style="color: #888;">[提交版本]:</span><span style="color: #333;">af8b112</span> | ||||||
|  | </details> | ||||||
|  | 
 | ||||||
| <details> | <details> | ||||||
|     <summary>fix: 优化首页获取车辆后才可以进入联网以及单机逻辑</summary> |     <summary>fix: 优化首页获取车辆后才可以进入联网以及单机逻辑</summary> | ||||||
|      <span style="color: #888;">[提交人]:</span><span style="color: #333;">wangzhongjie</span><br> |      <span style="color: #888;">[提交人]:</span><span style="color: #333;">wangzhongjie</span><br> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user