fix: 过程数据记录
This commit is contained in:
		
							parent
							
								
									8cf68ea6fb
								
							
						
					
					
						commit
						be462d6877
					
				| @ -112,22 +112,22 @@ export enum WorkerMessageType { | |||||||
| 
 | 
 | ||||||
| // 过程数据枚举 | // 过程数据枚举 | ||||||
| export enum ProcessDataEnumType { | export enum ProcessDataEnumType { | ||||||
|   //four_one_log_byte_data |   // //four_one_log_byte_data | ||||||
|   FourOneLogByteData = "0", |   // FourOneLogByteData = "0", | ||||||
|   //four_one_log_data |   // //four_one_log_data | ||||||
|   FourOneLogData = "1", |   // FourOneLogData = "1", | ||||||
|   //judge_exam_data |   //judge_exam_data | ||||||
|   JudgeExamData = "2", |   JudgeExamData = "0", | ||||||
|   //judge_log_data |   //judge_log_data | ||||||
|   JudgeLogData = "3", |   JudgeLogData = "1", | ||||||
|   //judge_progress_callback_data |   //judge_progress_callback_data | ||||||
|   JudgeProgressCallbackData = "4", |   JudgeProgressCallbackData = "2", | ||||||
|   //plc_data |   //plc_data | ||||||
|   PlcData = "5", |   PlcData = "3", | ||||||
|   //wuxi_exam_data |   //wuxi_exam_data | ||||||
|   WuxiExam = "6", |   WuxiExam = "4", | ||||||
|   //wuxi_progress_data |   //wuxi_progress_data | ||||||
|   WuxiProgressData = "7" |   WuxiProgressData = "5" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export interface FileQueueType { | export interface FileQueueType { | ||||||
|  | |||||||
| @ -533,6 +533,7 @@ export class BaseJudge { | |||||||
|       AppStorage.setOrCreate('isJudgeInitBool', true) |       AppStorage.setOrCreate('isJudgeInitBool', true) | ||||||
|       dConsole.info(JudgeTag, '4.评判初始化完成') |       dConsole.info(JudgeTag, '4.评判初始化完成') | ||||||
|     } |     } | ||||||
|  |     dConsole.writeProcessData(ProcessDataEnumType.JudgeExamData, JSON.stringify(initInfo)) | ||||||
|     AppStorage.setOrCreate('isJudge', true) |     AppStorage.setOrCreate('isJudge', true) | ||||||
|     // 2.评判过程回调 |     // 2.评判过程回调 | ||||||
|     await examJudgeSetRealExamCallback(async (strData: string, len: number) => { |     await examJudgeSetRealExamCallback(async (strData: string, len: number) => { | ||||||
| @ -555,6 +556,7 @@ export class BaseJudge { | |||||||
|     // 3.开始考试 |     // 3.开始考试 | ||||||
|     if (beginExamInfo) { |     if (beginExamInfo) { | ||||||
|       await examJudgeBeginExam(beginExamInfo); |       await examJudgeBeginExam(beginExamInfo); | ||||||
|  |       dConsole.writeProcessData(ProcessDataEnumType.JudgeExamData, JSON.stringify(beginExamInfo)) | ||||||
|     } |     } | ||||||
|     dConsole.info(JudgeTag, '6.开始考试注册完成') |     dConsole.info(JudgeTag, '6.开始考试注册完成') | ||||||
|     that.avPlayer?.playAudio([judgeUI.singlePlay ? 'voice/ksks.wav' : 'voice/监管成功.mp3']) |     that.avPlayer?.playAudio([judgeUI.singlePlay ? 'voice/ksks.wav' : 'voice/监管成功.mp3']) | ||||||
|  | |||||||
| @ -10,6 +10,16 @@ export default class GetDistance { | |||||||
|   public totalTime: number |   public totalTime: number | ||||||
|   public date: string |   public date: string | ||||||
|   public fd: number |   public fd: number | ||||||
|  |   //上传行驶里程数据 | ||||||
|  |   uploadData = async () => { | ||||||
|  |     // setInterval(() => { | ||||||
|  |     //   // const { carId } = AppStorage.get<CarInfoType>('carInfo'); | ||||||
|  |     //   // const { date, timeStr, totalDistance } = this; | ||||||
|  |     //   return | ||||||
|  |     //   //"carid":"1001","startTime":"2024-08-24 08:09:01","time":"111233", "mileage":"1222" | ||||||
|  |     // | ||||||
|  |     // }, 5000) | ||||||
|  |   } | ||||||
|   //后续文件路径待替换 |   //后续文件路径待替换 | ||||||
|   private fileUtil: FileUtils |   private fileUtil: FileUtils | ||||||
|   // 设置文件夹 |   // 设置文件夹 | ||||||
| @ -35,7 +45,6 @@ export default class GetDistance { | |||||||
|     this.fileUtil = fileUtil; |     this.fileUtil = fileUtil; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|   // 过程文件数据 |   // 过程文件数据 | ||||||
|   public setTimeData = async (str: number) => { |   public setTimeData = async (str: number) => { | ||||||
|     console.log('folderPath', this.folderPath) |     console.log('folderPath', this.folderPath) | ||||||
| @ -55,14 +64,4 @@ export default class GetDistance { | |||||||
|     //   `${folderPath}/${date}.txt`,contentArr.join('\n') |     //   `${folderPath}/${date}.txt`,contentArr.join('\n') | ||||||
|     // ); |     // ); | ||||||
|   } |   } | ||||||
|   //上传行驶里程数据 |  | ||||||
|   uploadData = async () => { |  | ||||||
|     setInterval(() => { |  | ||||||
|       // const { carId } = AppStorage.get<CarInfoType>('carInfo'); |  | ||||||
|       // const { date, timeStr, totalDistance } = this; |  | ||||||
|       return |  | ||||||
|       //"carid":"1001","startTime":"2024-08-24 08:09:01","time":"111233", "mileage":"1222" |  | ||||||
| 
 |  | ||||||
|     }, 5000) |  | ||||||
|   } |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -7,7 +7,8 @@ import fs from '@ohos.file.fs'; | |||||||
| 
 | 
 | ||||||
| const workerPort: ThreadWorkerGlobalScope = worker.workerPort; | const workerPort: ThreadWorkerGlobalScope = worker.workerPort; | ||||||
| // 过程数据文件 | // 过程数据文件 | ||||||
| const fileNameArr: string[] = ["four_one_log_byte_data.txt", "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"] | // "four_one_log_byte_data.txt", "four_one_log_data.txt", | ||||||
|  | const fileNameArr: string[] = ["judge_exam_data.txt", "judge_log_data.txt", "judge_progress_callback_data.txt", "plc_data.txt", "wuxi_exam_data.txt", "wuxi_progress_data.txt"] | ||||||
| // 过程数据fd | // 过程数据fd | ||||||
| let fileFdArr: number[] = [] | let fileFdArr: number[] = [] | ||||||
| let writeQueue: Array<FileQueueType> = []; | let writeQueue: Array<FileQueueType> = []; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user