fix: 优化评判问题,删除老日志记录
This commit is contained in:
		
							parent
							
								
									b6f5993e06
								
							
						
					
					
						commit
						e22def4691
					
				| @ -498,6 +498,7 @@ export interface JudgeUI { | |||||||
|   dw: string |   dw: string | ||||||
|   endExamDialogController: CustomDialogController |   endExamDialogController: CustomDialogController | ||||||
|   generateExamRecordsDialogController: CustomDialogController |   generateExamRecordsDialogController: CustomDialogController | ||||||
|  |   laneSignal:PerLane | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -38,14 +38,15 @@ import { | |||||||
|   SyssetConfig, |   SyssetConfig, | ||||||
|   SYSTEMPARMARR, |   SYSTEMPARMARR, | ||||||
|   User, |   User, | ||||||
|   ProcessDataEnumType |   ProcessDataEnumType, | ||||||
|  |   PerLane | ||||||
| } from '../model'; | } from '../model'; | ||||||
| import { GetSyncData } from '../utils/table/Operation'; | import { GetSyncData } from '../utils/table/Operation'; | ||||||
| import dayTs from '../utils/Date'; | import dayTs from '../utils/Date'; | ||||||
| import { GetCurrentTime } from '../utils/Common'; | import { GetCurrentTime } from '../utils/Common'; | ||||||
| import FileUtils from '../utils/FileUtils'; | import FileUtils from '../utils/FileUtils'; | ||||||
| import SignalTrajectoryDialog from './Judge/SignalTrajectoryDialog'; | import SignalTrajectoryDialog from './Judge/SignalTrajectoryDialog'; | ||||||
| import { DefaultJudgeConfigData, ProcessDataMock } from '../mock'; | import { DefaultJudgeConfigData, InitialPerLane, ProcessDataMock } from '../mock'; | ||||||
| import { dConsole } from '../utils/LogWorker'; | import { dConsole } from '../utils/LogWorker'; | ||||||
| import ConfirmDialog from './compontents/ConfirmDialog'; | import ConfirmDialog from './compontents/ConfirmDialog'; | ||||||
| import CarLoadingDialog from './compontents/CarLoading'; | import CarLoadingDialog from './compontents/CarLoading'; | ||||||
| @ -146,10 +147,13 @@ struct JudgePage { | |||||||
|   @State carInfo: CarInfoType = {} |   @State carInfo: CarInfoType = {} | ||||||
|   @State isErrorMsgEnd: boolean = false |   @State isErrorMsgEnd: boolean = false | ||||||
|   @State disConnectErrorOpen: boolean = false |   @State disConnectErrorOpen: boolean = false | ||||||
|  |   @State laneSignal: PerLane = InitialPerLane | ||||||
|   public context = getContext(this) as common.UIAbilityContext; |   public context = getContext(this) as common.UIAbilityContext; | ||||||
|   // 信号查看弹窗 |   // 信号查看弹窗 | ||||||
|   signalTrajectoryDialogController: CustomDialogController = new CustomDialogController({ |   signalTrajectoryDialogController: CustomDialogController = new CustomDialogController({ | ||||||
|     builder: SignalTrajectoryDialog(), |     builder: SignalTrajectoryDialog({ | ||||||
|  |       laneSignal: this.laneSignal | ||||||
|  |     }), | ||||||
|     customStyle: true, |     customStyle: true, | ||||||
|     autoCancel: true |     autoCancel: true | ||||||
|   }) |   }) | ||||||
| @ -167,8 +171,7 @@ struct JudgePage { | |||||||
|       text: "确认结束考试?", |       text: "确认结束考试?", | ||||||
|       onConfirm: async () => { |       onConfirm: async () => { | ||||||
|         if (this.isErrorMsgEnd) { |         if (this.isErrorMsgEnd) { | ||||||
|           dConsole.log(JudgeTag, "结束考试") |           dConsole.log(JudgeTag, "router back1") | ||||||
|           this.judge.closeAllFiles() |  | ||||||
|           router.back() |           router.back() | ||||||
|           return |           return | ||||||
|         } |         } | ||||||
| @ -187,7 +190,7 @@ struct JudgePage { | |||||||
|         try { |         try { | ||||||
|           this.judge.checkExamIsEnd(true); |           this.judge.checkExamIsEnd(true); | ||||||
|         } catch (e) { |         } catch (e) { | ||||||
|           this.judge.closeAllFiles() |           dConsole.log(JudgeTag, "router back2") | ||||||
|           router.back() |           router.back() | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
| @ -505,6 +508,7 @@ struct JudgePage { | |||||||
|         message: '读取数据库信息失败,请重新联网更新!', |         message: '读取数据库信息失败,请重新联网更新!', | ||||||
|         duration: 8000 |         duration: 8000 | ||||||
|       }); |       }); | ||||||
|  |       dConsole.log(JudgeTag, "router back3") | ||||||
|       router.back(); |       router.back(); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  | |||||||
| @ -1,9 +1,15 @@ | |||||||
|  | import { PerLane } from '../../model' | ||||||
|  | import { dConsole } from '../../utils/LogWorker' | ||||||
| import SignalDisplayComponent from '../compontents/SignalDisplay' | import SignalDisplayComponent from '../compontents/SignalDisplay' | ||||||
| import TabComponent from '../compontents/Tab' | import TabComponent from '../compontents/Tab' | ||||||
| 
 | 
 | ||||||
| @CustomDialog | @CustomDialog | ||||||
| export default struct SignalTrajectoryDialog { | export default struct SignalTrajectoryDialog { | ||||||
|   @State active: number = 0 |   @State active: number = 0 | ||||||
|  |   @Prop  laneSignal: PerLane | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|   private controller?: CustomDialogController |   private controller?: CustomDialogController | ||||||
| 
 | 
 | ||||||
|   build() { |   build() { | ||||||
| @ -32,7 +38,8 @@ export default struct SignalTrajectoryDialog { | |||||||
|       Scroll() { |       Scroll() { | ||||||
|         Column() { |         Column() { | ||||||
|           SignalDisplayComponent({ |           SignalDisplayComponent({ | ||||||
|             active: this.active |             active: this.active, | ||||||
|  |             laneSignal: this.laneSignal | ||||||
|           }) |           }) | ||||||
|         }.height(890) |         }.height(890) | ||||||
|       }.width("100%") |       }.width("100%") | ||||||
|  | |||||||
| @ -14,6 +14,7 @@ struct TerminalInfoPage { | |||||||
|   @State config: EnvironmentConfigurationType = {} |   @State config: EnvironmentConfigurationType = {} | ||||||
|   private fileUtil!: FileUtils |   private fileUtil!: FileUtils | ||||||
|   private context = getContext(this) as common.UIAbilityContext; |   private context = getContext(this) as common.UIAbilityContext; | ||||||
|  |   @State isProcessing: boolean = false; | ||||||
| 
 | 
 | ||||||
|   async aboutToAppear() { |   async aboutToAppear() { | ||||||
|     this.fileUtil = new FileUtils(this.context) |     this.fileUtil = new FileUtils(this.context) | ||||||
| @ -39,6 +40,7 @@ struct TerminalInfoPage { | |||||||
|       Column() { |       Column() { | ||||||
|         Column() { |         Column() { | ||||||
|           Button().opacity(1).width(0).height(0) |           Button().opacity(1).width(0).height(0) | ||||||
|  |           Scroll() { | ||||||
|             Flex({ |             Flex({ | ||||||
|               wrap: FlexWrap.Wrap, |               wrap: FlexWrap.Wrap, | ||||||
|             }) { |             }) { | ||||||
| @ -146,6 +148,20 @@ struct TerminalInfoPage { | |||||||
|                   this.config.dnsServers = value; |                   this.config.dnsServers = value; | ||||||
|                 } |                 } | ||||||
|               }) |               }) | ||||||
|  |               blockComponent({ | ||||||
|  |                 label: "外壳版本", | ||||||
|  |                 value: this.config.version, | ||||||
|  |                 change: (value: string) => { | ||||||
|  |                   this.config.version = value; | ||||||
|  |                 } | ||||||
|  |               }) | ||||||
|  |               blockComponent({ | ||||||
|  |                 label: "评判版本", | ||||||
|  |                 value: this.config.judgeVersion, | ||||||
|  |                 change: (value: string) => { | ||||||
|  |                   this.config.judgeVersion = value; | ||||||
|  |                 } | ||||||
|  |               }) | ||||||
|               blockComponent({ |               blockComponent({ | ||||||
|                 label: "车型", |                 label: "车型", | ||||||
|                 type: 4, |                 type: 4, | ||||||
| @ -187,24 +203,36 @@ struct TerminalInfoPage { | |||||||
|                 } |                 } | ||||||
|               }) |               }) | ||||||
|               blockComponent({ |               blockComponent({ | ||||||
|               label: "是否开启调试", |                 label: "开启调试(重启APP)", | ||||||
|                 type: 6, |                 type: 6, | ||||||
|                 value: this.config.isOpenDebugger, |                 value: this.config.isOpenDebugger, | ||||||
|                 change: (value: string) => { |                 change: (value: string) => { | ||||||
|                   this.config.isOpenDebugger = value; |                   this.config.isOpenDebugger = value; | ||||||
|                 } |                 } | ||||||
|               }) |               }) | ||||||
|  |             }.margin(20) | ||||||
|  | 
 | ||||||
|           } |           } | ||||||
|           .backgroundColor("#282828") |  | ||||||
|           .height(650) |           .height(650) | ||||||
|  |           .width("100%") | ||||||
|  |           .backgroundColor("#282828") | ||||||
|           .borderRadius(20) |           .borderRadius(20) | ||||||
|           .margin(20) |           .margin(20) | ||||||
|           .padding({ |           .padding({ | ||||||
|             top: 10 |             top: 10 | ||||||
|           }) |           }) | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|           Row() { |           Row() { | ||||||
|             Image($r('app.media.bc')).height(80).objectFit(ImageFit.Contain).onClick(() => { |             Image($r('app.media.bc')).height(80).objectFit(ImageFit.Contain).onClick(() => { | ||||||
|  |               if (this.isProcessing) { | ||||||
|  |                 Prompt.showToast({ | ||||||
|  |                   message: "请勿频繁点击", | ||||||
|  |                   duration: 3000 | ||||||
|  |                 }) | ||||||
|  |                 return | ||||||
|  |               } | ||||||
|  |               this.isProcessing = true | ||||||
|               dConsole.log(TerminalInfoTag, "保存配置", JSON.stringify(this.config)) |               dConsole.log(TerminalInfoTag, "保存配置", JSON.stringify(this.config)) | ||||||
|               AppStorage.setOrCreate<EnvironmentConfigurationType>("EnvironmentConfiguration", this.config) |               AppStorage.setOrCreate<EnvironmentConfigurationType>("EnvironmentConfiguration", this.config) | ||||||
|               this.fileUtil.addFile(GlobalConfig.commonFileWriteAddress + '/config/ipConfig.txt', JSON.stringify(this.config)) |               this.fileUtil.addFile(GlobalConfig.commonFileWriteAddress + '/config/ipConfig.txt', JSON.stringify(this.config)) | ||||||
| @ -228,8 +256,13 @@ struct TerminalInfoPage { | |||||||
|                     message: '设置成功', |                     message: '设置成功', | ||||||
|                     duration: 3000 |                     duration: 3000 | ||||||
|                   }); |                   }); | ||||||
|  |                   //   延迟几秒 | ||||||
|  |                   setTimeout(() => { | ||||||
|  |                     this.isProcessing = false | ||||||
|  |                   }, 3000) | ||||||
|                 } |                 } | ||||||
|               }); |               }); | ||||||
|  | 
 | ||||||
|             }) |             }) | ||||||
|           } |           } | ||||||
|           .width("100%") |           .width("100%") | ||||||
|  | |||||||
| @ -28,7 +28,9 @@ export default struct SignalDisplayComponent { | |||||||
|   // 原始数据 |   // 原始数据 | ||||||
|   @State rawData: string = "$GPS,,,,,,,,,,,,,,,,,,,,,,,,,,,,," |   @State rawData: string = "$GPS,,,,,,,,,,,,,,,,,,,,,,,,,,,,," | ||||||
|   // 车道信息 |   // 车道信息 | ||||||
|   @State laneSignal: PerLane = InitialPerLane |   @Prop  laneSignal: PerLane | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
|   aboutToAppear(): void { |   aboutToAppear(): void { | ||||||
|     DifferentialAndSignal.onMsg(this.getMsg) |     DifferentialAndSignal.onMsg(this.getMsg) | ||||||
| @ -243,6 +245,7 @@ struct LaneComponent { | |||||||
|   ] |   ] | ||||||
| 
 | 
 | ||||||
|   getValues(roadColumn: RoadDataType) { |   getValues(roadColumn: RoadDataType) { | ||||||
|  |     dConsole.log(SignDisplayTag, "车道信息", this.laneSignal) | ||||||
|     let key = roadColumn.key; |     let key = roadColumn.key; | ||||||
|     let str = '' |     let str = '' | ||||||
|     if (Array.isArray(key)) { |     if (Array.isArray(key)) { | ||||||
|  | |||||||
| @ -285,6 +285,16 @@ export default class Judge { | |||||||
|     if (stachArr[0] != '#DN_GD' || this.isUdpEnd) { |     if (stachArr[0] != '#DN_GD' || this.isUdpEnd) { | ||||||
|       return |       return | ||||||
|     } |     } | ||||||
|  |     if (msg[336]) { | ||||||
|  |       if (msg[336] === "4") { | ||||||
|  |         dConsole.log(JudgeTag, "差分状态正常") | ||||||
|  |         this.judgeUI.isDwztRight = true | ||||||
|  |       } else { | ||||||
|  |         dConsole.log(JudgeTag, "差分状态异常") | ||||||
|  |         this.judgeUI.isDwztRight = false | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |     this.judgeUI.isDwztRight | ||||||
|     const plcData = await this.getPlcData(msg); |     const plcData = await this.getPlcData(msg); | ||||||
|     // 4.过程数据 |     // 4.过程数据 | ||||||
|     await this.fileLog?.setExamJudgeData(JSON.stringify(plcData)) |     await this.fileLog?.setExamJudgeData(JSON.stringify(plcData)) | ||||||
| @ -591,7 +601,7 @@ export default class Judge { | |||||||
|       num++ |       num++ | ||||||
|       // 4.过程数据 |       // 4.过程数据 | ||||||
|       this.tempData = msg |       this.tempData = msg | ||||||
|       this.judgeUI.isDwztRight = (msg?.gps?.dwzt == 4 && msg?.gps?.jdzt == 3); |       // this.judgeUI.isDwztRight = (msg?.gps?.dwzt == 4 && msg?.gps?.jdzt == 3); | ||||||
|       this.judgeUI.sd = Math.floor(msg?.gps?.sd * 1.852) + ''; |       this.judgeUI.sd = Math.floor(msg?.gps?.sd * 1.852) + ''; | ||||||
|       this.judgeUI.dw = Math.floor(msg?.sensor?.dw) + '' |       this.judgeUI.dw = Math.floor(msg?.sensor?.dw) + '' | ||||||
|       this.plcData = msg |       this.plcData = msg | ||||||
| @ -1075,7 +1085,6 @@ export default class Judge { | |||||||
|     const checkExamIsEnd = this.checkExamIsEnd |     const checkExamIsEnd = this.checkExamIsEnd | ||||||
|     const checkProjectIsStart = this.checkProjectIsStart |     const checkProjectIsStart = this.checkProjectIsStart | ||||||
|     const lane = this.lane |     const lane = this.lane | ||||||
|     const closeAllFiles = this.closeAllFiles |  | ||||||
| 
 | 
 | ||||||
|     const projectsObj: object = judgeUI.projectsObj |     const projectsObj: object = judgeUI.projectsObj | ||||||
|     const judgeConfigObj: object = judgeUI.judgeConfigObj |     const judgeConfigObj: object = judgeUI.judgeConfigObj | ||||||
| @ -1332,7 +1341,6 @@ export default class Judge { | |||||||
|     const avPlayer = this.avPlayer |     const avPlayer = this.avPlayer | ||||||
|     const judgeTask = this.judgeTask |     const judgeTask = this.judgeTask | ||||||
|     const isManual = this.isManual |     const isManual = this.isManual | ||||||
|     const closeAllFiles = this.closeAllFiles |  | ||||||
| 
 | 
 | ||||||
|     const judgeConfigObj = judgeUI.judgeConfigObj |     const judgeConfigObj = judgeUI.judgeConfigObj | ||||||
|     const examSubject = judgeUI.examSubject |     const examSubject = judgeUI.examSubject | ||||||
| @ -1354,7 +1362,7 @@ export default class Judge { | |||||||
|     if (!singlePlay && isManual && !isAllProjectsEnd) { |     if (!singlePlay && isManual && !isAllProjectsEnd) { | ||||||
|       avPlayer?.playAudio(['voice/empty.mp3'], true, () => { |       avPlayer?.playAudio(['voice/empty.mp3'], true, () => { | ||||||
|         this.isUdpEnd = true; |         this.isUdpEnd = true; | ||||||
|         closeAllFiles() |         dConsole.log(JudgeTag, "router back7") | ||||||
|         router.back(); |         router.back(); | ||||||
|       }) |       }) | ||||||
|       return |       return | ||||||
| @ -1396,7 +1404,6 @@ export default class Judge { | |||||||
|     const avPlayer = this.avPlayer |     const avPlayer = this.avPlayer | ||||||
|     const kfArr = this.kfArr |     const kfArr = this.kfArr | ||||||
|     const filePath = this.filePath |     const filePath = this.filePath | ||||||
|     const closeAllFiles = this.closeAllFiles |  | ||||||
| 
 | 
 | ||||||
|     const lsh = judgeUI.lsh; |     const lsh = judgeUI.lsh; | ||||||
|     const idCard = judgeUI.idCard; |     const idCard = judgeUI.idCard; | ||||||
| @ -1436,6 +1443,7 @@ export default class Judge { | |||||||
|       drvexam |       drvexam | ||||||
|     } |     } | ||||||
|     let backTimeOut = setTimeout(() => { |     let backTimeOut = setTimeout(() => { | ||||||
|  |       dConsole.log(JudgeTag, "router back6") | ||||||
|       router.back() |       router.back() | ||||||
|     }, 90 * 1000) |     }, 90 * 1000) | ||||||
|     const temp = await this.sendWriteObjectOut(data, filePath); |     const temp = await this.sendWriteObjectOut(data, filePath); | ||||||
| @ -1449,7 +1457,6 @@ export default class Judge { | |||||||
|         this.judgeUI.errorMsg = '当前的考试过程信息监管审核未通过,程序将退出!' |         this.judgeUI.errorMsg = '当前的考试过程信息监管审核未通过,程序将退出!' | ||||||
|       } |       } | ||||||
|       this.isUdpEnd = true; |       this.isUdpEnd = true; | ||||||
|       closeAllFiles() |  | ||||||
|       // this.judgeUI.loadingPopupVisible = false; |       // this.judgeUI.loadingPopupVisible = false; | ||||||
|       dConsole.log(JudgeTag, ' 关闭车辆loading1') |       dConsole.log(JudgeTag, ' 关闭车辆loading1') | ||||||
|       this.judgeUI.generateExamRecordsDialogController.close() |       this.judgeUI.generateExamRecordsDialogController.close() | ||||||
| @ -1536,7 +1543,7 @@ export default class Judge { | |||||||
|               if (kfArr && kfArr.length - 1 === index) { |               if (kfArr && kfArr.length - 1 === index) { | ||||||
|                 avPlayer?.playAudio([`voice/${kf.markcatalog}.mp3`, voiceURL], false, () => { |                 avPlayer?.playAudio([`voice/${kf.markcatalog}.mp3`, voiceURL], false, () => { | ||||||
|                   this.isUdpEnd = true; |                   this.isUdpEnd = true; | ||||||
|                   closeAllFiles() |                   dConsole.log(JudgeTag, "router back4") | ||||||
|                   router.back(); |                   router.back(); | ||||||
|                 }) |                 }) | ||||||
|                 throw new Error('End Loop') |                 throw new Error('End Loop') | ||||||
| @ -1545,7 +1552,7 @@ export default class Judge { | |||||||
|             } else { |             } else { | ||||||
|               avPlayer?.playAudio([`voice/${kf.markcatalog}.mp3`, voiceURL], false, () => { |               avPlayer?.playAudio([`voice/${kf.markcatalog}.mp3`, voiceURL], false, () => { | ||||||
|                 this.isUdpEnd = true; |                 this.isUdpEnd = true; | ||||||
|                 closeAllFiles() |                 dConsole.log(JudgeTag, "router back5") | ||||||
|                 router.back(); |                 router.back(); | ||||||
|               }) |               }) | ||||||
|               throw new Error('End Loop') |               throw new Error('End Loop') | ||||||
| @ -1559,9 +1566,10 @@ export default class Judge { | |||||||
|       avPlayer?.playAudio([voiceURL], true, () => { |       avPlayer?.playAudio([voiceURL], true, () => { | ||||||
|         setTimeout(() => { |         setTimeout(() => { | ||||||
|           this.isUdpEnd = true |           this.isUdpEnd = true | ||||||
|           closeAllFiles() |  | ||||||
|           dConsole.log(JudgeTag, ' 关闭车辆loading2') |           dConsole.log(JudgeTag, ' 关闭车辆loading2') | ||||||
|           this.judgeUI.generateExamRecordsDialogController.close() |           this.judgeUI.generateExamRecordsDialogController.close() | ||||||
|  |           dConsole.log(JudgeTag, "router back8") | ||||||
|  |           DifferentialAndSignal.clearMsg() | ||||||
|           router.back(); |           router.back(); | ||||||
|         }, param302 == '8' ? 3000 : 0) |         }, param302 == '8' ? 3000 : 0) | ||||||
|       }) |       }) | ||||||
| @ -1841,11 +1849,7 @@ export default class Judge { | |||||||
|         break; |         break; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   closeAllFiles = () => { | 
 | ||||||
|     setTimeout(() => { |  | ||||||
|       this.fileLog?.closeAllFiles() |  | ||||||
|     }, 1000) |  | ||||||
|   } |  | ||||||
| 
 | 
 | ||||||
|   //开始评判 |   //开始评判 | ||||||
|   private async judging(callBack: Function) { |   private async judging(callBack: Function) { | ||||||
| @ -1857,15 +1861,9 @@ export default class Judge { | |||||||
|     const kssycs = judgeUI.kssycs |     const kssycs = judgeUI.kssycs | ||||||
|     const manualMarkRules = judgeUI.manualMarkRules |     const manualMarkRules = judgeUI.manualMarkRules | ||||||
| 
 | 
 | ||||||
|     const fileLog = new FileLog(judgeUI.context); | 
 | ||||||
|     const filePath = await fileLog?.initFileLogo({ |  | ||||||
|       name, lsh, idCard |  | ||||||
|     }); |  | ||||||
|     this.fileLog = fileLog; |  | ||||||
|     this.filePath = filePath; |  | ||||||
| 
 | 
 | ||||||
|     const getJudgeBeginData = this.getJudgeBeginData; |     const getJudgeBeginData = this.getJudgeBeginData; | ||||||
|     const handleUdp = this.handleUdp; |  | ||||||
|     const handDistance = this.getJudgeBeginData; |     const handDistance = this.getJudgeBeginData; | ||||||
|     const handleTrajectoryUdp = this.handleTrajectoryUdp; |     const handleTrajectoryUdp = this.handleTrajectoryUdp; | ||||||
|     const isTrajectoryOpen = this.isTrajectoryOpen; |     const isTrajectoryOpen = this.isTrajectoryOpen; | ||||||
| @ -1919,6 +1917,8 @@ export default class Judge { | |||||||
|       this.judgeUI.jl = jl |       this.judgeUI.jl = jl | ||||||
|       //TODO 待优化 跨组件传值不生效 |       //TODO 待优化 跨组件传值不生效 | ||||||
|       // globalThis.laneData = performInfo.lane; |       // globalThis.laneData = performInfo.lane; | ||||||
|  |       dConsole.log(JudgeTag, "车道信息", performInfo.lane) | ||||||
|  |       this.judgeUI.laneSignal = performInfo.lane | ||||||
|     }) |     }) | ||||||
| 
 | 
 | ||||||
|     let beginExamInfo: JudgeBeginObj | undefined = undefined |     let beginExamInfo: JudgeBeginObj | undefined = undefined | ||||||
| @ -1929,7 +1929,6 @@ export default class Judge { | |||||||
|     } else { |     } else { | ||||||
|       beginExamInfo = await getJudgeBeginData() |       beginExamInfo = await getJudgeBeginData() | ||||||
|     } |     } | ||||||
|     await fileLog?.setExamJudgeData(JSON.stringify(beginExamInfo)) |  | ||||||
|     if (beginExamInfo) { |     if (beginExamInfo) { | ||||||
|       await examJudgeBeginExam(beginExamInfo); |       await examJudgeBeginExam(beginExamInfo); | ||||||
|     } |     } | ||||||
| @ -1961,7 +1960,7 @@ export default class Judge { | |||||||
|     DifferentialAndSignal.onMsg((data: string) => { |     DifferentialAndSignal.onMsg((data: string) => { | ||||||
|       const result: WorkerBackMessage = JSON.parse(data) |       const result: WorkerBackMessage = JSON.parse(data) | ||||||
|       if (result.type === WorkerBackMessageType.ObtainUdpData) { |       if (result.type === WorkerBackMessageType.ObtainUdpData) { | ||||||
|         handleUdp(result.data as string) |         this.handleUdp(result.data as string) | ||||||
|         dConsole.writeProcessData(ProcessDataEnumType.PlcData, result.data as string) |         dConsole.writeProcessData(ProcessDataEnumType.PlcData, result.data as string) | ||||||
|       } |       } | ||||||
|       //TODO UDP修改 |       //TODO UDP修改 | ||||||
|  | |||||||
| @ -29,8 +29,8 @@ export default class FileLog { | |||||||
|   } |   } | ||||||
|   // 无锡所接口数据 |   // 无锡所接口数据 | ||||||
|   public setExamJudgeWuxiData = async (str: string) => { |   public setExamJudgeWuxiData = async (str: string) => { | ||||||
|     this.examJudgeWuxiDataFd = |     // this.examJudgeWuxiDataFd = | ||||||
|       await this.fileUtil.editFile(`${this.folderPath}/wuxi_exam_data.txt`, str); |     //   await this.fileUtil.editFile(`${this.folderPath}/wuxi_exam_data.txt`, str); | ||||||
|   } |   } | ||||||
|   // 无锡所过程数据 |   // 无锡所过程数据 | ||||||
|   public setExamJudgeWuxiProgressData = async (str: string) => { |   public setExamJudgeWuxiProgressData = async (str: string) => { | ||||||
|  | |||||||
| @ -98,7 +98,40 @@ async function InitExam(dirName: string) { | |||||||
| 
 | 
 | ||||||
| // 写过程数据 | // 写过程数据 | ||||||
| async function WriteProcessData(type: ProcessDataEnumType, data: string) { | async function WriteProcessData(type: ProcessDataEnumType, data: string) { | ||||||
|  |   if (type === ProcessDataEnumType.WuxiExam) { | ||||||
|  |     //   改变数据为无锡所需要的数据 | ||||||
|  |     const plcData = data.split(','); | ||||||
|  |     const time = dayTs().format("YYYY-MM-DD HH:mm:ss") | ||||||
|  |     const lineData = [ | ||||||
|  |     /*帧头*/time, | ||||||
|  |       /*卫星时间*/time, | ||||||
|  |       /*经度*/ plcData[95], | ||||||
|  |       /*纬度*/ plcData[95], | ||||||
|  |       /*高度*/ plcData[86], | ||||||
|  |       /*方位角*/ 0, | ||||||
|  |       /*俯仰角*/ plcData[91], | ||||||
|  |       /*速度角*/'', | ||||||
|  |       /*速度*/  plcData[97], | ||||||
|  |       /*横滚*/'', | ||||||
|  |       /*卫星定位状态*/'', | ||||||
|  |       /*卫星定向状态*/'', | ||||||
|  |       /*前天线可用星数*/'', | ||||||
|  |       /*后天线可用星数*/'', | ||||||
|  |       /*东向位置坐标*/'', | ||||||
|  |       /*北向位置坐标*/'', | ||||||
|  |       /*天向位置坐标*/'', | ||||||
|  |       /*东向速度*/'', | ||||||
|  |       /*北向速度*/'', | ||||||
|  |       /*评判信号1*/[plcData[14], plcData[19], plcData[5], '', plcData[2], plcData[3], plcData[7], plcData[8], | ||||||
|  |         plcData[13], plcData[12], plcData[17], '', plcData[4], plcData[11], plcData[20], plcData[9], 0].join(','), | ||||||
|  |       /*评判信号2*/['', plcData[28], '', '', plcData[10], '', '', '', '', '', '', '', '', '', '', '', '', ''].join(','), | ||||||
|  |       /*发动机转速*/ plcData[25], | ||||||
|  |       /*结束符*/ time, | ||||||
|  |     ]; | ||||||
|  |     writeQueue.push({ type, data: JSON.stringify(lineData) }); | ||||||
|  |   } else { | ||||||
|     writeQueue.push({ type, data }); |     writeQueue.push({ type, data }); | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
|   if (!isProcessing) { |   if (!isProcessing) { | ||||||
|     processQueue(); |     processQueue(); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user