Merge branch 'main' into lv_chengmai
This commit is contained in:
		
						commit
						699317b1fe
					
				
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -7,4 +7,5 @@ | ||||
| .cxx | ||||
| /.clangd | ||||
| /.clang-format | ||||
| /.clang-tidy | ||||
| /.clang-tidy | ||||
| /entry/src/main/cpp/ | ||||
|  | ||||
| @ -3,15 +3,14 @@ | ||||
|     "signingConfigs": [ | ||||
|       { | ||||
|         "name": "default", | ||||
|         "type": "HarmonyOS", | ||||
|         "material": { | ||||
|           "certpath": "C:\\Users\\lvyuankang\\.ohos\\config\\openharmony\\auto_ohos_default_subject-two_com.oh.dts.cer", | ||||
|           "storePassword": "000000196C396C316487A43A98EF15626CB3607497CF9DE834B8522AFF4BCC81FBE0F8588BA161CED8", | ||||
|           "certpath": "/Users/wangzhongjie/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.cer", | ||||
|           "storePassword": "0000001A411B16D84BA448A9AED56C5B7E351A55B8BA7BA0073A2313B214C24C5740A4B49E6E80AD05F0", | ||||
|           "keyAlias": "debugKey", | ||||
|           "keyPassword": "00000019E303B1483B2AF630EB5C3AA1BD1A670C1C8F31F84C3DA43C32F816CC733FEFC11B843E23E6", | ||||
|           "profile": "C:\\Users\\lvyuankang\\.ohos\\config\\openharmony\\auto_ohos_default_subject-two_com.oh.dts.p7b", | ||||
|           "keyPassword": "0000001AD6836BCC5536725F76279FB36A15D9F61E7CE88C2D043642297F81A9662DEB365314D756CB63", | ||||
|           "profile": "/Users/wangzhongjie/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.p7b", | ||||
|           "signAlg": "SHA256withECDSA", | ||||
|           "storeFile": "C:\\Users\\lvyuankang\\.ohos\\config\\openharmony\\auto_ohos_default_subject-two_com.oh.dts.p12" | ||||
|           "storeFile": "/Users/wangzhongjie/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.p12" | ||||
|         } | ||||
|       } | ||||
|     ], | ||||
|  | ||||
| @ -192,13 +192,13 @@ struct Index { | ||||
|           }) | ||||
|           this.totalScore += currentKf.markreal * 1; | ||||
|         }) | ||||
|         this.projectsObj['1'].type = kfdm.length ? '4' : '3'; | ||||
|         this.projectsObj[1].type = kfdm.length ? '4' : '3'; | ||||
|         this.projectsObj = { | ||||
|           ...this.projectsObj | ||||
|         } | ||||
|       } | ||||
| 
 | ||||
|       this.judgeConfigObj[sys.v_no] = value | ||||
| 
 | ||||
|     }); | ||||
|     this.judgeConfig = syssetJudgeConfigArr; | ||||
|   } | ||||
| @ -210,7 +210,7 @@ struct Index { | ||||
|     const {carName,carType,examSubject} = this; | ||||
|     //小车车型列表 | ||||
|     const sCarTypes = ['C1', 'C2', 'C5'] | ||||
|     this.wayno = currentParams.wayno | ||||
|     this.wayno = currentParams.wayno || 1; | ||||
|     const {isTrajectoryOpen} = judgeConfig | ||||
|     let carNo = '', allItems = []; | ||||
|     systemParms.forEach((systemParm) => { | ||||
| @ -256,7 +256,7 @@ struct Index { | ||||
|           //是否是必考 | ||||
|           isRequired: allItems.includes(no2 + ''), | ||||
|         } | ||||
|         this.projectsObj[no2] = currentProject | ||||
|         this.projectsObj[no2*1] = currentProject | ||||
|         this.projectsCenterObj[txt2] = currentProject | ||||
|         this.projects.push(currentProject); | ||||
|       } | ||||
| @ -272,7 +272,7 @@ struct Index { | ||||
|     const projects = this.projects; | ||||
|     if (!projects.length) { | ||||
|       Prompt.showToast({ | ||||
|         message: '读取数据库信息失败,请重新考试!', | ||||
|         message: '读取数据库信息失败,请重新联网更新!', | ||||
|         duration: 8000 | ||||
|       }); | ||||
|       router.back(); | ||||
| @ -434,9 +434,8 @@ struct Index { | ||||
|         Row() { | ||||
|           Image($rawfile('judge/signal_logoS.png')).width(120) | ||||
|           Text(this.time).fontColor('#CCB48F').fontSize(32).padding({ left: 10, right: 5 }) | ||||
|           Image($rawfile('judge/xh_green.png')).width(50) | ||||
|           Image($rawfile(this.isDwztRight?'judge/xh_red.png':'judge/xh_green.png')).width(50) | ||||
|         }.padding({ left: 20 }) | ||||
| 
 | ||||
|         Row() { | ||||
|           Text(`当前项目:${this.xmmcStr || '无'} `).fontColor('#E5CCA1').fontSize(32) | ||||
|         } | ||||
| @ -607,9 +606,7 @@ struct Index { | ||||
|                       List({}) { | ||||
|                         ForEach(this.projects, (project) => { | ||||
|                           ListItem() { | ||||
|                             Text(project.name) { | ||||
| 
 | ||||
|                             } | ||||
|                             Text(project.name) {} | ||||
|                             .fontColor(this.getProjectColor(this.projectsObj[project.projectCode].type)) | ||||
|                             .margin({ bottom: 5 }) | ||||
|                             .fontSize(26) | ||||
| @ -819,8 +816,8 @@ struct Index { | ||||
|           currentItems: Reflect.ownKeys(this.projectsObj).map(projectKey => { | ||||
|             //@ts-ignore | ||||
|             const project = this.projectsObj[projectKey] | ||||
|             return project.type == '2' ? project.projectCode : '' | ||||
|           }).filter(project => project !== ''), | ||||
|             return project.type == '2' ? project.projectCode : undefined | ||||
|           }).filter(project => project !== undefined), | ||||
|           markRules: this.manualMarkRules, | ||||
|           closePopup: () => { | ||||
|             this.isDeductedPopShow = false | ||||
| @ -928,9 +925,9 @@ struct Index { | ||||
|     } = this; | ||||
|     const projectCode = artSubject3ProjectsCodesArr[index]; | ||||
|     const projectType = projectsObj[projectCode].type; | ||||
| 
 | ||||
|     //不允许人工触发的项目列表,以","分隔 | ||||
|     const unExitManualProjects = judgeConfigObj['332'].split(',') || []; | ||||
| 
 | ||||
|     //直线行驶中不进其他考试项目(0-否 1-是) | ||||
|     const param348 = judgeConfigObj['348'] || '0', | ||||
|       //里程不够允许手工点靠边停车(0-否 1-是) | ||||
| @ -951,18 +948,22 @@ struct Index { | ||||
|     if (judgeConfigObj['342'] === '3' || judgeConfigObj['342'] === '2') { | ||||
|       return false | ||||
|     } | ||||
| 
 | ||||
|     //不允许人工触发的项目列表 | ||||
|     if (unExitManualProjects.includes(artSubject3ProjectsCodesArr[index])) { | ||||
|       return false | ||||
|     } | ||||
| 
 | ||||
|     //项目进行中不能人工触发 | ||||
|     if (isProjectIn) { | ||||
|       if (param340 == 1 && isManualProjectIn && (currentXmdm == projectCode)) { | ||||
|         return true | ||||
|       }else{ | ||||
|         return false | ||||
|     if(isProjectIn) { | ||||
|       if(param340 == 1){ | ||||
|         if(isManualProjectIn && (currentXmdm == projectCode)){ | ||||
|           return true | ||||
|         }else{ | ||||
|           return false | ||||
|         } | ||||
|       } | ||||
|       return false | ||||
|     } | ||||
| 
 | ||||
|     //项目路段信息判断 | ||||
| @ -999,19 +1000,21 @@ struct Index { | ||||
| 
 | ||||
|     const projectRoads = { | ||||
|       //直线行驶 | ||||
|       '3': (judgeConfigObj['514'].split(',') || []), | ||||
|       '3': (judgeConfigObj['514']?.split(',') || []), | ||||
|       //变更车道 | ||||
|       '4':judgeConfigObj['515'].split(',') || [], | ||||
|       '4':judgeConfigObj['515']?.split(',') || [], | ||||
|       //超车 | ||||
|       '10':judgeConfigObj['516'].split(',') || [], | ||||
|       '10':judgeConfigObj['516']?.split(',') || [], | ||||
|       //靠边停车 | ||||
|       '11':judgeConfigObj['517'].split(',') || [], | ||||
|       '11':judgeConfigObj['517']?.split(',') || [], | ||||
|       //会车 | ||||
|       '9':judgeConfigObj['518'].split(',') || [], | ||||
|       '9':judgeConfigObj['518']?.split(',') || [], | ||||
|       //掉头 | ||||
|       '12':judgeConfigObj['519'].split(',') || [], | ||||
|       '12':judgeConfigObj['519']?.split(',') || [], | ||||
|     }; | ||||
| 
 | ||||
|     console.info('surenjun',JSON.stringify(projectRoads)) | ||||
| 
 | ||||
|     //未测绘得道路上或者不在差分状态 | ||||
|     if(road === ''){ | ||||
|       return false | ||||
| @ -1040,10 +1043,8 @@ struct Index { | ||||
|     if(projectCode == '10' || projectCode == '4'){ | ||||
|       if(count < 2){return false} | ||||
|     } | ||||
| 
 | ||||
|     return true | ||||
| 
 | ||||
| 
 | ||||
|   } | ||||
|   // 获取人工项目是否已做 | ||||
|   getIsEndManualProject = (index: number) => { | ||||
| @ -1134,6 +1135,8 @@ struct Index { | ||||
|   //必考项目除靠边停车是否全部完成 | ||||
|   @State isRequiredProjectsEnd: boolean = false; | ||||
|   @State lane: LANE = { road: '', num: 0, count: 0 } | ||||
|   //定位差分状态时候正常 | ||||
|   @State isDwztRight:boolean = false; | ||||
|   private context = getContext(this) as common.UIAbilityContext; | ||||
|   //已考考试项目 | ||||
| } | ||||
|  | ||||
| @ -125,6 +125,10 @@ struct UserInfo { | ||||
|           // globalThis.statue=4 | ||||
|           router.pushUrl({ | ||||
|             url: 'pages/Judge', | ||||
|             params:{ | ||||
|               sczb:Number(this.isBoardPrePareSetPopupOpen), | ||||
|               kfdm:this.sczbkf | ||||
|             } | ||||
|           }, router.RouterMode.Single); | ||||
|           return | ||||
|         } | ||||
| @ -499,7 +503,11 @@ struct UserInfo { | ||||
|               this.stepFlag = false | ||||
|               router.pushUrl({ | ||||
|                 url: 'pages/Judge', | ||||
|                 params: { examItems: examItems?.getExaminationItemRsp?.body?.ykxx } | ||||
|                 params: { | ||||
|                   examItems: examItems?.getExaminationItemRsp?.body?.ykxx , | ||||
|                   sczb:Number(this.isBoardPrePareSetPopupOpen), | ||||
|                   kfdm:this.sczbkf | ||||
|                 } | ||||
|               }, router.RouterMode.Single); | ||||
|               this.stopDeviceById() | ||||
| 
 | ||||
| @ -511,7 +519,11 @@ struct UserInfo { | ||||
|               this.stepFlag = false | ||||
|               router.pushUrl({ | ||||
|                 url: 'pages/Judge', | ||||
|                 params: { examItems: examItems?.getExaminationItemRsp?.body?.ykxx } | ||||
|                 params: { | ||||
|                   examItems: examItems?.getExaminationItemRsp?.body?.ykxx , | ||||
|                   sczb:Number(this.isBoardPrePareSetPopupOpen), | ||||
|                   kfdm:this.sczbkf | ||||
|                 } | ||||
|               }, router.RouterMode.Single); | ||||
|               globalThis.statue = 4 | ||||
|               this.stopDeviceById() | ||||
|  | ||||
| @ -95,14 +95,11 @@ export default struct DeductedPopup { | ||||
|       if (sys.v_no == '901') { | ||||
|         this.serialNumber = sys.v_value || '123456' | ||||
|       } | ||||
|       console.info('surenjun',sys.v_no) | ||||
| 
 | ||||
|       //364	绕车一周评判时机(1-开始考试后判 2-开始考试前判) | ||||
|       if (sys.v_no == '364') { | ||||
|         const isOpen = sys.v_value == 2 | ||||
|         if (isOpen) { | ||||
|           this.avPlayer.playAudio(['voice/上车准备.mp3']) | ||||
|           console.info('surenjun','voice/上车准备.mp3') | ||||
|         } | ||||
| 
 | ||||
|       } | ||||
|  | ||||
| @ -21,7 +21,7 @@ export default struct  DeductedPopup { | ||||
|   private  markRules:MarkRule[] = [] | ||||
|   @State universalMarkRules:MarkRule[] = [] | ||||
|   @State manualMarkRules:MarkRule[] = [] | ||||
|   @State currentItems:string[] = [] | ||||
|   @State currentItems:number[] = [] | ||||
| 
 | ||||
|   @State lineBg:Array<string> = ['#4D4136','#26231E'] | ||||
|   @State selectedLine:number = undefined | ||||
| @ -33,7 +33,9 @@ export default struct  DeductedPopup { | ||||
|   } | ||||
| 
 | ||||
|   aboutToAppear(){ | ||||
|     this.universalMarkRules = this.markRules.filter(item => this.currentItems.includes(item.itemno+'')) | ||||
|     //@ts-ignore | ||||
| 
 | ||||
|     this.universalMarkRules = this.markRules.filter(item => (this.currentItems.includes(item.itemno) || this.currentItems.includes(item.itemno + ''))) | ||||
|   } | ||||
|   //上一页 下一页 | ||||
|   goPage(typeIndex){ | ||||
| @ -78,7 +80,6 @@ export default struct  DeductedPopup { | ||||
|           Row(){ | ||||
|             Row(){ | ||||
|               ForEach(['人工评判','通用评判'],(text,index)=>{ | ||||
| 
 | ||||
|                 Row(){ | ||||
|                   Text(text).fontColor(index === this.currentIndex ? this.selected.fontColor : this.unselected.fontColor).fontSize(this.fontSize).fontWeight(500) | ||||
|                 } | ||||
| @ -91,7 +92,8 @@ export default struct  DeductedPopup { | ||||
|                   if(index === 1) { | ||||
|                     this.universalMarkRules = this.markRules.filter(item => item.itemno == 20 ) | ||||
|                   }else{ | ||||
|                     this.universalMarkRules = this.markRules.filter(item => this.currentItems.includes(item.itemno+'')) | ||||
|                     //@ts-ignore | ||||
|                     this.universalMarkRules = this.markRules.filter(item => (this.currentItems.includes(item.itemno) || this.currentItems.includes(item.itemno+''))) | ||||
|                   } | ||||
|                 }) | ||||
|               }) | ||||
| @ -121,11 +123,11 @@ export default struct  DeductedPopup { | ||||
|               Row(){ | ||||
|                 Text('扣  分'){}.fontColor('#FFF').fontSize(this.fontSize).padding({left:35}) | ||||
|               }.width(120).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}) | ||||
|                .onClick(()=>{ | ||||
|                  const index = this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex; | ||||
|                  const mark = this.universalMarkRules[index * 7 + this.selectedLine] | ||||
|                  mark && this.confirmMark(mark.itemno,mark.markserial) | ||||
|                }) | ||||
|               .onClick(()=>{ | ||||
|                 const index = this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex; | ||||
|                 const mark = this.universalMarkRules[index * 7 + this.selectedLine] | ||||
|                 mark && this.confirmMark(mark.itemno,mark.markserial) | ||||
|               }) | ||||
|             } | ||||
|           }.width('100%').justifyContent(FlexAlign.SpaceBetween) | ||||
|           Column(){ | ||||
| @ -145,7 +147,6 @@ export default struct  DeductedPopup { | ||||
|         } | ||||
|       }.width(1200).height(620).position({x:30,y:315}).backgroundColor('#E6E3DF').padding({top:15,bottom:15,left:25,right:25}).borderRadius(20) | ||||
|       // Row(){}.width(100).height(100).position({y:'85%',x:'50%'}).backgroundImage($rawfile('judge/km3/close_nor.png')).backgroundImageSize({width:'100%',height:'100%'}) | ||||
| 
 | ||||
|     }.width('100%').height('100%').position({y:0}).onClick(()=>{this.closePopup()}) | ||||
|   } | ||||
| } | ||||
| @ -1,39 +0,0 @@ | ||||
| const folder = 'judge/km3/amplify/' | ||||
| const amplifyImgs = [ | ||||
|   'km_zxB.png','km_hcB.png', | ||||
|   'km_bdB.png', | ||||
|   'km_ccB.png','km_dtB.png','km_tcB.png', | ||||
| ] | ||||
| const amplifyArrs = [ | ||||
|   {name:'直线',projectCode:'3',projectCodeCenter:'40300'}, | ||||
|   {name:'会车',projectCode:'9',projectCodeCenter:'41300'}, | ||||
|   {name:'变道',projectCode:'4',projectCodeCenter:'40500'}, | ||||
|   {name:'超车',projectCode:'10',projectCodeCenter:'41400'}, | ||||
|   {name:'掉头',projectCode:'12',projectCodeCenter:'41500'}, | ||||
|   {name:'停车',projectCode:'11',projectCodeCenter:'40600'}, | ||||
| ] | ||||
| 
 | ||||
| @Component | ||||
| struct EndPopup { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
|   private amplifyImgIndex:number = 0 | ||||
|   private closeAmplifyPop:Function = ()=>{} | ||||
|   private confirmAmplify:Function = ()=>{} | ||||
| 
 | ||||
|   build(){ | ||||
|     Column(){ | ||||
|       Column(){ | ||||
| 
 | ||||
|       }.width(530).height(386).backgroundImage($rawfile(`${folder}${amplifyImgs[this.amplifyImgIndex]}`)).backgroundImageSize({width:'100%',height:'100%'}).position({y:'25%',x:'37%'}).justifyContent(FlexAlign.Center) | ||||
|        .onClick((e:ClickEvent)=>{ | ||||
|           this.confirmAmplify(amplifyArrs[this.amplifyImgIndex]) | ||||
|        }) | ||||
| 
 | ||||
|     }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.9)') | ||||
|     .onClick(()=>{this.closeAmplifyPop()}) | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export default EndPopup | ||||
| @ -1,154 +0,0 @@ | ||||
| import {MarkRule} from '../../judgeSDK/api/judgeSDK' | ||||
| interface SEL{ | ||||
|   fontColor:string | ||||
|   bgColor:string | ||||
| } | ||||
| 
 | ||||
| @Component | ||||
| struct DeductedPopup { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| 
 | ||||
|   @State fontSize:number = 25 | ||||
|   @State unselected:SEL = {fontColor:'#000000', bgColor:'#CCC4B8'} | ||||
|   @State selected:SEL =   {fontColor:'#FFAD33', bgColor:'#26231E'} | ||||
| 
 | ||||
|   @State currentIndex:number = 0 | ||||
|   @State currentPageIndex:number = 0 | ||||
|   //通用评判扣分 | ||||
|   @State currentUniversalPageIndex:number = 0; | ||||
|   private  markRules:MarkRule[] = [] | ||||
|   @State universalMarkRules:MarkRule[] = [] | ||||
|   @State manualMarkRules:MarkRule[] = [] | ||||
|   @State currentItems:string[] = [] | ||||
| 
 | ||||
|   @State lineBg:Array<string> = ['#4D4136','#26231E'] | ||||
|   @State selectedLine:number = undefined | ||||
|   private  closePopup:Function = ()=> {} | ||||
|   private  confirmMark:Function = (itemno:number,serial:string) => {} | ||||
|   @State selectedLineStyle:SEL = { | ||||
|     fontColor:'#FFF', | ||||
|     bgColor:'#B36E00' | ||||
|   } | ||||
| 
 | ||||
|   aboutToAppear(){ | ||||
|     this.universalMarkRules = this.markRules.filter(item => this.currentItems.includes(item.itemno+'')) | ||||
|   } | ||||
|   //上一页 下一页 | ||||
|   goPage(typeIndex){ | ||||
|     const currentIndex = this.currentIndex | ||||
|     if(currentIndex){ | ||||
|       //通用评判 | ||||
|       typeIndex ? (this.currentUniversalPageIndex += 1) : (this.currentUniversalPageIndex -= 1) | ||||
|     }else{ | ||||
|       typeIndex ? (this.currentPageIndex += 1) : (this.currentPageIndex -= 1) | ||||
|     } | ||||
|     this.selectedLine = -1 | ||||
|   } | ||||
| 
 | ||||
|   //选中扣分项 | ||||
|   getSelectedLine(index){ | ||||
|     const {selectedLine,selectedLineStyle,lineBg} = this; | ||||
|     if(selectedLine === index){ | ||||
|       return selectedLineStyle.bgColor | ||||
|     } | ||||
|     if(index % 2 === 0){ | ||||
|       return lineBg[0] | ||||
|     }else{ | ||||
|       return lineBg[1] | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   //获取当前页的数据 | ||||
|   getCurrentMarkRuleList(){ | ||||
|     const {currentIndex,currentUniversalPageIndex,currentPageIndex,markRules,universalMarkRules} = this; | ||||
|     if(currentIndex){ | ||||
|       //通用评判 | ||||
|       return universalMarkRules.slice(currentUniversalPageIndex*7,(currentUniversalPageIndex + 1)*7) | ||||
|     }else{ | ||||
|       return universalMarkRules.slice(currentPageIndex*7,(currentPageIndex + 1)*7) | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   build(){ | ||||
|     Column(){ | ||||
|       Column(){ | ||||
|         Column(){ | ||||
|           Row(){ | ||||
|             Row(){ | ||||
|               ForEach(['人工评判','通用评判'],(text,index)=>{ | ||||
| 
 | ||||
|                 Row(){ | ||||
|                   Text(text).fontColor(index === this.currentIndex ? this.selected.fontColor : this.unselected.fontColor).fontSize(this.fontSize).fontWeight(500) | ||||
|                 } | ||||
|                 .width(180).height(70) | ||||
|                 .backgroundColor(index === this.currentIndex ? this.selected.bgColor: this.unselected.bgColor ).justifyContent(FlexAlign.Center).justifyContent(FlexAlign.Center) | ||||
|                 .borderRadius({topLeft:20,topRight:20}).margin({right:10}) | ||||
|                 .onClick(()=>{ | ||||
|                   this.currentIndex = index; | ||||
|                   this.selectedLine = -1; | ||||
|                   if(index === 1) { | ||||
|                     this.universalMarkRules = this.markRules.filter(item => item.itemno == 20 ) | ||||
|                   }else{ | ||||
|                     this.universalMarkRules = this.markRules.filter(item => this.currentItems.includes(item.itemno+'')) | ||||
|                   } | ||||
|                 }) | ||||
|               }) | ||||
|             } | ||||
|             Row(){ | ||||
|               if( | ||||
|                 (Math.ceil(this.universalMarkRules.length / 7 - 1)) >= (this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex) && | ||||
|                   (this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex) > 0 | ||||
|               ){ | ||||
|                 Row(){ | ||||
|                   Row(){}.width(36).height(36).backgroundImage($rawfile(`judge/km3/zuo_nor.png`)).margin({left:24,top:4}) | ||||
|                   Text('上一页'){}.fontColor('#FFF').fontSize(this.fontSize) | ||||
|                 }.width(160).height(80).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}) | ||||
|                 .onClick(()=>{this.goPage(0)}) | ||||
|               } | ||||
| 
 | ||||
|               if( | ||||
|                 (Math.ceil(this.universalMarkRules.length / 7 - 1))  > (this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex) | ||||
|               ){ | ||||
|                 Row(){ | ||||
|                   Text('下一页'){}.fontColor('#FFF').fontSize(this.fontSize).padding({left:30}) | ||||
|                   Row(){}.width(36).height(36).backgroundImage($rawfile(`judge/km3/you_nor.png`)).margin({left:4,top:4}) | ||||
|                 }.width(160).height(80).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}) | ||||
|                 .onClick(()=>{this.goPage(1)}) | ||||
|               } | ||||
| 
 | ||||
| 
 | ||||
|               Row(){ | ||||
|                 Text('扣  分'){}.fontColor('#FFF').fontSize(this.fontSize).padding({left:49}) | ||||
|               }.width(160).height(80).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}) | ||||
|                .onClick(()=>{ | ||||
|                  const index = this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex; | ||||
|                  const mark = this.universalMarkRules[index * 7 + this.selectedLine] | ||||
|                  mark && this.confirmMark(mark.itemno,mark.markserial) | ||||
|                }) | ||||
|             } | ||||
|           }.width('100%').justifyContent(FlexAlign.SpaceBetween) | ||||
|           Column(){ | ||||
|             ForEach(this.getCurrentMarkRuleList(),(item,index) => { | ||||
|               Row(){ | ||||
|                 Text(`${item.markshow} (${item.markcatalog})`).fontColor('#FFF').fontSize(this.fontSize).fontWeight(500) | ||||
|                 Row(){ | ||||
|                   Text(item.markreal + '').fontColor('#FFF').fontSize(this.fontSize).fontWeight(500) | ||||
|                 } | ||||
|               } | ||||
|               .width('100%').height(75).justifyContent(FlexAlign.SpaceBetween).alignItems(VerticalAlign.Center) | ||||
|               .padding({left:20,right:20}) | ||||
|               .backgroundColor(this.getSelectedLine(index)) | ||||
|               .onClick(()=>{this.selectedLine = index}) | ||||
|             }) | ||||
|           } | ||||
|         } | ||||
|       }.width(1300).height(710).position({x:'15%',y:'10%'}).backgroundColor('#E6E3DF').padding({top:15,bottom:15,left:25,right:25}).borderRadius(20) | ||||
|       Row(){}.width(100).height(100).position({y:'85%',x:'50%'}).backgroundImage($rawfile('judge/km3/close_nor.png')).backgroundImageSize({width:'100%',height:'100%'}) | ||||
|         .onClick(()=>{this.closePopup()}) | ||||
|     }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)') | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export default DeductedPopup | ||||
| @ -1,27 +0,0 @@ | ||||
| 
 | ||||
| @Component | ||||
| struct EndPopup { | ||||
|   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)') | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export default EndPopup | ||||
| @ -1,21 +0,0 @@ | ||||
| 
 | ||||
| @Component | ||||
| struct LoadingPopup { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| 
 | ||||
|   private title:string = '' | ||||
| 
 | ||||
|   build(){ | ||||
|     Column(){ | ||||
|       Column(){ | ||||
|         Image($rawfile('judge/loading-car.gif')).width(250).margin({top:20,bottom:20}) | ||||
|         Text(this.title).fontSize(32).margin({top:70}) | ||||
|       }.width('70%').height('70%').backgroundColor('#E6E3DF').borderRadius(38).position({y:'15%',x:'15%'}).justifyContent(FlexAlign.Center) | ||||
| 
 | ||||
|     }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)') | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export default LoadingPopup | ||||
| @ -1,83 +0,0 @@ | ||||
| // @ts-nocheck | ||||
| import hilog from '@ohos.hilog'; | ||||
| import apiJudgeSdk from 'libJudgeSdk.so'; | ||||
| // import apiJudgeSdk from '@ohos.judgesdk'; | ||||
| 
 | ||||
| import Judge from '../../judgeSDK/utils/judge-real' | ||||
| // import Judge from '../../judgeSDK/judge-track-playback' | ||||
| import {Project,ProjectObj,MarkRule} from '../../judgeSDK/api/judgeSDK.d' | ||||
| import AccountTable from '../../../common/database/tables/AccountTable'; | ||||
| import MA_SYSSET from '../../../common//constants/MA_SYSSET'; | ||||
| import common from '@ohos.app.ability.common'; | ||||
| import { getSyncData } from '../../../common/service/initable' | ||||
| import {testAllitems,testUIAllitems,testMarkRules} from '../../judgeSDK/dataTest/index' | ||||
| 
 | ||||
| @Component | ||||
| struct RealTime { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| 
 | ||||
|   private height:number = 0 | ||||
|   private width:number = 0 | ||||
| 
 | ||||
|   @State message: string = '开始绘制' | ||||
| 
 | ||||
|   // 控制XComponent组件的创建和销毁 | ||||
|   @State draw: boolean = false | ||||
|   //监管接口序列号 | ||||
|   @State serialNumber:number = 0 | ||||
| 
 | ||||
|   //模拟考试项目 | ||||
|   @State projects:Project[] = [] | ||||
|   @State projectsObj:ProjectObj = {} | ||||
|   @State markRuleListObj:MarkRule ={} | ||||
|   private context = getContext(this) as common.UIAbilityContext; | ||||
| 
 | ||||
|   // xcomponentController: XComponentController = new XComponentController() | ||||
| 
 | ||||
|   build() { | ||||
|     Row() { | ||||
|       Column() { | ||||
|         if (this.draw) { | ||||
|           XComponent({ | ||||
|             id: 'duolun_plugin_id_draw', //显示轨迹窗口id名称,注意这个ID要和C++侧一致,不能变 | ||||
|             type: 'surface', | ||||
|             libraryname: 'JudgeSdk' | ||||
|             // libraryname: 'judgesdk' | ||||
|           }) | ||||
|             .width(this.width) | ||||
|             .height(this.height) | ||||
|             .onLoad(() => { | ||||
|               apiJudgeSdk.examJudgeMapSetDrawing(true); //停止绘制地图轨迹,false:表示结束绘制 | ||||
|             }) | ||||
|             .onDestroy(() => { | ||||
|               apiJudgeSdk.examJudgeMapSetDrawing(false); //停止绘制地图轨迹,false:表示结束绘制 | ||||
|               this.draw = false; | ||||
|               clearInterval(globalThis.realTimer) | ||||
|             }) | ||||
|         } else { | ||||
|           Column() {} | ||||
|           .width(this.width) | ||||
|           .height(this.height) | ||||
|         } | ||||
|       } | ||||
|       .width('100%') | ||||
|       .backgroundColor('#fff') | ||||
|     } | ||||
|     .height('100%') | ||||
|   } | ||||
| 
 | ||||
|   async aboutToAppear() { | ||||
| 
 | ||||
|     const judge = new Judge(this) | ||||
|   } | ||||
| 
 | ||||
|   aboutToDisappear() { | ||||
|     //apiJudgeSdk.stopRender(); | ||||
| 
 | ||||
|   } | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| export default RealTime | ||||
| @ -172,9 +172,8 @@ export default class Judge { | ||||
|       handleTrajectoryUdp(strArr); | ||||
|       return | ||||
|     } | ||||
| 
 | ||||
|     // 处理实时udp里的plc信号
 | ||||
|     globalThis.udpClient.onMessage(async (msg) => { | ||||
|     globalThis.udpClient.onMessage_1(async (msg) => { | ||||
|       handleUdp(msg) | ||||
|     }) | ||||
|   } | ||||
| @ -323,8 +322,9 @@ export default class Judge { | ||||
|       case 2: | ||||
|         judgeUI.projectsObj[xmdm].type = (xmjs.xmhg === 0 ? '4' : '3'); | ||||
|         //计算项目是否全部结束
 | ||||
|         console.info(judgeTag,projects.filter(project => project.type == '2').length ) | ||||
|         this.judgeUI.isProjectIn = (projects.filter(project => project.type == '2').length) > 0 | ||||
|         this.judgeUI.isProjectIn = (Reflect.ownKeys(judgeUI.projectsObj).filter( | ||||
|           projectKey => judgeUI.projectsObj[projectKey].type == '2').length | ||||
|         ) > 0; | ||||
|         if(isManualProjectIn){ | ||||
|           this.judgeUI.isManualProjectIn = false | ||||
|         } | ||||
| @ -383,6 +383,7 @@ export default class Judge { | ||||
|     //车道和路段变化
 | ||||
|       case 9: | ||||
|         this.judgeUI.lane = lane | ||||
|         console.info('surenjun',JSON.stringify(lane)) | ||||
|         break; | ||||
| 
 | ||||
|       default: | ||||
| @ -624,11 +625,10 @@ export default class Judge { | ||||
|     const {avPlayer,fileLog} = this; | ||||
|     const {xmdm,code,type} = sound; | ||||
|     //判断是不是模拟灯光语音
 | ||||
|     console.info(judgeTag,JSON.stringify(sound)) | ||||
|     if(type == 1){ | ||||
|       console.info(judgeTag, '模拟灯光开始播放:' + code) | ||||
|     } | ||||
|     avPlayer.playAudio([`voice/${code}.mp3`], true, () => { | ||||
|     avPlayer.playAudio([`voice/${code}.mp3`], false, () => { | ||||
|       if (type == 1) { | ||||
|         console.info(judgeTag, '播放结束:' + code) | ||||
|         examJudgeSoundEnd({itemno:xmdm,code,type}) | ||||
| @ -794,9 +794,7 @@ export default class Judge { | ||||
|     const {jd,wd, hxj,  fyj,  hbg,} = gps | ||||
|     const translateProject = getTranslateProject(); | ||||
|     const sbxh = getSbxh(xmdm, xmxh) | ||||
|     console.log('sbxhsbxh', sbxh) | ||||
|     const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo; | ||||
|     console.log('performInfo', JSON.stringify(performInfo)) | ||||
|     // const asclshArr = stringToASC(lsh);
 | ||||
|     const asclshArr = stringToASC(fillZero('0000000000000' || 0, 13)); | ||||
| 
 | ||||
| @ -806,19 +804,16 @@ export default class Judge { | ||||
|     const translateSignals = getTranslateSignals( | ||||
|       [zfxd, yfxd, shtd, ygd, jgd, skd, dh1, dh2, lhq, jsc, ssc, fsc, lb, mkg, aqd, 0, 0, 0, 0].concat(getCarStatusType(carzt)).concat([ygq, sensor.wd, 0]) | ||||
|     ) | ||||
|     console.log('jinweidu111jdwd0') | ||||
| 
 | ||||
|     //@ts-ignore
 | ||||
|     const translateJd = convertGpsCoord2(wd).toFixed(7) * Math.pow(10, 7); | ||||
|     //@ts-ignore
 | ||||
|     const translateWd = convertGpsCoord2(jd).toFixed(7) * Math.pow(10, 7) | ||||
|     console.log('jinweidu111jdwd') | ||||
|     //@ts-ignore
 | ||||
|     const translateProjects = translateProject.map(numStr => string2Bytes(parseInt(numStr, 2), 8)[0]) | ||||
| 
 | ||||
|     //@ts-ignore
 | ||||
|     // const translateProjects= translateProject.map(num => string2Bytes(p,8)[0])
 | ||||
|     console.log('jinweidu2222', `${examType}${startHourTime}`) | ||||
|     const arr = [ | ||||
|     //考生号                                         TODO 考试员号
 | ||||
|       asclshArr.map(lsh => string2Bytes(lsh, 8)[0]), | ||||
| @ -1043,6 +1038,7 @@ export default class Judge { | ||||
|       const str = await senorToWXDataStr(msg); | ||||
|       usbService.sendUSB(str) | ||||
|     } | ||||
|     this.judgeUI.isDwztRight = plcData.gps.dwzt == 4; | ||||
|     await examJudgeRealExam(plcData) | ||||
|     const udpIndex = globalThis.udpIndex; | ||||
|     if (udpIndex % 5 === 0) { | ||||
| @ -1117,7 +1113,7 @@ export default class Judge { | ||||
|       } | ||||
|       await examJudgeRealExam(msg) | ||||
|       num++ | ||||
|     }, 100) | ||||
|     }, 200) | ||||
|     globalThis.judgeTimer = judgeTimer; | ||||
|   } | ||||
|   // 统计必考项目数量
 | ||||
|  | ||||
| @ -63,7 +63,6 @@ export function getCenterProjectStatus(status){ | ||||
| } | ||||
| 
 | ||||
| //获取科目三开始项目、结束项目语音
 | ||||
| 
 | ||||
| export function getKmProjectVoice( | ||||
|   projectCode, | ||||
|   // 1:项目开始 2:项目结束
 | ||||
| @ -101,8 +100,8 @@ export function getKmProjectVoice( | ||||
|     case 40600 : return type === 1 ? 406001 : undefined | ||||
|     //掉头
 | ||||
|     case 41500 : return type === 1 ? 415001:undefined | ||||
|     //超车
 | ||||
|     case 40400 : return type === 1 ? 404001:undefined | ||||
|     //加减挡为
 | ||||
|     case 40400 : return type === 1 ? undefined : undefined | ||||
| 
 | ||||
|     default :return undefined | ||||
|   } | ||||
|  | ||||
| @ -1,5 +1,4 @@ | ||||
| 
 | ||||
| 
 | ||||
| //考试回放开关
 | ||||
| export const judgeConfig = { | ||||
|   //本地目录开关
 | ||||
| @ -9,11 +8,9 @@ export const judgeConfig = { | ||||
|   // 本地模型地址
 | ||||
|   modelPath: 'models/model_enc', | ||||
|   // 轨迹回放地址
 | ||||
|   // trajectoryPath: 'logs/2024_07_11/0000000000001_342323199501470011_测试学员1_2024_07_11_14_25_52/judge_exam_data.txt',
 | ||||
|   // trajectoryPath: 'logs/2024_07_11/0000000000001_342323199501470011_测试学员1_2024_07_01_11_30_16/judge_exam_data.txt',
 | ||||
|   trajectoryPath: 'logs/2024_07_11/0000000000001_342323199501470011_测试学员1_2024_07_11_14_25_52/judge_exam_data.txt', | ||||
|   trajectoryPath: 'logs/2024_07_11/0000000000001_342323199501470011_测试学员1_2024_07_11_13_33_10/judge_exam_data.txt', | ||||
|   //扣分语音是否强制开启
 | ||||
|   kfVoiceOpen:false, | ||||
|   kfVoiceOpen:true, | ||||
|   //TODO 济南临时特殊配置
 | ||||
|   systemParamConfig:{} | ||||
| } | ||||
| @ -25,7 +25,6 @@ export default class VoiceAnnounce{ | ||||
| 
 | ||||
|   async playAudio(urls:string[],shit?:boolean,callback?:Function){ | ||||
|     const {isStopped,queue} = this; | ||||
|     // this.callback = callback
 | ||||
|     const tempUrls = urls.map((url,index)=>{ | ||||
|       return { | ||||
|         url, | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user