Compare commits
5 Commits
ffe0dfd695
...
e1dcac0072
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1dcac0072 | ||
|
|
628671d9d9 | ||
|
|
edf7e07f6f | ||
|
|
acd7aef88b | ||
|
|
c3a27f6a87 |
@ -490,14 +490,14 @@ export interface JudgeUI {
|
||||
jl: number
|
||||
dwztErrorVisible: boolean
|
||||
isDeductedPopShow: boolean
|
||||
loadingPopupVisible: boolean
|
||||
endPopupVisible: boolean
|
||||
defaultTabIndex: number
|
||||
isDwztRight: boolean
|
||||
draw: boolean
|
||||
lane: LANE
|
||||
sd: string
|
||||
dw: string
|
||||
endExamDialogController: CustomDialogController
|
||||
generateExamRecordsDialogController: CustomDialogController
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -19,6 +19,13 @@ export interface WorkerBackMessage {
|
||||
data: string | CenterCallBackMsgType
|
||||
}
|
||||
|
||||
export enum WorkerBackMessageType {
|
||||
// 后置机信息
|
||||
ObtainUdpData = 'obtainUdpData',
|
||||
// 中心消息
|
||||
CenterUdpData = 'centerUdpData',
|
||||
}
|
||||
|
||||
export interface LogWorkerMessage {
|
||||
type: WorkerMessageType;
|
||||
data?: string;
|
||||
|
||||
@ -22,7 +22,7 @@ export default struct BottomMessageComponent {
|
||||
.onClick(() => {
|
||||
// 点击五次
|
||||
this.count++
|
||||
if (this.count >= 5) {
|
||||
if (this.count >= 3) {
|
||||
this.versionClick && this.versionClick()
|
||||
this.count = 0
|
||||
}
|
||||
|
||||
@ -40,6 +40,5 @@ export default struct LoadingComponent {
|
||||
radius: 30,
|
||||
color: "#E7B544"
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,6 @@
|
||||
import router from '@ohos.router';
|
||||
import Prompt from '@system.prompt';
|
||||
import common from '@ohos.app.ability.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';
|
||||
@ -51,6 +49,8 @@ import FileUtils from '../utils/FileUtils';
|
||||
import SignalTrajectoryDialog from './Judge/SignalTrajectoryDialog';
|
||||
import { DefaultJudgeConfigData } from '../mock';
|
||||
import { dConsole } from '../utils/LogWorker';
|
||||
import ConfirmDialog from './compontents/ConfirmDialog';
|
||||
import CarLoadingDialog from './compontents/CarLoading';
|
||||
|
||||
|
||||
@Entry
|
||||
@ -61,10 +61,6 @@ struct JudgePage {
|
||||
@State wayno: number = 0
|
||||
@State FONTSIZE: number = 30
|
||||
@State BIGFONTSIZE: number = 32
|
||||
//结束考试弹窗
|
||||
@State endPopupVisible: boolean = false
|
||||
//等待弹窗(考试及格,考试不及格使用)
|
||||
@State loadingPopupVisible: boolean = false
|
||||
@State isDdxk: boolean = false;
|
||||
@State time: string = ''
|
||||
//考试用时
|
||||
@ -156,12 +152,51 @@ struct JudgePage {
|
||||
@State disConnectErrorOpen: boolean = false
|
||||
public context = getContext(this) as common.UIAbilityContext;
|
||||
// 信号查看弹窗
|
||||
signalTrajectoryDialog: CustomDialogController = new CustomDialogController({
|
||||
signalTrajectoryDialogController: CustomDialogController = new CustomDialogController({
|
||||
builder: SignalTrajectoryDialog(),
|
||||
customStyle: true,
|
||||
autoCancel: true
|
||||
})
|
||||
// 生成考试记录
|
||||
generateExamRecordsDialogController: CustomDialogController = new CustomDialogController({
|
||||
builder: CarLoadingDialog({
|
||||
text: "正在生成考试记录,请稍等...",
|
||||
}),
|
||||
customStyle: true
|
||||
})
|
||||
private judge: Judge = new Judge(this)
|
||||
// 结束考试弹窗
|
||||
endExamDialogController: CustomDialogController = new CustomDialogController({
|
||||
builder: ConfirmDialog({
|
||||
text: "确认结束考试?",
|
||||
onConfirm: async () => {
|
||||
if (this.isErrorMsgEnd) {
|
||||
this.judge.closeAllFiles()
|
||||
router.back()
|
||||
return
|
||||
}
|
||||
if (Reflect.get(this.judgeConfigObj, '344') == 1) {
|
||||
Prompt.showToast({
|
||||
message: '考试未结束,不允许手动退出!',
|
||||
duration: 4000
|
||||
});
|
||||
return
|
||||
}
|
||||
this.endExamDialogController.close()
|
||||
// this.loadingPopupVisible = true
|
||||
this.generateExamRecordsDialogController.open()
|
||||
clearInterval(this.timer);
|
||||
clearInterval(AppStorage.get('judgeTimer'))
|
||||
try {
|
||||
this.judge.checkExamIsEnd(true);
|
||||
} catch (e) {
|
||||
this.judge.closeAllFiles()
|
||||
router.back()
|
||||
}
|
||||
}
|
||||
}),
|
||||
customStyle: true
|
||||
})
|
||||
|
||||
async aboutToDisappear() {
|
||||
clearInterval(this.mileageTimer)
|
||||
@ -410,7 +445,7 @@ struct JudgePage {
|
||||
//获取当前考车的考试项目
|
||||
if (carNo !== '' && systemParm.no1 == "3" && systemParm.no2 == carNo && systemParm.no3 == "10") {
|
||||
allItems = decodeURIComponent(systemParm.txt1 || "").split(',').filter(txt => txt !== '')
|
||||
dConsole.info(JudgeTag, 'surenjun', JSON.stringify(allItems))
|
||||
dConsole.info(JudgeTag, '考试项目', allItems)
|
||||
}
|
||||
if (
|
||||
//科目二获取项目
|
||||
@ -949,7 +984,7 @@ struct JudgePage {
|
||||
// type: 1,
|
||||
// name: 'button_media.wav'
|
||||
// })
|
||||
this.signalTrajectoryDialog.open()
|
||||
this.signalTrajectoryDialogController.open()
|
||||
})
|
||||
|
||||
Row() {
|
||||
@ -1017,12 +1052,8 @@ struct JudgePage {
|
||||
.backgroundImage($rawfile('judge/anniu_nor.png'), ImageRepeat.NoRepeat)
|
||||
.backgroundImageSize({ width: '100%', height: '100%' })
|
||||
.onClick(() => {
|
||||
// this.vocObj.playAudio({
|
||||
// type: 1,
|
||||
// name: 'button_media.wav'
|
||||
// })
|
||||
if (Reflect.get(this.judgeConfigObj, '353') == '0') {
|
||||
this.endPopupVisible = true
|
||||
this.endExamDialogController.open()
|
||||
} else {
|
||||
Prompt.showToast({
|
||||
message: '车上不允许手动结束考试!',
|
||||
@ -1097,47 +1128,6 @@ struct JudgePage {
|
||||
})
|
||||
}
|
||||
|
||||
//结束考试弹窗
|
||||
if (this.endPopupVisible) {
|
||||
EndPoPup({
|
||||
title: '确定结束考试吗?',
|
||||
cancelFn: () => {
|
||||
this.endPopupVisible = false;
|
||||
},
|
||||
confirmFn: async () => {
|
||||
if (this.isErrorMsgEnd) {
|
||||
this.judge.closeAllFiles()
|
||||
router.back()
|
||||
return
|
||||
}
|
||||
if (Reflect.get(this.judgeConfigObj, '344') == 1) {
|
||||
Prompt.showToast({
|
||||
message: '考试未结束,不允许手动退出!',
|
||||
duration: 4000
|
||||
});
|
||||
return
|
||||
}
|
||||
this.endPopupVisible = false;
|
||||
this.loadingPopupVisible = true
|
||||
clearInterval(this.timer);
|
||||
clearInterval(AppStorage.get('judgeTimer'))
|
||||
try {
|
||||
this.judge.checkExamIsEnd(true);
|
||||
} catch (e) {
|
||||
this.judge.closeAllFiles()
|
||||
router.back()
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//loading 弹窗
|
||||
if (this.loadingPopupVisible) {
|
||||
LoadingPopup({
|
||||
title: '正在生成考试记录,请稍后...',
|
||||
})
|
||||
}
|
||||
|
||||
if (this.errorMsg) {
|
||||
MsgPopup({
|
||||
|
||||
@ -12,15 +12,17 @@ const lBg = $rawfile('judge/km3/road/luxian_nor.png');
|
||||
@Entry
|
||||
@Component
|
||||
struct RoadsPage {
|
||||
@State roadObj: number[] = [];
|
||||
@State roadArr: number[] = [];
|
||||
|
||||
async aboutToAppear() {
|
||||
//读取systemparam表的no1等于4的
|
||||
//读取MA_SYSTEMPARM表的no1等于4的 然后根据no2去重
|
||||
const systemParms: Array<MASYSTEMPARMType> = await GetSyncData('MA_SYSTEMPARM') as MASYSTEMPARMType[];
|
||||
dConsole.log(RoadsTag, systemParms)
|
||||
systemParms.forEach((systemParm: MASYSTEMPARMType) => {
|
||||
if (systemParm.no1.toString() === "4") {
|
||||
this.roadObj.push(systemParm.no2)
|
||||
if (!this.roadArr.includes(systemParm.no2)) {
|
||||
this.roadArr.push(systemParm.no2);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -64,11 +66,11 @@ struct RoadsPage {
|
||||
.height(220)
|
||||
.margin({ left: 5, bottom: 10 })
|
||||
.onClick(async () => {
|
||||
const wayno = this.roadObj[Math.floor(Math.random() * this.roadObj.length)];
|
||||
const wayno = this.roadArr[Math.floor(Math.random() * this.roadArr.length)];
|
||||
this.goJudge(wayno)
|
||||
})
|
||||
|
||||
ForEach(this.roadObj, (item: number) => {
|
||||
ForEach(this.roadArr, (item: number) => {
|
||||
ListItem() {
|
||||
Column() {
|
||||
Row() {
|
||||
|
||||
@ -47,8 +47,8 @@ import HeaderComponent from './compontents/Header';
|
||||
import AvatarComponent from './UserInfo/Avatar';
|
||||
import CommTextComponent from './UserInfo/CommText';
|
||||
import LabelBlockComponent from './UserInfo/LabelBlock';
|
||||
import MissAnExamDialog from './UserInfo/MissAnExamDialog';
|
||||
import CarLoadingDialog from './compontents/CarLoading';
|
||||
import ConfirmDialog from './compontents/ConfirmDialog';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
@ -74,19 +74,11 @@ struct UserInfoPage {
|
||||
@State loadingText: string = '正在认证监管信息,请稍后...'
|
||||
@State sczbkf: SckType[] = []
|
||||
@State currentUser: User = EmptyCandidateObject
|
||||
// 缺考弹窗
|
||||
missAnExamDialogController: CustomDialogController = new CustomDialogController({
|
||||
builder: MissAnExamDialog({
|
||||
name: this.currentUser.xm,
|
||||
onConfirm: () => {
|
||||
this.qkFn()
|
||||
}
|
||||
})
|
||||
})
|
||||
// 开始考试弹窗
|
||||
startExamDialog: CustomDialogController = new CustomDialogController({
|
||||
startExamDialogController: CustomDialogController = new CustomDialogController({
|
||||
builder: CarLoadingDialog(),
|
||||
autoCancel: false
|
||||
autoCancel: false,
|
||||
customStyle: true
|
||||
})
|
||||
@State dataList: Array<User> = []
|
||||
@State list: Array<User> = []
|
||||
@ -108,7 +100,17 @@ struct UserInfoPage {
|
||||
@State signNum: number = 0;
|
||||
@State isCanClick: boolean = true;
|
||||
@State updateTimeLimit: boolean = false
|
||||
@State ksksLimit: boolean = false
|
||||
// 缺考弹窗
|
||||
missAnExamDialogController: CustomDialogController = new CustomDialogController({
|
||||
builder: ConfirmDialog({
|
||||
text: `确认考生:${this.currentUser.xm}是否缺考?`,
|
||||
onConfirm: () => {
|
||||
this.qkFn()
|
||||
}
|
||||
}),
|
||||
customStyle: true,
|
||||
autoCancel: true
|
||||
})
|
||||
@State faceFlag: string = '0';
|
||||
@State FaceOpenStatue: string = '0'; //是否开启人脸识别
|
||||
@State faceCatchImg: string = ''
|
||||
@ -163,9 +165,6 @@ struct UserInfoPage {
|
||||
]
|
||||
//开始考试准备
|
||||
prePareExam = async () => {
|
||||
if (this.ksksLimit) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
await this.checkSignal()
|
||||
this.faceCompareSucess = 0
|
||||
@ -173,7 +172,6 @@ struct UserInfoPage {
|
||||
if (!this.currentUser.xm) {
|
||||
return
|
||||
}
|
||||
this.ksksLimit = true
|
||||
if (this.singlePlay) {
|
||||
this.currentUser.id = '0'
|
||||
dConsole.log('开始考试')
|
||||
@ -187,7 +185,6 @@ struct UserInfoPage {
|
||||
kfdm: this.sczbkf,
|
||||
}
|
||||
}, router.RouterMode.Single);
|
||||
this.ksksLimit = false
|
||||
this.stopDeviceById()
|
||||
return
|
||||
}
|
||||
@ -216,7 +213,6 @@ struct UserInfoPage {
|
||||
this.isExamStart = false
|
||||
this.startExam = false
|
||||
this.updateTimeLimit = false
|
||||
this.ksksLimit = false
|
||||
this.currentUser = EmptyCandidateObject
|
||||
this.filePhoto = new FilePhoto(this.context);
|
||||
this.singlePlay = AppStorage.get<boolean>('singlePlay') || false
|
||||
@ -606,7 +602,6 @@ struct UserInfoPage {
|
||||
|
||||
//人脸比对窗口关闭
|
||||
changeFaceCompareSuccess() {
|
||||
this.ksksLimit = false
|
||||
dConsole.log('this.faceCompareSuces', this.faceCompareSucess, JSON.stringify(this.currentUser))
|
||||
if (this.faceCompareSucess > 0) {
|
||||
//人脸比对通过
|
||||
@ -640,7 +635,6 @@ struct UserInfoPage {
|
||||
this.isExamStart = false
|
||||
this.startExam = false
|
||||
this.updateTimeLimit = false
|
||||
this.ksksLimit = false
|
||||
// this.isBoardPrePareSetPopupOpen=true
|
||||
this.isFirstBoardPrePareSetPopupBtnShow = false
|
||||
dConsole.log('isFirstBoardPrePareSetPopupBtnShow', this.isFirstBoardPrePareSetPopupBtnShow,
|
||||
@ -774,7 +768,6 @@ struct UserInfoPage {
|
||||
return
|
||||
}
|
||||
this.faceCompareSucess = 0
|
||||
this.ksksLimit = false
|
||||
if (this.singlePlay) {
|
||||
this.qkFlag = false
|
||||
return
|
||||
@ -857,7 +850,7 @@ struct UserInfoPage {
|
||||
}
|
||||
this.currentUser.id = '1'
|
||||
const avPlayer = this.avPlayer;
|
||||
this.startExamDialog.open()
|
||||
this.startExamDialogController.open()
|
||||
|
||||
avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => {
|
||||
dConsole.info('surenjun', '播放结束开始考试接口调用')
|
||||
@ -868,7 +861,7 @@ struct UserInfoPage {
|
||||
|
||||
if (res.code != 1) {
|
||||
avPlayer.playAudio([res.code == -200 ? 'voice/photo_error.mp3' : 'voice/监管审核未通过.mp3']);
|
||||
this.startExamDialog.close()
|
||||
this.startExamDialogController.close()
|
||||
this.isExamStart = false
|
||||
promptAction.showToast({
|
||||
message: res.message,
|
||||
@ -880,7 +873,7 @@ struct UserInfoPage {
|
||||
// await upDateTableByArray('USER', [this.currentUser])
|
||||
await SqlInsertTable('USER', [this.currentUser])
|
||||
this.stepFlag = false
|
||||
this.startExamDialog.close()
|
||||
this.startExamDialogController.close()
|
||||
router.pushUrl({
|
||||
url: 'pages/Judge',
|
||||
params: {
|
||||
@ -1008,8 +1001,7 @@ struct UserInfoPage {
|
||||
AppStorage.setOrCreate('startHourTime', startHourTime)
|
||||
const photoBase64 = await this.getPhoto();
|
||||
if (photoBase64 == '') {
|
||||
this.ksksLimit = false
|
||||
this.startExamDialog.close()
|
||||
this.startExamDialogController.close()
|
||||
return { code: -200 }
|
||||
}
|
||||
const drvexam: DrvexamType = {
|
||||
@ -1196,12 +1188,12 @@ struct UserInfoPage {
|
||||
imageBtn({ btnWidth: 390, btnHeight: 122, imgSrc: $r('app.media.qk_btn') })
|
||||
.margin({ bottom: 21 })
|
||||
.onClick(() => {
|
||||
if (this.ksksLimit || (this.systemParam.Param352Str == '1' && this.currentUser.kssycs == '1') ||
|
||||
if ((this.systemParam.Param352Str == '1' && this.currentUser.kssycs == '1') ||
|
||||
this.systemParam.Param770Str == '1') {
|
||||
return
|
||||
}
|
||||
this.ksksLimit = true
|
||||
// this.qkFlag = true
|
||||
console.log("打开缺考")
|
||||
this.missAnExamDialogController.open()
|
||||
})
|
||||
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
// 缺考考生弹窗
|
||||
import BtnComponent from '../compontents/Button';
|
||||
import BtnComponent from './Button';
|
||||
|
||||
@CustomDialog
|
||||
export default struct MissAnExamDialog {
|
||||
@Prop name: string = "xxx";
|
||||
export default struct ConfirmDialog {
|
||||
@Prop text: string = "xxx";
|
||||
private controller?: CustomDialogController;
|
||||
onConfirm: () => void = () => {
|
||||
};
|
||||
@ -14,7 +13,7 @@ export default struct MissAnExamDialog {
|
||||
top: 40
|
||||
}).fontWeight(FontWeight.Bold)
|
||||
Row() {
|
||||
Text(`确认考生:${this.name}是否缺考?`).fontSize(28)
|
||||
Text(this.text).fontSize(28)
|
||||
}.height(300).justifyContent(FlexAlign.Center).alignItems(VerticalAlign.Center)
|
||||
|
||||
Row() {
|
||||
@ -38,11 +37,4 @@ export default struct MissAnExamDialog {
|
||||
color: "#E7B544"
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@Component
|
||||
struct btnComponent {
|
||||
build() {
|
||||
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,7 @@
|
||||
import dayTs from '../../utils/Date'
|
||||
import router from '@ohos.router'
|
||||
import common from '@ohos.app.ability.common'
|
||||
import BtnComponent from './Button'
|
||||
import ConfirmDialog from './ConfirmDialog'
|
||||
|
||||
@Component
|
||||
export default struct HeaderComponent {
|
||||
@ -25,7 +25,12 @@ export default struct HeaderComponent {
|
||||
@BuilderParam
|
||||
logoExpansionBuilder?: () => void = this.customBuilder
|
||||
exitDialogController: CustomDialogController = new CustomDialogController({
|
||||
builder: exitDialogComponent(),
|
||||
builder: ConfirmDialog({
|
||||
text: "是否确认退出程序?",
|
||||
onConfirm: () => {
|
||||
(getContext(this) as common.UIAbilityContext).terminateSelf()
|
||||
}
|
||||
}),
|
||||
customStyle: true
|
||||
})
|
||||
|
||||
@ -99,38 +104,4 @@ export default struct HeaderComponent {
|
||||
}
|
||||
}
|
||||
|
||||
@CustomDialog
|
||||
struct exitDialogComponent {
|
||||
private controller?: CustomDialogController;
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
Text("提示信息").fontSize(26).margin({
|
||||
top: 40
|
||||
}).fontWeight(FontWeight.Bold)
|
||||
Row() {
|
||||
Text("是否确认退出程序?").fontSize(28)
|
||||
}.margin({
|
||||
top: 100,
|
||||
bottom: 90
|
||||
})
|
||||
|
||||
Row() {
|
||||
BtnComponent({
|
||||
text: "取消"
|
||||
}).onClick(() => {
|
||||
this.controller?.close()
|
||||
})
|
||||
BtnComponent().onClick(() => {
|
||||
(getContext(this) as common.UIAbilityContext).terminateSelf()
|
||||
})
|
||||
}
|
||||
}
|
||||
.backgroundImage($r("app.media.km_open"))
|
||||
.backgroundImageSize({
|
||||
width: "100%",
|
||||
height: "100%"
|
||||
}).width(800).height(400)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,12 @@
|
||||
import { GPSData, InitialPerLane, SignalData } from '../../mock'
|
||||
import { EnvironmentConfigurationType, PerLane, RoadDataType, SignalDataType, WorkerBackMessage } from '../../model'
|
||||
import {
|
||||
EnvironmentConfigurationType,
|
||||
PerLane,
|
||||
RoadDataType,
|
||||
SignalDataType,
|
||||
WorkerBackMessage,
|
||||
WorkerBackMessageType
|
||||
} from '../../model'
|
||||
import apiJudgeSdk from 'libJudgeSdk.so'
|
||||
|
||||
import { DifferentialAndSignal } from '../../utils/business/DifferentialAndSignalWorker'
|
||||
@ -23,14 +30,20 @@ export default struct SignalDisplayComponent {
|
||||
@State laneSignal: PerLane = InitialPerLane
|
||||
|
||||
aboutToAppear(): void {
|
||||
DifferentialAndSignal.onMsg((data: string) => {
|
||||
const result: WorkerBackMessage = JSON.parse(data)
|
||||
dConsole.log("wzj", data)
|
||||
if (result.type === "obtainUdpData") {
|
||||
this.getSignal(result.data as string)
|
||||
this.rawData = result.data as string
|
||||
}
|
||||
})
|
||||
DifferentialAndSignal.onMsg(this.getMsg)
|
||||
}
|
||||
|
||||
getMsg(data: string) {
|
||||
const result: WorkerBackMessage = JSON.parse(data)
|
||||
dConsole.log("wzj", data)
|
||||
if (result.type === WorkerBackMessageType.ObtainUdpData) {
|
||||
this.getSignal(result.data as string)
|
||||
this.rawData = result.data as string
|
||||
}
|
||||
}
|
||||
|
||||
aboutToDisappear(): void {
|
||||
DifferentialAndSignal.offMsg(this.getMsg)
|
||||
}
|
||||
|
||||
getSignal = (msg: string) => {
|
||||
@ -39,11 +52,9 @@ export default struct SignalDisplayComponent {
|
||||
return
|
||||
}
|
||||
this.signArr = newArr
|
||||
|
||||
for (let i = 0; i <= 12; i++) {
|
||||
this.vehicleSignal[i].value = this.signArr[i+2]
|
||||
}
|
||||
|
||||
this.vehicleSignal[13].value = this.signArr[17]
|
||||
this.vehicleSignal[14].value = this.signArr[18]
|
||||
this.vehicleSignal[15].value = this.signArr[19]
|
||||
|
||||
@ -50,6 +50,8 @@ import {
|
||||
RouteParamsType,
|
||||
TKmItem,
|
||||
User,
|
||||
WorkerBackMessage,
|
||||
WorkerBackMessageType,
|
||||
WR
|
||||
} from '../../model';
|
||||
import { DrivingDataStorage } from '../../utils/business/DrivingDataStorage';
|
||||
@ -228,60 +230,6 @@ export default class Judge {
|
||||
dConsole.info(JudgeTag, '过程数据文件上传 end')
|
||||
}
|
||||
private judgeTask: JudgeTask
|
||||
// 检测扣分、结束项目时该项目是否开始
|
||||
checkProjectIsStart = async (xmdm: number, currentType: 1 | 2, kf?: MarkRule) => {
|
||||
if (xmdm == 20) {
|
||||
return true
|
||||
}
|
||||
const judgeUI = this.judgeUI;
|
||||
const judgeTask = this.judgeTask;
|
||||
const projectsObj: object = this.judgeUI.projectsObj
|
||||
const currentProject: ProjectInfo = Reflect.get(projectsObj, xmdm)
|
||||
const isUpload = currentProject.isUpload
|
||||
|
||||
//如果项目没有开始
|
||||
dConsole.info(JudgeTag, 'surenjun isUpload=>', isUpload)
|
||||
if (!isUpload) {
|
||||
dConsole.info(JudgeTag, '项目补传开始')
|
||||
//项目开始补传
|
||||
judgeTask.addTask(async () => {
|
||||
await this.beginProject(xmdm)
|
||||
}, {
|
||||
isDelay: true
|
||||
})
|
||||
judgeTask.addTask(async () => {
|
||||
await this.uploadProgressPhoto(xmdm)
|
||||
}, {
|
||||
isDelay: true
|
||||
})
|
||||
currentProject.isUpload = true;
|
||||
Reflect.set(this.judgeUI.projectsObj, xmdm, currentProject)
|
||||
//扣分补传
|
||||
if (currentType == 2) {
|
||||
judgeTask.addTask(async () => {
|
||||
await this.pointsDedute(xmdm, kf!)
|
||||
}, {
|
||||
isDelay: true
|
||||
})
|
||||
}
|
||||
//扣分补传判断是否合格 不合格补传项目结束
|
||||
if (currentType == 1 || (currentType == 2 && this.totalScore < judgeUI.passingScore)) {
|
||||
judgeTask.addTask(async () => {
|
||||
await this.endProject(xmdm)
|
||||
}, {
|
||||
isDelay: true
|
||||
})
|
||||
currentProject.isEnd = true;
|
||||
Reflect.set(this.judgeUI.projectsObj, xmdm, currentProject)
|
||||
}
|
||||
judgeTask.addTask(async () => {
|
||||
this.checkExamIsEnd()
|
||||
})
|
||||
return false;
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
private tempData?: PLCType
|
||||
//实时计算gps经纬度距离
|
||||
handDistance = async () => {
|
||||
@ -447,7 +395,6 @@ export default class Judge {
|
||||
}
|
||||
// 处理udp plc信号
|
||||
handleUdp = async (msg: string) => {
|
||||
dConsole.info(JudgeTag, 'plc信号', msg)
|
||||
const stachArr = msg.split(',')
|
||||
if (stachArr[0] != '#DN_GD' || this.isUdpEnd) {
|
||||
return
|
||||
@ -515,9 +462,9 @@ export default class Judge {
|
||||
}
|
||||
//本地轨迹回放地址
|
||||
private trajectoryPath: string
|
||||
//当前科目二的考试项目
|
||||
// private currentKm2ItemsObj: any
|
||||
private isTrajectoryOpen: boolean;
|
||||
//当前科目二的考试项目
|
||||
// 调代理接口是否断网了
|
||||
private isJudgeDisConnect: boolean = false;
|
||||
// 断网数据补传
|
||||
@ -601,33 +548,6 @@ export default class Judge {
|
||||
dConsole.info(JudgeTag, '项目结束 end')
|
||||
UploadRegulatoryCodeConversion('17C55', temp.code || 0)
|
||||
}
|
||||
private artSubject3ProjectsCodesArr: number[] = [3, 9, 4, 10, 12, 11]
|
||||
private lane: LANE = {
|
||||
road: '', num: 0, count: 0
|
||||
}
|
||||
private videoData?: RecordHandleType
|
||||
private disConnectNum: number = 0;
|
||||
//调用监管接口
|
||||
sendWriteObjectOut: SendWriteObjectOut = async (data, filePath) => {
|
||||
const temp = await writeObjectOut(data, filePath, this.context);
|
||||
dConsole.log(JudgeTag, "wzj", JSON.stringify(temp))
|
||||
//断网&网络超时次数计算
|
||||
if (temp.code == 2300007 || temp.code == 2300028) {
|
||||
this.disConnectNum += 1;
|
||||
if (this.disConnectNum < 5) {
|
||||
return await this.sendWriteObjectOut(data, filePath)
|
||||
}
|
||||
}
|
||||
|
||||
if (this.disConnectNum >= 5) {
|
||||
dConsole.info('surenjun', '123')
|
||||
this.judgeUI.errorMsg = '当前的考试过程信息网络传输异常,程序点击确认将重启!';
|
||||
this.judgeUI.disConnectErrorOpen = true
|
||||
}
|
||||
|
||||
this.disConnectNum = 0
|
||||
return temp
|
||||
}
|
||||
// 考试过程照片
|
||||
uploadProgressPhoto = async (ksxm: number) => {
|
||||
const time = GetCurrentTime();
|
||||
@ -662,6 +582,87 @@ export default class Judge {
|
||||
UploadRegulatoryCodeConversion('17C54', temp.code || 0)
|
||||
dConsole.info(JudgeTag, '上传照片 end')
|
||||
}
|
||||
// 检测扣分、结束项目时该项目是否开始
|
||||
checkProjectIsStart = async (xmdm: number, currentType: 1 | 2, kf?: MarkRule) => {
|
||||
if (xmdm == 20) {
|
||||
return true
|
||||
}
|
||||
const judgeUI = this.judgeUI;
|
||||
const judgeTask = this.judgeTask;
|
||||
const projectsObj: object = this.judgeUI.projectsObj
|
||||
const currentProject: ProjectInfo = Reflect.get(projectsObj, xmdm)
|
||||
const isUpload = currentProject.isUpload
|
||||
|
||||
//如果项目没有开始
|
||||
dConsole.info(JudgeTag, 'surenjun isUpload=>', isUpload)
|
||||
if (!isUpload) {
|
||||
dConsole.info(JudgeTag, '项目补传开始')
|
||||
//项目开始补传
|
||||
judgeTask.addTask(async () => {
|
||||
await this.beginProject(xmdm)
|
||||
}, {
|
||||
isDelay: true
|
||||
})
|
||||
judgeTask.addTask(async () => {
|
||||
await this.uploadProgressPhoto(xmdm)
|
||||
}, {
|
||||
isDelay: true
|
||||
})
|
||||
currentProject.isUpload = true;
|
||||
Reflect.set(this.judgeUI.projectsObj, xmdm, currentProject)
|
||||
//扣分补传
|
||||
if (currentType == 2) {
|
||||
judgeTask.addTask(async () => {
|
||||
await this.pointsDedute(xmdm, kf!)
|
||||
}, {
|
||||
isDelay: true
|
||||
})
|
||||
}
|
||||
//扣分补传判断是否合格 不合格补传项目结束
|
||||
if (currentType == 1 || (currentType == 2 && this.totalScore < judgeUI.passingScore)) {
|
||||
judgeTask.addTask(async () => {
|
||||
await this.endProject(xmdm)
|
||||
}, {
|
||||
isDelay: true
|
||||
})
|
||||
currentProject.isEnd = true;
|
||||
Reflect.set(this.judgeUI.projectsObj, xmdm, currentProject)
|
||||
}
|
||||
judgeTask.addTask(async () => {
|
||||
this.checkExamIsEnd()
|
||||
})
|
||||
return false;
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
private artSubject3ProjectsCodesArr: number[] = [3, 9, 4, 10, 12, 11]
|
||||
private lane: LANE = {
|
||||
road: '', num: 0, count: 0
|
||||
}
|
||||
private videoData?: RecordHandleType
|
||||
private disConnectNum: number = 0;
|
||||
//调用监管接口
|
||||
sendWriteObjectOut: SendWriteObjectOut = async (data, filePath) => {
|
||||
const temp = await writeObjectOut(data, filePath, this.context);
|
||||
dConsole.log(JudgeTag, "wzj", JSON.stringify(temp))
|
||||
//断网&网络超时次数计算
|
||||
if (temp.code == 2300007 || temp.code == 2300028) {
|
||||
this.disConnectNum += 1;
|
||||
if (this.disConnectNum < 5) {
|
||||
return await this.sendWriteObjectOut(data, filePath)
|
||||
}
|
||||
}
|
||||
|
||||
if (this.disConnectNum >= 5) {
|
||||
dConsole.info('surenjun', '123')
|
||||
this.judgeUI.errorMsg = '当前的考试过程信息网络传输异常,程序点击确认将重启!';
|
||||
this.judgeUI.disConnectErrorOpen = true
|
||||
}
|
||||
|
||||
this.disConnectNum = 0
|
||||
return temp
|
||||
}
|
||||
|
||||
constructor(judgeUI: JudgeUI) {
|
||||
this.serialIndex = 1;
|
||||
@ -1160,7 +1161,7 @@ export default class Judge {
|
||||
|
||||
// 扣分
|
||||
case 3:
|
||||
dConsole.info('surenjun', '扣分开始')
|
||||
dConsole.info(JudgeTag, 'surenjun', '扣分开始')
|
||||
//扣分时实时播报语音(0-否+1-是)
|
||||
const currentKf = kf[kfLen -1];
|
||||
if (JudgeConfig.kfVoiceOpen || (examSubject == '2' && judgeConfigObj['618'] == '1') ||
|
||||
@ -1321,8 +1322,10 @@ export default class Judge {
|
||||
}
|
||||
// 处理考试结束
|
||||
public handEndExam = async () => {
|
||||
this.judgeUI.loadingPopupVisible = true;
|
||||
this.judgeUI.endPopupVisible = false;
|
||||
// this.judgeUI.loadingPopupVisible = true;
|
||||
this.judgeUI.generateExamRecordsDialogController.open()
|
||||
// this.judgeUI.endPopupVisible = false;
|
||||
this.judgeUI.endExamDialogController.close()
|
||||
this.judgeUI.isDeductedPopShow = false;
|
||||
|
||||
const judgeUI = this.judgeUI
|
||||
@ -1450,12 +1453,14 @@ export default class Judge {
|
||||
}
|
||||
this.isUdpEnd = true;
|
||||
closeAllFiles()
|
||||
this.judgeUI.loadingPopupVisible = false;
|
||||
// this.judgeUI.loadingPopupVisible = false;
|
||||
this.judgeUI.generateExamRecordsDialogController.close()
|
||||
return
|
||||
}
|
||||
dConsole.info(JudgeTag, '考试结束 end')
|
||||
const param302: string = Reflect.get(judgeConfigObj, '302')
|
||||
judgeUI.loadingPopupVisible = true;
|
||||
// judgeUI.loadingPopupVisible = true;
|
||||
judgeUI.generateExamRecordsDialogController.open()
|
||||
let currentKssycs = '0';
|
||||
let voiceURL = ''
|
||||
if (examSubject == '2') {
|
||||
@ -1950,7 +1955,10 @@ export default class Judge {
|
||||
// 处理实时udp里的plc信号
|
||||
DifferentialAndSignal.onMsg((data: string) => {
|
||||
dConsole.info(JudgeTag, 'socketTag[PLC.UdpClient]', '收到udp回调数据')
|
||||
handleUdp(data)
|
||||
const result: WorkerBackMessage = JSON.parse(data)
|
||||
if (result.type === WorkerBackMessageType.ObtainUdpData) {
|
||||
handleUdp(result.data as string)
|
||||
}
|
||||
//TODO UDP修改
|
||||
// const udpIndex = globalThis.udpIndex;
|
||||
// if (udpIndex % 5 === 0) {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// 处理worker线程的消息tcp拿差分改正数,udp给后置机
|
||||
import worker, { ErrorEvent, MessageEvents, ThreadWorkerGlobalScope } from '@ohos.worker';
|
||||
import { WorkerTag } from '../config';
|
||||
import { CenterCallBackMsgType, WorkerBackMessage, WorkerMessage } from '../model';
|
||||
import { CenterCallBackMsgType, WorkerBackMessage, WorkerBackMessageType, WorkerMessage } from '../model';
|
||||
import { CenterUDPBusinessInstance } from '../utils/business/CenterUdpBusiness';
|
||||
import { DifferentialSignal } from '../utils/business/DifferentialSignal';
|
||||
import { ObtainUdpBusinessInstance } from '../utils/business/ObtainUdpBusiness';
|
||||
@ -56,7 +56,7 @@ function getDataFn() {
|
||||
// 收到后置机消息传出去提供给业务,data应该是个string
|
||||
workerPort.postMessage(
|
||||
JSON.stringify({
|
||||
type: 'obtainUdpData',
|
||||
type: WorkerBackMessageType.ObtainUdpData,
|
||||
data: data
|
||||
} as WorkerBackMessage))
|
||||
})
|
||||
@ -68,7 +68,7 @@ function getDataFn() {
|
||||
// 收到中心指令发送出去
|
||||
workerPort.postMessage(
|
||||
JSON.stringify({
|
||||
type: 'centerUdpData',
|
||||
type: WorkerBackMessageType.CenterUdpData,
|
||||
data: data
|
||||
} as WorkerBackMessage)
|
||||
)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 7.0 KiB |
Loading…
x
Reference in New Issue
Block a user