fix: 优化代码格式,统一空格和分号使用
This commit is contained in:
		
							parent
							
								
									fca24538d0
								
							
						
					
					
						commit
						6984855346
					
				| @ -2,7 +2,7 @@ import common from '@ohos.app.ability.common'; | ||||
| // ------------------------------ | ||||
| // 基础共用类型 | ||||
| // ------------------------------ | ||||
| import { MA_SYSTEMPARMType } from './Table' | ||||
| import { MA_SYSTEMPARMType } from './Table'; | ||||
| 
 | ||||
| /** 基础考试字段 */ | ||||
| interface BaseExamFields { | ||||
| @ -214,9 +214,9 @@ export interface Plc { | ||||
|   extend: object | ||||
|   //轨迹回放需要 | ||||
|   method?: string | ||||
|   itemno: string | ||||
|   type: 1 | 2 | ||||
|   serial: 1 | 2 | ||||
|   itemno?: string | ||||
|   type?: 1 | 2 | ||||
|   serial?: 1 | 2 | ||||
| } | ||||
| 
 | ||||
| interface Qfsj { | ||||
| @ -723,6 +723,7 @@ interface UdpKf{ | ||||
|   kfxh: string | ||||
|   directives: string | ||||
| } | ||||
| 
 | ||||
| export interface JudgeUdpKf { | ||||
|   data: UdpKf | ||||
| } | ||||
|  | ||||
| @ -8,7 +8,6 @@ interface StuInfo { | ||||
|   idCard: string | ||||
| } | ||||
| 
 | ||||
| const LOGTAG = 'LOGTAG' | ||||
| 
 | ||||
| export default class FileLog { | ||||
|   public folderPath: string | ||||
| @ -27,48 +26,46 @@ export default class FileLog { | ||||
|   // 过程文件数据 | ||||
|   public setExamProgressData = async (str: Object) => { | ||||
|     this.progressDataFd = | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/exam_progress_data.txt`, JSON.stringify(str), | ||||
|         this.progressDataFd); | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/exam_progress_data.txt`, JSON.stringify(str)); | ||||
|   } | ||||
|   // 无锡所接口数据 | ||||
|   public setExamJudgeWuxiData = async (str: string) => { | ||||
|     this.examJudgeWuxiDataFd = | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/wuxi_exam_data.txt`, str, this.examJudgeWuxiDataFd); | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/wuxi_exam_data.txt`, str); | ||||
|   } | ||||
|   // 无锡所过程数据 | ||||
|   public setExamJudgeWuxiProgressData = async (str: string) => { | ||||
|     this.examJudgeWuxiProgressDataFd = | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/wuxi_progress_data.txt`, str, this.examJudgeWuxiProgressDataFd); | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/wuxi_progress_data.txt`, str); | ||||
|   } | ||||
|   // plc文件数据 | ||||
|   public setPlcProgressData = async (str: Object) => { | ||||
|     this.plcDataFd = | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/plc_data.txt`, JSON.stringify(str), this.plcDataFd); | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/plc_data.txt`, JSON.stringify(str)); | ||||
|   } | ||||
|   // 过程评判json数据 | ||||
|   public setExamJudgeData = async (str: string) => { | ||||
|     this.examJudgeDataFd = | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/judge_exam_data.txt`, str, this.examJudgeDataFd); | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/judge_exam_data.txt`, str); | ||||
|   } | ||||
|   // 过程评判回调数据 | ||||
|   public setExamJudgeCallbackData = async (str: string) => { | ||||
|     this.examJudgeCallbackDataFd = | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/judge_progress_callback_data.txt`, str, | ||||
|         this.examJudgeCallbackDataFd); | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/judge_progress_callback_data.txt`, str); | ||||
|   } | ||||
|   // 过程评判日志调数据 | ||||
|   public setExamJudgeLogData = async (str: string) => { | ||||
|     this.examJudgeLogDataFd = | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/judge_log_data.txt`, str, this.examJudgeLogDataFd); | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/judge_log_data.txt`, str); | ||||
|   } | ||||
|   // 设置四合一画面数据 | ||||
|   public setFourAndOneLogData = async (str: string) => { | ||||
|     this.fourAndOneLogDataFd = | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/four_one_log_data.txt`, str, this.fourAndOneLogDataFd); | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/four_one_log_data.txt`, str); | ||||
|   } | ||||
|   public setFourAndOneLogDataBytes = async (str: string) => { | ||||
|     this.fourAndOneLogDataBytesFd = | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/four_one_log_byte_data.txt`, str, this.fourAndOneLogDataBytesFd); | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/four_one_log_byte_data.txt`, str); | ||||
|   } | ||||
|   // 无锡所轨迹数据 | ||||
|   public setExamLineData = async (plcStr: string) => { | ||||
| @ -101,13 +98,12 @@ export default class FileLog { | ||||
|       /*结束符*/ time, | ||||
|     ]; | ||||
|     this.examLineDataFd = | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/exam_wuxi_data.txt`, JSON.stringify(lineData), | ||||
|         this.examLineDataFd); | ||||
|       await this.fileUtil.editFile(`${this.folderPath}/exam_wuxi_data.txt`, JSON.stringify(lineData)); | ||||
|   }; | ||||
|   private stuInfo: StuInfo | ||||
|   // private stuInfo: StuInfo | ||||
|   // 设置文件夹 | ||||
|   public initFileLogo = async (stuInfo: StuInfo) => { | ||||
|     this.stuInfo = stuInfo; | ||||
|     // this.stuInfo = stuInfo; | ||||
|     const time = GetCurrentTime() | ||||
|     const date = time.split(' ')[0].split('-').join('_') | ||||
|     const hourTime = time.split(' ')[1].split(':').join('_') | ||||
|  | ||||
| @ -1,10 +1,10 @@ | ||||
| import { testMarkRules, testRealExam } from '../dataTest/index'; | ||||
| import { GetCurrentTime, NumberToByteArray } from '../../../utils/Common'; | ||||
| import { testRealExam } from '../dataTest/index'; | ||||
| import { NumberToByteArray } from '../../../utils/Common'; | ||||
| 
 | ||||
| import systemTime from '@ohos.systemDateTime'; | ||||
| import { Array2Byte } from './Common'; | ||||
| import { CarInfoType } from '../../../model'; | ||||
| import { Gps, Lane,Plc,Vision,Radar, Sensor,DefaultJudgeConfigObj, JudgeLane} from '../../../model/Judge' | ||||
| import { DefaultJudgeConfigObj, Gps, JudgeLane, Plc, Radar, Sensor, Vision } from '../../../model/Judge'; | ||||
| 
 | ||||
| interface Extend {} | ||||
| 
 | ||||
| @ -147,7 +147,7 @@ export function getKmProjectVoice( | ||||
|     case 41100: | ||||
|       return type === 1 | ||||
|         ? (param512Str[2] == 3 ? 411001 : undefined) | ||||
|         : (param544Str.includes(xmxh) ? undefined : (param544Str.length === 0 ? undefined : 411004)) | ||||
|         : (param544Str.includes(Number(xmxh)) ? undefined : (param544Str.length === 0 ? undefined : 411004)) | ||||
| 
 | ||||
|   //通过车站 | ||||
|     case 41200: | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user