Compare commits

...

5 Commits

Author SHA1 Message Date
3e509779f1 Merge pull request 'feat_surenjun' (#35) from feat_surenjun into main
Reviewed-on: #35
2024-07-17 09:01:30 +08:00
a7cf1eb007 Merge branch 'main' into feat_surenjun
# Conflicts:
#	entry/src/main/ets/pages/Index.ets
2024-07-17 09:02:29 +08:00
03df4becd9 feat:科目三评判优化 2024-07-16 17:32:25 +08:00
1a4301f424 feat:科目三评判优化 2024-07-16 15:02:36 +08:00
9ac3e76957 feat:删除无用文件 2024-07-16 12:55:41 +08:00
13 changed files with 66 additions and 386 deletions

View File

@ -192,13 +192,13 @@ struct Index {
}) })
this.totalScore += currentKf.markreal * 1; 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.projectsObj ...this.projectsObj
} }
} }
this.judgeConfigObj[sys.v_no] = value this.judgeConfigObj[sys.v_no] = value
}); });
this.judgeConfig = syssetJudgeConfigArr; this.judgeConfig = syssetJudgeConfigArr;
} }
@ -210,7 +210,7 @@ struct Index {
const {carName,carType,examSubject} = this; const {carName,carType,examSubject} = this;
//小车车型列表 //小车车型列表
const sCarTypes = ['C1', 'C2', 'C5'] const sCarTypes = ['C1', 'C2', 'C5']
this.wayno = currentParams.wayno this.wayno = currentParams.wayno || 1;
const {isTrajectoryOpen} = judgeConfig const {isTrajectoryOpen} = judgeConfig
let carNo = '', allItems = []; let carNo = '', allItems = [];
systemParms.forEach((systemParm) => { systemParms.forEach((systemParm) => {
@ -256,7 +256,7 @@ struct Index {
//是否是必考 //是否是必考
isRequired: allItems.includes(no2 + ''), isRequired: allItems.includes(no2 + ''),
} }
this.projectsObj[no2] = currentProject this.projectsObj[no2*1] = currentProject
this.projectsCenterObj[txt2] = currentProject this.projectsCenterObj[txt2] = currentProject
this.projects.push(currentProject); this.projects.push(currentProject);
} }
@ -272,7 +272,7 @@ struct Index {
const projects = this.projects; const projects = this.projects;
if (!projects.length) { if (!projects.length) {
Prompt.showToast({ Prompt.showToast({
message: '读取数据库信息失败,请重新考试', message: '读取数据库信息失败,请重新联网更新',
duration: 8000 duration: 8000
}); });
router.back(); router.back();
@ -434,9 +434,8 @@ struct Index {
Row() { Row() {
Image($rawfile('judge/signal_logoS.png')).width(120) Image($rawfile('judge/signal_logoS.png')).width(120)
Text(this.time).fontColor('#CCB48F').fontSize(32).padding({ left: 10, right: 5 }) 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 }) }.padding({ left: 20 })
Row() { Row() {
Text(`当前项目:${this.xmmcStr || '无'} `).fontColor('#E5CCA1').fontSize(32) Text(`当前项目:${this.xmmcStr || '无'} `).fontColor('#E5CCA1').fontSize(32)
} }
@ -607,9 +606,7 @@ struct Index {
List({}) { List({}) {
ForEach(this.projects, (project) => { ForEach(this.projects, (project) => {
ListItem() { ListItem() {
Text(project.name) { Text(project.name) {}
}
.fontColor(this.getProjectColor(this.projectsObj[project.projectCode].type)) .fontColor(this.getProjectColor(this.projectsObj[project.projectCode].type))
.margin({ bottom: 5 }) .margin({ bottom: 5 })
.fontSize(26) .fontSize(26)
@ -819,8 +816,8 @@ struct Index {
currentItems: Reflect.ownKeys(this.projectsObj).map(projectKey => { currentItems: Reflect.ownKeys(this.projectsObj).map(projectKey => {
//@ts-ignore //@ts-ignore
const project = this.projectsObj[projectKey] const project = this.projectsObj[projectKey]
return project.type == '2' ? project.projectCode : '' return project.type == '2' ? project.projectCode : undefined
}).filter(project => project !== ''), }).filter(project => project !== undefined),
markRules: this.manualMarkRules, markRules: this.manualMarkRules,
closePopup: () => { closePopup: () => {
this.isDeductedPopShow = false this.isDeductedPopShow = false
@ -928,9 +925,9 @@ struct Index {
} = this; } = this;
const projectCode = artSubject3ProjectsCodesArr[index]; const projectCode = artSubject3ProjectsCodesArr[index];
const projectType = projectsObj[projectCode].type; const projectType = projectsObj[projectCode].type;
//不允许人工触发的项目列表,以","分隔 //不允许人工触发的项目列表,以","分隔
const unExitManualProjects = judgeConfigObj['332'].split(',') || []; const unExitManualProjects = judgeConfigObj['332'].split(',') || [];
//直线行驶中不进其他考试项目(0-否 1-是) //直线行驶中不进其他考试项目(0-否 1-是)
const param348 = judgeConfigObj['348'] || '0', const param348 = judgeConfigObj['348'] || '0',
//里程不够允许手工点靠边停车0-否 1-是) //里程不够允许手工点靠边停车0-否 1-是)
@ -951,18 +948,22 @@ struct Index {
if (judgeConfigObj['342'] === '3' || judgeConfigObj['342'] === '2') { if (judgeConfigObj['342'] === '3' || judgeConfigObj['342'] === '2') {
return false return false
} }
//不允许人工触发的项目列表 //不允许人工触发的项目列表
if (unExitManualProjects.includes(artSubject3ProjectsCodesArr[index])) { if (unExitManualProjects.includes(artSubject3ProjectsCodesArr[index])) {
return false return false
} }
//项目进行中不能人工触发 //项目进行中不能人工触发
if (isProjectIn) { if(isProjectIn) {
if (param340 == 1 && isManualProjectIn && (currentXmdm == projectCode)) { if(param340 == 1){
return true if(isManualProjectIn && (currentXmdm == projectCode)){
}else{ return true
return false }else{
return false
}
} }
return false
} }
//项目路段信息判断 //项目路段信息判断
@ -999,19 +1000,21 @@ struct Index {
const projectRoads = { 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 === ''){ if(road === ''){
return false return false
@ -1040,10 +1043,8 @@ struct Index {
if(projectCode == '10' || projectCode == '4'){ if(projectCode == '10' || projectCode == '4'){
if(count < 2){return false} if(count < 2){return false}
} }
return true return true
} }
// 获取人工项目是否已做 // 获取人工项目是否已做
getIsEndManualProject = (index: number) => { getIsEndManualProject = (index: number) => {
@ -1134,6 +1135,8 @@ struct Index {
//必考项目除靠边停车是否全部完成 //必考项目除靠边停车是否全部完成
@State isRequiredProjectsEnd: boolean = false; @State isRequiredProjectsEnd: boolean = false;
@State lane: LANE = { road: '', num: 0, count: 0 } @State lane: LANE = { road: '', num: 0, count: 0 }
//定位差分状态时候正常
@State isDwztRight:boolean = false;
private context = getContext(this) as common.UIAbilityContext; private context = getContext(this) as common.UIAbilityContext;
//已考考试项目 //已考考试项目
} }

View File

@ -125,6 +125,10 @@ struct UserInfo {
// globalThis.statue=4 // globalThis.statue=4
router.pushUrl({ router.pushUrl({
url: 'pages/Judge', url: 'pages/Judge',
params:{
sczb:Number(this.isBoardPrePareSetPopupOpen),
kfdm:this.sczbkf
}
}, router.RouterMode.Single); }, router.RouterMode.Single);
return return
} }
@ -499,7 +503,11 @@ struct UserInfo {
this.stepFlag = false this.stepFlag = false
router.pushUrl({ router.pushUrl({
url: 'pages/Judge', 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); }, router.RouterMode.Single);
this.stopDeviceById() this.stopDeviceById()
@ -511,7 +519,11 @@ struct UserInfo {
this.stepFlag = false this.stepFlag = false
router.pushUrl({ router.pushUrl({
url: 'pages/Judge', 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); }, router.RouterMode.Single);
globalThis.statue = 4 globalThis.statue = 4
this.stopDeviceById() this.stopDeviceById()

View File

@ -95,14 +95,11 @@ export default struct DeductedPopup {
if (sys.v_no == '901') { if (sys.v_no == '901') {
this.serialNumber = sys.v_value || '123456' this.serialNumber = sys.v_value || '123456'
} }
console.info('surenjun',sys.v_no)
//364 绕车一周评判时机(1-开始考试后判 2-开始考试前判) //364 绕车一周评判时机(1-开始考试后判 2-开始考试前判)
if (sys.v_no == '364') { if (sys.v_no == '364') {
const isOpen = sys.v_value == 2 const isOpen = sys.v_value == 2
if (isOpen) { if (isOpen) {
this.avPlayer.playAudio(['voice/上车准备.mp3']) this.avPlayer.playAudio(['voice/上车准备.mp3'])
console.info('surenjun','voice/上车准备.mp3')
} }
} }

View File

@ -21,7 +21,7 @@ export default struct DeductedPopup {
private markRules:MarkRule[] = [] private markRules:MarkRule[] = []
@State universalMarkRules:MarkRule[] = [] @State universalMarkRules:MarkRule[] = []
@State manualMarkRules:MarkRule[] = [] @State manualMarkRules:MarkRule[] = []
@State currentItems:string[] = [] @State currentItems:number[] = []
@State lineBg:Array<string> = ['#4D4136','#26231E'] @State lineBg:Array<string> = ['#4D4136','#26231E']
@State selectedLine:number = undefined @State selectedLine:number = undefined
@ -33,7 +33,9 @@ export default struct DeductedPopup {
} }
aboutToAppear(){ 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){ goPage(typeIndex){
@ -78,7 +80,6 @@ export default struct DeductedPopup {
Row(){ Row(){
Row(){ Row(){
ForEach(['人工评判','通用评判'],(text,index)=>{ ForEach(['人工评判','通用评判'],(text,index)=>{
Row(){ Row(){
Text(text).fontColor(index === this.currentIndex ? this.selected.fontColor : this.unselected.fontColor).fontSize(this.fontSize).fontWeight(500) 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) { if(index === 1) {
this.universalMarkRules = this.markRules.filter(item => item.itemno == 20 ) this.universalMarkRules = this.markRules.filter(item => item.itemno == 20 )
}else{ }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(){ Row(){
Text('扣 分'){}.fontColor('#FFF').fontSize(this.fontSize).padding({left:35}) 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%'}) }.width(120).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'})
.onClick(()=>{ .onClick(()=>{
const index = this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex; const index = this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex;
const mark = this.universalMarkRules[index * 7 + this.selectedLine] const mark = this.universalMarkRules[index * 7 + this.selectedLine]
mark && this.confirmMark(mark.itemno,mark.markserial) mark && this.confirmMark(mark.itemno,mark.markserial)
}) })
} }
}.width('100%').justifyContent(FlexAlign.SpaceBetween) }.width('100%').justifyContent(FlexAlign.SpaceBetween)
Column(){ 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) }.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%'}) // 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()}) }.width('100%').height('100%').position({y:0}).onClick(()=>{this.closePopup()})
} }
} }

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -172,9 +172,8 @@ export default class Judge {
handleTrajectoryUdp(strArr); handleTrajectoryUdp(strArr);
return return
} }
// 处理实时udp里的plc信号 // 处理实时udp里的plc信号
globalThis.udpClient.onMessage(async (msg) => { globalThis.udpClient.onMessage_1(async (msg) => {
handleUdp(msg) handleUdp(msg)
}) })
} }
@ -323,8 +322,9 @@ export default class Judge {
case 2: case 2:
judgeUI.projectsObj[xmdm].type = (xmjs.xmhg === 0 ? '4' : '3'); judgeUI.projectsObj[xmdm].type = (xmjs.xmhg === 0 ? '4' : '3');
//计算项目是否全部结束 //计算项目是否全部结束
console.info(judgeTag,projects.filter(project => project.type == '2').length ) this.judgeUI.isProjectIn = (Reflect.ownKeys(judgeUI.projectsObj).filter(
this.judgeUI.isProjectIn = (projects.filter(project => project.type == '2').length) > 0 projectKey => judgeUI.projectsObj[projectKey].type == '2').length
) > 0;
if(isManualProjectIn){ if(isManualProjectIn){
this.judgeUI.isManualProjectIn = false this.judgeUI.isManualProjectIn = false
} }
@ -383,6 +383,7 @@ export default class Judge {
//车道和路段变化 //车道和路段变化
case 9: case 9:
this.judgeUI.lane = lane this.judgeUI.lane = lane
console.info('surenjun',JSON.stringify(lane))
break; break;
default: default:
@ -624,11 +625,10 @@ export default class Judge {
const {avPlayer,fileLog} = this; const {avPlayer,fileLog} = this;
const {xmdm,code,type} = sound; const {xmdm,code,type} = sound;
//判断是不是模拟灯光语音 //判断是不是模拟灯光语音
console.info(judgeTag,JSON.stringify(sound))
if(type == 1){ if(type == 1){
console.info(judgeTag, '模拟灯光开始播放:' + code) console.info(judgeTag, '模拟灯光开始播放:' + code)
} }
avPlayer.playAudio([`voice/${code}.mp3`], true, () => { avPlayer.playAudio([`voice/${code}.mp3`], false, () => {
if (type == 1) { if (type == 1) {
console.info(judgeTag, '播放结束:' + code) console.info(judgeTag, '播放结束:' + code)
examJudgeSoundEnd({itemno:xmdm,code,type}) examJudgeSoundEnd({itemno:xmdm,code,type})
@ -794,9 +794,7 @@ export default class Judge {
const {jd,wd, hxj, fyj, hbg,} = gps const {jd,wd, hxj, fyj, hbg,} = gps
const translateProject = getTranslateProject(); const translateProject = getTranslateProject();
const sbxh = getSbxh(xmdm, xmxh) const sbxh = getSbxh(xmdm, xmxh)
console.log('sbxhsbxh', sbxh)
const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo; const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo;
console.log('performInfo', JSON.stringify(performInfo))
// const asclshArr = stringToASC(lsh); // const asclshArr = stringToASC(lsh);
const asclshArr = stringToASC(fillZero('0000000000000' || 0, 13)); const asclshArr = stringToASC(fillZero('0000000000000' || 0, 13));
@ -806,19 +804,16 @@ export default class Judge {
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].concat(getCarStatusType(carzt)).concat([ygq, sensor.wd, 0]) [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 //@ts-ignore
const translateJd = convertGpsCoord2(wd).toFixed(7) * Math.pow(10, 7); const translateJd = convertGpsCoord2(wd).toFixed(7) * Math.pow(10, 7);
//@ts-ignore //@ts-ignore
const translateWd = convertGpsCoord2(jd).toFixed(7) * Math.pow(10, 7) const translateWd = convertGpsCoord2(jd).toFixed(7) * Math.pow(10, 7)
console.log('jinweidu111jdwd')
//@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 //@ts-ignore
// const translateProjects= translateProject.map(num => string2Bytes(p,8)[0]) // const translateProjects= translateProject.map(num => string2Bytes(p,8)[0])
console.log('jinweidu2222', `${examType}${startHourTime}`)
const arr = [ const arr = [
//考生号 TODO 考试员号 //考生号 TODO 考试员号
asclshArr.map(lsh => string2Bytes(lsh, 8)[0]), asclshArr.map(lsh => string2Bytes(lsh, 8)[0]),
@ -1043,6 +1038,7 @@ export default class Judge {
const str = await senorToWXDataStr(msg); const str = await senorToWXDataStr(msg);
usbService.sendUSB(str) usbService.sendUSB(str)
} }
this.judgeUI.isDwztRight = plcData.gps.dwzt == 4;
await examJudgeRealExam(plcData) await examJudgeRealExam(plcData)
const udpIndex = globalThis.udpIndex; const udpIndex = globalThis.udpIndex;
if (udpIndex % 5 === 0) { if (udpIndex % 5 === 0) {
@ -1117,7 +1113,7 @@ export default class Judge {
} }
await examJudgeRealExam(msg) await examJudgeRealExam(msg)
num++ num++
}, 100) }, 200)
globalThis.judgeTimer = judgeTimer; globalThis.judgeTimer = judgeTimer;
} }
// 统计必考项目数量 // 统计必考项目数量

View File

@ -63,7 +63,6 @@ export function getCenterProjectStatus(status){
} }
//获取科目三开始项目、结束项目语音 //获取科目三开始项目、结束项目语音
export function getKmProjectVoice( export function getKmProjectVoice(
projectCode, projectCode,
// 1:项目开始 2:项目结束 // 1:项目开始 2:项目结束
@ -101,8 +100,8 @@ export function getKmProjectVoice(
case 40600 : return type === 1 ? 406001 : undefined case 40600 : return type === 1 ? 406001 : undefined
//掉头 //掉头
case 41500 : return type === 1 ? 415001: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 default :return undefined
} }

View File

@ -1,5 +1,4 @@
//考试回放开关 //考试回放开关
export const judgeConfig = { export const judgeConfig = {
//本地目录开关 //本地目录开关
@ -9,11 +8,9 @@ export const judgeConfig = {
// 本地模型地址 // 本地模型地址
modelPath: 'models/model_enc', 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_11_13_33_10/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',
//扣分语音是否强制开启 //扣分语音是否强制开启
kfVoiceOpen:false, kfVoiceOpen:true,
//TODO 济南临时特殊配置 //TODO 济南临时特殊配置
systemParamConfig:{} systemParamConfig:{}
} }

View File

@ -25,7 +25,6 @@ export default class VoiceAnnounce{
async playAudio(urls:string[],shit?:boolean,callback?:Function){ async playAudio(urls:string[],shit?:boolean,callback?:Function){
const {isStopped,queue} = this; const {isStopped,queue} = this;
// this.callback = callback
const tempUrls = urls.map((url,index)=>{ const tempUrls = urls.map((url,index)=>{
return { return {
url, url,