Compare commits
2 Commits
33bb420725
...
6edece72d9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6edece72d9 | ||
|
|
cf0f2de7ab |
7
Makefile
7
Makefile
@ -1,2 +1,7 @@
|
|||||||
gitLog:
|
gitLog:
|
||||||
git log --since="2025-07-16 10:00" --until="2025-07-22 10:00" --pretty=format:"<details>%n <summary>%s</summary>%n <span style=\"color: #888;\">[提交人]:</span><span style=\"color: #333;\">%an</span><br>%n <span style=\"color: #888;\">[提交时间]:</span><span style=\"color: #333;\">%ad</span><br>%n <span style=\"color: #888;\">[提交版本]:</span><span style=\"color: #333;\">%h</span>%n</details>%n" --date=format:"%Y-%m-%d %H:%M" > release_note.md
|
git log --since="2025-07-16 10:00" --until="2025-07-22 10:00" --pretty=format:"<details>%n <summary>%s</summary>%n <span style=\"color: #888;\">[提交人]:</span><span style=\"color: #333;\">%an</span><br>%n <span style=\"color: #888;\">[提交时间]:</span><span style=\"color: #333;\">%ad</span><br>%n <span style=\"color: #888;\">[提交版本]:</span><span style=\"color: #333;\">%h</span>%n</details>%n" --date=format:"%Y-%m-%d %H:%M" > release_note.md
|
||||||
|
re:
|
||||||
|
hdc shell mount -o remount,rw /
|
||||||
|
pushJudge:
|
||||||
|
hdc file send /Users/wangzhongjie/Desktop/duolun/openHarmony/car_next/ohos/so/libjudgesdk.z.so /system/lib/module/
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -4,9 +4,6 @@
|
|||||||
"description": "Please describe the basic information.",
|
"description": "Please describe the basic information.",
|
||||||
"main": "",
|
"main": "",
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "",
|
"license": ""
|
||||||
"dependencies": {
|
|
||||||
"libjudgesdk.so": "file:./src/cpp/libJudgeSdk"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
38
entry/src/cpp/libJudgeSdk/Index.d.ts
vendored
38
entry/src/cpp/libJudgeSdk/Index.d.ts
vendored
@ -1,38 +0,0 @@
|
|||||||
export const examJudgeVersion: () => string;
|
|
||||||
|
|
||||||
export const examJudgeInit: (data: string, len: number) => number
|
|
||||||
|
|
||||||
export const examJudgeSetLogCallback: (level: number, handle: Function) => number
|
|
||||||
|
|
||||||
export const examJudgeRealExam: (plc: string, len: number) => number
|
|
||||||
|
|
||||||
export const examJudgeSetRealExamCallback: (callback: Function) => number
|
|
||||||
|
|
||||||
export const examJudgeMapImageSetCallback: (callback: Function) => number
|
|
||||||
|
|
||||||
export const examJudgeArtificialMark: (no: number, serial: string, type: number) => number
|
|
||||||
|
|
||||||
export const examJudgeArtificialItem: (no: number, type: number) => number
|
|
||||||
|
|
||||||
export const examJudgeMapSetDrawing: (flag: boolean) => number
|
|
||||||
|
|
||||||
export const examJudgeBeginExam: (data: string, len: number) => number
|
|
||||||
|
|
||||||
export const examJudgeEndExam: () => number
|
|
||||||
|
|
||||||
export const examJudgeDestroy: () => number
|
|
||||||
|
|
||||||
export const examJudgeMapSetParam: (width: number, height: number) => number
|
|
||||||
|
|
||||||
export const examJudgeMapSetScaling: (scale: number) => number
|
|
||||||
|
|
||||||
export const examJudgeSetPerformCallback: (callback: Function) => number
|
|
||||||
|
|
||||||
export const examJudgeSoundEnd: (no: number, code: string, type: number) => number
|
|
||||||
|
|
||||||
export const examCalcGpsDistance: (lng1: number, lat1: number, lng2: number, lat2: number, height: number) => number
|
|
||||||
|
|
||||||
export const examJudgeErrorInfo: (level: number) => number
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "libjudgesdk.so",
|
|
||||||
"types": "./Index.d.ts",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"description": "Please describe the basic information."
|
|
||||||
}
|
|
||||||
@ -1,4 +1,5 @@
|
|||||||
import { AmplifyItem, DefaultJudgeConfigObj, PerLane, PLCType } from '../model';
|
import { AmplifyItem, DefaultJudgeConfigObj, PerLane, PLCType } from '../model';
|
||||||
|
import dayTs from '../utils/Date';
|
||||||
|
|
||||||
export const AmplifyArr: AmplifyItem[] = [
|
export const AmplifyArr: AmplifyItem[] = [
|
||||||
{ name: '直线', projectCode: '3', projectCodeCenter: '40300' },
|
{ name: '直线', projectCode: '3', projectCodeCenter: '40300' },
|
||||||
@ -242,6 +243,7 @@ export const TestRealExam: PLCType = {
|
|||||||
},
|
},
|
||||||
extend: {}
|
extend: {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DefaultJudgeConfigData: DefaultJudgeConfigObj = {
|
export const DefaultJudgeConfigData: DefaultJudgeConfigObj = {
|
||||||
//结束考试方式 0-不合格继续 1-考试不合格报靠边停车 2-不合格不报靠边 3-训练不合格报靠边 4-自动退出 5-不合格自动退出
|
//结束考试方式 0-不合格继续 1-考试不合格报靠边停车 2-不合格不报靠边 3-训练不合格报靠边 4-自动退出 5-不合格自动退出
|
||||||
param_302: '5',
|
param_302: '5',
|
||||||
|
|||||||
@ -148,16 +148,14 @@ struct JudgePage {
|
|||||||
@State isErrorMsgEnd: boolean = false
|
@State isErrorMsgEnd: boolean = false
|
||||||
@State disConnectErrorOpen: boolean = false
|
@State disConnectErrorOpen: boolean = false
|
||||||
@State @Watch("laneSignalChange") laneSignal: PerLane = InitialPerLane
|
@State @Watch("laneSignalChange") laneSignal: PerLane = InitialPerLane
|
||||||
|
laneSignalChange(){
|
||||||
laneSignalChange() {
|
dConsole.log("车道信号变化1",this.laneSignal)
|
||||||
dConsole.log("车道信号变化1", this.laneSignal)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public context = getContext(this) as common.UIAbilityContext;
|
public context = getContext(this) as common.UIAbilityContext;
|
||||||
// 信号查看弹窗
|
// 信号查看弹窗
|
||||||
signalTrajectoryDialogController: CustomDialogController = new CustomDialogController({
|
signalTrajectoryDialogController: CustomDialogController = new CustomDialogController({
|
||||||
builder: SignalTrajectoryDialog({
|
builder: SignalTrajectoryDialog({
|
||||||
laneSignal: this.laneSignal
|
laneSignal: $laneSignal
|
||||||
}),
|
}),
|
||||||
customStyle: true,
|
customStyle: true,
|
||||||
autoCancel: true
|
autoCancel: true
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import libJudgeSdk from 'libjudgesdk.so';
|
import libJudgeSdk from '@ohos.judgesdk';
|
||||||
import { JudgeBeginObj, JudgeInitObj, PLCType } from '../../model';
|
import { JudgeBeginObj, JudgeInitObj, PLCType } from '../../model';
|
||||||
import { dConsole } from '../../utils/LogWorker';
|
import { dConsole } from '../../utils/LogWorker';
|
||||||
|
|
||||||
@ -35,7 +35,6 @@ export async function examJudgeSetLogCallback(level: number, handleLog: Function
|
|||||||
* @desc评判初始化
|
* @desc评判初始化
|
||||||
*/
|
*/
|
||||||
export async function examJudgeInit(data: JudgeInitObj) {
|
export async function examJudgeInit(data: JudgeInitObj) {
|
||||||
|
|
||||||
const str = JSON.stringify(data);
|
const str = JSON.stringify(data);
|
||||||
const temp: number = libJudgeSdk.examJudgeInit(str, str.length);
|
const temp: number = libJudgeSdk.examJudgeInit(str, str.length);
|
||||||
return await handle(temp, 'examJudgeInit')
|
return await handle(temp, 'examJudgeInit')
|
||||||
|
|||||||
@ -6,8 +6,11 @@ import TabComponent from '../compontents/Tab'
|
|||||||
@CustomDialog
|
@CustomDialog
|
||||||
export default struct SignalTrajectoryDialog {
|
export default struct SignalTrajectoryDialog {
|
||||||
@State active: number = 0
|
@State active: number = 0
|
||||||
@Link laneSignal: PerLane
|
@Link @Watch("laneSignalChange") laneSignal: PerLane
|
||||||
|
|
||||||
|
laneSignalChange() {
|
||||||
|
dConsole.log("车道信号变化222", this.laneSignal)
|
||||||
|
}
|
||||||
|
|
||||||
private controller?: CustomDialogController
|
private controller?: CustomDialogController
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
import SignalDisplayComponent from './compontents/SignalDisplay';
|
import SignalDisplayComponent from './compontents/SignalDisplay';
|
||||||
import router from '@ohos.router';
|
import router from '@ohos.router';
|
||||||
import TabComponent from './compontents/Tab';
|
import TabComponent from './compontents/Tab';
|
||||||
import { InitialPerLane } from '../mock';
|
import { PerLane } from '../model';
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
struct SignDisplayPage {
|
struct SignDisplayPage {
|
||||||
@State active: number = 0
|
@State active: number = 0
|
||||||
|
@Link laneSignal: PerLane
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
Flex({
|
Flex({
|
||||||
@ -43,7 +44,7 @@ struct SignDisplayPage {
|
|||||||
|
|
||||||
SignalDisplayComponent({
|
SignalDisplayComponent({
|
||||||
active: this.active,
|
active: this.active,
|
||||||
laneSignal: InitialPerLane
|
laneSignal: this.laneSignal
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
.width('100%')
|
.width('100%')
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { GPSData, InitialPerLane, SignalData } from '../../mock'
|
import { GPSData, SignalData } from '../../mock';
|
||||||
import {
|
import {
|
||||||
EnvironmentConfigurationType,
|
EnvironmentConfigurationType,
|
||||||
PerLane,
|
PerLane,
|
||||||
@ -6,13 +6,14 @@ import {
|
|||||||
SignalDataType,
|
SignalDataType,
|
||||||
WorkerBackMessage,
|
WorkerBackMessage,
|
||||||
WorkerBackMessageType
|
WorkerBackMessageType
|
||||||
} from '../../model'
|
} from '../../model';
|
||||||
import apiJudgeSdk from 'libJudgeSdk.so'
|
// import apiJudgeSdk from 'libJudgeSdk.so'
|
||||||
|
import apiJudgeSdk from '@ohos.judgesdk';
|
||||||
|
|
||||||
import { DifferentialAndSignal } from '../../utils/business/DifferentialAndSignalWorker'
|
import { DifferentialAndSignal } from '../../utils/business/DifferentialAndSignalWorker';
|
||||||
import { examJudgeMapSetScaling } from '../Judge/JudgeUtils'
|
import { examJudgeMapSetScaling } from '../Judge/JudgeUtils';
|
||||||
import { dConsole } from '../../utils/LogWorker'
|
import { dConsole } from '../../utils/LogWorker';
|
||||||
import { SignDisplayTag } from '../../config'
|
import { SignDisplayTag } from '../../config';
|
||||||
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@ -28,10 +29,10 @@ export default struct SignalDisplayComponent {
|
|||||||
// 原始数据
|
// 原始数据
|
||||||
@State rawData: string = "$GPS,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"
|
@State rawData: string = "$GPS,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"
|
||||||
// 车道信息
|
// 车道信息
|
||||||
@Link @Watch("laneSignalChange") laneSignal: PerLane
|
@Link @Watch("laneSignalChange") laneSignal: PerLane
|
||||||
|
|
||||||
laneSignalChange(){
|
laneSignalChange() {
|
||||||
dConsole.log("车道信号变化3",this.laneSignal)
|
dConsole.log("车道信号变化333", this.laneSignal)
|
||||||
}
|
}
|
||||||
|
|
||||||
aboutToAppear(): void {
|
aboutToAppear(): void {
|
||||||
@ -225,7 +226,7 @@ struct trajectoryComponent {
|
|||||||
|
|
||||||
@Component
|
@Component
|
||||||
struct LaneComponent {
|
struct LaneComponent {
|
||||||
@Prop laneSignal: PerLane
|
@Link laneSignal: PerLane
|
||||||
private RoadData: Array<RoadDataType> = [
|
private RoadData: Array<RoadDataType> = [
|
||||||
{ name: '路段组号', key: 'MapRoad_Code_No' },
|
{ name: '路段组号', key: 'MapRoad_Code_No' },
|
||||||
{ name: '路段编码', key: 'MapRoad_Name' },
|
{ name: '路段编码', key: 'MapRoad_Name' },
|
||||||
|
|||||||
@ -87,7 +87,6 @@ type SendWriteObjectOut = (data: RegulatoryInterfaceParams, filePath: string) =>
|
|||||||
type GetKfStr = (code: string) => MarkRule
|
type GetKfStr = (code: string) => MarkRule
|
||||||
type GetDqxmStr = (xmdm: number) => string
|
type GetDqxmStr = (xmdm: number) => string
|
||||||
|
|
||||||
|
|
||||||
export default class Judge {
|
export default class Judge {
|
||||||
public plcStr: string = ""
|
public plcStr: string = ""
|
||||||
public judgeUI: JudgeUI
|
public judgeUI: JudgeUI
|
||||||
@ -185,6 +184,47 @@ export default class Judge {
|
|||||||
private isExamEnd: boolean
|
private isExamEnd: boolean
|
||||||
// 是否发送udp
|
// 是否发送udp
|
||||||
private isUdpEnd: boolean = false
|
private isUdpEnd: boolean = false
|
||||||
|
// 处理udp plc信号
|
||||||
|
handleUdp = async (msg: string) => {
|
||||||
|
const stachArr = msg.split(',')
|
||||||
|
if (stachArr[0] != '#DN_GD' || this.isUdpEnd) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const gpsPart = msg.split("#END$GPS,")[1];
|
||||||
|
const gpsStatus = gpsPart.split(",")[0];
|
||||||
|
if (gpsStatus === "4") {
|
||||||
|
dConsole.log(JudgeTag, "差分状态正常", gpsStatus)
|
||||||
|
this.judgeUI.isDwztRight = true
|
||||||
|
} else {
|
||||||
|
dConsole.log(JudgeTag, "差分状态异常", gpsStatus)
|
||||||
|
this.judgeUI.isDwztRight = false
|
||||||
|
}
|
||||||
|
this.judgeUI.isDwztRight
|
||||||
|
const plcData = await this.getPlcData(msg);
|
||||||
|
// 4.过程数据
|
||||||
|
await this.fileLog?.setExamJudgeData(JSON.stringify(plcData))
|
||||||
|
//检测到有无锡所设备接入,需要发送特定的数据,供检测
|
||||||
|
// if (this.usbService.isWXUSBDevice) {
|
||||||
|
// const str = await senorToWXDataStr(msg);
|
||||||
|
// this.usbService.sendUSB(str)
|
||||||
|
// }
|
||||||
|
const param350: number = Reflect.get(this.judgeUI.judgeConfigObj, '350')
|
||||||
|
this.judgeUI.sd = ((param350 == 0 ? plcData.gps.sd : plcData.sensor.cs) as number * 1.852).toFixed(0) + ''
|
||||||
|
this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + ''
|
||||||
|
//TODO 暂时关闭差分检测异常
|
||||||
|
// await this.checkDwzt(plcData.gps.dwzt,plcData.gps.jdzt);
|
||||||
|
if (!this.isExamEnd) {
|
||||||
|
await examJudgeRealExam(plcData)
|
||||||
|
}
|
||||||
|
// let udpIndex = AppStorage.get<number>('udpIndex') || 0;
|
||||||
|
// if (udpIndex % 5 === 0 && !this.isUdpEnd) {
|
||||||
|
// TODO UPD缺失
|
||||||
|
// const judgeUdp = globalThis.judgeUdp
|
||||||
|
// const bytes = await this.getMessageHeartbeat(this.isExamEnd);
|
||||||
|
// judgeUdp.send(bytes)
|
||||||
|
// }
|
||||||
|
// AppStorage.setOrCreate('udpIndex', udpIndex++)
|
||||||
|
}
|
||||||
//是否手动结束考试
|
//是否手动结束考试
|
||||||
private isManual: boolean = false
|
private isManual: boolean = false
|
||||||
//UDP服务序列号
|
//UDP服务序列号
|
||||||
@ -231,6 +271,60 @@ export default class Judge {
|
|||||||
dConsole.info(JudgeTag, '过程数据文件上传 end')
|
dConsole.info(JudgeTag, '过程数据文件上传 end')
|
||||||
}
|
}
|
||||||
private judgeTask: JudgeTask
|
private judgeTask: JudgeTask
|
||||||
|
// 检测扣分、结束项目时该项目是否开始
|
||||||
|
checkProjectIsStart = async (xmdm: number, currentType: 1 | 2, kf?: MarkRule) => {
|
||||||
|
if (xmdm == 20) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
const judgeUI = this.judgeUI;
|
||||||
|
const judgeTask = this.judgeTask;
|
||||||
|
const projectsObj: object = this.judgeUI.projectsObj
|
||||||
|
const currentProject: ProjectInfo = Reflect.get(projectsObj, xmdm)
|
||||||
|
const isUpload = currentProject.isUpload
|
||||||
|
|
||||||
|
//如果项目没有开始
|
||||||
|
dConsole.info(JudgeTag, 'surenjun isUpload=>', isUpload)
|
||||||
|
if (!isUpload) {
|
||||||
|
dConsole.info(JudgeTag, '项目补传开始')
|
||||||
|
//项目开始补传
|
||||||
|
judgeTask.addTask(async () => {
|
||||||
|
await this.beginProject(xmdm)
|
||||||
|
}, {
|
||||||
|
isDelay: true
|
||||||
|
})
|
||||||
|
judgeTask.addTask(async () => {
|
||||||
|
await this.uploadProgressPhoto(xmdm)
|
||||||
|
}, {
|
||||||
|
isDelay: true
|
||||||
|
})
|
||||||
|
currentProject.isUpload = true;
|
||||||
|
Reflect.set(this.judgeUI.projectsObj, xmdm, currentProject)
|
||||||
|
//扣分补传
|
||||||
|
if (currentType == 2) {
|
||||||
|
judgeTask.addTask(async () => {
|
||||||
|
await this.pointsDedute(xmdm, kf!)
|
||||||
|
}, {
|
||||||
|
isDelay: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//扣分补传判断是否合格 不合格补传项目结束
|
||||||
|
if (currentType == 1 || (currentType == 2 && this.totalScore < judgeUI.passingScore)) {
|
||||||
|
judgeTask.addTask(async () => {
|
||||||
|
await this.endProject(xmdm)
|
||||||
|
}, {
|
||||||
|
isDelay: true
|
||||||
|
})
|
||||||
|
currentProject.isEnd = true;
|
||||||
|
Reflect.set(this.judgeUI.projectsObj, xmdm, currentProject)
|
||||||
|
}
|
||||||
|
judgeTask.addTask(async () => {
|
||||||
|
this.checkExamIsEnd()
|
||||||
|
})
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
private tempData?: PLCType
|
private tempData?: PLCType
|
||||||
//实时计算gps经纬度距离
|
//实时计算gps经纬度距离
|
||||||
handDistance = async () => {
|
handDistance = async () => {
|
||||||
@ -279,46 +373,40 @@ export default class Judge {
|
|||||||
AppStorage.setOrCreate('msgStr', plc)
|
AppStorage.setOrCreate('msgStr', plc)
|
||||||
return tempData
|
return tempData
|
||||||
}
|
}
|
||||||
// 处理udp plc信号
|
// 处理轨迹plc信号
|
||||||
handleUdp = async (msg: string) => {
|
handleTrajectoryUdp = async (strArr: string[]) => {
|
||||||
const stachArr = msg.split(',')
|
let num = 2;
|
||||||
if (stachArr[0] != '#DN_GD' || this.isUdpEnd) {
|
const judgeTimer = setInterval(async () => {
|
||||||
return
|
const msgStr = strArr[num];
|
||||||
}
|
if (msgStr == '') {
|
||||||
const gpsPart = msg.split("#END$GPS,")[1];
|
dConsole.info(JudgeTag, '模拟数据考试结束')
|
||||||
const gpsStatus = gpsPart.split(",")[0];
|
clearInterval(judgeTimer)
|
||||||
if (gpsStatus === "4") {
|
this.checkExamIsEnd(true)
|
||||||
dConsole.log(JudgeTag, "差分状态正常", gpsStatus)
|
return
|
||||||
this.judgeUI.isDwztRight = true
|
}
|
||||||
} else {
|
const msg: PLCType = JSON.parse(strArr[num]);
|
||||||
dConsole.log(JudgeTag, "差分状态异常", gpsStatus)
|
num++
|
||||||
this.judgeUI.isDwztRight = false
|
// 4.过程数据
|
||||||
}
|
this.tempData = msg
|
||||||
this.judgeUI.isDwztRight
|
// this.judgeUI.isDwztRight = (msg?.gps?.dwzt == 4 && msg?.gps?.jdzt == 3);
|
||||||
const plcData = await this.getPlcData(msg);
|
this.judgeUI.sd = Math.floor(msg?.gps?.sd * 1.852) + '';
|
||||||
// 4.过程数据
|
this.judgeUI.dw = Math.floor(msg?.sensor?.dw) + ''
|
||||||
await this.fileLog?.setExamJudgeData(JSON.stringify(plcData))
|
this.plcData = msg
|
||||||
//检测到有无锡所设备接入,需要发送特定的数据,供检测
|
// this.judgeUI.isDwztRight = msg.gps.dwzt == 4;
|
||||||
// if (this.usbService.isWXUSBDevice) {
|
AppStorage.setOrCreate('msgStr', '')
|
||||||
// const str = await senorToWXDataStr(msg);
|
if (msg.method === 'examJudgeArtificialItem') {
|
||||||
// this.usbService.sendUSB(str)
|
this.setJudgeItem(msg.itemno, msg.type)
|
||||||
// }
|
}
|
||||||
const param350: number = Reflect.get(this.judgeUI.judgeConfigObj, '350')
|
if (msg.method === 'examJudgeArtificialMark') {
|
||||||
this.judgeUI.sd = ((param350 == 0 ? plcData.gps.sd : plcData.sensor.cs) as number * 1.852).toFixed(0) + ''
|
this.setJudgeItem(msg.itemno, msg.serial)
|
||||||
this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + ''
|
}
|
||||||
//TODO 暂时关闭差分检测异常
|
await examJudgeRealExam(msg)
|
||||||
// await this.checkDwzt(plcData.gps.dwzt,plcData.gps.jdzt);
|
// const bytes = await this.getMessageHeartbeat();
|
||||||
if (!this.isExamEnd) {
|
// bytes && globalThis.judgeUdp.send(bytes)
|
||||||
await examJudgeRealExam(plcData)
|
|
||||||
}
|
}, 200)
|
||||||
// let udpIndex = AppStorage.get<number>('udpIndex') || 0;
|
// TODO 定时器缺失
|
||||||
// if (udpIndex % 5 === 0 && !this.isUdpEnd) {
|
// globalThis.judgeTimer = judgeTimer;
|
||||||
// TODO UPD缺失
|
|
||||||
// const judgeUdp = globalThis.judgeUdp
|
|
||||||
// const bytes = await this.getMessageHeartbeat(this.isExamEnd);
|
|
||||||
// judgeUdp.send(bytes)
|
|
||||||
// }
|
|
||||||
// AppStorage.setOrCreate('udpIndex', udpIndex++)
|
|
||||||
}
|
}
|
||||||
private isEndTip: boolean = false;
|
private isEndTip: boolean = false;
|
||||||
//本地轨迹回放地址
|
//本地轨迹回放地址
|
||||||
@ -339,32 +427,6 @@ export default class Judge {
|
|||||||
const code = await writeObjectOut(JSON.parse(examDataStr), "", this.context);
|
const code = await writeObjectOut(JSON.parse(examDataStr), "", this.context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private artSubject3ProjectsCodesArr: number[] = [3, 9, 4, 10, 12, 11]
|
|
||||||
private lane: LANE = {
|
|
||||||
road: '', num: 0, count: 0
|
|
||||||
}
|
|
||||||
private disConnectNum: number = 0;
|
|
||||||
//调用监管接口
|
|
||||||
sendWriteObjectOut: SendWriteObjectOut = async (data, filePath) => {
|
|
||||||
const temp = await writeObjectOut(data, filePath, this.context);
|
|
||||||
dConsole.log(JudgeTag, "wzj", JSON.stringify(temp))
|
|
||||||
//断网&网络超时次数计算
|
|
||||||
if (temp.code == 2300007 || temp.code == 2300028) {
|
|
||||||
this.disConnectNum += 1;
|
|
||||||
if (this.disConnectNum < 5) {
|
|
||||||
return await this.sendWriteObjectOut(data, filePath)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.disConnectNum >= 5) {
|
|
||||||
dConsole.info('surenjun', '123')
|
|
||||||
this.judgeUI.errorMsg = '当前的考试过程信息网络传输异常,程序点击确认将重启!';
|
|
||||||
this.judgeUI.disConnectErrorOpen = true
|
|
||||||
}
|
|
||||||
|
|
||||||
this.disConnectNum = 0
|
|
||||||
return temp
|
|
||||||
}
|
|
||||||
// 项目开始接口同步
|
// 项目开始接口同步
|
||||||
beginProject = async (ksxm: number) => {
|
beginProject = async (ksxm: number) => {
|
||||||
const carInfo = AppStorage.get<CarInfoType>('carInfo');
|
const carInfo = AppStorage.get<CarInfoType>('carInfo');
|
||||||
@ -468,6 +530,32 @@ export default class Judge {
|
|||||||
UploadRegulatoryCodeConversion('17C54', temp.code || 0)
|
UploadRegulatoryCodeConversion('17C54', temp.code || 0)
|
||||||
dConsole.info(JudgeTag, '上传照片 end')
|
dConsole.info(JudgeTag, '上传照片 end')
|
||||||
}
|
}
|
||||||
|
private artSubject3ProjectsCodesArr: number[] = [3, 9, 4, 10, 12, 11]
|
||||||
|
private lane: LANE = {
|
||||||
|
road: '', num: 0, count: 0
|
||||||
|
}
|
||||||
|
private disConnectNum: number = 0;
|
||||||
|
//调用监管接口
|
||||||
|
sendWriteObjectOut: SendWriteObjectOut = async (data, filePath) => {
|
||||||
|
const temp = await writeObjectOut(data, filePath, this.context);
|
||||||
|
dConsole.log(JudgeTag, "wzj", JSON.stringify(temp))
|
||||||
|
//断网&网络超时次数计算
|
||||||
|
if (temp.code == 2300007 || temp.code == 2300028) {
|
||||||
|
this.disConnectNum += 1;
|
||||||
|
if (this.disConnectNum < 5) {
|
||||||
|
return await this.sendWriteObjectOut(data, filePath)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.disConnectNum >= 5) {
|
||||||
|
dConsole.info('surenjun', '123')
|
||||||
|
this.judgeUI.errorMsg = '当前的考试过程信息网络传输异常,程序点击确认将重启!';
|
||||||
|
this.judgeUI.disConnectErrorOpen = true
|
||||||
|
}
|
||||||
|
|
||||||
|
this.disConnectNum = 0
|
||||||
|
return temp
|
||||||
|
}
|
||||||
private videoData?: RecordHandleType
|
private videoData?: RecordHandleType
|
||||||
//当前科目二的考试项目
|
//当前科目二的考试项目
|
||||||
private deductedPopShowTimer: number = 0;
|
private deductedPopShowTimer: number = 0;
|
||||||
@ -586,95 +674,6 @@ export default class Judge {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 处理轨迹plc信号
|
|
||||||
handleTrajectoryUdp = async (strArr: string[]) => {
|
|
||||||
let num = 2;
|
|
||||||
const judgeTimer = setInterval(async () => {
|
|
||||||
const msgStr = strArr[num];
|
|
||||||
if (msgStr == '') {
|
|
||||||
dConsole.info(JudgeTag, '模拟数据考试结束')
|
|
||||||
clearInterval(judgeTimer)
|
|
||||||
this.checkExamIsEnd(true)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const msg: PLCType = JSON.parse(strArr[num]);
|
|
||||||
num++
|
|
||||||
// 4.过程数据
|
|
||||||
this.tempData = msg
|
|
||||||
// this.judgeUI.isDwztRight = (msg?.gps?.dwzt == 4 && msg?.gps?.jdzt == 3);
|
|
||||||
this.judgeUI.sd = Math.floor(msg?.gps?.sd * 1.852) + '';
|
|
||||||
this.judgeUI.dw = Math.floor(msg?.sensor?.dw) + ''
|
|
||||||
this.plcData = msg
|
|
||||||
// this.judgeUI.isDwztRight = msg.gps.dwzt == 4;
|
|
||||||
AppStorage.setOrCreate('msgStr', '')
|
|
||||||
if (msg.method === 'examJudgeArtificialItem') {
|
|
||||||
this.setJudgeItem(msg.itemno, msg.type)
|
|
||||||
}
|
|
||||||
if (msg.method === 'examJudgeArtificialMark') {
|
|
||||||
this.setJudgeItem(msg.itemno, msg.serial)
|
|
||||||
}
|
|
||||||
await examJudgeRealExam(msg)
|
|
||||||
// const bytes = await this.getMessageHeartbeat();
|
|
||||||
// bytes && globalThis.judgeUdp.send(bytes)
|
|
||||||
|
|
||||||
}, 200)
|
|
||||||
// TODO 定时器缺失
|
|
||||||
// globalThis.judgeTimer = judgeTimer;
|
|
||||||
}
|
|
||||||
// 检测扣分、结束项目时该项目是否开始
|
|
||||||
checkProjectIsStart = async (xmdm: number, currentType: 1 | 2, kf?: MarkRule) => {
|
|
||||||
if (xmdm == 20) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
const judgeUI = this.judgeUI;
|
|
||||||
const judgeTask = this.judgeTask;
|
|
||||||
const projectsObj: object = this.judgeUI.projectsObj
|
|
||||||
const currentProject: ProjectInfo = Reflect.get(projectsObj, xmdm)
|
|
||||||
const isUpload = currentProject.isUpload
|
|
||||||
|
|
||||||
//如果项目没有开始
|
|
||||||
dConsole.info(JudgeTag, 'surenjun isUpload=>', isUpload)
|
|
||||||
if (!isUpload) {
|
|
||||||
dConsole.info(JudgeTag, '项目补传开始')
|
|
||||||
//项目开始补传
|
|
||||||
judgeTask.addTask(async () => {
|
|
||||||
await this.beginProject(xmdm)
|
|
||||||
}, {
|
|
||||||
isDelay: true
|
|
||||||
})
|
|
||||||
judgeTask.addTask(async () => {
|
|
||||||
await this.uploadProgressPhoto(xmdm)
|
|
||||||
}, {
|
|
||||||
isDelay: true
|
|
||||||
})
|
|
||||||
currentProject.isUpload = true;
|
|
||||||
Reflect.set(this.judgeUI.projectsObj, xmdm, currentProject)
|
|
||||||
//扣分补传
|
|
||||||
if (currentType == 2) {
|
|
||||||
judgeTask.addTask(async () => {
|
|
||||||
await this.pointsDedute(xmdm, kf!)
|
|
||||||
}, {
|
|
||||||
isDelay: true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//扣分补传判断是否合格 不合格补传项目结束
|
|
||||||
if (currentType == 1 || (currentType == 2 && this.totalScore < judgeUI.passingScore)) {
|
|
||||||
judgeTask.addTask(async () => {
|
|
||||||
await this.endProject(xmdm)
|
|
||||||
}, {
|
|
||||||
isDelay: true
|
|
||||||
})
|
|
||||||
currentProject.isEnd = true;
|
|
||||||
Reflect.set(this.judgeUI.projectsObj, xmdm, currentProject)
|
|
||||||
}
|
|
||||||
judgeTask.addTask(async () => {
|
|
||||||
this.checkExamIsEnd()
|
|
||||||
})
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(judgeUI: JudgeUI) {
|
constructor(judgeUI: JudgeUI) {
|
||||||
this.serialIndex = 1;
|
this.serialIndex = 1;
|
||||||
@ -1915,7 +1914,10 @@ export default class Judge {
|
|||||||
this.judgeUI.jl = jl
|
this.judgeUI.jl = jl
|
||||||
//TODO 待优化 跨组件传值不生效
|
//TODO 待优化 跨组件传值不生效
|
||||||
// globalThis.laneData = performInfo.lane;
|
// globalThis.laneData = performInfo.lane;
|
||||||
dConsole.log(JudgeTag, "车道信息", performInfo.lane)
|
// let res = InitialPerLane
|
||||||
|
// res.MapRoad_Code_No = dayTs().format("YYYY-MM-DD HH:mm:ss")
|
||||||
|
// dConsole.log(JudgeTag, "车道信息", res)
|
||||||
|
// this.judgeUI.laneSignal = res
|
||||||
this.judgeUI.laneSignal = performInfo.lane
|
this.judgeUI.laneSignal = performInfo.lane
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
48
ohos/so/@ohos.judgesdk.d.ts
vendored
Normal file
48
ohos/so/@ohos.judgesdk.d.ts
vendored
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/**
|
||||||
|
* Provides interfaces to generate system logs.
|
||||||
|
*
|
||||||
|
* @namespace JudgeSDk
|
||||||
|
* @syscap SystemCapability.HiviewDFX.HiLog
|
||||||
|
* @crossplatform
|
||||||
|
* @HONGZOS 2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare namespace Judge {
|
||||||
|
function examJudgeVersion(): string;
|
||||||
|
|
||||||
|
function examJudgeInit(data: string, len: number): number;
|
||||||
|
|
||||||
|
function examJudgeSetLogCallback(level: number, handle: Function): number;
|
||||||
|
|
||||||
|
function examJudgeRealExam(plc: string, len: number): number;
|
||||||
|
|
||||||
|
function examJudgeSetRealExamCallback(callback: Function): number;
|
||||||
|
|
||||||
|
function examJudgeMapImageSetCallback(callback: Function): number;
|
||||||
|
|
||||||
|
function examJudgeArtificialMark(no: number, serial: string, type: number): number;
|
||||||
|
|
||||||
|
function examJudgeArtificialItem(no: number, type: number): number;
|
||||||
|
|
||||||
|
function examJudgeMapSetDrawing(flag: boolean): number;
|
||||||
|
|
||||||
|
function examJudgeBeginExam(data: string, len: number): number;
|
||||||
|
|
||||||
|
function examJudgeEndExam(): number;
|
||||||
|
|
||||||
|
function examJudgeDestroy(): number;
|
||||||
|
|
||||||
|
function examJudgeMapSetParam(width: number, height: number): number;
|
||||||
|
|
||||||
|
function examJudgeMapSetScaling(scale: number): number;
|
||||||
|
|
||||||
|
function examJudgeSetPerformCallback(callback: Function): number;
|
||||||
|
|
||||||
|
function examJudgeSoundEnd(no: number, code: string, type: number): number;
|
||||||
|
|
||||||
|
function examCalcGpsDistance(lng1: number, lat1: number, lng2: number, lat2: number, height: number): number;
|
||||||
|
|
||||||
|
function examJudgeErrorInfo(level: number): string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Judge;
|
||||||
BIN
ohos/so/libjudgesdk.z.so
Executable file
BIN
ohos/so/libjudgesdk.z.so
Executable file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user