This commit is contained in:
lixiao 2025-04-10 15:10:31 +08:00
parent 992ac12276
commit ae9fcde331
16 changed files with 100 additions and 40 deletions

View File

@ -1,6 +1,6 @@
{ {
"app": { "app": {
"bundleName": "com.oh.myapplication", "bundleName": "com.oh.dts",
"vendor": "example", "vendor": "example",
"versionCode": 1000000, "versionCode": 1000000,
"versionName": "1.0.0", "versionName": "1.0.0",

View File

@ -4,13 +4,13 @@
{ {
"name": "default", "name": "default",
"material": { "material": {
"certpath": "/Users/wangzhongjie/.ohos/config/openharmony/default_car_next_xIuD6UMCLxZgyeiH-w2XdDck6DewIfdHAvOk_FUbNZo=.cer", "certpath": "C:/Users/93218/.ohos/config/openharmony/default_harmony_vehicle_terminal_Ja3OiX9fkBwGKa0NNRbcXszAt35lPCdUakY4mTtjFwU=.cer",
"storePassword": "0000001BE66D421B205804C1F052841DA4C90D4B3A39A1553B3CA1CA21F934529A92D16A3A7A35A69A0A3D", "storePassword": "0000001B8F068D534BF0B0245E4BDB69E8CFA101B3E7CD4BE89CFE5B2FD5D27D4CA2734F0FBC84F49A9C68",
"keyAlias": "debugKey", "keyAlias": "debugKey",
"keyPassword": "0000001B97A92453459A43E1B0A987037A6FECEB014956E03BFD674EE2D1602CA14A7774AE46012DA8A29B", "keyPassword": "0000001B7EE522481B6BADA6544DD7E5E5D2A7A964971BFFF30CF41899AE5382A42143444D275F293D0744",
"profile": "/Users/wangzhongjie/.ohos/config/openharmony/default_car_next_xIuD6UMCLxZgyeiH-w2XdDck6DewIfdHAvOk_FUbNZo=.p7b", "profile": "C:/Users/93218/.ohos/config/openharmony/default_harmony_vehicle_terminal_Ja3OiX9fkBwGKa0NNRbcXszAt35lPCdUakY4mTtjFwU=.p7b",
"signAlg": "SHA256withECDSA", "signAlg": "SHA256withECDSA",
"storeFile": "/Users/wangzhongjie/.ohos/config/openharmony/default_car_next_xIuD6UMCLxZgyeiH-w2XdDck6DewIfdHAvOk_FUbNZo=.p12" "storeFile": "C:/Users/93218/.ohos/config/openharmony/default_harmony_vehicle_terminal_Ja3OiX9fkBwGKa0NNRbcXszAt35lPCdUakY4mTtjFwU=.p12"
} }
} }
], ],

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,18 @@
{
"meta": {
"stableOrder": true
},
"lockfileVersion": 3,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": {
"libjudgesdk.so@src/cpp/libJudgeSdk": "libjudgesdk.so@src/cpp/libJudgeSdk"
},
"packages": {
"libjudgesdk.so@src/cpp/libJudgeSdk": {
"name": "libjudgesdk.so",
"version": "1.0.0",
"resolved": "src/cpp/libJudgeSdk",
"registryType": "local"
}
}
}

View File

@ -5,6 +5,8 @@
"main": "", "main": "",
"author": "", "author": "",
"license": "", "license": "",
"dependencies": {} "dependencies": {
"libjudgesdk.so": "file:./src/cpp/libJudgeSdk"
}
} }

38
entry/src/cpp/libJudgeSdk/Index.d.ts vendored Normal file
View File

@ -0,0 +1,38 @@
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

View File

@ -0,0 +1,6 @@
{
"name": "libjudgesdk.so",
"types": "./Index.d.ts",
"version": "1.0.0",
"description": "Please describe the basic information."
}

View File

@ -40,7 +40,11 @@ export default class EntryAbility extends UIAbility {
async onWindowStageCreate(windowStage: window.WindowStage) { async onWindowStageCreate(windowStage: window.WindowStage) {
// Main window is created, set main page for this ability // Main window is created, set main page for this ability
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
const windowClass = await windowStage.getMainWindow();
let rect = windowClass.getWindowProperties().windowRect
let width = rect.width
let height = rect.height
console.log("log", width, height)
AppStorage.setOrCreate<CarInfoType>('carInfo', {}) AppStorage.setOrCreate<CarInfoType>('carInfo', {})
AppStorage.setOrCreate<ExaminerInfoType>('examinerInfo', {}) AppStorage.setOrCreate<ExaminerInfoType>('examinerInfo', {})
AppStorage.setOrCreate<string>('lsh', '0000000000000') AppStorage.setOrCreate<string>('lsh', '0000000000000')
@ -53,18 +57,15 @@ export default class EntryAbility extends UIAbility {
judgeVersion: GlobalConfig.version.jn.km3[1] || "", judgeVersion: GlobalConfig.version.jn.km3[1] || "",
tcpSendNum: 0, tcpSendNum: 0,
videoVersion: '1.0', videoVersion: '1.0',
ratio: 1280 / 960, //适配比例 ratio: width / height, //适配比例
pathDir: this.context.filesDir, pathDir: this.context.filesDir,
context: this.context, context: this.context,
isJudgeInitBool: false, isJudgeInitBool: false,
}) })
const windowClass = await windowStage.getMainWindow();
AppStorage.setOrCreate('windowClass', windowClass) AppStorage.setOrCreate('windowClass', windowClass)
// await windowClass.setWindowLayoutFullScreen(true)
await windowClass.setWindowSystemBarEnable([]) //全屏 await windowClass.setWindowSystemBarEnable([]) //全屏
// await windowClass.setWindowSystemBarEnable(['navigation'])
windowStage.loadContent('pages/Index', (err, data) => { windowStage.loadContent('pages/Index', (err, data) => {
if (err.code) { if (err.code) {

View File

@ -20,7 +20,7 @@ import { delPic } from '../utils/Video';
import { FileHelper } from '../utils/FileHelp'; import { FileHelper } from '../utils/FileHelp';
import { GetCurrentTime } from '../utils/Common'; import { GetCurrentTime } from '../utils/Common';
import { ObtainUdpBusinessInstance } from '../utils/business/ObtainUdpBusiness'; import { ObtainUdpBusinessInstance } from '../utils/business/ObtainUdpBusiness';
import { CenterUDPClientInstance } from '../utils/business/CenterUdpBusiness'; import { CenterUDPBusinessInstance } from '../utils/business/CenterUdpBusiness';
import { DrivingDataStorage } from '../utils/business/DrivingDataStorage'; import { DrivingDataStorage } from '../utils/business/DrivingDataStorage';
import { JudgeUdpBusinessInstance } from '../utils/business/JudgeUdpBusiness'; import { JudgeUdpBusinessInstance } from '../utils/business/JudgeUdpBusiness';
import { JudgeEmitterInstance } from '../utils/business/UdpEvent'; import { JudgeEmitterInstance } from '../utils/business/UdpEvent';
@ -44,6 +44,7 @@ struct Index {
@State fd: number = -1; @State fd: number = -1;
@State carInfo: CarInfoType = {}; @State carInfo: CarInfoType = {};
@State num: number = 0; @State num: number = 0;
private context = getContext(this) as common.UIAbilityContext;
errorDialog: CustomDialogController = new CustomDialogController({ errorDialog: CustomDialogController = new CustomDialogController({
builder: errorMsgDialog({ builder: errorMsgDialog({
title: AppStorage.get('title'), title: AppStorage.get('title'),
@ -57,14 +58,12 @@ struct Index {
alignment: DialogAlignment.Center, alignment: DialogAlignment.Center,
}, },
) )
private fileHelper!: FileHelper private fileHelper: FileHelper = new FileHelper(this.context)
private interval = -1; private interval = -1;
private avPlayer!: VoiceAnnounce private avPlayer: VoiceAnnounce = new VoiceAnnounce(this.context)
private timeInfo!: TimeSynchronizationRspBody private timeInfo: TimeSynchronizationRspBody = {}
private context = getContext(this) as common.UIAbilityContext;
async aboutToAppear() { async aboutToAppear() {
this.avPlayer = new VoiceAnnounce(this.context);
this.ratio = AppStorage.get<BaseInfoType>('baseInfo')?.ratio || 1.4 this.ratio = AppStorage.get<BaseInfoType>('baseInfo')?.ratio || 1.4
this.initParamFlag = false this.initParamFlag = false
this.delLoading = false this.delLoading = false
@ -133,7 +132,7 @@ struct Index {
carId: this.carInfo?.carId, carId: this.carInfo?.carId,
examinationRoomId: this.carInfo?.examinationRoomId, examinationRoomId: this.carInfo?.examinationRoomId,
judgeVersion: this.baseInfo?.judgeVersion, judgeVersion: this.baseInfo?.judgeVersion,
shellVersion: this.baseInfo?.version||"", shellVersion: this.baseInfo?.version || "",
paraKdid: this.timeInfo?.paraKdid || this.timeInfo?.kdid, paraKdid: this.timeInfo?.paraKdid || this.timeInfo?.kdid,
kdid: this.timeInfo?.kdid || this.timeInfo?.paraKdid, kdid: this.timeInfo?.kdid || this.timeInfo?.paraKdid,
mode: this.timeInfo?.mode, mode: this.timeInfo?.mode,
@ -199,11 +198,9 @@ struct Index {
} }
async createAlbum() { async createAlbum() {
this.fileHelper = new FileHelper(this.context);
const time = GetCurrentTime() const time = GetCurrentTime()
const date = time.split(' ')[0] const date = time.split(' ')[0]
this.fileHelper.createAlbum('jt') this.fileHelper.createAlbum('jt')
// this.fileHelper.createAlbum('2025-01-02')
this.fileHelper.createAlbum('pz'); this.fileHelper.createAlbum('pz');
this.fileHelper.createAlbum(date); this.fileHelper.createAlbum(date);
} }
@ -212,9 +209,9 @@ struct Index {
//设置plc udp 同步requesthost //设置plc udp 同步requesthost
ObtainUdpBusinessInstance.init(); ObtainUdpBusinessInstance.init();
CenterUDPClientInstance.init(); CenterUDPBusinessInstance.init();
CenterUDPClientInstance.startHeartBeat() CenterUDPBusinessInstance.startHeartBeat()
CenterUDPClientInstance.onMsg((data: centerCallBackMsgType) => { CenterUDPBusinessInstance.onMsg((data: centerCallBackMsgType) => {
if (data.id == 32) { if (data.id == 32) {
AppStorage.setOrCreate('signNum', data.body[1]) AppStorage.setOrCreate('signNum', data.body[1])
} }
@ -489,7 +486,6 @@ struct Index {
.backgroundColor('#E6E3DF') .backgroundColor('#E6E3DF')
.borderRadius(19 * this.ratio) .borderRadius(19 * this.ratio)
} }
if (this.loading) { if (this.loading) {
Column() { Column() {
Image($r('app.media.open_loading')) Image($r('app.media.open_loading'))

View File

@ -42,7 +42,7 @@ import { GetCurrentUserKeyValue } from './UserInfo/utils';
import dayTs from '../utils/Date'; import dayTs from '../utils/Date';
import { GetCurrentTime, NumberToByteArray } from '../utils/Common'; import { GetCurrentTime, NumberToByteArray } from '../utils/Common';
import DB from '../utils/DbSql'; import DB from '../utils/DbSql';
import { CenterUDPClientInstance } from '../utils/business/CenterUdpBusiness'; import { CenterUDPBusinessInstance } from '../utils/business/CenterUdpBusiness';
import { JudgeEmitterInstance } from '../utils/business/UdpEvent'; import { JudgeEmitterInstance } from '../utils/business/UdpEvent';
import errorMsgDialog from './compontents/errorMsgDialog'; import errorMsgDialog from './compontents/errorMsgDialog';
@ -308,7 +308,7 @@ struct UserInfo {
} }
async onPageHide(): Promise<void> { async onPageHide(): Promise<void> {
CenterUDPClientInstance.offMsg(this.onCenterMsg) CenterUDPBusinessInstance.offMsg(this.onCenterMsg)
} }
//身份证读卡器初始化 //身份证读卡器初始化
@ -469,7 +469,7 @@ struct UserInfo {
} }
async heartMsg() { async heartMsg() {
CenterUDPClientInstance.onMsg(this.onCenterMsg) CenterUDPBusinessInstance.onMsg(this.onCenterMsg)
} }
//考点端查询缺考指令内容消息请求 //考点端查询缺考指令内容消息请求
@ -484,7 +484,7 @@ struct UserInfo {
placeId: this.carInfo.examinationRoomId as string placeId: this.carInfo.examinationRoomId as string
} }
// globalThis.udpClient2.sendMsgExt(param, this.context) // globalThis.udpClient2.sendMsgExt(param, this.context)
CenterUDPClientInstance.sendData(param) CenterUDPBusinessInstance.sendData(param)
} }
async initSysset() { async initSysset() {
@ -808,7 +808,7 @@ struct UserInfo {
carNo: this.carInfo.carNo || "", carNo: this.carInfo.carNo || "",
placeId: this.carInfo.examinationRoomId || "" placeId: this.carInfo.examinationRoomId || ""
} }
CenterUDPClientInstance.sendData(param) CenterUDPBusinessInstance.sendData(param)
// globalThis.udpClient2.sendMsgExt(param, this.context) // globalThis.udpClient2.sendMsgExt(param, this.context)
if (res.examinationStuAbsentRsp && res.examinationStuAbsentRsp.head && if (res.examinationStuAbsentRsp && res.examinationStuAbsentRsp.head &&
res.examinationStuAbsentRsp.head.resultCode == '0') { res.examinationStuAbsentRsp.head.resultCode == '0') {

View File

@ -7,7 +7,7 @@ import { VideoConfigData } from '../../mock';
import { CarInfoType, UDPParamType, VideoConfig } from '../../model'; import { CarInfoType, UDPParamType, VideoConfig } from '../../model';
import { NumberToByteArray } from '../../utils/Common'; import { NumberToByteArray } from '../../utils/Common';
import FileUtils from '../../utils/FileUtils'; import FileUtils from '../../utils/FileUtils';
import { CenterUDPClientInstance } from '../../utils/business/CenterUdpBusiness'; import { CenterUDPBusinessInstance } from '../../utils/business/CenterUdpBusiness';
import { takePhoto, takePhotoParam } from '../../utils/Video'; import { takePhoto, takePhotoParam } from '../../utils/Video';
import { voiceService } from '../../utils/Voice'; import { voiceService } from '../../utils/Voice';
@ -244,7 +244,7 @@ export default struct FaceCompare {
this.callBackFlag = true this.callBackFlag = true
} }
} }
CenterUDPClientInstance.sendData(param) CenterUDPBusinessInstance.sendData(param)
// UDP缺失 // UDP缺失
// globalThis.udpClient2 && globalThis.udpClient2.sendMsgExt(param, this.context) // globalThis.udpClient2 && globalThis.udpClient2.sendMsgExt(param, this.context)
clearInterval(this.interval) clearInterval(this.interval)
@ -256,10 +256,10 @@ export default struct FaceCompare {
carNo: this.carInfo.carNo || "", carNo: this.carInfo.carNo || "",
placeId: this.carInfo.examinationRoomId || "", placeId: this.carInfo.examinationRoomId || "",
} }
CenterUDPClientInstance.sendData(param2) CenterUDPBusinessInstance.sendData(param2)
} }
}, 1000) }, 1000)
CenterUDPClientInstance.onMsg((val) => { CenterUDPBusinessInstance.onMsg((val) => {
if (AppStorage.get('statue') != 3) { if (AppStorage.get('statue') != 3) {
return return
} }

View File

@ -1,7 +1,6 @@
import libJudgeSdk from 'libjudgesdk.so'; import libJudgeSdk from 'libjudgesdk.so';
import { JudgeBeginObj, JudgeInitObj, Plc } from '../../../model'; import { JudgeBeginObj, JudgeInitObj, Plc } from '../../../model';
// import libJudgeSdk from '@ohos.judgesdk'
/** /**
* 苏仁君 * 苏仁君
* @date 2023/04/10 * @date 2023/04/10

View File

@ -4,7 +4,7 @@ import { CarInfoType, EnvironmentConfigurationType } from '../model'
import { UDPTag } from '../config' import { UDPTag } from '../config'
import { BusinessError } from '@ohos.base' import { BusinessError } from '@ohos.base'
import { FillZero, StringToBytes, StringToASCII } from './Common' import { FillZero, StringToBytes, StringToASCII } from './Common'
import { CenterUDPClientInstance } from './business/CenterUdpBusiness' import { CenterUDPBusinessInstance } from './business/CenterUdpBusiness'
interface MsgExt { interface MsgExt {
id: number, id: number,

View File

@ -146,4 +146,4 @@ class CenterUDPBusiness {
} }
} }
export const CenterUDPClientInstance = new CenterUDPBusiness(); export const CenterUDPBusinessInstance = new CenterUDPBusiness();

View File

@ -4,7 +4,7 @@ import { fillZero, } from '../../pages/judgeSDK/utils/Common';
import { JudgeConfig } from '../../pages/judgeSDK/utils/judgeConfig'; import { JudgeConfig } from '../../pages/judgeSDK/utils/judgeConfig';
import { FillZero, StringToASCII } from '../Common'; import { FillZero, StringToASCII } from '../Common';
import UdpClient from '../UdpUtils' import UdpClient from '../UdpUtils'
import { CenterUDPClientInstance } from './CenterUdpBusiness'; import { CenterUDPBusinessInstance } from './CenterUdpBusiness';
import { ObtainUdpBusinessInstance } from './ObtainUdpBusiness'; import { ObtainUdpBusinessInstance } from './ObtainUdpBusiness';
import systemTime from '@ohos.systemDateTime'; import systemTime from '@ohos.systemDateTime';
import { examCalcGpsDistance } from '../../pages/judgeSDK/api'; import { examCalcGpsDistance } from '../../pages/judgeSDK/api';
@ -347,7 +347,7 @@ class JudgeUdpBusiness {
//申请远程扣分查询 //申请远程扣分查询
askKf(directives: number) { askKf(directives: number) {
const carInfo: CarInfoType = AppStorage.get<CarInfoType>('carInfo')! const carInfo: CarInfoType = AppStorage.get<CarInfoType>('carInfo')!
CenterUDPClientInstance.sendData({ CenterUDPBusinessInstance.sendData({
id: 35, id: 35,
list: [directives], list: [directives],
carNo: carInfo.carNo!, carNo: carInfo.carNo!,
@ -359,7 +359,7 @@ class JudgeUdpBusiness {
//确定远程扣分 //确定远程扣分
confirmKf(directives: number, code: number) { confirmKf(directives: number, code: number) {
const carInfo: CarInfoType = AppStorage.get<CarInfoType>('carInfo')! const carInfo: CarInfoType = AppStorage.get<CarInfoType>('carInfo')!
CenterUDPClientInstance.sendData({ CenterUDPBusinessInstance.sendData({
id: 37, id: 37,
list: [directives, code], list: [directives, code],
carNo: carInfo.carNo!, carNo: carInfo.carNo!,