Compare commits
	
		
			No commits in common. "f57a04521c5dcfe0c6b9b8947d701a10f0a2a670" and "98e17164e10ad29f32593d0a34f540d808d09dec" have entirely different histories.
		
	
	
		
			f57a04521c
			...
			98e17164e1
		
	
		
@ -125,30 +125,28 @@ export class BaseJudge {
 | 
			
		||||
          ProjectStart(xmdm, that.xmxh, judgeUI)
 | 
			
		||||
          UploadProgressPhoto(xmdm, that.plcData!, judgeUI)
 | 
			
		||||
        }
 | 
			
		||||
        // this.judgeUI.projectsObj[xmdm].isUpload = true
 | 
			
		||||
 | 
			
		||||
        break;
 | 
			
		||||
      }
 | 
			
		||||
      case 2: {
 | 
			
		||||
        dConsole.log(JudgeTag, ExamProcessDataTag, "项目结束判定1")
 | 
			
		||||
        const project: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm)
 | 
			
		||||
        // const isStart = await this.checkProjectIsStart(xmdm, 1, judgeUI, that, kf)
 | 
			
		||||
        const isStart = await this.checkProjectIsStart(xmdm, 2, judgeUI, that)
 | 
			
		||||
 | 
			
		||||
        // if (isStart) {
 | 
			
		||||
        //   // 项目结束了就不再生成数据
 | 
			
		||||
        //   dConsole.info(JudgeTag, ExamProcessDataTag, ' 项目是否结束 =>', project.isEnd)
 | 
			
		||||
        //   if (!project.isEnd) {
 | 
			
		||||
        // judgeTask.addTask(async () => {
 | 
			
		||||
        //   dConsole.info(JudgeTag, `项目结束-${xmdm}-${project.name}`)
 | 
			
		||||
        //   await endProject(xmdm);
 | 
			
		||||
        //   this.xmmcSingleCode = '0';
 | 
			
		||||
        //   this.xmmcEndCode = undefined;
 | 
			
		||||
        // }, {
 | 
			
		||||
        //   isDelay: true
 | 
			
		||||
        // })
 | 
			
		||||
        ProjectEnd(xmdm, that.xmxh, judgeUI)
 | 
			
		||||
        //   }
 | 
			
		||||
        // }
 | 
			
		||||
        if (isStart) {
 | 
			
		||||
          // 项目结束了就不再生成数据
 | 
			
		||||
          dConsole.info(JudgeTag, ExamProcessDataTag, ' 项目是否结束 =>', project.isEnd)
 | 
			
		||||
          if (!project.isEnd) {
 | 
			
		||||
            // judgeTask.addTask(async () => {
 | 
			
		||||
            //   dConsole.info(JudgeTag, `项目结束-${xmdm}-${project.name}`)
 | 
			
		||||
            //   await endProject(xmdm);
 | 
			
		||||
            //   this.xmmcSingleCode = '0';
 | 
			
		||||
            //   this.xmmcEndCode = undefined;
 | 
			
		||||
            // }, {
 | 
			
		||||
            //   isDelay: true
 | 
			
		||||
            // })
 | 
			
		||||
            ProjectEnd(xmdm, that.xmxh, judgeUI)
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        dConsole.log(JudgeTag, ExamProcessDataTag, "项目结束判定3")
 | 
			
		||||
        try {
 | 
			
		||||
          const param512: JudgeConfigObj = (Reflect.get(judgeUI.judgeConfigObj, '512') || '').split(',');
 | 
			
		||||
@ -171,19 +169,16 @@ export class BaseJudge {
 | 
			
		||||
          that.avPlayer?.playAudio([`voice/${currentKf.markcatalog}.mp3`,
 | 
			
		||||
            `voice/mark_${Math.abs(currentKf?.score || 0)}.mp3`])
 | 
			
		||||
        }
 | 
			
		||||
        // const isStart = await this.checkProjectIsStart(Number(currentKf.xmdm), 2, judgeUI, that, kf);
 | 
			
		||||
        // if (isStart) {
 | 
			
		||||
        // await judgeTask.addTask(async () => {
 | 
			
		||||
        //   dConsole.info(JudgeTag, `项目扣分-${currentKf.markcatalog}-${currentKf.desc}`)
 | 
			
		||||
        //   await pointsDedute(Number(currentKf.xmdm), currentKf)
 | 
			
		||||
        // }, {
 | 
			
		||||
        //   isDelay: true
 | 
			
		||||
        // })
 | 
			
		||||
        DeductPoints(Number(currentKf.xmdm), currentKf, that.xmmcEndCode || "", judgeUI)
 | 
			
		||||
        if (judgeUI.totalScore < judgeUI.passingScore) {
 | 
			
		||||
          ProjectEnd(xmdm, that.xmxh, judgeUI)
 | 
			
		||||
        const isStart = await this.checkProjectIsStart(Number(currentKf.xmdm), 2, judgeUI, that);
 | 
			
		||||
        if (isStart) {
 | 
			
		||||
          // await judgeTask.addTask(async () => {
 | 
			
		||||
          //   dConsole.info(JudgeTag, `项目扣分-${currentKf.markcatalog}-${currentKf.desc}`)
 | 
			
		||||
          //   await pointsDedute(Number(currentKf.xmdm), currentKf)
 | 
			
		||||
          // }, {
 | 
			
		||||
          //   isDelay: true
 | 
			
		||||
          // })
 | 
			
		||||
          DeductPoints(Number(currentKf.xmdm), currentKf, that.xmmcEndCode || "", judgeUI)
 | 
			
		||||
        }
 | 
			
		||||
        // }
 | 
			
		||||
        break
 | 
			
		||||
      }
 | 
			
		||||
      case 5: {
 | 
			
		||||
@ -372,6 +367,7 @@ export class BaseJudge {
 | 
			
		||||
      })
 | 
			
		||||
      return
 | 
			
		||||
    }
 | 
			
		||||
    //
 | 
			
		||||
    that.avPlayer?.playAudio(['voice/exam_waiting.mp3'], judgeUI.singlePlay, async () => {
 | 
			
		||||
      try {
 | 
			
		||||
        if (!judgeUI.singlePlay) {
 | 
			
		||||
@ -397,6 +393,7 @@ export class BaseJudge {
 | 
			
		||||
          await this.endExam(judgeUI, that)
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
      await this.endExam(judgeUI, that)
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -405,6 +402,7 @@ export class BaseJudge {
 | 
			
		||||
    const singlePlay = judgeUI.singlePlay
 | 
			
		||||
    //TODO 断网考试结束补传
 | 
			
		||||
    // await uploadDisConnectData();
 | 
			
		||||
 | 
			
		||||
    let backTimeOut = setTimeout(() => {
 | 
			
		||||
      router.back()
 | 
			
		||||
    }, 90 * 1000)
 | 
			
		||||
@ -508,62 +506,58 @@ export class BaseJudge {
 | 
			
		||||
        }, param302 === "8" ? 3000 : 0)
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   *  检测扣分、结束项目时该项目是否开始
 | 
			
		||||
   *
 | 
			
		||||
   */
 | 
			
		||||
  // async checkProjectIsStart(xmdm: number, currentType: 1 | 2, judgeUI: JudgePage, that: JudgeBusiness, kf?: MarkRule[]): Promise<boolean> {
 | 
			
		||||
  //   if (xmdm == 20) {
 | 
			
		||||
  //     return true
 | 
			
		||||
  //   }
 | 
			
		||||
  //   const currentProject: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm)
 | 
			
		||||
  //
 | 
			
		||||
  //   if (!currentProject.isUpload) {
 | 
			
		||||
  //     dConsole.info(JudgeTag, '项目补传开始')
 | 
			
		||||
  //     // judgeTask.addTask(async () => {
 | 
			
		||||
  //     //   await this.beginProject(xmdm)
 | 
			
		||||
  //     // }, {
 | 
			
		||||
  //     //   isDelay: true
 | 
			
		||||
  //     // })
 | 
			
		||||
  //     // judgeTask.addTask(async () => {
 | 
			
		||||
  //     //   await this.uploadProgressPhoto(xmdm)
 | 
			
		||||
  //     // }, {
 | 
			
		||||
  //     //   isDelay: true
 | 
			
		||||
  //     // })
 | 
			
		||||
  //     ProjectStart(xmdm, that.xmxh, judgeUI)
 | 
			
		||||
  //     UploadProgressPhoto(xmdm, that.plcData!, judgeUI)
 | 
			
		||||
  //     currentProject.isUpload = true;
 | 
			
		||||
  //     Reflect.set(judgeUI.projectsObj, xmdm, currentProject)
 | 
			
		||||
  //     if (currentType == 2) {
 | 
			
		||||
  //       //项目结束需要等补传完毕
 | 
			
		||||
  //       // judgeTask.addTask(async () => {
 | 
			
		||||
  //       //   await this.pointsDedute(xmdm, kf!)
 | 
			
		||||
  //       // }, {
 | 
			
		||||
  //       //   isDelay: true
 | 
			
		||||
  //       // })\
 | 
			
		||||
  //       const currentKf = kf[kf.length -1];
 | 
			
		||||
  //       DeductPoints(Number(currentKf.xmdm), currentKf, that.xmmcEndCode || "", judgeUI)
 | 
			
		||||
  //     }
 | 
			
		||||
  //     //扣分补传判断是否合格 不合格补传项目结束
 | 
			
		||||
  //     if (currentType == 1 || (currentType == 2 && that.totalScore < judgeUI.passingScore)) {
 | 
			
		||||
  //       // judgeTask.addTask(async () => {
 | 
			
		||||
  //       //   await this.endProject(xmdm)
 | 
			
		||||
  //       // }, {
 | 
			
		||||
  //       //   isDelay: true
 | 
			
		||||
  //       // })
 | 
			
		||||
  //       ProjectEnd(xmdm, that.xmxh, judgeUI)
 | 
			
		||||
  //       currentProject.isEnd = true;
 | 
			
		||||
  //       Reflect.set(judgeUI.projectsObj, xmdm, currentProject)
 | 
			
		||||
  //     }
 | 
			
		||||
  //     // judgeTask.addTask(async () => {
 | 
			
		||||
  //     //   this.checkExamIsEnd()
 | 
			
		||||
  //     // })
 | 
			
		||||
  //     return false;
 | 
			
		||||
  //   }
 | 
			
		||||
  //   return true
 | 
			
		||||
  // }
 | 
			
		||||
  async checkProjectIsStart(xmdm: number, currentType: 1 | 2, judgeUI: JudgePage, that: JudgeBusiness, kf?: MarkRule): Promise<boolean> {
 | 
			
		||||
    if (xmdm == 20) {
 | 
			
		||||
      return true
 | 
			
		||||
    }
 | 
			
		||||
    const currentProject: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm)
 | 
			
		||||
 | 
			
		||||
    if (!currentProject.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(judgeUI.projectsObj, xmdm, currentProject)
 | 
			
		||||
      if (currentType == 2) {
 | 
			
		||||
        //项目结束需要等补传完毕
 | 
			
		||||
        // judgeTask.addTask(async () => {
 | 
			
		||||
        //   await this.pointsDedute(xmdm, kf!)
 | 
			
		||||
        // }, {
 | 
			
		||||
        //   isDelay: true
 | 
			
		||||
        // })
 | 
			
		||||
      }
 | 
			
		||||
      //扣分补传判断是否合格 不合格补传项目结束
 | 
			
		||||
      if (currentType == 1 || (currentType == 2 && that.totalScore < judgeUI.passingScore)) {
 | 
			
		||||
        // judgeTask.addTask(async () => {
 | 
			
		||||
        //   await this.endProject(xmdm)
 | 
			
		||||
        // }, {
 | 
			
		||||
        //   isDelay: true
 | 
			
		||||
        // })
 | 
			
		||||
        currentProject.isEnd = true;
 | 
			
		||||
        Reflect.set(judgeUI.projectsObj, xmdm, currentProject)
 | 
			
		||||
      }
 | 
			
		||||
      // judgeTask.addTask(async () => {
 | 
			
		||||
      //   this.checkExamIsEnd()
 | 
			
		||||
      // })
 | 
			
		||||
      return false;
 | 
			
		||||
    }
 | 
			
		||||
    return true
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  async judgeStart(callBack: Function, judgeUI: JudgePage, that: JudgeBusiness, beginExamInfo: JudgeBeginObj, initInfo: JudgeInitObj) {
 | 
			
		||||
    const name = judgeUI.name
 | 
			
		||||
@ -886,6 +880,7 @@ export class BaseJudge {
 | 
			
		||||
          that.isExamEnd = true
 | 
			
		||||
          return
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //成绩合格
 | 
			
		||||
        if (isAllProjectsEnd && totalScore >= passingScore && !that.isEndTip) {
 | 
			
		||||
          if (examSubject == '2') {
 | 
			
		||||
 | 
			
		||||
@ -708,7 +708,7 @@ struct UserInfoPage {
 | 
			
		||||
 | 
			
		||||
        this.list = JSON.parse(JSON.stringify(dataList))
 | 
			
		||||
 | 
			
		||||
        dConsole.log(UserInfoTag, "temp list", JSON.stringify(this.list))
 | 
			
		||||
        dConsole.log("temp list", JSON.stringify(this.list))
 | 
			
		||||
        this.list.forEach((listData, index) => {
 | 
			
		||||
          //考过一次不允许切换学员
 | 
			
		||||
          if (listData.kssycs == '1') {
 | 
			
		||||
@ -730,7 +730,7 @@ struct UserInfoPage {
 | 
			
		||||
        })
 | 
			
		||||
 | 
			
		||||
        // await upDateTableByArray('USERLIST', this.list || [])
 | 
			
		||||
        dConsole.log(UserInfoTag, "temp list", JSON.stringify(this.list))
 | 
			
		||||
        dConsole.log("temp list", JSON.stringify(this.list))
 | 
			
		||||
 | 
			
		||||
        // await sqlInsertCommonFn("USERLIST", this.list || [])
 | 
			
		||||
        await SqlInsertTable('USERLIST', this.list || [])
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
// 处理worker线程的消息tcp拿差分改正数,udp给后置机
 | 
			
		||||
import worker, { ErrorEvent, MessageEvents, ThreadWorkerGlobalScope } from '@ohos.worker';
 | 
			
		||||
import { SerialPortTag, WorkerTag } from '../config';
 | 
			
		||||
import { WorkerTag } from '../config';
 | 
			
		||||
import {
 | 
			
		||||
  CenterCallBackMsgType,
 | 
			
		||||
  EnvironmentConfigurationType,
 | 
			
		||||
@ -70,7 +70,7 @@ function getDataFn(config: EnvironmentConfigurationType) {
 | 
			
		||||
      // 需要观察
 | 
			
		||||
      // console.log(WorkerTag, "后置机消息", data)
 | 
			
		||||
      const res = await SerialPortService.getData()
 | 
			
		||||
      console.log(SerialPortTag, "档位原始数据", res)
 | 
			
		||||
      // console.log(SerialPortTag, "档位原始数据", res)
 | 
			
		||||
      if (res.length > 0) {
 | 
			
		||||
        const dataArray = data.split(",");
 | 
			
		||||
        // 替换data的第28位
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user