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