fix: 评判日志
This commit is contained in:
parent
03d3f09d2a
commit
756ced2469
@ -1,6 +1,5 @@
|
||||
import router from '@ohos.router';
|
||||
import { carConfigurationInfo, uploadExamCarCheckResult } from '../api/checkCar';
|
||||
import TopLogo from './compontents/TopLogo';
|
||||
import testNapi from '@ohos.hiserialsdk';
|
||||
import { DwMapData, PassData, RealNumData, StackValueData, WarnFlagData, WarnFlagTipData } from '../mock';
|
||||
import { RouteParamsType } from '../model/Common';
|
||||
@ -11,6 +10,8 @@ import dayTs from '../utils/Date';
|
||||
import { ObtainUdpBusinessInstance } from '../utils/business/ObtainUdpBusiness';
|
||||
import common from '@ohos.app.ability.common';
|
||||
import { dConsole } from '../utils/LogWorker';
|
||||
import HeaderComponent from './compontents/Header';
|
||||
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
@ -392,7 +393,10 @@ struct CarCheckPage {
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
TopLogo({ outFlag: $outFlag }).margin({ bottom: 25.5 * this.ratio })
|
||||
HeaderComponent({
|
||||
shortLogo: true,
|
||||
shouBackArea: true
|
||||
})
|
||||
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
|
||||
Column() {
|
||||
Row() {
|
||||
|
||||
@ -171,6 +171,7 @@ struct JudgePage {
|
||||
text: "确认结束考试?",
|
||||
onConfirm: async () => {
|
||||
if (this.isErrorMsgEnd) {
|
||||
dConsole.log(JudgeTag, "结束考试")
|
||||
this.judge.closeAllFiles()
|
||||
router.back()
|
||||
return
|
||||
@ -1146,7 +1147,7 @@ struct JudgePage {
|
||||
},
|
||||
confirmFn: () => {
|
||||
clearInterval(this.timer);
|
||||
clearInterval(AppStorage.get('judgeTimer'))
|
||||
// clearInterval(AppStorage.get('judgeTimer'))
|
||||
this.judge.checkExamIsEnd(true);
|
||||
},
|
||||
})
|
||||
|
||||
@ -12,6 +12,7 @@ import apiJudgeSdk from 'libJudgeSdk.so'
|
||||
import { DifferentialAndSignal } from '../../utils/business/DifferentialAndSignalWorker'
|
||||
import { examJudgeMapSetScaling } from '../Judge/JudgeUtils'
|
||||
import { dConsole } from '../../utils/LogWorker'
|
||||
import { SignDisplayTag } from '../../config'
|
||||
|
||||
|
||||
@Component
|
||||
@ -30,16 +31,21 @@ 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 === WorkerBackMessageType.ObtainUdpData) {
|
||||
this.getSignal(result.data as string)
|
||||
this.rawData = result.data as string
|
||||
}
|
||||
})
|
||||
DifferentialAndSignal.onMsg(this.getMsg)
|
||||
}
|
||||
|
||||
aboutToDisappear(): void {
|
||||
DifferentialAndSignal.onMsg(this.getMsg)
|
||||
}
|
||||
|
||||
getMsg = (data: string) => {
|
||||
const result: WorkerBackMessage = JSON.parse(data)
|
||||
dConsole.log(SignDisplayTag, "wzj", data)
|
||||
if (result.type === WorkerBackMessageType.ObtainUdpData) {
|
||||
this.getSignal(result.data as string)
|
||||
this.rawData = result.data as string
|
||||
}
|
||||
}
|
||||
getSignal = (msg: string) => {
|
||||
const newArr = msg.split(',')
|
||||
if (newArr[0] != '#DN_GD') {
|
||||
@ -81,9 +87,9 @@ export default struct SignalDisplayComponent {
|
||||
t++
|
||||
}
|
||||
this.GPSColum[14].value = ((Number((this.signArr[97] || 0)) * 1.852).toFixed(2)).toString()
|
||||
const str0 = this.signArr[93].substr(0, 2)
|
||||
const str1 = this.signArr[93].substr(2, 2)
|
||||
const str2 = this.signArr[93].substr(4.2)
|
||||
const str0 = this.signArr[93].slice(0, 2);
|
||||
const str1 = this.signArr[93].slice(2, 4);
|
||||
const str2 = this.signArr[93].slice(4);
|
||||
this.signArr[93] = str2 + str1 + str0
|
||||
this.GPSColum[10].value = this.signArr[93]
|
||||
|
||||
|
||||
@ -1,48 +0,0 @@
|
||||
import router from '@ohos.router';
|
||||
import { GetCurrentTime } from '../../utils/Common';
|
||||
import imageBtn from '../compontents/imageBtn';
|
||||
|
||||
@Component
|
||||
export default struct TopLogo {
|
||||
@State ratio: number = 850 / 960
|
||||
@State timeText: string = '';
|
||||
@Link outFlag: boolean; //返回按钮触发
|
||||
private timer: number = -1;
|
||||
|
||||
async aboutToAppear() {
|
||||
this.timeText = GetCurrentTime();
|
||||
this.timer = setInterval(async () => {
|
||||
this.timeText = GetCurrentTime();
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
aboutToDisappear() {
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
|
||||
build() {
|
||||
Row() {
|
||||
Row() {
|
||||
Image($r('app.media.shortLogo'))
|
||||
.width('10.2%')
|
||||
.height('75%')
|
||||
.margin({ left: 30 * this.ratio, top: -15 * this.ratio })
|
||||
Text(this.timeText)
|
||||
.fontSize(30 * this.ratio)
|
||||
.fontColor('#CCB48F')
|
||||
.margin({ top: -15 * this.ratio, left: 14 * this.ratio })
|
||||
}
|
||||
|
||||
imageBtn({ btnWidth: '14.5%', imgSrc: $r('app.media.topB_back') })
|
||||
.onClick(() => {
|
||||
this.outFlag = true
|
||||
router.back()
|
||||
})
|
||||
}
|
||||
.width('100%')
|
||||
.height(100)
|
||||
.justifyContent(FlexAlign.SpaceBetween)
|
||||
.backgroundColor('#333230')
|
||||
}
|
||||
}
|
||||
|
||||
@ -184,6 +184,37 @@ export default class Judge {
|
||||
private isExamEnd: boolean
|
||||
// 是否发送udp
|
||||
private isUdpEnd: boolean = false
|
||||
// 处理udp plc信号
|
||||
handleUdp = async (msg: string) => {
|
||||
const stachArr = msg.split(',')
|
||||
if (stachArr[0] != '#DN_GD' || this.isUdpEnd) {
|
||||
return
|
||||
}
|
||||
const plcData = await this.getPlcData(msg);
|
||||
// 4.过程数据
|
||||
await this.fileLog?.setExamJudgeData(JSON.stringify(plcData))
|
||||
//检测到有无锡所设备接入,需要发送特定的数据,供检测
|
||||
// if (this.usbService.isWXUSBDevice) {
|
||||
// const str = await senorToWXDataStr(msg);
|
||||
// this.usbService.sendUSB(str)
|
||||
// }
|
||||
const param350: number = Reflect.get(this.judgeUI.judgeConfigObj, '350')
|
||||
this.judgeUI.sd = ((param350 == 0 ? plcData.gps.sd : plcData.sensor.cs) as number * 1.852).toFixed(0) + ''
|
||||
this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + ''
|
||||
//TODO 暂时关闭差分检测异常
|
||||
// await this.checkDwzt(plcData.gps.dwzt,plcData.gps.jdzt);
|
||||
if (!this.isExamEnd) {
|
||||
await examJudgeRealExam(plcData)
|
||||
}
|
||||
// let udpIndex = AppStorage.get<number>('udpIndex') || 0;
|
||||
// if (udpIndex % 5 === 0 && !this.isUdpEnd) {
|
||||
// TODO UPD缺失
|
||||
// const judgeUdp = globalThis.judgeUdp
|
||||
// const bytes = await this.getMessageHeartbeat(this.isExamEnd);
|
||||
// judgeUdp.send(bytes)
|
||||
// }
|
||||
// AppStorage.setOrCreate('udpIndex', udpIndex++)
|
||||
}
|
||||
//是否手动结束考试
|
||||
private isManual: boolean = false
|
||||
//UDP服务序列号
|
||||
@ -230,31 +261,6 @@ export default class Judge {
|
||||
dConsole.info(JudgeTag, '过程数据文件上传 end')
|
||||
}
|
||||
private judgeTask: JudgeTask
|
||||
private tempData?: PLCType
|
||||
//实时计算gps经纬度距离
|
||||
handDistance = async () => {
|
||||
const dwzt = this.tempData?.gps?.dwzt || "";
|
||||
const jdzt = this.tempData?.gps?.jdzt || "";
|
||||
const tJD = ConvertDdmmToDecimalDegrees(this.tempData?.gps?.jd || 0)
|
||||
const tWD = ConvertDdmmToDecimalDegrees(this.tempData?.gps?.wd || 0)
|
||||
if (this.prevJd && dwzt == 4 && jdzt == 3) {
|
||||
const distance = await examCalcGpsDistance({
|
||||
jd1: this.prevJd,
|
||||
wd1: this.prevWd,
|
||||
jd2: tJD,
|
||||
wd2: tWD,
|
||||
h: this.tempData?.gps?.hxj || 1,
|
||||
})
|
||||
// const distanceClass = AppStorage.get<DistanceClass>('distanceClass')
|
||||
// distanceClass?.setTimeData(Number(((distance / 100).toFixed(2))))
|
||||
DrivingDataStorage.setDrivingProcessData(Number(((distance / 100).toFixed(2))))
|
||||
}
|
||||
this.prevJd = tJD;
|
||||
this.prevWd = tWD;
|
||||
}
|
||||
private performInfo?: JudgePerformInfo
|
||||
private isEndTip: boolean = false;
|
||||
private deductedPopShowTimer: number = 0;
|
||||
// 校验考试是否结束
|
||||
checkExamIsEnd =
|
||||
async (isManual?: boolean) => {
|
||||
@ -288,7 +294,7 @@ export default class Judge {
|
||||
|
||||
//单机模式
|
||||
if (singlePlay) {
|
||||
dConsole.info(JudgeTag + ' isAllProjectsEnd => ', isAllProjectsEnd)
|
||||
dConsole.info(JudgeTag + ' 单机模式结束 => ', isAllProjectsEnd)
|
||||
if (isAllProjectsEnd && jl >= examMileage) {
|
||||
//成绩合格
|
||||
if (totalScore >= passingGrade && !isEndTip) {
|
||||
@ -368,6 +374,85 @@ export default class Judge {
|
||||
}
|
||||
}
|
||||
}
|
||||
private tempData?: PLCType
|
||||
//实时计算gps经纬度距离
|
||||
handDistance = async () => {
|
||||
const dwzt = this.tempData?.gps?.dwzt || "";
|
||||
const jdzt = this.tempData?.gps?.jdzt || "";
|
||||
const tJD = ConvertDdmmToDecimalDegrees(this.tempData?.gps?.jd || 0)
|
||||
const tWD = ConvertDdmmToDecimalDegrees(this.tempData?.gps?.wd || 0)
|
||||
if (this.prevJd && dwzt == 4 && jdzt == 3) {
|
||||
const distance = await examCalcGpsDistance({
|
||||
jd1: this.prevJd,
|
||||
wd1: this.prevWd,
|
||||
jd2: tJD,
|
||||
wd2: tWD,
|
||||
h: this.tempData?.gps?.hxj || 1,
|
||||
})
|
||||
// const distanceClass = AppStorage.get<DistanceClass>('distanceClass')
|
||||
// distanceClass?.setTimeData(Number(((distance / 100).toFixed(2))))
|
||||
DrivingDataStorage.setDrivingProcessData(Number(((distance / 100).toFixed(2))))
|
||||
}
|
||||
this.prevJd = tJD;
|
||||
this.prevWd = tWD;
|
||||
}
|
||||
private performInfo?: JudgePerformInfo
|
||||
private isEndTip: boolean = false;
|
||||
private deductedPopShowTimer: number = 0;
|
||||
// 检测扣分、结束项目时该项目是否开始
|
||||
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 ksjs?: JudgeKSJS
|
||||
private kfArr?: MarkRule[]
|
||||
//所有的科目考试项目(大车&小车)
|
||||
@ -393,37 +478,6 @@ export default class Judge {
|
||||
AppStorage.setOrCreate('msgStr', plc)
|
||||
return tempData
|
||||
}
|
||||
// 处理udp plc信号
|
||||
handleUdp = async (msg: string) => {
|
||||
const stachArr = msg.split(',')
|
||||
if (stachArr[0] != '#DN_GD' || this.isUdpEnd) {
|
||||
return
|
||||
}
|
||||
const plcData = await this.getPlcData(msg);
|
||||
// 4.过程数据
|
||||
await this.fileLog?.setExamJudgeData(JSON.stringify(plcData))
|
||||
//检测到有无锡所设备接入,需要发送特定的数据,供检测
|
||||
// if (this.usbService.isWXUSBDevice) {
|
||||
// const str = await senorToWXDataStr(msg);
|
||||
// this.usbService.sendUSB(str)
|
||||
// }
|
||||
const param350: number = Reflect.get(this.judgeUI.judgeConfigObj, '350')
|
||||
this.judgeUI.sd = ((param350 == 0 ? plcData.gps.sd : plcData.sensor.cs) as number * 1.852).toFixed(0) + ''
|
||||
this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + ''
|
||||
//TODO 暂时关闭差分检测异常
|
||||
// await this.checkDwzt(plcData.gps.dwzt,plcData.gps.jdzt);
|
||||
if (!this.isExamEnd) {
|
||||
await examJudgeRealExam(plcData)
|
||||
}
|
||||
// let udpIndex = AppStorage.get<number>('udpIndex') || 0;
|
||||
// if (udpIndex % 5 === 0 && !this.isUdpEnd) {
|
||||
// TODO UPD缺失
|
||||
// const judgeUdp = globalThis.judgeUdp
|
||||
// const bytes = await this.getMessageHeartbeat(this.isExamEnd);
|
||||
// judgeUdp.send(bytes)
|
||||
// }
|
||||
// AppStorage.setOrCreate('udpIndex', udpIndex++)
|
||||
}
|
||||
// 处理轨迹plc信号
|
||||
handleTrajectoryUdp = async (strArr: string[]) => {
|
||||
let num = 2;
|
||||
@ -461,9 +515,9 @@ export default class Judge {
|
||||
}
|
||||
//本地轨迹回放地址
|
||||
private trajectoryPath: string
|
||||
//当前科目二的考试项目
|
||||
// private currentKm2ItemsObj: any
|
||||
private isTrajectoryOpen: boolean;
|
||||
//当前科目二的考试项目
|
||||
// 调代理接口是否断网了
|
||||
private isJudgeDisConnect: boolean = false;
|
||||
// 断网数据补传
|
||||
@ -478,6 +532,33 @@ export default class Judge {
|
||||
const code = await writeObjectOut(JSON.parse(examDataStr), "", this.context);
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
// 项目开始接口同步
|
||||
beginProject = async (ksxm: number) => {
|
||||
const carInfo = AppStorage.get<CarInfoType>('carInfo');
|
||||
@ -581,87 +662,6 @@ 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;
|
||||
@ -1323,6 +1323,7 @@ export default class Judge {
|
||||
}
|
||||
// 处理考试结束
|
||||
public handEndExam = async () => {
|
||||
dConsole.info(JudgeTag, '处理考试结束 handEndExam')
|
||||
// this.judgeUI.loadingPopupVisible = true;
|
||||
this.judgeUI.generateExamRecordsDialogController.open()
|
||||
// this.judgeUI.endPopupVisible = false;
|
||||
@ -1388,6 +1389,7 @@ export default class Judge {
|
||||
}
|
||||
// 考试结束
|
||||
public endExam = async (isManual?: Boolean) => {
|
||||
dConsole.log(JudgeTag, '考试结束 endExam')
|
||||
const carInfo = AppStorage.get<CarInfoType>('carInfo')!;
|
||||
const singlePlay = AppStorage.get<boolean>('singlePlay') || false
|
||||
const examSubject = carInfo?.examSubject || "2"
|
||||
|
||||
@ -12,6 +12,9 @@ class differentialAndSignal {
|
||||
|
||||
// 初始化Worker
|
||||
init() {
|
||||
if (this.workerInstance) {
|
||||
this.close();
|
||||
}
|
||||
this.workerInstance = new worker.ThreadWorker("entry/ets/workers/DifferentialCorrection.ets");
|
||||
let config: EnvironmentConfigurationType =
|
||||
AppStorage.get<EnvironmentConfigurationType>("EnvironmentConfiguration") || {
|
||||
@ -52,14 +55,20 @@ class differentialAndSignal {
|
||||
|
||||
// 关闭
|
||||
close() {
|
||||
const config: EnvironmentConfigurationType = AppStorage.get<EnvironmentConfigurationType>("EnvironmentConfiguration") || {
|
||||
if (this.workerInstance) {
|
||||
// 清空所有监听器
|
||||
this.events = [];
|
||||
|
||||
// 发送关闭消息
|
||||
const config = AppStorage.get<EnvironmentConfigurationType>("EnvironmentConfiguration") || {};
|
||||
this.workerInstance.postMessage(JSON.stringify({
|
||||
config: config,
|
||||
close: true
|
||||
}));
|
||||
|
||||
// 关闭线程
|
||||
this.workerInstance.terminate();
|
||||
}
|
||||
this.workerInstance.postMessage(JSON.stringify({
|
||||
config: config,
|
||||
close: true
|
||||
}));
|
||||
// 关闭线程
|
||||
this.workerInstance.terminate()
|
||||
}
|
||||
|
||||
// 获取Worker消息
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user