1519 lines
48 KiB
TypeScript
Raw Normal View History

2024-01-05 11:11:15 +08:00
import systemTime from '@ohos.systemDateTime';
import router from '@ohos.router';
import util from '@ohos.util';
import buffer from '@ohos.buffer';
2024-08-08 20:12:19 +08:00
import { testKm2Items,testKm3Items, testMarkRules } from './dataTest/index';
2024-07-31 13:47:40 +08:00
import { EXAMDATA, SOUND, KSJS } from './api/judgeSDK';
2024-07-11 10:22:31 +08:00
import VoiceAnnounce from './utils/voiceAnnouncements';
import FileModel from './utils/fileModel';
import FilePhoto from './utils/filePhoto';
2024-07-02 10:42:53 +08:00
import FileUtil from '../../common/utils/File';
2024-07-11 10:22:31 +08:00
import FileLog from './utils/fileLog';
import JudgeTask from './utils/judgeTask';
import { judgeConfig } from './utils/judgeConfig';
2024-07-02 10:42:53 +08:00
import { uploadExamProgressData, writeObjectOut } from '../../api/judge';
2024-07-31 13:47:40 +08:00
import UsbService from '../../common/service/usbService';
import { LANE,KF } from '../judgeSDK/api/judgeSDK.d';
2024-07-02 10:14:38 +08:00
import {
2024-07-02 10:42:53 +08:00
Array2Byte,
convertGpsCoord2,
deepClone,
fillZero,
getCurrentTime,
string2Bytes,
stringToASC
} from '../../common/utils/tools';
2024-07-31 13:47:40 +08:00
2024-07-02 10:42:53 +08:00
import {
getCarStatus,
getCarStatusType,
2024-08-08 20:12:19 +08:00
getDwStatusType,
2024-07-02 10:42:53 +08:00
getCenterProjectStatus,
getKmProjectVoice,
getTranslateSignals,
plcStrToJson,
plcStrToWXJson,
promptWxCode,
2024-08-12 10:19:31 +08:00
senorToWXDataStr,
getKmProjectCancelVoice
2024-07-11 10:22:31 +08:00
} from './utils/judgeCommon';
2024-07-31 13:47:40 +08:00
2024-07-02 10:42:53 +08:00
import {
examJudgeArtificialItem,
examJudgeArtificialMark,
2024-07-02 10:14:38 +08:00
examJudgeBeginExam,
2024-07-02 10:42:53 +08:00
examJudgeEndExam,
2024-07-02 10:14:38 +08:00
examJudgeInit,
2024-07-11 10:22:31 +08:00
examJudgeSoundEnd,
2024-07-02 10:14:38 +08:00
examJudgeRealExam,
2024-07-02 10:42:53 +08:00
examJudgeSetLogCallback,
2024-07-02 10:14:38 +08:00
examJudgeSetPerformCallback,
2024-07-02 10:42:53 +08:00
examJudgeSetRealExamCallback
} from './api/index';
2024-01-05 11:11:15 +08:00
2024-07-02 10:42:53 +08:00
const judgeTag = 'SURENJUN_JUDGE'
2024-05-15 16:22:48 +08:00
2024-07-02 10:42:53 +08:00
export default class Judge {
2024-07-05 09:08:17 +08:00
constructor(judgeUI) {
this.serialIndex = 1;
this.judgeUI = judgeUI
//语音播放工具
this.avPlayer = new VoiceAnnounce();
//模型工具
this.fileModel = new FileModel(judgeUI.context);
//文件工具
this.fileUtil = new FileUtil(judgeUI.context)
this.judgeTask = new JudgeTask()
this.usbService = new UsbService();
2024-07-31 13:47:40 +08:00
this.filePhoto = new FilePhoto(judgeUI.context);
2024-07-05 09:08:17 +08:00
this.kfArr = judgeUI.kfArr
this.xmmcStr = '';
this.xmmcCode = '';
this.carztStr = '';
this.testKmItems = {};
2024-01-05 11:11:15 +08:00
2024-07-05 09:08:17 +08:00
// 考试回放配置
const {isTrajectoryOpen,modelPath,trajectoryPath} = judgeConfig
this.isTrajectoryOpen = isTrajectoryOpen;
this.modelPath = modelPath;
this.trajectoryPath = trajectoryPath;
2024-05-15 16:22:48 +08:00
2024-07-31 13:47:40 +08:00
this.isExam = !this.judgeUI.singlePlay;
2024-08-08 20:12:19 +08:00
const {projectsCenterObj,examSubject} = judgeUI;
2024-07-05 09:08:17 +08:00
//科目三待修改
2024-08-08 20:12:19 +08:00
(examSubject ==2 ? testKm2Items : testKm3Items ).forEach(item => {
2024-07-05 09:08:17 +08:00
this.testKmItems[item.code] = item;
//考试项目存在
2024-08-08 20:12:19 +08:00
this.testKmItems[item.code] = {
code: item.code,
status: 1,
// status: projectsCenterObj[item.code]?.isRequired ? 1 : 0
2024-07-05 09:08:17 +08:00
}
2024-01-05 11:11:15 +08:00
})
2024-08-08 20:12:19 +08:00
console.info(judgeTag+'testKmItems',JSON.stringify(this.testKmItems))
2024-07-31 13:47:40 +08:00
this.isExamEnd = false;
2024-07-02 10:42:53 +08:00
}
2024-07-05 09:08:17 +08:00
public async onJudgeFn(fn: Function) {
await this.judging(fn)
2024-07-02 10:42:53 +08:00
}
2024-07-31 13:47:40 +08:00
2024-07-05 09:08:17 +08:00
//开始评判
private async judging(callBack: Function) {
const {judgeUI} = this;
const { name, lsh, idCard} = judgeUI;
const fileLog = new FileLog(judgeUI.context);
const filePath = await fileLog.initFileLogo({
name, lsh, idCard
});
this.fileLog = fileLog;
2024-08-05 09:47:44 +08:00
this.filePath = filePath;
2024-07-05 09:08:17 +08:00
const {getJudgeBeginData,handleUdp,fileUtil,handleTrajectoryUdp,isTrajectoryOpen,trajectoryPath,avPlayer} = this;
const isJudgeInitBool = globalThis.isJudgeInitBool;
let strArr = [];
if (isTrajectoryOpen) {
const folderPath = await this.fileUtil.initFolder(trajectoryPath);
const str = await fileUtil.readFile(folderPath)
strArr = str.split('\n')
2024-07-02 10:42:53 +08:00
}
2024-07-05 09:08:17 +08:00
//日志回调
console.info(judgeTag, '1.进入评判入口')
2024-07-31 13:47:40 +08:00
await examJudgeSetLogCallback(6, async (level, info, len) => {
2024-07-05 09:08:17 +08:00
console.log('评判日志:' + info)
await fileLog.setExamJudgeLogData(info);
})
console.info(judgeTag, '2.注册日志回调完成')
let initInfo = isTrajectoryOpen ? JSON.parse(strArr[0]) : await this.getJudgeInitData();
2024-07-11 10:22:31 +08:00
2024-07-05 09:08:17 +08:00
//相关评判初始化只做一次
if (!isJudgeInitBool) {
await fileLog.setExamJudgeData(initInfo)
const tempJudge = await examJudgeInit(initInfo);
globalThis.isJudgeInitBool = true
console.info(judgeTag, '4.评判初始化完成')
} else {
2024-07-11 10:22:31 +08:00
await fileLog.setExamJudgeData(initInfo)
2024-07-02 10:42:53 +08:00
}
2024-01-31 14:42:14 +08:00
2024-07-05 09:08:17 +08:00
globalThis.isJudge = true
// 2.评判过程回调
await examJudgeSetRealExamCallback(async (strData, len) => {
await fileLog.setExamJudgeCallbackData(strData)
console.info('评判回调数据', strData)
this.handleRealExam(strData, callBack)
})
2024-01-05 11:11:15 +08:00
2024-07-05 09:08:17 +08:00
await examJudgeSetPerformCallback(async (info) => {
console.info('评判实时数据', info)
const performInfo = JSON.parse(info)
this.performInfo = performInfo
2024-07-11 10:22:31 +08:00
this.judgeUI.jl = Math.floor((performInfo.qjjl + performInfo.dcjl) / 100)
2024-07-31 13:47:40 +08:00
//TODO 待优化 跨组件传值不生效
globalThis.laneData = performInfo.lane;
2024-07-05 09:08:17 +08:00
})
2024-07-11 10:22:31 +08:00
2024-07-05 09:08:17 +08:00
// 3.开始考试
let beginExamInfo = isTrajectoryOpen ? {
...JSON.parse(strArr[1]),
2024-08-12 10:19:31 +08:00
replay: 1,
ykxm:judgeConfig.ignoreProjects
2024-07-05 09:08:17 +08:00
} : await getJudgeBeginData()
2024-07-11 10:22:31 +08:00
2024-07-05 09:08:17 +08:00
await fileLog.setExamJudgeData(beginExamInfo)
await examJudgeBeginExam(beginExamInfo);
console.info(judgeTag, '6.开始考试注册完成')
2024-08-08 20:12:19 +08:00
avPlayer.playAudio([globalThis.singlePlay?'voice/ksks.WAV':'voice/监管成功.mp3'])
2024-07-05 09:08:17 +08:00
this.judgeUI.draw = true
// 处理轨迹plc信息
if (isTrajectoryOpen) {
handleTrajectoryUdp(strArr);
return
2024-01-05 11:11:15 +08:00
}
2024-07-05 09:08:17 +08:00
// 处理实时udp里的plc信号
2024-08-05 09:47:44 +08:00
// globalThis.udpClient.closeMessage_1();
2024-07-16 17:32:25 +08:00
globalThis.udpClient.onMessage_1(async (msg) => {
2024-08-05 09:47:44 +08:00
console.info('socketTag[PLC.UdpClient]', '收到udp回调数据')
2024-07-05 09:08:17 +08:00
handleUdp(msg)
})
2024-07-11 10:22:31 +08:00
}
2024-07-31 13:47:40 +08:00
2024-07-11 10:22:31 +08:00
// 获取评判初始化数据
getJudgeInitData = async () => {
const {getModelData,getKm3JudgeInitConfig} = this
const carInfo = globalThis.carInfo;
const { examSubject,plateNo,carId } = carInfo;
const judgeUI = this.judgeUI
const {projectsObj,cdsbInfoObj,markRuleListObj,carType,carName,systemparmArr} = judgeUI
const examType = examSubject == 2 ? 'km2' : 'km3'
2024-01-05 11:11:15 +08:00
2024-07-11 10:22:31 +08:00
let allitems = [];
if (examSubject == 2) {
allitems = Reflect.ownKeys(cdsbInfoObj).map(cdsbKey => {
const cdsb = cdsbInfoObj[cdsbKey];
const {xmdm,xmxh,modelKey} = cdsb
return {
xmdm, xmxh, model: getModelData(`${examType}/${modelKey}.txt`)
}
})
}
2024-07-05 09:08:17 +08:00
2024-07-11 10:22:31 +08:00
const initInfo = {
kskm: examSubject * 1,
kchp: plateNo,
kchm: carId * 1,
kscx: carType,
cxcode: '1',
name: carName,
carmodel: getModelData(`${examType}/${carType}.txt`),
allitems,
2024-07-31 13:47:40 +08:00
iteminfo: [],
2024-07-11 10:22:31 +08:00
systemparm: systemparmArr,
mark: Reflect.ownKeys(markRuleListObj).map(ruleKey => (markRuleListObj[ruleKey])) || testMarkRules,
sysset: judgeUI.judgeConfig,
};
let km3Config = {}
2024-07-31 13:47:40 +08:00
if (examSubject == 3) {
2024-07-11 10:22:31 +08:00
km3Config = await getKm3JudgeInitConfig();
}
// 获取科目三的评判配置
console.info(judgeTag, '3.获取评判初始化数据完成')
return {
...initInfo,
...km3Config,
}
2024-07-05 18:10:12 +08:00
}
2024-07-31 13:47:40 +08:00
2024-07-11 10:22:31 +08:00
// 获取开始考试数据
getJudgeBeginData = async () => {
const {code,name:examinerName} = globalThis.examinerInfo;
let currentParams: any = router.getParams();
const {sczb,kfdm} = currentParams;
const {isExam} = this;
const judgeUI = this.judgeUI
const {projects,carType,isDdxk,ddxkTime,projectsCenterObj,ddxkKsxmArr,ddxkKfArr} = judgeUI;
const beginInfo = {
kgid: '012',
kgxm: decodeURI(examinerName || ''),
exam: isExam ? 1 : 0,
//是否回放
replay: 0,
//生成的轨迹文件
track: '',
xm: judgeUI.name,
sex: 0,
kslsh: judgeUI.lsh,
sfzmhm: judgeUI.idCard,
ksyy: '',
kscx: carType,
kkcs: 1,
sfyk: 0,
ykkkcs: 1,
wayno: judgeUI.wayno * 1,
czlx: 0,
kskssj: await systemTime.getCurrentTime(),
ksxm: projects.map(project => {
return {
xmdm: project.projectCode * 1,
xmxh: '',
}
}),
//断点续考
ddxk: isDdxk ? 1 : 0,
2024-07-31 13:47:40 +08:00
ddkssj: ddxkTime || 0,
2024-07-11 10:22:31 +08:00
ykxm: isDdxk ? (ddxkKsxmArr?.map(projectCenterCode => (projectsCenterObj[projectCenterCode]?.projectCode) * 1)) : [],
kfxm: isDdxk ? (ddxkKfArr?.map(kf => {
const [xmdm, kfdm] = kf.split(',')
return {
xmdm: xmdm * 1,
kfdm
}
})) : [],
2024-07-31 13:47:40 +08:00
//TODO 已考里程待修改
2024-07-11 10:22:31 +08:00
yklc: 0,
special: [],
//TODO 科目三参数临时写死
2024-07-31 13:47:40 +08:00
sczb: (sczb === undefined || sczb == 0) ? 0 : 1,
sczbkf: kfdm,
2024-07-11 10:22:31 +08:00
dmndg: false,
nitem1: false,
nitem41: false,
mfxx: false,
mfxxn: false
}
console.info(judgeTag, '5.获取开始考试数据完成')
return beginInfo
}
//处理评判过程回调
handleRealExam = async (strData, callBack) => {
let examData: EXAMDATA = JSON.parse(strData);
2024-08-12 10:19:31 +08:00
const {getDqxmStr,getKfStr,goJudgeVoice,setMndg,avPlayer,judgeUI} = this;
const {carzt,xmks,kf,event,xmjs,xmqx,ksjs,sound,mndg,lane} = examData
const param512 = (judgeUI.judgeConfigObj['512'] || '').split(',');
2024-07-11 10:22:31 +08:00
//获取项目结束、项目开始代码
const xmdm = event == 2 ? xmjs.xmdm : xmks.xmdm
const xmxh = event == 2 ? xmjs.xmxh : xmks.xmxh;
const isManualProjectIn = this.artSubject3ProjectsCodesArr.includes(xmdm);
2024-07-11 16:16:43 +08:00
const {examSubject,projects} = this.judgeUI
2024-07-11 10:22:31 +08:00
switch (event) {
//项目开始
case 1:
judgeUI.projectsObj[xmdm].type = '2';
2024-07-31 13:47:40 +08:00
if (isManualProjectIn) {
2024-07-11 10:22:31 +08:00
//手动项目是否在进行中
this.judgeUI.isManualProjectIn = true
}
2024-07-31 13:47:40 +08:00
if (xmdm == 41 && examSubject == 3) {
2024-07-11 10:22:31 +08:00
this.rmndg = 1
}
this.judgeUI.currentXmdm = xmdm;
const xmmcStr = judgeUI.projectsObj[xmdm].name;
const xmmcCode = judgeUI.projectsObj[xmdm].projectCodeCenter;
2024-08-08 20:12:19 +08:00
console.info(judgeTag,JSON.stringify(judgeUI.projectsObj[xmdm]))
2024-07-11 10:22:31 +08:00
const xmmcSingleCode = judgeUI.projectsObj[xmdm].projectCode;
this.testKmItems[xmmcCode].status = 2;
this.xmmcStr = xmmcStr;
this.xmmcCode = xmmcCode;
this.xmmcSingleCode = xmmcSingleCode
this.xmdm = xmdm;
this.xmxh = xmxh;
2024-07-11 16:16:43 +08:00
this.judgeUI.isProjectIn = true
2024-08-12 10:19:31 +08:00
if(param512[7] != 0){
this.judgeUI.isDeductedPopShow = true
}
2024-07-11 10:22:31 +08:00
break;
//项目结束
2024-08-08 20:12:19 +08:00
case 2: {
const xmmcCode = judgeUI.projectsObj[xmdm].projectCodeCenter;
2024-07-11 10:22:31 +08:00
judgeUI.projectsObj[xmdm].type = (xmjs.xmhg === 0 ? '4' : '3');
2024-08-08 20:12:19 +08:00
//计算项目是否全部结束
2024-07-16 17:32:25 +08:00
this.judgeUI.isProjectIn = (Reflect.ownKeys(judgeUI.projectsObj).filter(
projectKey => judgeUI.projectsObj[projectKey].type == '2').length
) > 0;
2024-07-31 13:47:40 +08:00
if (isManualProjectIn) {
2024-07-10 19:39:13 +08:00
this.judgeUI.isManualProjectIn = false
}
2024-08-08 20:12:19 +08:00
this.testKmItems[xmmcCode].status = 3;
//统计必考项目数量
2024-07-11 10:22:31 +08:00
this.xmmcStr = '无';
this.xmmcCode = '';
this.xmmcSingleCode = 0;
this.xmdm = '';
this.judgeUI.isDeductedPopShow = false
this.judgeUI.currentXmdm = undefined;
break;
2024-08-08 20:12:19 +08:00
}
2024-07-11 10:22:31 +08:00
//扣分
case 3:
const thisKf = getKfStr(`${kf.xmdm}_${kf.kfdm}`)
//扣分信息
this.kfArr.push({
//扣分项目名称
xmmcStr: getDqxmStr(kf.xmdm),
xmdm: kf.xmdm,
//扣分描述
desc: thisKf.desc,
//扣分分数
score: thisKf.score,
// 扣分无锡所代码
markcatalog: thisKf.markcatalog,
markserial: thisKf.markserial,
2024-07-31 13:47:40 +08:00
kfxh: thisKf.kfxh,
//扣分类型
type: kf.type
2024-07-11 10:22:31 +08:00
})
this.judgeUI.totalScore += thisKf.score * 1;
break;
//考车状态
case 4:
this.carztStr = getCarStatus(carzt);
break;
//考试结束
case 5:
this.ksjs = ksjs;
break;
//项目取消
2024-08-12 10:19:31 +08:00
case 6:{
console.info(judgeTag,'项目取消');
const xmdm = xmqx.xmdm;
const xmmcCode = judgeUI.projectsObj[xmdm].projectCodeCenter;
const voiceCode = getKmProjectCancelVoice(xmmcCode);
avPlayer.playAudio([`voice/${voiceCode}.mp3`],true)
this.judgeUI.projectsObj[xmdm].type = '1';
this.testKmItems[xmmcCode].status = '1';
2024-07-11 10:22:31 +08:00
break;
2024-08-12 10:19:31 +08:00
}
2024-07-09 11:11:31 +08:00
2024-07-11 10:22:31 +08:00
//语音播放和提示
case 7:
goJudgeVoice(sound)
break;
//模拟灯光事件
case 8:
setMndg(mndg)
break;
//车道和路段变化
case 9:
this.judgeUI.lane = lane
2024-07-31 13:47:40 +08:00
this.lane = lane;
2024-07-11 10:22:31 +08:00
break;
default:
;break;
}
const {xmmcStr,carztStr,kfArr} = this;
await callBack({
//项目名称 考车状态 扣分arr
xmmcStr, carztStr, kfArr
});
//语音播报
2024-07-31 13:47:40 +08:00
this.goVoiceAnnounce(event, xmdm, this.kfArr, xmjs, ksjs)
2024-07-11 10:22:31 +08:00
//更新UI
2024-08-12 10:19:31 +08:00
if (event == 1 || event == 2 || event == 3 || event == 6) {
2024-07-11 10:22:31 +08:00
const copyProjectsObj = this.judgeUI.projectsObj;
judgeUI.projectsObj = deepClone(copyProjectsObj);
}
}
2024-07-31 13:47:40 +08:00
2024-07-11 10:22:31 +08:00
// 更改考试状态
2024-07-31 13:47:40 +08:00
goVoiceAnnounce = async (event, xmdm, kf, xmjs, ksjs) => {
const {
beginProject,
pointsDedute,
endProject,
avPlayer,
uploadProgressPhoto,
judgeTask,
handEndExam,
judgeUI,
checkExamIsEnd,
checkProjectIsStart,
lane
} = this;
2024-07-11 10:22:31 +08:00
2024-07-31 13:47:40 +08:00
const {projectsObj,judgeConfigObj,examSubject,examMileage,jl,isAllProjectsEnd} = judgeUI;
const kfLen = kf.length;
2024-07-11 10:22:31 +08:00
//不报语音的项目列表
const ignoreVoiceCodeArr = (judgeConfigObj['312'] || '').split(',')
switch (event) {
// 项目开始
case 1:
const code = projectsObj[xmdm].projectCodeCenter;
2024-07-31 13:47:40 +08:00
const isEnd = projectsObj[xmdm].isEnd;
const kmCode = getKmProjectVoice(code, 1, judgeConfigObj, lane)
2024-07-11 10:22:31 +08:00
if (!ignoreVoiceCodeArr.includes(code)) {
2024-08-12 10:19:31 +08:00
kmCode && avPlayer.playAudio([`voice/${kmCode}.mp3`],true)
2024-07-11 10:22:31 +08:00
}
2024-07-31 13:47:40 +08:00
//项目已考不上传监管信息
if (!isEnd) {
2024-08-16 08:52:38 +08:00
judgeTask.addTask(async () => {
console.info(judgeTag, `项目开始-${xmdm}-${projectsObj[xmdm].name}`)
await beginProject(xmdm)
},{isDelay: true})
judgeTask.addTask(async () => {
2024-08-05 09:47:44 +08:00
console.info(judgeTag, `项目-${xmdm}-上传照片 start`)
2024-07-31 13:47:40 +08:00
await uploadProgressPhoto(xmdm)
2024-08-16 08:52:38 +08:00
},{isDelay: true})
2024-08-05 09:47:44 +08:00
this.judgeUI.projectsObj[xmdm].isUpload = true;
2024-07-31 13:47:40 +08:00
}
2024-07-11 10:22:31 +08:00
break;
// 项目结束
2024-07-31 13:47:40 +08:00
case 2:{
2024-07-11 10:22:31 +08:00
const endCode = projectsObj[xmdm].projectCodeCenter;
2024-07-31 13:47:40 +08:00
const projectIsEnd = projectsObj[xmdm].isEnd;
const endKmCode = getKmProjectVoice(endCode, 2, judgeConfigObj, lane)
2024-07-11 10:22:31 +08:00
if (!ignoreVoiceCodeArr.includes(endCode) && examSubject == 3) {
endKmCode && avPlayer.playAudio([`voice/${endKmCode}.mp3`])
}
2024-07-31 13:47:40 +08:00
const isStart = await checkProjectIsStart(xmdm,1);
if(isStart){
//项目结束了就不再生成数据
2024-08-05 09:47:44 +08:00
console.info(judgeTag + ' projectIsEnd =>',projectIsEnd)
2024-07-31 13:47:40 +08:00
if (!projectIsEnd) {
2024-08-05 09:47:44 +08:00
judgeTask.addTask(async () => {
2024-07-31 13:47:40 +08:00
console.info(judgeTag, `项目结束-${xmdm}-${projectsObj[xmdm].name}`)
await endProject(xmdm);
2024-08-08 20:12:19 +08:00
}, {isDelay: true})
2024-07-11 10:22:31 +08:00
}
2024-07-31 13:47:40 +08:00
}
judgeUI.projectsObj[xmdm].isEnd = true;
2024-07-11 10:22:31 +08:00
break;
2024-07-31 13:47:40 +08:00
}
2024-07-11 10:22:31 +08:00
// 扣分
case 3:
2024-07-31 13:47:40 +08:00
//扣分时实时播报语音0-否+1-是)
2024-08-05 09:47:44 +08:00
const currentKf = kf[kfLen -1];
2024-08-12 10:19:31 +08:00
if (judgeConfigObj['418'] == '1' && judgeConfig.kfVoiceOpen) {
2024-08-05 09:47:44 +08:00
avPlayer.playAudio([`voice/${currentKf.markcatalog}.mp3`])
2024-07-11 10:22:31 +08:00
}
2024-08-05 09:47:44 +08:00
const isStart = await checkProjectIsStart(currentKf.xmdm,2,currentKf);
2024-07-31 13:47:40 +08:00
if(isStart){
await judgeTask.addTask(async () => {
2024-08-05 09:47:44 +08:00
console.info(judgeTag, `项目扣分-${currentKf.markcatalog}-${currentKf.desc}`)
await pointsDedute(currentKf.xmdm, currentKf)
2024-08-08 20:12:19 +08:00
}, {isDelay: true})
2024-07-31 13:47:40 +08:00
}
2024-07-11 10:22:31 +08:00
break;
// 考车状态
case 4:
break
// 考试结束
case 5:
2024-07-31 13:47:40 +08:00
console.info(judgeTag, '考试结束')
2024-08-05 09:47:44 +08:00
judgeTask.addTask(async () => {
2024-07-11 10:22:31 +08:00
console.info(judgeTag, '考试结束 start')
2024-07-31 13:47:40 +08:00
globalThis.isJudge = false;
await handEndExam(ksjs)
2024-07-11 10:22:31 +08:00
})
2024-07-31 13:47:40 +08:00
clearInterval(globalThis.judgeTimer)
2024-07-11 10:22:31 +08:00
break
default:
break
}
2024-07-31 13:47:40 +08:00
if (event == 2 || event == 3) {
setTimeout(() => {
this.judgeUI.kfArrScroller.scrollTo({
yOffset: 999999, xOffset: 0
})
2024-08-05 09:47:44 +08:00
},500)
2024-08-08 20:12:19 +08:00
//统计必考项目完成数量
2024-08-05 09:47:44 +08:00
await this.setCountItems();
await checkExamIsEnd()
2024-07-31 13:47:40 +08:00
}
2024-07-11 10:22:31 +08:00
}
2024-07-31 13:47:40 +08:00
// 检测扣分、结束项目时该项目是否开始
checkProjectIsStart = async(xmdm,currentType:1|2,kf?:KF) => {
if(xmdm == 20){
2024-08-05 09:47:44 +08:00
return true
2024-07-31 13:47:40 +08:00
}
2024-08-08 20:12:19 +08:00
const {judgeTask,beginProject,pointsDedute,uploadProgressPhoto,endProject,checkExamIsEnd,totalScore} = this;
const {projectsObj,passingScore:passingGrade} = this.judgeUI
2024-08-05 09:47:44 +08:00
const {isUpload} = projectsObj[xmdm];
2024-07-31 13:47:40 +08:00
//如果项目没有开始
2024-08-08 20:12:19 +08:00
console.info('surenjun isUpload=>',isUpload)
2024-08-05 09:47:44 +08:00
if(!isUpload){
2024-07-31 13:47:40 +08:00
console.info(judgeTag,'项目补传开始')
//项目开始补传
judgeTask.addTask(async ()=>{await beginProject(xmdm)},{isDelay:true})
judgeTask.addTask(async ()=>{await uploadProgressPhoto(xmdm)},{isDelay:true})
2024-08-08 20:12:19 +08:00
this.judgeUI.projectsObj[xmdm].isUpload = true;
2024-07-31 13:47:40 +08:00
//扣分补传
if(currentType == 2){
judgeTask.addTask(async ()=>{await pointsDedute(xmdm,kf)},{isDelay:true})
}
2024-08-08 20:12:19 +08:00
//扣分补传判断是否合格 不合格补传项目结束
if(currentType == 1 || (currentType == 2 && totalScore < passingGrade)){
judgeTask.addTask(async ()=>{await endProject(xmdm)},{isDelay:true})
2024-07-31 13:47:40 +08:00
this.judgeUI.projectsObj[xmdm].isEnd = true;
2024-08-08 20:12:19 +08:00
}
judgeTask.addTask(async ()=>{
2024-07-31 13:47:40 +08:00
checkExamIsEnd()
})
return false;
}else{
return true
}
}
2024-01-05 11:11:15 +08:00
// 项目开始接口同步
2024-07-02 10:42:53 +08:00
beginProject = async (ksxm) => {
2024-01-05 11:11:15 +08:00
const carInfo = globalThis.carInfo;
const { examSubject,plateNo } = carInfo;
2024-08-05 09:47:44 +08:00
const {judgeUI,fileLog,getSbbm,xmxh,filePath} = this;
2024-08-16 08:52:38 +08:00
const {lsh,idCard,serialNumber,projectsObj,ksdd,kslx,xldm} = judgeUI
2024-01-05 11:11:15 +08:00
const time = await getCurrentTime();
const project = projectsObj[ksxm]
2024-07-02 10:42:53 +08:00
const sbxh = getSbbm(ksxm, xmxh)
2024-01-05 11:11:15 +08:00
const data = {
2024-02-21 14:53:53 +08:00
//系统类别 接口序列号 接口标识
2024-07-02 10:42:53 +08:00
xtlb: '17', jkxlh: serialNumber, jkid: '17C52',
drvexam: {
2024-02-21 14:53:53 +08:00
// 考试科目 身份证号码
2024-07-02 10:42:53 +08:00
lsh,
kskm: examSubject,
sfzmhm: idCard,
ksxm: project.projectCodeCenter,
sbxh,
2024-08-16 08:52:38 +08:00
ksxl:xldm,
2024-07-02 10:42:53 +08:00
kchp: encodeURI(plateNo),
2024-02-21 14:53:53 +08:00
// 开始时间
2024-07-02 10:42:53 +08:00
ksdd: encodeURI(ksdd),
2024-07-31 13:47:40 +08:00
kslx: encodeURI(kslx) || '',
2024-07-02 10:42:53 +08:00
kssj: time
2024-01-05 11:11:15 +08:00
}
}
2024-08-15 09:01:09 +08:00
console.info(judgeTag +'filePath' , filePath)
2024-08-12 10:19:31 +08:00
const {code} = await writeObjectOut(data,filePath)
2024-07-31 13:47:40 +08:00
console.info(judgeTag, '项目开始 end')
2024-07-02 10:42:53 +08:00
if (code === 2300007) {
this.isJudgeDisConnect = true;
}
promptWxCode('17C52', code)
2024-01-05 11:11:15 +08:00
}
2024-08-05 09:47:44 +08:00
2024-01-05 11:11:15 +08:00
// 项目结束接口同步
2024-07-02 10:42:53 +08:00
endProject = async (ksxm) => {
2024-01-05 11:11:15 +08:00
const carInfo = globalThis.carInfo;
const deviceNo = globalThis.deviceNo;
const { examSubject,plateNo,carNo } = carInfo;
2024-08-05 09:47:44 +08:00
const {judgeUI,fileLog,getSbxh,xmxh,getSbbm,filePath} = this;
2024-08-16 08:52:38 +08:00
const {lsh,idCard,serialNumber,projectsObj,cdsbInfoObj,ksdd,kslx,xldm,} = judgeUI
2024-01-05 11:11:15 +08:00
const time = await getCurrentTime();
const project = projectsObj[ksxm]
2024-07-31 13:47:40 +08:00
const sbxh = examSubject == 3 ? undefined : getSbbm(ksxm, xmxh)
2024-01-05 11:11:15 +08:00
const data = {
2024-07-02 10:42:53 +08:00
xtlb: '17', jkxlh: serialNumber, jkid: '17C55',
drvexam: {
lsh,
kskm: examSubject,
sfzmhm: idCard,
ksxm: project.projectCodeCenter,
2024-01-05 11:11:15 +08:00
sbxh,
2024-07-31 13:47:40 +08:00
//TODO 操作类型 1:正常 0:撤销该考试记录
2024-07-02 10:42:53 +08:00
czlx: '1',
2024-08-16 08:52:38 +08:00
ksxl:xldm,
2024-07-02 10:42:53 +08:00
kchp: encodeURI(plateNo),
ksdd: encodeURI(ksdd),
2024-07-31 13:47:40 +08:00
kslx: encodeURI(kslx) || '',
2024-07-02 10:42:53 +08:00
jssj: time
2024-01-05 11:11:15 +08:00
}
}
2024-08-12 10:19:31 +08:00
const {code} = await writeObjectOut(data,filePath)
2024-07-02 10:42:53 +08:00
if (code === 2300007) {
this.isJudgeDisConnect = true;
}
2024-07-31 13:47:40 +08:00
console.info(judgeTag, '项目结束 end')
2024-07-02 10:42:53 +08:00
promptWxCode('17C55', code)
}
2024-08-05 09:47:44 +08:00
2024-07-02 10:42:53 +08:00
// 考试扣分
pointsDedute = async (ksxm, kf) => {
const carInfo = globalThis.carInfo;
const deviceNo = globalThis.deviceNo;
const { examSubject,plateNo,carNo } = carInfo;
2024-08-05 09:47:44 +08:00
const {judgeUI,getProjectInfo,fileLog,xmmcSingleCode,filePath} = this;
2024-07-02 10:42:53 +08:00
const {lsh,idCard,serialNumber,ksdd} = judgeUI
const time = await getCurrentTime();
const project = getProjectInfo(ksxm);
2024-07-31 13:47:40 +08:00
//科目三上车准备、模拟灯光、夜间行驶出现通用评判ksxm为当前进行的项目
const checkProjects = ['41600', '41700', '40100']
2024-07-02 10:42:53 +08:00
const data = {
xtlb: '17', jkxlh: serialNumber, jkid: '17C53',
drvexam: {
lsh,
kskm: examSubject,
2024-07-31 13:47:40 +08:00
ksxm: project
? (checkProjects.includes(xmmcSingleCode + '') ? xmmcSingleCode : project.projectCodeCenter)
: (examSubject == 3 ? 30000 : 10000),
2024-07-02 10:42:53 +08:00
kfxm: kf.markcatalog,
kfxmmx: `${ksxm},${kf.markserial}`,
sfzmhm: idCard,
kchp: encodeURI(carInfo.plateNo),
2024-07-31 13:47:40 +08:00
kffs: kf.type == 0 ? 1 : 2,
2024-07-02 10:42:53 +08:00
ksdd: encodeURI(ksdd),
kfsj: time
}
}
2024-08-12 10:19:31 +08:00
const {code} = await writeObjectOut(data,filePath);
2024-07-02 10:42:53 +08:00
if (code === 2300007) {
this.isJudgeDisConnect = true
}
console.info(judgeTag, '项目扣分 end')
promptWxCode('17C53', code)
}
2024-08-05 09:47:44 +08:00
2024-07-02 10:42:53 +08:00
// 考试过程照片
uploadProgressPhoto = async (ksxm) => {
const time = await getCurrentTime();
2024-08-05 09:47:44 +08:00
const {judgeUI,plcData,getPhoto,fileLog,filePath} = this;
2024-07-02 10:42:53 +08:00
const photoBase64 = await getPhoto();
const carInfo = globalThis.carInfo;
const { examSubject,plateNo,carNo } = carInfo;
const {lsh,idCard,serialNumber,projectsObj,ksdd} = judgeUI;
const {sensor,gps} = plcData
const project = projectsObj[ksxm]
const data = {
xtlb: '17', jkxlh: serialNumber, jkid: '17C54',
drvexam: {
lsh,
kskm: examSubject,
ksxm: project.projectCodeCenter,
sfzmhm: idCard,
kchp: encodeURI(plateNo),
zpsj: time,
//@ts-ignore
2024-07-31 13:47:40 +08:00
zp: photoBase64,
2024-08-05 09:47:44 +08:00
cs: Math.floor(gps.sd * 1.852),
2024-07-02 10:42:53 +08:00
ksdd: encodeURI(ksdd)
}
};
2024-08-12 10:19:31 +08:00
const {code} = await writeObjectOut(data,filePath);
2024-07-02 10:42:53 +08:00
if (code === 2300007) {
this.isJudgeDisConnect = true
}
promptWxCode('17C54', code)
console.info(judgeTag, '上传照片 end')
}
2024-07-31 13:47:40 +08:00
2024-07-05 09:08:17 +08:00
// 评判语音提示
goJudgeVoice = async (sound: SOUND) => {
2024-07-11 10:22:31 +08:00
const {avPlayer,fileLog} = this;
const {xmdm,code,type} = sound;
2024-07-05 09:08:17 +08:00
//判断是不是模拟灯光语音
2024-07-31 13:47:40 +08:00
if (type == 1) {
2024-08-12 10:19:31 +08:00
avPlayer.playAudio([`voice/${code}.mp3`], false, () => {
2024-08-16 08:52:38 +08:00
examJudgeSoundEnd({
itemno: xmdm, code, type
})
fileLog.setExamJudgeData({
method: 'examJudgeSoundEnd',
itemno: xmdm,
code,
type,
})
2024-08-12 10:19:31 +08:00
})
}else{
avPlayer.playAudio([`voice/${code}.mp3`])
2024-07-05 09:08:17 +08:00
}
}
2024-07-31 13:47:40 +08:00
// 校验考试是否结束
checkExamIsEnd = async (isManual?: boolean) => {
2024-08-12 10:19:31 +08:00
const {judgeUI,avPlayer,isExamEnd,isEndTip} = this;
2024-08-05 09:47:44 +08:00
const {isAllProjectsEnd,examSubject,singlePlay,totalScore,judgeConfigObj,passingScore} = judgeUI;
2024-07-31 13:47:40 +08:00
if (isExamEnd) {
return
}
//及格分
2024-08-05 09:47:44 +08:00
let passingGrade = passingScore
2024-07-31 13:47:40 +08:00
if (isManual) {
if (isAllProjectsEnd) {
// 考试合格
if (totalScore >= passingGrade) {
// 考试合格
await examJudgeEndExam();
this.isExamEnd = true
}
} else {
// 考试不合格
await examJudgeEndExam()
this.isExamEnd = true
}
this.isManual = true
} else {
//单机模式
if (singlePlay) {
2024-08-05 09:47:44 +08:00
console.info(judgeTag + ' isAllProjectsEnd => ',isAllProjectsEnd)
2024-07-31 13:47:40 +08:00
if (isAllProjectsEnd) {
await examJudgeEndExam()
this.isExamEnd = true
}
} else {
2024-08-15 09:01:09 +08:00
const param302 = judgeConfigObj['302'];
const param342 = judgeConfigObj['342'];
const param512 = (judgeConfigObj['512'] || '').split(',');
2024-07-31 13:47:40 +08:00
//成绩不合格
if (totalScore < passingGrade) {
2024-08-15 09:01:09 +08:00
//科目三不合格报靠边停车
if(examSubject == 3 && param302 ==1){
avPlayer.playAudio([`voice/考试结束.mp3`]);
return
}
2024-07-31 13:47:40 +08:00
await examJudgeEndExam()
this.isExamEnd = true
return
}
//成绩合格
2024-08-12 10:19:31 +08:00
if (isAllProjectsEnd && totalScore >= passingGrade && isEndTip) {
2024-08-15 09:01:09 +08:00
//考试合格自动退出
if(examSubject == 3 && param302 == 4){
await examJudgeEndExam()
this.isExamEnd = true
return
}
if (examSubject == 3 && (param342 == 0 || param342 == 2) && (param302 != 6 || param302 != 7 || param302 != 8)) {
2024-08-12 10:19:31 +08:00
if(param512[7] != 0){
avPlayer.playAudio(['voice/综合评判.mp3'])
this.judgeUI.isDeductedPopShow = true
this.judgeUI.defaultTabIndex = 1
this.isEndTip = true
}
2024-07-31 13:47:40 +08:00
} else {
await examJudgeEndExam()
this.isExamEnd = true
}
}
}
}
}
2024-07-05 09:08:17 +08:00
// 处理考试结束
2024-07-31 13:47:40 +08:00
public handEndExam = async (ksjs: KSJS) => {
2024-07-11 16:16:43 +08:00
this.judgeUI.loadingPopupVisible = true;
2024-07-31 13:47:40 +08:00
this.judgeUI.endPopupVisible = false;
2024-08-05 09:47:44 +08:00
this.judgeUI.isDeductedPopShow = false;
2024-08-12 10:19:31 +08:00
console.info(judgeTag,1)
2024-07-31 13:47:40 +08:00
const {qjjl,dcjl} = ksjs
const {judgeUI,endExam,handleSEP,kfArr,avPlayer,judgeTask,isManual} = this;
2024-08-05 09:47:44 +08:00
const {judgeConfigObj,examSubject,isAllProjectsEnd,totalScore,passingScore} = judgeUI;
2024-07-31 13:47:40 +08:00
//计算考试分数
2024-08-12 10:19:31 +08:00
console.info(judgeTag,2)
2024-07-31 13:47:40 +08:00
this.judgeUI.totalScore = isAllProjectsEnd ? totalScore : 0;
const singlePlay = globalThis.singlePlay
const param302 = judgeConfigObj['302'];
globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
2024-08-12 10:19:31 +08:00
console.info(judgeTag,3)
2024-07-31 13:47:40 +08:00
//自动退出待验证并且不合格
2024-08-05 09:47:44 +08:00
if (!isManual && examSubject == 3 && (param302 == 1 || (singlePlay && param302 == 2)) && totalScore < passingScore) {
2024-07-31 13:47:40 +08:00
avPlayer.playAudio([`voice/考试结束.mp3`])
}
2024-08-12 10:19:31 +08:00
console.info(judgeTag,4)
2024-07-31 13:47:40 +08:00
//联网模式下手动结束的直接退出
if (!singlePlay && isManual && !isAllProjectsEnd) {
avPlayer.playAudio(['voice/empty.mp3'], true, () => {
router.back();
})
2024-07-05 09:08:17 +08:00
return
}
2024-08-12 10:19:31 +08:00
console.info(judgeTag,5)
2024-07-31 13:47:40 +08:00
if (examSubject == 3) {
const param302 = judgeConfigObj['302'];
2024-08-05 09:47:44 +08:00
if (totalScore < passingScore) {
2024-07-31 13:47:40 +08:00
//考试不合格;考试模式,自动退出;
if (param302 == 4 || param302 == 5 || param302 == 7 || param302 == 8) {
2024-08-12 10:19:31 +08:00
2024-07-11 10:22:31 +08:00
}
2024-07-31 13:47:40 +08:00
} else {
//考试合格
}
2024-07-09 11:11:31 +08:00
}
2024-08-12 10:19:31 +08:00
console.info(judgeTag,6)
2024-07-11 10:22:31 +08:00
await handleSEP(306);
2024-08-12 10:19:31 +08:00
console.info(judgeTag,7)
2024-07-31 13:47:40 +08:00
avPlayer.playAudio(['voice/exam_waiting.mp3'], true, async () => {
try {
if (!singlePlay) {
// TODO 待验证
2024-08-08 20:12:19 +08:00
const bytes = await this.getMessageHeartbeat(true);
globalThis.judgeUdp.send(bytes)
2024-07-11 10:22:31 +08:00
}
2024-07-31 13:47:40 +08:00
//TODO endExam函数逻辑待验证
await endExam()
} catch (e) {
2024-08-12 10:19:31 +08:00
console.info(judgeTag,JSON.stringify(e))
2024-07-31 13:47:40 +08:00
// setTimeout(() => {
// // avPlayer.avPlayerStop();
// router.back();
// }, 3000)
}
});
2024-07-09 11:11:31 +08:00
}
2024-07-05 09:08:17 +08:00
// 考试结束
public endExam = async (isManual?: Boolean) => {
const carInfo = globalThis.carInfo;
2024-07-31 13:47:40 +08:00
const singlePlay = globalThis.singlePlay
2024-07-05 09:08:17 +08:00
const { examSubject ,plateNo} = carInfo;
2024-08-05 09:47:44 +08:00
const {judgeUI,ksjs,getPhoto,uploadProgressData,uploadDisConnectData,avPlayer,kfArr,judgeTask,filePath} = this;
const {lsh,idCard,serialNumber,kssycs,totalScore,judgeConfigObj,isAllProjectsEnd,passingScore} = judgeUI
2024-07-05 09:08:17 +08:00
await uploadDisConnectData();
const time = await getCurrentTime();
const photoBase64 = await getPhoto();
2024-08-08 20:12:19 +08:00
const {d1,d2,d3,d4,d5} = ksjs
2024-07-05 09:08:17 +08:00
const data = {
xtlb: '17', jkxlh: serialNumber, jkid: '17C56',
drvexam: {
lsh,
kchp: encodeURI(plateNo),
kskm: examSubject,
sfzmhm: idCard,
//@ts-ignore
2024-07-31 13:47:40 +08:00
zp: photoBase64,
2024-07-05 09:08:17 +08:00
jssj: time,
kscj: (totalScore * 1) > 0 ? totalScore : 0,
2024-07-31 13:47:40 +08:00
kslc: Math.ceil(((ksjs?.qjjl + ksjs?.dcjl) || 0) / 100),
2024-08-08 20:12:19 +08:00
// 1,22;2,560;3,128;4,0;5,0;
dwlc: [d1,d2,d3,d4,d5].map((d,index) => `${index},${Math.floor(d /100)}`).join(';'),
2024-07-05 09:08:17 +08:00
}
}
2024-08-12 10:19:31 +08:00
const temp = await writeObjectOut(data,filePath);
promptWxCode('17C56', temp.code)
2024-07-05 09:08:17 +08:00
console.info(judgeTag, '考试结束 end')
2024-07-31 13:47:40 +08:00
const param302 = judgeConfigObj['302'];
judgeUI.loadingPopupVisible = true;
2024-07-11 10:22:31 +08:00
2024-07-31 13:47:40 +08:00
let voiceURL = ''
if (examSubject == 2) {
2024-08-05 09:47:44 +08:00
voiceURL = (totalScore < passingScore ? `voice/unqualified_${kssycs == 1 ? 'one' : 'two'}.wav` : 'voice/qualified.mp3')
2024-07-31 13:47:40 +08:00
}
if (examSubject == 3) {
if (isAllProjectsEnd) {
2024-08-05 09:47:44 +08:00
if (totalScore < passingScore) {
2024-07-31 13:47:40 +08:00
voiceURL = `voice/${kssycs == 1 ? 'exam_no_pass_finish' : 'exam_no_pass'}.mp3`
} else {
voiceURL = 'voice/exam_pass.mp3'
}
2024-07-11 10:22:31 +08:00
} else {
2024-07-31 13:47:40 +08:00
voiceURL = `voice/${kssycs == 1 ? 'exam_no_pass_finish' : 'exam_no_pass'}.mp3`
2024-07-11 10:22:31 +08:00
}
2024-07-05 09:08:17 +08:00
}
2024-07-31 13:47:40 +08:00
2024-07-05 09:08:17 +08:00
console.info(judgeTag, `考试成绩:${totalScore}`)
2024-08-12 10:19:31 +08:00
if(!singlePlay){
await uploadProgressData();
}
2024-07-05 09:08:17 +08:00
2024-07-31 13:47:40 +08:00
//语音播放扣分项
let score = 0;
if (kfArr.length) {
avPlayer.playAudio([`voice/kfdesc.mp3`], false, () => {
try {
kfArr.forEach((kf, index) => {
score += Math.abs(Number(kf.score));
//TODO 考试分数待替换
if (score <= (examSubject == 3 ? 10 : 20)) {
if (kfArr.length - 1 === index) {
avPlayer.playAudio([`voice/${kf.markcatalog}.mp3`, voiceURL], false, () => {
router.back();
})
throw new Error('End Loop')
}
avPlayer.playAudio([`voice/${kf.markcatalog}.mp3`])
} else {
avPlayer.playAudio([`voice/${kf.markcatalog}.mp3`, voiceURL], false, () => {
router.back();
})
throw new Error('End Loop')
}
})
} catch (e) {
2024-08-12 10:19:31 +08:00
console.info(judgeTag,JSON.stringify(e))
2024-07-31 13:47:40 +08:00
}
})
} else {
avPlayer.playAudio([voiceURL], true, () => {
setTimeout(() => {
router.back();
}, param302 == 8 ? 3000 : 0)
})
}
2024-07-05 09:08:17 +08:00
}
2024-07-31 13:47:40 +08:00
2024-07-11 10:22:31 +08:00
// 当前项目转换
getDqxmStr = (type) => {
const projectsObj = this.judgeUI.projectsObj
return projectsObj[type]?.abbreviation || '通用评判'
}
// 扣分项目转换
getKfStr = (code) => {
const markRuleListObj = this.judgeUI.markRuleListObj;
const thisMark = markRuleListObj[code]
2024-07-05 09:08:17 +08:00
return {
2024-07-11 10:22:31 +08:00
desc: thisMark.markshow,
score: thisMark.markreal,
markcatalog: thisMark.markcatalog,
markserial: thisMark.markserial,
kfxh: thisMark.kfxh
2024-07-05 09:08:17 +08:00
}
}
// 消息心跳发送
getMessageHeartbeat = async (isEnd?: Boolean) => {
const carInfo = globalThis.carInfo;
const { examSubject,plateNo,ksyh } = carInfo;
2024-08-15 09:01:09 +08:00
console.info(judgeTag,1)
2024-07-05 09:08:17 +08:00
const {
judgeUI,
isExam,
serialIndex,
tempData,
xmmcCode,
xmxh,
xmmcSingleCode,
xmdm,
performInfo,
kfArr,
getTranslateProject,
getSbxh
} = this;
2024-08-15 09:01:09 +08:00
console.info(judgeTag,2)
2024-08-16 08:52:38 +08:00
const singlePlay = globalThis.singlePlay
2024-08-15 09:01:09 +08:00
const {lsh,startHourTime,totalScore,examTime} = judgeUI;
2024-08-08 20:12:19 +08:00
const {fourInOneScreen:{gpsDigit}} = judgeConfig
2024-08-15 09:01:09 +08:00
console.info(judgeTag,3)
2024-08-08 20:12:19 +08:00
const examType = examSubject == 2?2:3
2024-07-05 09:08:17 +08:00
const {sensor,gps} = tempData;
2024-08-15 09:01:09 +08:00
console.info(judgeTag,4)
console.info(judgeTag,JSON.stringify(tempData))
if(tempData.sensor === undefined){
return
}
2024-08-08 20:12:19 +08:00
const {zfxd,yfxd,shtd,ygd,jgd,skd,dh1,dh2,lhq,jsc,ssc,fsc,lb,mkg,aqd,ygq,cs,fdjzs,dw} = sensor
2024-07-05 09:08:17 +08:00
const {jd,wd, hxj, fyj, hbg,} = gps
2024-08-15 09:01:09 +08:00
console.info(judgeTag,5)
2024-07-05 09:08:17 +08:00
const translateProject = getTranslateProject();
const sbxh = getSbxh(xmdm, xmxh)
2024-08-15 09:01:09 +08:00
console.info(judgeTag,JSON.stringify(performInfo))
const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo || {};
2024-08-16 08:52:38 +08:00
const asclshArr = stringToASC(
fillZero((singlePlay?1111111111111:lsh) || 0, 13)
);
2024-07-05 09:08:17 +08:00
//13不足要补0
2024-08-15 09:01:09 +08:00
console.info(judgeTag,6)
2024-07-05 09:08:17 +08:00
const ascksyhArr = stringToASC(fillZero(ksyh || 0, 13))
2024-08-15 09:01:09 +08:00
console.info(judgeTag,7)
2024-07-05 09:08:17 +08:00
const ascsbxhArr = stringToASC(sbxh)
2024-08-15 09:01:09 +08:00
console.info(judgeTag,8)
2024-07-05 09:08:17 +08:00
const translateSignals = getTranslateSignals(
2024-08-08 20:12:19 +08:00
[zfxd, yfxd, shtd, ygd, jgd, skd, dh1, dh2, lhq, jsc, ssc, fsc, lb, mkg, aqd].concat(getDwStatusType(dw)).concat(getCarStatusType(carzt)).concat([ygq, sensor.wd, 0])
2024-07-05 09:08:17 +08:00
)
//@ts-ignore
2024-08-08 20:12:19 +08:00
const translateJd = convertGpsCoord2(wd).toFixed(gpsDigit) * Math.pow(10, gpsDigit);
2024-07-05 09:08:17 +08:00
//@ts-ignore
2024-08-08 20:12:19 +08:00
const translateWd = convertGpsCoord2(jd).toFixed(gpsDigit) * Math.pow(10, gpsDigit)
2024-07-05 09:08:17 +08:00
//@ts-ignore
const translateProjects = translateProject.map(numStr => string2Bytes(parseInt(numStr, 2), 8)[0])
2024-08-15 09:01:09 +08:00
console.info(judgeTag,6)
2024-08-08 20:12:19 +08:00
// console.info(judgeTag,JSON.stringify(translateProject))
2024-07-05 09:08:17 +08:00
//@ts-ignore
// const translateProjects= translateProject.map(num => string2Bytes(p,8)[0])
2024-08-15 09:01:09 +08:00
console.info('surenjunxmmcexamTime' , examTime)
2024-07-05 09:08:17 +08:00
const arr = [
2024-08-16 08:52:38 +08:00
//考生号
2024-07-05 09:08:17 +08:00
asclshArr.map(lsh => string2Bytes(lsh, 8)[0]),
//考试员号
ascksyhArr.map(ksyh => string2Bytes(ksyh, 8)[0]),
//科目类型(0:未考试 1:科目二 2:科目三) + 考试开始时间
string2Bytes(`${examType}${startHourTime}`, 4 * 8),
// TODO 消息序号从1开始0结束
string2Bytes(isEnd ? 0 : serialIndex, 2 * 8),
/*左向灯 右向灯 双跳灯 远光灯 近光灯 视宽灯 点火1 点火2 离合器 脚刹 手刹 副刹 喇叭 门开关 安全带 档位 车辆状态 雨刮器 雾灯 0*/
translateSignals,
2024-08-08 20:12:19 +08:00
//速度 发动机转速 GPS纬度 GPS经度 主天线位置
2024-07-05 09:08:17 +08:00
//@ts-ignore
2024-08-15 09:01:09 +08:00
string2Bytes(cs * 100, 2 * 8), string2Bytes(fdjzs / 100, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8),
2024-07-05 09:08:17 +08:00
//GPS东向距离
string2Bytes(dxjl < 0 ? (dxjl + 4294967296) : dxjl, 4 * 8),
//GPS北向距离
string2Bytes(bxjl < 0 ? (bxjl + 4294967296) : bxjl, 4 * 8),
2024-08-08 20:12:19 +08:00
//航向角 俯仰角 高程(海拔)
string2Bytes((hxj) * 100, 2 * 8), string2Bytes(fyj * 100, 2 * 8), string2Bytes(hbg * 100, 4 * 8),
2024-07-05 09:08:17 +08:00
//项目状态 parseInt('01010010',2) 二进制转成10进制
translateProjects,
//当前项目编号
string2Bytes(xmmcSingleCode ? (xmmcSingleCode * 1 + 1) : 0, 8),
//场地设备编号
ascsbxhArr.map(sbxh => string2Bytes(sbxh, 8)[0]),
//本次考试行驶距离
string2Bytes(Math.floor((dcjl + qjjl) / 100), 2 * 8),
//扣分
string2Bytes(100 - Math.abs(totalScore), 2 * 8),
//扣分项数量
string2Bytes(kfArr.length, 8),
//n个扣分序号
2024-08-15 09:01:09 +08:00
kfArr.map(kf => string2Bytes(kf.kfxh, 8)[0]),
//TODO 牵引车第二gps精度、纬度
string2Bytes(0, 4 * 8), string2Bytes(0, 4 * 8),
//TODO 牵引车第二航向角
string2Bytes(0, 2 * 8),
//TODO 摩托压线 Byte[20],
string2Bytes(0, 20 * 8),
2024-08-16 08:52:38 +08:00
//考试用时
string2Bytes(examTime, 4 * 8),
2024-08-15 09:01:09 +08:00
//TODO 项目用时
string2Bytes(fillZero(0,2), 2 * 8),
//TODO 设备信号状态
string2Bytes(0, 4 * 8),
2024-07-05 09:08:17 +08:00
]
2024-07-02 10:42:53 +08:00
2024-07-05 09:08:17 +08:00
let tempArr = [];
arr.forEach(itemArr => {
tempArr = tempArr.concat(itemArr)
2024-07-02 10:42:53 +08:00
})
2024-07-05 09:08:17 +08:00
this.serialIndex += 1;
2024-08-15 09:01:09 +08:00
console.info('message-judge-udp' + Array2Byte(tempArr).toString());
2024-07-05 09:08:17 +08:00
return Array2Byte(tempArr)
2024-07-02 10:42:53 +08:00
}
2024-07-05 09:08:17 +08:00
//获取场地序号
getSbxh = (ksxm, xmxh) => {
const {judgeUI} = this;
2024-08-15 09:01:09 +08:00
console.info(judgeTag,10)
2024-07-05 09:08:17 +08:00
const {cdsbInfoObj,projectsObj} = judgeUI;
2024-08-15 09:01:09 +08:00
console.info(judgeTag,11)
2024-07-05 09:08:17 +08:00
const project = projectsObj[ksxm]
2024-08-15 09:01:09 +08:00
console.info(judgeTag,12)
if(project == 3){
return '0000000000'
}
2024-07-05 09:08:17 +08:00
if (project === undefined) {
2024-08-15 09:01:09 +08:00
return '0000000000'
2024-07-02 10:42:53 +08:00
}
2024-08-15 09:01:09 +08:00
console.info(judgeTag,13)
2024-07-05 09:08:17 +08:00
const projectType = project.sbxh;
const projectKey = `${ksxm}_${xmxh}`;
2024-08-15 09:01:09 +08:00
console.info(judgeTag,14)
2024-07-05 09:08:17 +08:00
const currentCdsb = cdsbInfoObj[projectKey] || {};
2024-08-15 09:01:09 +08:00
console.info(judgeTag,15)
const sbxh = currentCdsb.sbbh || '0000000000'
2024-07-05 09:08:17 +08:00
return sbxh
2024-07-02 10:42:53 +08:00
}
2024-07-09 11:11:31 +08:00
2024-07-05 09:08:17 +08:00
getSbbm = (ksxm, xmxh) => {
const {judgeUI} = this;
2024-08-12 10:19:31 +08:00
const {cdsbInfoObj,projectsObj,examSubject} = judgeUI;
2024-07-05 09:08:17 +08:00
const project = projectsObj[ksxm]
2024-08-12 10:19:31 +08:00
//科目三不需要
if(examSubject == 3){
return undefined
}
2024-07-05 09:08:17 +08:00
if (project === undefined) {
return '00000000'
2024-07-02 10:42:53 +08:00
}
2024-07-05 09:08:17 +08:00
const projectKey = `${ksxm}_${xmxh}`;
const currentCdsb = cdsbInfoObj[projectKey] || {};
const sbxh = currentCdsb.sbbm || '00000000'
return sbxh
}
// 中心所有项目转换
getTranslateProject = () => {
2024-08-08 20:12:19 +08:00
const {examSubject} = this.judgeUI;
const tempItems = (examSubject == 2 ? testKm2Items:testKm3Items).map(item => {
2024-07-05 09:08:17 +08:00
const current = this.testKmItems[item.code];
return {
code: item.code,
status: getCenterProjectStatus(current.status)
}
})
2024-08-08 20:12:19 +08:00
// console.info(judgeTag+'TranslateProject',JSON.stringify(tempItems));
2024-07-05 09:08:17 +08:00
const arr = [];
2024-08-08 20:12:19 +08:00
for (let i = 0; i <= 4; i++) {
const temp = tempItems.slice(i * 4, (i + 1) * 4);
2024-07-05 09:08:17 +08:00
let tempArr = temp.map(item => item.status)
if (i === 4) {
2024-08-08 20:12:19 +08:00
tempArr = examSubject == 2
//bit36-bit39保留
? tempArr.concat(['00', '00'])
//bit30-bit39保留
: tempArr.concat(['00', '00','00'])
2024-07-05 09:08:17 +08:00
}
2024-08-08 20:12:19 +08:00
// if (i === 3 && examSubject == 3) {
// tempArr = tempArr.concat(['00'])
// }
2024-07-05 09:08:17 +08:00
arr.push(tempArr.join(''));
2024-01-05 11:11:15 +08:00
}
2024-08-15 09:01:09 +08:00
console.info(judgeTag,JSON.stringify(arr))
// return arr.map(numStr => parseInt(numStr, 2));
return arr
2024-01-05 11:11:15 +08:00
}
2024-07-05 09:08:17 +08:00
// 获取考试项目详情
getProjectInfo = (projectCode) => {
const judgeUI = this.judgeUI;
return judgeUI.projectsObj[projectCode]
2024-07-02 10:42:53 +08:00
}
2024-07-05 09:08:17 +08:00
// 获取模型数据
getModelData = (modelName) => {
const modelPath = this.modelPath
const fileModel = this.fileModel;
const modelData = fileModel.getModelContent(modelPath, modelName);
return modelData
}
// 过程照片拍照
getPhoto = async (empty?: boolean) => {
const singlePlay = globalThis.singlePlay
//单机模式返回空照片
if (singlePlay) {
return ''
} else {
const {filePhoto} = this;
const photoBase64 = await filePhoto.getPhoto();
console.info(judgeTag, '拍照完成')
return photoBase64
2024-07-02 10:42:53 +08:00
}
2024-01-05 11:11:15 +08:00
}
2024-07-11 10:22:31 +08:00
//人工操作项目
2024-07-31 13:47:40 +08:00
public setJudgeItem = async (itemno, type: 1 | 2) => {
2024-07-11 10:22:31 +08:00
const {fileLog} = this;
2024-07-31 13:47:40 +08:00
await examJudgeArtificialItem(itemno * 1, type);
2024-07-05 09:08:17 +08:00
await fileLog.setExamJudgeData({
method: 'examJudgeArtificialItem',
itemno: itemno * 1,
2024-07-11 10:22:31 +08:00
type
2024-07-05 09:08:17 +08:00
})
2024-07-31 13:47:40 +08:00
console.info(judgeTag, `人工评判${type == 1 ? '进入' : '取消'}项目-${itemno}`)
2024-01-05 11:11:15 +08:00
}
2024-07-05 09:08:17 +08:00
//人工扣分
2024-07-31 13:47:40 +08:00
public setJudgeMark = async (itemno, serial, type = 1) => {
2024-01-05 11:11:15 +08:00
const {fileLog} = this
2024-07-31 13:47:40 +08:00
await examJudgeArtificialMark(itemno * 1, serial, type);
2024-05-15 16:22:48 +08:00
2024-07-05 09:08:17 +08:00
await fileLog.setExamJudgeData({
method: 'examJudgeArtificialMark',
itemno: itemno * 1,
2024-07-31 13:47:40 +08:00
serial,
type
2024-07-05 09:08:17 +08:00
})
2024-05-15 16:22:48 +08:00
2024-07-05 09:08:17 +08:00
console.info(judgeTag, `人工扣分-${itemno}-${serial}`)
}
// 断网数据补传
uploadDisConnectData = async () => {
const {isJudgeDisConnect,fileLog,fileUtil} = this;
if (!isJudgeDisConnect) {
return
2024-05-15 16:22:48 +08:00
}
2024-07-05 09:08:17 +08:00
const folderPath = fileLog.folderPath
const examDataStr = await fileUtil.readFile(`${folderPath}/wuxi_dis_progress_data.txt`);
const examDataArr = examDataStr.split('\n');
for (let examDataStr of examDataArr) {
const examData = JSON.parse(examDataStr)
const code = await writeObjectOut(examData);
2024-05-15 16:22:48 +08:00
}
2024-07-05 09:08:17 +08:00
}
//上传无锡所过程数据
uploadProgressData = async () => {
const {judgeUI,fileUtil,fileLog} = this;
const {idCard,startFullTime} = judgeUI
const carInfo = globalThis.carInfo;
const {carId,examinationRoomId} = carInfo
const folderPath = fileLog.folderPath
const base64 = new util.Base64();
const time = await getCurrentTime();
const endTime = await getCurrentTime(1)
let examDataBase64
//@ts-ignore
//TODO try catch报错待优化
const examDataStr: string = await fileUtil.readFile(`${folderPath}/wuxi_progress_data.txt`);
try {
let tempBuff = buffer.alloc(examDataStr.length, examDataStr)
let examData: Uint8Array = new Uint8Array(tempBuff.buffer)
examDataBase64 = base64.encodeToStringSync(examData)
} catch (e) {
console.info(judgeTag, JSON.stringify(e))
}
console.info(judgeTag, '过程数据文件上传 start')
await uploadExamProgressData({
time,
carId,
examinationRoomId,
examData: examDataBase64,
type: 1,
cardNo: idCard,
examStartTime: startFullTime,
examEndTime: endTime,
})
console.info(judgeTag, '过程数据文件上传 end')
}
//获取科目三的评判初始化配置
getKm3JudgeInitConfig = async () => {
const {judgeUI,getModelData} = this;
2024-07-11 10:22:31 +08:00
const {carinfoArrr,mapPointArr,mapPointItemArr} = judgeUI;
2024-05-15 16:22:48 +08:00
return {
2024-07-05 09:08:17 +08:00
carinfo: carinfoArrr,
map_point: mapPointArr,
map_point_item: mapPointItemArr,
//科目三暂时为空
iteminfo: [],
roads: getModelData('km3/Roads.txt'),
sharps: getModelData('km3/Sharps.txt')
2024-05-15 16:22:48 +08:00
}
}
2024-07-05 09:08:17 +08:00
// 处理udp plc信号
handleUdp = async (msg) => {
console.info('plc信号', msg)
2024-07-11 10:22:31 +08:00
const {fileLog,getPlcData,usbService} = this
2024-07-05 09:08:17 +08:00
const stachArr = msg.split(',')
2024-07-31 13:47:40 +08:00
const {isExamEnd} = this;
if (stachArr[0] != '#DN_GD' || isExamEnd) {
2024-07-05 09:08:17 +08:00
return
}
const plcData = await getPlcData(msg);
// 4.过程数据
await fileLog.setExamJudgeData(plcData)
2024-07-11 10:22:31 +08:00
//检测到有无锡所设备接入,需要发送特定的数据,供检测
if (usbService.isWXUSBDevice) {
const str = await senorToWXDataStr(msg);
usbService.sendUSB(str)
}
2024-07-16 17:32:25 +08:00
this.judgeUI.isDwztRight = plcData.gps.dwzt == 4;
2024-08-08 20:12:19 +08:00
this.judgeUI.sd = (Math.floor(((plcData.gps.sd as number) || 0) * 1.852)) + '';
2024-07-31 13:47:40 +08:00
this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + ''
2024-07-05 09:08:17 +08:00
await examJudgeRealExam(plcData)
const udpIndex = globalThis.udpIndex;
2024-08-16 08:52:38 +08:00
if (udpIndex % 5 === 0 && !isExamEnd) {
2024-07-05 09:08:17 +08:00
const judgeUdp = globalThis.judgeUdp
const bytes = await this.getMessageHeartbeat();
2024-08-15 09:01:09 +08:00
console.info(judgeTag+'UDP',JSON.stringify(bytes))
2024-07-05 09:08:17 +08:00
judgeUdp.send(bytes)
}
globalThis.udpIndex += 1
}
// 处理特殊参数配置
handleSEP = async (code: number) => {
const {judgeUI:{
judgeConfigObj
},avPlayer} = this;
const {examSubject} = globalThis.carInfo;
2024-05-15 16:22:48 +08:00
2024-07-05 09:08:17 +08:00
switch (code) {
//结束考试方式
case 306:
if (judgeConfigObj[code] == 5) {
//靠边停车
avPlayer.playAudio(['voice/406001.mp3'])
}
break;
2024-01-05 11:11:15 +08:00
}
}
2024-07-05 09:08:17 +08:00
// 获取plc数据
getPlcData = async (plc: string) => {
2024-07-11 10:22:31 +08:00
const {fileLog,mndgStr,rmndg} = this;
2024-07-05 09:08:17 +08:00
await fileLog.setPlcProgressData(plc)
//plc字符串转化成评判初始化数据
const tempData = await plcStrToJson(plc);
//模拟灯光回放时刻
tempData.sensor.rmndg = rmndg;
//模拟灯灯光灯光项目
tempData.sensor.mndg = mndgStr;
//plc字符串转化成无锡所过程数据
const wuXiDataStr = await plcStrToWXJson(plc)
this.plcData = tempData
await fileLog.setExamJudgeWuxiProgressData(wuXiDataStr)
this.tempData = tempData
this.plcStr = plc;
this.mndgStr = '';
this.rmndg = 0;
globalThis.msgStr = plc
return tempData
}
2024-08-12 10:19:31 +08:00
2024-07-05 09:08:17 +08:00
// 处理轨迹plc信号
handleTrajectoryUdp = async (strArr) => {
2024-07-11 10:22:31 +08:00
const {fileLog,setJudgeItem,setJudgeMark,endExam} = this;
2024-07-05 09:08:17 +08:00
let num = 2;
const judgeTimer = setInterval(async () => {
2024-08-05 09:47:44 +08:00
const msgStr = strArr[num];
if(msgStr == ''){
2024-07-05 09:08:17 +08:00
console.info(judgeTag, '模拟数据考试结束')
globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
clearInterval(judgeTimer)
2024-08-12 10:19:31 +08:00
await examJudgeEndExam()
this.isExamEnd = true
this.isManual = true
2024-07-05 09:08:17 +08:00
return
2024-01-05 11:11:15 +08:00
}
2024-08-05 09:47:44 +08:00
const msg = JSON.parse(strArr[num]);
2024-07-05 09:08:17 +08:00
// 4.过程数据
this.tempData = msg
2024-07-31 13:47:40 +08:00
this.judgeUI.isDwztRight = msg?.gps?.dwzt == 4;
2024-08-05 09:47:44 +08:00
this.judgeUI.sd = Math.floor(msg?.gps?.sd) * 1.852 + '';
2024-07-31 13:47:40 +08:00
this.judgeUI.dw = Math.floor(msg?.sensor?.dw) + ''
2024-07-05 09:08:17 +08:00
this.plcData = msg
2024-07-31 13:47:40 +08:00
// this.judgeUI.isDwztRight = msg.gps.dwzt == 4;
2024-07-05 09:08:17 +08:00
globalThis.msgStr = ''
2024-07-31 13:47:40 +08:00
if (msg.method === 'examJudgeArtificialItem') {
setJudgeItem(msg.itemno, msg.type)
2024-07-11 10:22:31 +08:00
}
2024-07-31 13:47:40 +08:00
if (msg.method === 'examJudgeArtificialMark') {
setJudgeItem(msg.itemno, msg.serial)
2024-01-05 11:11:15 +08:00
}
2024-07-05 09:08:17 +08:00
await examJudgeRealExam(msg)
2024-08-16 08:52:38 +08:00
const bytes = await this.getMessageHeartbeat();
bytes && globalThis.judgeUdp.send(bytes)
2024-07-05 09:08:17 +08:00
num++
2024-08-15 09:01:09 +08:00
}, 200)
2024-07-05 09:08:17 +08:00
globalThis.judgeTimer = judgeTimer;
2024-01-05 11:11:15 +08:00
}
2024-07-31 13:47:40 +08:00
// 统计必考项目、所有项目、已考数量
2024-07-11 10:22:31 +08:00
setCountItems = async () => {
const carInfo = globalThis.carInfo;
const { examSubject} = carInfo;
const {projectsObj} = this.judgeUI;
2024-07-31 13:47:40 +08:00
//必考项目数量 必考项目已考数量
let projectNum = 0, endProjectsNum = 0;
// 所有考试项目数量 项目已考项目数量
let allProjectNum = 0, allEndProjectsNum = 0;
Reflect.ownKeys(projectsObj).forEach(projectKey => {
const {type,isRequired} = projectsObj[projectKey];
allProjectNum += 1;
if (type == 3 || type == 4) {
allEndProjectsNum += 1;
}
if (isRequired) {
projectNum += 1;
if (type == 3 || type == 4) {
endProjectsNum += 1;
2024-07-11 10:22:31 +08:00
}
2024-07-31 13:47:40 +08:00
}
})
2024-08-12 10:19:31 +08:00
console.info(judgeTag,'必考项目数量:' + projectNum)
console.info(judgeTag,'必考项目已考数量:' + endProjectsNum)
2024-07-31 13:47:40 +08:00
//必考项目除靠边停车是否全部完成
this.judgeUI.isRequiredProjectsEnd = (projectNum - endProjectsNum === 0)
this.judgeUI.isAllProjectsEnd = (allProjectNum - allEndProjectsNum === 0)
}
2024-07-11 10:22:31 +08:00
// 模拟灯光
setMndg = async (mndgStr: string) => {
this.mndgStr = mndgStr
}
2024-05-15 16:22:48 +08:00
2024-07-11 10:22:31 +08:00
// 路段信息处理
2024-07-31 13:47:40 +08:00
setRoadAndLane = async (lane) => {
2024-07-11 10:22:31 +08:00
const {road,num,count} = lane;
2024-07-05 09:08:17 +08:00
}
2024-07-09 11:11:31 +08:00
2024-07-11 10:22:31 +08:00
public plcStr: string
private judgeUI
2024-07-05 09:08:17 +08:00
private fileLog
2024-08-05 09:47:44 +08:00
private filePath
2024-07-05 09:08:17 +08:00
private totalScore: number
private folderPath: string
private modelPath: string
private avPlayer
private carztStr: string
private rmndg: 0 | 1
private mndgStr: string | undefined
private xmmcStr: string
private xmmcCode: string
private xmmcSingleCode: number
private xmdm: string | number
private xmxh: string
private fileModel: FileModel
private filePhoto: FilePhoto
private usbService: UsbService
//是否是考试模式
private isExam: boolean
//考试是否结束了
2024-07-31 13:47:40 +08:00
private isExamEnd: boolean
//是否手动结束考试
private isManual: boolean
2024-07-05 09:08:17 +08:00
//UDP服务序列号
private serialIndex: number
private fileUtil: FileUtil
private judgeTask: JudgeTask
private tempData: any
private performInfo: any
2024-08-12 10:19:31 +08:00
private isEndTip:boolean = false;
2024-07-05 09:08:17 +08:00
private ksjs: {
// 累计前进距离
qjjl: number,
// 累计倒车距离
dcjl: number
2024-08-08 20:12:19 +08:00
d1: number
d2: number
d3: number
d4: number
d5: number
d6: number
2024-07-05 09:08:17 +08:00
}
private kfArr: {
//项目名称
xmmcStr: string,
xmdm: string | number,
//扣分描述
desc: string,
//扣分
score: string
//无锡所扣分代码
markcatalog: string
markserial: string
kfxh: string
2024-07-31 13:47:40 +08:00
type: 0| 1 | 2
2024-07-05 09:08:17 +08:00
}[]
private km2ItemsStatus: any[]
//所有的科目考试项目(大车&小车)
private testKmItems: any
2024-01-05 11:11:15 +08:00
2024-07-05 09:08:17 +08:00
private plcData: any
2024-07-02 10:42:53 +08:00
2024-07-05 09:08:17 +08:00
//当前科目二的考试项目
private currentKm2ItemsObj: any
//本地轨迹回放地址
private trajectoryPath: string
private isTrajectoryOpen: boolean;
// 调代理接口是否断网了
private isJudgeDisConnect: boolean;
2024-07-31 13:47:40 +08:00
private artSubject3ProjectsCodesArr: number[] = [3, 9, 4, 10, 12, 11]
private lane: LANE = {
road: '', num: 0, count: 0
}
2024-01-05 11:11:15 +08:00
}