@ -15,7 +15,6 @@ import { uploadExamProgressData, writeObjectOut } from '../../api/judge';
 
		
	
		
			
				import  UsbService  from  '../../common/service/usbService' ;  
		
	
		
			
				import  {  KF ,  LANE  }  from  '../judgeSDK/api/judgeSDK.d' ;  
		
	
		
			
				import  {  endRecordVideo ,  saveStartRecordVideo  }  from  '../../common/service/videoService' ;  
		
	
		
			
				
 
		
	
		
			
				import  {  
		
	
		
			
				  Array2Byte , 
 
		
	
		
			
				  convertGpsCoord2 , 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -55,7 +54,9 @@ import {
 
		
	
		
			
				  examJudgeVersion 
 
		
	
		
			
				}  from  './api/index' ;  
		
	
		
			
				import  {  getSyncData ,  upDateTableByArray  }  from  '../../common/service/initable' ;  
		
	
		
			
				import  {  GlobalConfig  }  from  '../../config' ;  
		
	
		
			
				import  promptAction  from  '@ohos.promptAction' ;  
		
	
		
			
				import  Want  from  '@ohos.app.ability.Want' ;  
		
	
		
			
				
 
		
	
		
			
				const  judgeTag  =  'SURENJUN_JUDGE'  
		
	
		
			
				
 
		
	
		
			
				function  ifNeedRetry ( code : number  |  string ) :  boolean  {  
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -65,6 +66,7 @@ function ifNeedRetry(code: number | string): boolean {
 
		
	
		
			
				  } 
 
		
	
		
			
				  return  false 
 
		
	
		
			
				}  
		
	
		
			
				
 
		
	
		
			
				export  default  class  Judge  {  
		
	
		
			
				  // 过程照片拍照
 
 
		
	
		
			
				  getPhoto  =  async  ( empty? : boolean )  = >  { 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -115,7 +117,7 @@ export default class Judge {
 
		
	
		
			
				    const  examDataArr  =  examDataStr . split ( '\n' ) ; 
 
		
	
		
			
				    for  ( let  examDataStr  of  examDataArr )  { 
 
		
	
		
			
				      const  examData  =  JSON . parse ( examDataStr ) 
 
		
	
		
			
				      const  code  =  await  writeObjectOut ( examData ; 
 
		
	
		
			
				      const  code  =  await  writeObjectOut ( examData , false  ); 
 
		
	
		
			
				    } 
 
		
	
		
			
				  } 
 
		
	
		
			
				  //上传无锡所过程数据
 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -166,15 +168,17 @@ export default class Judge {
 
		
	
		
			
				      map_point_item : mapPointItemArr , 
 
		
	
		
			
				      //科目三暂时为空
 
 
		
	
		
			
				      iteminfo :  [ ] , 
 
		
	
		
			
				      roads : getModelData ( ' Roads.txt') , 
 
		
	
		
			
				      sharps : getModelData ( ' Sharps.txt') 
 
		
	
		
			
				      roads : getModelData ( ' km3/ Roads.txt') , 
 
		
	
		
			
				      sharps : getModelData ( ' km3/ Sharps.txt') 
 
		
	
		
			
				    } 
 
		
	
		
			
				  } 
 
		
	
		
			
				  // 处理特殊参数配置
 
 
		
	
		
			
				  handleSEP  =  async  ( code : number )  = >  { 
 
		
	
		
			
				    const  { judgeUI : { 
 
		
	
		
			
				    const  { 
 
		
	
		
			
				      judgeUI : { 
 
		
	
		
			
				        judgeConfigObj 
 
		
	
		
			
				    } , avPlayer }  =  this ; 
 
		
	
		
			
				      } ,  avPlayer 
 
		
	
		
			
				    }  =  this ; 
 
		
	
		
			
				    const  {  examSubject  }  =  globalThis . carInfo ; 
 
		
	
		
			
				
 
		
	
		
			
				    switch  ( code )  { 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -240,6 +244,7 @@ export default class Judge {
 
		
	
		
			
				  } 
 
		
	
		
			
				  // 处理udp plc信号
 
 
		
	
		
			
				  handleUdp  =  async  ( msg )  = >  { 
 
		
	
		
			
				    console . info ( 'plc信号' ,  msg ) 
 
		
	
		
			
				    const  {  fileLog ,  getPlcData ,  usbService ,  isUdpEnd ,  isExamEnd ,  judgeUI  }  =  this 
 
		
	
		
			
				    const  stachArr  =  msg . split ( ',' ) 
 
		
	
		
			
				    if  ( stachArr [ 0 ]  !=  '#DN_GD'  ||  isUdpEnd )  { 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -260,23 +265,20 @@ export default class Judge {
 
		
	
		
			
				    this . judgeUI . dw  =  ( Math . floor ( plcData . sensor . dw  as  number )  ||  0 )  +  '' 
 
		
	
		
			
				    //TODO 暂时关闭差分检测异常
 
 
		
	
		
			
				    // await this.checkDwzt(plcData.gps.dwzt,plcData.gps.jdzt);
 
 
		
	
		
			
				    if  ( ! isExamEnd )  { 
 
		
	
		
			
				      await  examJudgeRealExam ( plcData ) 
 
		
	
		
			
				    } 
 
		
	
		
			
				    const  udpIndex  =  globalThis . udpIndex ; 
 
		
	
		
			
				    let  [ prevJd ,  preWd ]  =  [ 0 ,  0 ] 
 
		
	
		
			
				    if  ( udpIndex  %  5  ===  0  &&  ! isUdpEnd )  { 
 
		
	
		
			
				      const  judgeUdp  =  globalThis . judgeUdp 
 
		
	
		
			
				      const  bytes  =  await  this . getMessageHeartbeat ( isExamEnd ) ; 
 
		
	
		
			
				      judgeUdp . send ( bytes ) 
 
		
	
		
			
				    } 
 
		
	
		
			
				    if  ( ! isExamEnd )  { 
 
		
	
		
			
				      console . info ( judgeTag ,  'start examJudgeRealExam' ) 
 
		
	
		
			
				      await  examJudgeRealExam ( plcData ) 
 
		
	
		
			
				      console . info ( judgeTag ,  'end examJudgeRealExam' ) 
 
		
	
		
			
				    } 
 
		
	
		
			
				    let  [ prevJd ,  preWd ]  =  [ 0 ,  0 ] 
 
		
	
		
			
				    globalThis . udpIndex  +=  1 
 
		
	
		
			
				  } 
 
		
	
		
			
				  private  fileLog 
 
		
	
		
			
				  private  filePath 
 
		
	
		
			
				  private  bklx : number  =  0 
 
		
	
		
			
				  private  totalScore : number 
 
		
	
		
			
				  private  prevJd : number  =  0 
 
		
	
		
			
				  private  prevWd : number  =  0 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -285,7 +287,7 @@ export default class Judge {
 
		
	
		
			
				  private  modelPath : string 
 
		
	
		
			
				  private  avPlayer 
 
		
	
		
			
				  private  carztStr : string 
 
		
	
		
			
				  private  rmndg : 0  |  1  |  2  
 
		
	
		
			
				  private  rmndg : 0  |  1 
 
		
	
		
			
				  private  mndgStr : string  |  undefined 
 
		
	
		
			
				  // 模拟灯光
 
 
		
	
		
			
				  setMndg  =  async  ( mndgStr : string )  = >  { 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -319,7 +321,7 @@ export default class Judge {
 
		
	
		
			
				    const  tJD  =  convertGpsCoord2 ( jd ) 
 
		
	
		
			
				    const  tWD  =  convertGpsCoord2 ( wd ) 
 
		
	
		
			
				    const  {  prevJd ,  prevWd  }  =  this 
 
		
	
		
			
				    if  ( prevJd  &&  dwzt  ==  4  &&  jdzt  ==  3  &&  ! globalThis . singlePlay  )  { 
 
		
	
		
			
				    if  ( prevJd  &&  dwzt  ==  4  &&  jdzt  ==  3 )  { 
 
		
	
		
			
				      const  distance  =  await  examCalcGpsDistance ( { 
 
		
	
		
			
				        jd1 : prevJd , 
 
		
	
		
			
				        wd1 : prevWd , 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -328,7 +330,7 @@ export default class Judge {
 
		
	
		
			
				        h : hxj  ||  1 , 
 
		
	
		
			
				      } ) 
 
		
	
		
			
				      //@ts-ignore
 
 
		
	
		
			
				      // globalThis.distanceClass?.setTimeData(((distance / 100).toFixed(2)) * 1)
 
 
		
	
		
			
				      globalThis . distanceClass ? . setTimeData ( ( ( distance  /  100 ) . toFixed ( 2 ) )  *  1 ) 
 
		
	
		
			
				    } 
 
		
	
		
			
				    this . prevJd  =  tJD ; 
 
		
	
		
			
				    this . prevWd  =  tWD ; 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -336,7 +338,7 @@ export default class Judge {
 
		
	
		
			
				  private  performInfo : any 
 
		
	
		
			
				  private  isEndTip : boolean  =  false ; 
 
		
	
		
			
				  private  deductedPopShowTimer : number  =  0 ; 
 
		
	
		
			
				
 
		
	
		
			
				  // 校验考试是否结束  
 
		
	
		
			
				  // 校验考试是否结束
 
 
		
	
		
			
				  checkExamIsEnd  = 
 
		
	
		
			
				    async  ( isManual? : boolean )  = >  { 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -468,8 +470,6 @@ export default class Judge {
 
		
	
		
			
				  //所有的科目考试项目(大车&小车)
 
 
		
	
		
			
				  private  testKmItems : any 
 
		
	
		
			
				  private  plcData : any 
 
		
	
		
			
				  //特殊扣分标记
 
 
		
	
		
			
				  private  specialkf :string  =  '' 
 
		
	
		
			
				  // 获取plc数据
 
 
		
	
		
			
				  getPlcData  =  async  ( plc : string )  = >  { 
 
		
	
		
			
				    const  {  fileLog ,  mndgStr ,  rmndg  }  =  this ; 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -500,7 +500,6 @@ export default class Judge {
 
		
	
		
			
				      const  msgStr  =  strArr [ num ] ; 
 
		
	
		
			
				      if  ( msgStr  ==  '' )  { 
 
		
	
		
			
				        console . info ( judgeTag ,  '模拟数据考试结束' ) 
 
		
	
		
			
				        globalThis . windowClass . setWindowSystemBarEnable ( [ 'navigation' ] ) 
 
		
	
		
			
				        clearInterval ( judgeTimer ) 
 
		
	
		
			
				        this . checkExamIsEnd ( true ) 
 
		
	
		
			
				        return 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -521,14 +520,11 @@ export default class Judge {
 
		
	
		
			
				      if  ( msg . method  ===  'examJudgeArtificialMark' )  { 
 
		
	
		
			
				        setJudgeItem ( msg . itemno ,  msg . serial ) 
 
		
	
		
			
				      } 
 
		
	
		
			
				      msg . sensor . rmndg  =  this . rmndg 
 
		
	
		
			
				      await  fileLog . setExamJudgeData ( msg ) 
 
		
	
		
			
				      await  examJudgeRealExam ( msg ) 
 
		
	
		
			
				      this . rmndg  =  0 
 
		
	
		
			
				      const  bytes  =  await  this . getMessageHeartbeat ( ) ; 
 
		
	
		
			
				      bytes  &&  globalThis . judgeUdp . send ( bytes ) 
 
		
	
		
			
				
 
		
	
		
			
				    } ,  5 0) 
 
		
	
		
			
				    } ,  20 0) 
 
		
	
		
			
				
 
		
	
		
			
				    globalThis . judgeTimer  =  judgeTimer ; 
 
		
	
		
			
				  } 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -540,17 +536,19 @@ export default class Judge {
 
		
	
		
			
				  // 调代理接口是否断网了
 
 
		
	
		
			
				  private  isJudgeDisConnect : boolean ; 
 
		
	
		
			
				  // 项目开始接口同步
 
 
		
	
		
			
				  beginProject  =  async  ( ksxm ,xmxh? :string  ) = >  { 
 
		
	
		
			
				  beginProject  =  async  ( ksxm = >  { 
 
		
	
		
			
				    const  carInfo  =  globalThis . carInfo ; 
 
		
	
		
			
				    const  {  examSubject ,  plateNo  }  =  carInfo ; 
 
		
	
		
			
				    const  { judgeUI , fileLog , getSbbm , filePath }  =  this ; 
 
		
	
		
			
				    const  {   judgeUI ,   fileLog ,   getSbbm ,  xmxh ,   filePath   }  =  this ; 
 
		
	
		
			
				    const  {  lsh ,  idCard ,  serialNumber ,  projectsObj ,  ksdd ,  kslx ,  xldm  }  =  judgeUI 
 
		
	
		
			
				    const  time  =  await  getCurrentTime ( ) ; 
 
		
	
		
			
				    const  project  =  projectsObj [ ksxm ] 
 
		
	
		
			
				    const  sbxh  =  getSbbm ( ksxm ,  xmxh  ||  this . xmxh  ) 
 
		
	
		
			
				    const  sbxh  =  getSbbm ( ksxm ,  xmxh ) 
 
		
	
		
			
				    const  data  =  { 
 
		
	
		
			
				      //系统类别   接口序列号             接口标识
 
 
		
	
		
			
				      xtlb :  '17' ,  jkxlh : serialNumber ,  jkid :  '17C52' , 
 
		
	
		
			
				      xtlb :  '17' , 
 
		
	
		
			
				      jkxlh : serialNumber , 
 
		
	
		
			
				      jkid :  '17C52' , 
 
		
	
		
			
				      drvexam :  { 
 
		
	
		
			
				        //   考试科目            身份证号码
 
 
		
	
		
			
				        lsh , 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -574,18 +572,20 @@ export default class Judge {
 
		
	
		
			
				    promptWxCode ( '17C52' ,  code ) 
 
		
	
		
			
				  } 
 
		
	
		
			
				  // 项目结束接口同步
 
 
		
	
		
			
				  endProject  =  async  ( ksxm ,xmxh? :string  ) = >  { 
 
		
	
		
			
				  endProject  =  async  ( ksxm = >  { 
 
		
	
		
			
				    const  carInfo  =  globalThis . carInfo ; 
 
		
	
		
			
				    const  deviceNo  =  globalThis . deviceNo ; 
 
		
	
		
			
				    const  {  examSubject ,  plateNo ,  carNo  }  =  carInfo ; 
 
		
	
		
			
				    const  { judgeUI , fileLog , getSbxh , getSbbm , filePath }  =  this ; 
 
		
	
		
			
				    const  {   judgeUI ,   fileLog ,   getSbxh ,  xmxh ,   getSbbm ,   filePath   }  =  this ; 
 
		
	
		
			
				    const  {  lsh ,  idCard ,  serialNumber ,  projectsObj ,  cdsbInfoObj ,  ksdd ,  kslx ,  xldm ,  }  =  judgeUI 
 
		
	
		
			
				    const  time  =  await  getCurrentTime ( ) ; 
 
		
	
		
			
				    const  project  =  projectsObj [ ksxm ] 
 
		
	
		
			
				    const  sbxh  =  examSubject  ==  3  ?  undefined  :  getSbbm ( ksxm ,  xmxh  ||  this . xmxh  ) 
 
		
	
		
			
				    const  sbxh  =  examSubject  ==  3  ?  undefined  :  getSbbm ( ksxm ,  xmxh ) 
 
		
	
		
			
				
 
		
	
		
			
				    const  data  =  { 
 
		
	
		
			
				      xtlb :  '17' ,  jkxlh : serialNumber ,  jkid :  '17C55' , 
 
		
	
		
			
				      xtlb :  '17' , 
 
		
	
		
			
				      jkxlh : serialNumber , 
 
		
	
		
			
				      jkid :  '17C55' , 
 
		
	
		
			
				      drvexam :  { 
 
		
	
		
			
				        lsh , 
 
		
	
		
			
				        kskm : examSubject , 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -602,56 +602,12 @@ export default class Judge {
 
		
	
		
			
				      } 
 
		
	
		
			
				    } 
 
		
	
		
			
				    const  {  code  }  =  await  this . sendWriteObjectOut ( data ,  filePath ) 
 
		
	
		
			
				
 
		
	
		
			
				    //科三 & 432=3
 
 
		
	
		
			
				    if ( examSubject  ==  3  &&  this . judgeUI . judgeConfigObj [ '432' ]  ==  2 ) { 
 
		
	
		
			
				      this . judgeUI . uploadMileage ( ) 
 
		
	
		
			
				    } 
 
		
	
		
			
				
 
		
	
		
			
				    if  ( code  ===  2300007 )  { 
 
		
	
		
			
				      this . isJudgeDisConnect  =  true ; 
 
		
	
		
			
				    } 
 
		
	
		
			
				    console . info ( judgeTag ,  '项目结束 end' ) 
 
		
	
		
			
				    promptWxCode ( '17C55' ,  code ) 
 
		
	
		
			
				  } 
 
		
	
		
			
				  private  artSubject3ProjectsCodesArr : number [ ]  =  [ 3 ,  9 ,  4 ,  10 ,  12 ,  11 ] 
 
		
	
		
			
				  private  lane : LANE  =  { 
 
		
	
		
			
				    road :  '' ,  num : 0 ,  count : 0 
 
		
	
		
			
				  } 
 
		
	
		
			
				  private  videoData : any 
 
		
	
		
			
				  private  disConnectNum : number  =  0 ; 
 
		
	
		
			
				  //调用监管接口
 
 
		
	
		
			
				
 
		
	
		
			
				  //调用监管接口
 
 
		
	
		
			
				  sendWriteObjectOut  =  async  ( data ,  filePath )  = >  { 
 
		
	
		
			
				    const  temp  =  await  writeObjectOut ( data ,  filePath ) ; 
 
		
	
		
			
				    console . log ( "wzj" ,  JSON . stringify ( temp ) ) 
 
		
	
		
			
				    if  ( this . disConnectNum  ==  0 )  { 
 
		
	
		
			
				      console . log ( "wzj" ,  "第一次发送" ,  JSON . stringify ( data ) ) 
 
		
	
		
			
				    } 
 
		
	
		
			
				    if  ( this . disConnectNum  <  5  &&  this . disConnectNum  >  0 )  { 
 
		
	
		
			
				      console . log ( "wzj" ,  "第"  +  this . disConnectNum  +  "次重新发送" ,  JSON . stringify ( data ) ) 
 
		
	
		
			
				    } 
 
		
	
		
			
				    // 不是成功的接口就需要补传
 
 
		
	
		
			
				    if  ( ifNeedRetry ( temp . code ) )  { 
 
		
	
		
			
				      this . disConnectNum  +=  1 ; 
 
		
	
		
			
				      if  ( this . disConnectNum  <  5 )  { 
 
		
	
		
			
				        if  ( temp . code  ==  2300028 )  { 
 
		
	
		
			
				          await  new  Promise ( resolve  = >  setTimeout ( resolve ,  2000 ) ) ;  // 延迟1秒
 
 
		
	
		
			
				        } 
 
		
	
		
			
				        return  await  this . sendWriteObjectOut ( data ,  filePath ) 
 
		
	
		
			
				      } 
 
		
	
		
			
				    } 
 
		
	
		
			
				
 
		
	
		
			
				    if  ( this . disConnectNum  >=  5 )  { 
 
		
	
		
			
				      console . info ( 'surenjun' ,  '123' ) 
 
		
	
		
			
				      this . judgeUI . errorMsg  =  '当前的考试过程信息网络传输异常,程序点击确认将重启!' ; 
 
		
	
		
			
				      this . judgeUI . disConnectErrorOpen  =  true 
 
		
	
		
			
				    } 
 
		
	
		
			
				
 
		
	
		
			
				    this . disConnectNum  =  0 
 
		
	
		
			
				    return  temp 
 
		
	
		
			
				  } 
 
		
	
		
			
				  // 考试过程照片
 
 
		
	
		
			
				  uploadProgressPhoto  =  async  ( ksxm )  = >  { 
 
		
	
		
			
				    const  time  =  await  getCurrentTime ( ) ; 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -664,7 +620,9 @@ export default class Judge {
 
		
	
		
			
				    const  project  =  projectsObj [ ksxm ] 
 
		
	
		
			
				
 
		
	
		
			
				    const  data  =  { 
 
		
	
		
			
				      xtlb :  '17' ,  jkxlh : serialNumber ,  jkid :  '17C54' , 
 
		
	
		
			
				      xtlb :  '17' , 
 
		
	
		
			
				      jkxlh : serialNumber , 
 
		
	
		
			
				      jkid :  '17C54' , 
 
		
	
		
			
				      drvexam :  { 
 
		
	
		
			
				        lsh , 
 
		
	
		
			
				        kskm : examSubject , 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -685,6 +643,12 @@ export default class Judge {
 
		
	
		
			
				    promptWxCode ( '17C54' ,  code ) 
 
		
	
		
			
				    console . info ( judgeTag ,  '上传照片 end' ) 
 
		
	
		
			
				  } 
 
		
	
		
			
				  private  artSubject3ProjectsCodesArr : number [ ]  =  [ 3 ,  9 ,  4 ,  10 ,  12 ,  11 ] 
 
		
	
		
			
				  private  lane : LANE  =  { 
 
		
	
		
			
				    road :  '' ,  num : 0 ,  count : 0 
 
		
	
		
			
				  } 
 
		
	
		
			
				  private  videoData : any 
 
		
	
		
			
				  private  disConnectNum : number  =  0 ; 
 
		
	
		
			
				
 
		
	
		
			
				  constructor ( judgeUI )  { 
 
		
	
		
			
				    this . serialIndex  =  1 ; 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -705,9 +669,9 @@ export default class Judge {
 
		
	
		
			
				    this . carztStr  =  '' ; 
 
		
	
		
			
				    this . testKmItems  =  { } ; 
 
		
	
		
			
				    // 考试回放配置
 
 
		
	
		
			
				    const  { isTrajectoryOpen , trajectoryPath }  =  judgeConfig 
 
		
	
		
			
				    const  {   isTrajectoryOpen ,  modelPath ,   trajectoryPath   }  =  judgeConfig 
 
		
	
		
			
				    this . isTrajectoryOpen  =  isTrajectoryOpen ; 
 
		
	
		
			
				    this . modelPath  =  'models' ; 
 
		
	
		
			
				    this . modelPath  =  modelPath ; 
 
		
	
		
			
				    this . trajectoryPath  =  trajectoryPath ; 
 
		
	
		
			
				
 
		
	
		
			
				    this . isExam  =  ! this . judgeUI . singlePlay ; 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -729,49 +693,97 @@ export default class Judge {
 
		
	
		
			
				    this . isExamEnd  =  false ; 
 
		
	
		
			
				  } 
 
		
	
		
			
				
 
		
	
		
			
				  private  externalTransmission : boolean  =  false 
 
		
	
		
			
				  // 计算是否启动
 
 
		
	
		
			
				  private  whetherToStart : boolean 
 
		
	
		
			
				  //调用监管接口
 
 
		
	
		
			
				  sendWriteObjectOut  =  async  ( data ,  filePath )  = >  { 
 
		
	
		
			
				    const  temp  =  await  writeObjectOut ( data ,  this . externalTransmission ,  filePath ) ; 
 
		
	
		
			
				    console . log ( "wzj" ,  JSON . stringify ( temp ) ) 
 
		
	
		
			
				    if  ( this . disConnectNum  ==  0 )  { 
 
		
	
		
			
				      console . log ( "wzj" ,  "第一次发送" ,  JSON . stringify ( data ) ) 
 
		
	
		
			
				    } 
 
		
	
		
			
				    if  ( this . disConnectNum  <  5  &&  this . disConnectNum  >  0 )  { 
 
		
	
		
			
				      console . log ( "wzj" ,  "第"  +  this . disConnectNum  +  "次重新发送" ,  JSON . stringify ( data ) ) 
 
		
	
		
			
				    } 
 
		
	
		
			
				    // 不是成功的接口就需要补传
 
 
		
	
		
			
				    if  ( ifNeedRetry ( temp . code ) )  { 
 
		
	
		
			
				      this . disConnectNum  +=  1 ; 
 
		
	
		
			
				      if  ( this . disConnectNum  <  5 )  { 
 
		
	
		
			
				        if  ( temp . code  ==  2300028 )  { 
 
		
	
		
			
				          await  new  Promise ( resolve  = >  setTimeout ( resolve ,  2000 ) ) ;  // 延迟1秒
 
 
		
	
		
			
				        } 
 
		
	
		
			
				        return  await  this . sendWriteObjectOut ( data ,  filePath ) 
 
		
	
		
			
				      } 
 
		
	
		
			
				      if  ( this . disConnectNum  >=  5 )  { 
 
		
	
		
			
				        this . externalTransmission  =  true 
 
		
	
		
			
				        let  want : Want  =  { 
 
		
	
		
			
				          bundleName :  'com.oh.upload' ,  // 替换为你的应用包名
 
 
		
	
		
			
				          abilityName :  'EntryAbility' ,  // 你的 Service Ability 名称
 
 
		
	
		
			
				          moduleName :  'entry' ,  // 你的模块名称,通常是 'entry',
 
 
		
	
		
			
				          parameters :  { } 
 
		
	
		
			
				        } ; 
 
		
	
		
			
				        try  { 
 
		
	
		
			
				          let  context  =  this . judgeUI . context ; 
 
		
	
		
			
				          context . startAbility ( want ) 
 
		
	
		
			
				            . then ( ( )  = >  { 
 
		
	
		
			
				            } ) 
 
		
	
		
			
				            . catch ( ( error )  = >  { 
 
		
	
		
			
				              console . error ( ` 拉起应用失败:  ${ error . code }  -  ${ error . message } ` ) ; 
 
		
	
		
			
				            } ) ; 
 
		
	
		
			
				        }  catch  ( error )  { 
 
		
	
		
			
				          console . error ( ` 启动Ability异常:  ${ error . message } ` ) ; 
 
		
	
		
			
				        } 
 
		
	
		
			
				        return  await  this . sendWriteObjectOut ( data ,  filePath ) 
 
		
	
		
			
				      } 
 
		
	
		
			
				    } 
 
		
	
		
			
				
 
		
	
		
			
				    if  ( this . disConnectNum  >=  5 )  { 
 
		
	
		
			
				      console . info ( 'surenjun' ,  '123' ) 
 
		
	
		
			
				      this . judgeUI . errorMsg  =  '当前的考试过程信息网络传输异常,程序点击确认将重启!' ; 
 
		
	
		
			
				      this . judgeUI . disConnectErrorOpen  =  true 
 
		
	
		
			
				
 
		
	
		
			
				    } 
 
		
	
		
			
				
 
		
	
		
			
				    this . disConnectNum  =  0 
 
		
	
		
			
				    return  temp 
 
		
	
		
			
				  } 
 
		
	
		
			
				
 
		
	
		
			
				  public  async  onJudgeFn ( fn : Function )  { 
 
		
	
		
			
				    await  this . judging ( fn ) 
 
		
	
		
			
				  } 
 
		
	
		
			
				
 
		
	
		
			
				  // 获取评判初始化数据
 
 
		
	
		
			
				  getJudgeInitData  =  async  ( )  = >  { 
 
		
	
		
			
				    const  { getModelData , getKm3JudgeInitConfig , bklx }  =  this 
 
		
	
		
			
				    const  {  getModelData ,  getKm3JudgeInitConfig   }  =  this 
 
		
	
		
			
				    const  carInfo  =  globalThis . carInfo ; 
 
		
	
		
			
				    const  {  examSubject ,  plateNo ,  carId  }  =  carInfo ; 
 
		
	
		
			
				    const  judgeUI  =  this . judgeUI 
 
		
	
		
			
				    const  {  projectsObj ,  itemInfoObj ,  markRuleListObj ,  carType ,  carName ,  systemparmArr ,  carinfoArr  }  =  judgeUI 
 
		
	
		
			
				    const  examType  =  examSubject  ==  2  ?  'km2'  :  'km3' 
 
		
	
		
			
				    const  fileUtil  =  new  FileUtil ( globalThis . context ) 
 
		
	
		
			
				    const  ipConfigStr  =  await  fileUtil . readFile ( GlobalConfig . comoonfileWriteAddress  +  '/config/ipConfig.txt' ) ; 
 
		
	
		
			
				    const  ipConfig  =  JSON . parse ( ipConfigStr ) 
 
		
	
		
			
				
 
		
	
		
			
				    let  allitems  =  [ ] ; 
 
		
	
		
			
				    if  ( examSubject  ==  2 )  { 
 
		
	
		
			
				      allitems  =  Reflect . ownKeys ( itemInfoObj ) . map ( cdsbKey  = >  { 
 
		
	
		
			
				        const  cdsb  =  itemInfoObj [ cdsbKey ] ; 
 
		
	
		
			
				        const  {  xmdm ,  xmxh ,  modelKey  }  =  cdsb 
 
		
	
		
			
				        const  modelVal =  getModelData ( ` ${ modelKey } .txt ` ) 
 
		
	
		
			
				        if ( modelVal ) { 
 
		
	
		
			
				        return  { 
 
		
	
		
			
				            xmdm ,  xmxh ,  model : modelVal 
 
		
	
		
			
				          xmdm ,  xmxh ,  model : getModelData ( ` ${ examType } / ${ modelKey } .txt ` ) 
 
		
	
		
			
				        } 
 
		
	
		
			
				        } else { 
 
		
	
		
			
				          return  undefined 
 
		
	
		
			
				        } 
 
		
	
		
			
				      } ) . filter ( item  = >  item  !==  undefined ) 
 
		
	
		
			
				      } ) 
 
		
	
		
			
				    } 
 
		
	
		
			
				    //获取版本号
 
 
		
	
		
			
				    const  sdkver  =  await  examJudgeVersion ( ) ; 
 
		
	
		
			
				    const  initInfo  =  { 
 
		
	
		
			
				      sdkver , 
 
		
	
		
			
				      appver : globalThis.version , 
 
		
	
		
			
				      appver : judgeConfig .version, 
 
		
	
		
			
				      kskm : examSubject  *  1 , 
 
		
	
		
			
				      kchp : plateNo , 
 
		
	
		
			
				      kchm : carId  *  1 , 
 
		
	
		
			
				      kscx : carType , 
 
		
	
		
			
				      cxcode :  '1' , 
 
		
	
		
			
				      name : carName , 
 
		
	
		
			
				      carmodel : getModelData ( ` ${ carType } .txt ` ) , 
 
		
	
		
			
				      carmodel : getModelData ( ` ${ examType} / ${  carType} .txt ` ) , 
 
		
	
		
			
				      allitems , 
 
		
	
		
			
				      iteminfo :  [ ] , 
 
		
	
		
			
				      systemparm : systemparmArr , 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -780,8 +792,6 @@ export default class Judge {
 
		
	
		
			
				      itemInfoObj , 
 
		
	
		
			
				      carlist : judgeUI.carlist , 
 
		
	
		
			
				      carinfo : carinfoArr , 
 
		
	
		
			
				      //板卡类型
 
 
		
	
		
			
				      bklx , 
 
		
	
		
			
				    } ; 
 
		
	
		
			
				    let  km3Config  =  { } 
 
		
	
		
			
				
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -803,7 +813,8 @@ export default class Judge {
 
		
	
		
			
				    const  {  sczb ,  kfdm  }  =  currentParams ; 
 
		
	
		
			
				    const  {  isExam  }  =  this ; 
 
		
	
		
			
				    const  judgeUI  =  this . judgeUI 
 
		
	
		
			
				    const  { projects , carType , kssycs , isDdxk , ddxkTime , projectsCenterObj , ddxkKsxmArr , ddxkKfArr , passingScore }  =  judgeUI ; 
 
		
	
		
			
				    const  {  projects ,  carType ,  kssycs ,  isDdxk ,  ddxkTime ,  projectsCenterObj ,  ddxkKsxmArr ,  ddxkKfArr ,  passingScore  }  = 
 
		
	
		
			
				      judgeUI ; 
 
		
	
		
			
				    const  beginInfo  =  { 
 
		
	
		
			
				      kgid :  '012' , 
 
		
	
		
			
				      kgxm : decodeURI ( examinerName  ||  '' ) , 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -841,15 +852,16 @@ export default class Judge {
 
		
	
		
			
				          xmdm : xmdm  *  1 ,  kfdm 
 
		
	
		
			
				        } 
 
		
	
		
			
				      } ) )  :  [ ] , 
 
		
	
		
			
				      yklc : judgeUI.yklc , 
 
		
	
		
			
				      //TODO 已考里程待修改
 
 
		
	
		
			
				      yklc : 0 , 
 
		
	
		
			
				      special :  [ ] , 
 
		
	
		
			
				      //TODO 科目三参数临时写死
 
 
		
	
		
			
				      sczb :  ( sczb  ===  undefined  ||  sczb  ==  0 )  ?  0  : 1 , 
 
		
	
		
			
				      sczbkf : kfdm , 
 
		
	
		
			
				      dmndg : false , 
 
		
	
		
			
				      mfxx : false , 
 
		
	
		
			
				      mfxxn : false , 
 
		
	
		
			
				      //科目三特殊扣分项
 
 
		
	
		
			
				      specialkf :judgeUI.specialkf , 
 
		
	
		
			
				      zeng : false 
 
		
	
		
			
				    } 
 
		
	
		
			
				    console . info ( judgeTag ,  '5.获取开始考试数据完成' ) 
 
		
	
		
			
				    return  beginInfo 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -957,7 +969,7 @@ export default class Judge {
 
		
	
		
			
				        const  {  examSubject  }  =  this . judgeUI 
 
		
	
		
			
				        const  xmdm  =  xmqx . xmdm ; 
 
		
	
		
			
				        const  xmmcCode  =  judgeUI . projectsObj [ xmdm ] . projectCodeCenter ; 
 
		
	
		
			
				        // const voiceCode = getKmProjectCancelVoice(examSubject, xmmcCode);
 
 
		
	
		
			
				        const  voiceCode  =  getKmProjectCancelVoice ( examSubject ,  xmmcCode ) ; 
 
		
	
		
			
				        // avPlayer.playAudio([`voice/${voiceCode}.mp3`],true)
 
 
		
	
		
			
				        this . judgeUI . projectsObj [ xmdm ] . type  =  '1' ; 
 
		
	
		
			
				        this . testKmItems [ xmmcCode ] . status  =  '1' ; 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1074,7 +1086,7 @@ export default class Judge {
 
		
	
		
			
				        if  ( ! isEnd )  { 
 
		
	
		
			
				          judgeTask . addTask ( async  ( )  = >  { 
 
		
	
		
			
				            console . info ( judgeTag ,  ` 项目开始- ${ xmdm } - ${ projectsObj [ xmdm ] . name } ` ) 
 
		
	
		
			
				            await  beginProject ( xmdm ,xmxh  )
 
		
	
		
			
				            await  beginProject ( xmdm 
 
		
	
		
			
				          } ,  { 
 
		
	
		
			
				            isDelay : true 
 
		
	
		
			
				          } ) 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1103,7 +1115,7 @@ export default class Judge {
 
		
	
		
			
				          if  ( ! projectIsEnd )  { 
 
		
	
		
			
				            judgeTask . addTask ( async  ( )  = >  { 
 
		
	
		
			
				              console . info ( judgeTag ,  ` 项目结束- ${ xmdm } - ${ projectsObj [ xmdm ] . name } ` ) 
 
		
	
		
			
				              await  endProject ( xmdm ,xmxh )  
 
		
	
		
			
				              await  endProject ( xmdm );  
 
		
	
		
			
				              this . xmmcSingleCode  =  0 ; 
 
		
	
		
			
				              this . xmmcEndCode  =  undefined ; 
 
		
	
		
			
				            } ,  { 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1125,7 +1137,8 @@ export default class Judge {
 
		
	
		
			
				        console . info ( 'surenjun' ,  '扣分开始' ) 
 
		
	
		
			
				      //扣分时实时播报语音(  
 
		
	
		
			
				        const  currentKf  =  kf [ kfLen  - 1 ] ; 
 
		
	
		
			
				        if  ( judgeConfig . kfVoiceOpen  ||  ( examSubject  ==  2  &&  judgeConfigObj [ '618' ]  ==  '1' )  ||  ( examSubject  ==  3  &&  judgeConfigObj [ '418' ]  ==  '1' ) )  { 
 
		
	
		
			
				        if  ( judgeConfig . kfVoiceOpen  ||  ( examSubject  ==  2  &&  judgeConfigObj [ '618' ]  ==  '1' )  || 
 
		
	
		
			
				          ( examSubject  ==  3  &&  judgeConfigObj [ '418' ]  ==  '1' ) )  { 
 
		
	
		
			
				          avPlayer . playAudio ( [ ` voice/ ${ currentKf . markcatalog } .mp3 ` ,  ` voice/mark_ ${ Math . abs ( currentKf . score ) } .mp3 ` ] ) 
 
		
	
		
			
				        } 
 
		
	
		
			
				        const  isStart  =  await  checkProjectIsStart ( currentKf . xmdm ,  2 ,  currentKf ) ; 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1194,7 +1207,9 @@ export default class Judge {
 
		
	
		
			
				    } ) 
 
		
	
		
			
				
 
		
	
		
			
				    const  data  =  { 
 
		
	
		
			
				      xtlb :  '17' ,  jkxlh : serialNumber ,  jkid :  '17C53' , 
 
		
	
		
			
				      xtlb :  '17' , 
 
		
	
		
			
				      jkxlh : serialNumber , 
 
		
	
		
			
				      jkid :  '17C53' , 
 
		
	
		
			
				      drvexam :  { 
 
		
	
		
			
				        lsh , 
 
		
	
		
			
				        kskm : examSubject , 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1214,6 +1229,7 @@ export default class Judge {
 
		
	
		
			
				      } 
 
		
	
		
			
				    } 
 
		
	
		
			
				    console . info ( judgeTag  +  'ksxm=>' ,  data . drvexam . ksxm ) 
 
		
	
		
			
				
 
		
	
		
			
				    const  {  code  }  =  await  this . sendWriteObjectOut ( data ,  filePath ) ; 
 
		
	
		
			
				    if  ( code  ==  2300007 )  { 
 
		
	
		
			
				      this . isJudgeDisConnect  =  true 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1243,13 +1259,9 @@ export default class Judge {
 
		
	
		
			
				    }  else  { 
 
		
	
		
			
				      //收到综合评判语音时,显示综合评判弹窗
 
 
		
	
		
			
				      if  ( code [ 0 ]  ==  'zhpp' )  { 
 
		
	
		
			
				        const  param512  =  ( this . judgeUI . judgeConfigObj [ '512' ]  ||  '' ) . split ( ',' ) ; 
 
		
	
		
			
				        this . judgeUI . isDeductedPopShow  =  false 
 
		
	
		
			
				        clearTimeout ( this . deductedPopShowTimer ) 
 
		
	
		
			
				        if ( param512 [ 7 ]  !=  0 ) { 
 
		
	
		
			
				        this . judgeUI . isDeductedPopShow  =  true 
 
		
	
		
			
				        this . judgeUI . defaultTabIndex  =  1 
 
		
	
		
			
				        } 
 
		
	
		
			
				        this . isEndTip  =  true 
 
		
	
		
			
				      } 
 
		
	
		
			
				      avPlayer . playAudio ( [ ` voice/ ${ code [ 0 ] } .mp3 ` ] ) 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1268,13 +1280,12 @@ export default class Judge {
 
		
	
		
			
				    // this.judgeUI.totalScore = isAllProjectsEnd ? totalScore : 0;
 
 
		
	
		
			
				    const  singlePlay  =  globalThis . singlePlay 
 
		
	
		
			
				    const  param302  =  judgeConfigObj [ '302' ] ; 
 
		
	
		
			
				    // globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
 
 
		
	
		
			
				
 
		
	
		
			
				    //自动退出待验证并且不合格
 
 
		
	
		
			
				    if  ( ! isManual  &&  examSubject  ==  3  &&  ( param302  ==  1  ||  ( singlePlay  &&  param302  ==  2 ) )  &&  totalScore  <  passingScore )  { 
 
		
	
		
			
				    if  ( ! isManual  &&  examSubject  ==  3  &&  ( param302  ==  1  ||  ( singlePlay  &&  param302  ==  2 ) )  && 
 
		
	
		
			
				      totalScore  <  passingScore )  { 
 
		
	
		
			
				      avPlayer . playAudio ( [ ` voice/考试结束.mp3 ` ] ) 
 
		
	
		
			
				    } 
 
		
	
		
			
				
 
		
	
		
			
				    //联网模式下:项目没有做完、当前分数大于及格分;手动结束直接退出
 
 
		
	
		
			
				    if  ( ! singlePlay  &&  isManual  &&  ! isAllProjectsEnd  &&  totalScore  >=  passingScore )  { 
 
		
	
		
			
				      avPlayer . playAudio ( [ 'voice/empty.mp3' ] ,  true ,  ( )  = >  { 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1284,7 +1295,18 @@ export default class Judge {
 
		
	
		
			
				      } ) 
 
		
	
		
			
				      return 
 
		
	
		
			
				    } 
 
		
	
		
			
				    if  ( examSubject  ==  3 )  { 
 
		
	
		
			
				      const  param302  =  judgeConfigObj [ '302' ] ; 
 
		
	
		
			
				      if  ( totalScore  <  passingScore )  { 
 
		
	
		
			
				        //考试不合格;考试模式,自动退出;
 
 
		
	
		
			
				        if  ( param302  ==  4  ||  param302  ==  5  ||  param302  ==  7  ||  param302  ==  8 )  { 
 
		
	
		
			
				
 
		
	
		
			
				        } 
 
		
	
		
			
				      }  else  { 
 
		
	
		
			
				        //考试合格
 
 
		
	
		
			
				      } 
 
		
	
		
			
				    } 
 
		
	
		
			
				    await  handleSEP ( 306 ) ; 
 
		
	
		
			
				    avPlayer . playAudio ( [ 'voice/exam_waiting.mp3' ] ,  globalThis . singlePlay ,  async  ( )  = >  { 
 
		
	
		
			
				      try  { 
 
		
	
		
			
				        if  ( ! singlePlay )  { 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1295,7 +1317,6 @@ export default class Judge {
 
		
	
		
			
				        console . info ( judgeTag ,  JSON . stringify ( e ) ) 
 
		
	
		
			
				      } 
 
		
	
		
			
				      await  endExam ( ) 
 
		
	
		
			
				
 
		
	
		
			
				    } ) ; 
 
		
	
		
			
				
 
		
	
		
			
				  } 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1309,22 +1330,22 @@ export default class Judge {
 
		
	
		
			
				      judgeUI , 
 
		
	
		
			
				      ksjs , 
 
		
	
		
			
				      getPhoto , 
 
		
	
		
			
				      uploadProgressData , 
 
		
	
		
			
				      uploadDisConnectData , 
 
		
	
		
			
				      avPlayer , 
 
		
	
		
			
				      kfArr , 
 
		
	
		
			
				      judgeTask , 
 
		
	
		
			
				      filePath , 
 
		
	
		
			
				      closeAllFiles 
 
		
	
		
			
				    }  =  this ; 
 
		
	
		
			
				    const  {  lsh ,  idCard ,  serialNumber ,  kssycs ,  totalScore ,  judgeConfigObj ,  isAllProjectsEnd ,  passingScore  }  =  judgeUI 
 
		
	
		
			
				    //TODO 断网考试结束补传
 
 
		
	
		
			
				    // await uploadDisConnectData();
 
 
		
	
		
			
				    try  { 
 
		
	
		
			
				      const  time  =  await  getCurrentTime ( ) ; 
 
		
	
		
			
				      const  photoBase64  =  await  getPhoto ( ) ; 
 
		
	
		
			
				      const  {  d1 ,  d2 ,  d3 ,  d4 ,  d5  }  =  ksjs 
 
		
	
		
			
				      const  data  =  { 
 
		
	
		
			
				      xtlb :  '17' ,  jkxlh : serialNumber ,  jkid :  '17C56' , 
 
		
	
		
			
				        xtlb :  '17' , 
 
		
	
		
			
				        jkxlh : serialNumber , 
 
		
	
		
			
				        jkid :  '17C56' , 
 
		
	
		
			
				        drvexam :  { 
 
		
	
		
			
				          lsh , 
 
		
	
		
			
				          kchp : encodeURI ( plateNo ) , 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1364,7 +1385,8 @@ export default class Judge {
 
		
	
		
			
				      let  voiceURL  =  '' 
 
		
	
		
			
				      if  ( examSubject  ==  2 )  { 
 
		
	
		
			
				        if  ( isAllProjectsEnd )  { 
 
		
	
		
			
				        voiceURL  =  ( totalScore  <  passingScore  ?  ` voice/unqualified_ ${ kssycs  ==  1  ?  'one'  :  'two' } .wav `  :  'voice/qualified.mp3' ) 
 
		
	
		
			
				          voiceURL  = 
 
		
	
		
			
				            ( totalScore  <  passingScore  ?  ` voice/unqualified_ ${ kssycs  ==  1  ?  'one'  :  'two' } .wav `  :  'voice/qualified.mp3' ) 
 
		
	
		
			
				        }  else  { 
 
		
	
		
			
				          voiceURL  =  ` voice/unqualified_ ${ kssycs  ==  1  ?  'one'  :  'two' } .wav ` 
 
		
	
		
			
				          currentKssycs  =  kssycs  ==  1  ?  0  : 1 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1466,6 +1488,14 @@ export default class Judge {
 
		
	
		
			
				        } ) 
 
		
	
		
			
				      } 
 
		
	
		
			
				
 
		
	
		
			
				    }  catch  ( e )  { 
 
		
	
		
			
				      promptAction . showToast ( { 
 
		
	
		
			
				        message :  "考试结束异常,请尝试重新结束" , 
 
		
	
		
			
				        duration : 3000 
 
		
	
		
			
				      } ) 
 
		
	
		
			
				      judgeUI . loadingPopupVisible  =  false 
 
		
	
		
			
				    } 
 
		
	
		
			
				
 
		
	
		
			
				  } 
 
		
	
		
			
				
 
		
	
		
			
				  // 当前项目转换
 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1508,9 +1538,11 @@ export default class Judge {
 
		
	
		
			
				    }  =  this ; 
 
		
	
		
			
				    const  singlePlay  =  globalThis . singlePlay 
 
		
	
		
			
				    const  {  lsh ,  startHourTime ,  totalScore ,  examTime ,  judgeConfigObj  }  =  judgeUI ; 
 
		
	
		
			
				    const  { fourInOneScreen : { 
 
		
	
		
			
				    const  { 
 
		
	
		
			
				      fourInOneScreen : { 
 
		
	
		
			
				        gpsDigit 
 
		
	
		
			
				    } }  =  judgeConfig 
 
		
	
		
			
				      } 
 
		
	
		
			
				    }  =  judgeConfig 
 
		
	
		
			
				    const  examType  =  examSubject  ==  2  ?  2  : 3 
 
		
	
		
			
				    const  {  sensor ,  gps  }  =  tempData ; 
 
		
	
		
			
				    if  ( tempData . sensor  ===  undefined )  { 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1527,15 +1559,14 @@ export default class Judge {
 
		
	
		
			
				    const  sbxh  =  getSbxh ( xmdm ,  xmxh ) 
 
		
	
		
			
				    const  {  carzt ,  dcjl ,  qjjl ,  dxjl ,  bxjl  }  =  performInfo  ||  { } ; 
 
		
	
		
			
				    const  asclshArr  =  stringToASC ( 
 
		
	
		
			
				      fillZero ( ( 
 
		
	
		
			
				        singlePlay  ? 
 
		
	
		
			
				          ( examSubject  ==  2  ?  '0000000000000'  :  '0000000000000' )  :  lsh )  ||  0 ,  13 ) 
 
		
	
		
			
				      fillZero ( ( singlePlay  ?  ( examSubject  ==  2  ?  '0000000000000'  :  '1111111111111' )  :  lsh )  ||  0 ,  13 ) 
 
		
	
		
			
				    ) ; 
 
		
	
		
			
				    //13不足要补0
 
 
		
	
		
			
				    const  ascksyhArr  =  stringToASC ( fillZero ( ksyh  ||  0 ,  13 ) ) 
 
		
	
		
			
				    const  ascsbxhArr  =  stringToASC ( sbxh ) 
 
		
	
		
			
				    const  translateSignals  =  getTranslateSignals ( 
 
		
	
		
			
				      [ zfxd ,  yfxd ,  shtd ,  ygd ,  jgd ,  skd ,  dh1 ,  dh2 ,  lhq ,  jsc ,  ssc ,  fsc ,  lb ,  mkg ,  aqd ] . concat ( getDwStatusType ( dw ) ) . concat ( getCarStatusType ( carzt ) ) . concat ( [ ygq ,  sensor . wd ,  0 ] ) 
 
		
	
		
			
				      [ zfxd ,  yfxd ,  shtd ,  ygd ,  jgd ,  skd ,  dh1 ,  dh2 ,  lhq ,  jsc ,  ssc ,  fsc ,  lb ,  mkg ,  aqd ] . concat ( getDwStatusType ( dw ) ) 
 
		
	
		
			
				        . concat ( getCarStatusType ( carzt ) ) . concat ( [ ygq ,  sensor . wd ,  0 ] ) 
 
		
	
		
			
				    ) 
 
		
	
		
			
				    //@ts-ignore
 
 
		
	
		
			
				    const  translateJd  =  convertGpsCoord2 ( wd ) . toFixed ( gpsDigit )  *  Math . pow ( 10 ,  gpsDigit ) ; 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1563,7 +1594,8 @@ export default class Judge {
 
		
	
		
			
				      translateSignals , 
 
		
	
		
			
				      //速度                                                发动机转速                          GPS纬度                         GPS经度                         主天线位置
 
 
		
	
		
			
				      //@ts-ignore
 
 
		
	
		
			
				      string2Bytes ( tempSd  *  100 ,  2  *  8 ) ,  string2Bytes ( fdjzs  /  100 ,  8 ) ,  string2Bytes ( translateJd ,  4  *  8 ) ,  string2Bytes ( translateWd ,  4  *  8 ) ,  string2Bytes ( 1 ,  8 ) , 
 
		
	
		
			
				      string2Bytes ( tempSd  *  100 ,  2  *  8 ) ,  string2Bytes ( fdjzs  /  100 ,  8 ) ,  string2Bytes ( translateJd ,  4  *  8 ) , 
 
		
	
		
			
				      string2Bytes ( translateWd ,  4  *  8 ) ,  string2Bytes ( 1 ,  8 ) , 
 
		
	
		
			
				      //GPS东向距离
 
 
		
	
		
			
				      string2Bytes ( dxjl  <  0  ?  ( dxjl  +  4294967296 )  :  dxjl ,  4  *  8 ) , 
 
		
	
		
			
				      //GPS北向距离
 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1682,8 +1714,9 @@ export default class Judge {
 
		
	
		
			
				
 
		
	
		
			
				  // 获取模型数据
 
 
		
	
		
			
				  getModelData  =  ( modelName )  = >  { 
 
		
	
		
			
				    const  modelPath  =  this . modelPath 
 
		
	
		
			
				    const  fileModel  =  this . fileModel ; 
 
		
	
		
			
				    const  modelData  =  fileModel . getModelContent ( 'models' ,  modelName ) ; 
 
		
	
		
			
				    const  modelData  =  fileModel . getModelContent ( modelPath ,  modelName ) ; 
 
		
	
		
			
				    return  modelData 
 
		
	
		
			
				  } 
 
		
	
		
			
				
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1722,7 +1755,7 @@ export default class Judge {
 
		
	
		
			
				  // 检测差分状态
 
 
		
	
		
			
				  checkDwzt  =  async  ( type )  = >  { 
 
		
	
		
			
				    const  {  avPlayer  }  =  this ; 
 
		
	
		
			
				    const  config499  =  this . judgeUI . judgeConfig Obj[ '499' ]  ; 
 
		
	
		
			
				    const  judgeConfig  =  this . judgeUI . judgeConfig ; 
 
		
	
		
			
				    switch  ( type )  { 
 
		
	
		
			
				      case  0 : 
 
		
	
		
			
				        this . judgeUI . isDwztRight  =  true ; 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1730,17 +1763,10 @@ export default class Judge {
 
		
	
		
			
				
 
		
	
		
			
				      case  1 : 
 
		
	
		
			
				        this . judgeUI . dwztErrorVisible  =  true ; 
 
		
	
		
			
				        clearInterval ( this . judgeUI . timer ) ; 
 
		
	
		
			
				        clearInterval ( globalThis . judgeTimer ) 
 
		
	
		
			
				        avPlayer . playAudio ( [ ` voice/差分状态异常.mp3 ` ] ,  true ) 
 
		
	
		
			
				        setTimeout ( ( )  = >  { 
 
		
	
		
			
				          try  { 
 
		
	
		
			
				            this . checkExamIsEnd ( true ) ; 
 
		
	
		
			
				          }  catch  ( e )  { 
 
		
	
		
			
				            this . closeAllFiles ( ) 
 
		
	
		
			
				          router . back ( ) 
 
		
	
		
			
				          } 
 
		
	
		
			
				        } ,  config499  *  1000 ) 
 
		
	
		
			
				        } ,  3000 ) 
 
		
	
		
			
				        break ; 
 
		
	
		
			
				
 
		
	
		
			
				      case  2 : 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1768,19 +1794,13 @@ export default class Judge {
 
		
	
		
			
				  //开始评判
 
 
		
	
		
			
				  private  async  judging ( callBack : Function )  { 
 
		
	
		
			
				    const  {  judgeUI  }  =  this ; 
 
		
	
		
			
				    const  {  name ,  lsh ,  idCard , kssycs , ma rkRules}  =  judgeUI ; 
 
		
	
		
			
				    const  {  name ,  lsh ,  idCard ,   kssycs ,   ma nualMa rkRules  }  =  judgeUI ; 
 
		
	
		
			
				    const  fileLog  =  new  FileLog ( judgeUI . context ) ; 
 
		
	
		
			
				    const  filePath  =  await  fileLog . initFileLogo ( { 
 
		
	
		
			
				      name ,  lsh ,  idCard 
 
		
	
		
			
				    } ) ; 
 
		
	
		
			
				
 
		
	
		
			
				    const  ipFileUtil  =  new  FileUtil ( globalThis . context ) 
 
		
	
		
			
				    const  ipConfigStr  =  await  ipFileUtil . readFile ( GlobalConfig . comoonfileWriteAddress  +  '/config/ipConfig.txt' ) ; 
 
		
	
		
			
				    const  ipConfig  =  JSON . parse ( ipConfigStr ) 
 
		
	
		
			
				
 
		
	
		
			
				    this . fileLog  =  fileLog ; 
 
		
	
		
			
				    this . filePath  =  filePath ; 
 
		
	
		
			
				    this . bklx  =  Number ( ipConfig . cardType ) 
 
		
	
		
			
				
 
		
	
		
			
				    const  { 
 
		
	
		
			
				      getJudgeBeginData , 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1825,7 +1845,6 @@ export default class Judge {
 
		
	
		
			
				      this . handleRealExam ( strData ,  callBack ) 
 
		
	
		
			
				    } ) 
 
		
	
		
			
				
 
		
	
		
			
				
 
		
	
		
			
				    await  examJudgeSetPerformCallback ( async  ( info )  = >  { 
 
		
	
		
			
				      console . info ( '评判实时数据' ,  info ) 
 
		
	
		
			
				      const  performInfo  =  JSON . parse ( info ) 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1837,11 +1856,6 @@ export default class Judge {
 
		
	
		
			
				      this . judgeUI . jl  =  jl 
 
		
	
		
			
				      //TODO 待优化 跨组件传值不生效
 
 
		
	
		
			
				      globalThis . laneData  =  performInfo . lane ; 
 
		
	
		
			
				      //特殊扣分标记上传中心
 
 
		
	
		
			
				      if ( performInfo . specialkf  !==  this . specialkf ) { 
 
		
	
		
			
				        this . judgeUI . uploadMileage ( performInfo . specialkf ) 
 
		
	
		
			
				        this . specialkf  =  performInfo . specialkf 
 
		
	
		
			
				      } 
 
		
	
		
			
				    } ) 
 
		
	
		
			
				
 
		
	
		
			
				    // 3.开始考试
 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1858,7 +1872,7 @@ export default class Judge {
 
		
	
		
			
				    if  ( ! globalThis . singlePlay )  { 
 
		
	
		
			
				      this . videoData  =  await  saveStartRecordVideo ( ` ${ name } _ ${ kssycs } ` ) 
 
		
	
		
			
				    } 
 
		
	
		
			
				    globalThis . statue  =  4   
		
	
		
			
				
  
		
	
		
			
				    const  {  examSubject ,  projectsObj  }  =  this . judgeUI 
 
		
	
		
			
				    // if(examSubject == 3){
 
 
		
	
		
			
				    //   //不做模拟灯光,需要做上车准备 =>(请上车准备)
 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1887,8 +1901,7 @@ export default class Judge {
 
		
	
		
			
				        handDistance ( ) ; 
 
		
	
		
			
				      } 
 
		
	
		
			
				    } ) ; 
 
		
	
		
			
				    //页面逻辑处理完成
 
 
		
	
		
			
				    this . judgeUI . isInitSuccess  =  true ; 
 
		
	
		
			
				
 
		
	
		
			
				    // this.checkExamIsEnd()
 
 
		
	
		
			
				
 
		
	
		
			
				    //监听远程结束考试
 
 
		
	
	
		
			
				
					
					
						
					 
				
			
			@ -1896,33 +1909,18 @@ export default class Judge {
 
		
	
		
			
				      this . checkExamIsEnd ( true ) ; 
 
		
	
		
			
				    } ) 
 
		
	
		
			
				
 
		
	
		
			
				    console . info ( judgeTag ,  JSON . stringify ( markRules ) ) 
 
		
	
		
			
				
 
		
	
		
			
				    console . info ( judgeTag ,  JSON . stringify ( manualMarkRules ) ) 
 
		
	
		
			
				    //监听远程扣分
 
 
		
	
		
			
				    globalThis . udpEvent . onKfExam ( async  ( content )  = >  { 
 
		
	
		
			
				      //为1时,  
 
		
	
		
			
				      const  config810  =  this . judgeUI . judgeConfigObj [ '810' ] ; 
 
		
	
		
			
				      console . info ( '评判收到远程扣分项目内容'  +  JSON . stringify ( content ) ) 
 
		
	
		
			
				      const  {  kfxh ,  directives  }  =  content . data ; 
 
		
	
		
			
				      console . info ( judgeTag ,  '评判收到远程扣分项目内容,扣分序号:'  +  ` kfxh=> ${ kfxh } ; directives=> ${ directives } ` ) 
 
		
	
		
			
				
 
		
	
		
			
				      //根据扣分序号找扣分代码
 
 
		
	
		
			
				      const  currentKf  =  markRules . filter ( mark  = >  ( 
 
		
	
		
			
				        mark . kfxh  ==  kfxh  &&  ( config810  ==  1  ||  mark . markserial  >  99 ) 
 
		
	
		
			
				      ) ) [ 0 ] ; 
 
		
	
		
			
				
 
		
	
		
			
				      const  currentKf  =  manualMarkRules . filter ( mark  = >  mark . kfxh  ==  kfxh ) [ 0 ] ; 
 
		
	
		
			
				      console . info ( judgeTag ,  '扣分项目:'  +  JSON . stringify ( currentKf ) ) 
 
		
	
		
			
				      this . setJudgeMark ( currentKf . itemno ,  currentKf . markserial ,  2 ) ; 
 
		
	
		
			
				      globalThis . judgeUdp . confirmKf ( directives ,  1 ) 
 
		
	
		
			
				    } ) 
 
		
	
		
			
				
 
		
	
		
			
				    //监听远程终止考试
 
 
		
	
		
			
				    globalThis . udpEvent . onStopExam ( async  ( )  = >  { 
 
		
	
		
			
				      const  config392  =  ( this . judgeUI . judgeConfigObj [ '392' ]  ||  '20,81' ) . split ( ',' ) ; 
 
		
	
		
			
				      console . info ( judgeTag ,  '开始远程终止考试扣分' ) 
 
		
	
		
			
				      this . setJudgeMark ( config392 [ 0 ] * 1 ,  config392 [ 1 ] ,  2 ) ; 
 
		
	
		
			
				    } ) 
 
		
	
		
			
				
 
		
	
		
			
				    this . checkExamIsEnd ( ) ; 
 
		
	
		
			
				
 
		
	
		
			
				  }