fix: 优化了信号取值问题,优化了评判内部弹窗
This commit is contained in:
parent
acd7aef88b
commit
edf7e07f6f
@ -490,14 +490,14 @@ export interface JudgeUI {
|
|||||||
jl: number
|
jl: number
|
||||||
dwztErrorVisible: boolean
|
dwztErrorVisible: boolean
|
||||||
isDeductedPopShow: boolean
|
isDeductedPopShow: boolean
|
||||||
loadingPopupVisible: boolean
|
|
||||||
endPopupVisible: boolean
|
|
||||||
defaultTabIndex: number
|
defaultTabIndex: number
|
||||||
isDwztRight: boolean
|
isDwztRight: boolean
|
||||||
draw: boolean
|
draw: boolean
|
||||||
lane: LANE
|
lane: LANE
|
||||||
sd: string
|
sd: string
|
||||||
dw: string
|
dw: string
|
||||||
|
endExamDialogController: CustomDialogController
|
||||||
|
generateExamRecordsDialogController: CustomDialogController
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,13 @@ export interface WorkerBackMessage {
|
|||||||
data: string | CenterCallBackMsgType
|
data: string | CenterCallBackMsgType
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum WorkerBackMessageType {
|
||||||
|
// 后置机信息
|
||||||
|
ObtainUdpData = 'obtainUdpData',
|
||||||
|
// 中心消息
|
||||||
|
CenterUdpData = 'centerUdpData',
|
||||||
|
}
|
||||||
|
|
||||||
export interface LogWorkerMessage {
|
export interface LogWorkerMessage {
|
||||||
type: WorkerMessageType;
|
type: WorkerMessageType;
|
||||||
data?: string;
|
data?: string;
|
||||||
|
|||||||
@ -40,6 +40,5 @@ export default struct LoadingComponent {
|
|||||||
radius: 30,
|
radius: 30,
|
||||||
color: "#E7B544"
|
color: "#E7B544"
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,8 +1,6 @@
|
|||||||
import router from '@ohos.router';
|
import router from '@ohos.router';
|
||||||
import Prompt from '@system.prompt';
|
import Prompt from '@system.prompt';
|
||||||
import common from '@ohos.app.ability.common';
|
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 DeductedPopup from './compontents/judge/DeductionPopup';
|
||||||
import AmplifyPopup from './compontents/judge/AmplifyPopup';
|
import AmplifyPopup from './compontents/judge/AmplifyPopup';
|
||||||
import Judge from './judgeSDK/judge';
|
import Judge from './judgeSDK/judge';
|
||||||
@ -51,6 +49,8 @@ import FileUtils from '../utils/FileUtils';
|
|||||||
import SignalTrajectoryDialog from './Judge/SignalTrajectoryDialog';
|
import SignalTrajectoryDialog from './Judge/SignalTrajectoryDialog';
|
||||||
import { DefaultJudgeConfigData } from '../mock';
|
import { DefaultJudgeConfigData } from '../mock';
|
||||||
import { dConsole } from '../utils/LogWorker';
|
import { dConsole } from '../utils/LogWorker';
|
||||||
|
import ConfirmDialog from './compontents/ConfirmDialog';
|
||||||
|
import CarLoadingDialog from './compontents/CarLoading';
|
||||||
|
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@ -61,10 +61,6 @@ struct JudgePage {
|
|||||||
@State wayno: number = 0
|
@State wayno: number = 0
|
||||||
@State FONTSIZE: number = 30
|
@State FONTSIZE: number = 30
|
||||||
@State BIGFONTSIZE: number = 32
|
@State BIGFONTSIZE: number = 32
|
||||||
//结束考试弹窗
|
|
||||||
@State endPopupVisible: boolean = false
|
|
||||||
//等待弹窗(考试及格,考试不及格使用)
|
|
||||||
@State loadingPopupVisible: boolean = false
|
|
||||||
@State isDdxk: boolean = false;
|
@State isDdxk: boolean = false;
|
||||||
@State time: string = ''
|
@State time: string = ''
|
||||||
//考试用时
|
//考试用时
|
||||||
@ -156,12 +152,51 @@ struct JudgePage {
|
|||||||
@State disConnectErrorOpen: boolean = false
|
@State disConnectErrorOpen: boolean = false
|
||||||
public context = getContext(this) as common.UIAbilityContext;
|
public context = getContext(this) as common.UIAbilityContext;
|
||||||
// 信号查看弹窗
|
// 信号查看弹窗
|
||||||
signalTrajectoryDialog: CustomDialogController = new CustomDialogController({
|
signalTrajectoryDialogController: CustomDialogController = new CustomDialogController({
|
||||||
builder: SignalTrajectoryDialog(),
|
builder: SignalTrajectoryDialog(),
|
||||||
customStyle: true,
|
customStyle: true,
|
||||||
autoCancel: true
|
autoCancel: true
|
||||||
})
|
})
|
||||||
|
// 生成考试记录
|
||||||
|
generateExamRecordsDialogController: CustomDialogController = new CustomDialogController({
|
||||||
|
builder: CarLoadingDialog({
|
||||||
|
text: "正在生成考试记录,请稍等...",
|
||||||
|
}),
|
||||||
|
customStyle: true
|
||||||
|
})
|
||||||
private judge: Judge = new Judge(this)
|
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() {
|
async aboutToDisappear() {
|
||||||
clearInterval(this.mileageTimer)
|
clearInterval(this.mileageTimer)
|
||||||
@ -949,7 +984,7 @@ struct JudgePage {
|
|||||||
// type: 1,
|
// type: 1,
|
||||||
// name: 'button_media.wav'
|
// name: 'button_media.wav'
|
||||||
// })
|
// })
|
||||||
this.signalTrajectoryDialog.open()
|
this.signalTrajectoryDialogController.open()
|
||||||
})
|
})
|
||||||
|
|
||||||
Row() {
|
Row() {
|
||||||
@ -1017,12 +1052,8 @@ struct JudgePage {
|
|||||||
.backgroundImage($rawfile('judge/anniu_nor.png'), ImageRepeat.NoRepeat)
|
.backgroundImage($rawfile('judge/anniu_nor.png'), ImageRepeat.NoRepeat)
|
||||||
.backgroundImageSize({ width: '100%', height: '100%' })
|
.backgroundImageSize({ width: '100%', height: '100%' })
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
// this.vocObj.playAudio({
|
|
||||||
// type: 1,
|
|
||||||
// name: 'button_media.wav'
|
|
||||||
// })
|
|
||||||
if (Reflect.get(this.judgeConfigObj, '353') == '0') {
|
if (Reflect.get(this.judgeConfigObj, '353') == '0') {
|
||||||
this.endPopupVisible = true
|
this.endExamDialogController.open()
|
||||||
} else {
|
} else {
|
||||||
Prompt.showToast({
|
Prompt.showToast({
|
||||||
message: '车上不允许手动结束考试!',
|
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) {
|
if (this.errorMsg) {
|
||||||
MsgPopup({
|
MsgPopup({
|
||||||
|
|||||||
@ -47,8 +47,8 @@ import HeaderComponent from './compontents/Header';
|
|||||||
import AvatarComponent from './UserInfo/Avatar';
|
import AvatarComponent from './UserInfo/Avatar';
|
||||||
import CommTextComponent from './UserInfo/CommText';
|
import CommTextComponent from './UserInfo/CommText';
|
||||||
import LabelBlockComponent from './UserInfo/LabelBlock';
|
import LabelBlockComponent from './UserInfo/LabelBlock';
|
||||||
import MissAnExamDialog from './UserInfo/MissAnExamDialog';
|
|
||||||
import CarLoadingDialog from './compontents/CarLoading';
|
import CarLoadingDialog from './compontents/CarLoading';
|
||||||
|
import ConfirmDialog from './compontents/ConfirmDialog';
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
@ -74,19 +74,11 @@ struct UserInfoPage {
|
|||||||
@State loadingText: string = '正在认证监管信息,请稍后...'
|
@State loadingText: string = '正在认证监管信息,请稍后...'
|
||||||
@State sczbkf: SckType[] = []
|
@State sczbkf: SckType[] = []
|
||||||
@State currentUser: User = EmptyCandidateObject
|
@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(),
|
builder: CarLoadingDialog(),
|
||||||
autoCancel: false
|
autoCancel: false,
|
||||||
|
customStyle: true
|
||||||
})
|
})
|
||||||
@State dataList: Array<User> = []
|
@State dataList: Array<User> = []
|
||||||
@State list: Array<User> = []
|
@State list: Array<User> = []
|
||||||
@ -108,7 +100,17 @@ struct UserInfoPage {
|
|||||||
@State signNum: number = 0;
|
@State signNum: number = 0;
|
||||||
@State isCanClick: boolean = true;
|
@State isCanClick: boolean = true;
|
||||||
@State updateTimeLimit: boolean = false
|
@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 faceFlag: string = '0';
|
||||||
@State FaceOpenStatue: string = '0'; //是否开启人脸识别
|
@State FaceOpenStatue: string = '0'; //是否开启人脸识别
|
||||||
@State faceCatchImg: string = ''
|
@State faceCatchImg: string = ''
|
||||||
@ -163,9 +165,6 @@ struct UserInfoPage {
|
|||||||
]
|
]
|
||||||
//开始考试准备
|
//开始考试准备
|
||||||
prePareExam = async () => {
|
prePareExam = async () => {
|
||||||
if (this.ksksLimit) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
await this.checkSignal()
|
await this.checkSignal()
|
||||||
this.faceCompareSucess = 0
|
this.faceCompareSucess = 0
|
||||||
@ -173,7 +172,6 @@ struct UserInfoPage {
|
|||||||
if (!this.currentUser.xm) {
|
if (!this.currentUser.xm) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.ksksLimit = true
|
|
||||||
if (this.singlePlay) {
|
if (this.singlePlay) {
|
||||||
this.currentUser.id = '0'
|
this.currentUser.id = '0'
|
||||||
dConsole.log('开始考试')
|
dConsole.log('开始考试')
|
||||||
@ -187,7 +185,6 @@ struct UserInfoPage {
|
|||||||
kfdm: this.sczbkf,
|
kfdm: this.sczbkf,
|
||||||
}
|
}
|
||||||
}, router.RouterMode.Single);
|
}, router.RouterMode.Single);
|
||||||
this.ksksLimit = false
|
|
||||||
this.stopDeviceById()
|
this.stopDeviceById()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -216,7 +213,6 @@ struct UserInfoPage {
|
|||||||
this.isExamStart = false
|
this.isExamStart = false
|
||||||
this.startExam = false
|
this.startExam = false
|
||||||
this.updateTimeLimit = false
|
this.updateTimeLimit = false
|
||||||
this.ksksLimit = false
|
|
||||||
this.currentUser = EmptyCandidateObject
|
this.currentUser = EmptyCandidateObject
|
||||||
this.filePhoto = new FilePhoto(this.context);
|
this.filePhoto = new FilePhoto(this.context);
|
||||||
this.singlePlay = AppStorage.get<boolean>('singlePlay') || false
|
this.singlePlay = AppStorage.get<boolean>('singlePlay') || false
|
||||||
@ -606,7 +602,6 @@ struct UserInfoPage {
|
|||||||
|
|
||||||
//人脸比对窗口关闭
|
//人脸比对窗口关闭
|
||||||
changeFaceCompareSuccess() {
|
changeFaceCompareSuccess() {
|
||||||
this.ksksLimit = false
|
|
||||||
dConsole.log('this.faceCompareSuces', this.faceCompareSucess, JSON.stringify(this.currentUser))
|
dConsole.log('this.faceCompareSuces', this.faceCompareSucess, JSON.stringify(this.currentUser))
|
||||||
if (this.faceCompareSucess > 0) {
|
if (this.faceCompareSucess > 0) {
|
||||||
//人脸比对通过
|
//人脸比对通过
|
||||||
@ -640,7 +635,6 @@ struct UserInfoPage {
|
|||||||
this.isExamStart = false
|
this.isExamStart = false
|
||||||
this.startExam = false
|
this.startExam = false
|
||||||
this.updateTimeLimit = false
|
this.updateTimeLimit = false
|
||||||
this.ksksLimit = false
|
|
||||||
// this.isBoardPrePareSetPopupOpen=true
|
// this.isBoardPrePareSetPopupOpen=true
|
||||||
this.isFirstBoardPrePareSetPopupBtnShow = false
|
this.isFirstBoardPrePareSetPopupBtnShow = false
|
||||||
dConsole.log('isFirstBoardPrePareSetPopupBtnShow', this.isFirstBoardPrePareSetPopupBtnShow,
|
dConsole.log('isFirstBoardPrePareSetPopupBtnShow', this.isFirstBoardPrePareSetPopupBtnShow,
|
||||||
@ -774,7 +768,6 @@ struct UserInfoPage {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.faceCompareSucess = 0
|
this.faceCompareSucess = 0
|
||||||
this.ksksLimit = false
|
|
||||||
if (this.singlePlay) {
|
if (this.singlePlay) {
|
||||||
this.qkFlag = false
|
this.qkFlag = false
|
||||||
return
|
return
|
||||||
@ -857,7 +850,7 @@ struct UserInfoPage {
|
|||||||
}
|
}
|
||||||
this.currentUser.id = '1'
|
this.currentUser.id = '1'
|
||||||
const avPlayer = this.avPlayer;
|
const avPlayer = this.avPlayer;
|
||||||
this.startExamDialog.open()
|
this.startExamDialogController.open()
|
||||||
|
|
||||||
avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => {
|
avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => {
|
||||||
dConsole.info('surenjun', '播放结束开始考试接口调用')
|
dConsole.info('surenjun', '播放结束开始考试接口调用')
|
||||||
@ -868,7 +861,7 @@ struct UserInfoPage {
|
|||||||
|
|
||||||
if (res.code != 1) {
|
if (res.code != 1) {
|
||||||
avPlayer.playAudio([res.code == -200 ? 'voice/photo_error.mp3' : 'voice/监管审核未通过.mp3']);
|
avPlayer.playAudio([res.code == -200 ? 'voice/photo_error.mp3' : 'voice/监管审核未通过.mp3']);
|
||||||
this.startExamDialog.close()
|
this.startExamDialogController.close()
|
||||||
this.isExamStart = false
|
this.isExamStart = false
|
||||||
promptAction.showToast({
|
promptAction.showToast({
|
||||||
message: res.message,
|
message: res.message,
|
||||||
@ -880,7 +873,7 @@ struct UserInfoPage {
|
|||||||
// await upDateTableByArray('USER', [this.currentUser])
|
// await upDateTableByArray('USER', [this.currentUser])
|
||||||
await SqlInsertTable('USER', [this.currentUser])
|
await SqlInsertTable('USER', [this.currentUser])
|
||||||
this.stepFlag = false
|
this.stepFlag = false
|
||||||
this.startExamDialog.close()
|
this.startExamDialogController.close()
|
||||||
router.pushUrl({
|
router.pushUrl({
|
||||||
url: 'pages/Judge',
|
url: 'pages/Judge',
|
||||||
params: {
|
params: {
|
||||||
@ -1008,8 +1001,7 @@ struct UserInfoPage {
|
|||||||
AppStorage.setOrCreate('startHourTime', startHourTime)
|
AppStorage.setOrCreate('startHourTime', startHourTime)
|
||||||
const photoBase64 = await this.getPhoto();
|
const photoBase64 = await this.getPhoto();
|
||||||
if (photoBase64 == '') {
|
if (photoBase64 == '') {
|
||||||
this.ksksLimit = false
|
this.startExamDialogController.close()
|
||||||
this.startExamDialog.close()
|
|
||||||
return { code: -200 }
|
return { code: -200 }
|
||||||
}
|
}
|
||||||
const drvexam: DrvexamType = {
|
const drvexam: DrvexamType = {
|
||||||
@ -1196,12 +1188,12 @@ struct UserInfoPage {
|
|||||||
imageBtn({ btnWidth: 390, btnHeight: 122, imgSrc: $r('app.media.qk_btn') })
|
imageBtn({ btnWidth: 390, btnHeight: 122, imgSrc: $r('app.media.qk_btn') })
|
||||||
.margin({ bottom: 21 })
|
.margin({ bottom: 21 })
|
||||||
.onClick(() => {
|
.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') {
|
this.systemParam.Param770Str == '1') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.ksksLimit = true
|
|
||||||
// this.qkFlag = true
|
// this.qkFlag = true
|
||||||
|
console.log("打开缺考")
|
||||||
this.missAnExamDialogController.open()
|
this.missAnExamDialogController.open()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
// 缺考考生弹窗
|
import BtnComponent from './Button';
|
||||||
import BtnComponent from '../compontents/Button';
|
|
||||||
|
|
||||||
@CustomDialog
|
@CustomDialog
|
||||||
export default struct MissAnExamDialog {
|
export default struct ConfirmDialog {
|
||||||
@Prop name: string = "xxx";
|
@Prop text: string = "xxx";
|
||||||
private controller?: CustomDialogController;
|
private controller?: CustomDialogController;
|
||||||
onConfirm: () => void = () => {
|
onConfirm: () => void = () => {
|
||||||
};
|
};
|
||||||
|
onCancel?: () => void = () => {
|
||||||
|
};
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
Column() {
|
Column() {
|
||||||
@ -14,14 +15,18 @@ export default struct MissAnExamDialog {
|
|||||||
top: 40
|
top: 40
|
||||||
}).fontWeight(FontWeight.Bold)
|
}).fontWeight(FontWeight.Bold)
|
||||||
Row() {
|
Row() {
|
||||||
Text(`确认考生:${this.name}是否缺考?`).fontSize(28)
|
Text(this.text).fontSize(28)
|
||||||
}.height(300).justifyContent(FlexAlign.Center).alignItems(VerticalAlign.Center)
|
}.height(300).justifyContent(FlexAlign.Center).alignItems(VerticalAlign.Center)
|
||||||
|
|
||||||
Row() {
|
Row() {
|
||||||
BtnComponent({
|
BtnComponent({
|
||||||
text: "取消",
|
text: "取消",
|
||||||
}).onClick(() => {
|
}).onClick(() => {
|
||||||
this.controller?.close();
|
if (!this.onCancel) {
|
||||||
|
this.controller?.close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.onCancel && this.onCancel();
|
||||||
})
|
})
|
||||||
|
|
||||||
BtnComponent().onClick(() => {
|
BtnComponent().onClick(() => {
|
||||||
@ -39,10 +44,3 @@ export default struct MissAnExamDialog {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component
|
|
||||||
struct btnComponent {
|
|
||||||
build() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,5 +1,12 @@
|
|||||||
import { GPSData, InitialPerLane, SignalData } from '../../mock'
|
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 apiJudgeSdk from 'libJudgeSdk.so'
|
||||||
|
|
||||||
import { DifferentialAndSignal } from '../../utils/business/DifferentialAndSignalWorker'
|
import { DifferentialAndSignal } from '../../utils/business/DifferentialAndSignalWorker'
|
||||||
@ -23,14 +30,20 @@ export default struct SignalDisplayComponent {
|
|||||||
@State laneSignal: PerLane = InitialPerLane
|
@State laneSignal: PerLane = InitialPerLane
|
||||||
|
|
||||||
aboutToAppear(): void {
|
aboutToAppear(): void {
|
||||||
DifferentialAndSignal.onMsg((data: string) => {
|
DifferentialAndSignal.onMsg(this.getMsg)
|
||||||
const result: WorkerBackMessage = JSON.parse(data)
|
}
|
||||||
dConsole.log("wzj", data)
|
|
||||||
if (result.type === "obtainUdpData") {
|
getMsg(data: string) {
|
||||||
this.getSignal(result.data as string)
|
const result: WorkerBackMessage = JSON.parse(data)
|
||||||
this.rawData = result.data as string
|
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) => {
|
getSignal = (msg: string) => {
|
||||||
@ -39,11 +52,9 @@ export default struct SignalDisplayComponent {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.signArr = newArr
|
this.signArr = newArr
|
||||||
|
|
||||||
for (let i = 0; i <= 12; i++) {
|
for (let i = 0; i <= 12; i++) {
|
||||||
this.vehicleSignal[i].value = this.signArr[i+2]
|
this.vehicleSignal[i].value = this.signArr[i+2]
|
||||||
}
|
}
|
||||||
|
|
||||||
this.vehicleSignal[13].value = this.signArr[17]
|
this.vehicleSignal[13].value = this.signArr[17]
|
||||||
this.vehicleSignal[14].value = this.signArr[18]
|
this.vehicleSignal[14].value = this.signArr[18]
|
||||||
this.vehicleSignal[15].value = this.signArr[19]
|
this.vehicleSignal[15].value = this.signArr[19]
|
||||||
|
|||||||
@ -51,6 +51,7 @@ import {
|
|||||||
TKmItem,
|
TKmItem,
|
||||||
User,
|
User,
|
||||||
WorkerBackMessage,
|
WorkerBackMessage,
|
||||||
|
WorkerBackMessageType,
|
||||||
WR
|
WR
|
||||||
} from '../../model';
|
} from '../../model';
|
||||||
import { DrivingDataStorage } from '../../utils/business/DrivingDataStorage';
|
import { DrivingDataStorage } from '../../utils/business/DrivingDataStorage';
|
||||||
@ -1321,8 +1322,10 @@ export default class Judge {
|
|||||||
}
|
}
|
||||||
// 处理考试结束
|
// 处理考试结束
|
||||||
public handEndExam = async () => {
|
public handEndExam = async () => {
|
||||||
this.judgeUI.loadingPopupVisible = true;
|
// this.judgeUI.loadingPopupVisible = true;
|
||||||
this.judgeUI.endPopupVisible = false;
|
this.judgeUI.generateExamRecordsDialogController.open()
|
||||||
|
// this.judgeUI.endPopupVisible = false;
|
||||||
|
this.judgeUI.endExamDialogController.close()
|
||||||
this.judgeUI.isDeductedPopShow = false;
|
this.judgeUI.isDeductedPopShow = false;
|
||||||
|
|
||||||
const judgeUI = this.judgeUI
|
const judgeUI = this.judgeUI
|
||||||
@ -1450,12 +1453,14 @@ export default class Judge {
|
|||||||
}
|
}
|
||||||
this.isUdpEnd = true;
|
this.isUdpEnd = true;
|
||||||
closeAllFiles()
|
closeAllFiles()
|
||||||
this.judgeUI.loadingPopupVisible = false;
|
// this.judgeUI.loadingPopupVisible = false;
|
||||||
|
this.judgeUI.generateExamRecordsDialogController.close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
dConsole.info(JudgeTag, '考试结束 end')
|
dConsole.info(JudgeTag, '考试结束 end')
|
||||||
const param302: string = Reflect.get(judgeConfigObj, '302')
|
const param302: string = Reflect.get(judgeConfigObj, '302')
|
||||||
judgeUI.loadingPopupVisible = true;
|
// judgeUI.loadingPopupVisible = true;
|
||||||
|
judgeUI.generateExamRecordsDialogController.open()
|
||||||
let currentKssycs = '0';
|
let currentKssycs = '0';
|
||||||
let voiceURL = ''
|
let voiceURL = ''
|
||||||
if (examSubject == '2') {
|
if (examSubject == '2') {
|
||||||
@ -1951,7 +1956,7 @@ export default class Judge {
|
|||||||
DifferentialAndSignal.onMsg((data: string) => {
|
DifferentialAndSignal.onMsg((data: string) => {
|
||||||
dConsole.info(JudgeTag, 'socketTag[PLC.UdpClient]', '收到udp回调数据')
|
dConsole.info(JudgeTag, 'socketTag[PLC.UdpClient]', '收到udp回调数据')
|
||||||
const result: WorkerBackMessage = JSON.parse(data)
|
const result: WorkerBackMessage = JSON.parse(data)
|
||||||
if (result.type === "obtainUdpData") {
|
if (result.type === WorkerBackMessageType.ObtainUdpData) {
|
||||||
handleUdp(result.data as string)
|
handleUdp(result.data as string)
|
||||||
}
|
}
|
||||||
//TODO UDP修改
|
//TODO UDP修改
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
// 处理worker线程的消息tcp拿差分改正数,udp给后置机
|
// 处理worker线程的消息tcp拿差分改正数,udp给后置机
|
||||||
import worker, { ErrorEvent, MessageEvents, ThreadWorkerGlobalScope } from '@ohos.worker';
|
import worker, { ErrorEvent, MessageEvents, ThreadWorkerGlobalScope } from '@ohos.worker';
|
||||||
import { WorkerTag } from '../config';
|
import { WorkerTag } from '../config';
|
||||||
import { CenterCallBackMsgType, WorkerBackMessage, WorkerMessage } from '../model';
|
import { CenterCallBackMsgType, WorkerBackMessage, WorkerBackMessageType, WorkerMessage } from '../model';
|
||||||
import { CenterUDPBusinessInstance } from '../utils/business/CenterUdpBusiness';
|
import { CenterUDPBusinessInstance } from '../utils/business/CenterUdpBusiness';
|
||||||
import { DifferentialSignal } from '../utils/business/DifferentialSignal';
|
import { DifferentialSignal } from '../utils/business/DifferentialSignal';
|
||||||
import { ObtainUdpBusinessInstance } from '../utils/business/ObtainUdpBusiness';
|
import { ObtainUdpBusinessInstance } from '../utils/business/ObtainUdpBusiness';
|
||||||
@ -56,7 +56,7 @@ function getDataFn() {
|
|||||||
// 收到后置机消息传出去提供给业务,data应该是个string
|
// 收到后置机消息传出去提供给业务,data应该是个string
|
||||||
workerPort.postMessage(
|
workerPort.postMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
type: 'obtainUdpData',
|
type: WorkerBackMessageType.ObtainUdpData,
|
||||||
data: data
|
data: data
|
||||||
} as WorkerBackMessage))
|
} as WorkerBackMessage))
|
||||||
})
|
})
|
||||||
@ -68,7 +68,7 @@ function getDataFn() {
|
|||||||
// 收到中心指令发送出去
|
// 收到中心指令发送出去
|
||||||
workerPort.postMessage(
|
workerPort.postMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
type: 'centerUdpData',
|
type: WorkerBackMessageType.CenterUdpData,
|
||||||
data: data
|
data: data
|
||||||
} as WorkerBackMessage)
|
} as WorkerBackMessage)
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user