Compare commits

...

29 Commits

Author SHA1 Message Date
wangzhongjie
7df90207e8 fix: 提交 2025-09-16 16:46:29 +08:00
wangzhongjie
55155a370b fix: 提交 2025-09-16 15:48:56 +08:00
wangzhongjie
3ee1b98b43 fix: 版本号 2025-09-16 15:45:15 +08:00
wangzhongjie
8d7173c545 Merge branch 'dev' of http://88.22.24.105:3000/harmony_car/subject-two into dev 2025-07-29 14:57:47 +08:00
Surenjun
ed4b981807 fix:遗漏方法提交 2025-07-22 18:43:54 +08:00
Surenjun
dc72d33536 feat: 断点续考specialkf修改 2025-07-22 09:14:44 +08:00
wangzhongjie
0c2715821d Merge branch 'dev' of http://88.22.24.105:3000/harmony_car/subject-two into dev 2025-07-01 10:42:14 +08:00
0832262cd7 fix:新增853参数 2025-06-30 19:28:17 +08:00
6b54e9da5c Revert "Revert "fix:新增503参数""
This reverts commit 6de9d4bdcb42c67f9533b693f3d70a04b0e8391d.
2025-06-30 19:27:41 +08:00
6de9d4bdcb Revert "fix:新增503参数"
This reverts commit addf143396b30a4b348dcf1830e0da3d4800163b.
2025-06-30 19:26:56 +08:00
addf143396 fix:新增503参数 2025-06-30 19:22:21 +08:00
448a16fab9 fix: 档位串口读取优化 2025-06-28 09:54:28 +08:00
e36b0f018b fix: 1.499参数修改; 2.科目二sbbm字段读取优化 2025-06-28 09:52:27 +08:00
lv
f9beb54a28 冲突提交 2025-06-25 10:21:28 +08:00
lv
f420a9512f 重连 2025-06-25 10:19:26 +08:00
wangzhongjie
2d085b42bf Merge branch 'dev' of http://88.22.24.105:3000/harmony_car/subject-two into dev 2025-06-23 14:19:26 +08:00
920323bc78 无用代码清理 2025-06-18 15:24:33 +08:00
6f3bdbf176 fix:退回 2025-06-18 15:10:43 +08:00
8251bed720 fix:优化人工进项目 2025-06-18 15:01:19 +08:00
508c3f3954 fix:档位串口优化 2025-06-18 14:21:05 +08:00
wangzhongjie
2f524da992 Merge branch 'dev' of http://88.22.24.105:3000/harmony_car/subject-two into dev 2025-06-05 16:12:27 +08:00
wangzhongjie
7447ae3f4d Merge branch 'dev' of http://88.22.24.105:3000/harmony_car/subject-two into dev 2025-05-27 11:01:31 +08:00
wangzhongjie
5c9af2b914 Merge branch 'dev' of http://88.22.24.105:3000/harmony_car/subject-two into dev 2025-05-27 10:16:01 +08:00
wangzhongjie
818d2a775d merge 2025-05-20 13:46:10 +08:00
wangzhongjie
5119c46963 Merge branch 'dev' of http://88.22.24.105:3000/harmony_car/subject-two into dev 2025-05-15 17:03:17 +08:00
wangzhongjie
bc8017ff71 Merge branch 'dev' of http://88.22.24.105:3000/harmony_car/subject-two into dev 2025-05-15 09:27:24 +08:00
wangzhongjie
45772f0b49 fix: 合并 2025-05-09 09:01:48 +08:00
wangzhongjie
fc6f784db1 Merge branch 'dev' of http://47.122.70.237:3000/harmony_car/subject-two into dev 2025-04-22 16:28:54 +08:00
wangzhongjie
afa4983725 关闭本地回放 2025-04-11 13:04:37 +08:00
18 changed files with 327 additions and 208 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": "0000001B0A8E97F78561FFE1B2E5B57C296BFC3D297047253237158BC25CD7077892C41C1C83FAFFDE4A0A",
"storePassword": "0000001B16BF173FAE0A4B7B6556BEFBF019A66FA1332BD4CE16B85D6FDCDB05CDB01EBBC32A8B55F90168",
"keyAlias": "debugKey",
"keyPassword": "0000001B654E765B79C902CB9E3A6D97A40F5852412CEE5AC37E949F430C754DB02327838E925EDF861314",
"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

@ -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)

View File

@ -1,8 +1,11 @@
import { getSyncData } from '../common/service/initable';
import request from "../common/utils/request"
let baseHost = globalThis.host;
import FileUtil from '../common/utils/File';
import FileLog from '../pages/judgeSDK/utils/fileLog';
import pasteboard from '@ohos.pasteboard';
import Want from '@ohos.app.ability.Want';
//监管接口序列号映射
const gjxlhObj = {
@ -14,38 +17,43 @@ const gjxlhObj = {
'17C56': '02-21-000014',
}
interface WR{
message?:string
code:number
interface WR {
message?: string
code: number
}
export default async function writeObjectOutNew(data,filePath): Promise<WR> {
export default async function writeObjectOutNew(data, filePath, externalTransmission): Promise<WR> {
const fileUtil = new FileUtil(globalThis.context);
const {jkid , drvexam} = data;
const basic = await getBasicConfig(jkid);
const params = await getParams(jkid, drvexam);
const {wglb,jkxlh,glbm,jgbh,sjbs} = basic;
if(filePath){
await fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`,JSON.stringify({
wglb,jkxlh,glbm,jgbh,sjbs,
data:params.data,
file:{...params.file,param:[]},
if (filePath) {
await fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`, JSON.stringify({
wglb,
jkxlh,
glbm,
jgbh,
sjbs,
data: params.data,
file: {
...params.file, param: []
},
}));
}
// let connectTimeout = sjbs === '02-21-000014' ?60000:1
console.info('surenjun','调用新监管')
console.info('surenjun', '调用新监管')
let temp
try {
temp = await request({
host: globalThis.JGHOST,
method: 'post',
//是否是新中心
isNewCenter: true,
xml: true,
url: '/dems_ws/services/TmriOutAccess?wsdl',
data: `<?xml version="1.0"?>
let requestData = {
host: globalThis.JGHOST,
method: 'post',
//是否是新中心
isNewCenter: true,
xml: true,
url: '/dems_ws/services/TmriOutAccess?wsdl',
data: `<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
@ -63,17 +71,29 @@ export default async function writeObjectOutNew(data,filePath): Promise<WR> {
</writeObjectOut>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>`,
})
}
try {
if (!externalTransmission) {
temp = await request(requestData)
} else {
let systemPasteboard = pasteboard.getSystemPasteboard()
let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, JSON.stringify(requestData))
await systemPasteboard.clear()
await systemPasteboard.setData(pasteData)
temp = {
code: 1
}
}
} catch (e) {
console.log("新监管错误")
temp = e
}
console.log("temp message: ", JSON.stringify(temp))
if(filePath){
await fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`,JSON.stringify(temp) +`\n`);
if (filePath) {
await fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`, JSON.stringify(temp) + `\n`);
}
return temp
}
export async function getParams(jkid, drvexam) {

View File

@ -7,12 +7,14 @@ import { takePhoto, deleteAllFileByPiC } from '../../common/service/videoService
// import { VideoConfigData } from '../../mock';
import request from '@ohos.request'
import Prompt from '@system.prompt';
import util from '@ohos.util';
import {
delSyncTable,
getDataBaseTable,
getMySystemSetTable,
upDataZhongxinginitialization,
getSyncData,
upDateTable
} from '../../common/service/initable'
import { GlobalConfig } from '../../config/index'
@ -433,17 +435,21 @@ let fd
const devPath = "/dev/ttyS3"
function openChuankouFn(callback) {
console.log('SerialOpen in indexservice, path=' + devPath)
//TODO 自动挡车不读取串口
testNapi.SerialOpenAsync(devPath, (fd) => {
globalThis.fd = fd;
globalThis.num = 0
let parity = 0x4e; // 'N'
let ret = testNapi.SerialSetAsync(globalThis.fd, 115200, 0, 8, 1, parity, (ret) => {
callback()
});
});
getSyncData('ES_CARINFO').then(result => {
const carInfo = result[0] || {};
globalThis.carInfo.kscx = carInfo.kscx
console.info('srj ES_CARINFO=>',JSON.stringify(carInfo))
if(carInfo.kscx == 'C1'){
testNapi.SerialOpenAsync(devPath, (fd) => {
globalThis.fd = fd;
globalThis.num = 0
let parity = 0x4e; // 'N'
let ret = testNapi.SerialSetAsync(globalThis.fd, 115200, 0, 8, 1, parity, (ret) => {
callback()
});
});
}
})
}
function getChuankouFnMsg() {
@ -451,9 +457,9 @@ function getChuankouFnMsg() {
let databuff = [0x61, 0xAA, 0x0A, 0X15, 0X00]; // send ABCDE
testNapi.SerialSendAsync(globalThis.fd, databuff, (ret) => {
testNapi.SerialRecvAsync(globalThis.fd, timeout, (revTestInfo) => {
const message = revTestInfo?.recevedBuf?.toString()
if (message == '') {
let msgBuf = util.TextDecoder.create().decodeWithStream(new Uint8Array(revTestInfo?.recevedBuf))
if (message == '' || msgBuf == '') {
globalThis.num = 1
// clearInterval(chuankou)
testNapi.SerialClose(globalThis.fd);
@ -464,16 +470,8 @@ function getChuankouFnMsg() {
return
}
const msg = message?.split(',')
if (!msg?.length) {
} else if (msg[0] != '98' || msg[1] != '85' || msg.length < 9) {
} else if (msg.length < 12) {
} else {
globalThis.chuankoMsg = msg[9]
}
let dang = Number(msgBuf?.split(",")?.[1]?.split('\r')[0] || 0)
globalThis.chuankoMsg =( msg[9] === '' || msg[9] >10 ) ? dang: msg[9]
setTimeout(() => {
getChuankouFnMsg()
}, 500)

View File

@ -3,7 +3,7 @@ import { getSyncData } from '../service/initable';
import hilog from '@ohos.hilog';
import FileUtil from '../../common/utils/File'
import { GlobalConfig } from '../../config/index'
const TAG = 'socketTag[TcpDemo.TcpClient]'
export async function getTCP(flag=false) {
globalThis.getCloseTcp=true
const fileUtil = new FileUtil(globalThis.context)
@ -35,10 +35,16 @@ export async function getTCP(flag=false) {
console.log('ttttttt00')
clearInterval(globalThis.intervalSendmsg)
globalThis.intervalSendmsg=setInterval(()=>{
globalThis.intervalSendmsg=setInterval(async()=>{
console.log('getCloseTcp',globalThis.carInfo.carNo)
if(!globalThis.getCloseTcp){
globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
globalThis.tcpStep+=1
if(globalThis.tcpStep>30){
console.log(TAG,'tcp重连开始')
globalThis.tcpStep=0
getTCP()
}
}
},1000/3)
globalThis.TcpClient.onError((val) => {
@ -68,10 +74,16 @@ export async function getTCP(flag=false) {
console.log('ttttttt12')
clearInterval(globalThis.intervalSendmsg)
globalThis.intervalSendmsg=setInterval(()=>{
globalThis.intervalSendmsg=setInterval(async()=>{
// console.log('getCloseTcp',globalThis.getCloseTcp)
if(!globalThis.getCloseTcp){
globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
globalThis.tcpStep+=1
if(globalThis.tcpStep>30){
console.log(TAG,'tcp重连开始')
globalThis.tcpStep=0
getTCP()
}
}
},1000/3)
globalThis.TcpClient.onError((val) => {

View File

@ -148,13 +148,12 @@ export default class TcpClient {
this.tcpSendNum=0
return
}
globalThis.getCloseTcp=true
console.log(`${TAG} TCPsend error ${JSON.stringify(err)}`)
// this.writeLog({
// time:dateFormat(new Date()),
// message: `${TAG} TCPsend error ${JSON.stringify(err)}`,
// })
reslove(false)
reject(false)
});
})
}
@ -165,6 +164,7 @@ export default class TcpClient {
// time:dateFormat(new Date()),
// PLC:`${TAG} Tcponmessage`,
// })
globalThis.tcpStep=0
globalThis.tcpUdpError = false
if (value) {
callback && callback(value.message)

View File

@ -38,7 +38,7 @@ export default class EntryAbility extends UIAbility {
// Main window is created, set main page for this ability
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
await tcpUtil.init()
globalThis.tcpStep=0
globalThis.carInfo = {}
globalThis.examinerInfo = {}

View File

@ -677,6 +677,11 @@ struct Index {
}, 1000)
this.createAlbum()
getSyncData('ES_CARINFO').then(result => {
const carInfo = result[0] || {};
globalThis.carInfo.kscx = carInfo.kscx
})
// clearInterval(globalThis.demo)
// globalThis.demo= setInterval(()=>{
// const str= {"carId":"1062","examinationRoomId":"2","videoVersion":"1.0","judgeVersion":"2023.09.30.1","shellVersion":"2023.12.13.01","host":"http://172.37.55.191:8082"}

View File

@ -442,7 +442,7 @@ struct Index {
const ddxkKsxmArr = examItemsArrs[2]?.split(',').filter(item => item) || []
const ddxkKfArr = examItemsArrs[3]?.split('^').filter(item => item) || []
if (judgeConfigObj['432'] == 2 || examSubject == 2) {
//TODO 带项目带里程
if (ddxkKsxmArr?.length) {
//断点续考
ddxkKsxmArr.forEach(xmdm => {
@ -455,6 +455,8 @@ struct Index {
})
this.ddxkKsxmArr = ddxkKsxmArr
}
this.specialkf = examItemsArrs[4];
this.yklc = Number(examItemsArrs[1]) || 0
}
//扣分续考
ddxkKfArr.forEach((kf) => {
@ -480,6 +482,7 @@ struct Index {
this.ddxkKfArr = ddxkKfArr
this.ddxkTime = Date.parse(startTime);
this.isDdxk = true
}
}
@ -572,7 +575,7 @@ struct Index {
}
// 上传考试里程
async uploadMileage() {
async uploadMileage(specialkf) {
if (!globalThis.singlePlay) {
const {lsh,startExamTime:kskssj,jl:kslc} = this
const { carId ,examinationRoomId} = globalThis.carInfo;
@ -581,7 +584,9 @@ struct Index {
examinationRoomId,
lsh,
kskssj,
kslc
//考试里程单位cm
kslc:kslc * 100,
specialkf
})
}
}
@ -1443,4 +1448,8 @@ struct Index {
@State errorMsg: string = ''
@State isErrorMsgEnd: boolean = false
@State disConnectErrorOpen: boolean = false
//开始考试特殊标记
@State specialkf:string = ''
//已考里程
@State yklc:number = 0
}

View File

@ -91,6 +91,7 @@ struct UserInfo {
'Param398': '0', //考前上车准备
'Param835': '0', //考前上车准备
'Param850': '0', //考前上车准备
'Param853': '0', //未熄火不能开始考试
}
@State startExam: boolean = false
// 过程照片拍照
@ -537,6 +538,9 @@ struct UserInfo {
if (sys.v_no === '770') {
that.systemParam.Param770Str = sys.v_value;
}
if(sys.v_no === '853'){
that.systemParam.Param853 = sys.v_value;
}
if (sys.v_no === '835') {
that.systemParam.Param835 = sys.v_value;
}
@ -946,8 +950,10 @@ struct UserInfo {
const {isCheckFireOpen} = judgeConfig
const {systemParam,isBoardPrePareSetPopupOpen} = this;
const Param803Str = systemParam.Param803Str
if (Param803Str === '') {
const Param853Str = systemParam.Param853
if (Param803Str === '' && Param853Str != '1') {
return true
}
return new Promise((resolve, reject) => {
if (isCheckFireOpen) {
@ -963,6 +969,14 @@ struct UserInfo {
const ygd = msgArr[8];
const ssc = msgArr[13];
const dw = msgArr[28];
if(Param853Str == '1'){
this.avPlayer.playAudio(['voice/熄火.mp3'])
promptAction.showToast({
message: '请熄火',
duration: 4000
})
reject(false)
}
// 开始考试信号检测
if (Param803Str !== '') {
//安全带
@ -1080,7 +1094,7 @@ struct UserInfo {
jkid: '17C51',
}
console.info('surenjunjianguan', JSON.stringify(param))
const temp = await writeObjectOut(param);
const temp = await writeObjectOut(param,false);
globalThis.lsh = this.currentUser.lsh
globalThis.ksyh = this.currentUser.ksy1sfzmhm
return temp
@ -1482,4 +1496,5 @@ type systemParam = {
'Param398': string, //考前上车准备
'Param835': string, //考前上车准备
'Param850': string, //考前上车准备
'Param853': string, //未熄火不能开始考试
}

View File

@ -226,7 +226,7 @@ export default struct DeductedPopup {
kssj: time
},
}
const code = await writeObjectOut(beginData)
const code = await writeObjectOut(beginData,false)
//TODO code待处理
// if (code == 1) {
//
@ -257,7 +257,7 @@ export default struct DeductedPopup {
ksdd: decodeURI(ksdd)
}
};
const code = await writeObjectOut(photoData);
const code = await writeObjectOut(photoData,false);
console.info('surenjun uploadProgressPhoto end',)
}
@ -285,7 +285,7 @@ export default struct DeductedPopup {
kfsj: time
}
}
const code = await writeObjectOut(kfData);
const code = await writeObjectOut(kfData,false);
}
// 项目结束
@ -309,7 +309,7 @@ export default struct DeductedPopup {
jssj: time
}
}
const code = await writeObjectOut(endProjectData);
const code = await writeObjectOut(endProjectData,false);
}
//考试结束
@ -335,7 +335,7 @@ export default struct DeductedPopup {
dwlc: '',
}
}
const code = await writeObjectOut(endData);
const code = await writeObjectOut(endData,false);
}
//获取sysset表数据

View File

@ -1,4 +1,5 @@
import libJudgeSdk from 'libJudgeSdk.so'
//@ts-ignore
// import libJudgeSdk from '@ohos.judgesdk'
/**
@ -12,7 +13,7 @@ import libJudgeSdk from 'libJudgeSdk.so'
*
* @desc
**/
export async function examJudgeVersion(){
export async function examJudgeVersion() {
return await libJudgeSdk.examJudgeVersion();
}
@ -24,29 +25,29 @@ export async function examJudgeVersion(){
* @params callBack
* @desc
*/
export async function examJudgeSetLogCallback(level:number,handleLog:Function):Promise<string>{
const temp = libJudgeSdk.examJudgeSetLogCallback(level,handleLog);
return await handle(temp,'examJudgeSetLogCallback')
export async function examJudgeSetLogCallback(level: number, handleLog: Function): Promise<string> {
const temp = libJudgeSdk.examJudgeSetLogCallback(level, handleLog);
return await handle(temp, 'examJudgeSetLogCallback')
}
/*
*
* @desc评判初始化
*/
export async function examJudgeInit(data){
export async function examJudgeInit(data) {
const str = JSON.stringify(data);
const temp = libJudgeSdk.examJudgeInit(str,str.length);
return await handle(temp,'examJudgeInit')
const temp = libJudgeSdk.examJudgeInit(str, str.length);
return await handle(temp, 'examJudgeInit')
}
/*
*
* @desc
*/
export async function examJudgeRealExam(data){
export async function examJudgeRealExam(data) {
const str = JSON.stringify(data);
const temp = libJudgeSdk.examJudgeRealExam(str,str.length);
return await handle(temp,'examJudgeRealExam')
const temp = libJudgeSdk.examJudgeRealExam(str, str.length);
return await handle(temp, 'examJudgeRealExam')
}
/*
@ -54,18 +55,18 @@ export async function examJudgeRealExam(data){
* @desc
*/
//js_examJudgeSetRealExamCallback
export async function examJudgeSetRealExamCallback(fn){
export async function examJudgeSetRealExamCallback(fn) {
const temp = libJudgeSdk.examJudgeSetRealExamCallback(fn);
return await handle(temp,'examJudgeSetRealExamCallback')
return await handle(temp, 'examJudgeSetRealExamCallback')
}
/*
*
* @desc
*/
export async function examJudgeMapImageSetCallback(fn){
export async function examJudgeMapImageSetCallback(fn) {
const temp = libJudgeSdk.examJudgeMapImageSetCallback(fn);
return await handle(temp,'examJudgeMapImageSetCallback')
return await handle(temp, 'examJudgeMapImageSetCallback')
}
/*
@ -75,14 +76,14 @@ export async function examJudgeMapImageSetCallback(fn){
export async function examJudgeArtificialMark(
//项目代码
itemno:number,
itemno: number,
//扣分代码
serial:string,
serial: string,
//扣分类型number
type:number
){
const temp = libJudgeSdk.examJudgeArtificialMark(itemno,serial,type);
return await handle(temp,'examJudgeArtificialMark')
type: number
) {
const temp = libJudgeSdk.examJudgeArtificialMark(itemno, serial, type);
return await handle(temp, 'examJudgeArtificialMark')
}
/*
@ -91,12 +92,12 @@ export async function examJudgeArtificialMark(
*/
export async function examJudgeArtificialItem(
//项目代码
itemno:number,
itemno: number,
//操作类型
type:number = 0
){
const temp = libJudgeSdk.examJudgeArtificialItem(itemno,type);
return await handle(temp,'examJudgeArtificialMark')
type: number = 0
) {
const temp = libJudgeSdk.examJudgeArtificialItem(itemno, type);
return await handle(temp, 'examJudgeArtificialMark')
}
@ -104,9 +105,9 @@ export async function examJudgeArtificialItem(
*
* @desc
*/
export async function examJudgeMapSetDrawing(fn){
export async function examJudgeMapSetDrawing(fn) {
const temp = libJudgeSdk.examJudgeMapSetDrawing(fn);
return await handle(temp,'examJudgeMapSetDrawing')
return await handle(temp, 'examJudgeMapSetDrawing')
}
@ -114,17 +115,17 @@ export async function examJudgeMapSetDrawing(fn){
*
* @desc开始考试
*/
export async function examJudgeBeginExam(data){
export async function examJudgeBeginExam(data) {
const str = JSON.stringify(data);
const temp = libJudgeSdk.examJudgeBeginExam(str,str.length);
return await handle(temp,'examJudgeBeginExam')
const temp = libJudgeSdk.examJudgeBeginExam(str, str.length);
return await handle(temp, 'examJudgeBeginExam')
}
/* @params levelinfoStrlen
* @desc处理日志文件
*/
export function handleLog(level,infoStr, len){
export function handleLog(level, infoStr, len) {
//TODO
}
@ -132,45 +133,45 @@ export function handleLog(level,infoStr, len){
* @desc结束考试
*
*/
export async function examJudgeEndExam(){
export async function examJudgeEndExam() {
const temp = libJudgeSdk.examJudgeEndExam();
return await handle(temp,'examJudgeEndExam')
return await handle(temp, 'examJudgeEndExam')
}
/*
*@desc examJudgeDestroy
*
*/
export async function examJudgeDestroy(){
export async function examJudgeDestroy() {
const temp = libJudgeSdk.examJudgeDestroy();
return await handle(temp,'examJudgeDestroy')
return await handle(temp, 'examJudgeDestroy')
}
/*
*@desc设置地图轨迹图像参数
*
*/
export async function examJudgeMapSetParam(width:number,height:number){
const temp = libJudgeSdk.examJudgeMapSetParam(width,height );
return await handle(temp,'examJudgeMapSetParam')
export async function examJudgeMapSetParam(width: number, height: number) {
const temp = libJudgeSdk.examJudgeMapSetParam(width, height);
return await handle(temp, 'examJudgeMapSetParam')
}
/*
*@desc设置地图图像缩放系数
*
*/
export async function examJudgeMapSetScaling(scaling?:number){
export async function examJudgeMapSetScaling(scaling?: number) {
const temp = libJudgeSdk.examJudgeMapSetScaling(scaling || 1);
return await handle(temp,'examJudgeMapSetScaling')
return await handle(temp, 'examJudgeMapSetScaling')
}
/*
*@desc设置考试过程数据回调
*
*/
export async function examJudgeSetPerformCallback(fn){
export async function examJudgeSetPerformCallback(fn) {
const temp = libJudgeSdk.examJudgeSetPerformCallback(fn);
return await handle(temp,'examJudgeSetPerformCallback')
return await handle(temp, 'examJudgeSetPerformCallback')
}
/**
@ -179,17 +180,17 @@ export async function examJudgeSetPerformCallback(fn){
* /
*/
export async function examJudgeSoundEnd(param:{
export async function examJudgeSoundEnd(param: {
//项目代码
itemno:number,
itemno: number,
//语音码
code:string,
code: string,
//语音类型
type:number,
}){
type: number,
}) {
const {itemno,code,type} = param;
const temp = libJudgeSdk.examJudgeSoundEnd(itemno,code,type);
return await handle(temp,'examJudgeSoundEnd')
const temp = libJudgeSdk.examJudgeSoundEnd(itemno, code, type);
return await handle(temp, 'examJudgeSoundEnd')
}
/**
@ -197,15 +198,15 @@ export async function examJudgeSoundEnd(param:{
* @desc
*
* */
export async function examCalcGpsDistance(param:{
jd1:number,
wd1:number,
jd2:number,
wd2:number,
h:number
}){
export async function examCalcGpsDistance(param: {
jd1: number,
wd1: number,
jd2: number,
wd2: number,
h: number
}) {
const {jd1,wd1,jd2,wd2,h} = param
const temp = libJudgeSdk.examCalcGpsDistance(jd1,wd1,jd2,wd2,h);
const temp = libJudgeSdk.examCalcGpsDistance(jd1, wd1, jd2, wd2, h);
return await temp;
}
@ -214,13 +215,21 @@ export async function examCalcGpsDistance(param:{
* @desc通用处理函数
*
*/
async function handle(temp,fnName):Promise<string>{
return new Promise((resolve,reject)=>{
if(temp == 0){
async function handle(temp, fnName): Promise<string> {
return new Promise((resolve, reject) => {
if (temp == 0) {
resolve(temp);
}else{
console.log('surenjun error:' + `调用c++函数 ${fnName} 异常:`+ libJudgeSdk.examJudgeErrorInfo(temp*1))
} else {
console.log('surenjun error:' + `调用c++函数 ${fnName} 异常:` + libJudgeSdk.examJudgeErrorInfo(temp * 1))
reject(temp)
}
})
}
/**
* 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

@ -56,6 +56,8 @@ import {
} from './api/index';
import { getSyncData, upDateTableByArray } from '../../common/service/initable';
import { GlobalConfig } from '../../config';
import Want from '@ohos.app.ability.Want';
const judgeTag = 'SURENJUN_JUDGE'
function ifNeedRetry(code: number | string): 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);
}
}
//上传无锡所过程数据
@ -468,6 +470,8 @@ export default class Judge {
//所有的科目考试项目(大车&小车)
private testKmItems: any
private plcData: any
//特殊扣分标记
private specialkf:string = ''
// 获取plc数据
getPlcData = async (plc: string) => {
const {fileLog,mndgStr,rmndg} = this;
@ -526,7 +530,7 @@ export default class Judge {
const bytes = await this.getMessageHeartbeat();
bytes && globalThis.judgeUdp.send(bytes)
}, 50)
}, 1000)
globalThis.judgeTimer = judgeTimer;
}
@ -538,14 +542,14 @@ export default class Judge {
// 调代理接口是否断网了
private isJudgeDisConnect: boolean;
// 项目开始接口同步
beginProject = async (ksxm) => {
beginProject = async (ksxm,xmxh?:string) => {
const carInfo = globalThis.carInfo;
const { examSubject,plateNo } = carInfo;
const {judgeUI,fileLog,getSbbm,xmxh,filePath} = this;
const {judgeUI,fileLog,getSbbm,filePath} = this;
const {lsh,idCard,serialNumber,projectsObj,ksdd,kslx,xldm} = judgeUI
const time = await getCurrentTime();
const project = projectsObj[ksxm]
const sbxh = getSbbm(ksxm, xmxh)
const sbxh = getSbbm(ksxm, xmxh || this.xmxh)
const data = {
//系统类别 接口序列号 接口标识
xtlb: '17', jkxlh: serialNumber, jkid: '17C52',
@ -572,15 +576,15 @@ export default class Judge {
promptWxCode('17C52', code)
}
// 项目结束接口同步
endProject = async (ksxm) => {
endProject = async (ksxm,xmxh?:string) => {
const carInfo = globalThis.carInfo;
const deviceNo = globalThis.deviceNo;
const { examSubject,plateNo,carNo } = carInfo;
const {judgeUI,fileLog,getSbxh,xmxh,getSbbm,filePath} = this;
const {judgeUI,fileLog,getSbxh,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)
const sbxh = examSubject == 3 ? undefined : getSbbm(ksxm, xmxh || this.xmxh)
const data = {
xtlb: '17', jkxlh: serialNumber, jkid: '17C55',
@ -600,6 +604,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;
}
@ -613,10 +623,12 @@ export default class Judge {
private videoData: any
private disConnectNum: number = 0;
//调用监管接口
private externalTransmission: boolean = false
// 计算是否启动
private whetherToStart: boolean
//调用监管接口
sendWriteObjectOut = async (data, filePath) => {
const temp = await writeObjectOut(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))
@ -633,12 +645,34 @@ export default class Judge {
}
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
@ -833,15 +867,15 @@ export default class Judge {
xmdm: xmdm * 1, kfdm
}
})) : [],
//TODO 已考里程待修改
yklc: 0,
yklc: judgeUI.yklc,
special: [],
//TODO 科目三参数临时写死
sczb: (sczb === undefined || sczb == 0) ? 0 : 1,
sczbkf: kfdm,
dmndg: false,
mfxx: false,
mfxxn: false
mfxxn: false,
//科目三特殊扣分项
specialkf:judgeUI.specialkf,
}
console.info(judgeTag, '5.获取开始考试数据完成')
return beginInfo
@ -1066,7 +1100,7 @@ export default class Judge {
if (!isEnd) {
judgeTask.addTask(async () => {
console.info(judgeTag, `项目开始-${xmdm}-${projectsObj[xmdm].name}`)
await beginProject(xmdm)
await beginProject(xmdm,xmxh)
}, {
isDelay: true
})
@ -1095,7 +1129,7 @@ export default class Judge {
if (!projectIsEnd) {
judgeTask.addTask(async () => {
console.info(judgeTag, `项目结束-${xmdm}-${projectsObj[xmdm].name}`)
await endProject(xmdm);
await endProject(xmdm,xmxh)
this.xmmcSingleCode = 0;
this.xmmcEndCode = undefined;
}, {
@ -1173,8 +1207,8 @@ export default class Judge {
const {lsh,idCard,serialNumber,ksdd,projectsObj} = judgeUI
const time = await getCurrentTime();
const project = getProjectInfo(ksxm);
//科目三夜间行驶.模拟灯光、上车准备出现通用评判ksxm为当前进行的项目
const checkProjects = ['17', '41', '1'];
//科目三夜间行驶.模拟灯光、上车准备出现非本项目的扣分ksxm需转换为为当前进行的项目
const checkProjects = ['1', '41', '17'];
//获取正在进行的项目
const inProjects = Reflect.ownKeys(projectsObj).filter(projectKey => projectsObj[projectKey].type == 2);
@ -1184,7 +1218,8 @@ export default class Judge {
commonKsxm = projectCode
}
})
console.info(judgeTag, 'commonKsxm=>' + commonKsxm)
console.info(judgeTag, 'project=>' + project)
const data = {
xtlb: '17', jkxlh: serialNumber, jkid: '17C53',
drvexam: {
@ -1194,7 +1229,7 @@ export default class Judge {
? (commonKsxm
? (projectsObj[commonKsxm].projectCodeCenter)
: (examSubject == 3 ? 30000 : (xmmcEndCode == undefined ? 10000 : xmmcEndCode)))
: project.projectCodeCenter,
: (projectsObj[commonKsxm]?.projectCodeCenter || project.projectCodeCenter),
kfxm: kf.markcatalog,
kfxmmx: `${ksxm},${kf.markserial}`,
sfzmhm: idCard,
@ -1714,7 +1749,7 @@ export default class Judge {
// 检测差分状态
checkDwzt = async (type) => {
const {avPlayer} = this;
const judgeConfig = this.judgeUI.judgeConfig;
const config499 = this.judgeUI.judgeConfigObj['499'];
switch (type) {
case 0:
this.judgeUI.isDwztRight = true;
@ -1722,10 +1757,17 @@ export default class Judge {
case 1:
this.judgeUI.dwztErrorVisible = true;
clearInterval(this.judgeUI.timer);
clearInterval(globalThis.judgeTimer)
avPlayer.playAudio([`voice/差分状态异常.mp3`], true)
setTimeout(() => {
router.back()
}, 3000)
try {
this.checkExamIsEnd(true);
} catch (e) {
this.closeAllFiles()
router.back()
}
}, config499 * 1000)
break;
case 2:
@ -1810,6 +1852,7 @@ export default class Judge {
this.handleRealExam(strData, callBack)
})
await examJudgeSetPerformCallback(async (info) => {
console.info('评判实时数据', info)
const performInfo = JSON.parse(info)
@ -1821,6 +1864,11 @@ 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.开始考试

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

@ -1,46 +1,30 @@
import FileUtil from '../../../common/utils/File'
import { takePhoto } from '../../../common/service/videoService';
import promptAction from '@ohos.promptAction';
import {judgeConfig} from './judgeConfig'
import { judgeConfig } from './judgeConfig'
interface Params{
userName:string
pwd:string
ip:string
port:string
rlls:string
pztd:string
interface Params {
userName: string
pwd: string
ip: string
port: string
rlls: string
pztd: string
}
export default class FilePhoto{
private params:Params
private context:any
private fileUtil:FileUtil
export default class FilePhoto {
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
})()
}
private params: Params
private context: any
public getPhoto = async () => {
const {params} = this;
if(!judgeConfig.isPhotoOpen){
const { params } = this;
if (!judgeConfig.isPhotoOpen) {
return ''
}else{
} else {
try {
console.info('surenjun','拍照开始')
const res = await takePhoto(params, this.context, 'pz/',2);
console.info('surenjun','拍照结束' + JSON.stringify(res))
console.info('surenjun', '拍照开始')
const res = await takePhoto(params, this.context, 'pz/', 2);
console.info('surenjun', '拍照结束' + JSON.stringify(res))
return res.base64
} catch (e) {
console.error('surenjun =>拍照异常' + JSON.stringify(e))
@ -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,
//是否开启拍照
@ -8,22 +9,22 @@ export const judgeConfig = {
//扣分语音是否强制开启
kfVoiceOpen: false,
//忽略的考试项目
ignoreProjects:[],
ignoreProjects: [],
// 是否忽略考试前熄火、车门检查
isCheckFireOpen: false,
//轨迹回放是否开启Udp
udpOpen:true,
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:{
fourInOneScreen: {
//gps位数
gpsDigit:7
gpsDigit: 6
},
// 杭州科目二
// trajectoryPath: 'logs/2024_07_19/0000000000001_342323199501470011_测试学员1_2024_07_19_06_49_12/judge_exam_data.txt',
//TODO 济南临时特殊配置
systemParamConfig:{}
systemParamConfig: {}
}