外殼修改
This commit is contained in:
		
						commit
						56369ec982
					
				| @ -26,7 +26,6 @@ export async function writeObjectOut(params,filePath?:string): Promise<WR> { | |||||||
|   if (singlePlay) { |   if (singlePlay) { | ||||||
|     return {code:1} |     return {code:1} | ||||||
|   } |   } | ||||||
| 
 |  | ||||||
|   //获取监管接口地址路径
 |   //获取监管接口地址路径
 | ||||||
|   if (!globalThis.JGPATH) { |   if (!globalThis.JGPATH) { | ||||||
|     const syssetParams = await getSyncData('MA_SYSSET') || []; |     const syssetParams = await getSyncData('MA_SYSSET') || []; | ||||||
| @ -47,7 +46,11 @@ export async function writeObjectOut(params,filePath?:string): Promise<WR> { | |||||||
|     return await writeObjectOutNew(params,filePath) |     return await writeObjectOutNew(params,filePath) | ||||||
|   } |   } | ||||||
|   drvexam.zp = drvexam.zp === undefined ? undefined : encodeURIComponent( drvexam.zp) |   drvexam.zp = drvexam.zp === undefined ? undefined : encodeURIComponent( drvexam.zp) | ||||||
|   const drvexamArrs = Reflect.ownKeys(drvexam).map((key: string) => (`<${key}>${drvexam[key]}</${key}>`)); | 
 | ||||||
|  |   const drvexamArrs = Reflect.ownKeys(drvexam) | ||||||
|  |     .filter(dKey => drvexam[dKey] != undefined) | ||||||
|  |     .map((key: string) => ( | ||||||
|  |     `<${key}>${drvexam[key]}</${key}>`)); | ||||||
| 
 | 
 | ||||||
|   if(filePath){ |   if(filePath){ | ||||||
|     const fileUtil = new FileUtil(globalThis.context); |     const fileUtil = new FileUtil(globalThis.context); | ||||||
|  | |||||||
| @ -291,27 +291,27 @@ export async function setJudgeUdp() { | |||||||
|   let udpIndex = 0; |   let udpIndex = 0; | ||||||
|   let currentUdpIndex = 0; |   let currentUdpIndex = 0; | ||||||
|   let judgeUdpTimer |   let judgeUdpTimer | ||||||
|   clearInterval(judgeUdpTimer) |   clearInterval(globalThis.judgeUdpTimer) | ||||||
|   judgeUdpTimer = setInterval(() => { |   globalThis.judgeUdpTimer = setInterval(() => { | ||||||
|     udpIndex += 1; |     udpIndex += 1; | ||||||
|   }, 1000); |   }, 1000); | ||||||
| 
 | 
 | ||||||
|   if (config && config.udplocalIp) { |   if (config && config.udplocalIp) { | ||||||
|     const {udplocalIp} = config; |     const {udplocalIp} = config; | ||||||
|     const udpClientbyCenter: UdpClientByCenter = new UdpClientByCenter(udplocalIp, '8080', globalThis.carInfo?.gpsAddress, globalThis.carInfo?.hintPort) |     const udpClientbyCenter: UdpClientByCenter = new UdpClientByCenter(udplocalIp, '8080', globalThis.carInfo?.gpsAddress, globalThis.carInfo?.hintPort) | ||||||
|  |     await udpClientbyCenter.onError_Callback(()=>{}) | ||||||
|     await udpClientbyCenter.bindUdp() |     await udpClientbyCenter.bindUdp() | ||||||
|     await udpClientbyCenter.onMessage_2((val) => { |     await udpClientbyCenter.onMessage_2((val) => {}) | ||||||
|       console.log('valval', val) |  | ||||||
| 
 |  | ||||||
|     }) |  | ||||||
|     // globalThis.judgeUdpClient = udpClientbyCenter;
 |     // globalThis.judgeUdpClient = udpClientbyCenter;
 | ||||||
|     return { |     return { | ||||||
|       send(bytes) { |       send(bytes) { | ||||||
|         if (udpIndex > currentUdpIndex) { |         if (udpIndex > currentUdpIndex) { | ||||||
|           udpClientbyCenter.sendMsgExt({ id: 45, |           udpClientbyCenter.sendMsgExt({ | ||||||
|  |             id: 45, | ||||||
|             list: bytes, |             list: bytes, | ||||||
|             carNo: globalThis.carInfo.carNo, |             carNo: globalThis.carInfo.carNo, | ||||||
|             placeId: globalThis.carInfo.examinationRoomId }) |             placeId: globalThis.carInfo.examinationRoomId | ||||||
|  |           }) | ||||||
|           currentUdpIndex = udpIndex |           currentUdpIndex = udpIndex | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|  | |||||||
| @ -22,6 +22,7 @@ import { fillZero, string2Bytes } from '../utils/tools' | |||||||
| const TAG = '[UdpDemo.UdpClient]' | const TAG = '[UdpDemo.UdpClient]' | ||||||
| import hilog from '@ohos.hilog'; | import hilog from '@ohos.hilog'; | ||||||
| import prompt from '@ohos.prompt' | import prompt from '@ohos.prompt' | ||||||
|  | import promptAction from '@ohos.promptAction'; | ||||||
| import { getUDP } from './GlobalUdp'; | import { getUDP } from './GlobalUdp'; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -179,6 +180,10 @@ export default class UdpClientByCenter { | |||||||
|       console.log(`${TAG}getUDPudpCLient udp send success:oppositeIp${this.oppositeIp},oppositeIpPort:${this.oppositeIpPort},localIp:${this.localIp},localIpPort,${this.localIpPort}`); |       console.log(`${TAG}getUDPudpCLient udp send success:oppositeIp${this.oppositeIp},oppositeIpPort:${this.oppositeIpPort},localIp:${this.localIp},localIpPort,${this.localIpPort}`); | ||||||
|     }).catch(err => { |     }).catch(err => { | ||||||
|       console.log(`${TAG}getUDPudpCLient udp send fail:oppositeIp${this.oppositeIp},oppositeIpPort:${this.oppositeIpPort},localIp:${this.localIp},localIpPort,${this.localIpPort}`); |       console.log(`${TAG}getUDPudpCLient udp send fail:oppositeIp${this.oppositeIp},oppositeIpPort:${this.oppositeIpPort},localIp:${this.localIp},localIpPort,${this.localIpPort}`); | ||||||
|  |       promptAction.showToast({ | ||||||
|  |         message:`${TAG}getUDPudpCLient udp send fail:oppositeIp${this.oppositeIp},oppositeIpPort:${this.oppositeIpPort},localIp:${this.localIp},localIpPort,${this.localIpPort}`, | ||||||
|  |         duration:4000 | ||||||
|  |       }) | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -39,8 +39,8 @@ export const getMessageHeartbeat = async (msg) => { | |||||||
|   const { examSubject,plateNo } = carInfo; |   const { examSubject,plateNo } = carInfo; | ||||||
|   const ksyh='0000000000000' |   const ksyh='0000000000000' | ||||||
|   const {fourInOneScreen:{gpsDigit}} = judgeConfig |   const {fourInOneScreen:{gpsDigit}} = judgeConfig | ||||||
|   const asclshArr = stringToASC(fillZero(globalThis.lsh || 0, 13)); |   const asclshArr = stringToASC(fillZero('0000000000000', 13)); | ||||||
|   const ascksyhArr = stringToASC(fillZero(ksyh || 0, 13)) |   const ascksyhArr = stringToASC(fillZero('0000000000000', 13)) | ||||||
|   const ascsbxhArr = stringToASC('00000000') |   const ascsbxhArr = stringToASC('00000000') | ||||||
|   // const ascsbxhArr = stringToASC('153216400880')
 |   // const ascsbxhArr = stringToASC('153216400880')
 | ||||||
|   const serialIndex = globalThis.serialIndex |   const serialIndex = globalThis.serialIndex | ||||||
| @ -93,7 +93,19 @@ export const getMessageHeartbeat = async (msg) => { | |||||||
|     //扣分项数量
 |     //扣分项数量
 | ||||||
|     string2Bytes(0, 8), |     string2Bytes(0, 8), | ||||||
|     //n个扣分序号
 |     //n个扣分序号
 | ||||||
|     [].map(kf => string2Bytes(kf.markcatalog, 8)) |     [].map(kf => string2Bytes(kf.markcatalog, 8)), | ||||||
|  |     //牵引车第二gps精度、纬度
 | ||||||
|  |     string2Bytes(0, 4 * 8), string2Bytes(0, 4 * 8), | ||||||
|  |     //牵引车第二航向角
 | ||||||
|  |     string2Bytes(0, 2 * 8), | ||||||
|  |     //摩托压线 Byte[20],
 | ||||||
|  |     string2Bytes(0, 20 * 8), | ||||||
|  |     //考试用时
 | ||||||
|  |     string2Bytes(fillZero(0+'',4), 4 * 8), | ||||||
|  |     //项目用时
 | ||||||
|  |     string2Bytes(fillZero(0,2), 2 * 8), | ||||||
|  |     //设备信号状态
 | ||||||
|  |     string2Bytes(0, 4 * 8), | ||||||
|   ] |   ] | ||||||
|   let tempArr = []; |   let tempArr = []; | ||||||
|   arr.forEach(itemArr => { |   arr.forEach(itemArr => { | ||||||
|  | |||||||
| @ -28,10 +28,10 @@ export default class EntryAbility extends UIAbility { | |||||||
|         globalThis.examinerInfo = {} |         globalThis.examinerInfo = {} | ||||||
|         globalThis.deviceNo = ''; |         globalThis.deviceNo = ''; | ||||||
|         globalThis.hasAuth = false |         globalThis.hasAuth = false | ||||||
|         globalThis.version = '2022.08.13.01' |         // globalThis.version = '2022.08.13.01'
 | ||||||
|         globalThis.judgeVersion = '2022.12.05.1' |         // globalThis.judgeVersion = '2022.12.05.1'
 | ||||||
|         // globalThis.version = '2024.11.22.14'
 |         globalThis.version = '2024.11.22.14' | ||||||
|         // globalThis.judgeVersion = '2024.11.22.14'
 |         globalThis.judgeVersion = '2024.11.22.14' | ||||||
|         globalThis.videoVersion= '1.0' |         globalThis.videoVersion= '1.0' | ||||||
|         // globalThis.version = '2023.12.13.01'
 |         // globalThis.version = '2023.12.13.01'
 | ||||||
|         // globalThis.judgeVersion = '2023.09.30.1'
 |         // globalThis.judgeVersion = '2023.09.30.1'
 | ||||||
|  | |||||||
| @ -118,7 +118,7 @@ struct Index { | |||||||
|     const {xm,sfzmhm,lsh,kszp,ksdd,kssycs,kslx,ksxl} = stuInfo; |     const {xm,sfzmhm,lsh,kszp,ksdd,kssycs,kslx,ksxl} = stuInfo; | ||||||
|     this.name = xm || '测试考生'; |     this.name = xm || '测试考生'; | ||||||
|     this.idCard = sfzmhm || '01234567891010'; |     this.idCard = sfzmhm || '01234567891010'; | ||||||
|     this.lsh = lsh; |     this.lsh = globalThis.singlePlay?'0000000000000':lsh; | ||||||
|     this.kszp = kszp; |     this.kszp = kszp; | ||||||
|     this.ksdd = ksdd; |     this.ksdd = ksdd; | ||||||
|     this.kssycs = kssycs; |     this.kssycs = kssycs; | ||||||
|  | |||||||
| @ -248,7 +248,7 @@ struct UserInfo { | |||||||
|     this.stepFlag = false |     this.stepFlag = false | ||||||
|     this.faceCompareSucess = 0 |     this.faceCompareSucess = 0 | ||||||
|     this.showFaceCompare = false |     this.showFaceCompare = false | ||||||
|     this.lsh = '0000000000000' |     this.lsh = '000000000000' | ||||||
|     this.callBackFlag = false |     this.callBackFlag = false | ||||||
|     globalThis.lsh = this.lsh |     globalThis.lsh = this.lsh | ||||||
|     // this.currentUser = EmptyCandidateObject |     // this.currentUser = EmptyCandidateObject | ||||||
| @ -267,8 +267,6 @@ struct UserInfo { | |||||||
|       // this.getExaminationStudentInfoFn() |       // this.getExaminationStudentInfoFn() | ||||||
|     } |     } | ||||||
|     const syssetParams = await getSyncData('MA_SYSSET'); |     const syssetParams = await getSyncData('MA_SYSSET'); | ||||||
|     console.log('响应头地址响应头地址0') |  | ||||||
| 
 |  | ||||||
|     //@ts-ignore |     //@ts-ignore | ||||||
|     syssetParams.forEach(sys => { |     syssetParams.forEach(sys => { | ||||||
|       //364	绕车一周评判时机(1-开始考试后判 2-开始考试前判) |       //364	绕车一周评判时机(1-开始考试后判 2-开始考试前判) | ||||||
| @ -340,9 +338,6 @@ struct UserInfo { | |||||||
|             that.openDeviceByIDCard() |             that.openDeviceByIDCard() | ||||||
|           } |           } | ||||||
|         } |         } | ||||||
|         // that.FaceOpenStatue =  '0' |  | ||||||
|         console.log('响应头地址响应头地址3',that.studentRefreshStatue) |  | ||||||
| 
 |  | ||||||
|         //0不自动更新 1自动更新(不限次数) 2没有考生更新2次 |         //0不自动更新 1自动更新(不限次数) 2没有考生更新2次 | ||||||
|         if (that.studentRefreshStatue == '2') { |         if (that.studentRefreshStatue == '2') { | ||||||
|           clearInterval(that.interval) |           clearInterval(that.interval) | ||||||
| @ -394,7 +389,6 @@ struct UserInfo { | |||||||
| 
 | 
 | ||||||
|   //获取下载考生 |   //获取下载考生 | ||||||
|   getExaminationStudentInfoFn() { |   getExaminationStudentInfoFn() { | ||||||
|     console.log('响应头地址',globalThis.singlePlay,this.updateTimeLimit) |  | ||||||
|     if (globalThis.singlePlay || this.updateTimeLimit) { |     if (globalThis.singlePlay || this.updateTimeLimit) { | ||||||
|       return |       return | ||||||
|     } |     } | ||||||
| @ -1003,9 +997,9 @@ struct LabelBlock { | |||||||
| 
 | 
 | ||||||
|   build() { |   build() { | ||||||
|     Row() { |     Row() { | ||||||
|       Text(this.label).fontSize(18 * this.ratio).fontColor('#99948A') |       Text(this.label).fontSize(16 * this.ratio).fontColor('#99948A') | ||||||
|       Row() { |       Row() { | ||||||
|         Text(decodeURIComponent(this.value)).fontColor('#fff').textAlign(TextAlign.Center).width('100%').fontSize(20 * this.ratio) |         Text(decodeURIComponent(this.value)).fontColor('#fff').textAlign(TextAlign.Center).width('100%') | ||||||
|       } |       } | ||||||
|       .commLabelStyle() |       .commLabelStyle() | ||||||
|     }.margin({ bottom: 10 * this.ratio }) |     }.margin({ bottom: 10 * this.ratio }) | ||||||
|  | |||||||
| @ -94,8 +94,13 @@ export default struct RealTime { | |||||||
|       .backgroundColor('#fff') |       .backgroundColor('#fff') | ||||||
| 
 | 
 | ||||||
|       Row(){ |       Row(){ | ||||||
|         Image($rawfile('judge/big.png')).width(60).onClick(()=>{this.scaleFn(-10)}) |         Image($rawfile('judge/big.png')).width(60).onClick(()=>{ | ||||||
|         Image($rawfile('judge/small.png')).width(60).onClick(()=>{this.scaleFn(10)}).margin({left:20}) |           this.scaleFn( -this.getScaleNum() ) | ||||||
|  |           console.info('surenjun getScaleNum',-this.getScaleNum()) | ||||||
|  |         }) | ||||||
|  |         Image($rawfile('judge/small.png')).width(60).onClick(()=>{ | ||||||
|  |           this.scaleFn( this.getScaleNum() ) | ||||||
|  |         }).margin({left:20}) | ||||||
|       }.position({x:'32%',y:60}) |       }.position({x:'32%',y:60}) | ||||||
|     } |     } | ||||||
|     .height('100%') |     .height('100%') | ||||||
| @ -112,6 +117,37 @@ export default struct RealTime { | |||||||
|     this.timer = timer |     this.timer = timer | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   getScaleNum = ()=>{ | ||||||
|  |     const scaleNum = this.scaleNum; | ||||||
|  |     if(scaleNum < 200){ | ||||||
|  |       return 10 | ||||||
|  |     } | ||||||
|  |     if(scaleNum >= 200 && scaleNum < 400){ | ||||||
|  |       return 30 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if(scaleNum >= 400 && scaleNum < 600){ | ||||||
|  |       return 50 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if(scaleNum >= 600 && scaleNum < 800){ | ||||||
|  |       return 70 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if(scaleNum >= 800 && scaleNum < 1000){ | ||||||
|  |       return 100 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if(scaleNum >= 1000 && scaleNum < 2000){ | ||||||
|  |       return 500 | ||||||
|  |     } | ||||||
|  |     if(scaleNum >= 2000 && scaleNum <= 5000){ | ||||||
|  |       return 1000 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     return 1000 | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   getValues(roadColumn) { |   getValues(roadColumn) { | ||||||
|     const lane = this.lane || {}; |     const lane = this.lane || {}; | ||||||
|     let key = roadColumn.key; |     let key = roadColumn.key; | ||||||
| @ -148,17 +184,18 @@ export default struct RealTime { | |||||||
| 
 | 
 | ||||||
|   scaleFn = async (num)=>{ |   scaleFn = async (num)=>{ | ||||||
|     const scaleNum = this.scaleNum |     const scaleNum = this.scaleNum | ||||||
|     if(scaleNum >0 && scaleNum < 200){ |     console.info('surenjun getScaleNum',scaleNum) | ||||||
|  |     if(scaleNum >0 && scaleNum < 5000){ | ||||||
|       this.scaleNum += num; |       this.scaleNum += num; | ||||||
|     } |     } | ||||||
|     if(scaleNum === 0 && num > 0){ |     if(scaleNum === 0 && num > 0){ | ||||||
|       this.scaleNum += num; |       this.scaleNum += num; | ||||||
|     } |     } | ||||||
|     if(scaleNum === 200 && num < 0){ |     if(scaleNum > 5000 && num < 0){ | ||||||
|       this.scaleNum += num; |       this.scaleNum += num; | ||||||
|     } |     } | ||||||
|     await examJudgeMapSetScaling(this.scaleNum); |     await examJudgeMapSetScaling(this.scaleNum); | ||||||
| 
 |  | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,25 +0,0 @@ | |||||||
| 
 |  | ||||||
| @Component |  | ||||||
| export default struct EndPopup { |  | ||||||
|   constructor() { |  | ||||||
|     super() |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   private title:string = '' |  | ||||||
|   private cancelFn:(event?: ClickEvent) => void |  | ||||||
|   private confirmFn:(event?: ClickEvent) => void |  | ||||||
| 
 |  | ||||||
|   build(){ |  | ||||||
|     Column(){ |  | ||||||
|       Column(){ |  | ||||||
|         Text(this.title).fontSize(38).margin({bottom:20}) |  | ||||||
|         Row(){}.height(50) |  | ||||||
|         Row(){ |  | ||||||
|           Text('取消').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(250).height(100).fontSize(30).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(100).fontSize(30).fontColor('#FFF').textAlign(TextAlign.Center).margin({left:45}).onClick(this.confirmFn) |  | ||||||
|         } |  | ||||||
|       }.width('80%').height('70%').backgroundColor('#E6E3DF').borderRadius(38).position({y:'12%',x:'10%'}).justifyContent(FlexAlign.Center) |  | ||||||
| 
 |  | ||||||
|     }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)') |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| @ -603,6 +603,7 @@ export default class Judge { | |||||||
|         kssj: time |         kssj: time | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  |     console.info(judgeTag +'filePath' , filePath) | ||||||
|     const {code} = await writeObjectOut(data,filePath) |     const {code} = await writeObjectOut(data,filePath) | ||||||
|     console.info(judgeTag, '项目开始 end') |     console.info(judgeTag, '项目开始 end') | ||||||
|     if (code === 2300007) { |     if (code === 2300007) { | ||||||
| @ -774,25 +775,36 @@ export default class Judge { | |||||||
|           this.isExamEnd = true |           this.isExamEnd = true | ||||||
|         } |         } | ||||||
|       } else { |       } else { | ||||||
|  |         const param302 = judgeConfigObj['302']; | ||||||
|  |         const param342 = judgeConfigObj['342']; | ||||||
|  |         const param512 = (judgeConfigObj['512'] || '').split(','); | ||||||
|  | 
 | ||||||
|         //成绩不合格
 |         //成绩不合格
 | ||||||
|         if (totalScore < passingGrade) { |         if (totalScore < passingGrade) { | ||||||
|  |           //科目三不合格报靠边停车
 | ||||||
|  |           if(examSubject == 3 && param302 ==1){ | ||||||
|  |             avPlayer.playAudio([`voice/考试结束.mp3`]); | ||||||
|  |             return | ||||||
|  |           } | ||||||
|           await examJudgeEndExam() |           await examJudgeEndExam() | ||||||
|           this.isExamEnd = true |           this.isExamEnd = true | ||||||
|           return |           return | ||||||
|         } |         } | ||||||
|         //成绩合格
 |         //成绩合格
 | ||||||
|         if (isAllProjectsEnd && totalScore >= passingGrade && isEndTip) { |         if (isAllProjectsEnd && totalScore >= passingGrade && isEndTip) { | ||||||
|           const param302 = judgeConfigObj['302']; |           //考试合格自动退出
 | ||||||
|           const param342 = judgeConfigObj['342']; |           if(examSubject == 3 && param302 == 4){ | ||||||
|           const param512 = (judgeUI.judgeConfigObj['512'] || '').split(','); |             await examJudgeEndExam() | ||||||
|           if (examSubject == 3 && param342 != 0 && (param302 != 6 || param302 != 7 || param302 != 8)) { |             this.isExamEnd = true | ||||||
|  |             return | ||||||
|  |           } | ||||||
|  |           if (examSubject == 3 && (param342 == 0 || param342 == 2) && (param302 != 6 || param302 != 7 || param302 != 8)) { | ||||||
|             if(param512[7] != 0){ |             if(param512[7] != 0){ | ||||||
|               avPlayer.playAudio(['voice/综合评判.mp3']) |               avPlayer.playAudio(['voice/综合评判.mp3']) | ||||||
|               this.judgeUI.isDeductedPopShow = true |               this.judgeUI.isDeductedPopShow = true | ||||||
|               this.judgeUI.defaultTabIndex = 1 |               this.judgeUI.defaultTabIndex = 1 | ||||||
|               this.isEndTip = true |               this.isEndTip = true | ||||||
|             } |             } | ||||||
| 
 |  | ||||||
|           } else { |           } else { | ||||||
|             await examJudgeEndExam() |             await examJudgeEndExam() | ||||||
|             this.isExamEnd = true |             this.isExamEnd = true | ||||||
| @ -980,6 +992,7 @@ export default class Judge { | |||||||
|   getMessageHeartbeat = async (isEnd?: Boolean) => { |   getMessageHeartbeat = async (isEnd?: Boolean) => { | ||||||
|     const carInfo = globalThis.carInfo; |     const carInfo = globalThis.carInfo; | ||||||
|     const { examSubject,plateNo,ksyh } = carInfo; |     const { examSubject,plateNo,ksyh } = carInfo; | ||||||
|  |     console.info(judgeTag,1) | ||||||
|     const { |     const { | ||||||
|       judgeUI, |       judgeUI, | ||||||
|       isExam, |       isExam, | ||||||
| @ -994,19 +1007,32 @@ export default class Judge { | |||||||
|       getTranslateProject, |       getTranslateProject, | ||||||
|       getSbxh |       getSbxh | ||||||
|     } = this; |     } = this; | ||||||
|     const {lsh,startHourTime,totalScore} = judgeUI; |     console.info(judgeTag,2) | ||||||
|  |     const {lsh,startHourTime,totalScore,examTime} = judgeUI; | ||||||
|  | 
 | ||||||
|     const {fourInOneScreen:{gpsDigit}} = judgeConfig |     const {fourInOneScreen:{gpsDigit}} = judgeConfig | ||||||
|  |     console.info(judgeTag,3) | ||||||
|     const examType = examSubject == 2?2:3 |     const examType = examSubject == 2?2:3 | ||||||
|     const {sensor,gps} = tempData; |     const {sensor,gps} = tempData; | ||||||
|  |     console.info(judgeTag,4) | ||||||
|  |     console.info(judgeTag,JSON.stringify(tempData)) | ||||||
|  |     if(tempData.sensor === undefined){ | ||||||
|  |       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,} = gps | ||||||
|  |     console.info(judgeTag,5) | ||||||
|     const translateProject = getTranslateProject(); |     const translateProject = getTranslateProject(); | ||||||
|     const sbxh = getSbxh(xmdm, xmxh) |     const sbxh = getSbxh(xmdm, xmxh) | ||||||
|     const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo; |     console.info(judgeTag,JSON.stringify(performInfo)) | ||||||
|  |     const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo || {}; | ||||||
|     const asclshArr = stringToASC(fillZero(lsh || 0, 13)); |     const asclshArr = stringToASC(fillZero(lsh || 0, 13)); | ||||||
|     //13不足要补0
 |     //13不足要补0
 | ||||||
|  |     console.info(judgeTag,6) | ||||||
|     const ascksyhArr = stringToASC(fillZero(ksyh || 0, 13)) |     const ascksyhArr = stringToASC(fillZero(ksyh || 0, 13)) | ||||||
|  |     console.info(judgeTag,7) | ||||||
|     const ascsbxhArr = stringToASC(sbxh) |     const ascsbxhArr = stringToASC(sbxh) | ||||||
|  |     console.info(judgeTag,8) | ||||||
|     const translateSignals = getTranslateSignals( |     const translateSignals = getTranslateSignals( | ||||||
|       [zfxd, yfxd, shtd, ygd, jgd, skd, dh1, dh2, lhq, jsc, ssc, fsc, lb, mkg, aqd].concat(getDwStatusType(dw)).concat(getCarStatusType(carzt)).concat([ygq, sensor.wd, 0]) |       [zfxd, yfxd, shtd, ygd, jgd, skd, dh1, dh2, lhq, jsc, ssc, fsc, lb, mkg, aqd].concat(getDwStatusType(dw)).concat(getCarStatusType(carzt)).concat([ygq, sensor.wd, 0]) | ||||||
|     ) |     ) | ||||||
| @ -1016,9 +1042,13 @@ 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]) | ||||||
|  |     console.info(judgeTag,6) | ||||||
|     // console.info(judgeTag,JSON.stringify(translateProject))
 |     // console.info(judgeTag,JSON.stringify(translateProject))
 | ||||||
|     //@ts-ignore
 |     //@ts-ignore
 | ||||||
|     // const translateProjects= translateProject.map(num => string2Bytes(p,8)[0])
 |     // const translateProjects= translateProject.map(num => string2Bytes(p,8)[0])
 | ||||||
|  |     console.info('surenjunxstartHourTime' , startHourTime) | ||||||
|  |     console.info('surenjunxmmcexamTime' , examTime) | ||||||
|  | 
 | ||||||
|     const arr = [ |     const arr = [ | ||||||
|       //考生号
 |       //考生号
 | ||||||
|       asclshArr.map(lsh => string2Bytes(lsh, 8)[0]), |       asclshArr.map(lsh => string2Bytes(lsh, 8)[0]), | ||||||
| @ -1032,7 +1062,7 @@ export default class Judge { | |||||||
|       translateSignals, |       translateSignals, | ||||||
|       //速度                                                发动机转速                          GPS纬度                         GPS经度                         主天线位置
 |       //速度                                                发动机转速                          GPS纬度                         GPS经度                         主天线位置
 | ||||||
|       //@ts-ignore
 |       //@ts-ignore
 | ||||||
|       string2Bytes(Math.floor(gps.sd*1.852) , 2 * 8), string2Bytes(fdjzs / 100, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8), |       string2Bytes(cs * 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北向距离
 | ||||||
| @ -1055,7 +1085,19 @@ export default class Judge { | |||||||
|       //扣分项数量
 |       //扣分项数量
 | ||||||
|       string2Bytes(kfArr.length, 8), |       string2Bytes(kfArr.length, 8), | ||||||
|       //n个扣分序号
 |       //n个扣分序号
 | ||||||
|       kfArr.map(kf => string2Bytes(kf.kfxh, 8)[0]) |       kfArr.map(kf => string2Bytes(kf.kfxh, 8)[0]), | ||||||
|  |       //TODO 牵引车第二gps精度、纬度
 | ||||||
|  |       string2Bytes(0, 4 * 8), string2Bytes(0, 4 * 8), | ||||||
|  |       //TODO 牵引车第二航向角
 | ||||||
|  |       string2Bytes(0, 2 * 8), | ||||||
|  |       //TODO 摩托压线 Byte[20],
 | ||||||
|  |       string2Bytes(0, 20 * 8), | ||||||
|  |       //TODO 考试用时
 | ||||||
|  |       string2Bytes(fillZero(examTime+'',4), 4 * 8), | ||||||
|  |       //TODO 项目用时
 | ||||||
|  |       string2Bytes(fillZero(0,2), 2 * 8), | ||||||
|  |       //TODO 设备信号状态
 | ||||||
|  |       string2Bytes(0, 4 * 8), | ||||||
|     ] |     ] | ||||||
| 
 | 
 | ||||||
|     let tempArr = []; |     let tempArr = []; | ||||||
| @ -1063,20 +1105,31 @@ export default class Judge { | |||||||
|       tempArr = tempArr.concat(itemArr) |       tempArr = tempArr.concat(itemArr) | ||||||
|     }) |     }) | ||||||
|     this.serialIndex += 1; |     this.serialIndex += 1; | ||||||
|  |     console.info('message-judge-udp' + Array2Byte(tempArr).toString()); | ||||||
|  | 
 | ||||||
|     return Array2Byte(tempArr) |     return Array2Byte(tempArr) | ||||||
|   } |   } | ||||||
|   //获取场地序号
 |   //获取场地序号
 | ||||||
|   getSbxh = (ksxm, xmxh) => { |   getSbxh = (ksxm, xmxh) => { | ||||||
|     const {judgeUI} = this; |     const {judgeUI} = this; | ||||||
|  |     console.info(judgeTag,10) | ||||||
|     const {cdsbInfoObj,projectsObj} = judgeUI; |     const {cdsbInfoObj,projectsObj} = judgeUI; | ||||||
|  |     console.info(judgeTag,11) | ||||||
|     const project = projectsObj[ksxm] |     const project = projectsObj[ksxm] | ||||||
|     if (project === undefined) { |     console.info(judgeTag,12) | ||||||
|       return '00000000' |     if(project == 3){ | ||||||
|  |       return '0000000000' | ||||||
|     } |     } | ||||||
|  |     if (project === undefined) { | ||||||
|  |       return '0000000000' | ||||||
|  |     } | ||||||
|  |     console.info(judgeTag,13) | ||||||
|     const projectType = project.sbxh; |     const projectType = project.sbxh; | ||||||
|     const projectKey = `${ksxm}_${xmxh}`; |     const projectKey = `${ksxm}_${xmxh}`; | ||||||
|  |     console.info(judgeTag,14) | ||||||
|     const currentCdsb = cdsbInfoObj[projectKey] || {}; |     const currentCdsb = cdsbInfoObj[projectKey] || {}; | ||||||
|     const sbxh = currentCdsb.sbbh || '00000000' |     console.info(judgeTag,15) | ||||||
|  |     const sbxh = currentCdsb.sbbh || '0000000000' | ||||||
|     return sbxh |     return sbxh | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @ -1125,7 +1178,9 @@ export default class Judge { | |||||||
| 
 | 
 | ||||||
|       arr.push(tempArr.join('')); |       arr.push(tempArr.join('')); | ||||||
|     } |     } | ||||||
|     return arr.map(numStr => parseInt(numStr, 2)); |     console.info(judgeTag,JSON.stringify(arr)) | ||||||
|  |     // return arr.map(numStr => parseInt(numStr, 2));
 | ||||||
|  |     return arr | ||||||
|   } |   } | ||||||
|   // 获取考试项目详情
 |   // 获取考试项目详情
 | ||||||
|   getProjectInfo = (projectCode) => { |   getProjectInfo = (projectCode) => { | ||||||
| @ -1264,6 +1319,7 @@ export default class Judge { | |||||||
|     if (udpIndex % 5 === 0) { |     if (udpIndex % 5 === 0) { | ||||||
|       const judgeUdp = globalThis.judgeUdp |       const judgeUdp = globalThis.judgeUdp | ||||||
|       const bytes = await this.getMessageHeartbeat(); |       const bytes = await this.getMessageHeartbeat(); | ||||||
|  |       console.info(judgeTag+'UDP',JSON.stringify(bytes)) | ||||||
|       judgeUdp.send(bytes) |       judgeUdp.send(bytes) | ||||||
|     } |     } | ||||||
|     globalThis.udpIndex += 1 |     globalThis.udpIndex += 1 | ||||||
| @ -1339,8 +1395,11 @@ export default class Judge { | |||||||
|         setJudgeItem(msg.itemno, msg.serial) |         setJudgeItem(msg.itemno, msg.serial) | ||||||
|       } |       } | ||||||
|       await examJudgeRealExam(msg) |       await examJudgeRealExam(msg) | ||||||
|  |       // const bytes = await this.getMessageHeartbeat();
 | ||||||
|  |       // bytes && globalThis.judgeUdp.send(bytes)
 | ||||||
|       num++ |       num++ | ||||||
|     }, 50) |     }, 200) | ||||||
|  | 
 | ||||||
|     globalThis.judgeTimer = judgeTimer; |     globalThis.judgeTimer = judgeTimer; | ||||||
|   } |   } | ||||||
|   // 统计必考项目、所有项目、已考数量
 |   // 统计必考项目、所有项目、已考数量
 | ||||||
|  | |||||||
| @ -36,6 +36,7 @@ export default class FileLog { | |||||||
|     const hourTime = time.split(' ')[1].split(':').join('_') |     const hourTime = time.split(' ')[1].split(':').join('_') | ||||||
|     const folderPath = await fileUtil.initFolder(`/logs/${date}/${date}_${hourTime}_${lsh}_${idCard}_${name}`); |     const folderPath = await fileUtil.initFolder(`/logs/${date}/${date}_${hourTime}_${lsh}_${idCard}_${name}`); | ||||||
|     this.folderPath = folderPath; |     this.folderPath = folderPath; | ||||||
|  |     return folderPath | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // 过程文件数据
 |   // 过程文件数据
 | ||||||
|  | |||||||
| @ -74,9 +74,9 @@ export function getCenterProjectStatus(status){ | |||||||
|     //未考
 |     //未考
 | ||||||
|     case 1:return '01' |     case 1:return '01' | ||||||
|     //正在考
 |     //正在考
 | ||||||
|     case 2:return '11' |     case 2:return '10' | ||||||
|     //已考
 |     //已考
 | ||||||
|     case 3:return '10' |     case 3:return '11' | ||||||
| 
 | 
 | ||||||
|     default :return '00' |     default :return '00' | ||||||
|   } |   } | ||||||
| @ -111,7 +111,9 @@ export function getKmProjectVoice( | |||||||
|     //右转
 |     //右转
 | ||||||
|     case 40900 : return type === 1 ? 409001 : undefined |     case 40900 : return type === 1 ? 409001 : undefined | ||||||
|     //会车 506-6为1都报
 |     //会车 506-6为1都报
 | ||||||
|     case 41300 : return type === 1 ? 413001: (param506Str[5]===1?413002:undefined) |     case 41300 : return type === 1 | ||||||
|  |       ? 413001 | ||||||
|  |       : (param506Str[5] == 1 ? undefined : 413002) | ||||||
|     //超车
 |     //超车
 | ||||||
|     case 41400 : return type === 1 |     case 41400 : return type === 1 | ||||||
|       ? (param405Str == 1 && (num == count)?undefined:414001) |       ? (param405Str == 1 && (num == count)?undefined:414001) | ||||||
|  | |||||||
| @ -6,17 +6,17 @@ export const judgeConfig = { | |||||||
|   //是否开启拍照
 |   //是否开启拍照
 | ||||||
|   isPhotoOpen: true, |   isPhotoOpen: true, | ||||||
|   //扣分语音是否强制开启
 |   //扣分语音是否强制开启
 | ||||||
|   kfVoiceOpen: true, |   kfVoiceOpen: false, | ||||||
|   //忽略的考试项目
 |   //忽略的考试项目
 | ||||||
|   ignoreProjects:[41], |   ignoreProjects:[], | ||||||
|   // 是否忽略考试前熄火、车门检查
 |   // 是否忽略考试前熄火、车门检查
 | ||||||
|   isCheckFireOpen: true, |   isCheckFireOpen: true, | ||||||
|   //是否开启Udp
 |   //轨迹回放是否开启Udp
 | ||||||
|   udpOpen:false, |   udpOpen:true, | ||||||
|   // 本地模型地址
 |   // 本地模型地址
 | ||||||
|   modelPath: 'models/model_enc', |   modelPath: 'models/model_enc', | ||||||
|   // 济南科目三
 |   // 济南科目三
 | ||||||
|   trajectoryPath: 'logs/2024_08_10/2024_08_10_14_24_20_0000000000001_342323199501470011_测试学员1/judge_exam_data.txt', |   trajectoryPath: 'logs/2024_08_14/2024_08_14_11_30_20_9999805761528_344094918358022656_葛李弯/judge_exam_data.txt', | ||||||
|   //四合一画面配置
 |   //四合一画面配置
 | ||||||
|   fourInOneScreen:{ |   fourInOneScreen:{ | ||||||
|     //gps位数
 |     //gps位数
 | ||||||
|  | |||||||
| @ -1,58 +0,0 @@ | |||||||
| import Prompt from '@system.prompt' |  | ||||||
| 
 |  | ||||||
| const TAG = 'SURENJUN_JUDGE' |  | ||||||
| interface QUEUE{ |  | ||||||
|   fn:Function, |  | ||||||
|   config?:{ |  | ||||||
|     isDelay:boolean |  | ||||||
|     delayTime:number |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| export default class JudgeTask{ |  | ||||||
|   private queue = [] |  | ||||||
|   private status:string |  | ||||||
|   constructor() { |  | ||||||
|     this.queue = [] |  | ||||||
|     this.status = 'end' |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   executeQueue = async ()=>{ |  | ||||||
|     const {queue,executeQueue} = this |  | ||||||
|     if(queue.length){ |  | ||||||
|       for (const currentTask of queue) { |  | ||||||
|         const {fn,delayConfig:{ |  | ||||||
|           isDelay = false, |  | ||||||
|           delayTime = 1000 |  | ||||||
|         }} = currentTask; |  | ||||||
|         const {status} = this |  | ||||||
|         try { |  | ||||||
|           isDelay |  | ||||||
|             ?setTimeout(async ()=>{await fn()}) |  | ||||||
|             :await fn(); |  | ||||||
|         }catch (e){ |  | ||||||
|           // console.info(TAG,'过程数据接口解析错误')
 |  | ||||||
|           Prompt.showToast({ |  | ||||||
|             message: '过程数据接口解析错误', |  | ||||||
|             duration: 3000 |  | ||||||
|           }); |  | ||||||
|         } |  | ||||||
|         this.queue.shift() |  | ||||||
|         await executeQueue() |  | ||||||
|       } |  | ||||||
|     }else{ |  | ||||||
|       this.status = 'end' |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   addTask = async (fn,delayConfig?:{ |  | ||||||
|     isDelay:Boolean, |  | ||||||
|     delayTime:Number |  | ||||||
|   }) =>{ |  | ||||||
|     this.queue.push({fn,delayConfig}); |  | ||||||
|     if(this.status == 'end' && this.queue.length === 1){ |  | ||||||
|       await this.executeQueue(); |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user