feat:版本号修改
This commit is contained in:
		
							parent
							
								
									5fba22c2ed
								
							
						
					
					
						commit
						9cf8b0dc58
					
				| @ -41,8 +41,8 @@ export default class GetDistance { | |||||||
|     console.info('surenjun',str) |     console.info('surenjun',str) | ||||||
|     const contentArr = content.split('\n').filter(item => item) |     const contentArr = content.split('\n').filter(item => item) | ||||||
|     console.info('surenjun contentArr',JSON.stringify(contentArr)) |     console.info('surenjun contentArr',JSON.stringify(contentArr)) | ||||||
|     this.totalDistance += str |     this.totalDistance += str * 1 | ||||||
|     contentArr[contentArr.length - 1] = `程序启动时间:${timeStr} 累计行驶距离:${this.totalDistance}m`+ '\n' |     contentArr[contentArr.length - 1] = `程序启动时间:${timeStr} 累计行驶距离:${(this.totalDistance).toFixed(2)}m`+ '\n' | ||||||
|     console.info('surenjun',contentArr.join('\n')) |     console.info('surenjun',contentArr.join('\n')) | ||||||
|     await fileUtil.addFile( |     await fileUtil.addFile( | ||||||
|       `${folderPath}/${date}.txt`,contentArr.join('\n') |       `${folderPath}/${date}.txt`,contentArr.join('\n') | ||||||
|  | |||||||
| @ -5,7 +5,7 @@ import { judgeConfig } from '../../pages/judgeSDK/utils/judgeConfig'; | |||||||
| import { setJudgeUdp, setTopLineUdp } from './GlobalUdp'; | import { setJudgeUdp, setTopLineUdp } from './GlobalUdp'; | ||||||
| import { convertGpsCoord2 } from '../utils/tools'; | import { convertGpsCoord2 } from '../utils/tools'; | ||||||
| import {examCalcGpsDistance} from '../../pages/judgeSDK/api' | import {examCalcGpsDistance} from '../../pages/judgeSDK/api' | ||||||
| import GetDistance from './GetDistance' | import GetDistance from '../utils/GetDistance' | ||||||
| export const initJudgeUdp = async () => { | export const initJudgeUdp = async () => { | ||||||
|   globalThis.serialIndex = 0; |   globalThis.serialIndex = 0; | ||||||
|   globalThis.udpIndex = 0; |   globalThis.udpIndex = 0; | ||||||
| @ -35,7 +35,7 @@ export const initJudgeUdp = async () => { | |||||||
|       const jd = convertGpsCoord2(msgArr[96]*1); |       const jd = convertGpsCoord2(msgArr[96]*1); | ||||||
|       const wd =  convertGpsCoord2(msgArr[95]*1 || 0); |       const wd =  convertGpsCoord2(msgArr[95]*1 || 0); | ||||||
|       udp.send(bytes) |       udp.send(bytes) | ||||||
|       if(prevJd){ |       if(prevJd && msgArr[83] == 4){ | ||||||
|         const distance = await examCalcGpsDistance({ |         const distance = await examCalcGpsDistance({ | ||||||
|           jd1:prevJd, |           jd1:prevJd, | ||||||
|           wd1:preWd, |           wd1:preWd, | ||||||
| @ -43,7 +43,11 @@ export const initJudgeUdp = async () => { | |||||||
|           wd2:wd, |           wd2:wd, | ||||||
|           h:msgArr[90]*1 || 1, |           h:msgArr[90]*1 || 1, | ||||||
|         }) |         }) | ||||||
|         globalThis.distanceClass.setTimeData(Math.floor(distance/100)) |         if(distance < 1){ | ||||||
|  |           return | ||||||
|  |         } | ||||||
|  |         //@ts-ignore
 | ||||||
|  |         globalThis.distanceClass.setTimeData(((distance / 100).toFixed(2)) * 1) | ||||||
|       } |       } | ||||||
|       prevJd = jd; |       prevJd = jd; | ||||||
|       preWd = wd; |       preWd = wd; | ||||||
| @ -59,7 +63,7 @@ export const getMessageHeartbeat = async (msg) => { | |||||||
|   const {fourInOneScreen:{gpsDigit}} = judgeConfig |   const {fourInOneScreen:{gpsDigit}} = judgeConfig | ||||||
|   const asclshArr = stringToASC(fillZero( |   const asclshArr = stringToASC(fillZero( | ||||||
|     globalThis.singlePlay |     globalThis.singlePlay | ||||||
|       ?'1111111111111' |       ? '1111111111111' | ||||||
|       : globalThis.lsh, |       : globalThis.lsh, | ||||||
|     13)); |     13)); | ||||||
|   const ascksyhArr = stringToASC(fillZero('1111111111111', 13)) |   const ascksyhArr = stringToASC(fillZero('1111111111111', 13)) | ||||||
| @ -70,7 +74,7 @@ export const getMessageHeartbeat = async (msg) => { | |||||||
|   const examType = examSubject == 2?2:3 |   const examType = examSubject == 2?2:3 | ||||||
|   const {sensor,gps} = tempData; |   const {sensor,gps} = tempData; | ||||||
|   const {zfxd,yfxd,shtd,ygd,jgd,skd,dh1,dh2,lhq,jsc,ssc,fsc,lb,mkg,aqd,ygq,cs,fdjzs} = sensor |   const {zfxd,yfxd,shtd,ygd,jgd,skd,dh1,dh2,lhq,jsc,ssc,fsc,lb,mkg,aqd,ygq,cs,fdjzs} = sensor | ||||||
|   const {jd,wd, hxj,  fyj,  hbg,} = gps |   const {jd,wd, hxj,  fyj,  hbg,sd} = gps | ||||||
|   const translateSignals = getTranslateSignals( |   const translateSignals = getTranslateSignals( | ||||||
|     [zfxd, yfxd, shtd, ygd, jgd, skd, dh1, dh2, lhq, jsc, ssc, fsc, lb, mkg, aqd, 0, 0, 0, 0, 0, 0, ygq, sensor.wd, 0] |     [zfxd, yfxd, shtd, ygd, jgd, skd, dh1, dh2, lhq, jsc, ssc, fsc, lb, mkg, aqd, 0, 0, 0, 0, 0, 0, ygq, sensor.wd, 0] | ||||||
|   ) |   ) | ||||||
| @ -81,6 +85,12 @@ export const getMessageHeartbeat = async (msg) => { | |||||||
|   const translateWd = convertGpsCoord2(jd).toFixed(gpsDigit) * Math.pow(10, gpsDigit) |   const translateWd = convertGpsCoord2(jd).toFixed(gpsDigit) * Math.pow(10, gpsDigit) | ||||||
|   //@ts-ignore
 |   //@ts-ignore
 | ||||||
|   const translateProjects = translateProject.map(numStr => string2Bytes(parseInt(numStr, 2), 8)[0]) |   const translateProjects = translateProject.map(numStr => string2Bytes(parseInt(numStr, 2), 8)[0]) | ||||||
|  |   //@ts-ignore
 | ||||||
|  |   let tempSd = (sd * 1.852).toFixed(0) * 1 | ||||||
|  |   if(tempSd < 1){ | ||||||
|  |     tempSd = 0 | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   const arr = [ |   const arr = [ | ||||||
|   //考生号
 |   //考生号
 | ||||||
|     asclshArr.map(lsh => string2Bytes(lsh, 8)[0]), |     asclshArr.map(lsh => string2Bytes(lsh, 8)[0]), | ||||||
| @ -92,7 +102,7 @@ export const getMessageHeartbeat = async (msg) => { | |||||||
|     string2Bytes(serialIndex, 2 * 8), |     string2Bytes(serialIndex, 2 * 8), | ||||||
|     translateSignals, |     translateSignals, | ||||||
|     //@ts-ignore
 |     //@ts-ignore
 | ||||||
|     string2Bytes(Math.floor(gps.sd*1.852) * 100, 2 * 8), string2Bytes(fdjzs / 100, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8), |     string2Bytes(tempSd * 100, 2 * 8), string2Bytes(fdjzs / 100, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8), | ||||||
|     //GPS东向距离
 |     //GPS东向距离
 | ||||||
|     string2Bytes(0, 4 * 8), |     string2Bytes(0, 4 * 8), | ||||||
|     //GPS北向距离
 |     //GPS北向距离
 | ||||||
|  | |||||||
| @ -8,7 +8,7 @@ import AmplifyPopup from './compontents/judge/AmplifyPopup'; | |||||||
| import Judge from './judgeSDK/judge'; | import Judge from './judgeSDK/judge'; | ||||||
| import { defaultJudgeConfigObj } from './judgeSDK/utils//judgeCommon'; | import { defaultJudgeConfigObj } from './judgeSDK/utils//judgeCommon'; | ||||||
| import {uploadExamMileage} from '../api/judge' | import {uploadExamMileage} from '../api/judge' | ||||||
| 
 | import DwztErrorPopup from './compontents/judge/DwztErrorPopup' | ||||||
| import { | import { | ||||||
|   CARINFO, |   CARINFO, | ||||||
|   CDSBInfo, |   CDSBInfo, | ||||||
| @ -874,7 +874,6 @@ struct Index { | |||||||
|         }.width('100%').height('100%').position({ y: 0 }).backgroundColor('rgba(0,0,0,0.6)') |         }.width('100%').height('100%').position({ y: 0 }).backgroundColor('rgba(0,0,0,0.6)') | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|       //科目三人工项目确认框 |       //科目三人工项目确认框 | ||||||
|       if (this.isAmplifyPopShow && this.examSubject == 3) { |       if (this.isAmplifyPopShow && this.examSubject == 3) { | ||||||
|         AmplifyPopup({ |         AmplifyPopup({ | ||||||
| @ -920,6 +919,20 @@ struct Index { | |||||||
|           title: '正在生成考试记录,请稍后...', |           title: '正在生成考试记录,请稍后...', | ||||||
|         }) |         }) | ||||||
|       } |       } | ||||||
|  | 
 | ||||||
|  |       if(this.dwztErrorVisible){ | ||||||
|  |         DwztErrorPopup({ | ||||||
|  |           title:'当前差分状态异常,学员将无法正常进行考试评判,请将车辆行驶到开阔地,等待程序自检,差分正常后会自动关闭该对话框', | ||||||
|  |           cancelFn:()=>{ | ||||||
|  |             this.dwztErrorVisible = false; | ||||||
|  |           }, | ||||||
|  |           confirmFn:()=>{ | ||||||
|  |             clearInterval(this.timer); | ||||||
|  |             clearInterval(globalThis.judgeTimer) | ||||||
|  |             this.judge.checkExamIsEnd(true); | ||||||
|  |           }, | ||||||
|  |         }) | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|     .height('100%').backgroundColor('#000').justifyContent(FlexAlign.Start) |     .height('100%').backgroundColor('#000').justifyContent(FlexAlign.Start) | ||||||
|   } |   } | ||||||
| @ -995,6 +1008,7 @@ struct Index { | |||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   // 获取是否能人工进项目 |   // 获取是否能人工进项目 | ||||||
|   getIsExitManualProject = (index: number) => { |   getIsExitManualProject = (index: number) => { | ||||||
|     const { |     const { | ||||||
| @ -1077,6 +1091,7 @@ struct Index { | |||||||
| 
 | 
 | ||||||
|     return true |     return true | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   // 判断项目是否在当前路段号 |   // 判断项目是否在当前路段号 | ||||||
|   getProjectIsInRoad = (projectCode: string,) => { |   getProjectIsInRoad = (projectCode: string,) => { | ||||||
|     const { |     const { | ||||||
| @ -1136,6 +1151,7 @@ struct Index { | |||||||
|     return true |     return true | ||||||
| 
 | 
 | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   // 获取人工项目是否已做 |   // 获取人工项目是否已做 | ||||||
|   getIsEndManualProject = (index: number) => { |   getIsEndManualProject = (index: number) => { | ||||||
|     const projectName = this.artSubject3Projects[index]; |     const projectName = this.artSubject3Projects[index]; | ||||||
| @ -1146,6 +1162,7 @@ struct Index { | |||||||
|     } |     } | ||||||
|     return (type == '3' || type == '4') ? `${projectName}_red` : `${projectName}_green`; |     return (type == '3' || type == '4') ? `${projectName}_red` : `${projectName}_green`; | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   scroller: Scroller = new Scroller() |   scroller: Scroller = new Scroller() | ||||||
|   //页面通用字体大小 |   //页面通用字体大小 | ||||||
|   @State wayno: number = 0 |   @State wayno: number = 0 | ||||||
| @ -1244,4 +1261,5 @@ struct Index { | |||||||
|   @State sd: string = '' |   @State sd: string = '' | ||||||
|   @State mileageTimer: number = 0; |   @State mileageTimer: number = 0; | ||||||
|   @State passingScore: number = 80 |   @State passingScore: number = 80 | ||||||
|  |   @State dwztErrorVisible: boolean = false; | ||||||
| } | } | ||||||
|  | |||||||
| @ -0,0 +1,25 @@ | |||||||
|  | 
 | ||||||
|  | @Component | ||||||
|  | export default struct  DwztErrorPop{ | ||||||
|  |   constructor() { | ||||||
|  |     super() | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   private title:string = '' | ||||||
|  |   private cancelFn:(event?: ClickEvent) => void | ||||||
|  |   private confirmFn:(event?: ClickEvent) => void | ||||||
|  | 
 | ||||||
|  |   build(){ | ||||||
|  |     Column(){ | ||||||
|  |       Column(){ | ||||||
|  |         Text(this.title).fontSize(36).margin({bottom:20}) | ||||||
|  |         Row(){}.height(100) | ||||||
|  |         Row(){ | ||||||
|  |           Text('继续考试').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(250).height(95).fontSize(28).fontColor('#FFF').textAlign(TextAlign.Center).onClick(this.cancelFn) | ||||||
|  |           Text('结束考试').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(250).height(95).fontSize(28).fontColor('#FFF').textAlign(TextAlign.Center).margin({left:45}).onClick(this.confirmFn) | ||||||
|  |         } | ||||||
|  |       }.width('75%').height('70%').backgroundColor('#E6E3DF').borderRadius(38).position({y:'12%',x:'12.5%'}).justifyContent(FlexAlign.Center) | ||||||
|  | 
 | ||||||
|  |     }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)') | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -209,3 +209,5 @@ export interface LANE { | |||||||
| export interface ProjectObj { | export interface ProjectObj { | ||||||
|   [k: string]: Project |   [k: string]: Project | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | |||||||
| @ -558,7 +558,7 @@ export const testUIAllitems = [ | |||||||
| ] | ] | ||||||
| 
 | 
 | ||||||
| export const wuxiKm3Items = [ | export const wuxiKm3Items = [ | ||||||
| //3,5,9,12,14,15,16,
 |     //3,5,9,12,14,15,16,
 | ||||||
|     {projectCode:'1',projectCodeCenter:'40100',name:'上车准备',abbreviation:'上车准备'}, |     {projectCode:'1',projectCodeCenter:'40100',name:'上车准备',abbreviation:'上车准备'}, | ||||||
|     {projectCode:'2',projectCodeCenter:'40200',name:'起步',abbreviation:'起步'}, |     {projectCode:'2',projectCodeCenter:'40200',name:'起步',abbreviation:'起步'}, | ||||||
|     {projectCode:'3',projectCodeCenter:'40300',name:'直线行驶',abbreviation:'直线行驶'}, |     {projectCode:'3',projectCodeCenter:'40300',name:'直线行驶',abbreviation:'直线行驶'}, | ||||||
|  | |||||||
| @ -72,7 +72,6 @@ export default class Judge { | |||||||
|     this.xmmcCode = ''; |     this.xmmcCode = ''; | ||||||
|     this.carztStr = ''; |     this.carztStr = ''; | ||||||
|     this.testKmItems = {}; |     this.testKmItems = {}; | ||||||
| 
 |  | ||||||
|     // 考试回放配置
 |     // 考试回放配置
 | ||||||
|     const {isTrajectoryOpen,modelPath,trajectoryPath} = judgeConfig |     const {isTrajectoryOpen,modelPath,trajectoryPath} = judgeConfig | ||||||
|     this.isTrajectoryOpen = isTrajectoryOpen; |     this.isTrajectoryOpen = isTrajectoryOpen; | ||||||
| @ -91,7 +90,6 @@ export default class Judge { | |||||||
|         // status: projectsCenterObj[item.code]?.isRequired ? 1 : 0
 |         // status: projectsCenterObj[item.code]?.isRequired ? 1 : 0
 | ||||||
|       } |       } | ||||||
|     }) |     }) | ||||||
| 
 |  | ||||||
|     console.info(judgeTag+'testKmItems',JSON.stringify(this.testKmItems)) |     console.info(judgeTag+'testKmItems',JSON.stringify(this.testKmItems)) | ||||||
|     this.isExamEnd = false; |     this.isExamEnd = false; | ||||||
|   } |   } | ||||||
| @ -164,7 +162,7 @@ export default class Judge { | |||||||
|     await fileLog.setExamJudgeData(beginExamInfo) |     await fileLog.setExamJudgeData(beginExamInfo) | ||||||
|     await examJudgeBeginExam(beginExamInfo); |     await examJudgeBeginExam(beginExamInfo); | ||||||
|     console.info(judgeTag, '6.开始考试注册完成') |     console.info(judgeTag, '6.开始考试注册完成') | ||||||
|     avPlayer.playAudio([globalThis.singlePlay?'voice/ksks.WAV':'voice/监管成功.mp3']) |     avPlayer.playAudio([globalThis.singlePlay ? 'voice/ksks.WAV' : 'voice/监管成功.mp3']) | ||||||
|     this.judgeUI.draw = true |     this.judgeUI.draw = true | ||||||
|     // 处理轨迹plc信息
 |     // 处理轨迹plc信息
 | ||||||
|     if (isTrajectoryOpen) { |     if (isTrajectoryOpen) { | ||||||
| @ -178,6 +176,8 @@ export default class Judge { | |||||||
|       handleUdp(msg) |       handleUdp(msg) | ||||||
|     }) |     }) | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|     //TODO 监听远程扣分
 |     //TODO 监听远程扣分
 | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @ -380,7 +380,7 @@ export default class Judge { | |||||||
|       case 5: |       case 5: | ||||||
|         this.ksjs = ksjs; |         this.ksjs = ksjs; | ||||||
|         await fileLog.setExamJudgeData({ |         await fileLog.setExamJudgeData({ | ||||||
|           method: 'examjudgeEndExam', |           method: 'examJudgeEndExam', | ||||||
|         }) |         }) | ||||||
|         break; |         break; | ||||||
| 
 | 
 | ||||||
| @ -504,8 +504,9 @@ export default class Judge { | |||||||
|       case 3: |       case 3: | ||||||
|       //扣分时实时播报语音(0-否+1-是)
 |       //扣分时实时播报语音(0-否+1-是)
 | ||||||
|         const currentKf = kf[kfLen -1]; |         const currentKf = kf[kfLen -1]; | ||||||
|         if (judgeConfigObj['418'] == '1' && judgeConfig.kfVoiceOpen) { |         if (judgeConfig.kfVoiceOpen ||(examSubject == 2 && judgeConfigObj['618'] == '1') || (examSubject== 3&& judgeConfigObj['418'] == '1') ) { | ||||||
|           avPlayer.playAudio([`voice/${currentKf.markcatalog}.mp3`]) |           avPlayer.playAudio([`voice/${currentKf.markcatalog}.mp3`,`voice/mark_${Math.abs(currentKf.score)}.mp3`]) | ||||||
|  | 
 | ||||||
|         } |         } | ||||||
|         const isStart = await checkProjectIsStart(currentKf.xmdm,2,currentKf); |         const isStart = await checkProjectIsStart(currentKf.xmdm,2,currentKf); | ||||||
|         if(isStart){ |         if(isStart){ | ||||||
| @ -709,7 +710,7 @@ export default class Judge { | |||||||
|     const photoBase64 = await getPhoto(); |     const photoBase64 = await getPhoto(); | ||||||
|     const carInfo = globalThis.carInfo; |     const carInfo = globalThis.carInfo; | ||||||
|     const { examSubject,plateNo,carNo } = carInfo; |     const { examSubject,plateNo,carNo } = carInfo; | ||||||
|     const {lsh,idCard,serialNumber,projectsObj,ksdd} = judgeUI; |     const {lsh,idCard,serialNumber,projectsObj,ksdd,judgeConfigObj} = judgeUI; | ||||||
|     const {sensor,gps} = plcData |     const {sensor,gps} = plcData | ||||||
|     const project = projectsObj[ksxm] |     const project = projectsObj[ksxm] | ||||||
| 
 | 
 | ||||||
| @ -724,7 +725,7 @@ export default class Judge { | |||||||
|         zpsj: time, |         zpsj: time, | ||||||
|         //@ts-ignore
 |         //@ts-ignore
 | ||||||
|         zp: photoBase64, |         zp: photoBase64, | ||||||
|         cs: Math.floor(gps.sd * 1.852), |         cs: Math.floor((judgeConfigObj['350'] == 0?gps.sd:sensor.cs) * 1.852), | ||||||
|         ksdd: encodeURI(ksdd) |         ksdd: encodeURI(ksdd) | ||||||
|       } |       } | ||||||
|     }; |     }; | ||||||
| @ -870,7 +871,7 @@ export default class Judge { | |||||||
|       } |       } | ||||||
|     } |     } | ||||||
|     await handleSEP(306); |     await handleSEP(306); | ||||||
|     avPlayer.playAudio(['voice/exam_waiting.mp3'], true, async () => { |     avPlayer.playAudio(['voice/exam_waiting.mp3'], globalThis.singlePlay, async () => { | ||||||
|       try { |       try { | ||||||
|         if (!singlePlay) { |         if (!singlePlay) { | ||||||
|           const bytes = await this.getMessageHeartbeat(true); |           const bytes = await this.getMessageHeartbeat(true); | ||||||
| @ -1054,7 +1055,7 @@ export default class Judge { | |||||||
|       getSbxh |       getSbxh | ||||||
|     } = this; |     } = this; | ||||||
|     const singlePlay = globalThis.singlePlay |     const singlePlay = globalThis.singlePlay | ||||||
|     const {lsh,startHourTime,totalScore,examTime} = judgeUI; |     const {lsh,startHourTime,totalScore,examTime,judgeConfigObj} = judgeUI; | ||||||
|     const {fourInOneScreen:{gpsDigit}} = judgeConfig |     const {fourInOneScreen:{gpsDigit}} = judgeConfig | ||||||
|     const examType = examSubject == 2?2:3 |     const examType = examSubject == 2?2:3 | ||||||
|     const {sensor,gps} = tempData; |     const {sensor,gps} = tempData; | ||||||
| @ -1062,12 +1063,12 @@ export default class Judge { | |||||||
|       return |       return | ||||||
|     } |     } | ||||||
|     const {zfxd,yfxd,shtd,ygd,jgd,skd,dh1,dh2,lhq,jsc,ssc,fsc,lb,mkg,aqd,ygq,cs,fdjzs,dw} = sensor |     const {zfxd,yfxd,shtd,ygd,jgd,skd,dh1,dh2,lhq,jsc,ssc,fsc,lb,mkg,aqd,ygq,cs,fdjzs,dw} = sensor | ||||||
|     const {jd,wd, hxj,  fyj,  hbg,} = gps |     const {jd,wd, hxj,  fyj,  hbg,sd} = gps | ||||||
|     const translateProject = getTranslateProject(); |     const translateProject = getTranslateProject(); | ||||||
|     const sbxh = getSbxh(xmdm, xmxh) |     const sbxh = getSbxh(xmdm, xmxh) | ||||||
|     const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo || {}; |     const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo || {}; | ||||||
|     const asclshArr = stringToASC( |     const asclshArr = stringToASC( | ||||||
|       fillZero((singlePlay?1111111111111:lsh) || 0, 13) |       fillZero((singlePlay ? 1111111111111 : lsh) || 0, 13) | ||||||
|     ); |     ); | ||||||
|     //13不足要补0
 |     //13不足要补0
 | ||||||
|     const ascksyhArr = stringToASC(fillZero(ksyh || 0, 13)) |     const ascksyhArr = stringToASC(fillZero(ksyh || 0, 13)) | ||||||
| @ -1081,6 +1082,14 @@ export default class Judge { | |||||||
|     const translateWd = convertGpsCoord2(jd).toFixed(gpsDigit) * Math.pow(10, gpsDigit) |     const translateWd = convertGpsCoord2(jd).toFixed(gpsDigit) * Math.pow(10, gpsDigit) | ||||||
|     //@ts-ignore
 |     //@ts-ignore
 | ||||||
|     const translateProjects = translateProject.map(numStr => string2Bytes(parseInt(numStr, 2), 8)[0]) |     const translateProjects = translateProject.map(numStr => string2Bytes(parseInt(numStr, 2), 8)[0]) | ||||||
|  | 
 | ||||||
|  |     //@ts-ignore
 | ||||||
|  |     let tempSd = ((judgeConfigObj['350'] ==0 ? sd : cs) * 1.852).toFixed(0) * 1 | ||||||
|  |     console.info(judgeTag + "prevSD",tempSd); | ||||||
|  |     if(tempSd < 1){ | ||||||
|  |       tempSd = 0 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     const arr = [ |     const arr = [ | ||||||
|       //考生号
 |       //考生号
 | ||||||
|       asclshArr.map(lsh => string2Bytes(lsh, 8)[0]), |       asclshArr.map(lsh => string2Bytes(lsh, 8)[0]), | ||||||
| @ -1094,7 +1103,7 @@ export default class Judge { | |||||||
|       translateSignals, |       translateSignals, | ||||||
|       //速度                                                发动机转速                          GPS纬度                         GPS经度                         主天线位置
 |       //速度                                                发动机转速                          GPS纬度                         GPS经度                         主天线位置
 | ||||||
|       //@ts-ignore
 |       //@ts-ignore
 | ||||||
|       string2Bytes(cs * 100, 2 * 8), string2Bytes(fdjzs / 100, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8), |       string2Bytes(tempSd * 100, 2 * 8), string2Bytes(fdjzs / 100, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8), | ||||||
|       //GPS东向距离
 |       //GPS东向距离
 | ||||||
|       string2Bytes(dxjl < 0 ? (dxjl + 4294967296) : dxjl, 4 * 8), |       string2Bytes(dxjl < 0 ? (dxjl + 4294967296) : dxjl, 4 * 8), | ||||||
|       //GPS北向距离
 |       //GPS北向距离
 | ||||||
| @ -1316,7 +1325,7 @@ export default class Judge { | |||||||
|   // 处理udp plc信号
 |   // 处理udp plc信号
 | ||||||
|   handleUdp = async (msg) => { |   handleUdp = async (msg) => { | ||||||
|     console.info('plc信号', msg) |     console.info('plc信号', msg) | ||||||
|     const {fileLog,getPlcData,usbService,isUdpEnd,isExamEnd} = this |     const {fileLog,getPlcData,usbService,isUdpEnd,isExamEnd,judgeUI} = this | ||||||
|     const stachArr = msg.split(',') |     const stachArr = msg.split(',') | ||||||
|     if (stachArr[0] != '#DN_GD' || isUdpEnd) { |     if (stachArr[0] != '#DN_GD' || isUdpEnd) { | ||||||
|       return |       return | ||||||
| @ -1330,8 +1339,12 @@ export default class Judge { | |||||||
|       usbService.sendUSB(str) |       usbService.sendUSB(str) | ||||||
|     } |     } | ||||||
|     this.judgeUI.isDwztRight = plcData.gps.dwzt == 4; |     this.judgeUI.isDwztRight = plcData.gps.dwzt == 4; | ||||||
|     this.judgeUI.sd = (Math.floor(((plcData.gps.sd as number) || 0) * 1.852))  + ''; |     const param350 = judgeUI.judgeConfigObj['350'] | ||||||
|  |     //@ts-ignore
 | ||||||
|  |     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) + '' |     this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + '' | ||||||
|  | 
 | ||||||
|  |     await this.checkDwzt(plcData.gps.dwzt); | ||||||
|     if(!isExamEnd){ |     if(!isExamEnd){ | ||||||
|       await examJudgeRealExam(plcData) |       await examJudgeRealExam(plcData) | ||||||
|     } |     } | ||||||
| @ -1401,7 +1414,7 @@ export default class Judge { | |||||||
|       // 4.过程数据
 |       // 4.过程数据
 | ||||||
|       this.tempData = msg |       this.tempData = msg | ||||||
|       this.judgeUI.isDwztRight = msg?.gps?.dwzt == 4; |       this.judgeUI.isDwztRight = msg?.gps?.dwzt == 4; | ||||||
|       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 | ||||||
|       // this.judgeUI.isDwztRight = msg.gps.dwzt == 4;
 |       // this.judgeUI.isDwztRight = msg.gps.dwzt == 4;
 | ||||||
| @ -1454,10 +1467,22 @@ export default class Judge { | |||||||
|     this.mndgStr = mndgStr |     this.mndgStr = mndgStr | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // 路段信息处理
 |   // 检测差分状态
 | ||||||
|   setRoadAndLane = async (lane) => { |   checkDwzt = async (dwzt) => { | ||||||
|     const {road,num,count} = lane; |     const {avPlayer} = this; | ||||||
| 
 |     const judgeConfig = this.judgeUI.judgeConfig; | ||||||
|  |     // const param499 = judgeConfig['499']
 | ||||||
|  |     //10秒内dwzt不为4;
 | ||||||
|  |     const dwztNum = this.dwztNum | ||||||
|  |     if(dwztNum != 0 && (dwztNum % (5 * 10) == 0)){ | ||||||
|  |       this.judgeUI.dwztErrorVisible = true; | ||||||
|  |       avPlayer.playAudio([`voice/差分状态异常.mp3`],true) | ||||||
|  |     } | ||||||
|  |     if(dwzt != 4){ | ||||||
|  |       this.dwztNum += 1 | ||||||
|  |     }else{ | ||||||
|  |       this.dwztNum = 0; | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   public plcStr: string |   public plcStr: string | ||||||
| @ -1465,6 +1490,7 @@ export default class Judge { | |||||||
|   private fileLog |   private fileLog | ||||||
|   private filePath |   private filePath | ||||||
|   private totalScore: number |   private totalScore: number | ||||||
|  |   private dwztNum:number = 0 | ||||||
|   private folderPath: string |   private folderPath: string | ||||||
|   private modelPath: string |   private modelPath: string | ||||||
|   private avPlayer |   private avPlayer | ||||||
|  | |||||||
| @ -434,25 +434,25 @@ export function sendRed(){ | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export const defaultJudgeConfigObj = { | export const defaultJudgeConfigObj = { | ||||||
|   //结束考试方式 0-不合格继续 1-考试不合格报靠边停车 2-不合格不报靠边 3-训练不合格报靠边 4-自动退出 5-不合格自动退出
 | //结束考试方式 0-不合格继续 1-考试不合格报靠边停车 2-不合格不报靠边 3-训练不合格报靠边 4-自动退出 5-不合格自动退出
 | ||||||
|   302:'5', |   302:'5', | ||||||
|   332:'', |   332:'', | ||||||
|   //是否能进行人工操作 0-不能人工评判 1-不能人工进项目 3-都不能
 | //是否能进行人工操作 0-不能人工评判 1-不能人工进项目 3-都不能
 | ||||||
|   342:'', |   342:'', | ||||||
|   //有项目未结束时可以靠边停车 0-否 1-是
 | //有项目未结束时可以靠边停车 0-否 1-是
 | ||||||
|   343:'1', |   343:'1', | ||||||
|   //考试未结束且有扣分,是否可以退出
 | //考试未结束且有扣分,是否可以退出
 | ||||||
|   344:'0', |   344:'0', | ||||||
|   //直线行驶中是否可以进其它项目 0-否 1-是
 | //直线行驶中是否可以进其它项目 0-否 1-是
 | ||||||
|   348:'0', |   348:'0', | ||||||
|   //车上是否能点结束考试 0:否 1:是
 | //车上是否能点结束考试 0:否 1:是
 | ||||||
|   353:'0', |   353:'0', | ||||||
|   //是否启动断电续考    0:否 1:是
 | //是否启动断电续考    0:否 1:是
 | ||||||
|   369:'1', |   369:'1', | ||||||
|   //是否显示应考里程
 | //是否显示应考里程
 | ||||||
|   375:'0', |   375:'0', | ||||||
|   //里程不够允许手工点靠边停车
 | //里程不够允许手工点靠边停车
 | ||||||
|   387:'0', |   387:'0', | ||||||
|   //监管模式有扣分续考(0-否++1-是+把上次未考完的扣分带下来重新考试)
 | //监管模式有扣分续考(0-否++1-是+把上次未考完的扣分带下来重新考试)
 | ||||||
|   432:'1' |   432:'1' | ||||||
| } | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user