Compare commits
	
		
			No commits in common. "bbd5edd1eaab7abd2d57e6f328af0f3266182c31" and "b76a2a3f58622e3a16b7fd65b5c2611d8756a7f9" have entirely different histories.
		
	
	
		
			bbd5edd1ea
			...
			b76a2a3f58
		
	
		
| @ -58,7 +58,7 @@ export async function writeObjectOut(params,filePath?:string): Promise<WR> { | ||||
|     await fileUtil.initFolder(filePath); | ||||
|     fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`,JSON.stringify({ | ||||
|       xtlb,jkxlh,jkid,drvexam:{...drvexam,zp:''}, | ||||
|     }) +`\n`); | ||||
|     })); | ||||
|   } | ||||
| 
 | ||||
|   console.info('surenjun','调用旧监管') | ||||
| @ -93,11 +93,6 @@ export async function writeObjectOut(params,filePath?:string): Promise<WR> { | ||||
|     method: 'post', | ||||
|     xml: true | ||||
|   }) | ||||
|   if(filePath){ | ||||
|     const fileUtil = new FileUtil(globalThis.context); | ||||
|     await fileUtil.initFolder(filePath); | ||||
|     fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`,JSON.stringify(temp) +`\n`); | ||||
|   } | ||||
|   return temp | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -106,7 +106,8 @@ console.log('baoyihubaoyihu',video_uri,flag) | ||||
|     // var snapResult = rtsp_server.getVideoSnapshot(context, video_uri, '', dir);
 | ||||
|   if(flag==0){ | ||||
|     rtsp_server.detectVideoSnapshotSize(video_uri,fileName,(err,snapResult)=>{ | ||||
|       console.log("baohaowen_detectLoop round end size1:"+snapResult.fileSize); | ||||
|       console.log("baohaowen_detectLoop round end size1:"+JSON.stringify(snapResult)); | ||||
|       //errorCode=0为正常
 | ||||
|       callback({fileSize:snapResult.fileSize,errorCode:snapResult.errorCode }) | ||||
|     }); | ||||
| 
 | ||||
| @ -116,6 +117,7 @@ console.log('baoyihubaoyihu',video_uri,flag) | ||||
|     return new Promise<takePhotoParam>((resolve,reject)=>{ | ||||
|       rtsp_server.getVideoSnapshot(context, video_uri, fileName,dir,true,(err,snapResult)=>{ | ||||
|         console.log('baoyihubaoyihu',video_uri,flag,JSON.stringify(snapResult)) | ||||
|         //errorCode=-2拍照失败
 | ||||
|         console.log('getPhtot',JSON.stringify(snapResult)) | ||||
|         resolve({base64: snapResult.dataString,name:snapResult.fileName,fileSize:snapResult.fileSize,errorCode:snapResult.errorCode }) | ||||
|       }); | ||||
|  | ||||
| @ -74,7 +74,7 @@ export const getMessageHeartbeat = async (msg) => { | ||||
|     string2Bytes(serialIndex, 2 * 8), | ||||
|     translateSignals, | ||||
|     //@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(Math.floor((Math.floor(gps.sd))*1.852*100) , 2 * 8), string2Bytes(fdjzs / 100, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8), | ||||
|     //GPS东向距离
 | ||||
|     string2Bytes(0, 4 * 8), | ||||
|     //GPS北向距离
 | ||||
|  | ||||
| @ -373,8 +373,13 @@ struct Index { | ||||
|     this.isSingle = globalThis.singlePlay | ||||
|     this.loading = false | ||||
|     this.createAlbum() | ||||
| 
 | ||||
|     this.num = 0 | ||||
| 
 | ||||
| 
 | ||||
|     // | ||||
|     // const TcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort) | ||||
| 
 | ||||
|     console.info('Index onPageShow'); | ||||
|     globalThis.lsh = '1111111111111' | ||||
|   } | ||||
|  | ||||
| @ -291,13 +291,16 @@ struct Index { | ||||
|           //项目开始数据是否上传过 | ||||
|           isUpload:false, | ||||
|         } | ||||
|         this.projectsObj[no2*1] = currentProject | ||||
|         this.projectsCenterObj[txt2] = currentProject | ||||
|         this.projects.push(currentProject); | ||||
|         if(isInExam && !kStringArr.includes(txt2)){ | ||||
|           this.projectsObj[no2*1].type = '3' | ||||
| 
 | ||||
|           // this.ddxkKsxmArr.push(txt2) | ||||
|         if(isInExam){ | ||||
|           if(kStringArr.includes(txt2)){ | ||||
|             this.projectsObj[no2*1] = currentProject | ||||
|             this.projectsCenterObj[txt2] = currentProject | ||||
|             this.projects.push(currentProject); | ||||
|           } | ||||
|         }else { | ||||
|           this.projectsObj[no2*1] = currentProject | ||||
|           this.projectsCenterObj[txt2] = currentProject | ||||
|           this.projects.push(currentProject); | ||||
|         } | ||||
| 
 | ||||
|       } | ||||
| @ -903,6 +906,7 @@ struct Index { | ||||
|             this.loadingPopupVisible = true | ||||
|             clearInterval(this.timer); | ||||
|             clearInterval(globalThis.judgeTimer) | ||||
|             globalThis.windowClass.setWindowSystemBarEnable(['navigation']) | ||||
|             this.judge.checkExamIsEnd(true); | ||||
|           } | ||||
|         }) | ||||
|  | ||||
| @ -99,7 +99,7 @@ export default struct Index { | ||||
|         kfdm, | ||||
|         wayno, | ||||
|         //TODO 真实监管项目 | ||||
|         // kString:'40200,40300,40400,40500,40700,41000,41100,41200,41300,41400,40600,41500,41700,40400,40800,40900' | ||||
|         // kString:'40300,40500,40700,40800' | ||||
|       } | ||||
|     }, router.RouterMode.Single); | ||||
| 
 | ||||
|  | ||||
| @ -192,24 +192,6 @@ export async function examJudgeSoundEnd(param:{ | ||||
|   return await handle(temp,'examJudgeSoundEnd') | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * | ||||
|  * @desc 实时距离计算 | ||||
|  * | ||||
|  * */ | ||||
| export async function examCalcGpsDistance(param:{ | ||||
|   jd1:number, | ||||
|   wd1:number, | ||||
|   jd2:number, | ||||
|   wd2:number, | ||||
|   h:number | ||||
| }){ | ||||
|   const {jd1,wd1,jd2,wd2,h} = param | ||||
|   const temp = libJudgeSdk.examJudgeSoundEnd(jd1,wd1,jd2,wd2,h); | ||||
|   return await handle(temp,'examCalcGpsDistance') | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| /* | ||||
|  * @desc通用处理函数 | ||||
|  * | ||||
|  | ||||
| @ -121,7 +121,7 @@ export default class Judge { | ||||
|     } | ||||
|     //日志回调
 | ||||
|     console.info(judgeTag, '1.进入评判入口') | ||||
|     await examJudgeSetLogCallback(3, async (level, info, len) => { | ||||
|     await examJudgeSetLogCallback(6, async (level, info, len) => { | ||||
|       console.log('评判日志:' + info) | ||||
|       await fileLog.setExamJudgeLogData(info); | ||||
|     }) | ||||
| @ -177,8 +177,6 @@ export default class Judge { | ||||
|       console.info('socketTag[PLC.UdpClient]', '收到udp回调数据') | ||||
|       handleUdp(msg) | ||||
|     }) | ||||
| 
 | ||||
|     //TODO 监听远程扣分
 | ||||
|   } | ||||
| 
 | ||||
|   // 获取评判初始化数据
 | ||||
| @ -235,7 +233,7 @@ export default class Judge { | ||||
|     const {sczb,kfdm} = currentParams; | ||||
|     const {isExam} = this; | ||||
|     const judgeUI = this.judgeUI | ||||
|     const {projects,carType,isDdxk,ddxkTime,projectsCenterObj,ddxkKsxmArr,ddxkKfArr,passingScore} = judgeUI; | ||||
|     const {projects,carType,isDdxk,ddxkTime,projectsCenterObj,ddxkKsxmArr,ddxkKfArr} = judgeUI; | ||||
|     const beginInfo = { | ||||
|       kgid: '012', | ||||
|       kgxm: decodeURI(examinerName || ''), | ||||
| @ -256,7 +254,6 @@ export default class Judge { | ||||
|       wayno: judgeUI.wayno * 1, | ||||
|       czlx: 0, | ||||
|       kskssj: await systemTime.getCurrentTime(), | ||||
|       passing:passingScore * 1, | ||||
|       ksxm: projects.map(project => { | ||||
|         return { | ||||
|           xmdm: project.projectCode * 1, | ||||
| @ -840,7 +837,7 @@ export default class Judge { | ||||
|     this.judgeUI.totalScore = isAllProjectsEnd ? totalScore : 0; | ||||
|     const singlePlay = globalThis.singlePlay | ||||
|     const param302 = judgeConfigObj['302']; | ||||
|     // globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
 | ||||
|     globalThis.windowClass.setWindowSystemBarEnable(['navigation']) | ||||
| 
 | ||||
|     //自动退出待验证并且不合格
 | ||||
|     if (!isManual && examSubject == 3 && (param302 == 1 || (singlePlay && param302 == 2)) && totalScore < passingScore) { | ||||
| @ -916,58 +913,24 @@ export default class Judge { | ||||
|     const param302 = judgeConfigObj['302']; | ||||
|     judgeUI.loadingPopupVisible = true; | ||||
| 
 | ||||
|     let currentKssycs =0; | ||||
|     let voiceURL = '' | ||||
|     if (examSubject == 2) { | ||||
|       voiceURL = (totalScore < passingScore ? `voice/unqualified_${kssycs == 1 ? 'one' : 'two'}.wav` : 'voice/qualified.mp3') | ||||
|       switch (voiceURL){ | ||||
|         case 'voice/unqualified_one.wav': | ||||
|           currentKssycs = 0; | ||||
|           break; | ||||
| 
 | ||||
|         case 'voice/unqualified_two.wav': | ||||
|           currentKssycs = 1; | ||||
|           break; | ||||
| 
 | ||||
|         case 'voice/qualified.mp3': | ||||
|           currentKssycs = 0; | ||||
|           break; | ||||
|       } | ||||
|     } | ||||
|     if (examSubject == 3) { | ||||
|       if (isAllProjectsEnd) { | ||||
|         if (totalScore < passingScore) { | ||||
|           voiceURL = `voice/${kssycs == 1 ? 'exam_no_pass_finish' : 'exam_no_pass'}.mp3` | ||||
|           currentKssycs = kssycs == 1 ? 0 : 1 | ||||
|         } else { | ||||
|           voiceURL = 'voice/exam_pass.mp3' | ||||
|           currentKssycs = 0 | ||||
|         } | ||||
|       } else { | ||||
|         voiceURL = `voice/${kssycs == 1 ? 'exam_no_pass_finish' : 'exam_no_pass'}.mp3` | ||||
|         currentKssycs = kssycs == 1 ? 0 : 1 | ||||
|       } | ||||
|       switch (voiceURL){ | ||||
|         case 'voice/exam_no_pass_finish.mp3': | ||||
|           currentKssycs = 0; | ||||
|           break; | ||||
| 
 | ||||
|         case 'voice/exam_no_pass.mp3': | ||||
|           currentKssycs = 1; | ||||
|           break; | ||||
| 
 | ||||
|         case 'voice/exam_pass.mp3': | ||||
|           currentKssycs = 0; | ||||
|           break; | ||||
| 
 | ||||
|       } | ||||
|     } | ||||
| 
 | ||||
|     const USER = await getSyncData('USER'); | ||||
|     await upDateTableByArray('USER', [{ | ||||
|       ...USER[0], | ||||
|       kssycs:currentKssycs | ||||
|     }]) | ||||
|     const USER =await getSyncData('USER'); | ||||
|     await upDateTableByArray('USER', [{...USER[0],kssycs:kssycs == 2 ? 1 : 0}]) | ||||
| 
 | ||||
|     console.info(judgeTag, `考试成绩:${totalScore}`) | ||||
|     if(!singlePlay){ | ||||
| @ -1333,7 +1296,7 @@ export default class Judge { | ||||
|     const udpIndex = globalThis.udpIndex; | ||||
|     if (udpIndex % 5 === 0 && !isUdpEnd) { | ||||
|       const judgeUdp = globalThis.judgeUdp | ||||
|       const bytes = await this.getMessageHeartbeat(isExamEnd); | ||||
|       const bytes = await this.getMessageHeartbeat(); | ||||
|       console.info(judgeTag+'UDP',JSON.stringify(bytes)) | ||||
|       judgeUdp.send(bytes) | ||||
|     } | ||||
|  | ||||
| @ -163,7 +163,6 @@ export function promptWxCode( | ||||
|     return | ||||
|   } | ||||
|   switch (jkid){ | ||||
| 
 | ||||
|     //项目开始
 | ||||
|     case '17C52': | ||||
|       switch (code){ | ||||
|  | ||||
| @ -6,7 +6,7 @@ export const judgeConfig = { | ||||
|   //是否开启拍照
 | ||||
|   isPhotoOpen: true, | ||||
|   //扣分语音是否强制开启
 | ||||
|   kfVoiceOpen: false, | ||||
|   kfVoiceOpen: true, | ||||
|   //忽略的考试项目
 | ||||
|   ignoreProjects:[], | ||||
|   // 是否忽略考试前熄火、车门检查
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user