fix: 修复完善一些小问题
This commit is contained in:
parent
39bfed3beb
commit
46c9b8bd63
@ -31,6 +31,7 @@ export enum WorkerBackMessageType {
|
|||||||
export interface LogWorkerMessage {
|
export interface LogWorkerMessage {
|
||||||
type: WorkerMessageType;
|
type: WorkerMessageType;
|
||||||
data?: string;
|
data?: string;
|
||||||
|
studentDirName?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
//枚举
|
//枚举
|
||||||
@ -45,7 +46,8 @@ export enum WorkerMessageType {
|
|||||||
ProcessDataInit = 'processDataInit',
|
ProcessDataInit = 'processDataInit',
|
||||||
// 打开过程数据文件
|
// 打开过程数据文件
|
||||||
OpenProcessDataFile = 'openProcessDataFile',
|
OpenProcessDataFile = 'openProcessDataFile',
|
||||||
|
// 初始化考试过程
|
||||||
|
ExamProcessInit = 'examProcessInit'
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LogPathType {
|
export interface LogPathType {
|
||||||
|
|||||||
@ -256,8 +256,8 @@ export default class Judge {
|
|||||||
private isEndTip: boolean = false;
|
private isEndTip: boolean = false;
|
||||||
private deductedPopShowTimer: number = 0;
|
private deductedPopShowTimer: number = 0;
|
||||||
// 校验考试是否结束
|
// 校验考试是否结束
|
||||||
checkExamIsEnd =
|
checkExamIsEnd = async (isManual?: boolean) => {
|
||||||
async (isManual?: boolean) => {
|
dConsole.log(JudgeTag, "校验考试是否结束")
|
||||||
const judgeUI = this.judgeUI
|
const judgeUI = this.judgeUI
|
||||||
const avPlayer = this.avPlayer
|
const avPlayer = this.avPlayer
|
||||||
const isExamEnd = this.isExamEnd
|
const isExamEnd = this.isExamEnd
|
||||||
@ -272,6 +272,7 @@ export default class Judge {
|
|||||||
const jl = judgeUI.jl
|
const jl = judgeUI.jl
|
||||||
|
|
||||||
if (isExamEnd) {
|
if (isExamEnd) {
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//及格分
|
//及格分
|
||||||
@ -318,6 +319,7 @@ export default class Judge {
|
|||||||
this.isExamEnd = true
|
this.isExamEnd = true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
//成绩不合格
|
//成绩不合格
|
||||||
if (totalScore < passingGrade) {
|
if (totalScore < passingGrade) {
|
||||||
//科目三不合格报靠边停车
|
//科目三不合格报靠边停车
|
||||||
@ -1059,8 +1061,7 @@ export default class Judge {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 更改考试状态
|
// 更改考试状态
|
||||||
goVoiceAnnounce =
|
goVoiceAnnounce = async (event: number, xmdm: number, kf: MarkRule[], xmjs: JudgeXMJS, ksjs: JudgeKSJS, xmxh: string) => {
|
||||||
async (event: number, xmdm: number, kf: MarkRule[], xmjs: JudgeXMJS, ksjs: JudgeKSJS, xmxh: string) => {
|
|
||||||
|
|
||||||
const beginProject = this.beginProject
|
const beginProject = this.beginProject
|
||||||
const pointsDedute = this.pointsDedute
|
const pointsDedute = this.pointsDedute
|
||||||
@ -1907,7 +1908,7 @@ export default class Judge {
|
|||||||
// 2.评判过程回调
|
// 2.评判过程回调
|
||||||
await examJudgeSetRealExamCallback(async (strData: string, len: number) => {
|
await examJudgeSetRealExamCallback(async (strData: string, len: number) => {
|
||||||
// 评判回调日志
|
// 评判回调日志
|
||||||
// await fileLog?.setExamJudgeCallbackData(strData)
|
await fileLog?.setExamJudgeCallbackData(strData)
|
||||||
dConsole.info(JudgeTag, '评判回调数据', strData)
|
dConsole.info(JudgeTag, '评判回调数据', strData)
|
||||||
await this.handleRealExam(strData, callBack)
|
await this.handleRealExam(strData, callBack)
|
||||||
})
|
})
|
||||||
@ -1963,7 +1964,6 @@ export default class Judge {
|
|||||||
}
|
}
|
||||||
// 处理实时udp里的plc信号
|
// 处理实时udp里的plc信号
|
||||||
DifferentialAndSignal.onMsg((data: string) => {
|
DifferentialAndSignal.onMsg((data: string) => {
|
||||||
dConsole.info(JudgeTag, 'socketTag[PLC.UdpClient]', '收到udp回调数据')
|
|
||||||
const result: WorkerBackMessage = JSON.parse(data)
|
const result: WorkerBackMessage = JSON.parse(data)
|
||||||
if (result.type === WorkerBackMessageType.ObtainUdpData) {
|
if (result.type === WorkerBackMessageType.ObtainUdpData) {
|
||||||
handleUdp(result.data as string)
|
handleUdp(result.data as string)
|
||||||
|
|||||||
@ -16,15 +16,18 @@ workerPort.onmessage = (e: MessageEvents) => {
|
|||||||
let logFileFd: LogFileFd = {}
|
let logFileFd: LogFileFd = {}
|
||||||
const result: LogWorkerMessage = JSON.parse(e.data);
|
const result: LogWorkerMessage = JSON.parse(e.data);
|
||||||
if (result.type === WorkerMessageType.Init) {
|
if (result.type === WorkerMessageType.Init) {
|
||||||
Init()
|
InitLog()
|
||||||
}
|
}
|
||||||
if (result.type === WorkerMessageType.OpenProcessDataFile) {
|
if (result.type === WorkerMessageType.OpenProcessDataFile) {
|
||||||
OpenProcessDataFile(logPaths, logFileFd, result.data || "")
|
OpenProcessDataFile(logPaths, logFileFd, result.data || "")
|
||||||
}
|
}
|
||||||
|
if (result.type === WorkerMessageType.ExamProcessInit && result.studentDirName) {
|
||||||
|
InitExam(result.studentDirName)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化
|
// 初始化日志
|
||||||
async function Init() {
|
async function InitLog() {
|
||||||
// /mnt/hmdfs/100/account/device_view/local/files/duolun/logs/2024_10_12
|
// /mnt/hmdfs/100/account/device_view/local/files/duolun/logs/2024_10_12
|
||||||
// 创建duolun文件夹 /mnt/hmdfs/100/account/device_view/local/files/duolun
|
// 创建duolun文件夹 /mnt/hmdfs/100/account/device_view/local/files/duolun
|
||||||
const basePath = GlobalConfig.commonFileWriteAddress;
|
const basePath = GlobalConfig.commonFileWriteAddress;
|
||||||
@ -57,6 +60,16 @@ async function Init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 初始化学员过程数据目录
|
||||||
|
async function InitExam(name: string) {
|
||||||
|
let date = dayTs().format("YYYY_MM_DD")
|
||||||
|
const path = `${GlobalConfig.commonFileWriteAddress}/logs/${date}/${name}`
|
||||||
|
const nameDirIsExit = await IsExit(path)
|
||||||
|
if (!nameDirIsExit) {
|
||||||
|
await CreateDir(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function OpenProcessDataFile(logPaths: LogPathType, logFileFd: LogFileFd, name: string) {
|
function OpenProcessDataFile(logPaths: LogPathType, logFileFd: LogFileFd, name: string) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user