feat:科目三评判优化
This commit is contained in:
parent
1a4301f424
commit
03df4becd9
@ -15,6 +15,7 @@ import { getliushuiNum, setliushuiNum } from '../common/service/indexService';
|
||||
import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl';
|
||||
import worker, { MessageEvents } from '@ohos.worker';
|
||||
import promptAction from '@ohos.promptAction'
|
||||
import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
@ -213,6 +214,8 @@ struct Index {
|
||||
globalThis.ratio = 1700 / 960
|
||||
this.angle = 0
|
||||
this.loading = false
|
||||
const avPlayer = new VoiceAnnounce();
|
||||
avPlayer.playAudio(['voice/welcome.mp3'])
|
||||
}
|
||||
|
||||
async testXMLToJSONInWorker() {
|
||||
|
||||
@ -436,7 +436,6 @@ struct Index {
|
||||
Text(this.time).fontColor('#CCB48F').fontSize(32).padding({ left: 10, right: 5 })
|
||||
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)
|
||||
@ -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
|
||||
}
|
||||
|
||||
//项目路段信息判断
|
||||
@ -1012,6 +1013,8 @@ struct Index {
|
||||
'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) => {
|
||||
|
||||
@ -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;
|
||||
}
|
||||
// 统计必考项目数量
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user