This commit is contained in:
lvyuankang 2024-12-20 13:28:18 +08:00
commit 2de46a9d1a
4 changed files with 44 additions and 23 deletions

3
.gitignore vendored
View File

@ -8,3 +8,6 @@
/.clangd /.clangd
/.clang-format /.clang-format
/.clang-tidy /.clang-tidy
/entry/src/main/cpp
/entry/src/main/ets/pages/judgeSDK/utils/judgeConfig.ts
/build-profile.json5

View File

@ -1325,7 +1325,7 @@ struct Index {
@State lane: LANE = { road: '', num: 0, count: 0 } @State lane: LANE = { road: '', num: 0, count: 0 }
@State roadData: Object = {}; @State roadData: Object = {};
//定位差分状态时候正常 //定位差分状态时候正常
@State isDwztRight: boolean = false; @State isDwztRight: boolean = true;
@State defaultTabIndex: number = 0; @State defaultTabIndex: number = 0;
private context = getContext(this) as common.UIAbilityContext; private context = getContext(this) as common.UIAbilityContext;
public kfArrScroller: Scroller = new Scroller() public kfArrScroller: Scroller = new Scroller()

View File

@ -97,8 +97,8 @@ export interface MAPITEMPOINTITEM {
} }
export interface EXAMDATA { export interface EXAMDATA {
//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 event: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11
//时间 //时间
sj: number sj: number
//考车状态 -1:后退 0:停车 1:前进 //考车状态 -1:后退 0:停车 1:前进
@ -164,6 +164,9 @@ export interface EXAMDATA {
xmdm:number, xmdm:number,
xmxh:string xmxh:string
} }
nongps:{
type:0|1|2|3|4
}
} }
export interface KSJS { export interface KSJS {

View File

@ -358,7 +358,7 @@ export default class Judge {
handleRealExam = async (strData, callBack) => { handleRealExam = async (strData, callBack) => {
let examData: EXAMDATA = JSON.parse(strData); let examData: EXAMDATA = JSON.parse(strData);
const {getDqxmStr,getKfStr,goJudgeVoice,setMndg,avPlayer,fileLog,judgeUI} = this; 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 param512 = (judgeUI.judgeConfigObj['512'] || '').split(',');
//获取项目结束、项目开始代码 //获取项目结束、项目开始代码
const xmdm = event == 2 ? xmjs.xmdm : xmks.xmdm const xmdm = event == 2 ? xmjs.xmdm : xmks.xmdm
@ -497,6 +497,11 @@ export default class Judge {
} }
break; break;
//差分事件
case 11:{
const {type}= nongps
this.checkDwzt(type)
}
default: default:
break; break;
@ -1477,13 +1482,13 @@ 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 && plcData.gps.jdzt == 3); // this.judgeUI.isDwztRight = (plcData.gps.dwzt == 4 && plcData.gps.jdzt == 3);
const param350 = judgeUI.judgeConfigObj['350'] const param350 = judgeUI.judgeConfigObj['350']
//@ts-ignore //@ts-ignore
this.judgeUI.sd = ((param350 == 0? plcData.gps.sd :plcData.sensor.cs) as number * 1.852).toFixed(0) + '' 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) + '' this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + ''
//TODO 暂时关闭差分检测异常 //TODO 暂时关闭差分检测异常
await this.checkDwzt(plcData.gps.dwzt,plcData.gps.jdzt); // await this.checkDwzt(plcData.gps.dwzt,plcData.gps.jdzt);
if(!isExamEnd){ if(!isExamEnd){
await examJudgeRealExam(plcData) await examJudgeRealExam(plcData)
} }
@ -1610,25 +1615,35 @@ export default class Judge {
} }
// 检测差分状态 // 检测差分状态
checkDwzt = async (dwzt,jdzt) => { checkDwzt = async (type) => {
const {avPlayer} = this; const {avPlayer} = this;
const judgeConfig = this.judgeUI.judgeConfig; const judgeConfig = this.judgeUI.judgeConfig;
const param499 = judgeConfig['499'] || ''; switch (type){
if(param499 == '' || param499 == undefined){ case 0:
return this.judgeUI.isDwztRight = true;
} break;
//10秒内dwzt不为4
const dwztNum = this.dwztNum case 1:
if(dwztNum != 0 && (dwztNum % (5 * 10) == 0) && (param499 !== '' || param499 !== undefined)){
this.judgeUI.dwztErrorVisible = true; this.judgeUI.dwztErrorVisible = true;
avPlayer.playAudio([`voice/差分状态异常.mp3`],true) avPlayer.playAudio([`voice/差分状态异常.mp3`],true)
} setTimeout(()=>{
router.back()
},3000)
break;
if(dwzt != 4 || jdzt != 3){ case 2:
this.dwztNum += 1 avPlayer.playAudio([`voice/差分状态异常.mp3`],true);
}else{
this.dwztNum = 0; break;
this.judgeUI.dwztErrorVisible = false; case 3:
this.judgeUI.dwztErrorVisible = true;
avPlayer.playAudio([`voice/差分状态异常.mp3`],true);
break;
case 4:
this.judgeUI.isDwztRight = false;
//差分异常上报
break;
} }
} }