diff --git a/.gitignore b/.gitignore index a4a68abd..a6da3e53 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,7 @@ .cxx /.clangd /.clang-format -/.clang-tidy \ No newline at end of file +/.clang-tidy +/entry/src/main/cpp +/entry/src/main/ets/pages/judgeSDK/utils/judgeConfig.ts +/build-profile.json5 \ No newline at end of file diff --git a/entry/src/main/ets/pages/Judge.ets b/entry/src/main/ets/pages/Judge.ets index 078c6237..c7a8242e 100644 --- a/entry/src/main/ets/pages/Judge.ets +++ b/entry/src/main/ets/pages/Judge.ets @@ -1325,7 +1325,7 @@ struct Index { @State lane: LANE = { road: '', num: 0, count: 0 } @State roadData: Object = {}; //定位差分状态时候正常 - @State isDwztRight: boolean = false; + @State isDwztRight: boolean = true; @State defaultTabIndex: number = 0; private context = getContext(this) as common.UIAbilityContext; public kfArrScroller: Scroller = new Scroller() diff --git a/entry/src/main/ets/pages/judgeSDK/api/judgeSDK.d.ts b/entry/src/main/ets/pages/judgeSDK/api/judgeSDK.d.ts index d651eccf..f398950e 100644 --- a/entry/src/main/ets/pages/judgeSDK/api/judgeSDK.d.ts +++ b/entry/src/main/ets/pages/judgeSDK/api/judgeSDK.d.ts @@ -97,8 +97,8 @@ export interface MAPITEMPOINTITEM { } export interface EXAMDATA { - //1:项目开始 2:项目结束 3:扣分 4:考车状态 5:考试结束 6:项目取消 7:语音播放和提示 8:模拟灯光事件 9:车道信息事件 10:预进项目事件 - event: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 + //1:项目开始 2:项目结束 3:扣分 4:考车状态 5:考试结束 6:项目取消 7:语音播放和提示 8:模拟灯光事件 9:车道信息事件 10:预进项目事件 11:差分事件 + event: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 //时间 sj: number //考车状态 -1:后退 0:停车 1:前进 @@ -164,6 +164,9 @@ export interface EXAMDATA { xmdm:number, xmxh:string } + nongps:{ + type:0|1|2|3|4 + } } export interface KSJS { diff --git a/entry/src/main/ets/pages/judgeSDK/judge.ts b/entry/src/main/ets/pages/judgeSDK/judge.ts index e4f3cad7..d3217516 100644 --- a/entry/src/main/ets/pages/judgeSDK/judge.ts +++ b/entry/src/main/ets/pages/judgeSDK/judge.ts @@ -358,7 +358,7 @@ export default class Judge { handleRealExam = async (strData, callBack) => { let examData: EXAMDATA = JSON.parse(strData); const {getDqxmStr,getKfStr,goJudgeVoice,setMndg,avPlayer,fileLog,judgeUI} = this; - const {carzt,xmks,kf,event,xmjs,xmqx,ksjs,sound,mndg,lane,precast} = examData + const {carzt,xmks,kf,event,xmjs,xmqx,ksjs,sound,mndg,lane,precast,nongps} = examData const param512 = (judgeUI.judgeConfigObj['512'] || '').split(','); //获取项目结束、项目开始代码 const xmdm = event == 2 ? xmjs.xmdm : xmks.xmdm @@ -497,6 +497,11 @@ export default class Judge { } break; + //差分事件 + case 11:{ + const {type}= nongps + this.checkDwzt(type) + } default: break; @@ -1477,13 +1482,13 @@ export default class Judge { const str = await senorToWXDataStr(msg); usbService.sendUSB(str) } - this.judgeUI.isDwztRight = (plcData.gps.dwzt == 4 && plcData.gps.jdzt == 3); + // this.judgeUI.isDwztRight = (plcData.gps.dwzt == 4 && plcData.gps.jdzt == 3); const param350 = judgeUI.judgeConfigObj['350'] //@ts-ignore this.judgeUI.sd = ((param350 == 0? plcData.gps.sd :plcData.sensor.cs) as number * 1.852).toFixed(0) + '' this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + '' //TODO 暂时关闭差分检测异常 - await this.checkDwzt(plcData.gps.dwzt,plcData.gps.jdzt); + // await this.checkDwzt(plcData.gps.dwzt,plcData.gps.jdzt); if(!isExamEnd){ await examJudgeRealExam(plcData) } @@ -1610,25 +1615,35 @@ export default class Judge { } // 检测差分状态 - checkDwzt = async (dwzt,jdzt) => { + checkDwzt = async (type) => { const {avPlayer} = this; const judgeConfig = this.judgeUI.judgeConfig; - const param499 = judgeConfig['499'] || ''; - if(param499 == '' || param499 == undefined){ - return - } - //10秒内dwzt不为4; - const dwztNum = this.dwztNum - if(dwztNum != 0 && (dwztNum % (5 * 10) == 0) && (param499 !== '' || param499 !== undefined)){ - this.judgeUI.dwztErrorVisible = true; - avPlayer.playAudio([`voice/差分状态异常.mp3`],true) - } + switch (type){ + case 0: + this.judgeUI.isDwztRight = true; + break; - if(dwzt != 4 || jdzt != 3){ - this.dwztNum += 1 - }else{ - this.dwztNum = 0; - this.judgeUI.dwztErrorVisible = false; + case 1: + this.judgeUI.dwztErrorVisible = true; + avPlayer.playAudio([`voice/差分状态异常.mp3`],true) + setTimeout(()=>{ + router.back() + },3000) + break; + + case 2: + avPlayer.playAudio([`voice/差分状态异常.mp3`],true); + + break; + case 3: + this.judgeUI.dwztErrorVisible = true; + avPlayer.playAudio([`voice/差分状态异常.mp3`],true); + break; + + case 4: + this.judgeUI.isDwztRight = false; + //差分异常上报 + break; } }