小红球udp
This commit is contained in:
parent
c1893eb185
commit
cf866ffa7f
@ -1,5 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
CarInfoType,
|
CarInfoType,
|
||||||
|
CDSBInfos,
|
||||||
CenterCallBackMsgType,
|
CenterCallBackMsgType,
|
||||||
EnvironmentConfigurationType,
|
EnvironmentConfigurationType,
|
||||||
JudgeConfigObjKmItems,
|
JudgeConfigObjKmItems,
|
||||||
@ -11,8 +12,12 @@ export interface JudgeUDPData {
|
|||||||
totalScore: number
|
totalScore: number
|
||||||
kfArr: MarkRule[]
|
kfArr: MarkRule[]
|
||||||
startTime: string
|
startTime: string
|
||||||
|
examTime: number
|
||||||
xmmcSingleCode: string
|
xmmcSingleCode: string
|
||||||
kmItems :JudgeConfigObjKmItems
|
kmItems: JudgeConfigObjKmItems
|
||||||
|
cdsbInfoObj: CDSBInfos
|
||||||
|
xmxh: string
|
||||||
|
xmdm: number | string
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum WorkerMessageDataType {
|
export enum WorkerMessageDataType {
|
||||||
|
|||||||
@ -104,7 +104,7 @@ export class BaseJudge {
|
|||||||
* @param judgeUI
|
* @param judgeUI
|
||||||
* @param that
|
* @param that
|
||||||
*/
|
*/
|
||||||
async changeExamStatus(event: number, xmdm: number, kf: MarkRule[], judgeUI: JudgePage, that: JudgeBusiness) {
|
async changeExamStatus(event: number, xmdm: number, xmxh: string, kf: MarkRule[], judgeUI: JudgePage, that: JudgeBusiness) {
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case 1: {
|
case 1: {
|
||||||
const param512: JudgeConfigObj = (Reflect.get(judgeUI.judgeConfigObj, '512') || '').split(',');
|
const param512: JudgeConfigObj = (Reflect.get(judgeUI.judgeConfigObj, '512') || '').split(',');
|
||||||
@ -129,7 +129,7 @@ export class BaseJudge {
|
|||||||
// }, {
|
// }, {
|
||||||
// isDelay: true
|
// isDelay: true
|
||||||
// })
|
// })
|
||||||
ProjectStart(xmdm, that.xmxh, judgeUI)
|
ProjectStart(xmdm, xmxh, judgeUI)
|
||||||
UploadProgressPhoto(xmdm, that.plcData!, judgeUI)
|
UploadProgressPhoto(xmdm, that.plcData!, judgeUI)
|
||||||
}
|
}
|
||||||
// this.judgeUI.projectsObj[xmdm].isUpload = true
|
// this.judgeUI.projectsObj[xmdm].isUpload = true
|
||||||
@ -153,7 +153,7 @@ export class BaseJudge {
|
|||||||
// }, {
|
// }, {
|
||||||
// isDelay: true
|
// isDelay: true
|
||||||
// })
|
// })
|
||||||
ProjectEnd(xmdm, that.xmxh, judgeUI)
|
ProjectEnd(xmdm, xmxh, judgeUI)
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
dConsole.log(JudgeTag, ExamProcessDataTag, "项目结束判定3")
|
dConsole.log(JudgeTag, ExamProcessDataTag, "项目结束判定3")
|
||||||
@ -188,7 +188,11 @@ export class BaseJudge {
|
|||||||
// })
|
// })
|
||||||
DeductPoints(Number(currentKf.xmdm), currentKf, that.xmmcEndCode || "", judgeUI)
|
DeductPoints(Number(currentKf.xmdm), currentKf, that.xmmcEndCode || "", judgeUI)
|
||||||
if (judgeUI.totalScore < judgeUI.passingScore) {
|
if (judgeUI.totalScore < judgeUI.passingScore) {
|
||||||
ProjectEnd(xmdm, that.xmxh, judgeUI)
|
try {
|
||||||
|
ProjectEnd(xmdm, xmxh, judgeUI)
|
||||||
|
} catch (e) {
|
||||||
|
dConsole.info(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
break
|
break
|
||||||
@ -536,7 +540,7 @@ export class BaseJudge {
|
|||||||
// // }, {
|
// // }, {
|
||||||
// // isDelay: true
|
// // isDelay: true
|
||||||
// // })
|
// // })
|
||||||
// ProjectStart(xmdm, that.xmxh, judgeUI)
|
// ProjectStart(xmdm, xmxh, judgeUI)
|
||||||
// UploadProgressPhoto(xmdm, that.plcData!, judgeUI)
|
// UploadProgressPhoto(xmdm, that.plcData!, judgeUI)
|
||||||
// currentProject.isUpload = true;
|
// currentProject.isUpload = true;
|
||||||
// Reflect.set(judgeUI.projectsObj, xmdm, currentProject)
|
// Reflect.set(judgeUI.projectsObj, xmdm, currentProject)
|
||||||
@ -819,7 +823,7 @@ export class BaseJudge {
|
|||||||
xmmcStr: that.xmmcStr, carztStr: that.carztStr, kfArr: judgeUI.kfArr
|
xmmcStr: that.xmmcStr, carztStr: that.carztStr, kfArr: judgeUI.kfArr
|
||||||
});
|
});
|
||||||
// TODO 语音播报
|
// TODO 语音播报
|
||||||
this.changeExamStatus(event, xmdm, judgeUI.kfArr!, judgeUI, that);
|
this.changeExamStatus(event, xmdm,xmxh, judgeUI.kfArr!, judgeUI, that);
|
||||||
// 更新ui
|
// 更新ui
|
||||||
if (event == 1 || event == 2 || event == 3 || event == 6) {
|
if (event == 1 || event == 2 || event == 3 || event == 6) {
|
||||||
judgeUI.projectsObj = JSON.parse(JSON.stringify(judgeUI.projectsObj))
|
judgeUI.projectsObj = JSON.parse(JSON.stringify(judgeUI.projectsObj))
|
||||||
|
|||||||
@ -181,7 +181,11 @@ export default class JudgeBusiness {
|
|||||||
kfArr: this.judgeUI.kfArr,
|
kfArr: this.judgeUI.kfArr,
|
||||||
startTime: this.judgeUI.udpStartTIme,
|
startTime: this.judgeUI.udpStartTIme,
|
||||||
xmmcSingleCode: this.xmmcSingleCode,
|
xmmcSingleCode: this.xmmcSingleCode,
|
||||||
kmItems: this.kmItems
|
kmItems: this.kmItems,
|
||||||
|
examTime: this.judgeUI.examTime,
|
||||||
|
cdsbInfoObj: this.judgeUI.cdsbInfoObj!,
|
||||||
|
xmdm: this.xmdm,
|
||||||
|
xmxh: this.xmxh
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
CarInfoType,
|
CarInfoType,
|
||||||
|
CDSBInfo,
|
||||||
EnvironmentConfigurationType,
|
EnvironmentConfigurationType,
|
||||||
Gps,
|
Gps,
|
||||||
JudgePerformInfo,
|
JudgePerformInfo,
|
||||||
@ -55,7 +56,7 @@ class JudgeUdpBusiness {
|
|||||||
: this.lsh,
|
: this.lsh,
|
||||||
13));
|
13));
|
||||||
const ascksyhArr = StringToASCII('0000000000000')
|
const ascksyhArr = StringToASCII('0000000000000')
|
||||||
const ascsbxhArr = StringToASCII('00000000')
|
const ascsbxhArr = StringToASCII(this.getSbxh(this.business.xmdm, this.business.xmxh))
|
||||||
|
|
||||||
const plcData = await this.getPlcData(msg);
|
const plcData = await this.getPlcData(msg);
|
||||||
let param: number[] = [plcData.sensor.zfxd, plcData.sensor.yfxd, plcData.sensor.shtd, plcData.sensor.ygd, plcData.sensor.jgd, plcData.sensor.skd, plcData.sensor.dh1, plcData.sensor.dh2, plcData.sensor.lhq, plcData.sensor.jsc, plcData.sensor.ssc, plcData.sensor.fsc, plcData.sensor.lb, plcData.sensor.mkg, plcData.sensor.aqd]
|
let param: number[] = [plcData.sensor.zfxd, plcData.sensor.yfxd, plcData.sensor.shtd, plcData.sensor.ygd, plcData.sensor.jgd, plcData.sensor.skd, plcData.sensor.dh1, plcData.sensor.dh2, plcData.sensor.lhq, plcData.sensor.jsc, plcData.sensor.ssc, plcData.sensor.fsc, plcData.sensor.lb, plcData.sensor.mkg, plcData.sensor.aqd]
|
||||||
@ -112,7 +113,7 @@ class JudgeUdpBusiness {
|
|||||||
//扣分值
|
//扣分值
|
||||||
NumberToByteArray(100 - Math.abs(this.business.totalScore), 2 * 8),
|
NumberToByteArray(100 - Math.abs(this.business.totalScore), 2 * 8),
|
||||||
//扣分数量
|
//扣分数量
|
||||||
NumberToByteArray(this.business.kfArr.length, 2 * 8),
|
NumberToByteArray(this.business.kfArr.length, 8),
|
||||||
//n个扣分序号
|
//n个扣分序号
|
||||||
this.business.kfArr.map(kf => NumberToByteArray(kf.kfxh!, 8)[0]),
|
this.business.kfArr.map(kf => NumberToByteArray(kf.kfxh!, 8)[0]),
|
||||||
//牵引车第二gps精度、纬度
|
//牵引车第二gps精度、纬度
|
||||||
@ -466,6 +467,13 @@ class JudgeUdpBusiness {
|
|||||||
gps,
|
gps,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getSbxh(ksxm: string | number, xmxh: string) {
|
||||||
|
const projectKey = `${ksxm}_${xmxh}`;
|
||||||
|
const currentCdsb: CDSBInfo = Reflect.get(this.business!.cdsbInfoObj, projectKey);
|
||||||
|
const sbxh = currentCdsb?.sbbh || '0000000000'
|
||||||
|
return sbxh
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user