fix: 版本号

This commit is contained in:
wangzhongjie 2025-09-16 15:45:15 +08:00
parent 8d7173c545
commit 3ee1b98b43
11 changed files with 511 additions and 498 deletions

View File

@ -5,9 +5,9 @@
"name": "default",
"material": {
"certpath": "/Users/wangzhongjie/.ohos/config/openharmony/default_subject-two_Kl4t-ZSvZeuUm9s8O-e6FIH2VFR_OaNyhDP8kPjIWgU=.cer",
"storePassword": "0000001B0D8963A2149509CE4705E3453B788A74A9A4A6714814A79A4AA117A71A42C0D48243CE59D648EE",
"storePassword": "0000001B16BF173FAE0A4B7B6556BEFBF019A66FA1332BD4CE16B85D6FDCDB05CDB01EBBC32A8B55F90168",
"keyAlias": "debugKey",
"keyPassword": "0000001BABDF12118AF1E7E6AFF8D76FA6D89B08D9E1EC05B6A55CFDAABB51A25D3EA85D9B0E3570B4E666",
"keyPassword": "0000001B2679DA5771C677985ED3A052179731797CD7638B37C0C5DE3D97C1041D0E80EB0D0947ADF133B0",
"profile": "/Users/wangzhongjie/.ohos/config/openharmony/default_subject-two_Kl4t-ZSvZeuUm9s8O-e6FIH2VFR_OaNyhDP8kPjIWgU=.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "/Users/wangzhongjie/.ohos/config/openharmony/default_subject-two_Kl4t-ZSvZeuUm9s8O-e6FIH2VFR_OaNyhDP8kPjIWgU=.p12"

View File

@ -1,13 +1,15 @@
{
"lockfileVersion": 1,
"lockfileVersion": 2,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": {
"@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6"
},
"packages": {
"@ohos/hypium@1.0.6": {
"resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz",
"integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ=="
"resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz",
"integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ==",
"registryType": "ohpm",
"shasum": "3f5fed65372633233264b3447705b0831dfe7ea1"
}
}
}

View File

@ -25,7 +25,7 @@ interface WR {
}
// 通用监管接口
export async function writeObjectOut(params, filePath?: string): Promise<WR> {
export async function writeObjectOut(params, externalTransmission: boolean, filePath?: string): Promise<WR> {
const singlePlay = globalThis.singlePlay
if (singlePlay) {
return { code: 1 }
@ -54,8 +54,7 @@ export async function writeObjectOut(params, filePath?: string): Promise<WR> {
//新监管调用
if (globalThis.isJGNew) {
return await writeObjectOutNew(params, filePath)
return await writeObjectOutNew(params, filePath, externalTransmission)
}
drvexam.zp = drvexam.zp === undefined ? undefined : encodeURIComponent(drvexam.zp)
@ -189,7 +188,6 @@ export async function uploadExamMileage(params) {
<lsh>${params.lsh}<lsh>
<kskssj>${params.examinationRoomId}<kskssj>
<kslc>${params.kslc}<kslc>
<specialkf>${params.specialkf}<specialkf>
</body>
</uploadExamMileageReq>`,
method: 'post',

View File

@ -1,4 +1,5 @@
import libJudgeSdk from 'libJudgeSdk.so'
//@ts-ignore
// import libJudgeSdk from '@ohos.judgesdk'
/**
@ -224,3 +225,11 @@ async function handle(temp,fnName):Promise<string>{
}
})
}
/**
* cpu内存使用情况
* @returns
*/
export function examPeerOccupy() {
return libJudgeSdk.examPeerOccupy()
}

View File

@ -73,7 +73,6 @@ export interface CARINFO {
FLAG: string,
BK1: string,
BK2: string
//脉冲里程设置
X_MCH: string
}

View File

@ -15,7 +15,6 @@ import { uploadExamProgressData, writeObjectOut } from '../../api/judge';
import UsbService from '../../common/service/usbService';
import { KF, LANE } from '../judgeSDK/api/judgeSDK.d';
import { endRecordVideo, saveStartRecordVideo } from '../../common/service/videoService';
import {
Array2Byte,
convertGpsCoord2,
@ -55,7 +54,9 @@ import {
examJudgeVersion
} from './api/index';
import { getSyncData, upDateTableByArray } from '../../common/service/initable';
import { GlobalConfig } from '../../config';
import promptAction from '@ohos.promptAction';
import Want from '@ohos.app.ability.Want';
const judgeTag = 'SURENJUN_JUDGE'
function ifNeedRetry(code: number | string): boolean {
@ -65,6 +66,7 @@ function ifNeedRetry(code: number | string): boolean {
}
return false
}
export default class Judge {
// 过程照片拍照
getPhoto = async (empty?: boolean) => {
@ -115,7 +117,7 @@ export default class Judge {
const examDataArr = examDataStr.split('\n');
for (let examDataStr of examDataArr) {
const examData = JSON.parse(examDataStr)
const code = await writeObjectOut(examData);
const code = await writeObjectOut(examData, false);
}
}
//上传无锡所过程数据
@ -166,15 +168,17 @@ export default class Judge {
map_point_item: mapPointItemArr,
//科目三暂时为空
iteminfo: [],
roads: getModelData('Roads.txt'),
sharps: getModelData('Sharps.txt')
roads: getModelData('km3/Roads.txt'),
sharps: getModelData('km3/Sharps.txt')
}
}
// 处理特殊参数配置
handleSEP = async (code: number) => {
const {judgeUI:{
const {
judgeUI:{
judgeConfigObj
},avPlayer} = this;
}, avPlayer
} = this;
const { examSubject } = globalThis.carInfo;
switch (code) {
@ -240,6 +244,7 @@ export default class Judge {
}
// 处理udp plc信号
handleUdp = async (msg) => {
console.info('plc信号', msg)
const { fileLog, getPlcData, usbService, isUdpEnd, isExamEnd, judgeUI } = this
const stachArr = msg.split(',')
if (stachArr[0] != '#DN_GD' || isUdpEnd) {
@ -260,23 +265,20 @@ export default class Judge {
this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + ''
//TODO 暂时关闭差分检测异常
// await this.checkDwzt(plcData.gps.dwzt,plcData.gps.jdzt);
if (!isExamEnd) {
await examJudgeRealExam(plcData)
}
const udpIndex = globalThis.udpIndex;
let [prevJd, preWd] = [0, 0]
if (udpIndex % 5 === 0 && !isUdpEnd) {
const judgeUdp = globalThis.judgeUdp
const bytes = await this.getMessageHeartbeat(isExamEnd);
judgeUdp.send(bytes)
}
if (!isExamEnd) {
console.info(judgeTag, 'start examJudgeRealExam')
await examJudgeRealExam(plcData)
console.info(judgeTag, 'end examJudgeRealExam')
}
let [prevJd, preWd] = [0, 0]
globalThis.udpIndex += 1
}
private fileLog
private filePath
private bklx: number = 0
private totalScore: number
private prevJd: number = 0
private prevWd: number = 0
@ -285,7 +287,7 @@ export default class Judge {
private modelPath: string
private avPlayer
private carztStr: string
private rmndg: 0 | 1 | 2
private rmndg: 0 | 1
private mndgStr: string | undefined
// 模拟灯光
setMndg = async (mndgStr: string) => {
@ -319,7 +321,7 @@ export default class Judge {
const tJD = convertGpsCoord2(jd)
const tWD = convertGpsCoord2(wd)
const { prevJd, prevWd } = this
if (prevJd && dwzt == 4 && jdzt == 3 && !globalThis.singlePlay) {
if (prevJd && dwzt == 4 && jdzt == 3) {
const distance = await examCalcGpsDistance({
jd1: prevJd,
wd1: prevWd,
@ -328,7 +330,7 @@ export default class Judge {
h: hxj || 1,
})
//@ts-ignore
// globalThis.distanceClass?.setTimeData(((distance / 100).toFixed(2)) * 1)
globalThis.distanceClass?.setTimeData(((distance / 100).toFixed(2)) * 1)
}
this.prevJd = tJD;
this.prevWd = tWD;
@ -336,7 +338,7 @@ export default class Judge {
private performInfo: any
private isEndTip: boolean = false;
private deductedPopShowTimer: number = 0;
// 校验考试是否结束
// 校验考试是否结束
checkExamIsEnd =
async (isManual?: boolean) => {
@ -468,8 +470,6 @@ export default class Judge {
//所有的科目考试项目(大车&小车)
private testKmItems: any
private plcData: any
//特殊扣分标记
private specialkf:string = ''
// 获取plc数据
getPlcData = async (plc: string) => {
const { fileLog, mndgStr, rmndg } = this;
@ -500,7 +500,6 @@ export default class Judge {
const msgStr = strArr[num];
if (msgStr == '') {
console.info(judgeTag, '模拟数据考试结束')
globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
clearInterval(judgeTimer)
this.checkExamIsEnd(true)
return
@ -521,14 +520,11 @@ export default class Judge {
if (msg.method === 'examJudgeArtificialMark') {
setJudgeItem(msg.itemno, msg.serial)
}
msg.sensor.rmndg = this.rmndg
await fileLog.setExamJudgeData(msg)
await examJudgeRealExam(msg)
this.rmndg = 0
const bytes = await this.getMessageHeartbeat();
bytes && globalThis.judgeUdp.send(bytes)
}, 50)
}, 200)
globalThis.judgeTimer = judgeTimer;
}
@ -540,17 +536,19 @@ export default class Judge {
// 调代理接口是否断网了
private isJudgeDisConnect: boolean;
// 项目开始接口同步
beginProject = async (ksxm,xmxh?:string) => {
beginProject = async (ksxm) => {
const carInfo = globalThis.carInfo;
const { examSubject, plateNo } = carInfo;
const {judgeUI,fileLog,getSbbm,filePath} = this;
const { judgeUI, fileLog, getSbbm, xmxh, filePath } = this;
const { lsh, idCard, serialNumber, projectsObj, ksdd, kslx, xldm } = judgeUI
const time = await getCurrentTime();
const project = projectsObj[ksxm]
const sbxh = getSbbm(ksxm, xmxh || this.xmxh)
const sbxh = getSbbm(ksxm, xmxh)
const data = {
//系统类别 接口序列号 接口标识
xtlb: '17', jkxlh: serialNumber, jkid: '17C52',
xtlb: '17',
jkxlh: serialNumber,
jkid: '17C52',
drvexam: {
// 考试科目 身份证号码
lsh,
@ -574,18 +572,20 @@ export default class Judge {
promptWxCode('17C52', code)
}
// 项目结束接口同步
endProject = async (ksxm,xmxh?:string) => {
endProject = async (ksxm) => {
const carInfo = globalThis.carInfo;
const deviceNo = globalThis.deviceNo;
const { examSubject, plateNo, carNo } = carInfo;
const {judgeUI,fileLog,getSbxh,getSbbm,filePath} = this;
const { judgeUI, fileLog, getSbxh, xmxh, getSbbm, filePath } = this;
const { lsh, idCard, serialNumber, projectsObj, cdsbInfoObj, ksdd, kslx, xldm, } = judgeUI
const time = await getCurrentTime();
const project = projectsObj[ksxm]
const sbxh = examSubject == 3 ? undefined : getSbbm(ksxm, xmxh || this.xmxh)
const sbxh = examSubject == 3 ? undefined : getSbbm(ksxm, xmxh)
const data = {
xtlb: '17', jkxlh: serialNumber, jkid: '17C55',
xtlb: '17',
jkxlh: serialNumber,
jkid: '17C55',
drvexam: {
lsh,
kskm: examSubject,
@ -602,56 +602,12 @@ export default class Judge {
}
}
const { code } = await this.sendWriteObjectOut(data, filePath)
//科三 & 432=3
if(examSubject == 3 && this.judgeUI.judgeConfigObj['432'] == 2){
this.judgeUI.uploadMileage()
}
if (code === 2300007) {
this.isJudgeDisConnect = true;
}
console.info(judgeTag, '项目结束 end')
promptWxCode('17C55', code)
}
private artSubject3ProjectsCodesArr: number[] = [3, 9, 4, 10, 12, 11]
private lane: LANE = {
road: '', num: 0, count: 0
}
private videoData: any
private disConnectNum: number = 0;
//调用监管接口
//调用监管接口
sendWriteObjectOut = async (data, filePath) => {
const temp = await writeObjectOut(data, filePath);
console.log("wzj", JSON.stringify(temp))
if (this.disConnectNum == 0) {
console.log("wzj", "第一次发送", JSON.stringify(data))
}
if (this.disConnectNum < 5 && this.disConnectNum > 0) {
console.log("wzj", "第" + this.disConnectNum + "次重新发送", JSON.stringify(data))
}
// 不是成功的接口就需要补传
if (ifNeedRetry(temp.code)) {
this.disConnectNum += 1;
if (this.disConnectNum < 5) {
if (temp.code == 2300028) {
await new Promise(resolve => setTimeout(resolve, 2000)); // 延迟1秒
}
return await this.sendWriteObjectOut(data, filePath)
}
}
if (this.disConnectNum >= 5) {
console.info('surenjun', '123')
this.judgeUI.errorMsg = '当前的考试过程信息网络传输异常,程序点击确认将重启!';
this.judgeUI.disConnectErrorOpen = true
}
this.disConnectNum = 0
return temp
}
// 考试过程照片
uploadProgressPhoto = async (ksxm) => {
const time = await getCurrentTime();
@ -664,7 +620,9 @@ export default class Judge {
const project = projectsObj[ksxm]
const data = {
xtlb: '17', jkxlh: serialNumber, jkid: '17C54',
xtlb: '17',
jkxlh: serialNumber,
jkid: '17C54',
drvexam: {
lsh,
kskm: examSubject,
@ -685,6 +643,12 @@ export default class Judge {
promptWxCode('17C54', code)
console.info(judgeTag, '上传照片 end')
}
private artSubject3ProjectsCodesArr: number[] = [3, 9, 4, 10, 12, 11]
private lane: LANE = {
road: '', num: 0, count: 0
}
private videoData: any
private disConnectNum: number = 0;
constructor(judgeUI) {
this.serialIndex = 1;
@ -705,9 +669,9 @@ export default class Judge {
this.carztStr = '';
this.testKmItems = {};
// 考试回放配置
const {isTrajectoryOpen,trajectoryPath} = judgeConfig
const { isTrajectoryOpen, modelPath, trajectoryPath } = judgeConfig
this.isTrajectoryOpen = isTrajectoryOpen;
this.modelPath = 'models';
this.modelPath = modelPath;
this.trajectoryPath = trajectoryPath;
this.isExam = !this.judgeUI.singlePlay;
@ -729,49 +693,97 @@ export default class Judge {
this.isExamEnd = false;
}
private externalTransmission: boolean = false
// 计算是否启动
private whetherToStart: boolean
//调用监管接口
sendWriteObjectOut = async (data, filePath) => {
const temp = await writeObjectOut(data, this.externalTransmission, filePath);
console.log("wzj", JSON.stringify(temp))
if (this.disConnectNum == 0) {
console.log("wzj", "第一次发送", JSON.stringify(data))
}
if (this.disConnectNum < 5 && this.disConnectNum > 0) {
console.log("wzj", "第" + this.disConnectNum + "次重新发送", JSON.stringify(data))
}
// 不是成功的接口就需要补传
if (ifNeedRetry(temp.code)) {
this.disConnectNum += 1;
if (this.disConnectNum < 5) {
if (temp.code == 2300028) {
await new Promise(resolve => setTimeout(resolve, 2000)); // 延迟1秒
}
return await this.sendWriteObjectOut(data, filePath)
}
if (this.disConnectNum >= 5) {
this.externalTransmission = true
let want: Want = {
bundleName: 'com.oh.upload', // 替换为你的应用包名
abilityName: 'EntryAbility', // 你的 Service Ability 名称
moduleName: 'entry', // 你的模块名称,通常是 'entry',
parameters: {}
};
try {
let context = this.judgeUI.context;
context.startAbility(want)
.then(() => {
})
.catch((error) => {
console.error(`拉起应用失败: ${error.code} - ${error.message}`);
});
} catch (error) {
console.error(`启动Ability异常: ${error.message}`);
}
return await this.sendWriteObjectOut(data, filePath)
}
}
if (this.disConnectNum >= 5) {
console.info('surenjun', '123')
this.judgeUI.errorMsg = '当前的考试过程信息网络传输异常,程序点击确认将重启!';
this.judgeUI.disConnectErrorOpen = true
}
this.disConnectNum = 0
return temp
}
public async onJudgeFn(fn: Function) {
await this.judging(fn)
}
// 获取评判初始化数据
getJudgeInitData = async () => {
const {getModelData,getKm3JudgeInitConfig,bklx} = this
const { getModelData, getKm3JudgeInitConfig } = this
const carInfo = globalThis.carInfo;
const { examSubject, plateNo, carId } = carInfo;
const judgeUI = this.judgeUI
const { projectsObj, itemInfoObj, markRuleListObj, carType, carName, systemparmArr, carinfoArr } = judgeUI
const examType = examSubject == 2 ? 'km2' : 'km3'
const fileUtil = new FileUtil(globalThis.context)
const ipConfigStr = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt');
const ipConfig = JSON.parse(ipConfigStr)
let allitems = [];
if (examSubject == 2) {
allitems = Reflect.ownKeys(itemInfoObj).map(cdsbKey => {
const cdsb = itemInfoObj[cdsbKey];
const { xmdm, xmxh, modelKey } = cdsb
const modelVal= getModelData(`${modelKey}.txt`)
if(modelVal){
return {
xmdm, xmxh, model: modelVal
xmdm, xmxh, model: getModelData(`${examType}/${modelKey}.txt`)
}
}else{
return undefined
}
}).filter(item => item !== undefined)
})
}
//获取版本号
const sdkver = await examJudgeVersion();
const initInfo = {
sdkver,
appver: globalThis.version,
appver: judgeConfig.version,
kskm: examSubject * 1,
kchp: plateNo,
kchm: carId * 1,
kscx: carType,
cxcode: '1',
name: carName,
carmodel: getModelData(`${carType}.txt`),
carmodel: getModelData(`${examType}/${carType}.txt`),
allitems,
iteminfo: [],
systemparm: systemparmArr,
@ -780,8 +792,6 @@ export default class Judge {
itemInfoObj,
carlist: judgeUI.carlist,
carinfo: carinfoArr,
//板卡类型
bklx,
};
let km3Config = {}
@ -803,7 +813,8 @@ export default class Judge {
const { sczb, kfdm } = currentParams;
const { isExam } = this;
const judgeUI = this.judgeUI
const {projects,carType,kssycs,isDdxk,ddxkTime,projectsCenterObj,ddxkKsxmArr,ddxkKfArr,passingScore} = judgeUI;
const { projects, carType, kssycs, isDdxk, ddxkTime, projectsCenterObj, ddxkKsxmArr, ddxkKfArr, passingScore } =
judgeUI;
const beginInfo = {
kgid: '012',
kgxm: decodeURI(examinerName || ''),
@ -841,15 +852,16 @@ export default class Judge {
xmdm: xmdm * 1, kfdm
}
})) : [],
yklc: judgeUI.yklc,
//TODO 已考里程待修改
yklc: 0,
special: [],
//TODO 科目三参数临时写死
sczb: (sczb === undefined || sczb == 0) ? 0 : 1,
sczbkf: kfdm,
dmndg: false,
mfxx: false,
mfxxn: false,
//科目三特殊扣分项
specialkf:judgeUI.specialkf,
zeng: false
}
console.info(judgeTag, '5.获取开始考试数据完成')
return beginInfo
@ -957,7 +969,7 @@ export default class Judge {
const { examSubject } = this.judgeUI
const xmdm = xmqx.xmdm;
const xmmcCode = judgeUI.projectsObj[xmdm].projectCodeCenter;
// const voiceCode = getKmProjectCancelVoice(examSubject, xmmcCode);
const voiceCode = getKmProjectCancelVoice(examSubject, xmmcCode);
// avPlayer.playAudio([`voice/${voiceCode}.mp3`],true)
this.judgeUI.projectsObj[xmdm].type = '1';
this.testKmItems[xmmcCode].status = '1';
@ -1074,7 +1086,7 @@ export default class Judge {
if (!isEnd) {
judgeTask.addTask(async () => {
console.info(judgeTag, `项目开始-${xmdm}-${projectsObj[xmdm].name}`)
await beginProject(xmdm,xmxh)
await beginProject(xmdm)
}, {
isDelay: true
})
@ -1103,7 +1115,7 @@ export default class Judge {
if (!projectIsEnd) {
judgeTask.addTask(async () => {
console.info(judgeTag, `项目结束-${xmdm}-${projectsObj[xmdm].name}`)
await endProject(xmdm,xmxh)
await endProject(xmdm);
this.xmmcSingleCode = 0;
this.xmmcEndCode = undefined;
}, {
@ -1125,7 +1137,8 @@ export default class Judge {
console.info('surenjun', '扣分开始')
//扣分时实时播报语音0-否+1-是)
const currentKf = kf[kfLen -1];
if (judgeConfig.kfVoiceOpen || (examSubject == 2 && judgeConfigObj['618'] == '1') || (examSubject == 3 && judgeConfigObj['418'] == '1')) {
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);
@ -1194,7 +1207,9 @@ export default class Judge {
})
const data = {
xtlb: '17', jkxlh: serialNumber, jkid: '17C53',
xtlb: '17',
jkxlh: serialNumber,
jkid: '17C53',
drvexam: {
lsh,
kskm: examSubject,
@ -1214,6 +1229,7 @@ export default class Judge {
}
}
console.info(judgeTag + 'ksxm=>', data.drvexam.ksxm)
const { code } = await this.sendWriteObjectOut(data, filePath);
if (code == 2300007) {
this.isJudgeDisConnect = true
@ -1243,13 +1259,9 @@ export default class Judge {
} else {
//收到综合评判语音时,显示综合评判弹窗
if (code[0] == 'zhpp') {
const param512 = (this.judgeUI.judgeConfigObj['512'] || '').split(',');
this.judgeUI.isDeductedPopShow = false
clearTimeout(this.deductedPopShowTimer)
if(param512[7] != 0){
this.judgeUI.isDeductedPopShow = true
this.judgeUI.defaultTabIndex = 1
}
this.isEndTip = true
}
avPlayer.playAudio([`voice/${code[0]}.mp3`])
@ -1268,13 +1280,12 @@ export default class Judge {
// this.judgeUI.totalScore = isAllProjectsEnd ? totalScore : 0;
const singlePlay = globalThis.singlePlay
const param302 = judgeConfigObj['302'];
// globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
//自动退出待验证并且不合格
if (!isManual && examSubject == 3 && (param302 == 1 || (singlePlay && param302 == 2)) && totalScore < passingScore) {
if (!isManual && examSubject == 3 && (param302 == 1 || (singlePlay && param302 == 2)) &&
totalScore < passingScore) {
avPlayer.playAudio([`voice/考试结束.mp3`])
}
//联网模式下:项目没有做完、当前分数大于及格分;手动结束直接退出
if (!singlePlay && isManual && !isAllProjectsEnd && totalScore >= passingScore) {
avPlayer.playAudio(['voice/empty.mp3'], true, () => {
@ -1284,7 +1295,18 @@ export default class Judge {
})
return
}
if (examSubject == 3) {
const param302 = judgeConfigObj['302'];
if (totalScore < passingScore) {
//考试不合格;考试模式,自动退出;
if (param302 == 4 || param302 == 5 || param302 == 7 || param302 == 8) {
}
} else {
//考试合格
}
}
await handleSEP(306);
avPlayer.playAudio(['voice/exam_waiting.mp3'], globalThis.singlePlay, async () => {
try {
if (!singlePlay) {
@ -1295,7 +1317,6 @@ export default class Judge {
console.info(judgeTag, JSON.stringify(e))
}
await endExam()
});
}
@ -1309,22 +1330,22 @@ export default class Judge {
judgeUI,
ksjs,
getPhoto,
uploadProgressData,
uploadDisConnectData,
avPlayer,
kfArr,
judgeTask,
filePath,
closeAllFiles
} = this;
const { lsh, idCard, serialNumber, kssycs, totalScore, judgeConfigObj, isAllProjectsEnd, passingScore } = judgeUI
//TODO 断网考试结束补传
// await uploadDisConnectData();
try {
const time = await getCurrentTime();
const photoBase64 = await getPhoto();
const { d1, d2, d3, d4, d5 } = ksjs
const data = {
xtlb: '17', jkxlh: serialNumber, jkid: '17C56',
xtlb: '17',
jkxlh: serialNumber,
jkid: '17C56',
drvexam: {
lsh,
kchp: encodeURI(plateNo),
@ -1364,7 +1385,8 @@ export default class Judge {
let voiceURL = ''
if (examSubject == 2) {
if (isAllProjectsEnd) {
voiceURL = (totalScore < passingScore ? `voice/unqualified_${kssycs == 1 ? 'one' : 'two'}.wav` : 'voice/qualified.mp3')
voiceURL =
(totalScore < passingScore ? `voice/unqualified_${kssycs == 1 ? 'one' : 'two'}.wav` : 'voice/qualified.mp3')
} else {
voiceURL = `voice/unqualified_${kssycs == 1 ? 'one' : 'two'}.wav`
currentKssycs = kssycs == 1 ? 0 : 1
@ -1466,6 +1488,14 @@ export default class Judge {
})
}
} catch (e) {
promptAction.showToast({
message: "考试结束异常,请尝试重新结束",
duration: 3000
})
judgeUI.loadingPopupVisible = false
}
}
// 当前项目转换
@ -1508,9 +1538,11 @@ export default class Judge {
} = this;
const singlePlay = globalThis.singlePlay
const { lsh, startHourTime, totalScore, examTime, judgeConfigObj } = judgeUI;
const {fourInOneScreen:{
const {
fourInOneScreen:{
gpsDigit
}} = judgeConfig
}
} = judgeConfig
const examType = examSubject == 2 ? 2 : 3
const { sensor, gps } = tempData;
if (tempData.sensor === undefined) {
@ -1527,15 +1559,14 @@ export default class Judge {
const sbxh = getSbxh(xmdm, xmxh)
const { carzt, dcjl, qjjl, dxjl, bxjl } = performInfo || {};
const asclshArr = stringToASC(
fillZero((
singlePlay ?
(examSubject == 2 ? '0000000000000' : '0000000000000') : lsh) || 0, 13)
fillZero((singlePlay ? (examSubject == 2 ? '0000000000000' : '1111111111111') : lsh) || 0, 13)
);
//13不足要补0
const ascksyhArr = stringToASC(fillZero(ksyh || 0, 13))
const ascsbxhArr = stringToASC(sbxh)
const translateSignals = getTranslateSignals(
[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])
[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])
)
//@ts-ignore
const translateJd = convertGpsCoord2(wd).toFixed(gpsDigit) * Math.pow(10, gpsDigit);
@ -1563,7 +1594,8 @@ export default class Judge {
translateSignals,
//速度 发动机转速 GPS纬度 GPS经度 主天线位置
//@ts-ignore
string2Bytes(tempSd * 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北向距离
@ -1682,8 +1714,9 @@ export default class Judge {
// 获取模型数据
getModelData = (modelName) => {
const modelPath = this.modelPath
const fileModel = this.fileModel;
const modelData = fileModel.getModelContent('models', modelName);
const modelData = fileModel.getModelContent(modelPath, modelName);
return modelData
}
@ -1722,7 +1755,7 @@ export default class Judge {
// 检测差分状态
checkDwzt = async (type) => {
const { avPlayer } = this;
const config499 = this.judgeUI.judgeConfigObj['499'];
const judgeConfig = this.judgeUI.judgeConfig;
switch (type) {
case 0:
this.judgeUI.isDwztRight = true;
@ -1730,17 +1763,10 @@ export default class Judge {
case 1:
this.judgeUI.dwztErrorVisible = true;
clearInterval(this.judgeUI.timer);
clearInterval(globalThis.judgeTimer)
avPlayer.playAudio([`voice/差分状态异常.mp3`], true)
setTimeout(() => {
try {
this.checkExamIsEnd(true);
} catch (e) {
this.closeAllFiles()
router.back()
}
}, config499 * 1000)
}, 3000)
break;
case 2:
@ -1768,19 +1794,13 @@ export default class Judge {
//开始评判
private async judging(callBack: Function) {
const { judgeUI } = this;
const { name, lsh, idCard,kssycs,markRules} = judgeUI;
const { name, lsh, idCard, kssycs, manualMarkRules } = judgeUI;
const fileLog = new FileLog(judgeUI.context);
const filePath = await fileLog.initFileLogo({
name, lsh, idCard
});
const ipFileUtil = new FileUtil(globalThis.context)
const ipConfigStr = await ipFileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt');
const ipConfig = JSON.parse(ipConfigStr)
this.fileLog = fileLog;
this.filePath = filePath;
this.bklx = Number(ipConfig.cardType)
const {
getJudgeBeginData,
@ -1825,7 +1845,6 @@ export default class Judge {
this.handleRealExam(strData, callBack)
})
await examJudgeSetPerformCallback(async (info) => {
console.info('评判实时数据', info)
const performInfo = JSON.parse(info)
@ -1837,11 +1856,6 @@ export default class Judge {
this.judgeUI.jl = jl
//TODO 待优化 跨组件传值不生效
globalThis.laneData = performInfo.lane;
//特殊扣分标记上传中心
if(performInfo.specialkf !== this.specialkf){
this.judgeUI.uploadMileage(performInfo.specialkf)
this.specialkf = performInfo.specialkf
}
})
// 3.开始考试
@ -1858,7 +1872,7 @@ export default class Judge {
if (!globalThis.singlePlay) {
this.videoData = await saveStartRecordVideo(`${name}_${kssycs}`)
}
globalThis.statue = 4
const { examSubject, projectsObj } = this.judgeUI
// if(examSubject == 3){
// //不做模拟灯光,需要做上车准备 =>(请上车准备)
@ -1887,8 +1901,7 @@ export default class Judge {
handDistance();
}
});
//页面逻辑处理完成
this.judgeUI.isInitSuccess = true;
// this.checkExamIsEnd()
//监听远程结束考试
@ -1896,33 +1909,18 @@ export default class Judge {
this.checkExamIsEnd(true);
})
console.info(judgeTag, JSON.stringify(markRules))
console.info(judgeTag, JSON.stringify(manualMarkRules))
//监听远程扣分
globalThis.udpEvent.onKfExam(async (content) => {
//为1时所有扣分项均可远程扣分;其它,只能扣 MARKSERIAL 大于 99 的扣分项
const config810 = this.judgeUI.judgeConfigObj['810'];
console.info('评判收到远程扣分项目内容' + JSON.stringify(content))
const { kfxh, directives } = content.data;
console.info(judgeTag, '评判收到远程扣分项目内容,扣分序号:' + `kfxh=>${kfxh}; directives=>${directives}`)
//根据扣分序号找扣分代码
const currentKf = markRules.filter(mark => (
mark.kfxh == kfxh && (config810 == 1 || mark.markserial > 99)
))[0];
const currentKf = manualMarkRules.filter(mark => mark.kfxh == kfxh)[0];
console.info(judgeTag, '扣分项目:' + JSON.stringify(currentKf))
this.setJudgeMark(currentKf.itemno, currentKf.markserial, 2);
globalThis.judgeUdp.confirmKf(directives, 1)
})
//监听远程终止考试
globalThis.udpEvent.onStopExam(async () => {
const config392 = (this.judgeUI.judgeConfigObj['392'] || '20,81').split(',');
console.info(judgeTag, '开始远程终止考试扣分')
this.setJudgeMark(config392[0]*1, config392[1], 2);
})
this.checkExamIsEnd();
}

View File

@ -55,11 +55,10 @@ export default class FileModel{
return content;
}catch (e){
console.info('surenjun',JSON.stringify(e))
// promptAction.showToast({
// message:`请检查模型路径${folderPath}/${fileName}是否正确!`,
// duration:4000
// })
return '';
promptAction.showToast({
message:`请检查模型路径${folderPath}/${fileName}是否正确!`,
duration:4000
})
}
}

View File

@ -13,25 +13,9 @@ interface Params{
}
export default class FilePhoto {
public mediaTest
private params: Params
private context: any
private fileUtil:FileUtil
public mediaTest
constructor(context) {
(async ()=>{
//TODO 309参数 获取拍照摄像头拍照通道
const fileUtil = new FileUtil(context)
const strConfig = await fileUtil.readFile('/mnt/hmdfs/100/account/device_view/local/files/duolun/config/config3.txt');
const config = JSON.parse(strConfig)
const {userName,ip,pwd,port,rlls,pztd} = config
this.params = {userName,pwd,ip,port,rlls,pztd}
this.context = context
this.fileUtil = fileUtil
})()
}
public getPhoto = async () => {
const { params } = this;
if (!judgeConfig.isPhotoOpen) {
@ -52,5 +36,26 @@ export default class FilePhoto{
}
}
}
private fileUtil: FileUtil
constructor(context) {
(async () => {
//TODO 309参数 获取拍照摄像头拍照通道
const fileUtil = new FileUtil(context)
const strConfig =
await fileUtil.readFile('/mnt/hmdfs/100/account/device_view/local/files/duolun/config/config3.txt');
const config = JSON.parse(strConfig)
const { userName, ip, pwd, port, rlls, pztd } = config
this.params = {
userName,
pwd,
ip,
port,
rlls,
pztd
}
this.context = context
this.fileUtil = fileUtil
})()
}
}

View File

@ -107,6 +107,8 @@ export function getKmProjectVoice(
const param544Str = judgeConfig['544']?.split(',') || [];
const param405Str = judgeConfig['405'] || 0;
console.info('surenjun => param544Str.length',param544Str.length)
const {num,count,road} = lane
if(examSubject == 2){
return projectCode
@ -317,14 +319,12 @@ export const plcStrToJson = async (plc:string) =>{
},
gps:{
//办卡类型 定位差分状态
bklx:Number(p[56]), dwzt:p[83],
bklx:p[56], dwzt:p[83],
//@ts-ignore 角度差分状态
jdzt:p[92].split('-')[0]*1,
//一代机、三代机经纬度数据兼容
//gps时间 经度 纬度
sj:time, jd:Math.max(Number(p[95]),Number(p[96])), wd:Math.min(Number(p[95]),Number(p[96])),
//航向角 俯仰角 海拔高 高度差 速度
hxj:p[90], fyj:p[91], hbg:p[85], gdc:p[86], sd:p[97],
//gps数据
//gps时间 经度 纬度 航向角 俯仰角 海拔高 高度差 速度
sj:time, jd:p[96], wd:p[95], hxj:p[90], fyj:p[91], hbg:p[85], gdc:p[86], sd:p[97],
//龄期 经度因子 纬度因子 定位搜星数
age:p[87], jdyz:p[89], wdyz:p[88], dwsxs:p[84] || 0,
//@ts-ignore 角度搜星数
@ -350,7 +350,7 @@ export const plcStrToWXJson = async (plc:string) =>{
const timeStr = p[93] + '' + p[94];
const gps = {
//办卡类型 定位差分状态
bklx:Number(p[56]), dwzt:p[83],
bklx:p[56], dwzt:p[83],
// 经度 纬度 航向角 俯仰角 海拔高 高度差 速度
jd:p[96], wd:p[95], hxj:p[90], fyj:p[91], hbg:p[85], gdc:p[86], sd:p[97],
//龄期 经度因子 纬度因子 定位搜星数

View File

@ -1,6 +1,7 @@
//考试回放开关
export const judgeConfig = {
version:'2024.08.21.01',
// 外壳版本号
version: "2025.05.26.01",
//本地目录开关
isTrajectoryOpen: false,
//是否开启拍照
@ -14,13 +15,13 @@ export const judgeConfig = {
//轨迹回放是否开启Udp
udpOpen: true,
// 本地模型地址
// modelPath: 'models/model_enc',
modelPath: 'models/model_enc',
// 济南科目三
trajectoryPath: 'logs/2025_04_23_09_50_55_2504755332926_320924199111132926_陈静/judge_exam_data.txt',
trajectoryPath: 'logs/2024_10_12/2024_10_12_11_50_10_9999427676823_744299437502336256_隋统/judge_exam_data.txt',
//四合一画面配置
fourInOneScreen: {
//gps位数
gpsDigit:7
gpsDigit: 6
},
// 杭州科目二
// trajectoryPath: 'logs/2024_07_19/0000000000001_342323199501470011_测试学员1_2024_07_19_06_49_12/judge_exam_data.txt',

View File

@ -1,13 +1,15 @@
{
"lockfileVersion": 1,
"lockfileVersion": 2,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": {
"@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6"
},
"packages": {
"@ohos/hypium@1.0.6": {
"resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz",
"integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ=="
"resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz",
"integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ==",
"registryType": "ohpm",
"shasum": "3f5fed65372633233264b3447705b0831dfe7ea1"
}
}
}