Merge branch 'main' into lv

# Conflicts:
#	entry/src/main/ets/pages/Index.ets
#	entry/src/main/ets/pages/UserInfo.ets
This commit is contained in:
lvyuankang 2024-07-02 13:43:46 +08:00
commit 009bd53f46
436 changed files with 2072 additions and 1934 deletions

1
entry/.gitignore vendored
View File

@ -3,3 +3,4 @@
/build
/.cxx
/.idea
/oh_modules

View File

@ -0,0 +1,120 @@
// 导入USB接口api包。
import usb from '@ohos.usbManager';
const LOGTAG = 'USBSERVICES'
//字符串转字节
function stringToArr(str){
var arr = [];
for (var i = 0, j = str.length; i < j; ++i) {
arr.push(str.charCodeAt(i));
}
return arr
}
//plc数据转成无锡科研所usb字节数据
function plcStrToWXCodeArr(wuXiDataStr){
const arr = stringToArr(wuXiDataStr);
//数据包总长度 有效长度
let packetSize = 65,maxDataSize = 63;
let packetArr = []
const loop = Math.ceil(arr.length / maxDataSize)
for(let i = 0; i< loop; i++){
const thisPacket = arr.slice(i * maxDataSize,(i + 1) * maxDataSize)
const oSize = maxDataSize - thisPacket.length;
//补齐0x00
if(oSize > 0){
let oSizeArr = []
for(let j = 0;j < oSize;j++){oSizeArr.push(0x00)}
packetArr.push([thisPacket.length].concat(thisPacket).concat(oSizeArr));
}else{
packetArr.push([thisPacket.length].concat(thisPacket));
}
}
return packetArr
}
export default class UsbService{
private devicepipe : usb.USBDevicePipe
private outEndpoint: usb.USBEndpoint
public isWXUSBDevice:Boolean
constructor() {
//是否是无锡检测设备
this.isWXUSBDevice = false
this.devicepipe
this.init()
}
init = async()=>{
// 获取设备列表。
let deviceList : Array<usb.USBDevice> = usb.getDevices();
deviceList.forEach(async (device:usb.USBDevice) => {
const {vendorId,productId} = device;
console.log(LOGTAG,JSON.stringify(device));
//无锡所检测设备接入
if(vendorId === 6790 && productId === 58409){
// if(vendorId === 2385 && productId === 5734){
// 申请操作指定的device的操作权限。
try {
let bool = usb.hasRight(device.name);
console.info(LOGTAG,'bool =>' + bool)
const isExit = await usb.requestRight(device.name);
console.info(LOGTAG,'isExit =>' + isExit)
if(isExit){
let devicepipe : usb.USBDevicePipe = usb.connectDevice(device);
let interfaces = device.configs[0].interfaces[0];
let ret = usb.claimInterface(devicepipe, interfaces,true);
console.info(LOGTAG,'ret =>' + ret);
if(ret === 0 ){
let outEndpoint : usb.USBEndpoint = interfaces.endpoints[1];
let inEndpoint : usb.USBEndpoint = interfaces.endpoints[0];
this.isWXUSBDevice = true;
this.devicepipe = devicepipe
this.outEndpoint = outEndpoint
}else{
console.info(LOGTAG,'usb claimInterface failed')
}
}else{
console.info(LOGTAG,'isExit =>' +'false')
}
} catch (e) {
console.info(LOGTAG,'e=>' + JSON.stringify(e))
}
}
});
}
sendUSB =async (wuXiDataStr) => {
console.info(LOGTAG,'正在发送数据')
const {devicepipe,isWXUSBDevice,outEndpoint} = this;
console.info(LOGTAG,'正在发送数据')
if(isWXUSBDevice){
console.info(LOGTAG,wuXiDataStr)
const codeArr = plcStrToWXCodeArr(wuXiDataStr);
for(let i = 0; i < codeArr.length;i++){
try {
console.info(LOGTAG,'正在发送数据')
const f = await usb.bulkTransfer(devicepipe, outEndpoint, new Uint8Array(codeArr[i]))
console.info(LOGTAG,'发送成功数据长度为:' + f)
} catch (e) {
console.info(LOGTAG,JSON.stringify(e))
}
}
}else{
console.info(LOGTAG,'usb设备初始化失败')
}
}
}
// export default initUsbServicesFn

View File

@ -1,7 +1,7 @@
import systemTime from '@ohos.systemDateTime';
import { Array2Byte, fillZero, string2Bytes, stringToASC } from '../../common/utils/tools';
import { testKmItems } from '../../pages/judgeSDK/dataTest/index';
import { setJudgeUdp, setTopLineUdp } from './GlobleUdp';
import { setJudgeUdp, setTopLineUdp } from './GlobalUdp';
import { convertGpsCoord2 } from '../utils/tools';

View File

@ -0,0 +1,165 @@
export const WarnFlagData = {
1: '0',
2: '0',
3: '0',
4: '0',
5: '0',
6: '0',
7: '0',
8: '0',
9: '0',
10: '0',
11: '0',
12: '0',
13: '0',
14: '0',
15: '0',
16: '0',
17: '0',
18: '0',
19: '0',
20: '0',
21: '0',
22: '0',
23: '0',
24: '0',
25: '0',
26: '0',
27: '0',
28: '0',
29: '0',
}
export const PassData = {
1: false,
2: false,
3: false,
4: false,
5: false,
6: false,
7: false,
8: false,
9: false,
10: false,
11: false,
12: false,
13: false,
14: false,
15: false,
16: false,
17: false,
18: false,
19: false,
20: false,
21: false,
22: false,
23: false,
24: false,
25: false,
26: false,
27: false,
28: false,
29: false,
}
export const StackValueData = {
1: '',
2: "",
3: "",
4: "",
5: "",
6: "",
7: "",
8: "",
9: "",
10: "",
11: "",
12: "",
13: "",
14: "",
15: "",
16: "",
17: "",
18: "",
19: "",
20: "",
21: "",
22: "",
23: "",
24: "",
25: "",
26: "",
27: "",
28: "",
29: "",
}
export const WarnFlagTipData = {
0: [],
1: [],
2: [],
3: ['check1.wav', 'check2.wav'],
4: ['check3.wav', 'check4.wav'],
5: ['check5.wav', 'check6.wav'],
6: ['check7.wav', 'check8.wav'],
7: ['check9.wav', 'check10.wav'],
8: ['check26.wav', 'check27.wav'],
9: ['dianhuoVideo.wav', 'xihuoVideo.wav'],
10: ['check31.wav'],
11: ['check30.wav'],
12: ['check28.wav'],
13: ['check29.wav'],
14: ['check11.wav'],
15: ['check12.wav'],
16: ['check13.wav'],
17: ['check14.wav'],
18: ['check15.wav'],
19: ['check16.wav'],
20: ['check17.wav'],
21: ['check18.wav'],
22: ['check19.wav'],
23: ['check22.wav'],
24: ['check23.wav'],
25: ['check20.wav', 'check21.wav'],
26: ['check24.wav'],
// 27:[],
// 28:[],
// 29:[],
}
export const RealNumData = {
3: 19,
4: 17,
5: 13,
6: 12,
7: 14,
8: 18,
9: 5,
10: 29,
11: 30,
12: 31,
13: 32,
14: 28,
15: 28,
16: 28,
17: 28,
18: 28,
19: 28,
20: 28,
21: 2, //左方向灯,
22: 3,
23: 7,
24: 8,
25: 20,
26: ''
}
export const DwMapData={
14: '1',
15: '2',
16: '3',
17: '4',
18: '5',
19: '9',
20: '0'
}

View File

@ -0,0 +1,17 @@
export const AmplifyArr = [
{ name: '直线', projectCode: '3', projectCodeCenter: '40300' },
{ name: '会车', projectCode: '9', projectCodeCenter: '41300' },
{ name: '变道', projectCode: '4', projectCodeCenter: '40500' },
{ name: '超车', projectCode: '10', projectCodeCenter: '41400' },
{ name: '掉头', projectCode: '12', projectCodeCenter: '41500' },
{ name: '停车', projectCode: '11', projectCodeCenter: '40600' },
]
export const AmplifyImages = [
'km_zxB.png',
'km_hcB.png',
'km_bdB.png',
'km_ccB.png',
'km_dtB.png',
'km_tcB.png',
]

View File

@ -0,0 +1,67 @@
export const SignalData = [
{ key: '左方向灯', value: '0' },
{ key: '右方向灯', value: '0' },
{ key: '喇叭', value: '0' },
{ key: '点火1', value: '0' },
{ key: '点火2', value: '0' },
{ key: '近光灯', value: '0' },
{ key: '远光灯', value: '0' },
{ key: '示廓灯', value: '0' },
{ key: '雾灯', value: '0' },
{ key: '雨刮器', value: '0' },
{ key: '脚刹', value: '0' },
{ key: '手刹', value: '0' },
{ key: '主驾驶门', value: '0' },
{ key: '离合', value: '0' },
{ key: '副刹车', value: '0' },
{ key: '安全带', value: '0' },
{ key: '双跳灯', value: '0' },
{ key: '车速', value: '0' },
{ key: '档位', value: '0' },
{ key: '超声波1', value: '0' },
{ key: '超声波2', value: '0' },
{ key: 'NC', value: '0' },
{ key: 'SA15', value: '0' },
{ key: '其他门', value: '0' },
{ key: '转速过高', value: '0' },
{ key: '累计脉冲', value: '0' },
{ key: '熄火次数', value: '0' },
{ key: '发动机转速', value: '0' },
{ key: '方向盘角度', value: '0' },
{ key: '超声波3', value: '0' },
{ key: '超声波4', value: '0' },
{ key: '触摸1', value: '0' },
{ key: '触摸2', value: '0' },
{ key: '触摸3', value: '0' },
{ key: 'SCIO', value: '0' },
{ key: 'SC1A_C', value: '0' },
{ key: 'SC1B_C', value: '0' },
{ key: 'SC2A_C', value: '0' },
{ key: 'SC2B_C', value: '0' },
{ key: 'SC3A_C', value: '0' },
{ key: 'SC3B_C', value: '0' },
{ key: 'SC4A_C', value: '0' },
{ key: 'SC4B_C', value: '0' },
{ key: 'SC5A_C', value: '0' },
{ key: 'SC5B_C', value: '0' },
{ key: 'SC6A_C', value: '0' },
{ key: 'SC6B_C', value: '0' }
]
export const GPSData = [
{ key: '状态', value: '0' },
{ key: '收星数', value: '0' },
{ key: '海拔高', value: '0' },
{ key: '高度差', value: '0' },
{ key: '龄期', value: '0' },
{ key: '维度因子', value: '0' },
{ key: '经度因子', value: '0' },
{ key: '航向角', value: '0' },
{ key: '俯仰角', value: '0' },
{ key: '航向角状态-收星数', value: '0' },
{ key: '年月日', value: '0' },
{ key: '时分秒', value: '0' },
{ key: '经度', value: '0' },
{ key: '纬度', value: '0' },
{ key: '速度', value: '0' },
]

View File

@ -1,3 +1,9 @@
export * from "./CandidateData"
export * from "./VideoData"
export * from "./Judge"
export * from "./SignDisplay"
export * from "./CarCheck"

View File

@ -0,0 +1,4 @@
export type SignalDataType = {
key: string;
value: string;
};

View File

@ -0,0 +1 @@
export * from "./SignDisplay"

View File

@ -4,6 +4,7 @@ import { carConfigurationInfo, uploadExamCarCheckResult } from '../api/checkCar'
import TopLogo from './compontents/TopLogo';
import testNapi from '@ohos.hiserialsdk';
import { dateFormat } from '../common/utils/tools';
import { DwMapData, PassData, RealNumData, StackValueData, WarnFlagData, WarnFlagTipData } from '../mock';
@Entry
@Component
@ -24,167 +25,13 @@ export default struct Index {
@State subFlag: boolean = true
@State signArr: Array<any> = []
@State checkListCopy: Array<any> = []
@State warnFlag: object = {
1: '0',
2: '0',
3: '0',
4: '0',
5: '0',
6: '0',
7: '0',
8: '0',
9: '0',
10: '0',
11: '0',
12: '0',
13: '0',
14: '0',
15: '0',
16: '0',
17: '0',
18: '0',
19: '0',
20: '0',
21: '0',
22: '0',
23: '0',
24: '0',
25: '0',
26: '0',
27: '0',
28: '0',
29: '0',
}
@State warnFlag: object = WarnFlagData
@State @Watch('outClick') outFlag: boolean = false;
@State passArray: object = {
1: false,
2: false,
3: false,
4: false,
5: false,
6: false,
7: false,
8: false,
9: false,
10: false,
11: false,
12: false,
13: false,
14: false,
15: false,
16: false,
17: false,
18: false,
19: false,
20: false,
21: false,
22: false,
23: false,
24: false,
25: false,
26: false,
27: false,
28: false,
29: false,
}
@State stachValue: object = {
1: '',
2: "",
3: "",
4: "",
5: "",
6: "",
7: "",
8: "",
9: "",
10: "",
11: "",
12: "",
13: "",
14: "",
15: "",
16: "",
17: "",
18: "",
19: "",
20: "",
21: "",
22: "",
23: "",
24: "",
25: "",
26: "",
27: "",
28: "",
29: "",
}
@State warnFlagTip: object = {
0: [],
1: [],
2: [],
3: ['check1.wav', 'check2.wav'],
4: ['check3.wav', 'check4.wav'],
5: ['check5.wav', 'check6.wav'],
6: ['check7.wav', 'check8.wav'],
7: ['check9.wav', 'check10.wav'],
8: ['check26.wav', 'check27.wav'],
9: ['dianhuoVideo.wav', 'xihuoVideo.wav'],
10: ['check31.wav'],
11: ['check30.wav'],
12: ['check28.wav'],
13: ['check29.wav'],
14: ['check11.wav'],
15: ['check12.wav'],
16: ['check13.wav'],
17: ['check14.wav'],
18: ['check15.wav'],
19: ['check16.wav'],
20: ['check17.wav'],
21: ['check18.wav'],
22: ['check19.wav'],
23: ['check22.wav'],
24: ['check23.wav'],
25: ['check20.wav', 'check21.wav'],
26: ['check24.wav'],
// 27:[],
// 28:[],
// 29:[],
}
@State realNum: object = {
3: 19,
4: 17,
5: 13,
6: 12,
7: 14,
8: 18,
9: 5,
10: 29,
11: 30,
12: 31,
13: 32,
14: 28,
15: 28,
16: 28,
17: 28,
18: 28,
19: 28,
20: 28,
21: 2, //左方向灯,
22: 3,
23: 7,
24: 8,
25: 20,
26: ''
}
@State dwMap: object = {
14: '1',
15: '2',
16: '3',
17: '4',
18: '5',
19: '9',
20: '0'
}
@State passArray: object = PassData
@State stachValue: object = StackValueData
@State warnFlagTip: object = WarnFlagTipData
@State realNum: object = RealNumData
@State dwMap: object = DwMapData
@State fd: number = -1;
@State devPath: string = "/dev/ttyS3"
@State stopFlag: boolean = false
@ -306,99 +153,9 @@ export default struct Index {
async kszj() {
this.breakFlag = true
this.stachValue = {
1: '',
2: "",
3: "",
4: "",
5: "",
6: "",
7: "",
8: "",
9: "",
10: "",
11: "",
12: "",
13: "",
14: "",
15: "",
16: "",
17: "",
18: "",
19: "",
20: "",
21: "",
22: "",
23: "",
24: "",
25: "",
26: "",
27: "",
28: "",
29: "",
}
this.warnFlag = {
1: 0,
2: 0,
3: 0,
4: 0,
5: 0,
6: 0,
7: 0,
8: 0,
9: 0,
10: 0,
11: 0,
12: 0,
13: 0,
14: 0,
15: 0,
16: 0,
17: 0,
18: 0,
19: 0,
20: 0,
21: 0,
22: 0,
23: 0,
24: 0,
25: 0,
26: 0,
27: 0,
28: 0,
29: 0,
}
this.passArray = {
1: false,
2: false,
3: false,
4: false,
5: false,
6: false,
7: false,
8: false,
9: false,
10: false,
11: false,
12: false,
13: false,
14: false,
15: false,
16: false,
17: false,
18: false,
19: false,
20: false,
21: false,
22: false,
23: false,
24: false,
25: false,
26: false,
27: false,
28: false,
29: false,
}
this.stachValue = StackValueData
this.warnFlag = WarnFlagData
this.passArray = PassData
this.checkListCopy = JSON.parse(JSON.stringify(this.checkList))
this.index = this.checkListCopy[0].key
this.vocObj.playAudio({

View File

@ -1,75 +1,40 @@
// @ts-nocheck
import promptAction from '@ohos.promptAction'
import { VideoConfig } from './interfaces'
import common from '@ohos.app.ability.common';
import router from '@ohos.router'
import { getDeviceInfo ,getCarInfo} from '../common/service/terminalService'
import { setCurrentTime } from '../common/service/timeService'
import {string2Bytes} from '../common/utils/tools'
import router from '@ohos.router';
import { getCarInfo, getDeviceInfo } from '../common/service/terminalService';
import { setCurrentTime } from '../common/service/timeService';
import { string2Bytes } from '../common/utils/tools';
import { FileHelper } from '../common/service/FileHelper';
import {
getEsCarModel,
} from '../common/service/initable'
import FileUtil from '../common/utils/File'
import { getUDP, getUDP2 } from '../common/utils/GlobleUdp'
import {initJudgeUdp} from '../common/utils/UdpJudge'
import { getTCP } from '../common/utils/GlobleTcp'
import TcpClient from '../common/utils/TcpClient';
import testNapi from '@ohos.hiserialsdk'
import {setliushuiNum,getliushuiNum,getSingleCenterTable,getDoubleCeneterTable,takePhotoFn} from '../common/service/indexService'
import { getEsCarModel, } from '../common/service/initable';
import FileUtil from '../common/utils/File';
import { getUDP, getUDP2 } from '../common/utils/GlobalUdp';
import { initJudgeUdp } from '../common/utils/UdpJudge';
import { getTCP } from '../common/utils/GlobalTcp';
import { getliushuiNum, setliushuiNum } from '../common/service/indexService';
import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl';
import worker, { MessageEvents } from '@ohos.worker';
@Entry
@Component
struct Index {
private fileUtil: FileUtil
@State carNum: string = ''
@State version: string = ''
@State url: string = ''
@State hasAuth: boolean = false;
@State isSingle: boolean = false;
@State deviceId: string = '';
private interval = null;
private workerInstance = null;
@State angle: number = 0
@State ratio: number = 1700 / 960
@State loading: boolean = true
@State fd: number = -1;
private context = getContext(this) as common.UIAbilityContext;
@State param: VideoConfig = {
videoNum:'1',
spls: '1',
wz: '0,0',
faceFlag: false,
shuiying: true,
pztd: '2',
ljlx: '',
ip: '192.168.36.94',
port: '554',
userName: 'admin',
pwd: '12345qwe',
td1: '1',
td2: '2',
td3: '3',
td4: '4',
videoRecord1: false,
videoRecord2: true,
videoRecord3: false,
videoRecord4: false,
text1: '',
text2: '',
text3: '',
dolt: '',
fontSize: '',
rlls: '1',
spzd4:false,
spzd3:false,
spzd2:false,
spzd1:false,
zdyz:'5',
}
@State param: VideoConfig = VideoConfigData
fileHelper = null;
private fileUtil: FileUtil
private interval = null;
private workerInstance = null;
private context = getContext(this) as common.UIAbilityContext;
build() {
Column() {
Column() {
@ -193,12 +158,16 @@ struct Index {
)
)
Text('考车号:' + globalThis.deviceNo).fontColor('#CCAE7A').fontSize(22 * globalThis.ratio).margin({ right: 24 })
Text('考车号:' + globalThis.deviceNo)
.fontColor('#CCAE7A')
.fontSize(22 * globalThis.ratio)
.margin({ right: 24 })
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
.margin({ bottom: 10 })
}
//
if (this.loading) {
Column() {
@ -218,7 +187,10 @@ struct Index {
.width(80 * globalThis.ratio)
.height(80 * globalThis.ratio)
.position({ x: 288 * globalThis.ratio, y: 89 * globalThis.ratio })
Text('获取考车信息,请稍候……').fontSize(24 * globalThis.ratio).margin({ top: 20 * globalThis.ratio }).fontWeight(400)
Text('获取考车信息,请稍候……')
.fontSize(24 * globalThis.ratio)
.margin({ top: 20 * globalThis.ratio })
.fontWeight(400)
}
.visibility(this.loading ? Visibility.Visible : Visibility.Hidden)
.width(660 * globalThis.ratio)
@ -241,6 +213,7 @@ struct Index {
this.angle = 0
this.loading = false
}
async testXMLToJSONInWorker() {
let workerInstance = new worker.ThreadWorker('entry/ets/workers/worker.ts', {
name: 'FriendsMoments Worker'
@ -265,6 +238,7 @@ struct Index {
this.loading=false
}
}
async heartMsg() {
const arr = [globalThis.signNum || 0, globalThis.statue || 1]
let tmpList = [];
@ -276,7 +250,12 @@ struct Index {
}
console.log('globalThis.carInfo', JSON.stringify(globalThis.carInfo))
const param= {id: 31,list:tmpList,carNo: globalThis.carInfo.carNo,placeId: globalThis.carInfo.examinationRoomId}
const param = {
id: 31,
list: tmpList,
carNo: globalThis.carInfo.carNo,
placeId: globalThis.carInfo.examinationRoomId
}
// globalThis.udpClient2.initHeartSendMsg(param,this.context)
if(!globalThis.closeHeartSocket){
globalThis.udpClient2.sendMsg(param, this.context)
@ -339,6 +318,7 @@ struct Index {
console.error(`Failed to request permissions from user. Code is ${err.code}, message is ${err.message}`);
})
}
async initParams() {
this.loading = false
await getDeviceInfo()
@ -352,8 +332,8 @@ struct Index {
// await this.getModel()
// const arr = [0x55, 0xaa, 0x01, 0x00, 0x02, 0x01, 0x03, 0x00]
// globalThis.udpClientByTopLine.sendMsg(Array2Byte(arr).buffer)
console.info(testNapi)
}
async getModel() {
const context = this.context;
//下载模型

View File

@ -1,30 +1,106 @@
import router from '@ohos.router'
import prompt from '@ohos.prompt'
import router from '@ohos.router';
import Prompt from '@system.prompt';
import common from '@ohos.app.ability.common';
import EndPoPup from './compontents/judge/end-popup'
import LoadingPopup from './compontents/judge/loading-popup'
import DeductedPopup from './compontents/judge/deduction-popup'
import AmplifyPopup from './compontents/judge/amplify-popup'
import Judge from './judgeSDK/judge'
import {defaultJudgeConfigObj} from './judgeSDK/utils//judge-common'
import EndPoPup from './compontents/judge/EndPopup';
import LoadingPopup from './compontents/judge/LoadingPopup';
import DeductedPopup from './compontents/judge/DeductionPopup';
import AmplifyPopup from './compontents/judge/AmplifyPopup';
import Judge from './judgeSDK/judge';
import { defaultJudgeConfigObj } from './judgeSDK/utils//judge-common';
import {
Project, ProjectObj, MarkRule, CDSBInfo,
SYSTEMPARMARR,CARINFO ,MAPPOINT ,MAPITEMPOINTITEM,SYSSET
} from './judgeSDK/api/judgeSDK.d'
import { getCurrentTime, formatTime, getCurrentHourTime,chunkArr } from '../common/utils/tools'
import { examJudgeEndExam } from './judgeSDK/api/index'
import { getSyncData } from '../common/service/initable'
import { judgeConfig } from './judgeSDK/utils/judge-config'
CARINFO,
CDSBInfo,
MAPITEMPOINTITEM,
MAPPOINT,
MarkRule,
Project,
ProjectObj,
SYSSET,
SYSTEMPARMARR
} from './judgeSDK/api/judgeSDK.d';
import { chunkArr, formatTime, getCurrentHourTime, getCurrentTime } from '../common/utils/tools';
import { examJudgeEndExam } from './judgeSDK/api/index';
import { getSyncData } from '../common/service/initable';
import { judgeConfig } from './judgeSDK/utils/judge-config';
import FileUtil from '../common/utils/File';
import SignDisplayCom from './compontents/signDisplayCom'
import {testMarkRules} from './judgeSDK/dataTest/index'
import SignDisplayCom from './compontents/signDisplayCom';
@Entry
@Component
struct Index {
scroller: Scroller = new Scroller()
//页面通用字体大小
@State FONTSIZE: number = 28
@State BIGFONTSIZE: number = 28
//结束考试弹窗
@State endPopupVisible: boolean = false
//等待弹窗(考试及格,考试不及格使用)
@State loadingPopupVisible: boolean = false
//实时轨迹弹窗
@State signDisplayComVisible: boolean = false
@State isDdxk: boolean = false;
@State time: string = ''
//考试用时
@State examTime: number = 0
//开始时间
@State startTime: string = '00:00:00'
@State startFullTime: string = ''
@State startHourTime: string = ''
//科目类型
@State examSubject: 2 | 3 = 3;
@State ddxkTime: number = 0;
@State ddxkKsxmArr: string[] = ['']
@State ddxkKfArr: string[] = ['']
@State xmmcStr: string = ''
@State carztStr: string = ''
@State kfArr: {
xmmcStr?: string,
score: string,
desc: string
}[] = []
@State name: string = ''
@State idCard: string = ''
@State totalScore: number = 100
//模拟考试项目
@State projects: Project[] = []
@State projectsObj: ProjectObj = {}
@State projectsCenterObj: ProjectObj = {}
@State markRuleListObj: MarkRule = {}
@State cdsbInfoObj: CDSBInfo = {}
@State timer: number = 0
@State judgeConfig: { [k: string]: string }[] = []
@State judgeConfigObj: { [k: string]: any } = defaultJudgeConfigObj
//流水号
@State lsh: string = ''
@State kszp: string = ''
@State ksdd: string = ''
@State kssycs: string = ''
@State kslx: string = ''
//监管接口序列号
@State serialNumber: number = 0
@State carType: string = ''
@State carName: string = ''
@State isDeductedPopShow: boolean = false
@State isAmplifyPopShow: boolean = false
@State amplifiedImgIndex: number = 0
@State judge: any = {}
//行驶距离
@State jl: number = 0
//应考里程
@State examMileage: string = '0'
@State artSubject3Projects: string[] = ['直线', '会车', '变道', '超车', '掉头', '停车']
@State artSubject3ProjectsCodesArr: string[] = ['3', '9', '4', '10', '12', '11']
@State manualMarkRules: MarkRule[] = []
//科目三评判初始化数据
@State systemparmArr: SYSTEMPARMARR[] = []
@State mapPointItemArr: MAPITEMPOINTITEM[] = []
@State carinfoArrr: CARINFO[] = []
@State mapPointArr: MAPPOINT[] = []
private context = getContext(this) as common.UIAbilityContext;
private img: ImageBitmap = new ImageBitmap("/resources/base/media/1.png")
//已考的考试项目
private wantInfos = []
async aboutToAppear() {
globalThis.windowClass.setWindowSystemBarEnable([''])
@ -75,6 +151,7 @@ struct Index {
await this.initMapPointItem()
}
}
// 查询考车信息
async initCar() {
const result = await getSyncData('ES_CARINFO')
@ -98,8 +175,8 @@ struct Index {
const students = await getSyncData('USER')
const stuInfo = students[0] || {};
const {xm,sfzmhm,lsh,kszp,ksdd,kssycs,kslx} = stuInfo;
this.name = xm;
this.idCard = sfzmhm;
this.name = xm || '测试考生';
this.idCard = sfzmhm || '01234567891010';
this.lsh = lsh;
this.kszp = kszp;
this.ksdd = ksdd;
@ -212,7 +289,7 @@ struct Index {
const projects = this.projects;
if (!projects.length) {
prompt.showToast({
Prompt.showToast({
message: '读取数据库信息失败,请重新考试!',
duration: 8000
});
@ -223,7 +300,7 @@ struct Index {
//初始化systemParam表
async initSystemKm3Param(sysParam?: SYSTEMPARMARR[]) {
const systemParms: any = sysParam || await getSyncData('MA_SYSTEMPARM')
console.log('systemParms',JSON.stringify(systemParms))
const {isTrajectoryOpen} = judgeConfig
systemParms.forEach((systemParm) => {
@ -239,7 +316,9 @@ struct Index {
const {no1,no2,no3,} = systemParm;
this.systemparmArr.push({
'NO1':no1*1,'NO2':no2*1,'NO3':no3*1,
'NO1': no1 * 1,
'NO2': no2 * 1,
'NO3': no3 * 1,
'TXT1': decodeURIComponent(systemParm.txt1),
'TXT2': decodeURIComponent(systemParm.txt2),
'TXT3': decodeURIComponent(systemParm.txt3),
@ -263,7 +342,7 @@ struct Index {
})
const projects = this.projects;
if (!projects.length) {
prompt.showToast({
Prompt.showToast({
message: '读取数据库信息失败,请重新考试!',
duration: 8000
});
@ -355,7 +434,19 @@ struct Index {
const pointParams = await getSyncData('MA_MAP_POINT')
//@ts-ignore
pointParams.forEach(point => {
const {point_no,gps_e,gps_n,point_no_f,point_type,road_code,gps_e_Location,gps_n_Location,f_gps_e,f_gps_n,passed} = point;
const {
point_no,
gps_e,
gps_n,
point_no_f,
point_type,
road_code,
gps_e_Location,
gps_n_Location,
f_gps_e,
f_gps_n,
passed
} = point;
this.mapPointArr.push({
point_no: point_no * 1,
gps_e: gps_e * 1,
@ -405,11 +496,10 @@ struct Index {
? await this.initSystemKm2Param(systemparm)
: await this.initSystemKm3Param(systemparm)
//@ts-ignore
await this.initMarkRules(testMarkRules);
await this.initMarkRules(initDataObj.mark);
await this.initSysset(initDataObj.sysset);
}
build() {
Column() {
Row() {
@ -468,7 +558,10 @@ struct Index {
if (this.examSubject == 3) {
Row() {
if (this.judgeConfigObj['375'] == '0') {
Text(`应行驶:${this.examMileage}m`).fontColor('#E5CCA1').fontSize(this.FONTSIZE).padding({right:20})
Text(`应行驶:${this.examMileage}m`)
.fontColor('#E5CCA1')
.fontSize(this.FONTSIZE)
.padding({ right: 20 })
}
Text(`已行驶:${this.jl}m`).fontColor('#FFAD33').fontSize(this.FONTSIZE)
}
@ -482,8 +575,11 @@ struct Index {
Row() {
Text(this.carztStr).fontColor('#FFA500').fontSize(this.FONTSIZE)
}.height(40)
Row() {
Flex({ direction: FlexDirection.Column }) {
if (this.kfArr.length) {
List({}) {
ForEach(this.kfArr, (item) => {
ListItem() {
@ -506,6 +602,19 @@ struct Index {
}.margin({ bottom: 25 })
})
}.padding({ left: 15, right: 15, top: 30, bottom: 5 })
} else {
Column() {
Row() {
Text('暂无扣分项').fontSize(this.BIGFONTSIZE).fontColor('#FFF')
}
.width('100%')
.backgroundColor('#38260B')
.justifyContent(FlexAlign.SpaceBetween)
.padding({ top: 12, bottom: 12, left: 8, right: 3 })
}.margin({ top: 35 }).padding({ left: 20, right: 20 }).alignItems(HorizontalAlign.Start)
}
}
.backgroundImage($rawfile('judge/score_bg.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
@ -523,54 +632,96 @@ struct Index {
Row() {
//#FF7566 #00FFD5 #E6DECF
// Text(this.projectsObj[item[0].projectCode])
Text(item[0].abbreviation).fontSize(item[0].abbreviation.length > 5?28:32).fontColor(this.getProjectColor(this.projectsObj[item[0].projectCode].type))
}.backgroundImage($rawfile('judge/project_item.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width('48.5%').height(115).margin({bottom:5}).justifyContent(FlexAlign.Center)
Text(item[0].abbreviation)
.fontSize(item[0].abbreviation.length > 5 ? 28 : 32)
.fontColor(this.getProjectColor(this.projectsObj[item[0].projectCode].type))
}
.backgroundImage($rawfile('judge/project_item.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.width('48.5%')
.height(115)
.margin({ bottom: 5 })
.justifyContent(FlexAlign.Center)
if (item[1]) {
Row() {
//#FF7566 #00FFD5 #E6DECF
Text(item[1].abbreviation).fontSize(item[1].abbreviation.length > 5?28:32).fontColor(this.getProjectColor(this.projectsObj[item[1].projectCode].type))
}.backgroundImage($rawfile('judge/project_item.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width('48.5%').height(115).margin({left:5,bottom:5}).justifyContent(FlexAlign.Center)
Text(item[1].abbreviation)
.fontSize(item[1].abbreviation.length > 5 ? 28 : 32)
.fontColor(this.getProjectColor(this.projectsObj[item[1].projectCode].type))
}
.backgroundImage($rawfile('judge/project_item.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.width('48.5%')
.height(115)
.margin({ left: 5, bottom: 5 })
.justifyContent(FlexAlign.Center)
}
}
}
});
}
}.backgroundImage($rawfile('judge/project_bg.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width('57%').height('100%').padding(30).margin({right:10})
}
.backgroundImage($rawfile('judge/project_bg.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.width('57%')
.height('100%')
.padding(30)
.margin({ right: 10 })
}
//科目三
if (this.examSubject == 3) {
Column() {
Flex({wrap:FlexWrap.Wrap,direction:FlexDirection.Row,justifyContent:FlexAlign.SpaceBetween}){
Flex({
wrap: FlexWrap.Wrap,
direction: FlexDirection.Row,
justifyContent: FlexAlign.SpaceBetween
}) {
List({}) {
ForEach(this.projects, (project) => {
ListItem() {
Text(project.name) {
}.fontColor(this.getProjectColor(this.projectsObj[project.projectCode].type)).margin({bottom:5}).fontSize(26)
}
.fontColor(this.getProjectColor(this.projectsObj[project.projectCode].type))
.margin({ bottom: 5 })
.fontSize(26)
}.margin({ bottom: 8 })
})
}.lanes(2).margin({ left: 25 })
}.width('100%').height('50%').backgroundImage($rawfile('judge/project_km3_bg.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).padding(30).margin({right:5})
}
.width('100%')
.height('50%')
.backgroundImage($rawfile('judge/project_km3_bg.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.padding(30)
.margin({ right: 5 })
Flex({ wrap: FlexWrap.Wrap, direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceAround }) {
List() {
ForEach(this.artSubject3Projects, (item, index) => {
ListItem(){}.backgroundImage(
ListItem() {
}
.backgroundImage(
$rawfile(
`judge/km3/${this.getIsExitManualProject(index) ? item : (item + '_gray')}.png`
), ImageRepeat.NoRepeat)
.backgroundImageSize({width:'100%',height:'100%'}).width(174).height(118).margin({bottom:15})
.backgroundImageSize({ width: '100%', height: '100%' })
.width(174)
.height(118)
.margin({ bottom: 15 })
.onClick(() => {
if (this.getIsExitManualProject(index)) {
// 靠边停车时候可以触发
if (this.judgeConfigObj['343'] == 0) {
const xmmcStr = this.xmmcStr;
if (xmmcStr == '无' || xmmcStr == '') {
this.amplifiedImgIndex = index;this.isAmplifyPopShow = true
this.amplifiedImgIndex = index;
this.isAmplifyPopShow = true
} else {
if (index === 5) {
prompt.showToast({
Prompt.showToast({
message: `${xmmcStr}未结束,不允许靠边停车`,
duration: 8000
});
@ -578,14 +729,21 @@ struct Index {
}
} else {
this.amplifiedImgIndex = index;this.isAmplifyPopShow = true
this.amplifiedImgIndex = index;
this.isAmplifyPopShow = true
}
}
})
})
}.lanes(3).margin({ left: 5, top: 18 })
}
}.backgroundImage($rawfile('judge/project_bg.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(660).height(640).padding(44).margin({right:10})
}
.backgroundImage($rawfile('judge/project_bg.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.width(660)
.height(640)
.padding(44)
.margin({ right: 10 })
}
}.margin({ top: 15 }).height('80%').justifyContent(FlexAlign.SpaceBetween)
}.width('100%').height('100%').alignItems(HorizontalAlign.Start).margin({ top: 10 })
@ -622,9 +780,19 @@ struct Index {
Column() {
if (this.examSubject == 3) {
Row() {
Row(){}.width(60).height(60).backgroundImage($rawfile('judge/manual_judge.png'), ImageRepeat.NoRepeat).backgroundImageSize({ width: '100%', height: '100%' })
Row() {
}
.width(60)
.height(60)
.backgroundImage($rawfile('judge/manual_judge.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
Text('人工评判').fontColor('#FFF').fontSize(32).padding({ right: 12 })
}.width(334).height(110).justifyContent(FlexAlign.Center).alignItems(VerticalAlign.Center)
}
.width(334)
.height(110)
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.backgroundImage($rawfile('judge/button_nor.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.margin({ bottom: 10 })
@ -632,7 +800,7 @@ struct Index {
if (this.judgeConfigObj['342'] == 0) {
this.isDeductedPopShow = true
} else {
prompt.showToast({
Prompt.showToast({
message: '平台配置不允许人工评判!',
duration: 4000
});
@ -640,16 +808,26 @@ struct Index {
})
}
Row() {
Row(){}.width(60).height(60).backgroundImage($rawfile('judge/phone.png'), ImageRepeat.NoRepeat).backgroundImageSize({ width: '100%', height: '100%' })
Row() {
}
.width(60)
.height(60)
.backgroundImage($rawfile('judge/phone.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
Text('呼叫请求').fontColor('#FFF').fontSize(32).padding({ right: 12 })
}.width(334).height(110).justifyContent(FlexAlign.Center).alignItems(VerticalAlign.Center)
}
.width(334)
.height(110)
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.backgroundImage($rawfile('judge/button_nor.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.margin({ bottom: 10 })
Row() {}
Row() {
}
.width(334)
.height(100)
.backgroundImage($rawfile('judge/anniu_nor.png'), ImageRepeat.NoRepeat)
@ -658,7 +836,7 @@ struct Index {
if (this.judgeConfigObj['353'] == '0') {
this.endPopupVisible = true
} else {
prompt.showToast({
Prompt.showToast({
message: '车上不允许手动结束考试!',
duration: 4000
});
@ -710,7 +888,8 @@ struct Index {
msgStr: this.judge.plcStr || ''
}).margin({ top: 100 })
Row() {}
Row() {
}
.width(240)
.height(240)
.position({ x: '81%', y: 80 })
@ -730,7 +909,9 @@ struct Index {
return project.type == '2' ? project.projectCode : ''
}).filter(project => project !== ''),
markRules: this.manualMarkRules,
closePopup:()=>{this.isDeductedPopShow = false},
closePopup: () => {
this.isDeductedPopShow = false
},
confirmMark: async (itemno, serial) => {
const judge = this.judge
await judge.setJudgeMark(itemno, serial);
@ -804,82 +985,4 @@ struct Index {
return true
}
//页面通用字体大小
@State FONTSIZE: number = 28
@State BIGFONTSIZE: number = 28
//结束考试弹窗
@State endPopupVisible: boolean = false
//等待弹窗(考试及格,考试不及格使用)
@State loadingPopupVisible: boolean = false
//实时轨迹弹窗
@State signDisplayComVisible: boolean = false
@State isDdxk: boolean = false;
@State time: string = ''
//考试用时
@State examTime: number = 0
//开始时间
@State startTime: string = '00:00:00'
@State startFullTime: string = ''
@State startHourTime: string = ''
//科目类型
@State examSubject: 2 | 3 = 3;
@State ddxkTime: number = 0;
@State ddxkKsxmArr: string[] = ['']
@State ddxkKfArr: string[] = ['']
@State xmmcStr: string = ''
@State carztStr: string = ''
@State kfArr: {
xmmcStr?: string,
score: string,
desc: string
}[] = []
@State name: string = ''
@State idCard: string = ''
@State totalScore: number = 100
//模拟考试项目
@State projects: Project[] = []
@State projectsObj: ProjectObj = {}
@State projectsCenterObj: ProjectObj = {}
@State markRuleListObj: MarkRule = {}
@State cdsbInfoObj: CDSBInfo = {}
@State timer: number = 0
@State judgeConfig: {[k:string]:string}[] = []
@State judgeConfigObj: {[k:string]:any} = defaultJudgeConfigObj
//流水号
@State lsh: string = ''
@State kszp: string = ''
@State ksdd: string = ''
@State kssycs: string = ''
@State kslx: string = ''
//监管接口序列号
@State serialNumber: number = 0
@State carType: string = ''
@State carName: string = ''
@State isDeductedPopShow: boolean = false
@State isAmplifyPopShow: boolean = false
@State amplifiedImgIndex: number = 0
@State judge:any = {}
//行驶距离
@State jl:number =0
//应考里程
@State examMileage:string = '0'
//已考的考试项目
private wantInfos = []
@State artSubject3Projects: string[] = ['直线', '会车', '变道','超车', '掉头', '停车']
@State artSubject3ProjectsCodesArr: string[] = ['3', '9', '4','10', '12', '11']
@State manualMarkRules:MarkRule[] = []
//科目三评判初始化数据
@State systemparmArr:SYSTEMPARMARR[] = []
@State mapPointItemArr:MAPITEMPOINTITEM[] = []
@State carinfoArrr:CARINFO[] = []
@State mapPointArr:MAPPOINT[] = []
}

View File

@ -1,145 +0,0 @@
import hilog from '@ohos.hilog';
import apiJudgeSdk from 'libJudgeSdk.so';
import Judge from './judgeSDK/utils/judge-real';
import { MarkRule, Project, ProjectObj } from './judgeSDK/api/judgeSDK.d';
import AccountTable from '../common/database/tables/AccountTable';
import MA_SYSSET from '../common//constants/MA_SYSSET';
import common from '@ohos.app.ability.common';
import { getSyncData } from '../common/service/initable';
@Entry
@Component
export default struct Index {
@State message: string = '开始绘制'
// 控制XComponent组件的创建和销毁
@State draw: boolean = false
//监管接口序列号
@State serialNumber: number = 0
//模拟考试项目
@State projects: Project[] = []
@State projectsObj: ProjectObj = {}
@State markRuleListObj: MarkRule = {}
private context = getContext(this) as common.UIAbilityContext;
// xcomponentController: XComponentController = new XComponentController()
build() {
Row() {
Column() {
if (this.draw) {
XComponent({
id: 'duolun_plugin_id_draw', //显示轨迹窗口id名称注意这个ID要和C++侧一致,不能变
type: 'surface',
libraryname: 'JudgeSdk'
})
.width(640)
.height(480)
.onLoad(() => {
apiJudgeSdk.examJudgeMapSetDrawing(true); //停止绘制地图轨迹false:表示结束绘制
hilog.info(0x0000, 'sdk-tag-ets', 'onLoad');
})
.onDestroy(() => {
hilog.info(0x0000, 'sdk-tag-ets', 'onDestroy');
apiJudgeSdk.examJudgeMapSetDrawing(false); //停止绘制地图轨迹false:表示结束绘制
})
} else {
Column() {
}
.width(640 / 2)
.height(480 / 2)
}
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
.fontColor('rgba(255,255,255,0)')
.onClick(() => {
hilog.info(0x0000, 'sdk-tag-ets', 'start render');
// 控制XComponent组件的创建和销毁创建XComponent组件时会调用libentry.so中的模块注册函数Init
this.draw = !this.draw;
clearInterval(globalThis.realTimer)
})
}
.width('100%')
.backgroundColor('#777777')
}
.height('100%')
}
async aboutToAppear() {
await this.initMarkRules();
//初始化项目
await this.initProjectInfo();
//初始化sysset表
await this.initSysset()
const judge = new Judge(this)
}
//获取项目信息
async initProjectInfo() {
const that = this;
const systemParamsArr = await getSyncData('MA_SYSTEMPARM')
const itemInfoArr = await getSyncData('MA_ITEMINFO')
//@ts-ignore
const filterProjectsArr = systemParamsArr.filter(item => item.no1 == 6)
that.projects = filterProjectsArr.map(project => {
//TODO 临时代码
const testType = {
0: 1,
2: 4,
3: 3,
5: 5,
6: 2
}
const currentProject = {
name: decodeURI(project.txt1),
abbreviation: decodeURI(project.txt3),
projectCode: decodeURI(project.no2),
projectCodeCenter: decodeURI(project.txt2),
//@ts-ignore
type: testType[decodeURI(project.no2)*1]
// type:'0' + (project.type || '1')
}
that.projectsObj[project.no2] = currentProject
return currentProject
});
}
//获取扣分代码信息
async initMarkRules() {
const that = this;
const markRuleParams = await getSyncData('MA_MARKRULE')
//@ts-ignore
markRuleParams.forEach(mark => {
that.markRuleListObj[`${mark.itemno}_${mark.markserial}`] = {
itemno: mark.itemno * 1,
markcatalog: mark.markcatalog,
markshow: decodeURI(mark.markshow),
markreal: mark.markreal * 1,
markserial: mark.markserial
};
})
}
// 获取sysset表信息
async initSysset() {
const that = this;
const db = new AccountTable(() => {
}, MA_SYSSET);
const syssetParams = await getSyncData('MA_SYSSET')
//@ts-ignore
const serialNumberArr = syssetParams.filter(sys => sys.v_no === '901');
that.serialNumber = serialNumberArr || '1234567'
}
aboutToDisappear() {
//apiJudgeSdk.stopRender();
}
}

View File

@ -1,75 +1,13 @@
import { GPSData, SignalData } from '../mock';
import { SignalDataType } from '../model';
import signDisplayCom from './compontents/signDisplayCom';
@Entry
@Component
export default struct Index {
@State signArr: Array<any> = []
@State sjxhColum: Array<any> = [
{ key: '左方向灯', value: '0' },
{ key: '右方向灯', value: '0' },
{ key: '喇叭', value: '0' },
{ key: '点火1', value: '0' },
{ key: '点火2', value: '0' },
{ key: '近光灯', value: '0' },
{ key: '远光灯', value: '0' },
{ key: '示廓灯', value: '0' },
{ key: '雾灯', value: '0' },
{ key: '雨刮器', value: '0' },
{ key: '脚刹', value: '0' },
{ key: '手刹', value: '0' },
{ key: '主驾驶门', value: '0' },
{ key: '离合', value: '0' },
{ key: '副刹车', value: '0' },
{ key: '安全带', value: '0' },
{ key: '双跳灯', value: '0' },
{ key: '车速', value: '0' },
{ key: '档位', value: '0' },
{ key: '超声波1', value: '0' },
{ key: '超声波2', value: '0' },
{ key: 'NC', value: '0' },
{ key: 'SA15', value: '0' },
{ key: '其他门', value: '0' },
{ key: '转速过高', value: '0' },
{ key: '累计脉冲', value: '0' },
{ key: '熄火次数', value: '0' },
{ key: '发动机转速', value: '0' },
{ key: '方向盘角度', value: '0' },
{ key: '超声波3', value: '0' },
{ key: '超声波4', value: '0' },
{ key: '触摸1', value: '0' },
{ key: '触摸2', value: '0' },
{ key: '触摸3', value: '0' },
{ key: 'SCIO', value: '0' },
{ key: 'SC1A_C', value: '0' },
{ key: 'SC1B_C', value: '0' },
{ key: 'SC2A_C', value: '0' },
{ key: 'SC2B_C', value: '0' },
{ key: 'SC3A_C', value: '0' },
{ key: 'SC3B_C', value: '0' },
{ key: 'SC4A_C', value: '0' },
{ key: 'SC4B_C', value: '0' },
{ key: 'SC5A_C', value: '0' },
{ key: 'SC5B_C', value: '0' },
{ key: 'SC6A_C', value: '0' },
{ key: 'SC6B_C', value: '0' }
];
@State GPSColum: Array<any> = [
{ key: '状态', value: '0' },
{ key: '收星数', value: '0' },
{ key: '海拔高', value: '0' },
{ key: '高度差', value: '0' },
{ key: '龄期', value: '0' },
{ key: '维度因子', value: '0' },
{ key: '经度因子', value: '0' },
{ key: '航向角', value: '0' },
{ key: '俯仰角', value: '0' },
{ key: '航向角状态-收星数', value: '0' },
{ key: '年月日', value: '0' },
{ key: '时分秒', value: '0' },
{ key: '经度', value: '0' },
{ key: '纬度', value: '0' },
{ key: '速度', value: '0' },
]
@State sjxhColum: Array<SignalDataType> =SignalData;
@State GPSColum: Array<SignalDataType> = GPSData
@State ratio: number = 850 / 960
@State gpsActive: number = 1
@State active: number = 0

View File

@ -88,6 +88,7 @@ struct Index {
gateway: this.inputTextList1[5],//value.gateway网关
netMask: this.inputTextList1[4],//value.netMask网络掩码
dnsServers: this.inputTextList1[6],
// @ts-ignore
domain: ""
}, (error) => {
if (error) {

View File

@ -1,22 +1,21 @@
import { getExaminationItem, getExaminationStudentInfo, examinationStuAbsent, getPhotosForOther } from '../api/userInfo'
import router from '@ohos.router'
import TopLogo from './compontents/TopLogo'
import { examinationStuAbsent, getExaminationItem, getExaminationStudentInfo } from '../api/userInfo';
import router from '@ohos.router';
import TopLogo from './compontents/TopLogo';
import Md5 from '../common/utils/md5';
import AccountTable from '../common/database/tables/AccountTable';
import USER from '../common/constants/USER';
import { dateFormat, getCurrentTime } from '../common/utils/tools';
import { dateFormat, getCurrentTime, string2Bytes } from '../common/utils/tools';
import MA_SYSSET from '../common//constants/MA_SYSSET';
import FaceCompare from './compontents/FaceCompare'
import FaceCompare from './compontents/FaceCompare';
// import { initJudgeUdp } from '../common/utils/UdpJudge'
import { writeObjectOut } from '../api/judge'
import testNapi from "@ohos.idcard";
import { writeObjectOut } from '../api/judge';
import testNapi from '@ohos.idcard';
import common from '@ohos.app.ability.common';
import { User } from './interfaces'
import WebRTCVoice from './webRTC/'
import promptAction from '@ohos.promptAction'
import { CandidateData, EmptyCandidateObject } from "../mock/CandidateData"
import {string2Bytes} from '../common/utils/tools'
import { getSyncData } from '../common/service/initable'
import { User } from './interfaces';
import WebRTCVoice from './webRTC/';
import promptAction from '@ohos.promptAction';
import { CandidateData, EmptyCandidateObject } from '../mock/CandidateData';
@Entry
@Component
struct UserInfo {
@ -38,9 +37,6 @@ struct UserInfo {
@State currentUser: User = EmptyCandidateObject
@State dataList: Array<User> = []
@State list: Array<User> = []
private AccountTable = new AccountTable(() => {
}, USER);
private context = getContext(this) as common.UIAbilityContext;
@State name: string = 'initName';
@State sex: string = '';
@State callBackFlag: boolean = false;
@ -60,6 +56,17 @@ struct UserInfo {
@State FaceOpenStatue: string = '0'; //是否开启人脸识别
subscriber;
@State faceCatchImg: string = ''
private AccountTable = new AccountTable(() => {
}, USER);
private context = getContext(this) as common.UIAbilityContext;
private labelBlocks = [
{ label: '考生姓名', key: 'xm' },
{ label: '身份证号', key: 'sfzmhm' },
{ label: ' 流 水 号 ', key: 'lsh' },
{ label: '考试路线', key: 'kslx' },
{ label: '待考次数', key: 'kssycs' },
{ label: '考官姓名', key: 'ksy1' },
]
async onPageShow() {
//语音功能
@ -75,6 +82,7 @@ struct UserInfo {
this.heartMsg()
}
//身份证读卡器初始化
openDeviceByIDCard() {
globalThis.indexComponent = this;
@ -86,11 +94,13 @@ struct UserInfo {
console.error("zzctest Failed to Open Device");
}
}
stopDeviceById() {
if (this.faceFlag == '1') {
testNapi && testNapi.StopReadCard()
}
}
// 通过身份证获取当前学员
getCurrentStudent(id) {
let flag = false
@ -126,6 +136,7 @@ struct UserInfo {
});
}
}
onReadCard(ret) {
console.info(`zzctest xx Read Card ret =${ret.status}`)
let thisVar = globalThis.indexComponent;
@ -182,6 +193,7 @@ struct UserInfo {
changeQkfn() {
this.qkFn()
}
initData() {
this.stepFlag = false
this.faceCompareSucess = 0
@ -222,6 +234,7 @@ struct UserInfo {
}
})
}
//考点端查询缺考指令内容消息请求
getqkFn() {
let tmpList = [];
@ -236,8 +249,6 @@ struct UserInfo {
globalThis.udpClient2.sendMsg(param, this.context)
}
async initSysset() {
const that = this;
const db = new AccountTable(() => {
@ -253,13 +264,13 @@ struct UserInfo {
const faceParam = syssetParams.filter(sys => sys.v_no === '2313')
that.FaceOpenStatue = faceParam?.[0]?.v_value == '3' ? '1' : '0'
that.FaceOpenStatue = '0'
console.log('that.FaceOpenStatue', that.FaceOpenStatue)
// faceParam?.[0]?.v_value ||
// 1身份证读卡器 2指纹 3人脸
this.faceFlag = faceParam?.[0]?.v_value || '0'
if (faceParam?.[0]?.v_value == '1') {
that.openDeviceByIDCard()
}
console.log('studentRefreshStatue',this.studentRefreshStatue)
//0不自动更新 1自动更新不限次数 2没有考生更新2次
if (that.studentRefreshStatue == '2') {
clearInterval(that.interval)
@ -283,6 +294,7 @@ struct UserInfo {
})
})
}
//人脸比对窗口关闭
changeFaceCompareSuccess() {
console.log('this.faceCompareSuces', this.faceCompareSucess, JSON.stringify(this.currentUser))
@ -307,6 +319,7 @@ struct UserInfo {
this.pageIndex--;
this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4)
}
//获取下载考生
getExaminationStudentInfoFn() {
if (globalThis.singlePlay) {
@ -360,6 +373,7 @@ struct UserInfo {
console.log('error12error' + error)
})
}
qkFn() {
this.faceCompareSucess = 0
if (globalThis.singlePlay) {
@ -396,6 +410,7 @@ struct UserInfo {
})
}
async getExaminationItemFn() {
console.info('surenjun', this.currentUser.lsh)
if (!this.currentUser.lsh || globalThis.singlePlay) {
@ -417,6 +432,7 @@ struct UserInfo {
}
}
//身份比对
async sfbdinterfaceFn() {
this.stepFlag = true
@ -491,14 +507,18 @@ struct UserInfo {
this.stepFlag = false
}
}
aboutToDisappear() {
this.outClick()
}
outClick() {
clearInterval(this.interval)
this.stopDeviceById()
globalThis.udpClient2&&globalThis.udpClient2?.setMsgCallBack(()=>{})
globalThis.udpClient2 && globalThis.udpClient2?.setMsgCallBack(() => {
})
}
// 几个按钮公共样式
@Styles
commStyle(){
@ -509,15 +529,6 @@ struct UserInfo {
.margin({ bottom: 12 * this.ratio })
}
private labelBlocks = [
{ label: '考生姓名', key: 'xm' },
{ label: '身份证号', key: 'sfzmhm' },
{ label: ' 流 水 号 ', key: 'lsh' },
{ label: '考试路线', key: 'kslx' },
{ label: '待考次数', key: 'kssycs' },
{ label: '考官姓名', key: 'ksy1' },
]
build() {
Column() {
TopLogo({ outFlag: $outFlag }).margin({ bottom: 10 })

View File

@ -1,23 +1,16 @@
//@ts-ignore
import util from '@ohos.util';
import { voiceService } from '../../common/service/voiceService'
import { faceCompare } from '../../api/userInfo'
import FileUtil from '../../common/utils/File'
import { VideoConfig } from '../interfaces'
import { voiceService } from '../../common/service/voiceService';
import { faceCompare } from '../../api/userInfo';
import FileUtil from '../../common/utils/File';
import { VideoConfig } from '../interfaces';
import common from '@ohos.app.ability.common';
import { string2Bytes } from '../../common/utils/tools'
import { takePhoto } from '../../common/service/videoService'
import { GlobalConfig } from '../../config/index'
import { string2Bytes } from '../../common/utils/tools';
import { takePhoto } from '../../common/service/videoService';
import { GlobalConfig } from '../../config/index';
import { VideoConfigData } from '../../mock';
@Component
export default struct FaceCompare {
constructor() {
super()
}
@State imageBase64: string = 'data:image/jpeg;base64,'
@Prop sfzh: string;
@Prop lsh: string;
@ -27,46 +20,26 @@ export default struct FaceCompare {
@Link getqkFlag: boolean;
@Link faceCatchImg: string;
@State imageThumbnail: string = '';
private times = 1; //人脸比对失败次数, 超过3次将不会自动比对需要点击重新打开重新触发
private vocObj = null;
@State callBackFlag: boolean = false;
@State @Watch('clearIntervalFn') showFaceCompareFlag: Boolean = false;
@State video_url: string = 'rtsp://admin:12345qwe@192.168.5.41:8000/h264/ch2/main/av_stream'
@State previewUri: Resource = $r('app.media.2_nor')
@State curRate: PlaybackSpeed = PlaybackSpeed.Speed_Forward_1_00_X
@State showControls: boolean = false
private controller: VideoController = new VideoController()
@State isAutoPlay: boolean = true
@State signNum: number = 0;
@State param: VideoConfig = VideoConfigData
private times = 1; //人脸比对失败次数, 超过3次将不会自动比对需要点击重新打开重新触发
private vocObj = null;
private controller: VideoController = new VideoController()
private fileUtil: FileUtil
private interval: any
@State param: VideoConfig = {
spls: '',
videoNum: '1',
faceFlag: false,
pztd: '1',
ljlx: '',
ip: '192.168.7.112',
port: '554',
userName: 'admin',
pwd: '12345qwe',
td1: '1',
td2: '2',
td3: '3',
td4: '4',
videoRecord1: false,
videoRecord2: false,
videoRecord3: false,
videoRecord4: false,
rlls: '1',
spzd4:false,
spzd3:false,
spzd2:false,
spzd1:false,
zdyz:'500',
}
private context = getContext(this) as common.UIAbilityContext;
constructor() {
super()
}
build() {
Column() {
Column() {
@ -239,8 +212,6 @@ export default struct FaceCompare {
console.log('mmmmm8', 9)
}
async heartMsg(context) {
@ -343,8 +314,6 @@ export default struct FaceCompare {
this.controller.start()
}
async aboutToDisappear() {
}

View File

@ -1,93 +1,34 @@
import router from '@ohos.router'
import router from '@ohos.router';
import UdpClient from '../../common/utils/UdpClient';
import FileLog from '../judgeSDK/utils/file-log'
import { voiceService } from '../../common/service/voiceService'
import prompt from '@ohos.prompt'
import RealTime from '../compontents/judge/real-time'
import FileLog from '../judgeSDK/utils/file-log';
import RealTime from '../compontents/judge/RealTime';
import { GPSData, SignalData } from '../../mock';
import { SignalDataType } from '../../model';
@Component
export default struct SignDisplayCom {
constructor() {
super()
}
@State showBack: boolean = false
@State scaleNum: number = 1
@State msg: string = ''
@State signArr: Array<any> = []
@State sjxhColum: Array<any> = [
{ key: '左方向灯', value: '0' }, { key: '右方向灯', value: '0' }, {
key: '喇叭',
value: '0'
}, { key: '点火1', value: '0' }, { key: '点火2', value: '0' }, { key: '近光灯', value: '0' }, {
key: '远光灯',
value: '0'
}, { key: '示廓灯', value: '0' }, { key: '雾灯', value: '0' }, { key: '雨刮器', value: '0' }, {
key: '脚刹',
value: '0'
}, { key: '手刹', value: '0' }, { key: '主驾驶门', value: '0' }, { key: '离合', value: '0' }, {
key: '副刹车',
value: '0'
}, {
key: '安全带',
value: '0'
}, { key: '双跳灯', value: '0' }, { key: '车速', value: '0' }, { key: '档位', value: '0' }, {
key: '超声波1',
value: '0'
}, {
key: '超声波2',
value: '0'
}, {
key: 'NC',
value: '0'
}, { key: 'SA15', value: '0' }, { key: '其他门', value: '0' }, { key: '转速过高', value: '0' }, {
key: '累计脉冲',
value: '0'
}, { key: '熄火次数', value: '0' }, { key: '发动机转速', value: '0' }, { key: '方向盘角度', value: '0' }, {
key: '超声波3',
value: '0'
}, { key: '超声波4', value: '0' }, { key: '触摸1', value: '0' }, { key: '触摸2', value: '0' }, {
key: '触摸3',
value: '0'
}, { key: 'SCIO', value: '0' }
, { key: 'SC1A_C', value: '0' }, { key: 'SC1B_C', value: '0' }, { key: 'SC2A_C', value: '0' }, {
key: 'SC2B_C',
value: '0'
}, { key: 'SC3A_C', value: '0' }, { key: 'SC3B_C', value: '0' }, { key: 'SC4A_C', value: '0' }, {
key: 'SC4B_C',
value: '0'
}, { key: 'SC5A_C', value: '0' }, { key: 'SC5B_C', value: '0' }, { key: 'SC6A_C', value: '0' }, {
key: 'SC6B_C',
value: '0'
}]
@State GPSColum:Array<any>=[
{ key: '状态', value: '0' },
{ key: '收星数', value: '0' },
{ key: '海拔高', value: '0' },
{ key: '高度差', value: '0' },
{ key: '龄期', value: '0' },
{ key: '维度因子', value: '0' },
{ key: '经度因子', value: '0' },
{ key: '航向角', value: '0' },
{ key: '俯仰角', value: '0' },
{ key: '航向角状态-收星数', value: '0' },
{ key: '年月日', value: '0' },
{ key: '时分秒', value: '0' },
{ key: '经度', value: '0' },
{ key: '纬度', value: '0' },
{ key: '速度', value: '0' },
]
@State sjxhColum: Array<SignalDataType> = SignalData
@State GPSColum: Array<SignalDataType> = GPSData
@State ratio: number = 850 / 960
@State gpsActive: number = 1
@Prop active: number = 0
@State msgStr: string = ''
@State interval: any=''
@State interval: number = 0
@State @Watch('outClick') outFlag: boolean = false;
@State url: string = ''
private timer = null
private udpClient: UdpClient = null
private FileLog: FileLog
private vocObj = null;
@State url: string = ''
constructor() {
super()
}
build() {
Column() {
Column() {
@ -259,8 +200,14 @@ export default struct SignDisplayCom {
Text('海拔高:' + this.signArr[85]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
Text('高度差:' + this.signArr[86]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
Text('龄期:' + this.signArr[87]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
Text('维度因子:' + this.signArr[88]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
Text('经度因子:' + this.signArr[89]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
Text('维度因子:' + this.signArr[88])
.fontColor('#FFB433')
.fontSize(14 * this.ratio)
.height(18 * this.ratio)
Text('经度因子:' + this.signArr[89])
.fontColor('#FFB433')
.fontSize(14 * this.ratio)
.height(18 * this.ratio)
Text('航向角:' + this.signArr[90]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
Text('俯仰角:' + this.signArr[91]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
Text('航向角状态-收星数:' + this.signArr[92])
@ -303,6 +250,7 @@ export default struct SignDisplayCom {
})
}.margin({ top: 10 * this.ratio })
Flex({ direction: FlexDirection.Column }) {
ForEach(this.GPSColum, (item) => {
Column() {
@ -325,8 +273,8 @@ export default struct SignDisplayCom {
Row() {
RealTime({
width:Math.floor(550 * this.ratio),
height:Math.floor(380 * this.ratio),
widthNumber: Math.floor(550 * this.ratio),
heightNumber: Math.floor(380 * this.ratio),
})
}
.width(550 * this.ratio)
@ -352,6 +300,7 @@ export default struct SignDisplayCom {
aboutToDisappear() {
clearInterval(this.interval)
}
aboutToAppear() {
this.ratio = this.ratio * (this.scaleNum || 1);
const that = this
@ -445,11 +394,11 @@ export default struct SignDisplayCom {
that.signArr = JSON.parse(JSON.stringify((this.signArr)))
that.GPSColum = JSON.parse(JSON.stringify((this.GPSColum)))
}
outClick() {
}
saveLog() {
}
}

View File

@ -0,0 +1,43 @@
import { AmplifyArr, AmplifyImages } from '../../../mock'
const folder = 'judge/km3/amplify/'
@Component
export default struct EndPopup {
private amplifyImgIndex: number = 0
constructor() {
super()
}
build() {
Column() {
Column() {
}
.width(530)
.height(386)
.backgroundImage($rawfile(`${folder}${AmplifyImages[this.amplifyImgIndex]}`))
.backgroundImageSize({ width: '100%', height: '100%' })
.position({ y: '25%', x: '37%' })
.justifyContent(FlexAlign.Center)
.onClick((e: ClickEvent) => {
this.confirmAmplify(AmplifyArr[this.amplifyImgIndex])
})
}
.width('100%')
.height('100%')
.position({ y: 0 })
.backgroundColor('rgba(0,0,0,0.9)')
.onClick(() => {
this.closeAmplifyPop()
})
}
private closeAmplifyPop: Function = () => {
}
private confirmAmplify: Function = () => {
}
}

View File

@ -5,7 +5,7 @@ interface SEL{
}
@Component
struct DeductedPopup {
export default struct DeductedPopup {
constructor() {
super()
}
@ -150,5 +150,3 @@ struct DeductedPopup {
}.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)')
}
}
export default DeductedPopup

View File

@ -1,6 +1,6 @@
@Component
struct EndPopup {
export default struct EndPopup {
constructor() {
super()
}
@ -23,5 +23,3 @@ struct EndPopup {
}.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)')
}
}
export default EndPopup

View File

@ -1,6 +1,5 @@
@Component
struct LoadingPopup {
export default struct LoadingPopup {
constructor() {
super()
}
@ -17,5 +16,3 @@ struct LoadingPopup {
}.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)')
}
}
export default LoadingPopup

View File

@ -1,39 +1,27 @@
// @ts-nocheck
import hilog from '@ohos.hilog';
import apiJudgeSdk from 'libJudgeSdk.so';
// import apiJudgeSdk from '@ohos.judgesdk';
import Judge from '../../judgeSDK/utils/judge-real'
// import Judge from '../../judgeSDK/judge-track-playback'
import {Project,ProjectObj,MarkRule} from '../../judgeSDK/api/judgeSDK.d'
import AccountTable from '../../../common/database/tables/AccountTable';
import MA_SYSSET from '../../../common//constants/MA_SYSSET';
import Judge from '../../judgeSDK/utils/judge-real';
import { MarkRule, Project, ProjectObj } from '../../judgeSDK/api/judgeSDK.d';
import common from '@ohos.app.ability.common';
import { getSyncData } from '../../../common/service/initable'
import {testAllitems,testUIAllitems,testMarkRules} from '../../judgeSDK/dataTest/index'
@Component
struct RealTime {
constructor() {
super()
}
private height:number = 0
private width:number = 0
export default struct RealTime {
@State message: string = '开始绘制'
// 控制XComponent组件的创建和销毁
@State draw: boolean = false
//监管接口序列号
@State serialNumber: number = 0
//模拟考试项目
@State projects: Project[] = []
@State projectsObj: ProjectObj = {}
@State markRuleListObj: MarkRule = {}
private widthNumber: string | number | Resource = 0
private heightNumber: string | number | Resource = 0
private context = getContext(this) as common.UIAbilityContext;
constructor() {
super()
}
// xcomponentController: XComponentController = new XComponentController()
build() {
@ -46,8 +34,8 @@ struct RealTime {
libraryname: 'JudgeSdk'
// libraryname: 'judgesdk'
})
.width(this.width)
.height(this.height)
.width(this.widthNumber)
.height(this.heightNumber)
.onLoad(() => {
apiJudgeSdk.examJudgeMapSetDrawing(true); //停止绘制地图轨迹false:表示结束绘制
})
@ -57,9 +45,10 @@ struct RealTime {
clearInterval(globalThis.realTimer)
})
} else {
Column() {}
.width(this.width)
.height(this.height)
Column() {
}
.width(this.widthNumber)
.height(this.heightNumber)
}
}
.width('100%')
@ -77,7 +66,5 @@ struct RealTime {
//apiJudgeSdk.stopRender();
}
}
export default RealTime

View File

@ -1,39 +0,0 @@
const folder = 'judge/km3/amplify/'
const amplifyImgs = [
'km_zxB.png','km_hcB.png',
'km_bdB.png',
'km_ccB.png','km_dtB.png','km_tcB.png',
]
const amplifyArrs = [
{name:'直线',projectCode:'3',projectCodeCenter:'40300'},
{name:'会车',projectCode:'9',projectCodeCenter:'41300'},
{name:'变道',projectCode:'4',projectCodeCenter:'40500'},
{name:'超车',projectCode:'10',projectCodeCenter:'41400'},
{name:'掉头',projectCode:'12',projectCodeCenter:'41500'},
{name:'停车',projectCode:'11',projectCodeCenter:'40600'},
]
@Component
struct EndPopup {
constructor() {
super()
}
private amplifyImgIndex:number = 0
private closeAmplifyPop:Function = ()=>{}
private confirmAmplify:Function = ()=>{}
build(){
Column(){
Column(){
}.width(530).height(386).backgroundImage($rawfile(`${folder}${amplifyImgs[this.amplifyImgIndex]}`)).backgroundImageSize({width:'100%',height:'100%'}).position({y:'25%',x:'37%'}).justifyContent(FlexAlign.Center)
.onClick((e:ClickEvent)=>{
this.confirmAmplify(amplifyArrs[this.amplifyImgIndex])
})
}.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.9)')
.onClick(()=>{this.closeAmplifyPop()})
}
}
export default EndPopup

View File

@ -1,25 +0,0 @@
@Component
export default struct EndPopup {
constructor() {
super()
}
private title:string = ''
private cancelFn:(event?: ClickEvent) => void
private confirmFn:(event?: ClickEvent) => void
build(){
Column(){
Column(){
Text(this.title).fontSize(38).margin({bottom:20})
Row(){}.height(50)
Row(){
Text('取消').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(250).height(100).fontSize(30).fontColor('#FFF').textAlign(TextAlign.Center).onClick(this.cancelFn)
Text('确定').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(250).height(100).fontSize(30).fontColor('#FFF').textAlign(TextAlign.Center).margin({left:45}).onClick(this.confirmFn)
}
}.width('80%').height('70%').backgroundColor('#E6E3DF').borderRadius(38).position({y:'12%',x:'10%'}).justifyContent(FlexAlign.Center)
}.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)')
}
}

View File

@ -3116,7 +3116,6 @@ export const testMarkRules = [{
}, {
"itemno": "41",
"markcatalog": "41603",
"markdepend": "通过急弯、坡路、拱桥、人行横道或者没有交通信号灯控制的路口时,不交替使用远近光灯示意",
"markreal": "-100",

File diff suppressed because it is too large Load Diff

View File

@ -301,6 +301,56 @@ export const plcStrToWXJson = async (plc:string) =>{
return wuXiDataStr
}
export const senorToWXDataStr= async (tempData) => {
const {sensor,gps} = tempData;
const timeStr = await getTimeStr()
const {mkg,aqd,dh1,dh2, zfxd, yfxd, jgd, ygd,ssc , jsc, lhq, fsc, lb, ygq,wd} = sensor
const judgeSignal = [
//车门 安全带 熄火 发动机启动 左转向 右转向 前照灯近灯 前照灯远灯
mkg, aqd, dh1, dh2, zfxd, yfxd, jgd, ygd,
// 注车制动 行车制动 离合器 副制动 喇叭 雨刷 危险报警灯 示廓灯 系统未涉及的传感器信号
ssc , jsc, lhq, fsc, lb, ygq, 0, 0, 0
]
const judgeAnotherSignal = [
// 低三挡位 左侧单边桥1 左侧单边桥2 右侧单边桥1 右侧单边桥2 雾灯
'000', '0', '0', '0', '0', '0',,'0',
// 桩杆全无信号 左后绕车 右后绕车 右前绕车 左前绕车
'000', '0', '0', '0', '0', '0','0'
]
//@ts-ignore
const str1 = (judgeSignal.join('')*1).toString(16);
//@ts-ignore
const str2 = (judgeAnotherSignal.join('')*1).toString(16);
const wuXiData = [
// 卫星时间 精度 纬度 高度 方位角 俯仰角 速度角 速度 横滚 卫星定位状态
'$KSXT', timeStr, gps.jd, gps.wd, gps.hbg, gps.hxj, gps.fyj, '0' , gps.sd, '0', gps.dwzt,
//前天线可用星数 后天线可用星数 东向坐标位置 北向位置坐标 天向位置坐标 东向速度 北向速度 天向速度
'0', '0', '0', '0', '0', '0', '0', '0','0',
//@ts-ignore 评判信号1 评判信号2 发动机转速
// (judgeSignal.join('')*1).toString(16), (judgeAnotherSignal.join('')*1).toString(16) , sensor.fdjzs,
'0006', '0001' , sensor.fdjzs,
'0xFFFFFFF'
]
return wuXiData.map(d => (d + '')).join(',');
// console.log('wuXiData',wuXiData.join(','));
}
export const getTimeStr = async () =>{
const date = await systemTime.getDate()
const timeStr = '';
const Y = date.getFullYear();
const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) ;
const D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
const h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours());
const m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes());
const s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds());
const ss = (date.getMilliseconds() +'').slice(0,2);
return timeStr + Y + M +D +h +m +s +'.' + ss
}
//蓝灯
export function sendBlue(){
const arrBlue = [0x55, 0xaa, 0x01, 0x00, 0x02, 0x01, 0x03, 0x00];

View File

@ -3,15 +3,14 @@
//考试回放开关
export const judgeConfig = {
//本地目录开关
isTrajectoryOpen: false,
isTrajectoryOpen: true,
//是否开启Udp
udpOpen:false,
// 本地模型地址
modelPath: 'models/model_enc',
// 轨迹回放地址
trajectoryPath: 'logs/2024_06_18/0000000000001_342323199501470011_测试学员1_2024_06_18_14_32_25/judge_exam_data.txt'
trajectoryPath: 'logs/2024_06_18/0000000000001_342323199501470011_测试学员1_2024_06_26_10_04_23/judge_exam_data.txt'
}
//0000000000001_342323199501470011_测试学员1_2024_04_28_10_59_44
// 模拟灯光轨迹
// test_sub3_car_test_jinan-32038219990808021X-20240417092356.txt

View File

@ -1,11 +1,5 @@
import {
examJudgeSetLogCallback,
examJudgeBeginExam,
examJudgeInit,
examJudgeRealExam,
examJudgeSetRealExamCallback,
examJudgeMapSetParam,
examJudgeMapSetDrawing,
examJudgeMapSetScaling
} from '../api/index'
import systemTime from '@ohos.systemDateTime';

View File

@ -1,4 +1,5 @@
import prompt from '@ohos.prompt'
import Prompt from '@system.prompt'
const TAG = 'SURENJUN_JUDGE'
export default class JudgeTask{
@ -17,8 +18,8 @@ export default class JudgeTask{
try {
await currentTask();
}catch (e){
console.info(TAG,'过程数据接口解析错误')
prompt.showToast({
// console.info(TAG,'过程数据接口解析错误')
Prompt.showToast({
message: '过程数据接口解析错误',
duration: 3000
});

View File

@ -1,5 +1,5 @@
import media from '@ohos.multimedia.media';
import prompt from '@ohos.prompt';
import Prompt from '@system.prompt';
const TAG = 'VoiceAnnounce'
@ -84,7 +84,7 @@ class AVPlayer {
url = await globalThis.context.resourceManager.getRawFd(name);
this.avPlayer.fdSrc = url;
} catch (e) {
prompt.showToast({
Prompt.showToast({
message: `${name}语音文件不存在`,
duration: 4000
});

View File

@ -9,7 +9,6 @@
"pages/TerminalInfos",
"pages/VideoConfig",
"pages/SignDisplay",
"pages/RealTime",
"pages/Roads",
"pages/Judge"
],

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More