济南修改 #24
@ -28,7 +28,7 @@ import DeviceInfoTable from '../constants/DeviceInfoTable'
 | 
				
			|||||||
import USER from '../constants/USER'
 | 
					import USER from '../constants/USER'
 | 
				
			||||||
import util from '@ohos.util';
 | 
					import util from '@ohos.util';
 | 
				
			||||||
import zlib from '@ohos.zlib';
 | 
					import zlib from '@ohos.zlib';
 | 
				
			||||||
import FileModel from '../../pages/judgeSDK/utils/file-model';
 | 
					import FileModel from '../../pages/judgeSDK/utils/fileModel';
 | 
				
			||||||
// @ts-nocheck
 | 
					// @ts-nocheck
 | 
				
			||||||
//读表
 | 
					//读表
 | 
				
			||||||
//参数平台
 | 
					//参数平台
 | 
				
			||||||
 | 
				
			|||||||
@ -46,22 +46,22 @@ export default class FileUtil{
 | 
				
			|||||||
*
 | 
					*
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
  public addFile = async (filePath:string,content:string,type?:string)=>{
 | 
					  public addFile = async (filePath:string,content:string,type?:string)=>{
 | 
				
			||||||
    const { READ_WRITE,CREATE,APPEND }= fs.OpenMode
 | 
					    const { READ_WRITE,CREATE,APPEND,TRUNC }= fs.OpenMode
 | 
				
			||||||
    const isExit = fs.accessSync(filePath);
 | 
					 | 
				
			||||||
    //文件存在先删除
 | 
					 | 
				
			||||||
    if(isExit){
 | 
					 | 
				
			||||||
      fs.unlinkSync(filePath);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
      let file = fs.openSync(filePath, READ_WRITE  | CREATE);
 | 
					      console.log('content',content)
 | 
				
			||||||
      //追加写入文件
 | 
					      let file = fs.openSync(filePath, TRUNC|READ_WRITE |CREATE|APPEND);
 | 
				
			||||||
      fs.writeSync(file.fd,content)
 | 
					      const option={
 | 
				
			||||||
 | 
					        offset:0,
 | 
				
			||||||
 | 
					        length:content.length,
 | 
				
			||||||
 | 
					        encoding:'utf-8'
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      fs.writeSync(file.fd,content,option)
 | 
				
			||||||
      fs.closeSync(file)
 | 
					      fs.closeSync(file)
 | 
				
			||||||
      console.error(LOGTAG,'写入文件成功')
 | 
					      console.error(LOGTAG,'写入文件成功')
 | 
				
			||||||
      return true
 | 
					      return true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }catch (e){
 | 
					    }catch (e){
 | 
				
			||||||
      console.error(LOGTAG,'写入失败',JSON.stringify(e))
 | 
					      console.error(LOGTAG,JSON.stringify(e))
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  /*
 | 
					  /*
 | 
				
			||||||
@ -72,15 +72,6 @@ export default class FileUtil{
 | 
				
			|||||||
    const { READ_WRITE,CREATE,APPEND }= fs.OpenMode
 | 
					    const { READ_WRITE,CREATE,APPEND }= fs.OpenMode
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
      let file = fs.openSync(filePath, READ_WRITE | APPEND |CREATE);
 | 
					      let file = fs.openSync(filePath, READ_WRITE | APPEND |CREATE);
 | 
				
			||||||
      let index
 | 
					 | 
				
			||||||
      // if(type=='overWrite'){
 | 
					 | 
				
			||||||
      //   //文件覆蓋
 | 
					 | 
				
			||||||
      //   index=0
 | 
					 | 
				
			||||||
      // }else{
 | 
					 | 
				
			||||||
      //   //文件追加
 | 
					 | 
				
			||||||
      //   const str = fs.readTextSync(filePath);
 | 
					 | 
				
			||||||
      //   index= str.length
 | 
					 | 
				
			||||||
      // }
 | 
					 | 
				
			||||||
      const newStr =  content + '\n'
 | 
					      const newStr =  content + '\n'
 | 
				
			||||||
      //追加写入文件
 | 
					      //追加写入文件
 | 
				
			||||||
      fs.writeSync(file.fd,newStr)
 | 
					      fs.writeSync(file.fd,newStr)
 | 
				
			||||||
 | 
				
			|||||||
@ -40,11 +40,11 @@ export async function getTCP() {
 | 
				
			|||||||
          hilog.info(0x0000, 'testTag', "valvalval2" + JSON.stringify(val));
 | 
					          hilog.info(0x0000, 'testTag', "valvalval2" + JSON.stringify(val));
 | 
				
			||||||
          setTimeout(()=>{
 | 
					          setTimeout(()=>{
 | 
				
			||||||
            globalThis.TcpClient.sendMsg('1002')//1002
 | 
					            globalThis.TcpClient.sendMsg('1002')//1002
 | 
				
			||||||
            if(val&&!globalThis.closeUDPSocket){
 | 
					            if(globalThis.udpClient && val&&!globalThis.closeUDPSocket){
 | 
				
			||||||
              // const msg=val.substring(5,val.length-1)
 | 
					              // const msg=val.substring(5,val.length-1)
 | 
				
			||||||
              console.log('socketTag[PLC.UdpClient]closeUDPSocket',globalThis.closeUDPSocket)
 | 
					              console.log('socketTag[PLC.UdpClient]closeUDPSocket',globalThis.closeUDPSocket)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
              globalThis.udpClient?.sendMsg(val)
 | 
					              globalThis.udpClient.sendMsg&&globalThis.udpClient?.sendMsg(val)
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          },1000)
 | 
					          },1000)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -11,7 +11,7 @@ export async function sendMsg(val){
 | 
				
			|||||||
export async function getUDP() {
 | 
					export async function getUDP() {
 | 
				
			||||||
  getSyncData('IpConfigTable').then((result:Array<any>)=>{
 | 
					  getSyncData('IpConfigTable').then((result:Array<any>)=>{
 | 
				
			||||||
    if(result.length){
 | 
					    if(result.length){
 | 
				
			||||||
      if(globalThis.udpClient&&globalThis.udpClient.closeUdp){
 | 
					      if(globalThis.udpClient&&!globalThis.closeUDPSocket){
 | 
				
			||||||
        globalThis.udpClient.closeUdp(()=>{
 | 
					        globalThis.udpClient.closeUdp(()=>{
 | 
				
			||||||
         setTimeout(()=>{
 | 
					         setTimeout(()=>{
 | 
				
			||||||
           globalThis.udpClient.rebindUdp(result[0].udplocalIp, result[0].udplocalIpPort,result[0].udpOppositeIp,result[0].udpOppositeIpPort)
 | 
					           globalThis.udpClient.rebindUdp(result[0].udplocalIp, result[0].udplocalIpPort,result[0].udpOppositeIp,result[0].udpOppositeIpPort)
 | 
				
			||||||
@ -42,7 +42,7 @@ export async function getUDP() {
 | 
				
			|||||||
export async function getUDP2() {
 | 
					export async function getUDP2() {
 | 
				
			||||||
  getSyncData('IpConfigTable').then(async (result:Array<any>)=>{
 | 
					  getSyncData('IpConfigTable').then(async (result:Array<any>)=>{
 | 
				
			||||||
    if(result.length){
 | 
					    if(result.length){
 | 
				
			||||||
      if(globalThis.udpClient2&&globalThis.closeHeartSocket){
 | 
					      if(globalThis.udpClient2&&!globalThis.closeHeartSocket){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        globalThis.udpClient2.closeUdp(async ()=>{
 | 
					        globalThis.udpClient2.closeUdp(async ()=>{
 | 
				
			||||||
          setTimeout(()=>{
 | 
					          setTimeout(()=>{
 | 
				
			||||||
 | 
				
			|||||||
@ -37,7 +37,7 @@ export default class TcpClient {
 | 
				
			|||||||
            this.localIpPort = localIpPort
 | 
					            this.localIpPort = localIpPort
 | 
				
			||||||
            this.oppositeIpPort = oppositeIpPort
 | 
					            this.oppositeIpPort = oppositeIpPort
 | 
				
			||||||
            console.log(TAG,'tcpreBind', this.localIp,this.localIpPort)
 | 
					            console.log(TAG,'tcpreBind', this.localIp,this.localIpPort)
 | 
				
			||||||
            let promise=this.tcp.bind({ address:  this.localIp, port:parseInt(this.localIpPort), family: 1 }, err => {
 | 
					            let promise=this.tcp.bind({ address:  this.localIp, port:parseInt(this.localIpPort)}, err => {
 | 
				
			||||||
                if (err) {
 | 
					                if (err) {
 | 
				
			||||||
                    globalThis.getCloseTcp=true
 | 
					                    globalThis.getCloseTcp=true
 | 
				
			||||||
                    hilog.info(0x0000, 'testTag', "tcpreBinderror:" + JSON.stringify(err));
 | 
					                    hilog.info(0x0000, 'testTag', "tcpreBinderror:" + JSON.stringify(err));
 | 
				
			||||||
@ -60,7 +60,7 @@ export default class TcpClient {
 | 
				
			|||||||
    bindTcp() {
 | 
					    bindTcp() {
 | 
				
			||||||
        console.log(TAG,'tcpbind',this.localIp,'localIp',this.localIpPort)
 | 
					        console.log(TAG,'tcpbind',this.localIp,'localIp',this.localIpPort)
 | 
				
			||||||
        return new Promise((resolve,reject)=>{
 | 
					        return new Promise((resolve,reject)=>{
 | 
				
			||||||
            let promise=this.tcp.bind({ address:  this.localIp, port:parseInt(this.localIpPort), family: 1 }, err => {
 | 
					            let promise=this.tcp.bind({ address:  this.localIp, port:parseInt(this.localIpPort) }, err => {
 | 
				
			||||||
                if (err) {
 | 
					                if (err) {
 | 
				
			||||||
                    console.log('testTag tcp bind faile');
 | 
					                    console.log('testTag tcp bind faile');
 | 
				
			||||||
                    globalThis.getCloseTcp=true
 | 
					                    globalThis.getCloseTcp=true
 | 
				
			||||||
@ -86,7 +86,7 @@ export default class TcpClient {
 | 
				
			|||||||
    connectTcp(){
 | 
					    connectTcp(){
 | 
				
			||||||
        console.log(TAG,'tcpConnect',this.oppositeIp,'localIp',this.oppositeIpPort)
 | 
					        console.log(TAG,'tcpConnect',this.oppositeIp,'localIp',this.oppositeIpPort)
 | 
				
			||||||
        return new Promise((resolve,reject)=>{
 | 
					        return new Promise((resolve,reject)=>{
 | 
				
			||||||
            let promise = this.tcp.connect({ address: {address: this.oppositeIp, port:  parseInt(this.oppositeIpPort), family: 1} , timeout: 6000});
 | 
					            let promise = this.tcp.connect({ address: {address: this.oppositeIp, port:  parseInt(this.oppositeIpPort)} , timeout: 6000});
 | 
				
			||||||
            promise.then(() => {
 | 
					            promise.then(() => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                this.tcp.setExtraOptions({
 | 
					                this.tcp.setExtraOptions({
 | 
				
			||||||
 | 
				
			|||||||
@ -50,7 +50,7 @@ export default class UdpClient {
 | 
				
			|||||||
    this.localIpPort = localIpPort
 | 
					    this.localIpPort = localIpPort
 | 
				
			||||||
    this.oppositeIpPort = oppositeIpPort
 | 
					    this.oppositeIpPort = oppositeIpPort
 | 
				
			||||||
    let promise = this.udp.bind({
 | 
					    let promise = this.udp.bind({
 | 
				
			||||||
      address: this.localIp, port: parseInt(this.localIpPort), family: 1
 | 
					      address: this.localIp, port: parseInt(this.localIpPort)
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    promise.then(() => {
 | 
					    promise.then(() => {
 | 
				
			||||||
      globalThis.closeUDPSocket=false
 | 
					      globalThis.closeUDPSocket=false
 | 
				
			||||||
@ -67,7 +67,7 @@ export default class UdpClient {
 | 
				
			|||||||
    let promise = this.udp.bind({
 | 
					    let promise = this.udp.bind({
 | 
				
			||||||
      // address: '192.168.7.170', port: 20122, family: 1
 | 
					      // address: '192.168.7.170', port: 20122, family: 1
 | 
				
			||||||
      // address: '192.168.7.170', port: 31013, family: 1
 | 
					      // address: '192.168.7.170', port: 31013, family: 1
 | 
				
			||||||
      address: this.localIp, port: parseInt(this.localIpPort), family: 1
 | 
					      address: this.localIp, port: parseInt(this.localIpPort)
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    promise.then(() => {
 | 
					    promise.then(() => {
 | 
				
			||||||
      globalThis.closeUDPSocket=false
 | 
					      globalThis.closeUDPSocket=false
 | 
				
			||||||
@ -97,7 +97,6 @@ export default class UdpClient {
 | 
				
			|||||||
            // port: 20022,
 | 
					            // port: 20022,
 | 
				
			||||||
            address: this.oppositeIp,
 | 
					            address: this.oppositeIp,
 | 
				
			||||||
            port: parseInt(this.oppositeIpPort),
 | 
					            port: parseInt(this.oppositeIpPort),
 | 
				
			||||||
            family: 1
 | 
					 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        promise.then(() => {
 | 
					        promise.then(() => {
 | 
				
			||||||
@ -126,7 +125,7 @@ export default class UdpClient {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  onMessage(callback?) {
 | 
					  onMessage(callback?) {
 | 
				
			||||||
    this.udp.on('message', value => {
 | 
					    this.udp.on('message', value => {
 | 
				
			||||||
      console.log(TAG,'udponmessage')
 | 
					      // console.log(TAG,'udponmessage')
 | 
				
			||||||
      // 收到的是ArrayBuffer 需要进行转换解析
 | 
					      // 收到的是ArrayBuffer 需要进行转换解析
 | 
				
			||||||
      globalThis.plcUdpError = false
 | 
					      globalThis.plcUdpError = false
 | 
				
			||||||
      if (value) {
 | 
					      if (value) {
 | 
				
			||||||
@ -179,12 +178,12 @@ export default class UdpClient {
 | 
				
			|||||||
        if (globalThis.plcUdpError) {
 | 
					        if (globalThis.plcUdpError) {
 | 
				
			||||||
          num++
 | 
					          num++
 | 
				
			||||||
          console.log(TAG,'plc udp信号丢失')
 | 
					          console.log(TAG,'plc udp信号丢失')
 | 
				
			||||||
          if(num==3){
 | 
					          // if(num==3){
 | 
				
			||||||
            await this.bindUdp()
 | 
					          //   await this.bindUdp()
 | 
				
			||||||
            await this.sendMsg('111')
 | 
					          //   await this.sendMsg('111')
 | 
				
			||||||
            await this.onMessage(callback)
 | 
					          //   await this.onMessage(callback)
 | 
				
			||||||
            num=0
 | 
					          //   num=0
 | 
				
			||||||
          }
 | 
					          // }
 | 
				
			||||||
          prompt.showToast({
 | 
					          prompt.showToast({
 | 
				
			||||||
            message: 'plc udp信号丢失',
 | 
					            message: 'plc udp信号丢失',
 | 
				
			||||||
            duration: 2000
 | 
					            duration: 2000
 | 
				
			||||||
@ -204,6 +203,8 @@ export default class UdpClient {
 | 
				
			|||||||
        globalThis.closeUDPSocket=false
 | 
					        globalThis.closeUDPSocket=false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
 | 
					        hilog.info(0x0000,TAG, 'udpCLient', 'closeonSuccess');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        globalThis.closeUDPSocket=true
 | 
					        globalThis.closeUDPSocket=true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.udp.getState((err, data) => {
 | 
					        this.udp.getState((err, data) => {
 | 
				
			||||||
 | 
				
			|||||||
@ -223,7 +223,6 @@ export default class UdpClientByCenter {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    closeUdp(callback) {
 | 
					    closeUdp(callback) {
 | 
				
			||||||
        globalThis.closeHeartSocket=true
 | 
					 | 
				
			||||||
        this.udp.close(err=>{
 | 
					        this.udp.close(err=>{
 | 
				
			||||||
            if(err){
 | 
					            if(err){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
import http from '@ohos.net.http';
 | 
					import http from '@ohos.net.http';
 | 
				
			||||||
import convertxml from '@ohos.convertxml';
 | 
					import convertxml from '@ohos.convertxml';
 | 
				
			||||||
import prompt from '@ohos.prompt'
 | 
					import prompt from '@ohos.prompt'
 | 
				
			||||||
import { sendGreen } from '../../pages/judgeSDK/utils/judge-common';
 | 
					import { sendGreen } from '../../pages/judgeSDK/utils/judgeCommon';
 | 
				
			||||||
import {GlobalConfig} from '../../config/index'
 | 
					import {GlobalConfig} from '../../config/index'
 | 
				
			||||||
const config = {
 | 
					const config = {
 | 
				
			||||||
    host:GlobalConfig.host,
 | 
					    host:GlobalConfig.host,
 | 
				
			||||||
 | 
				
			|||||||
@ -31,6 +31,8 @@ export default class EntryAbility extends UIAbility {
 | 
				
			|||||||
        globalThis.version = '2024.11.22.14'
 | 
					        globalThis.version = '2024.11.22.14'
 | 
				
			||||||
        globalThis.judgeVersion = '2024.11.22.14'
 | 
					        globalThis.judgeVersion = '2024.11.22.14'
 | 
				
			||||||
        globalThis.videoVersion= '1.0'
 | 
					        globalThis.videoVersion= '1.0'
 | 
				
			||||||
 | 
					        globalThis.closeUDPSocket=true
 | 
				
			||||||
 | 
					        globalThis.closeHeartSocket=true
 | 
				
			||||||
        // globalThis.version = '2023.12.13.01'
 | 
					        // globalThis.version = '2023.12.13.01'
 | 
				
			||||||
        // globalThis.judgeVersion = '2023.09.30.1'
 | 
					        // globalThis.judgeVersion = '2023.09.30.1'
 | 
				
			||||||
        // globalThis.videoVersion= '1.0'
 | 
					        // globalThis.videoVersion= '1.0'
 | 
				
			||||||
 | 
				
			|||||||
@ -6,7 +6,7 @@ import LoadingPopup from './compontents/judge/LoadingPopup';
 | 
				
			|||||||
import DeductedPopup from './compontents/judge/DeductionPopup';
 | 
					import DeductedPopup from './compontents/judge/DeductionPopup';
 | 
				
			||||||
import AmplifyPopup from './compontents/judge/AmplifyPopup';
 | 
					import AmplifyPopup from './compontents/judge/AmplifyPopup';
 | 
				
			||||||
import Judge from './judgeSDK/judge';
 | 
					import Judge from './judgeSDK/judge';
 | 
				
			||||||
import { defaultJudgeConfigObj } from './judgeSDK/utils//judge-common';
 | 
					import { defaultJudgeConfigObj } from './judgeSDK/utils//judgeCommon';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
  CARINFO,
 | 
					  CARINFO,
 | 
				
			||||||
  CDSBInfo,
 | 
					  CDSBInfo,
 | 
				
			||||||
@ -21,86 +21,13 @@ import {
 | 
				
			|||||||
import { chunkArr, formatTime, getCurrentHourTime, getCurrentTime } from '../common/utils/tools';
 | 
					import { chunkArr, formatTime, getCurrentHourTime, getCurrentTime } from '../common/utils/tools';
 | 
				
			||||||
import { examJudgeEndExam } from './judgeSDK/api/index';
 | 
					import { examJudgeEndExam } from './judgeSDK/api/index';
 | 
				
			||||||
import { getSyncData } from '../common/service/initable';
 | 
					import { getSyncData } from '../common/service/initable';
 | 
				
			||||||
import { judgeConfig } from './judgeSDK/utils/judge-config';
 | 
					import { judgeConfig } from './judgeSDK/utils/judgeConfig';
 | 
				
			||||||
import FileUtil from '../common/utils/File';
 | 
					import FileUtil from '../common/utils/File';
 | 
				
			||||||
import SignDisplayCom from './compontents/signDisplayCom';
 | 
					import SignDisplayCom from './compontents/signDisplayCom';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
@Entry
 | 
					@Entry
 | 
				
			||||||
@Component
 | 
					@Component
 | 
				
			||||||
struct Index {
 | 
					struct Index {
 | 
				
			||||||
  scroller: Scroller = new Scroller()
 | 
					 | 
				
			||||||
  //页面通用字体大小
 | 
					 | 
				
			||||||
  @State FONTSIZE: number = 28
 | 
					 | 
				
			||||||
  @State BIGFONTSIZE: number = 28
 | 
					 | 
				
			||||||
  //结束考试弹窗
 | 
					 | 
				
			||||||
  @State endPopupVisible: boolean = false
 | 
					 | 
				
			||||||
  //等待弹窗(考试及格,考试不及格使用)
 | 
					 | 
				
			||||||
  @State loadingPopupVisible: boolean = false
 | 
					 | 
				
			||||||
  //实时轨迹弹窗
 | 
					 | 
				
			||||||
  @State signDisplayComVisible: boolean = false
 | 
					 | 
				
			||||||
  @State isDdxk: boolean = false;
 | 
					 | 
				
			||||||
  @State time: string = ''
 | 
					 | 
				
			||||||
  //考试用时
 | 
					 | 
				
			||||||
  @State examTime: number = 0
 | 
					 | 
				
			||||||
  //开始时间
 | 
					 | 
				
			||||||
  @State startTime: string = '00:00:00'
 | 
					 | 
				
			||||||
  @State startFullTime: string = ''
 | 
					 | 
				
			||||||
  @State startHourTime: string = ''
 | 
					 | 
				
			||||||
  //科目类型
 | 
					 | 
				
			||||||
  @State examSubject: 2 | 3 = 3;
 | 
					 | 
				
			||||||
  @State ddxkTime: number = 0;
 | 
					 | 
				
			||||||
  @State ddxkKsxmArr: string[] = ['']
 | 
					 | 
				
			||||||
  @State ddxkKfArr: string[] = ['']
 | 
					 | 
				
			||||||
  @State xmmcStr: string = ''
 | 
					 | 
				
			||||||
  @State carztStr: string = ''
 | 
					 | 
				
			||||||
  @State kfArr: {
 | 
					 | 
				
			||||||
    xmmcStr?: string,
 | 
					 | 
				
			||||||
    score: string,
 | 
					 | 
				
			||||||
    desc: string
 | 
					 | 
				
			||||||
  }[] = []
 | 
					 | 
				
			||||||
  @State name: string = ''
 | 
					 | 
				
			||||||
  @State idCard: string = ''
 | 
					 | 
				
			||||||
  @State totalScore: number = 100
 | 
					 | 
				
			||||||
  //模拟考试项目
 | 
					 | 
				
			||||||
  @State projects: Project[] = []
 | 
					 | 
				
			||||||
  @State projectsObj: ProjectObj = {}
 | 
					 | 
				
			||||||
  @State projectsCenterObj: ProjectObj = {}
 | 
					 | 
				
			||||||
  @State markRuleListObj: MarkRule = {}
 | 
					 | 
				
			||||||
  @State cdsbInfoObj: CDSBInfo = {}
 | 
					 | 
				
			||||||
  @State timer: number = 0
 | 
					 | 
				
			||||||
  @State judgeConfig: { [k: string]: string }[] = []
 | 
					 | 
				
			||||||
  @State judgeConfigObj: { [k: string]: any } = defaultJudgeConfigObj
 | 
					 | 
				
			||||||
  //流水号
 | 
					 | 
				
			||||||
  @State lsh: string = ''
 | 
					 | 
				
			||||||
  @State kszp: string = ''
 | 
					 | 
				
			||||||
  @State ksdd: string = ''
 | 
					 | 
				
			||||||
  @State kssycs: string = ''
 | 
					 | 
				
			||||||
  @State kslx: string = ''
 | 
					 | 
				
			||||||
  //监管接口序列号
 | 
					 | 
				
			||||||
  @State serialNumber: number = 0
 | 
					 | 
				
			||||||
  @State carType: string = ''
 | 
					 | 
				
			||||||
  @State carName: string = ''
 | 
					 | 
				
			||||||
  @State isDeductedPopShow: boolean = false
 | 
					 | 
				
			||||||
  @State isAmplifyPopShow: boolean = false
 | 
					 | 
				
			||||||
  @State amplifiedImgIndex: number = 0
 | 
					 | 
				
			||||||
  @State judge: any = {}
 | 
					 | 
				
			||||||
  //行驶距离
 | 
					 | 
				
			||||||
  @State jl: number = 0
 | 
					 | 
				
			||||||
  //应考里程
 | 
					 | 
				
			||||||
  @State examMileage: string = '0'
 | 
					 | 
				
			||||||
  @State artSubject3Projects: string[] = ['直线', '会车', '变道', '超车', '掉头', '停车']
 | 
					 | 
				
			||||||
  @State artSubject3ProjectsCodesArr: string[] = ['3', '9', '4', '10', '12', '11']
 | 
					 | 
				
			||||||
  @State manualMarkRules: MarkRule[] = []
 | 
					 | 
				
			||||||
  //科目三评判初始化数据
 | 
					 | 
				
			||||||
  @State systemparmArr: SYSTEMPARMARR[] = []
 | 
					 | 
				
			||||||
  @State mapPointItemArr: MAPITEMPOINTITEM[] = []
 | 
					 | 
				
			||||||
  @State carinfoArrr: CARINFO[] = []
 | 
					 | 
				
			||||||
  @State mapPointArr: MAPPOINT[] = []
 | 
					 | 
				
			||||||
  private context = getContext(this) as common.UIAbilityContext;
 | 
					 | 
				
			||||||
  private img: ImageBitmap = new ImageBitmap("/resources/base/media/1.png")
 | 
					 | 
				
			||||||
  //已考的考试项目
 | 
					 | 
				
			||||||
  private wantInfos = []
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  async aboutToAppear() {
 | 
					  async aboutToAppear() {
 | 
				
			||||||
    globalThis.windowClass.setWindowSystemBarEnable([''])
 | 
					    globalThis.windowClass.setWindowSystemBarEnable([''])
 | 
				
			||||||
@ -200,10 +127,9 @@ struct Index {
 | 
				
			|||||||
        NoCancelId: mark.nocancelid * 1,
 | 
					        NoCancelId: mark.nocancelid * 1,
 | 
				
			||||||
        GPS_SID: mark.gps_sid == 0 ? false : true
 | 
					        GPS_SID: mark.gps_sid == 0 ? false : true
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      const markserial = mark.markserial * 1;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
      //筛选出人工评判的扣分
 | 
					      //筛选出人工评判的扣分
 | 
				
			||||||
      if (markserial > 100 && markserial < 200) {
 | 
					      if (Number(tempObj.markserial) > 100 && Number(tempObj.markserial) < 200) {
 | 
				
			||||||
        this.manualMarkRules.push(tempObj)
 | 
					        this.manualMarkRules.push(tempObj)
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      this.markRuleListObj[`${mark.itemno}_${mark.markserial}`] = {
 | 
					      this.markRuleListObj[`${mark.itemno}_${mark.markserial}`] = {
 | 
				
			||||||
@ -244,6 +170,33 @@ struct Index {
 | 
				
			|||||||
        this.examMileage = sys.v_value + '';
 | 
					        this.examMileage = sys.v_value + '';
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      //364	绕车一周评判时机(1-开始考试后判 2-开始考试前判)
 | 
				
			||||||
 | 
					      if(sys.v_no == '364' && sys.v_value == 2 ){
 | 
				
			||||||
 | 
					        let currentParams: any = router.getParams();
 | 
				
			||||||
 | 
					        const {sczb,kfdm} = currentParams;
 | 
				
			||||||
 | 
					        kfdm.forEach(kf => {
 | 
				
			||||||
 | 
					          const {xmdm, kfdm} = kf
 | 
				
			||||||
 | 
					          const currentKf = this.markRuleListObj[`${xmdm}_${kfdm}`];
 | 
				
			||||||
 | 
					          const currentProject = this.projectsObj[xmdm]
 | 
				
			||||||
 | 
					          this.kfArr.push({
 | 
				
			||||||
 | 
					            //扣分项目名称
 | 
				
			||||||
 | 
					            xmmcStr: currentProject.name,
 | 
				
			||||||
 | 
					            //@ts-ignore
 | 
				
			||||||
 | 
					            xmdm,
 | 
				
			||||||
 | 
					            desc: currentKf.markshow,
 | 
				
			||||||
 | 
					            score: currentKf.markreal,
 | 
				
			||||||
 | 
					            markcatalog: currentKf.markcatalog,
 | 
				
			||||||
 | 
					            markserial: currentKf.markserial,
 | 
				
			||||||
 | 
					            kfxh: currentKf.kfxh
 | 
				
			||||||
 | 
					          })
 | 
				
			||||||
 | 
					          this.totalScore += currentKf.markreal * 1;
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					        this.projectsObj['1'].type = kfdm.length ? '4':'3';
 | 
				
			||||||
 | 
					        this.projectsObj = {
 | 
				
			||||||
 | 
					          ...this.projectsObj
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      this.judgeConfigObj[sys.v_no] = value
 | 
					      this.judgeConfigObj[sys.v_no] = value
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    this.judgeConfig = syssetJudgeConfigArr;
 | 
					    this.judgeConfig = syssetJudgeConfigArr;
 | 
				
			||||||
@ -300,7 +253,8 @@ struct Index {
 | 
				
			|||||||
  //初始化systemParam表
 | 
					  //初始化systemParam表
 | 
				
			||||||
  async initSystemKm3Param(sysParam?: SYSTEMPARMARR[]) {
 | 
					  async initSystemKm3Param(sysParam?: SYSTEMPARMARR[]) {
 | 
				
			||||||
    const systemParms: any = sysParam || await getSyncData('MA_SYSTEMPARM')
 | 
					    const systemParms: any = sysParam || await getSyncData('MA_SYSTEMPARM')
 | 
				
			||||||
 | 
					    let currentParams: any = router.getParams();
 | 
				
			||||||
 | 
					    this.wayno = currentParams.wayno
 | 
				
			||||||
    const {isTrajectoryOpen} = judgeConfig
 | 
					    const {isTrajectoryOpen} = judgeConfig
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    systemParms.forEach((systemParm) => {
 | 
					    systemParms.forEach((systemParm) => {
 | 
				
			||||||
@ -538,7 +492,7 @@ struct Index {
 | 
				
			|||||||
                if (this.examSubject == 3) {
 | 
					                if (this.examSubject == 3) {
 | 
				
			||||||
                  Row() {
 | 
					                  Row() {
 | 
				
			||||||
                    Text('考试路线:').fontColor('#E5CCA1').fontSize(this.FONTSIZE)
 | 
					                    Text('考试路线:').fontColor('#E5CCA1').fontSize(this.FONTSIZE)
 | 
				
			||||||
                    Text(`线路${globalThis.carInfo.wayno}`).fontColor('#FFAD33').fontSize(this.FONTSIZE)
 | 
					                    Text(`线路${this.wayno}`).fontColor('#FFAD33').fontSize(this.FONTSIZE)
 | 
				
			||||||
                  }
 | 
					                  }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -578,7 +532,6 @@ struct Index {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
              Row() {
 | 
					              Row() {
 | 
				
			||||||
                Flex({ direction: FlexDirection.Column }) {
 | 
					                Flex({ direction: FlexDirection.Column }) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
                  if (this.kfArr.length) {
 | 
					                  if (this.kfArr.length) {
 | 
				
			||||||
                    List({}) {
 | 
					                    List({}) {
 | 
				
			||||||
                      ForEach(this.kfArr, (item) => {
 | 
					                      ForEach(this.kfArr, (item) => {
 | 
				
			||||||
@ -905,6 +858,7 @@ struct Index {
 | 
				
			|||||||
      if (this.isDeductedPopShow) {
 | 
					      if (this.isDeductedPopShow) {
 | 
				
			||||||
        DeductedPopup({
 | 
					        DeductedPopup({
 | 
				
			||||||
          currentItems: Reflect.ownKeys(this.projectsObj).map(projectKey => {
 | 
					          currentItems: Reflect.ownKeys(this.projectsObj).map(projectKey => {
 | 
				
			||||||
 | 
					            //@ts-ignore
 | 
				
			||||||
            const project = this.projectsObj[projectKey]
 | 
					            const project = this.projectsObj[projectKey]
 | 
				
			||||||
            return project.type == '2' ? project.projectCode : ''
 | 
					            return project.type == '2' ? project.projectCode : ''
 | 
				
			||||||
          }).filter(project => project !== ''),
 | 
					          }).filter(project => project !== ''),
 | 
				
			||||||
@ -961,11 +915,13 @@ struct Index {
 | 
				
			|||||||
  // 获取是否能人工进项目
 | 
					  // 获取是否能人工进项目
 | 
				
			||||||
  getIsExitManualProject = (index: number) => {
 | 
					  getIsExitManualProject = (index: number) => {
 | 
				
			||||||
    const {judgeConfigObj,artSubject3ProjectsCodesArr,projectsObj} = this;
 | 
					    const {judgeConfigObj,artSubject3ProjectsCodesArr,projectsObj} = this;
 | 
				
			||||||
 | 
					    //不允许人工触发的项目列表,以","分隔
 | 
				
			||||||
    const unExitManualProjects = judgeConfigObj['332'].split(',') || [];
 | 
					    const unExitManualProjects = judgeConfigObj['332'].split(',') || [];
 | 
				
			||||||
 | 
					    //直线行驶中不进其他考试项目(0-否 1-是)
 | 
				
			||||||
    const param348 = judgeConfigObj['348'] || '0';
 | 
					    const param348 = judgeConfigObj['348'] || '0';
 | 
				
			||||||
 | 
					    //里程不够允许手工点靠边停车(0-否 1-是)
 | 
				
			||||||
    const param387 = judgeConfigObj['387'] || '0';
 | 
					    const param387 = judgeConfigObj['387'] || '0';
 | 
				
			||||||
 | 
					    //车上是否能进行人工操作(0-能1-不能人工评判2-不能人工进项目3-都不能)
 | 
				
			||||||
    if (judgeConfigObj['342'] === '3' || judgeConfigObj['342'] === '2') {
 | 
					    if (judgeConfigObj['342'] === '3' || judgeConfigObj['342'] === '2') {
 | 
				
			||||||
      return false
 | 
					      return false
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -974,6 +930,7 @@ struct Index {
 | 
				
			|||||||
      return false
 | 
					      return false
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    //@ts-ignore
 | 
				
			||||||
    if (param348 == '0' && projectsObj['9']?.type == 2) {
 | 
					    if (param348 == '0' && projectsObj['9']?.type == 2) {
 | 
				
			||||||
      return index === 0 ? true : false
 | 
					      return index === 0 ? true : false
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -985,4 +942,76 @@ struct Index {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    return true
 | 
					    return true
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  scroller: Scroller = new Scroller()
 | 
				
			||||||
 | 
					  //页面通用字体大小
 | 
				
			||||||
 | 
					  @State wayno:number = 0
 | 
				
			||||||
 | 
					  @State FONTSIZE: number = 28
 | 
				
			||||||
 | 
					  @State BIGFONTSIZE: number = 28
 | 
				
			||||||
 | 
					  //结束考试弹窗
 | 
				
			||||||
 | 
					  @State endPopupVisible: boolean = false
 | 
				
			||||||
 | 
					  //等待弹窗(考试及格,考试不及格使用)
 | 
				
			||||||
 | 
					  @State loadingPopupVisible: boolean = false
 | 
				
			||||||
 | 
					  //实时轨迹弹窗
 | 
				
			||||||
 | 
					  @State signDisplayComVisible: boolean = false
 | 
				
			||||||
 | 
					  @State isDdxk: boolean = false;
 | 
				
			||||||
 | 
					  @State time: string = ''
 | 
				
			||||||
 | 
					  //考试用时
 | 
				
			||||||
 | 
					  @State examTime: number = 0
 | 
				
			||||||
 | 
					  //开始时间
 | 
				
			||||||
 | 
					  @State startTime: string = '00:00:00'
 | 
				
			||||||
 | 
					  @State startFullTime: string = ''
 | 
				
			||||||
 | 
					  @State startHourTime: string = ''
 | 
				
			||||||
 | 
					  //科目类型
 | 
				
			||||||
 | 
					  @State examSubject: 2 | 3 = 3;
 | 
				
			||||||
 | 
					  @State ddxkTime: number = 0;
 | 
				
			||||||
 | 
					  @State ddxkKsxmArr: string[] = ['']
 | 
				
			||||||
 | 
					  @State ddxkKfArr: string[] = ['']
 | 
				
			||||||
 | 
					  @State xmmcStr: string = ''
 | 
				
			||||||
 | 
					  @State carztStr: string = ''
 | 
				
			||||||
 | 
					  @State kfArr: {
 | 
				
			||||||
 | 
					    xmmcStr?: string,
 | 
				
			||||||
 | 
					    score: string,
 | 
				
			||||||
 | 
					    desc: string
 | 
				
			||||||
 | 
					  }[] = []
 | 
				
			||||||
 | 
					  @State name: string = ''
 | 
				
			||||||
 | 
					  @State idCard: string = ''
 | 
				
			||||||
 | 
					  @State totalScore: number = 100
 | 
				
			||||||
 | 
					  //模拟考试项目
 | 
				
			||||||
 | 
					  @State projects: Project[] = []
 | 
				
			||||||
 | 
					  @State projectsObj: ProjectObj = {}
 | 
				
			||||||
 | 
					  @State projectsCenterObj: ProjectObj = {}
 | 
				
			||||||
 | 
					  @State markRuleListObj: MarkRule = {}
 | 
				
			||||||
 | 
					  @State cdsbInfoObj: CDSBInfo = {}
 | 
				
			||||||
 | 
					  @State timer: number = 0
 | 
				
			||||||
 | 
					  @State judgeConfig: { [k: string]: string }[] = []
 | 
				
			||||||
 | 
					  @State judgeConfigObj: { [k: string]: any } = defaultJudgeConfigObj
 | 
				
			||||||
 | 
					  //流水号
 | 
				
			||||||
 | 
					  @State lsh: string = ''
 | 
				
			||||||
 | 
					  @State kszp: string = ''
 | 
				
			||||||
 | 
					  @State ksdd: string = ''
 | 
				
			||||||
 | 
					  @State kssycs: string = ''
 | 
				
			||||||
 | 
					  @State kslx: string = ''
 | 
				
			||||||
 | 
					  //监管接口序列号
 | 
				
			||||||
 | 
					  @State serialNumber: number = 0
 | 
				
			||||||
 | 
					  @State carType: string = ''
 | 
				
			||||||
 | 
					  @State carName: string = ''
 | 
				
			||||||
 | 
					  @State isDeductedPopShow: boolean = false
 | 
				
			||||||
 | 
					  @State isAmplifyPopShow: boolean = false
 | 
				
			||||||
 | 
					  @State amplifiedImgIndex: number = 0
 | 
				
			||||||
 | 
					  @State judge: any = {}
 | 
				
			||||||
 | 
					  //行驶距离
 | 
				
			||||||
 | 
					  @State jl: number = 0
 | 
				
			||||||
 | 
					  //应考里程
 | 
				
			||||||
 | 
					  @State examMileage: string = '0'
 | 
				
			||||||
 | 
					  @State artSubject3Projects: string[] = ['直线', '会车', '变道', '超车', '掉头', '停车']
 | 
				
			||||||
 | 
					  @State artSubject3ProjectsCodesArr: string[] = ['3', '9', '4', '10', '12', '11']
 | 
				
			||||||
 | 
					  @State manualMarkRules: MarkRule[] = []
 | 
				
			||||||
 | 
					  //科目三评判初始化数据
 | 
				
			||||||
 | 
					  @State systemparmArr: SYSTEMPARMARR[] = []
 | 
				
			||||||
 | 
					  @State mapPointItemArr: MAPITEMPOINTITEM[] = []
 | 
				
			||||||
 | 
					  @State carinfoArrr: CARINFO[] = []
 | 
				
			||||||
 | 
					  @State mapPointArr: MAPPOINT[] = []
 | 
				
			||||||
 | 
					  private context = getContext(this) as common.UIAbilityContext;
 | 
				
			||||||
 | 
					  //已考的考试项目
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -24,7 +24,6 @@ export default struct Index {
 | 
				
			|||||||
      const {no1,no2,no3,txt1,txt2} = systemParm;
 | 
					      const {no1,no2,no3,txt1,txt2} = systemParm;
 | 
				
			||||||
      if (no1 == 4) {
 | 
					      if (no1 == 4) {
 | 
				
			||||||
        const temp = { no2, no3, txt1: decodeURI(txt1), txt2 }
 | 
					        const temp = { no2, no3, txt1: decodeURI(txt1), txt2 }
 | 
				
			||||||
        console.info('surenjun', JSON.stringify(temp))
 | 
					 | 
				
			||||||
        this.roadObj[no2] = no2
 | 
					        this.roadObj[no2] = no2
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
@ -57,10 +56,8 @@ export default struct Index {
 | 
				
			|||||||
            const roadArr = Reflect.ownKeys(this.roadObj).map((roadKey) => {
 | 
					            const roadArr = Reflect.ownKeys(this.roadObj).map((roadKey) => {
 | 
				
			||||||
              return this.roadObj[roadKey]
 | 
					              return this.roadObj[roadKey]
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            globalThis.carInfo.wayno = roadArr[Math.floor(Math.random()*roadArr.length)];
 | 
					            const wayno = roadArr[Math.floor(Math.random()*roadArr.length)];
 | 
				
			||||||
            router.pushUrl({
 | 
					            this.goJudge(wayno)
 | 
				
			||||||
              url: 'pages/Judge',
 | 
					 | 
				
			||||||
            }, router.RouterMode.Single);
 | 
					 | 
				
			||||||
          })
 | 
					          })
 | 
				
			||||||
          ForEach(Reflect.ownKeys(this.roadObj), (roadIndex) => {
 | 
					          ForEach(Reflect.ownKeys(this.roadObj), (roadIndex) => {
 | 
				
			||||||
            ListItem() {
 | 
					            ListItem() {
 | 
				
			||||||
@ -81,10 +78,7 @@ export default struct Index {
 | 
				
			|||||||
            .height(220)
 | 
					            .height(220)
 | 
				
			||||||
            .margin({ left: 5, bottom: 10 })
 | 
					            .margin({ left: 5, bottom: 10 })
 | 
				
			||||||
            .onClick(async () => {
 | 
					            .onClick(async () => {
 | 
				
			||||||
              globalThis.carInfo.wayno = this.roadObj[roadIndex];
 | 
					              this.goJudge(this.roadObj[roadIndex])
 | 
				
			||||||
              router.pushUrl({
 | 
					 | 
				
			||||||
                url: 'pages/Judge',
 | 
					 | 
				
			||||||
              }, router.RouterMode.Single);
 | 
					 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
          })
 | 
					          })
 | 
				
			||||||
        }.lanes(8).margin({ top: 50, left: 15 })
 | 
					        }.lanes(8).margin({ top: 50, left: 15 })
 | 
				
			||||||
@ -95,6 +89,18 @@ export default struct Index {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  outClick() {
 | 
					  goJudge(wayno) {
 | 
				
			||||||
 | 
					    let currentParams: any = router.getParams() || {};
 | 
				
			||||||
 | 
					    const {sczb,kfdm} = currentParams;
 | 
				
			||||||
 | 
					    router.replaceUrl({
 | 
				
			||||||
 | 
					      url: 'pages/Judge',
 | 
				
			||||||
 | 
					      params:{
 | 
				
			||||||
 | 
					        sczb,
 | 
				
			||||||
 | 
					        kfdm,
 | 
				
			||||||
 | 
					        wayno
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }, router.RouterMode.Single);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  outClick(){}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -14,8 +14,9 @@ import common from '@ohos.app.ability.common';
 | 
				
			|||||||
import { User } from './interfaces';
 | 
					import { User } from './interfaces';
 | 
				
			||||||
import WebRTCVoice from './webRTC/';
 | 
					import WebRTCVoice from './webRTC/';
 | 
				
			||||||
import promptAction from '@ohos.promptAction';
 | 
					import promptAction from '@ohos.promptAction';
 | 
				
			||||||
 | 
					import { getSyncData } from '../common/service/initable';
 | 
				
			||||||
import { CandidateData, EmptyCandidateObject } from '../mock/CandidateData';
 | 
					import { CandidateData, EmptyCandidateObject } from '../mock/CandidateData';
 | 
				
			||||||
 | 
					import BoardPrePareSetPopup from './compontents/judge/BoardPrePareSetPopup'
 | 
				
			||||||
@Entry
 | 
					@Entry
 | 
				
			||||||
@Component
 | 
					@Component
 | 
				
			||||||
struct UserInfo {
 | 
					struct UserInfo {
 | 
				
			||||||
@ -34,6 +35,10 @@ struct UserInfo {
 | 
				
			|||||||
  @State url: string = ''
 | 
					  @State url: string = ''
 | 
				
			||||||
  @State lsh: string = ''
 | 
					  @State lsh: string = ''
 | 
				
			||||||
  @State qkFlag: boolean = false
 | 
					  @State qkFlag: boolean = false
 | 
				
			||||||
 | 
					  @State isBoardPrePareSetPopupOpen: boolean = false
 | 
				
			||||||
 | 
					  @State isFirstBoardPrePareSetPopupBtnShow: boolean = false
 | 
				
			||||||
 | 
					  @State isBoardPrePareSetPopupShow: boolean = false
 | 
				
			||||||
 | 
					  @State sczbkf:{xmdm:number,kfdm:string}[] = []
 | 
				
			||||||
  @State currentUser: User = EmptyCandidateObject
 | 
					  @State currentUser: User = EmptyCandidateObject
 | 
				
			||||||
  @State dataList: Array<User> = []
 | 
					  @State dataList: Array<User> = []
 | 
				
			||||||
  @State list: Array<User> = []
 | 
					  @State list: Array<User> = []
 | 
				
			||||||
@ -194,7 +199,9 @@ struct UserInfo {
 | 
				
			|||||||
    this.qkFn()
 | 
					    this.qkFn()
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  initData() {
 | 
					  async initData() {
 | 
				
			||||||
 | 
					    this.sczbkf = []
 | 
				
			||||||
 | 
					    this.isFirstBoardPrePareSetPopupBtnShow = false;
 | 
				
			||||||
    this.stepFlag = false
 | 
					    this.stepFlag = false
 | 
				
			||||||
    this.faceCompareSucess = 0
 | 
					    this.faceCompareSucess = 0
 | 
				
			||||||
    this.showFaceCompare = false
 | 
					    this.showFaceCompare = false
 | 
				
			||||||
@ -216,6 +223,15 @@ struct UserInfo {
 | 
				
			|||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      //      this.getExaminationStudentInfoFn()
 | 
					      //      this.getExaminationStudentInfoFn()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    const syssetParams = await getSyncData('MA_SYSSET');
 | 
				
			||||||
 | 
					    //@ts-ignore
 | 
				
			||||||
 | 
					    syssetParams.forEach(sys => {
 | 
				
			||||||
 | 
					      //364	绕车一周评判时机(1-开始考试后判 2-开始考试前判)
 | 
				
			||||||
 | 
					       if(sys.v_no === '364'){
 | 
				
			||||||
 | 
					          this.isBoardPrePareSetPopupOpen = true;
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  async heartMsg() {
 | 
					  async heartMsg() {
 | 
				
			||||||
@ -531,6 +547,7 @@ struct UserInfo {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  build() {
 | 
					  build() {
 | 
				
			||||||
    Column() {
 | 
					    Column() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      TopLogo({ outFlag: $outFlag }).margin({ bottom: 10 })
 | 
					      TopLogo({ outFlag: $outFlag }).margin({ bottom: 10 })
 | 
				
			||||||
      Row() {
 | 
					      Row() {
 | 
				
			||||||
        Row() {
 | 
					        Row() {
 | 
				
			||||||
@ -627,54 +644,72 @@ struct UserInfo {
 | 
				
			|||||||
            .onClick(() => {
 | 
					            .onClick(() => {
 | 
				
			||||||
              this.qkFlag = true
 | 
					              this.qkFlag = true
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
          Image($r('app.media.ksks_btn'))
 | 
					
 | 
				
			||||||
            .commStyle()
 | 
					          if( this.isBoardPrePareSetPopupOpen && !this.isFirstBoardPrePareSetPopupBtnShow){
 | 
				
			||||||
            .onClick(() => {
 | 
					            //上车准备
 | 
				
			||||||
              this.faceCompareSucess = 0
 | 
					            Image($r('app.media.sczb_btn')).commStyle().onClick(()=>{
 | 
				
			||||||
              globalThis.statue = 2
 | 
					              this.isBoardPrePareSetPopupShow = true;
 | 
				
			||||||
              if (!this.currentUser.xm) {
 | 
					              this.isFirstBoardPrePareSetPopupBtnShow = true;
 | 
				
			||||||
                return
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
              // if(globalThis.spzdFlag){
 | 
					 | 
				
			||||||
              //   promptAction.showToast({
 | 
					 | 
				
			||||||
              //     message: '摄像头被遮挡',
 | 
					 | 
				
			||||||
              //     duration: 2000
 | 
					 | 
				
			||||||
              //   });
 | 
					 | 
				
			||||||
              //   return
 | 
					 | 
				
			||||||
              // }
 | 
					 | 
				
			||||||
              //TODO 科目三先写死
 | 
					 | 
				
			||||||
              globalThis.carInfo.examSubject = 3;
 | 
					 | 
				
			||||||
              if (globalThis.singlePlay) {
 | 
					 | 
				
			||||||
                const {examSubject} = globalThis.carInfo;
 | 
					 | 
				
			||||||
                this.AccountTable.query('0', (result) => {
 | 
					 | 
				
			||||||
                  if (result.length == 0) {
 | 
					 | 
				
			||||||
                    this.AccountTable.insertData(this.currentUser, (id) => {
 | 
					 | 
				
			||||||
                      this.AccountTable.query('0', (result) => {
 | 
					 | 
				
			||||||
                        router.pushUrl({
 | 
					 | 
				
			||||||
                          url: examSubject == 3 ? 'pages/Roads':'pages/Judge',
 | 
					 | 
				
			||||||
                        }, router.RouterMode.Single);
 | 
					 | 
				
			||||||
                        this.stopDeviceById()
 | 
					 | 
				
			||||||
                      })
 | 
					 | 
				
			||||||
                    })
 | 
					 | 
				
			||||||
                  } else {
 | 
					 | 
				
			||||||
                    this.AccountTable.updateData(this.currentUser, (id) => {
 | 
					 | 
				
			||||||
                      this.AccountTable.query('0', (result) => {
 | 
					 | 
				
			||||||
                        router.pushUrl({
 | 
					 | 
				
			||||||
                          url: examSubject == 3?'pages/Roads':'pages/Judge',
 | 
					 | 
				
			||||||
                        }, router.RouterMode.Single);
 | 
					 | 
				
			||||||
                        this.stopDeviceById()
 | 
					 | 
				
			||||||
                      })
 | 
					 | 
				
			||||||
                    })
 | 
					 | 
				
			||||||
                  }
 | 
					 | 
				
			||||||
                })
 | 
					 | 
				
			||||||
                return
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
              if (this.FaceOpenStatue != '0') {
 | 
					 | 
				
			||||||
                this.showFaceCompare = true
 | 
					 | 
				
			||||||
              } else {
 | 
					 | 
				
			||||||
                this.sfbdinterfaceFn()
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
 | 
					          }else{
 | 
				
			||||||
 | 
					            Image($r('app.media.ksks_btn'))
 | 
				
			||||||
 | 
					              .commStyle()
 | 
				
			||||||
 | 
					              .onClick(() => {
 | 
				
			||||||
 | 
					                this.faceCompareSucess = 0
 | 
				
			||||||
 | 
					                globalThis.statue = 2
 | 
				
			||||||
 | 
					                if (!this.currentUser.xm) {
 | 
				
			||||||
 | 
					                  return
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                // if(globalThis.spzdFlag){
 | 
				
			||||||
 | 
					                //   promptAction.showToast({
 | 
				
			||||||
 | 
					                //     message: '摄像头被遮挡',
 | 
				
			||||||
 | 
					                //     duration: 2000
 | 
				
			||||||
 | 
					                //   });
 | 
				
			||||||
 | 
					                //   return
 | 
				
			||||||
 | 
					                // }
 | 
				
			||||||
 | 
					                //TODO 科目三先写死
 | 
				
			||||||
 | 
					                globalThis.carInfo.examSubject = 3;
 | 
				
			||||||
 | 
					                if (globalThis.singlePlay) {
 | 
				
			||||||
 | 
					                  const {examSubject} = globalThis.carInfo;
 | 
				
			||||||
 | 
					                  this.AccountTable.query('0', (result) => {
 | 
				
			||||||
 | 
					                    if (result.length == 0) {
 | 
				
			||||||
 | 
					                      this.AccountTable.insertData(this.currentUser, (id) => {
 | 
				
			||||||
 | 
					                        this.AccountTable.query('0', (result) => {
 | 
				
			||||||
 | 
					                          router.pushUrl({
 | 
				
			||||||
 | 
					                            url: examSubject == 3 ? 'pages/Roads':'pages/Judge',
 | 
				
			||||||
 | 
					                            params:{
 | 
				
			||||||
 | 
					                              sczb:Number(this.isBoardPrePareSetPopupOpen),
 | 
				
			||||||
 | 
					                              kfdm:this.sczbkf
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                          }, router.RouterMode.Single);
 | 
				
			||||||
 | 
					                          this.stopDeviceById()
 | 
				
			||||||
 | 
					                        })
 | 
				
			||||||
 | 
					                      })
 | 
				
			||||||
 | 
					                    } else {
 | 
				
			||||||
 | 
					                      this.AccountTable.updateData(this.currentUser, (id) => {
 | 
				
			||||||
 | 
					                        this.AccountTable.query('0', (result) => {
 | 
				
			||||||
 | 
					                          router.pushUrl({
 | 
				
			||||||
 | 
					                            url: examSubject == 3?'pages/Roads':'pages/Judge',
 | 
				
			||||||
 | 
					                            params:{
 | 
				
			||||||
 | 
					                              sczb:Number(this.isBoardPrePareSetPopupOpen),
 | 
				
			||||||
 | 
					                              kfdm:this.sczbkf
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                          }, router.RouterMode.Single);
 | 
				
			||||||
 | 
					                          this.stopDeviceById()
 | 
				
			||||||
 | 
					                        })
 | 
				
			||||||
 | 
					                      })
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                  })
 | 
				
			||||||
 | 
					                  return
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (this.FaceOpenStatue != '0') {
 | 
				
			||||||
 | 
					                  this.showFaceCompare = true
 | 
				
			||||||
 | 
					                } else {
 | 
				
			||||||
 | 
					                  this.sfbdinterfaceFn()
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					              })
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -719,6 +754,19 @@ struct UserInfo {
 | 
				
			|||||||
        .backgroundColor('#E6E3DF')
 | 
					        .backgroundColor('#E6E3DF')
 | 
				
			||||||
        .borderRadius(19 * this.ratio)
 | 
					        .borderRadius(19 * this.ratio)
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // 上车准备
 | 
				
			||||||
 | 
					      if(this.isBoardPrePareSetPopupShow){
 | 
				
			||||||
 | 
					        BoardPrePareSetPopup({
 | 
				
			||||||
 | 
					          closePopup:()=>{
 | 
				
			||||||
 | 
					            this.isBoardPrePareSetPopupShow = false
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					          confirmMark:(kfdm)=>{
 | 
				
			||||||
 | 
					            this.sczbkf= kfdm
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    .height('100%')
 | 
					    .height('100%')
 | 
				
			||||||
    .width('100%')
 | 
					    .width('100%')
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
import router from '@ohos.router';
 | 
					import router from '@ohos.router';
 | 
				
			||||||
import UdpClient from '../../common/utils/UdpClient';
 | 
					import UdpClient from '../../common/utils/UdpClient';
 | 
				
			||||||
import FileLog from '../judgeSDK/utils/file-log';
 | 
					import FileLog from '../judgeSDK/utils/fileLog';
 | 
				
			||||||
import RealTime from '../compontents/judge/RealTime';
 | 
					import RealTime from '../compontents/judge/RealTime';
 | 
				
			||||||
import { GPSData, SignalData } from '../../mock';
 | 
					import { GPSData, SignalData } from '../../mock';
 | 
				
			||||||
import { SignalDataType } from '../../model';
 | 
					import { SignalDataType } from '../../model';
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
import apiJudgeSdk from 'libJudgeSdk.so';
 | 
					import apiJudgeSdk from 'libJudgeSdk.so';
 | 
				
			||||||
import Judge from '../../judgeSDK/utils/judge-real';
 | 
					import Judge from '../../judgeSDK/utils/judgeReal';
 | 
				
			||||||
import { MarkRule, Project, ProjectObj } from '../../judgeSDK/api/judgeSDK.d';
 | 
					import { MarkRule, Project, ProjectObj } from '../../judgeSDK/api/judgeSDK.d';
 | 
				
			||||||
import common from '@ohos.app.ability.common';
 | 
					import common from '@ohos.app.ability.common';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -131,6 +131,7 @@ export function handleLog(level,infoStr, len){
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
export async function examJudgeEndExam(){
 | 
					export async function examJudgeEndExam(){
 | 
				
			||||||
 | 
					  console.info('surenjun','考试结束调用')
 | 
				
			||||||
  const temp = libJudgeSdk.examJudgeEndExam();
 | 
					  const temp = libJudgeSdk.examJudgeEndExam();
 | 
				
			||||||
  return await handle(temp,'examJudgeEndExam')
 | 
					  return await handle(temp,'examJudgeEndExam')
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -170,6 +171,26 @@ export async function examJudgeSetPerformCallback(fn){
 | 
				
			|||||||
  const temp = libJudgeSdk.examJudgeSetPerformCallback(fn);
 | 
					  const temp = libJudgeSdk.examJudgeSetPerformCallback(fn);
 | 
				
			||||||
  return await handle(temp,'examJudgeSetPerformCallback')
 | 
					  return await handle(temp,'examJudgeSetPerformCallback')
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @desc 语音播报结束
 | 
				
			||||||
 | 
					 * /
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export async function examJudgeSoundEnd(param:{
 | 
				
			||||||
 | 
					  //项目代码
 | 
				
			||||||
 | 
					  itemno:number,
 | 
				
			||||||
 | 
					  //语音码
 | 
				
			||||||
 | 
					  code:string,
 | 
				
			||||||
 | 
					  //语音类型
 | 
				
			||||||
 | 
					  type:number,
 | 
				
			||||||
 | 
					}){
 | 
				
			||||||
 | 
					  const {itemno,code,type} = param;
 | 
				
			||||||
 | 
					  const temp = libJudgeSdk.examJudgeSoundEnd(itemno,code,type);
 | 
				
			||||||
 | 
					  return await handle(temp,'examJudgeSoundEnd')
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * @desc通用处理函数
 | 
					 * @desc通用处理函数
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 | 
				
			|||||||
@ -16,7 +16,8 @@ export interface MarkRule{
 | 
				
			|||||||
  itemno?:number
 | 
					  itemno?:number
 | 
				
			||||||
  markcatalog?:string
 | 
					  markcatalog?:string
 | 
				
			||||||
  markshow?:string
 | 
					  markshow?:string
 | 
				
			||||||
  markserial?:number
 | 
					  markserial?:string
 | 
				
			||||||
 | 
					  markstandard?:number,
 | 
				
			||||||
  markreal?:number
 | 
					  markreal?:number
 | 
				
			||||||
  kfxh?:string
 | 
					  kfxh?:string
 | 
				
			||||||
  onlyoneid?:number
 | 
					  onlyoneid?:number
 | 
				
			||||||
@ -118,7 +119,8 @@ export interface EXAMDATA{
 | 
				
			|||||||
  sound:{
 | 
					  sound:{
 | 
				
			||||||
    xmdm:number,
 | 
					    xmdm:number,
 | 
				
			||||||
    //语音播放文件代码
 | 
					    //语音播放文件代码
 | 
				
			||||||
    code:string
 | 
					    code:string,
 | 
				
			||||||
 | 
					    type:number
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  //模拟灯光
 | 
					  //模拟灯光
 | 
				
			||||||
  mndg:string
 | 
					  mndg:string
 | 
				
			||||||
@ -138,7 +140,9 @@ export interface SOUND {
 | 
				
			|||||||
  //项目代码
 | 
					  //项目代码
 | 
				
			||||||
  xmdm:number
 | 
					  xmdm:number
 | 
				
			||||||
  //语音播放提示代码
 | 
					  //语音播放提示代码
 | 
				
			||||||
  code:string
 | 
					  code:string,
 | 
				
			||||||
 | 
					  //0:普通,1:模拟灯光
 | 
				
			||||||
 | 
					  type:number
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
export  interface SYSSET {
 | 
					export  interface SYSSET {
 | 
				
			||||||
  v_no:string,
 | 
					  v_no:string,
 | 
				
			||||||
@ -147,7 +151,7 @@ export  interface SYSSET {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface ProjectObj {
 | 
					export interface ProjectObj {
 | 
				
			||||||
  [k:any]:Project
 | 
					  [k:string]:Project
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -2,19 +2,16 @@ import systemTime from '@ohos.systemDateTime';
 | 
				
			|||||||
import router from '@ohos.router';
 | 
					import router from '@ohos.router';
 | 
				
			||||||
import util from '@ohos.util';
 | 
					import util from '@ohos.util';
 | 
				
			||||||
import buffer from '@ohos.buffer';
 | 
					import buffer from '@ohos.buffer';
 | 
				
			||||||
 | 
					 | 
				
			||||||
import { testKmItems, testMarkRules } from './dataTest/index';
 | 
					import { testKmItems, testMarkRules } from './dataTest/index';
 | 
				
			||||||
import { EXAMDATA, SOUND } from './api/judgeSDK';
 | 
					import { EXAMDATA, SOUND } from './api/judgeSDK';
 | 
				
			||||||
 | 
					import VoiceAnnounce from './utils/voiceAnnouncements';
 | 
				
			||||||
import VoiceAnnounce from './utils/voice-announcements';
 | 
					import FileModel from './utils/fileModel';
 | 
				
			||||||
import FileModel from './utils/file-model';
 | 
					import FilePhoto from './utils/filePhoto';
 | 
				
			||||||
import FilePhoto from './utils/file-photo';
 | 
					 | 
				
			||||||
import FileUtil from '../../common/utils/File';
 | 
					import FileUtil from '../../common/utils/File';
 | 
				
			||||||
import FileLog from '../judgeSDK/utils/file-log';
 | 
					import FileLog from './utils/fileLog';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import JudgeTask from './utils/judge-task';
 | 
					import JudgeTask from './utils/judgeTask';
 | 
				
			||||||
import SimulateLights from './utils/simulate-lights';
 | 
					import { judgeConfig } from './utils/judgeConfig';
 | 
				
			||||||
import { judgeConfig } from './utils/judge-config';
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
import { uploadExamProgressData, writeObjectOut } from '../../api/judge';
 | 
					import { uploadExamProgressData, writeObjectOut } from '../../api/judge';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
@ -36,35 +33,33 @@ import {
 | 
				
			|||||||
  plcStrToWXJson,
 | 
					  plcStrToWXJson,
 | 
				
			||||||
  promptWxCode,
 | 
					  promptWxCode,
 | 
				
			||||||
  senorToWXDataStr
 | 
					  senorToWXDataStr
 | 
				
			||||||
} from './utils/judge-common';
 | 
					} from './utils/judgeCommon';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
  examJudgeArtificialItem,
 | 
					  examJudgeArtificialItem,
 | 
				
			||||||
  examJudgeArtificialMark,
 | 
					  examJudgeArtificialMark,
 | 
				
			||||||
  examJudgeBeginExam,
 | 
					  examJudgeBeginExam,
 | 
				
			||||||
  examJudgeEndExam,
 | 
					  examJudgeEndExam,
 | 
				
			||||||
  examJudgeInit,
 | 
					  examJudgeInit,
 | 
				
			||||||
  examJudgeMapSetParam,
 | 
					  examJudgeSoundEnd,
 | 
				
			||||||
  examJudgeMapSetScaling,
 | 
					 | 
				
			||||||
  examJudgeRealExam,
 | 
					  examJudgeRealExam,
 | 
				
			||||||
  examJudgeSetLogCallback,
 | 
					  examJudgeSetLogCallback,
 | 
				
			||||||
  examJudgeSetPerformCallback,
 | 
					  examJudgeSetPerformCallback,
 | 
				
			||||||
  examJudgeSetRealExamCallback
 | 
					  examJudgeSetRealExamCallback
 | 
				
			||||||
} from './api/index';
 | 
					} from './api/index';
 | 
				
			||||||
import UsbService from '../../common/service/usbService';
 | 
					import UsbService from '../../common/service/usbService';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import Prompt from '@system.prompt';
 | 
					import Prompt from '@system.prompt';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const judgeTag = 'SURENJUN_JUDGE'
 | 
					const judgeTag = 'SURENJUN_JUDGE'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default class Judge {
 | 
					export default class Judge {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
  constructor(judgeUI) {
 | 
					  constructor(judgeUI) {
 | 
				
			||||||
    this.serialIndex = 1;
 | 
					    this.serialIndex = 1;
 | 
				
			||||||
    this.judgeUI = judgeUI
 | 
					    this.judgeUI = judgeUI
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //语音播放工具
 | 
					    //语音播放工具
 | 
				
			||||||
    this.avPlayer = new VoiceAnnounce();
 | 
					    this.avPlayer = new VoiceAnnounce();
 | 
				
			||||||
    new SimulateLights(this.avPlayer)
 | 
					 | 
				
			||||||
    //模型工具
 | 
					    //模型工具
 | 
				
			||||||
    this.fileModel = new FileModel(judgeUI.context);
 | 
					    this.fileModel = new FileModel(judgeUI.context);
 | 
				
			||||||
    //文件工具
 | 
					    //文件工具
 | 
				
			||||||
@ -133,7 +128,7 @@ export default class Judge {
 | 
				
			|||||||
    console.info(judgeTag, '2.注册日志回调完成')
 | 
					    console.info(judgeTag, '2.注册日志回调完成')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let initInfo = isTrajectoryOpen ? JSON.parse(strArr[0]) : await this.getJudgeInitData();
 | 
					    let initInfo = isTrajectoryOpen ? JSON.parse(strArr[0]) : await this.getJudgeInitData();
 | 
				
			||||||
    console.log('SURENJUN_JUDGE',isJudgeInitBool,isTrajectoryOpen,JSON.stringify(initInfo))
 | 
					
 | 
				
			||||||
    //相关评判初始化只做一次
 | 
					    //相关评判初始化只做一次
 | 
				
			||||||
    if (!isJudgeInitBool) {
 | 
					    if (!isJudgeInitBool) {
 | 
				
			||||||
      await fileLog.setExamJudgeData(initInfo)
 | 
					      await fileLog.setExamJudgeData(initInfo)
 | 
				
			||||||
@ -141,6 +136,7 @@ export default class Judge {
 | 
				
			|||||||
      globalThis.isJudgeInitBool = true
 | 
					      globalThis.isJudgeInitBool = true
 | 
				
			||||||
      console.info(judgeTag, '4.评判初始化完成')
 | 
					      console.info(judgeTag, '4.评判初始化完成')
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
 | 
					      await fileLog.setExamJudgeData(initInfo)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    globalThis.isJudge = true
 | 
					    globalThis.isJudge = true
 | 
				
			||||||
@ -157,24 +153,19 @@ export default class Judge {
 | 
				
			|||||||
      this.performInfo = performInfo
 | 
					      this.performInfo = performInfo
 | 
				
			||||||
      this.judgeUI.jl = Math.ceil((performInfo.qjjl + performInfo.dcjl) / 100)
 | 
					      this.judgeUI.jl = Math.ceil((performInfo.qjjl + performInfo.dcjl) / 100)
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // 3.开始考试
 | 
					    // 3.开始考试
 | 
				
			||||||
    let beginExamInfo = isTrajectoryOpen ? {
 | 
					    let beginExamInfo = isTrajectoryOpen ? {
 | 
				
			||||||
      ...JSON.parse(strArr[1]),
 | 
					      ...JSON.parse(strArr[1]),
 | 
				
			||||||
      replay: 1
 | 
					      replay: 1
 | 
				
			||||||
    } : await getJudgeBeginData()
 | 
					    } : await getJudgeBeginData()
 | 
				
			||||||
    console.log(judgeTag,'22222',JSON.stringify(beginExamInfo),strArr[1])
 | 
					 | 
				
			||||||
    await fileLog.setExamJudgeData(beginExamInfo)
 | 
					 | 
				
			||||||
    console.log(judgeTag,'333333')
 | 
					 | 
				
			||||||
    await examJudgeBeginExam(beginExamInfo);
 | 
					 | 
				
			||||||
    console.log(judgeTag,'4444444')
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    await fileLog.setExamJudgeData(beginExamInfo)
 | 
				
			||||||
 | 
					    await examJudgeBeginExam(beginExamInfo);
 | 
				
			||||||
    console.info(judgeTag, '6.开始考试注册完成')
 | 
					    console.info(judgeTag, '6.开始考试注册完成')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    avPlayer.playAudio(['voice/ksks.WAV'])
 | 
					    avPlayer.playAudio(['voice/ksks.WAV'])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    await examJudgeMapSetParam(640, 480); //设置参数宽、高
 | 
					 | 
				
			||||||
    await examJudgeMapSetScaling(120); //设置缩放比例,一般默认填100(就是100%的意思) ,数字越大视野越大,数字越小视野越小,不能为0
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    this.judgeUI.draw = true
 | 
					    this.judgeUI.draw = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // 处理轨迹plc信息
 | 
					    // 处理轨迹plc信息
 | 
				
			||||||
@ -189,9 +180,113 @@ export default class Judge {
 | 
				
			|||||||
      handleUdp(msg)
 | 
					      handleUdp(msg)
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  // 获取评判初始化数据
 | 
				
			||||||
 | 
					  getJudgeInitData = async () => {
 | 
				
			||||||
 | 
					    const {getModelData,getKm3JudgeInitConfig} = this
 | 
				
			||||||
 | 
					    const carInfo = globalThis.carInfo;
 | 
				
			||||||
 | 
					    const { examSubject,plateNo,carId } = carInfo;
 | 
				
			||||||
 | 
					    const {fileLog} = this
 | 
				
			||||||
 | 
					    const judgeUI = this.judgeUI
 | 
				
			||||||
 | 
					    const {projectsObj,cdsbInfoObj,markRuleListObj,carType,carName} = judgeUI
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const examType = examSubject == 2 ? 'km2' : 'km3'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    let allitems = [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (examSubject == 2) {
 | 
				
			||||||
 | 
					      allitems = Reflect.ownKeys(cdsbInfoObj).map(cdsbKey => {
 | 
				
			||||||
 | 
					        const cdsb = cdsbInfoObj[cdsbKey];
 | 
				
			||||||
 | 
					        const {xmdm,xmxh,modelKey} = cdsb
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					          xmdm, xmxh, model: getModelData(`${examType}/${modelKey}.txt`)
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      })
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    const initInfo = {
 | 
				
			||||||
 | 
					      kskm: examSubject * 1,
 | 
				
			||||||
 | 
					      kchp: plateNo,
 | 
				
			||||||
 | 
					      kchm: carId * 1,
 | 
				
			||||||
 | 
					      kscx: carType,
 | 
				
			||||||
 | 
					      cxcode: '1',
 | 
				
			||||||
 | 
					      name: carName,
 | 
				
			||||||
 | 
					      carmodel: getModelData(`${examType}/${carType}.txt`),
 | 
				
			||||||
 | 
					      allitems,
 | 
				
			||||||
 | 
					      mark: Reflect.ownKeys(markRuleListObj).map(ruleKey => (markRuleListObj[ruleKey])) || testMarkRules,
 | 
				
			||||||
 | 
					      sysset: judgeUI.judgeConfig,
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    let km3Config = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (examSubject) {
 | 
				
			||||||
 | 
					      km3Config = await getKm3JudgeInitConfig();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    // 获取科目三的评判配置
 | 
				
			||||||
 | 
					    console.info(judgeTag, '3.获取评判初始化数据完成')
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					      ...initInfo,
 | 
				
			||||||
 | 
					      ...km3Config,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  // 获取开始考试数据
 | 
				
			||||||
 | 
					  getJudgeBeginData = async () => {
 | 
				
			||||||
 | 
					    const {code,name:examinerName} = globalThis.examinerInfo;
 | 
				
			||||||
 | 
					    let currentParams: any = router.getParams();
 | 
				
			||||||
 | 
					    const {sczb,kfdm} = currentParams;
 | 
				
			||||||
 | 
					    const {isExam} = this;
 | 
				
			||||||
 | 
					    const judgeUI = this.judgeUI
 | 
				
			||||||
 | 
					    const {projects,carType,isDdxk,ddxkTime,projectsCenterObj,ddxkKsxmArr,ddxkKfArr} = judgeUI;
 | 
				
			||||||
 | 
					    const beginInfo = {
 | 
				
			||||||
 | 
					      kgid: '012',
 | 
				
			||||||
 | 
					      kgxm: decodeURI(examinerName || ''),
 | 
				
			||||||
 | 
					      exam: isExam ? 1 : 0,
 | 
				
			||||||
 | 
					      //是否回放
 | 
				
			||||||
 | 
					      replay: 0,
 | 
				
			||||||
 | 
					      //生成的轨迹文件
 | 
				
			||||||
 | 
					      track: '',
 | 
				
			||||||
 | 
					      xm: judgeUI.name,
 | 
				
			||||||
 | 
					      sex: 0,
 | 
				
			||||||
 | 
					      kslsh: judgeUI.lsh,
 | 
				
			||||||
 | 
					      sfzmhm: judgeUI.idCard,
 | 
				
			||||||
 | 
					      ksyy: '',
 | 
				
			||||||
 | 
					      kscx: carType,
 | 
				
			||||||
 | 
					      kkcs: 1,
 | 
				
			||||||
 | 
					      sfyk: 0,
 | 
				
			||||||
 | 
					      ykkkcs: 1,
 | 
				
			||||||
 | 
					      wayno: judgeUI.wayno * 1,
 | 
				
			||||||
 | 
					      czlx: 0,
 | 
				
			||||||
 | 
					      kskssj: await systemTime.getCurrentTime(),
 | 
				
			||||||
 | 
					      ksxm: projects.map(project => {
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					          xmdm: project.projectCode * 1,
 | 
				
			||||||
 | 
					          xmxh: '',
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }),
 | 
				
			||||||
 | 
					      //断点续考
 | 
				
			||||||
 | 
					      ddxk: isDdxk ? 1 : 0,
 | 
				
			||||||
 | 
					      ddkssj: ddxkTime,
 | 
				
			||||||
 | 
					      ykxm: isDdxk ? (ddxkKsxmArr?.map(projectCenterCode => (projectsCenterObj[projectCenterCode]?.projectCode) * 1)) : [],
 | 
				
			||||||
 | 
					      kfxm: isDdxk ? (ddxkKfArr?.map(kf => {
 | 
				
			||||||
 | 
					        const [xmdm, kfdm] = kf.split(',')
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					          xmdm: xmdm * 1,
 | 
				
			||||||
 | 
					          kfdm
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      })) : [],
 | 
				
			||||||
 | 
					      yklc: 0,
 | 
				
			||||||
 | 
					      special: [],
 | 
				
			||||||
 | 
					      //TODO 科目三参数临时写死
 | 
				
			||||||
 | 
					      sczb: (sczb === undefined || sczb == 0)?0:1,
 | 
				
			||||||
 | 
					      sczbkf:kfdm,
 | 
				
			||||||
 | 
					      dmndg: false,
 | 
				
			||||||
 | 
					      nitem1: false,
 | 
				
			||||||
 | 
					      nitem41: false,
 | 
				
			||||||
 | 
					      mfxx: false,
 | 
				
			||||||
 | 
					      mfxxn: false
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    console.info(judgeTag, '5.获取开始考试数据完成')
 | 
				
			||||||
 | 
					    return beginInfo
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  // 项目开始接口同步
 | 
					  // 项目开始接口同步
 | 
				
			||||||
  beginProject = async (ksxm) => {
 | 
					  beginProject = async (ksxm) => {
 | 
				
			||||||
    const carInfo = globalThis.carInfo;
 | 
					    const carInfo = globalThis.carInfo;
 | 
				
			||||||
@ -332,28 +427,28 @@ export default class Judge {
 | 
				
			|||||||
    fileLog.setExamJudgeWuxiData(data)
 | 
					    fileLog.setExamJudgeWuxiData(data)
 | 
				
			||||||
    console.info(judgeTag, '上传照片 end')
 | 
					    console.info(judgeTag, '上传照片 end')
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  // 评判语音提示
 | 
					  // 评判语音提示
 | 
				
			||||||
  goJudgeVoice = async (sound: SOUND) => {
 | 
					  goJudgeVoice = async (sound: SOUND) => {
 | 
				
			||||||
    const {avPlayer} = this;
 | 
					    const {avPlayer,fileLog} = this;
 | 
				
			||||||
    const {xmdm,code} = sound;
 | 
					    const {xmdm,code,type} = sound;
 | 
				
			||||||
    //判断是不是模拟灯光语音
 | 
					    //判断是不是模拟灯光语音
 | 
				
			||||||
    const isLight = code.slice(0, 3) === '417';
 | 
					    console.info(judgeTag,JSON.stringify(sound))
 | 
				
			||||||
    if (isLight) {
 | 
					    if(type == 1){
 | 
				
			||||||
      console.info(judgeTag, '模拟灯光开始播放:' + code)
 | 
					      console.info(judgeTag, '模拟灯光开始播放:' + code)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    avPlayer.playAudio([`voice/${code}.mp3`], true, () => {
 | 
					    avPlayer.playAudio([`voice/${code}.mp3`], true, () => {
 | 
				
			||||||
      if (isLight) {
 | 
					      if (type == 1) {
 | 
				
			||||||
        console.info(judgeTag, '播放结束:' + code)
 | 
					        console.info(judgeTag, '播放结束:' + code)
 | 
				
			||||||
        setTimeout(() => {
 | 
					        examJudgeSoundEnd({itemno:xmdm,code,type})
 | 
				
			||||||
          this.wav = 1;
 | 
					        fileLog.setExamJudgeData({
 | 
				
			||||||
 | 
					          method: 'examJudgeSoundEnd',
 | 
				
			||||||
 | 
					          itemno: xmdm,
 | 
				
			||||||
 | 
					          code,
 | 
				
			||||||
 | 
					          type,
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  // 处理考试结束
 | 
					  // 处理考试结束
 | 
				
			||||||
  public handEndExam = async (isManual?: Boolean) => {
 | 
					  public handEndExam = async (isManual?: Boolean) => {
 | 
				
			||||||
    const {isExam,judgeUI,endExam,handleSEP,avPlayer} = this;
 | 
					    const {isExam,judgeUI,endExam,handleSEP,avPlayer} = this;
 | 
				
			||||||
@ -386,26 +481,6 @@ export default class Judge {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  // 当前项目转换
 | 
					 | 
				
			||||||
  getDqxmStr = (type) => {
 | 
					 | 
				
			||||||
    const projectsObj = this.judgeUI.projectsObj
 | 
					 | 
				
			||||||
    return projectsObj[type]?.abbreviation || '通用评判'
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  // 扣分项目转换
 | 
					 | 
				
			||||||
  getKfStr = (code) => {
 | 
					 | 
				
			||||||
    const markRuleListObj = this.judgeUI.markRuleListObj;
 | 
					 | 
				
			||||||
    const thisMark = markRuleListObj[code]
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
      desc: thisMark.markshow,
 | 
					 | 
				
			||||||
      score: thisMark.markreal,
 | 
					 | 
				
			||||||
      markcatalog: thisMark.markcatalog,
 | 
					 | 
				
			||||||
      markserial: thisMark.markserial,
 | 
					 | 
				
			||||||
      kfxh: thisMark.kfxh
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  // 考试结束
 | 
					  // 考试结束
 | 
				
			||||||
  public endExam = async (isManual?: Boolean) => {
 | 
					  public endExam = async (isManual?: Boolean) => {
 | 
				
			||||||
    const carInfo = globalThis.carInfo;
 | 
					    const carInfo = globalThis.carInfo;
 | 
				
			||||||
@ -455,55 +530,23 @@ export default class Judge {
 | 
				
			|||||||
    }, 3000)
 | 
					    }, 3000)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  // 当前项目转换
 | 
				
			||||||
  // 获取评判初始化数据
 | 
					  getDqxmStr = (type) => {
 | 
				
			||||||
  getJudgeInitData = async () => {
 | 
					    const projectsObj = this.judgeUI.projectsObj
 | 
				
			||||||
    const {getModelData,getKm3JudgeInitConfig} = this
 | 
					    return projectsObj[type]?.abbreviation || '通用评判'
 | 
				
			||||||
    const carInfo = globalThis.carInfo;
 | 
					  }
 | 
				
			||||||
    const { examSubject,plateNo,carId } = carInfo;
 | 
					  // 扣分项目转换
 | 
				
			||||||
    const {fileLog} = this
 | 
					  getKfStr = (code) => {
 | 
				
			||||||
    const judgeUI = this.judgeUI
 | 
					    const markRuleListObj = this.judgeUI.markRuleListObj;
 | 
				
			||||||
    const {projectsObj,cdsbInfoObj,markRuleListObj,carType,carName} = judgeUI
 | 
					    const thisMark = markRuleListObj[code]
 | 
				
			||||||
 | 
					 | 
				
			||||||
    const examType = examSubject == 2 ? 'km2' : 'km3'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    let allitems = [];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (examSubject == 2) {
 | 
					 | 
				
			||||||
      allitems = Reflect.ownKeys(cdsbInfoObj).map(cdsbKey => {
 | 
					 | 
				
			||||||
        const cdsb = cdsbInfoObj[cdsbKey];
 | 
					 | 
				
			||||||
        const {xmdm,xmxh,modelKey} = cdsb
 | 
					 | 
				
			||||||
        return {
 | 
					 | 
				
			||||||
          xmdm, xmxh, model: getModelData(`${examType}/${modelKey}.txt`)
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    const initInfo = {
 | 
					 | 
				
			||||||
      kskm: examSubject * 1,
 | 
					 | 
				
			||||||
      kchp: plateNo,
 | 
					 | 
				
			||||||
      kchm: carId * 1,
 | 
					 | 
				
			||||||
      kscx: carType,
 | 
					 | 
				
			||||||
      cxcode: '1',
 | 
					 | 
				
			||||||
      name: carName,
 | 
					 | 
				
			||||||
      carmodel: getModelData(`${examType}/${carType}.txt`),
 | 
					 | 
				
			||||||
      allitems,
 | 
					 | 
				
			||||||
      mark: Reflect.ownKeys(markRuleListObj).map(ruleKey => (markRuleListObj[ruleKey])) || testMarkRules,
 | 
					 | 
				
			||||||
      sysset: judgeUI.judgeConfig,
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    let km3Config = {}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (examSubject) {
 | 
					 | 
				
			||||||
      km3Config = await getKm3JudgeInitConfig();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    // 获取科目三的评判配置
 | 
					 | 
				
			||||||
    console.info(judgeTag, '3.获取评判初始化数据完成')
 | 
					 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
      ...initInfo,
 | 
					      desc: thisMark.markshow,
 | 
				
			||||||
      ...km3Config,
 | 
					      score: thisMark.markreal,
 | 
				
			||||||
 | 
					      markcatalog: thisMark.markcatalog,
 | 
				
			||||||
 | 
					      markserial: thisMark.markserial,
 | 
				
			||||||
 | 
					      kfxh: thisMark.kfxh
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  // 消息心跳发送
 | 
					  // 消息心跳发送
 | 
				
			||||||
  getMessageHeartbeat = async (isEnd?: Boolean) => {
 | 
					  getMessageHeartbeat = async (isEnd?: Boolean) => {
 | 
				
			||||||
    const carInfo = globalThis.carInfo;
 | 
					    const carInfo = globalThis.carInfo;
 | 
				
			||||||
@ -603,66 +646,6 @@ export default class Judge {
 | 
				
			|||||||
    this.serialIndex += 1;
 | 
					    this.serialIndex += 1;
 | 
				
			||||||
    return Array2Byte(tempArr)
 | 
					    return Array2Byte(tempArr)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  // 获取开始考试数据
 | 
					 | 
				
			||||||
  getJudgeBeginData = async () => {
 | 
					 | 
				
			||||||
    console.log('globalThis.carInfo.wayno',globalThis.carInfo.wayno)
 | 
					 | 
				
			||||||
    const {code,name:examinerName} = globalThis.examinerInfo;
 | 
					 | 
				
			||||||
    const {isExam,isTrajectoryOpen} = this;
 | 
					 | 
				
			||||||
    const judgeUI = this.judgeUI
 | 
					 | 
				
			||||||
    const {projects,carType,isDdxk,ddxkTime,projectsCenterObj,ddxkKsxmArr,ddxkKfArr} = judgeUI;
 | 
					 | 
				
			||||||
    const beginInfo = {
 | 
					 | 
				
			||||||
      kgid: '012',
 | 
					 | 
				
			||||||
      kgxm: decodeURI(examinerName || ''),
 | 
					 | 
				
			||||||
      exam: isExam ? 1 : 0,
 | 
					 | 
				
			||||||
      //是否回放
 | 
					 | 
				
			||||||
      replay: 0,
 | 
					 | 
				
			||||||
      //生成的轨迹文件
 | 
					 | 
				
			||||||
      track: '',
 | 
					 | 
				
			||||||
      xm: judgeUI.name,
 | 
					 | 
				
			||||||
      sex: 0,
 | 
					 | 
				
			||||||
      kslsh: judgeUI.lsh,
 | 
					 | 
				
			||||||
      sfzmhm: judgeUI.idCard,
 | 
					 | 
				
			||||||
      ksyy: '',
 | 
					 | 
				
			||||||
      kscx: carType,
 | 
					 | 
				
			||||||
      kkcs: 1,
 | 
					 | 
				
			||||||
      sfyk: 0,
 | 
					 | 
				
			||||||
      ykkkcs: 1,
 | 
					 | 
				
			||||||
      wayno: Number(globalThis.carInfo.wayno)|| 0,
 | 
					 | 
				
			||||||
      czlx: 0,
 | 
					 | 
				
			||||||
      kskssj: await systemTime.getCurrentTime(),
 | 
					 | 
				
			||||||
      ksxm: projects.map(project => {
 | 
					 | 
				
			||||||
        return {
 | 
					 | 
				
			||||||
          xmdm: project.projectCode * 1,
 | 
					 | 
				
			||||||
          xmxh: '',
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      }),
 | 
					 | 
				
			||||||
      //断点续考
 | 
					 | 
				
			||||||
      ddxk: isDdxk ? 1 : 0,
 | 
					 | 
				
			||||||
      ddkssj: ddxkTime,
 | 
					 | 
				
			||||||
      ykxm: isDdxk ? (ddxkKsxmArr?.map(projectCenterCode => (projectsCenterObj[projectCenterCode]?.projectCode) * 1)) : [],
 | 
					 | 
				
			||||||
      kfxm: isDdxk ? (ddxkKfArr?.map(kf => {
 | 
					 | 
				
			||||||
        const [xmdm, kfdm] = kf.split(',')
 | 
					 | 
				
			||||||
        return {
 | 
					 | 
				
			||||||
          xmdm: xmdm * 1,
 | 
					 | 
				
			||||||
          kfdm
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      })) : [],
 | 
					 | 
				
			||||||
      yklc: 0,
 | 
					 | 
				
			||||||
      special: [],
 | 
					 | 
				
			||||||
      //TODO 科目三参数临时写死
 | 
					 | 
				
			||||||
      sczb: 0,
 | 
					 | 
				
			||||||
      sczbkf: [],
 | 
					 | 
				
			||||||
      dmndg: false,
 | 
					 | 
				
			||||||
      nitem1: false,
 | 
					 | 
				
			||||||
      nitem41: false,
 | 
					 | 
				
			||||||
      mfxx: false,
 | 
					 | 
				
			||||||
      mfxxn: false
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    console.info(judgeTag, '5.获取开始考试数据完成')
 | 
					 | 
				
			||||||
    return beginInfo
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  //获取场地序号
 | 
					  //获取场地序号
 | 
				
			||||||
  getSbxh = (ksxm, xmxh) => {
 | 
					  getSbxh = (ksxm, xmxh) => {
 | 
				
			||||||
    const {judgeUI} = this;
 | 
					    const {judgeUI} = this;
 | 
				
			||||||
@ -677,7 +660,6 @@ export default class Judge {
 | 
				
			|||||||
    const sbxh = currentCdsb.sbbh || '00000000'
 | 
					    const sbxh = currentCdsb.sbbh || '00000000'
 | 
				
			||||||
    return sbxh
 | 
					    return sbxh
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  getSbbm = (ksxm, xmxh) => {
 | 
					  getSbbm = (ksxm, xmxh) => {
 | 
				
			||||||
    const {judgeUI} = this;
 | 
					    const {judgeUI} = this;
 | 
				
			||||||
    const {cdsbInfoObj,projectsObj} = judgeUI;
 | 
					    const {cdsbInfoObj,projectsObj} = judgeUI;
 | 
				
			||||||
@ -690,7 +672,6 @@ export default class Judge {
 | 
				
			|||||||
    const sbxh = currentCdsb.sbbm || '00000000'
 | 
					    const sbxh = currentCdsb.sbbm || '00000000'
 | 
				
			||||||
    return sbxh
 | 
					    return sbxh
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  // 中心所有项目转换
 | 
					  // 中心所有项目转换
 | 
				
			||||||
  getTranslateProject = () => {
 | 
					  getTranslateProject = () => {
 | 
				
			||||||
    // const {testKmItems} = this;
 | 
					    // const {testKmItems} = this;
 | 
				
			||||||
@ -713,13 +694,11 @@ export default class Judge {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    return arr.map(numStr => parseInt(numStr, 2));
 | 
					    return arr.map(numStr => parseInt(numStr, 2));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  // 获取考试项目详情
 | 
					  // 获取考试项目详情
 | 
				
			||||||
  getProjectInfo = (projectCode) => {
 | 
					  getProjectInfo = (projectCode) => {
 | 
				
			||||||
    const judgeUI = this.judgeUI;
 | 
					    const judgeUI = this.judgeUI;
 | 
				
			||||||
    return judgeUI.projectsObj[projectCode]
 | 
					    return judgeUI.projectsObj[projectCode]
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  // 获取模型数据
 | 
					  // 获取模型数据
 | 
				
			||||||
  getModelData = (modelName) => {
 | 
					  getModelData = (modelName) => {
 | 
				
			||||||
    const modelPath = this.modelPath
 | 
					    const modelPath = this.modelPath
 | 
				
			||||||
@ -750,7 +729,6 @@ export default class Judge {
 | 
				
			|||||||
      itemno: itemno * 1,
 | 
					      itemno: itemno * 1,
 | 
				
			||||||
      type: 1
 | 
					      type: 1
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					 | 
				
			||||||
    console.info(judgeTag, `人工评判进入项目-${itemno}`)
 | 
					    console.info(judgeTag, `人工评判进入项目-${itemno}`)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@ -870,8 +848,6 @@ export default class Judge {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  public plcStr: string
 | 
					 | 
				
			||||||
  private judgeUI
 | 
					 | 
				
			||||||
  // 更改考试状态
 | 
					  // 更改考试状态
 | 
				
			||||||
  goVoiceAnnounce = async (event, xmdm, kf, xmjs) => {
 | 
					  goVoiceAnnounce = async (event, xmdm, kf, xmjs) => {
 | 
				
			||||||
    const {projectsObj,judgeConfigObj} = this.judgeUI;
 | 
					    const {projectsObj,judgeConfigObj} = this.judgeUI;
 | 
				
			||||||
@ -937,17 +913,14 @@ export default class Judge {
 | 
				
			|||||||
        break
 | 
					        break
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  // 获取plc数据
 | 
					  // 获取plc数据
 | 
				
			||||||
  getPlcData = async (plc: string) => {
 | 
					  getPlcData = async (plc: string) => {
 | 
				
			||||||
    const {fileLog,mndgStr,rmndg,wav} = this;
 | 
					    const {fileLog,mndgStr,rmndg} = this;
 | 
				
			||||||
    await fileLog.setPlcProgressData(plc)
 | 
					    await fileLog.setPlcProgressData(plc)
 | 
				
			||||||
    //plc字符串转化成评判初始化数据
 | 
					    //plc字符串转化成评判初始化数据
 | 
				
			||||||
    const tempData = await plcStrToJson(plc);
 | 
					    const tempData = await plcStrToJson(plc);
 | 
				
			||||||
    //模拟灯光回放时刻
 | 
					    //模拟灯光回放时刻
 | 
				
			||||||
    tempData.sensor.rmndg = rmndg;
 | 
					    tempData.sensor.rmndg = rmndg;
 | 
				
			||||||
    //模拟灯光单个灯光结束时刻
 | 
					 | 
				
			||||||
    tempData.sensor.wav = wav;
 | 
					 | 
				
			||||||
    //模拟灯灯光灯光项目
 | 
					    //模拟灯灯光灯光项目
 | 
				
			||||||
    tempData.sensor.mndg = mndgStr;
 | 
					    tempData.sensor.mndg = mndgStr;
 | 
				
			||||||
    //plc字符串转化成无锡所过程数据
 | 
					    //plc字符串转化成无锡所过程数据
 | 
				
			||||||
@ -958,7 +931,6 @@ export default class Judge {
 | 
				
			|||||||
    this.plcStr = plc;
 | 
					    this.plcStr = plc;
 | 
				
			||||||
    this.mndgStr = '';
 | 
					    this.mndgStr = '';
 | 
				
			||||||
    this.rmndg = 0;
 | 
					    this.rmndg = 0;
 | 
				
			||||||
    this.wav = 0;
 | 
					 | 
				
			||||||
    globalThis.msgStr = plc
 | 
					    globalThis.msgStr = plc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return tempData
 | 
					    return tempData
 | 
				
			||||||
@ -966,7 +938,6 @@ export default class Judge {
 | 
				
			|||||||
  // 处理轨迹plc信号
 | 
					  // 处理轨迹plc信号
 | 
				
			||||||
  handleTrajectoryUdp = async (strArr) => {
 | 
					  handleTrajectoryUdp = async (strArr) => {
 | 
				
			||||||
    const {fileLog} = this;
 | 
					    const {fileLog} = this;
 | 
				
			||||||
    console.log('kkkkk')
 | 
					 | 
				
			||||||
    let num = 2;
 | 
					    let num = 2;
 | 
				
			||||||
    const {usbService} = this;
 | 
					    const {usbService} = this;
 | 
				
			||||||
    const judgeTimer = setInterval(async () => {
 | 
					    const judgeTimer = setInterval(async () => {
 | 
				
			||||||
@ -1094,7 +1065,8 @@ export default class Judge {
 | 
				
			|||||||
      judgeUI.projectsObj = deepClone(copyProjectsObj)
 | 
					      judgeUI.projectsObj = deepClone(copyProjectsObj)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  public plcStr: string
 | 
				
			||||||
 | 
					  private judgeUI
 | 
				
			||||||
  private fileLog
 | 
					  private fileLog
 | 
				
			||||||
  private totalScore: number
 | 
					  private totalScore: number
 | 
				
			||||||
  private folderPath: string
 | 
					  private folderPath: string
 | 
				
			||||||
@ -1102,7 +1074,6 @@ export default class Judge {
 | 
				
			|||||||
  private avPlayer
 | 
					  private avPlayer
 | 
				
			||||||
  private carztStr: string
 | 
					  private carztStr: string
 | 
				
			||||||
  private rmndg: 0 | 1
 | 
					  private rmndg: 0 | 1
 | 
				
			||||||
  private wav: 0 | 1
 | 
					 | 
				
			||||||
  private mndgStr: string | undefined
 | 
					  private mndgStr: string | undefined
 | 
				
			||||||
  // 模拟灯光
 | 
					  // 模拟灯光
 | 
				
			||||||
  setMndg = async (mndgStr: string) => {
 | 
					  setMndg = async (mndgStr: string) => {
 | 
				
			||||||
 | 
				
			|||||||
@ -3,6 +3,7 @@ import onvifclient from '@ohos.onvifclient';
 | 
				
			|||||||
import fs from '@ohos.file.fs'
 | 
					import fs from '@ohos.file.fs'
 | 
				
			||||||
import util from '@ohos.util';
 | 
					import util from '@ohos.util';
 | 
				
			||||||
import FileUtil from '../../../common/utils/File'
 | 
					import FileUtil from '../../../common/utils/File'
 | 
				
			||||||
 | 
					import { takePhoto } from '../../../common/service/videoService';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface Params{
 | 
					interface Params{
 | 
				
			||||||
  userName:string
 | 
					  userName:string
 | 
				
			||||||
@ -33,39 +34,9 @@ export default class FilePhoto{
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  public async getPhoto(){
 | 
					  public async getPhoto(){
 | 
				
			||||||
    const {params,context,fileUtil} = this;
 | 
					    const {params,context,fileUtil} = this;
 | 
				
			||||||
    const {userName,pwd,ip,port,rlls} = params;
 | 
					    return new Promise(async (reslove)=>{
 | 
				
			||||||
    const mediaTest = mediaLibrary.getMediaLibrary(context);
 | 
					      const data=await takePhoto(params,context,'jt/',1)
 | 
				
			||||||
    let mediaType = mediaLibrary.MediaType.IMAGE;
 | 
					      reslove(data.base64)
 | 
				
			||||||
    let DIR_DOCUMENTS = mediaLibrary.DirectoryType.DIR_IMAGE;
 | 
					 | 
				
			||||||
    const path = await mediaTest.getPublicDirectory(DIR_DOCUMENTS);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return new Promise(async (resolve)=>{
 | 
					 | 
				
			||||||
      mediaTest.createAsset(mediaType, 'judge_face.jpg', path,(error,asset)=>{
 | 
					 | 
				
			||||||
        asset.open('rw', (error, fd) => {
 | 
					 | 
				
			||||||
          if (fd > 0) {
 | 
					 | 
				
			||||||
            const file_path = "/mnt/hmdfs/100/account/device_view/local/files/Pictures/judge_face.jpg"
 | 
					 | 
				
			||||||
            const result3 = onvifclient.getVideoSnapshot(`rtsp://${userName}:${pwd}@${ip}:${port}/h264/ch${rlls}/main/av_stream`,file_path,fd);
 | 
					 | 
				
			||||||
            fs.closeSync(fd);
 | 
					 | 
				
			||||||
            asset.close(fd);
 | 
					 | 
				
			||||||
            fs.lstat(file_path).then((stat) => {
 | 
					 | 
				
			||||||
              console.info("get link status succeed, the size of file is" + stat.size);
 | 
					 | 
				
			||||||
              let file = fs.openSync(file_path, fs.OpenMode.READ_WRITE);
 | 
					 | 
				
			||||||
              const size=Number(stat.size)+100
 | 
					 | 
				
			||||||
              let buf = new ArrayBuffer(size);
 | 
					 | 
				
			||||||
              let num = fs.readSync(file.fd, buf);
 | 
					 | 
				
			||||||
              const that = new util.Base64();
 | 
					 | 
				
			||||||
              const array = new Uint8Array(buf);
 | 
					 | 
				
			||||||
              const result = that.encodeToStringSync(array);//base64圖片
 | 
					 | 
				
			||||||
              fileUtil.deleteF(file_path,3)
 | 
					 | 
				
			||||||
              resolve(result)
 | 
					 | 
				
			||||||
            }).catch((err) => {
 | 
					 | 
				
			||||||
              console.info("get link status failed with error message: " + err.message + ", error code: " + err.code);
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
          } else {
 | 
					 | 
				
			||||||
            console.error('baoyihu getVideoSnapshot File Open failed with error: ' + error);
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user