dev #63
@ -41,8 +41,8 @@ export default class GetDistance {
|
||||
console.info('surenjun',str)
|
||||
const contentArr = content.split('\n').filter(item => item)
|
||||
console.info('surenjun contentArr',JSON.stringify(contentArr))
|
||||
this.totalDistance += str
|
||||
contentArr[contentArr.length - 1] = `程序启动时间:${timeStr} 累计行驶距离:${this.totalDistance}m`+ '\n'
|
||||
this.totalDistance += str * 1
|
||||
contentArr[contentArr.length - 1] = `程序启动时间:${timeStr} 累计行驶距离:${(this.totalDistance).toFixed(2)}m`+ '\n'
|
||||
console.info('surenjun',contentArr.join('\n'))
|
||||
await fileUtil.addFile(
|
||||
`${folderPath}/${date}.txt`,contentArr.join('\n')
|
||||
|
||||
@ -8,7 +8,7 @@ import AmplifyPopup from './compontents/judge/AmplifyPopup';
|
||||
import Judge from './judgeSDK/judge';
|
||||
import { defaultJudgeConfigObj } from './judgeSDK/utils//judgeCommon';
|
||||
import {uploadExamMileage} from '../api/judge'
|
||||
|
||||
import DwztErrorPopup from './compontents/judge/DwztErrorPopup'
|
||||
import {
|
||||
CARINFO,
|
||||
CDSBInfo,
|
||||
@ -874,7 +874,6 @@ struct Index {
|
||||
}.width('100%').height('100%').position({ y: 0 }).backgroundColor('rgba(0,0,0,0.6)')
|
||||
}
|
||||
|
||||
|
||||
//科目三人工项目确认框
|
||||
if (this.isAmplifyPopShow && this.examSubject == 3) {
|
||||
AmplifyPopup({
|
||||
@ -920,6 +919,20 @@ struct Index {
|
||||
title: '正在生成考试记录,请稍后...',
|
||||
})
|
||||
}
|
||||
|
||||
if(this.dwztErrorVisible){
|
||||
DwztErrorPopup({
|
||||
title:'当前差分状态异常,学员将无法正常进行考试评判,请将车辆行驶到开阔地,等待程序自检,差分正常后会自动关闭该对话框',
|
||||
cancelFn:()=>{
|
||||
this.dwztErrorVisible = false;
|
||||
},
|
||||
confirmFn:()=>{
|
||||
clearInterval(this.timer);
|
||||
clearInterval(globalThis.judgeTimer)
|
||||
this.judge.checkExamIsEnd(true);
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
.height('100%').backgroundColor('#000').justifyContent(FlexAlign.Start)
|
||||
}
|
||||
@ -995,6 +1008,7 @@ struct Index {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取是否能人工进项目
|
||||
getIsExitManualProject = (index: number) => {
|
||||
const {
|
||||
@ -1077,6 +1091,7 @@ struct Index {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// 判断项目是否在当前路段号
|
||||
getProjectIsInRoad = (projectCode: string,) => {
|
||||
const {
|
||||
@ -1136,6 +1151,7 @@ struct Index {
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
// 获取人工项目是否已做
|
||||
getIsEndManualProject = (index: number) => {
|
||||
const projectName = this.artSubject3Projects[index];
|
||||
@ -1146,6 +1162,7 @@ struct Index {
|
||||
}
|
||||
return (type == '3' || type == '4') ? `${projectName}_red` : `${projectName}_green`;
|
||||
}
|
||||
|
||||
scroller: Scroller = new Scroller()
|
||||
//页面通用字体大小
|
||||
@State wayno: number = 0
|
||||
@ -1244,4 +1261,5 @@ struct Index {
|
||||
@State sd: string = ''
|
||||
@State mileageTimer: number = 0;
|
||||
@State passingScore: number = 80
|
||||
@State dwztErrorVisible: boolean = false;
|
||||
}
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
|
||||
@Component
|
||||
export default struct DwztErrorPop{
|
||||
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)')
|
||||
}
|
||||
}
|
||||
@ -209,3 +209,5 @@ export interface LANE {
|
||||
export interface ProjectObj {
|
||||
[k: string]: Project
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -72,7 +72,6 @@ export default class Judge {
|
||||
this.xmmcCode = '';
|
||||
this.carztStr = '';
|
||||
this.testKmItems = {};
|
||||
|
||||
// 考试回放配置
|
||||
const {isTrajectoryOpen,modelPath,trajectoryPath} = judgeConfig
|
||||
this.isTrajectoryOpen = isTrajectoryOpen;
|
||||
@ -91,7 +90,6 @@ export default class Judge {
|
||||
// status: projectsCenterObj[item.code]?.isRequired ? 1 : 0
|
||||
}
|
||||
})
|
||||
|
||||
console.info(judgeTag+'testKmItems',JSON.stringify(this.testKmItems))
|
||||
this.isExamEnd = false;
|
||||
}
|
||||
@ -178,6 +176,8 @@ export default class Judge {
|
||||
handleUdp(msg)
|
||||
})
|
||||
|
||||
|
||||
|
||||
//TODO 监听远程扣分
|
||||
}
|
||||
|
||||
@ -380,7 +380,7 @@ export default class Judge {
|
||||
case 5:
|
||||
this.ksjs = ksjs;
|
||||
await fileLog.setExamJudgeData({
|
||||
method: 'examjudgeEndExam',
|
||||
method: 'examJudgeEndExam',
|
||||
})
|
||||
break;
|
||||
|
||||
@ -504,8 +504,9 @@ export default class Judge {
|
||||
case 3:
|
||||
//扣分时实时播报语音(0-否+1-是)
|
||||
const currentKf = kf[kfLen -1];
|
||||
if (judgeConfigObj['418'] == '1' && judgeConfig.kfVoiceOpen) {
|
||||
avPlayer.playAudio([`voice/${currentKf.markcatalog}.mp3`])
|
||||
if (judgeConfig.kfVoiceOpen ||(examSubject == 2 && judgeConfigObj['618'] == '1') || (examSubject== 3&& judgeConfigObj['418'] == '1') ) {
|
||||
avPlayer.playAudio([`voice/${currentKf.markcatalog}.mp3`,`voice/mark_${Math.abs(currentKf.score)}.mp3`])
|
||||
|
||||
}
|
||||
const isStart = await checkProjectIsStart(currentKf.xmdm,2,currentKf);
|
||||
if(isStart){
|
||||
@ -709,7 +710,7 @@ export default class Judge {
|
||||
const photoBase64 = await getPhoto();
|
||||
const carInfo = globalThis.carInfo;
|
||||
const { examSubject,plateNo,carNo } = carInfo;
|
||||
const {lsh,idCard,serialNumber,projectsObj,ksdd} = judgeUI;
|
||||
const {lsh,idCard,serialNumber,projectsObj,ksdd,judgeConfigObj} = judgeUI;
|
||||
const {sensor,gps} = plcData
|
||||
const project = projectsObj[ksxm]
|
||||
|
||||
@ -724,7 +725,7 @@ export default class Judge {
|
||||
zpsj: time,
|
||||
//@ts-ignore
|
||||
zp: photoBase64,
|
||||
cs: Math.floor(gps.sd * 1.852),
|
||||
cs: Math.floor((judgeConfigObj['350'] == 0?gps.sd:sensor.cs) * 1.852),
|
||||
ksdd: encodeURI(ksdd)
|
||||
}
|
||||
};
|
||||
@ -870,7 +871,7 @@ export default class Judge {
|
||||
}
|
||||
}
|
||||
await handleSEP(306);
|
||||
avPlayer.playAudio(['voice/exam_waiting.mp3'], true, async () => {
|
||||
avPlayer.playAudio(['voice/exam_waiting.mp3'], globalThis.singlePlay, async () => {
|
||||
try {
|
||||
if (!singlePlay) {
|
||||
const bytes = await this.getMessageHeartbeat(true);
|
||||
@ -1054,7 +1055,7 @@ export default class Judge {
|
||||
getSbxh
|
||||
} = this;
|
||||
const singlePlay = globalThis.singlePlay
|
||||
const {lsh,startHourTime,totalScore,examTime} = judgeUI;
|
||||
const {lsh,startHourTime,totalScore,examTime,judgeConfigObj} = judgeUI;
|
||||
const {fourInOneScreen:{gpsDigit}} = judgeConfig
|
||||
const examType = examSubject == 2?2:3
|
||||
const {sensor,gps} = tempData;
|
||||
@ -1062,7 +1063,7 @@ export default class Judge {
|
||||
return
|
||||
}
|
||||
const {zfxd,yfxd,shtd,ygd,jgd,skd,dh1,dh2,lhq,jsc,ssc,fsc,lb,mkg,aqd,ygq,cs,fdjzs,dw} = sensor
|
||||
const {jd,wd, hxj, fyj, hbg,} = gps
|
||||
const {jd,wd, hxj, fyj, hbg,sd} = gps
|
||||
const translateProject = getTranslateProject();
|
||||
const sbxh = getSbxh(xmdm, xmxh)
|
||||
const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo || {};
|
||||
@ -1081,6 +1082,14 @@ export default class Judge {
|
||||
const translateWd = convertGpsCoord2(jd).toFixed(gpsDigit) * Math.pow(10, gpsDigit)
|
||||
//@ts-ignore
|
||||
const translateProjects = translateProject.map(numStr => string2Bytes(parseInt(numStr, 2), 8)[0])
|
||||
|
||||
//@ts-ignore
|
||||
let tempSd = ((judgeConfigObj['350'] ==0 ? sd : cs) * 1.852).toFixed(0) * 1
|
||||
console.info(judgeTag + "prevSD",tempSd);
|
||||
if(tempSd < 1){
|
||||
tempSd = 0
|
||||
}
|
||||
|
||||
const arr = [
|
||||
//考生号
|
||||
asclshArr.map(lsh => string2Bytes(lsh, 8)[0]),
|
||||
@ -1094,7 +1103,7 @@ export default class Judge {
|
||||
translateSignals,
|
||||
//速度 发动机转速 GPS纬度 GPS经度 主天线位置
|
||||
//@ts-ignore
|
||||
string2Bytes(cs * 100, 2 * 8), string2Bytes(fdjzs / 100, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8),
|
||||
string2Bytes(tempSd * 100, 2 * 8), string2Bytes(fdjzs / 100, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8),
|
||||
//GPS东向距离
|
||||
string2Bytes(dxjl < 0 ? (dxjl + 4294967296) : dxjl, 4 * 8),
|
||||
//GPS北向距离
|
||||
@ -1316,7 +1325,7 @@ export default class Judge {
|
||||
// 处理udp plc信号
|
||||
handleUdp = async (msg) => {
|
||||
console.info('plc信号', msg)
|
||||
const {fileLog,getPlcData,usbService,isUdpEnd,isExamEnd} = this
|
||||
const {fileLog,getPlcData,usbService,isUdpEnd,isExamEnd,judgeUI} = this
|
||||
const stachArr = msg.split(',')
|
||||
if (stachArr[0] != '#DN_GD' || isUdpEnd) {
|
||||
return
|
||||
@ -1330,8 +1339,12 @@ export default class Judge {
|
||||
usbService.sendUSB(str)
|
||||
}
|
||||
this.judgeUI.isDwztRight = plcData.gps.dwzt == 4;
|
||||
this.judgeUI.sd = (Math.floor(((plcData.gps.sd as number) || 0) * 1.852)) + '';
|
||||
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) + ''
|
||||
|
||||
await this.checkDwzt(plcData.gps.dwzt);
|
||||
if(!isExamEnd){
|
||||
await examJudgeRealExam(plcData)
|
||||
}
|
||||
@ -1401,7 +1414,7 @@ export default class Judge {
|
||||
// 4.过程数据
|
||||
this.tempData = msg
|
||||
this.judgeUI.isDwztRight = msg?.gps?.dwzt == 4;
|
||||
this.judgeUI.sd = Math.floor(msg?.gps?.sd) * 1.852 + '';
|
||||
this.judgeUI.sd = Math.floor(msg?.gps?.sd * 1.852) + '';
|
||||
this.judgeUI.dw = Math.floor(msg?.sensor?.dw) + ''
|
||||
this.plcData = msg
|
||||
// this.judgeUI.isDwztRight = msg.gps.dwzt == 4;
|
||||
@ -1454,10 +1467,22 @@ export default class Judge {
|
||||
this.mndgStr = mndgStr
|
||||
}
|
||||
|
||||
// 路段信息处理
|
||||
setRoadAndLane = async (lane) => {
|
||||
const {road,num,count} = lane;
|
||||
|
||||
// 检测差分状态
|
||||
checkDwzt = async (dwzt) => {
|
||||
const {avPlayer} = this;
|
||||
const judgeConfig = this.judgeUI.judgeConfig;
|
||||
// const param499 = judgeConfig['499']
|
||||
//10秒内dwzt不为4;
|
||||
const dwztNum = this.dwztNum
|
||||
if(dwztNum != 0 && (dwztNum % (5 * 10) == 0)){
|
||||
this.judgeUI.dwztErrorVisible = true;
|
||||
avPlayer.playAudio([`voice/差分状态异常.mp3`],true)
|
||||
}
|
||||
if(dwzt != 4){
|
||||
this.dwztNum += 1
|
||||
}else{
|
||||
this.dwztNum = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public plcStr: string
|
||||
@ -1465,6 +1490,7 @@ export default class Judge {
|
||||
private fileLog
|
||||
private filePath
|
||||
private totalScore: number
|
||||
private dwztNum:number = 0
|
||||
private folderPath: string
|
||||
private modelPath: string
|
||||
private avPlayer
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user