Compare commits
No commits in common. "e6f5e564cfbb4c71fc233a094888e9c875e3fced" and "747f88e65acab4d53ec249d2bdbcea6342b6b878" have entirely different histories.
e6f5e564cf
...
747f88e65a
@ -24,12 +24,11 @@ export async function setCurrentTime():Promise<void> {
|
|||||||
let times = new Date(currentTime).getTime();
|
let times = new Date(currentTime).getTime();
|
||||||
console.log('jiangsong:times==' + times);
|
console.log('jiangsong:times==' + times);
|
||||||
try {
|
try {
|
||||||
await systemTime.setTime(times)
|
systemTime.setTime(times).then(() => {
|
||||||
// systemTime.setTime(times).then(() => {
|
console.info(`Succeeded in setting time.`);
|
||||||
// console.info(`Succeeded in setting time.`);
|
}).catch((error) => {
|
||||||
// }).catch((error) => {
|
console.info(`Failed to set time. message: ${error.message}, code: ${error.code}`);
|
||||||
// console.info(`Failed to set time. message: ${error.message}, code: ${error.code}`);
|
});
|
||||||
// });
|
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.info(`Failed to set time. message: ${e.message}, code: ${e.code}`);
|
console.info(`Failed to set time. message: ${e.message}, code: ${e.code}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,7 +33,7 @@ const FILE_ASSET_FETCH_COLUMNS = [photoAccessHelper.PhotoKeys.URI,
|
|||||||
|
|
||||||
// const rtsp_server = record.createServer();
|
// const rtsp_server = record.createServer();
|
||||||
|
|
||||||
export async function startRecordVideo(param, td, context, dir, path?,index?) {
|
export async function startRecordVideo(param, td, context, dir, path?) {
|
||||||
return new Promise(async (reslove, reject) => {
|
return new Promise(async (reslove, reject) => {
|
||||||
// const fileUtil = new FileUtil(globalThis.context)
|
// const fileUtil = new FileUtil(globalThis.context)
|
||||||
// const date=dateFormat(new Date).split(' ')[0]
|
// const date=dateFormat(new Date).split(' ')[0]
|
||||||
@ -47,7 +47,7 @@ export async function startRecordVideo(param, td, context, dir, path?,index?) {
|
|||||||
if (!path) {
|
if (!path) {
|
||||||
fileName = `movie_record${num}.mp4`
|
fileName = `movie_record${num}.mp4`
|
||||||
} else {
|
} else {
|
||||||
fileName = `${path}_${index||num}.mp4`
|
fileName = `${path}.mp4`
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -101,18 +101,18 @@ export async function saveStartRecordVideo(path) {
|
|||||||
if (param['videoRecord'+i]) {
|
if (param['videoRecord'+i]) {
|
||||||
console.log('pathpath0',path)
|
console.log('pathpath0',path)
|
||||||
|
|
||||||
record_handle[i] = await getfilehandleCode(i, param, date, path,i)
|
record_handle[i] = await getfilehandleCode(i, param, date, path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
reslove(record_handle)
|
reslove(record_handle)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getfilehandleCode(td, param, dir, path,index) {
|
async function getfilehandleCode(td, param, dir, path) {
|
||||||
return new Promise(async (reslove, reject) => {
|
return new Promise(async (reslove, reject) => {
|
||||||
console.log('pathpath1',path)
|
console.log('pathpath1',path)
|
||||||
|
|
||||||
const record_handle = await startRecordVideo(param, td, globalThis.context, dir, path,index)
|
const record_handle = await startRecordVideo(param, td, globalThis.context, dir, path)
|
||||||
// this.rocordHandleObj['rocord_handle'+td] = record_handle
|
// this.rocordHandleObj['rocord_handle'+td] = record_handle
|
||||||
reslove(record_handle)
|
reslove(record_handle)
|
||||||
})
|
})
|
||||||
@ -137,8 +137,6 @@ export async function getUserAlbumItemByDisplayName(displayName: string): Promis
|
|||||||
console.log('get getUserAlbumItemByDisplayName, count: ' + JSON.stringify(fetchResult));
|
console.log('get getUserAlbumItemByDisplayName, count: ' + JSON.stringify(fetchResult));
|
||||||
if (fetchResult.getCount() > 0) {
|
if (fetchResult.getCount() > 0) {
|
||||||
const albums = await fetchResult.getLastObject();
|
const albums = await fetchResult.getLastObject();
|
||||||
console.log('get getUserAlbumItemByDisplayName album111',albums.albumName)
|
|
||||||
|
|
||||||
if(isSevenDaysAgo(albums.albumName)){
|
if(isSevenDaysAgo(albums.albumName)){
|
||||||
deleteAllFileByPiC(albums.albumName,2)
|
deleteAllFileByPiC(albums.albumName,2)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,6 +92,7 @@ export class voiceService {
|
|||||||
}
|
}
|
||||||
// 以下为使用资源管理接口获取打包在HAP内的媒体资源文件并通过fdSrc属性进行播放示例
|
// 以下为使用资源管理接口获取打包在HAP内的媒体资源文件并通过fdSrc属性进行播放示例
|
||||||
avPlayerFdSrc(name) {
|
avPlayerFdSrc(name) {
|
||||||
|
|
||||||
globalThis.context.resourceManager.getRawFd(name,async (error, value) => {
|
globalThis.context.resourceManager.getRawFd(name,async (error, value) => {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
console.log(`jiangsong callback getRawFd failed error code: ${error.code}, message: ${error.message}.`);
|
console.log(`jiangsong callback getRawFd failed error code: ${error.code}, message: ${error.message}.`);
|
||||||
|
|||||||
@ -42,7 +42,7 @@ export default class GetDistance {
|
|||||||
const content = await fileUtil.readFile(`${folderPath}/${date}.txt`) || '';
|
const content = await fileUtil.readFile(`${folderPath}/${date}.txt`) || '';
|
||||||
const contentArr = content.split('\n').filter(item => item)
|
const contentArr = content.split('\n').filter(item => item)
|
||||||
console.info('surenjun contentArr',JSON.stringify(contentArr))
|
console.info('surenjun contentArr',JSON.stringify(contentArr))
|
||||||
this.totalDistance += (str * 1 > 200 ? 200 : str*1)
|
this.totalDistance += str * 1
|
||||||
this.totalTime += 1;
|
this.totalTime += 1;
|
||||||
contentArr[contentArr.length - 1] = `程序启动时间:${timeStr} 累计行驶距离:${(this.totalDistance).toFixed(2)}m 累计运行时常:${Math.ceil(this.totalTime/60)}min`+ '\n'
|
contentArr[contentArr.length - 1] = `程序启动时间:${timeStr} 累计行驶距离:${(this.totalDistance).toFixed(2)}m 累计运行时常:${Math.ceil(this.totalTime/60)}min`+ '\n'
|
||||||
console.info('surenjun',contentArr.join('\n'))
|
console.info('surenjun',contentArr.join('\n'))
|
||||||
|
|||||||
@ -27,7 +27,7 @@ export async function getTCP() {
|
|||||||
})
|
})
|
||||||
await globalThis.TcpClient.onMessage((val) => {
|
await globalThis.TcpClient.onMessage((val) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
globalThis.TcpClient.sendMsg(globalThis.carInfo?.carNo||'1002') //1002
|
globalThis.TcpClient.sendMsg('1002') //1002
|
||||||
if (val) {
|
if (val) {
|
||||||
// const msg=val.substring(5,val.length-1)
|
// const msg=val.substring(5,val.length-1)
|
||||||
console.log('socketTag[PLC.UdpClient] status:', globalThis.udpClient.getStatus())
|
console.log('socketTag[PLC.UdpClient] status:', globalThis.udpClient.getStatus())
|
||||||
@ -54,7 +54,7 @@ export async function getTCP() {
|
|||||||
await globalThis.TcpClient.onMessage((val) => {
|
await globalThis.TcpClient.onMessage((val) => {
|
||||||
hilog.info(0x0000, 'testTag', "valvalval2" + JSON.stringify(val));
|
hilog.info(0x0000, 'testTag', "valvalval2" + JSON.stringify(val));
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
globalThis.TcpClient.sendMsg(globalThis.carInfo?.carNo||'1002') //1002
|
globalThis.TcpClient.sendMsg('1002') //1002
|
||||||
if (val && globalThis.udpClient?.sendMsg) {
|
if (val && globalThis.udpClient?.sendMsg) {
|
||||||
globalThis.udpClient?.sendMsg(val)
|
globalThis.udpClient?.sendMsg(val)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -298,8 +298,7 @@ export async function setJudgeUdp() {
|
|||||||
|
|
||||||
if (config && config.udplocalIp) {
|
if (config && config.udplocalIp) {
|
||||||
const {udplocalIp} = config;
|
const {udplocalIp} = config;
|
||||||
const udpClientbyCenter: UdpClientByCenter = new UdpClientByCenter(udplocalIp, '8080', globalThis.carInfo?.udpAddress, globalThis.carInfo?.hintPort)
|
const udpClientbyCenter: UdpClientByCenter = new UdpClientByCenter(udplocalIp, '8080', globalThis.carInfo?.gpsAddress, globalThis.carInfo?.hintPort)
|
||||||
|
|
||||||
await udpClientbyCenter.onError_Callback(()=>{})
|
await udpClientbyCenter.onError_Callback(()=>{})
|
||||||
await udpClientbyCenter.bindUdp()
|
await udpClientbyCenter.bindUdp()
|
||||||
await udpClientbyCenter.onMessage_2((val) => {})
|
await udpClientbyCenter.onMessage_2((val) => {})
|
||||||
|
|||||||
@ -195,6 +195,7 @@ export default class TcpClient {
|
|||||||
}
|
}
|
||||||
clearInterval(globalThis.intervaltcp)
|
clearInterval(globalThis.intervaltcp)
|
||||||
globalThis.intervaltcp=setInterval(()=>{
|
globalThis.intervaltcp=setInterval(()=>{
|
||||||
|
setTimeout(async () => {
|
||||||
//程序断开
|
//程序断开
|
||||||
if (globalThis.tcpUdpError) {
|
if (globalThis.tcpUdpError) {
|
||||||
console.log(TAG,'tcp信号丢失')
|
console.log(TAG,'tcp信号丢失')
|
||||||
@ -205,6 +206,7 @@ export default class TcpClient {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
globalThis.tcpUdpError = true;
|
globalThis.tcpUdpError = true;
|
||||||
|
}, 2000)
|
||||||
},3000)
|
},3000)
|
||||||
// callback(value.message)
|
// callback(value.message)
|
||||||
});
|
});
|
||||||
|
|||||||
@ -343,10 +343,10 @@ export default class UdpClientByCenter {
|
|||||||
|
|
||||||
// this.stashFn(str)
|
// this.stashFn(str)
|
||||||
const newArr = JSON.parse(JSON.stringify(strachArr))
|
const newArr = JSON.parse(JSON.stringify(strachArr))
|
||||||
this.writeLog({
|
// this.writeLog({
|
||||||
time:dateFormat(new Date()),
|
// time:dateFormat(new Date()),
|
||||||
PLC: JSON.stringify(newArr.toString()),
|
// PLC: JSON.stringify(newArr.toString()),
|
||||||
})
|
// })
|
||||||
if(strachArr[83]!='4'){
|
if(strachArr[83]!='4'){
|
||||||
this.chafenFlag++
|
this.chafenFlag++
|
||||||
if(this.chafenFlag>=15&&!globalThis.dialogOpen){
|
if(this.chafenFlag>=15&&!globalThis.dialogOpen){
|
||||||
@ -393,10 +393,10 @@ export default class UdpClientByCenter {
|
|||||||
this.testIfUdpConnetced(callback)
|
this.testIfUdpConnetced(callback)
|
||||||
}
|
}
|
||||||
async writeLog(param){
|
async writeLog(param){
|
||||||
const fileUtil = new FileUtil(globalThis.context)
|
// const fileUtil = new FileUtil(globalThis.context)
|
||||||
const date=dateFormat(new Date).split(' ')[0]
|
// const date=dateFormat(new Date).split(' ')[0]
|
||||||
const folderPath = await fileUtil.initFolder(`/PLC/${date}`);
|
// const folderPath = await fileUtil.initFolder(`/PLC/${date}`);
|
||||||
fileUtil.editFile(`${folderPath}/plcLog.txt`, JSON.stringify(param)+`\n`)
|
// fileUtil.editFile(`${folderPath}/plcLog.txt`, JSON.stringify(param)+`\n`)
|
||||||
|
|
||||||
}
|
}
|
||||||
//获取当前UDP信号
|
//获取当前UDP信号
|
||||||
|
|||||||
@ -43,8 +43,11 @@ export const initJudgeUdp = async () => {
|
|||||||
wd2:wd,
|
wd2:wd,
|
||||||
h:msgArr[90]*1 || 1,
|
h:msgArr[90]*1 || 1,
|
||||||
})
|
})
|
||||||
|
if(distance < 1){
|
||||||
|
return
|
||||||
|
}
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
globalThis.distanceClass?.setTimeData(((distance / 100).toFixed(2)) * 1)
|
globalThis.distanceClass.setTimeData(((distance / 100).toFixed(2)) * 1)
|
||||||
}
|
}
|
||||||
prevJd = jd;
|
prevJd = jd;
|
||||||
preWd = wd;
|
preWd = wd;
|
||||||
@ -63,7 +66,7 @@ export const getMessageHeartbeat = async (msg) => {
|
|||||||
? '1111111111111'
|
? '1111111111111'
|
||||||
: globalThis.lsh,
|
: globalThis.lsh,
|
||||||
13));
|
13));
|
||||||
const ascksyhArr = stringToASC(fillZero(examSubject == 2 ? '0000000000000':'1111111111111', 13))
|
const ascksyhArr = stringToASC(fillZero('1111111111111', 13))
|
||||||
const ascsbxhArr = stringToASC('00000000')
|
const ascsbxhArr = stringToASC('00000000')
|
||||||
// const ascsbxhArr = stringToASC('153216400880')
|
// const ascsbxhArr = stringToASC('153216400880')
|
||||||
const serialIndex = globalThis.serialIndex
|
const serialIndex = globalThis.serialIndex
|
||||||
|
|||||||
@ -62,7 +62,6 @@ export default async function request(req: any) {
|
|||||||
//处理中心服务code
|
//处理中心服务code
|
||||||
if(res.Envelope){
|
if(res.Envelope){
|
||||||
const msgXml = res.Envelope.Body.writeObjectOutResponse.return;
|
const msgXml = res.Envelope.Body.writeObjectOutResponse.return;
|
||||||
//Envelope.Body.writeObjectOutResponse.return
|
|
||||||
const dd = handleCenterCode(msgXml,isNewCenter);
|
const dd = handleCenterCode(msgXml,isNewCenter);
|
||||||
return dd
|
return dd
|
||||||
}
|
}
|
||||||
@ -166,14 +165,12 @@ function handleCenterCode(msgXml,isNewCenter){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//正则匹配code message字段
|
//正则匹配code message字段
|
||||||
const [code,message,keystr] = [/<code>(.*)<\/code>/i,/<message>(.*)<\/message>/i,/<keystr>(.*)<\/keystr>/i].map(pattern=>{
|
const [code,message] = [/<code>(.*)<\/code>/i,/<message>(.*)<\/message>/i].map(pattern=>{
|
||||||
const patternArr = pattern.exec(msgXml);
|
const patternArr = pattern.exec(msgXml);
|
||||||
return patternArr[1]
|
return patternArr[1]
|
||||||
});
|
});
|
||||||
|
|
||||||
console.info('surenjun =>request-prev',keystr)
|
if(code === ''){
|
||||||
|
|
||||||
if(code != '1'){
|
|
||||||
prompt.showToast({
|
prompt.showToast({
|
||||||
message: decodeURIComponent(message as string),
|
message: decodeURIComponent(message as string),
|
||||||
duration: 3000
|
duration: 3000
|
||||||
@ -183,8 +180,7 @@ function handleCenterCode(msgXml,isNewCenter){
|
|||||||
// globalThis.errorDialog.open()
|
// globalThis.errorDialog.open()
|
||||||
return {code,message:decodeURIComponent(message)}
|
return {code,message:decodeURIComponent(message)}
|
||||||
}else{
|
}else{
|
||||||
console.info('surenjun =>request',keystr)
|
return { code }
|
||||||
return { code ,keystr, message }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -236,16 +236,4 @@ export function convertGpsCoord2 (num){
|
|||||||
const du = Math.floor(tempNum / 100);
|
const du = Math.floor(tempNum / 100);
|
||||||
const fen = tempNum % 100 + num - tempNum;
|
const fen = tempNum % 100 + num - tempNum;
|
||||||
return du + fen / 60
|
return du + fen / 60
|
||||||
}
|
}
|
||||||
|
|
||||||
export function debounce(fn, delay){
|
|
||||||
// 利用闭包定义定时器id变量存储
|
|
||||||
let timer = null;
|
|
||||||
return () => {
|
|
||||||
// 如果有值就清除定时器,重新计时
|
|
||||||
if (timer) {
|
|
||||||
clearTimeout(timer)
|
|
||||||
}
|
|
||||||
timer = setTimeout(fn, delay);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@ -28,14 +28,10 @@ export default class EntryAbility extends UIAbility {
|
|||||||
globalThis.examinerInfo = {}
|
globalThis.examinerInfo = {}
|
||||||
globalThis.deviceNo = '';
|
globalThis.deviceNo = '';
|
||||||
globalThis.hasAuth = false
|
globalThis.hasAuth = false
|
||||||
globalThis.version = '2024.03.19.01'//洛阳
|
|
||||||
globalThis.judgeVersion = '2024.01.05.1'
|
|
||||||
// globalThis.judgeVersion = '2022.12.05.1'
|
|
||||||
// globalThis.version = '2022.08.13.01'
|
|
||||||
// globalThis.version = '2022.08.13.01'//洛阳
|
// globalThis.version = '2022.08.13.01'//洛阳
|
||||||
// globalThis.judgeVersion = '2022.12.05.1'
|
// globalThis.judgeVersion = '2022.12.05.1'
|
||||||
// globalThis.judgeVersion = '2022.12.05.1'
|
globalThis.judgeVersion = '2022.12.05.1'
|
||||||
// globalThis.version = '2022.08.13.01'
|
globalThis.version = '2022.08.13.01'
|
||||||
// globalThis.version = '2024.11.22.14'//济南
|
// globalThis.version = '2024.11.22.14'//济南
|
||||||
// globalThis.judgeVersion = '2024.11.22.14'
|
// globalThis.judgeVersion = '2024.11.22.14'
|
||||||
globalThis.videoVersion= '1.0'
|
globalThis.videoVersion= '1.0'
|
||||||
@ -64,7 +60,7 @@ export default class EntryAbility extends UIAbility {
|
|||||||
const windowClass = await windowStage.getMainWindow();
|
const windowClass = await windowStage.getMainWindow();
|
||||||
globalThis.windowClass = windowClass
|
globalThis.windowClass = windowClass
|
||||||
// await windowClass.setWindowLayoutFullScreen(true)
|
// await windowClass.setWindowLayoutFullScreen(true)
|
||||||
// await windowClass.setWindowSystemBarEnable([]) //全屏
|
await windowClass.setWindowSystemBarEnable([]) //全屏
|
||||||
// await windowClass.setWindowSystemBarEnable(['navigation'])
|
// await windowClass.setWindowSystemBarEnable(['navigation'])
|
||||||
|
|
||||||
windowStage.loadContent('pages/Index', (err, data) => {
|
windowStage.loadContent('pages/Index', (err, data) => {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
import common from '@ohos.app.ability.common';
|
import common from '@ohos.app.ability.common';
|
||||||
import router from '@ohos.router';
|
import router from '@ohos.router';
|
||||||
import { getCarInfo, getDeviceInfo } from '../common/service/terminalService';
|
import { getCarInfo, getDeviceInfo } from '../common/service/terminalService';
|
||||||
@ -19,7 +20,6 @@ import errorMsgDialog from './compontents/errorMsgDialog'
|
|||||||
import { getSyncData } from '../common/service/initable';
|
import { getSyncData } from '../common/service/initable';
|
||||||
import GetDistance from '../common/utils/GetDistance'
|
import GetDistance from '../common/utils/GetDistance'
|
||||||
import UIAbility from '@ohos.app.ability.UIAbility';
|
import UIAbility from '@ohos.app.ability.UIAbility';
|
||||||
import { endRecordVideo, getUserAlbumItemByDisplayName, saveStartRecordVideo } from '../common/service/videoService';
|
|
||||||
|
|
||||||
// import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
|
// import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
|
||||||
|
|
||||||
@ -45,6 +45,8 @@ struct Index {
|
|||||||
private vocObj = null;
|
private vocObj = null;
|
||||||
private workerInstance = null;
|
private workerInstance = null;
|
||||||
private context = getContext(this) as common.UIAbilityContext;
|
private context = getContext(this) as common.UIAbilityContext;
|
||||||
|
private title = ''
|
||||||
|
private type = '2'
|
||||||
errorDialog: CustomDialogController = new CustomDialogController({
|
errorDialog: CustomDialogController = new CustomDialogController({
|
||||||
builder: errorMsgDialog({
|
builder: errorMsgDialog({
|
||||||
title: globalThis.title,
|
title: globalThis.title,
|
||||||
@ -183,7 +185,7 @@ struct Index {
|
|||||||
Column() {
|
Column() {
|
||||||
Row() {
|
Row() {
|
||||||
Column() {
|
Column() {
|
||||||
Text('V 1.0')
|
Text('V ' + globalThis.version)
|
||||||
.fontColor('#CCAE7A')
|
.fontColor('#CCAE7A')
|
||||||
.fontSize(22 * globalThis.ratio)
|
.fontSize(22 * globalThis.ratio)
|
||||||
.width('30%')
|
.width('30%')
|
||||||
@ -328,7 +330,6 @@ struct Index {
|
|||||||
workerInstance.postMessage(param);
|
workerInstance.postMessage(param);
|
||||||
workerInstance.onmessage = (e: MessageEvents): void => {
|
workerInstance.onmessage = (e: MessageEvents): void => {
|
||||||
console.log("baoyihu after postMessage :", JSON.stringify(e.data));
|
console.log("baoyihu after postMessage :", JSON.stringify(e.data));
|
||||||
// @ts-ignore
|
|
||||||
let workData: WorkData = e.data;
|
let workData: WorkData = e.data;
|
||||||
if (workData.isComplete) {
|
if (workData.isComplete) {
|
||||||
router.pushUrl({
|
router.pushUrl({
|
||||||
@ -377,7 +378,6 @@ struct Index {
|
|||||||
console.log('globalThis.singlePlay', globalThis.singlePlay)
|
console.log('globalThis.singlePlay', globalThis.singlePlay)
|
||||||
if (globalThis.singlePlay == undefined || globalThis.singlePlay == null) {
|
if (globalThis.singlePlay == undefined || globalThis.singlePlay == null) {
|
||||||
this.context.resourceManager.getRawFileContent("welcome.wav").then(value => {
|
this.context.resourceManager.getRawFileContent("welcome.wav").then(value => {
|
||||||
console.log('tttttttt')
|
|
||||||
this.vocObj.playAudio({
|
this.vocObj.playAudio({
|
||||||
type: 1,
|
type: 1,
|
||||||
name: 'welcome.wav'
|
name: 'welcome.wav'
|
||||||
@ -431,6 +431,7 @@ struct Index {
|
|||||||
|
|
||||||
async initParams() {
|
async initParams() {
|
||||||
console.log('kkkkmmm')
|
console.log('kkkkmmm')
|
||||||
|
delHilog()
|
||||||
// deleteAllFIleLog(GlobalConfig.comoonfileWriteAddress + '/PLC/')
|
// deleteAllFIleLog(GlobalConfig.comoonfileWriteAddress + '/PLC/')
|
||||||
//设置plc udp 同步requesthost
|
//设置plc udp 同步requesthost
|
||||||
await getUDP(this.context, false)
|
await getUDP(this.context, false)
|
||||||
@ -458,8 +459,6 @@ struct Index {
|
|||||||
this.heartMsg()
|
this.heartMsg()
|
||||||
}
|
}
|
||||||
}, 1000)
|
}, 1000)
|
||||||
delHilog()
|
|
||||||
getUserAlbumItemByDisplayName('')
|
|
||||||
//下载模型
|
//下载模型
|
||||||
// await this.getModel()
|
// await this.getModel()
|
||||||
// const arr = [0x55, 0xaa, 0x01, 0x00, 0x02, 0x01, 0x03, 0x00]
|
// const arr = [0x55, 0xaa, 0x01, 0x00, 0x02, 0x01, 0x03, 0x00]
|
||||||
|
|||||||
@ -9,8 +9,6 @@ import Judge from './judgeSDK/judge';
|
|||||||
import { defaultJudgeConfigObj } from './judgeSDK/utils//judgeCommon';
|
import { defaultJudgeConfigObj } from './judgeSDK/utils//judgeCommon';
|
||||||
import {uploadExamMileage} from '../api/judge'
|
import {uploadExamMileage} from '../api/judge'
|
||||||
import DwztErrorPopup from './compontents/judge/DwztErrorPopup'
|
import DwztErrorPopup from './compontents/judge/DwztErrorPopup'
|
||||||
import {debounce} from '../common/utils/tools'
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CARINFO,
|
CARINFO,
|
||||||
CDSBInfo,
|
CDSBInfo,
|
||||||
@ -30,7 +28,6 @@ import { getSyncData } from '../common/service/initable';
|
|||||||
import { judgeConfig } from './judgeSDK/utils/judgeConfig';
|
import { judgeConfig } from './judgeSDK/utils/judgeConfig';
|
||||||
import FileUtil from '../common/utils/File';
|
import FileUtil from '../common/utils/File';
|
||||||
import SignDisplayCom from './compontents/signDisplayCom';
|
import SignDisplayCom from './compontents/signDisplayCom';
|
||||||
import promptAction from '@ohos.promptAction';
|
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
@ -164,8 +161,7 @@ struct Index {
|
|||||||
const syssetParams = sysset || await getSyncData('MA_SYSSET')
|
const syssetParams = sysset || await getSyncData('MA_SYSSET')
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
const serialNumberArr = syssetParams.filter(sys => sys.v_no === '901');
|
const serialNumberArr = syssetParams.filter(sys => sys.v_no === '901');
|
||||||
console.info('surenjun serialNumberArr' + JSON.stringify(serialNumberArr))
|
this.serialNumber = (serialNumberArr[0] && serialNumberArr[0].v_value) || '123456'
|
||||||
this.serialNumber = (serialNumberArr[0] && serialNumberArr[0].v_value) || '';
|
|
||||||
const {isTrajectoryOpen} = judgeConfig
|
const {isTrajectoryOpen} = judgeConfig
|
||||||
const syssetJudgeConfigArr = []
|
const syssetJudgeConfigArr = []
|
||||||
|
|
||||||
@ -298,15 +294,12 @@ struct Index {
|
|||||||
this.projectsObj[no2*1] = currentProject
|
this.projectsObj[no2*1] = currentProject
|
||||||
this.projectsCenterObj[txt2] = currentProject
|
this.projectsCenterObj[txt2] = currentProject
|
||||||
this.projects.push(currentProject);
|
this.projects.push(currentProject);
|
||||||
|
console.info('surenjun txt2=>',txt2)
|
||||||
//真实监管下发考试项目
|
//真实监管下发考试项目
|
||||||
if(isInExam && !kStringArr.includes(txt2)){
|
if(isInExam && !kStringArr.includes(txt2)){
|
||||||
this.projectsObj[no2*1].type = '3'
|
this.projectsObj[no2*1].type = '3'
|
||||||
this.projectsObj[no2*1].isUpload = true
|
this.projectsObj[no2*1].isUpload = true
|
||||||
this.projectsObj[no2*1].isEnd = true
|
this.projectsObj[no2*1].isEnd = true
|
||||||
this.projectsCenterObj[txt2].type = '3'
|
|
||||||
this.projectsCenterObj[txt2].isUpload = true
|
|
||||||
this.projectsCenterObj[txt2].isEnd = true
|
|
||||||
this.isDdxk = true
|
this.isDdxk = true
|
||||||
this.ddxkKsxmArr.push(txt2)
|
this.ddxkKsxmArr.push(txt2)
|
||||||
}
|
}
|
||||||
@ -388,8 +381,6 @@ struct Index {
|
|||||||
const projectCode = this.projectsCenterObj[xmdm].projectCode
|
const projectCode = this.projectsCenterObj[xmdm].projectCode
|
||||||
if(this.projectsObj[projectCode]){
|
if(this.projectsObj[projectCode]){
|
||||||
this.projectsObj[projectCode].type = '3'
|
this.projectsObj[projectCode].type = '3'
|
||||||
this.projectsObj[projectCode].isUpload = true
|
|
||||||
this.projectsObj[projectCode].isEnd = true
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.ddxkKsxmArr = ddxkKsxmArr
|
this.ddxkKsxmArr = ddxkKsxmArr
|
||||||
@ -854,15 +845,10 @@ struct Index {
|
|||||||
this.isDeductedPopShow = false;
|
this.isDeductedPopShow = false;
|
||||||
this.defaultTabIndex = 0;
|
this.defaultTabIndex = 0;
|
||||||
},
|
},
|
||||||
confirmMark: async (itemno, serial)=>{
|
confirmMark: async (itemno, serial) => {
|
||||||
clearTimeout(this.popTimer)
|
const judge = this.judge
|
||||||
this.popTimer = null
|
await judge.setJudgeMark(itemno, serial);
|
||||||
this.popTimer = setTimeout(async ()=>{
|
this.isDeductedPopShow = false
|
||||||
const judge = this.judge
|
|
||||||
await judge.setJudgeMark(itemno, serial);
|
|
||||||
this.isDeductedPopShow = false
|
|
||||||
this.popTimer = null;
|
|
||||||
},500)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -892,15 +878,10 @@ struct Index {
|
|||||||
if (this.isAmplifyPopShow && this.examSubject == 3) {
|
if (this.isAmplifyPopShow && this.examSubject == 3) {
|
||||||
AmplifyPopup({
|
AmplifyPopup({
|
||||||
amplifyImgIndex: this.amplifiedImgIndex,
|
amplifyImgIndex: this.amplifiedImgIndex,
|
||||||
confirmAmplify:async (amplify)=>{
|
confirmAmplify: async (amplify) => {
|
||||||
clearTimeout(this.popTimer)
|
const judge = this.judge
|
||||||
this.popTimer = null
|
await judge.setJudgeItem(amplify.projectCode, 1);
|
||||||
this.popTimer = setTimeout(async ()=>{
|
this.isAmplifyPopShow = false
|
||||||
const judge = this.judge
|
|
||||||
await judge.setJudgeItem(amplify.projectCode, 1);
|
|
||||||
this.isAmplifyPopShow = false
|
|
||||||
this.popTimer = null;
|
|
||||||
},500)
|
|
||||||
},
|
},
|
||||||
closeAmplifyPop: () => {
|
closeAmplifyPop: () => {
|
||||||
this.isAmplifyPopShow = false
|
this.isAmplifyPopShow = false
|
||||||
@ -1281,5 +1262,4 @@ struct Index {
|
|||||||
@State mileageTimer: number = 0;
|
@State mileageTimer: number = 0;
|
||||||
@State passingScore: number = 80
|
@State passingScore: number = 80
|
||||||
@State dwztErrorVisible: boolean = false;
|
@State dwztErrorVisible: boolean = false;
|
||||||
@State popTimer:number =0;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -389,7 +389,7 @@ struct UserInfo {
|
|||||||
db.getRdbStore(() => {
|
db.getRdbStore(() => {
|
||||||
db.query('0', (syssetParams) => {
|
db.query('0', (syssetParams) => {
|
||||||
const serialNumberArr = syssetParams.filter(sys => sys.v_no === '901')
|
const serialNumberArr = syssetParams.filter(sys => sys.v_no === '901')
|
||||||
that.jkxlh = serialNumberArr?.[0]?.v_value || ''
|
that.jkxlh = serialNumberArr?.[0]?.v_value || '1234567'
|
||||||
const ksxtbhArr = syssetParams.filter(sys => sys.v_no === '902')
|
const ksxtbhArr = syssetParams.filter(sys => sys.v_no === '902')
|
||||||
that.ksxtbh = ksxtbhArr?.[0]?.v_value || '222'
|
that.ksxtbh = ksxtbhArr?.[0]?.v_value || '222'
|
||||||
const studentRefreshParam = syssetParams.filter(sys => sys.v_no === '452') //判断自动更新
|
const studentRefreshParam = syssetParams.filter(sys => sys.v_no === '452') //判断自动更新
|
||||||
@ -650,8 +650,6 @@ struct UserInfo {
|
|||||||
message,
|
message,
|
||||||
duration: 4000
|
duration: 4000
|
||||||
})
|
})
|
||||||
avPlayer.playAudio(['voice/监管审核未通过.mp3']);
|
|
||||||
this.isLoadingPopupVisible = false
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.currentUser.id = '0'
|
this.currentUser.id = '0'
|
||||||
@ -801,7 +799,7 @@ struct UserInfo {
|
|||||||
drvexam,
|
drvexam,
|
||||||
xtlb: '17',
|
xtlb: '17',
|
||||||
//接口序列号
|
//接口序列号
|
||||||
jkxlh: this.jkxlh,
|
jkxlh: this.jkxlh || '1234567',
|
||||||
//接口标识
|
//接口标识
|
||||||
jkid: '17C51',
|
jkid: '17C51',
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,16 +80,14 @@ export default class Judge {
|
|||||||
|
|
||||||
this.isExam = !this.judgeUI.singlePlay;
|
this.isExam = !this.judgeUI.singlePlay;
|
||||||
const {projectsCenterObj,examSubject} = judgeUI;
|
const {projectsCenterObj,examSubject} = judgeUI;
|
||||||
|
//科目三待修改
|
||||||
(examSubject ==2 ? testKm2Items : testKm3Items ).forEach(item => {
|
(examSubject ==2 ? testKm2Items : testKm3Items ).forEach(item => {
|
||||||
const projectCenterObj = projectsCenterObj[item.code]
|
|
||||||
this.testKmItems[item.code] = item;
|
this.testKmItems[item.code] = item;
|
||||||
//考试项目存在
|
//考试项目存在
|
||||||
this.testKmItems[item.code] = {
|
this.testKmItems[item.code] = {
|
||||||
code: item.code,
|
code: item.code,
|
||||||
status: projectCenterObj === undefined
|
status: 1,
|
||||||
? 0
|
// status: projectsCenterObj[item.code]?.isRequired ? 1 : 0
|
||||||
: ( projectCenterObj.isEnd ? 3 : 1 )
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.info(judgeTag+'testKmItems',JSON.stringify(this.testKmItems))
|
console.info(judgeTag+'testKmItems',JSON.stringify(this.testKmItems))
|
||||||
@ -158,25 +156,13 @@ export default class Judge {
|
|||||||
let beginExamInfo = isTrajectoryOpen ? {
|
let beginExamInfo = isTrajectoryOpen ? {
|
||||||
...JSON.parse(strArr[1]),
|
...JSON.parse(strArr[1]),
|
||||||
replay: 1,
|
replay: 1,
|
||||||
|
ykxm:judgeConfig.ignoreProjects
|
||||||
} : await getJudgeBeginData()
|
} : await getJudgeBeginData()
|
||||||
|
|
||||||
await fileLog.setExamJudgeData(beginExamInfo)
|
await fileLog.setExamJudgeData(beginExamInfo)
|
||||||
await examJudgeBeginExam(beginExamInfo);
|
await examJudgeBeginExam(beginExamInfo);
|
||||||
console.info(judgeTag, '6.开始考试注册完成')
|
console.info(judgeTag, '6.开始考试注册完成')
|
||||||
avPlayer.playAudio([globalThis.singlePlay ? 'voice/ksks.WAV' : 'voice/监管成功.mp3'])
|
avPlayer.playAudio([globalThis.singlePlay ? 'voice/ksks.WAV' : 'voice/监管成功.mp3'])
|
||||||
|
|
||||||
const {examSubject,projectsObj} = this.judgeUI
|
|
||||||
if(examSubject == 3){
|
|
||||||
//不做模拟灯光,需要做上车准备 =>(请上车准备)
|
|
||||||
if(projectsObj[41]?.type == 3 && projectsObj[1]?.type != 3){
|
|
||||||
avPlayer.playAudio(['voice/上车准备.mp3'])
|
|
||||||
}
|
|
||||||
//不做模拟灯光,不做上车准备 =>(请起步,完成考试)
|
|
||||||
if(projectsObj[41]?.type == 3 && projectsObj[1]?.type == 3){
|
|
||||||
avPlayer.playAudio(['voice/402001.mp3'])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.judgeUI.draw = true
|
this.judgeUI.draw = true
|
||||||
// 处理轨迹plc信息
|
// 处理轨迹plc信息
|
||||||
if (isTrajectoryOpen) {
|
if (isTrajectoryOpen) {
|
||||||
@ -193,15 +179,24 @@ export default class Judge {
|
|||||||
handDistance();
|
handDistance();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//TODO 监听远程扣分
|
//TODO 监听远程扣分
|
||||||
}
|
}
|
||||||
//实时计算gps经纬度距离
|
|
||||||
|
|
||||||
handDistance= async ()=>{
|
handDistance= async ()=>{
|
||||||
const {jd,wd,hxj,dwzt} = this.tempData.gps;
|
const {jd,wd,hxj,dwzt} = this.tempData.gps;
|
||||||
const tJD = convertGpsCoord2(jd)
|
const tJD = convertGpsCoord2(jd)
|
||||||
const tWD = convertGpsCoord2(wd)
|
const tWD = convertGpsCoord2(wd)
|
||||||
const {prevJd,prevWd} = this
|
const {prevJd,prevWd} = this
|
||||||
|
console.info('surenjun =>prevJd',prevJd)
|
||||||
|
console.info('surenjun =>dwzt',dwzt)
|
||||||
if(prevJd && dwzt == 4){
|
if(prevJd && dwzt == 4){
|
||||||
|
console.info('surenjun =>tJD',tJD)
|
||||||
|
console.info('surenjun =>tWD',tWD)
|
||||||
|
console.info('surenjun =>prevJd',prevJd)
|
||||||
|
console.info('surenjun =>preWd',prevWd)
|
||||||
|
console.info('surenjun =>hxj',hxj)
|
||||||
const distance = await examCalcGpsDistance({
|
const distance = await examCalcGpsDistance({
|
||||||
jd1:prevJd,
|
jd1:prevJd,
|
||||||
wd1:prevWd,
|
wd1:prevWd,
|
||||||
@ -209,8 +204,9 @@ export default class Judge {
|
|||||||
wd2:tWD,
|
wd2:tWD,
|
||||||
h:hxj || 1,
|
h:hxj || 1,
|
||||||
})
|
})
|
||||||
|
console.info('surenjun =>distance',distance)
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
globalThis.distanceClass?.setTimeData(((distance / 100).toFixed(2)) * 1)
|
globalThis.distanceClass.setTimeData(((distance / 100).toFixed(2)) * 1)
|
||||||
}
|
}
|
||||||
this.prevJd = tJD;
|
this.prevJd = tJD;
|
||||||
this.prevWd = tWD;
|
this.prevWd = tWD;
|
||||||
@ -642,6 +638,7 @@ export default class Judge {
|
|||||||
kssj: time
|
kssj: time
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.info(judgeTag +'filePath' , filePath)
|
||||||
const {code} = await writeObjectOut(data,filePath)
|
const {code} = await writeObjectOut(data,filePath)
|
||||||
console.info(judgeTag, '项目开始 end')
|
console.info(judgeTag, '项目开始 end')
|
||||||
if (code === 2300007) {
|
if (code === 2300007) {
|
||||||
@ -805,9 +802,18 @@ export default class Judge {
|
|||||||
//及格分
|
//及格分
|
||||||
let passingGrade = passingScore
|
let passingGrade = passingScore
|
||||||
if (isManual) {
|
if (isManual) {
|
||||||
// 考试不合格
|
if (isAllProjectsEnd) {
|
||||||
await examJudgeEndExam()
|
// 考试合格
|
||||||
this.isExamEnd = true
|
if (totalScore >= passingGrade) {
|
||||||
|
// 考试合格
|
||||||
|
await examJudgeEndExam();
|
||||||
|
this.isExamEnd = true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 考试不合格
|
||||||
|
await examJudgeEndExam()
|
||||||
|
this.isExamEnd = true
|
||||||
|
}
|
||||||
this.isManual = true
|
this.isManual = true
|
||||||
} else {
|
} else {
|
||||||
const param302 = judgeConfigObj['302'];
|
const param302 = judgeConfigObj['302'];
|
||||||
@ -818,30 +824,17 @@ export default class Judge {
|
|||||||
if (singlePlay) {
|
if (singlePlay) {
|
||||||
console.info(judgeTag + ' isAllProjectsEnd => ',isAllProjectsEnd)
|
console.info(judgeTag + ' isAllProjectsEnd => ',isAllProjectsEnd)
|
||||||
if (isAllProjectsEnd) {
|
if (isAllProjectsEnd) {
|
||||||
//成绩合格
|
if (examSubject == 3 && (param342 == 0 || param342 == 2) && (param302 != 6 || param302 != 7 || param302 != 8)) {
|
||||||
if(totalScore >= passingGrade && !isEndTip) {
|
if(param512[7] != 0){
|
||||||
if (examSubject == 3 && (param342 == 0 || param342 == 2) && (param302 != 6 || param302 != 7 || param302 != 8)) {
|
avPlayer.playAudio(['voice/综合评判.mp3'])
|
||||||
if(param512[7] != 0){
|
this.judgeUI.isDeductedPopShow = true
|
||||||
avPlayer.playAudio(['voice/综合评判.mp3'])
|
this.judgeUI.defaultTabIndex = 1
|
||||||
this.judgeUI.isDeductedPopShow = true
|
this.isEndTip = true
|
||||||
this.judgeUI.defaultTabIndex = 1
|
}
|
||||||
this.isEndTip = true
|
} else {
|
||||||
return
|
await examJudgeEndExam()
|
||||||
}
|
this.isExamEnd = true
|
||||||
} else {
|
}
|
||||||
await examJudgeEndExam()
|
|
||||||
this.isExamEnd = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
if(examSubject == 3 && param302 == 4){
|
|
||||||
await examJudgeEndExam()
|
|
||||||
this.isExamEnd = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await examJudgeEndExam()
|
|
||||||
this.isExamEnd = true
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//成绩不合格
|
//成绩不合格
|
||||||
@ -857,11 +850,6 @@ export default class Judge {
|
|||||||
}
|
}
|
||||||
//成绩合格
|
//成绩合格
|
||||||
if (isAllProjectsEnd && totalScore >= passingGrade && !isEndTip) {
|
if (isAllProjectsEnd && totalScore >= passingGrade && !isEndTip) {
|
||||||
if(examSubject == 2){
|
|
||||||
await examJudgeEndExam()
|
|
||||||
this.isExamEnd = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
//考试合格自动退出
|
//考试合格自动退出
|
||||||
if(examSubject == 3 && param302 == 4){
|
if(examSubject == 3 && param302 == 4){
|
||||||
await examJudgeEndExam()
|
await examJudgeEndExam()
|
||||||
@ -967,15 +955,8 @@ export default class Judge {
|
|||||||
dwlc: [d1,d2,d3,d4,d5].map((d,index) => `${index+1},${Math.floor(d /100)}`).join(';'),
|
dwlc: [d1,d2,d3,d4,d5].map((d,index) => `${index+1},${Math.floor(d /100)}`).join(';'),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const {code,keystr,message} = await writeObjectOut(data,filePath);
|
const temp = await writeObjectOut(data,filePath);
|
||||||
promptWxCode('17C56', code)
|
promptWxCode('17C56', temp.code)
|
||||||
|
|
||||||
if(code != 1){
|
|
||||||
avPlayer.playAudio(['voice/监管失败.mp3'])
|
|
||||||
this.isUdpEnd = true
|
|
||||||
router.back();
|
|
||||||
return
|
|
||||||
}
|
|
||||||
console.info(judgeTag, '考试结束 end')
|
console.info(judgeTag, '考试结束 end')
|
||||||
const param302 = judgeConfigObj['302'];
|
const param302 = judgeConfigObj['302'];
|
||||||
judgeUI.loadingPopupVisible = true;
|
judgeUI.loadingPopupVisible = true;
|
||||||
@ -983,13 +964,8 @@ export default class Judge {
|
|||||||
let currentKssycs =0;
|
let currentKssycs =0;
|
||||||
let voiceURL = ''
|
let voiceURL = ''
|
||||||
if (examSubject == 2) {
|
if (examSubject == 2) {
|
||||||
if (isAllProjectsEnd) {
|
voiceURL = (totalScore < passingScore ? `voice/unqualified_${kssycs == 1 ? 'one' : 'two'}.wav` : 'voice/qualified.mp3')
|
||||||
voiceURL = (totalScore < passingScore ? `voice/unqualified_${kssycs == 1 ? 'one' : 'two'}.wav` : 'voice/qualified.mp3')
|
switch (voiceURL){
|
||||||
}else{
|
|
||||||
voiceURL = `voice/unqualified_${kssycs == 1 ? 'one' : 'two'}.wav`
|
|
||||||
currentKssycs = kssycs == 1 ? 0 : 1
|
|
||||||
}
|
|
||||||
switch (voiceURL){
|
|
||||||
case 'voice/unqualified_one.wav':
|
case 'voice/unqualified_one.wav':
|
||||||
currentKssycs = 0;
|
currentKssycs = 0;
|
||||||
break;
|
break;
|
||||||
@ -1087,7 +1063,6 @@ export default class Judge {
|
|||||||
const projectsObj = this.judgeUI.projectsObj
|
const projectsObj = this.judgeUI.projectsObj
|
||||||
return projectsObj[type]?.abbreviation || '通用评判'
|
return projectsObj[type]?.abbreviation || '通用评判'
|
||||||
}
|
}
|
||||||
|
|
||||||
// 扣分项目转换
|
// 扣分项目转换
|
||||||
getKfStr = (code) => {
|
getKfStr = (code) => {
|
||||||
const markRuleListObj = this.judgeUI.markRuleListObj;
|
const markRuleListObj = this.judgeUI.markRuleListObj;
|
||||||
@ -1132,7 +1107,7 @@ export default class Judge {
|
|||||||
const sbxh = getSbxh(xmdm, xmxh)
|
const sbxh = getSbxh(xmdm, xmxh)
|
||||||
const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo || {};
|
const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo || {};
|
||||||
const asclshArr = stringToASC(
|
const asclshArr = stringToASC(
|
||||||
fillZero((singlePlay ? (examSubject == 2 ? '0000000000000':'1111111111111') : lsh) || 0, 13)
|
fillZero((singlePlay ? 1111111111111 : lsh) || 0, 13)
|
||||||
);
|
);
|
||||||
//13不足要补0
|
//13不足要补0
|
||||||
const ascksyhArr = stringToASC(fillZero(ksyh || 0, 13))
|
const ascksyhArr = stringToASC(fillZero(ksyh || 0, 13))
|
||||||
@ -1149,6 +1124,7 @@ export default class Judge {
|
|||||||
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
let tempSd = ((judgeConfigObj['350'] ==0 ? sd : cs) * 1.852).toFixed(0) * 1
|
let tempSd = ((judgeConfigObj['350'] ==0 ? sd : cs) * 1.852).toFixed(0) * 1
|
||||||
|
console.info(judgeTag + "prevSD",tempSd);
|
||||||
if(tempSd < 1){
|
if(tempSd < 1){
|
||||||
tempSd = 0
|
tempSd = 0
|
||||||
}
|
}
|
||||||
@ -1252,6 +1228,7 @@ export default class Judge {
|
|||||||
status: getCenterProjectStatus(current.status)
|
status: getCenterProjectStatus(current.status)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// console.info(judgeTag+'TranslateProject',JSON.stringify(tempItems));
|
||||||
|
|
||||||
const arr = [];
|
const arr = [];
|
||||||
for (let i = 0; i <= 4; i++) {
|
for (let i = 0; i <= 4; i++) {
|
||||||
@ -1299,7 +1276,6 @@ export default class Judge {
|
|||||||
}
|
}
|
||||||
//人工操作项目
|
//人工操作项目
|
||||||
public setJudgeItem = async (itemno, type: 1 | 2) => {
|
public setJudgeItem = async (itemno, type: 1 | 2) => {
|
||||||
console.info('surenjun','2')
|
|
||||||
const {fileLog} = this;
|
const {fileLog} = this;
|
||||||
await examJudgeArtificialItem(itemno * 1, type);
|
await examJudgeArtificialItem(itemno * 1, type);
|
||||||
await fileLog.setExamJudgeData({
|
await fileLog.setExamJudgeData({
|
||||||
@ -1416,10 +1392,7 @@ export default class Judge {
|
|||||||
if (udpIndex % 5 === 0 && !isUdpEnd) {
|
if (udpIndex % 5 === 0 && !isUdpEnd) {
|
||||||
const judgeUdp = globalThis.judgeUdp
|
const judgeUdp = globalThis.judgeUdp
|
||||||
const bytes = await this.getMessageHeartbeat(isExamEnd);
|
const bytes = await this.getMessageHeartbeat(isExamEnd);
|
||||||
console.info(judgeTag,JSON.stringify(bytes))
|
|
||||||
console.info(judgeTag,'udp-prev-send')
|
|
||||||
judgeUdp.send(bytes)
|
judgeUdp.send(bytes)
|
||||||
console.info(judgeTag,'udp-prev-end')
|
|
||||||
}
|
}
|
||||||
globalThis.udpIndex += 1
|
globalThis.udpIndex += 1
|
||||||
}
|
}
|
||||||
@ -1471,13 +1444,12 @@ export default class Judge {
|
|||||||
const msgStr = strArr[num];
|
const msgStr = strArr[num];
|
||||||
if(msgStr == ''){
|
if(msgStr == ''){
|
||||||
console.info(judgeTag, '模拟数据考试结束')
|
console.info(judgeTag, '模拟数据考试结束')
|
||||||
globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
|
// globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
|
||||||
clearInterval(judgeTimer)
|
clearInterval(judgeTimer)
|
||||||
this.checkExamIsEnd(true)
|
this.checkExamIsEnd(true)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const msg = JSON.parse(strArr[num]);
|
const msg = JSON.parse(strArr[num]);
|
||||||
num++
|
|
||||||
// 4.过程数据
|
// 4.过程数据
|
||||||
this.tempData = msg
|
this.tempData = msg
|
||||||
this.judgeUI.isDwztRight = msg?.gps?.dwzt == 4;
|
this.judgeUI.isDwztRight = msg?.gps?.dwzt == 4;
|
||||||
@ -1495,8 +1467,8 @@ export default class Judge {
|
|||||||
await examJudgeRealExam(msg)
|
await examJudgeRealExam(msg)
|
||||||
const bytes = await this.getMessageHeartbeat();
|
const bytes = await this.getMessageHeartbeat();
|
||||||
bytes && globalThis.judgeUdp.send(bytes)
|
bytes && globalThis.judgeUdp.send(bytes)
|
||||||
|
num++
|
||||||
}, 50)
|
}, 200)
|
||||||
|
|
||||||
globalThis.judgeTimer = judgeTimer;
|
globalThis.judgeTimer = judgeTimer;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ export const judgeConfig = {
|
|||||||
// 本地模型地址
|
// 本地模型地址
|
||||||
modelPath: 'models/model_enc',
|
modelPath: 'models/model_enc',
|
||||||
// 济南科目三
|
// 济南科目三
|
||||||
trajectoryPath: 'logs/2024_08_29/2024_08_29_09_48_08_2230612098578_410311200501058031_闫嘉衡/judge_exam_data.txt',
|
trajectoryPath: 'logs/2024_08_17/2024_08_17_16_51_24_9999282315477_203908531884520064_彭雯季/judge_exam_data.txt',
|
||||||
//四合一画面配置
|
//四合一画面配置
|
||||||
fourInOneScreen:{
|
fourInOneScreen:{
|
||||||
//gps位数
|
//gps位数
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user