新评判
This commit is contained in:
		
							parent
							
								
									fd44196a1d
								
							
						
					
					
						commit
						88f00ddfcf
					
				| @ -27,7 +27,7 @@ | |||||||
| #define JUDGE_VERSION_MAJOR  1 | #define JUDGE_VERSION_MAJOR  1 | ||||||
| #define JUDGE_VERSION_MINOR  0 | #define JUDGE_VERSION_MINOR  0 | ||||||
| #define JUDGE_VERSION_PATCH  3 | #define JUDGE_VERSION_PATCH  3 | ||||||
| #define JUDGE_VERSION_STAMP  "2505132200b" | #define JUDGE_VERSION_STAMP  "2505201042b" | ||||||
| #if JUDGE_USE_OLD | #if JUDGE_USE_OLD | ||||||
| #   undef JUDGE_VERSION_STAMP | #   undef JUDGE_VERSION_STAMP | ||||||
| #   define JUDGE_VERSION_STAMP  "2411121010b.old" | #   define JUDGE_VERSION_STAMP  "2411121010b.old" | ||||||
|  | |||||||
| @ -635,27 +635,29 @@ bool ExamCarSub3::Init_KM3_Global() | |||||||
|         //只有掉头项目才有右掉头一说  //20150516
 |         //只有掉头项目才有右掉头一说  //20150516
 | ||||||
|         examItem->bYdt = (itemNo == Sub3ItemType12Dtxx && parm1->TXT2 == "ydt" ? true : false); //是否右掉头
 |         examItem->bYdt = (itemNo == Sub3ItemType12Dtxx && parm1->TXT2 == "ydt" ? true : false); //是否右掉头
 | ||||||
| 
 | 
 | ||||||
|         //如果是满分学习的 czlx=1 m_stuInfo.czlx //满分学习非必考项目,一开始考试就通知外壳合格变绿
 |         //满分学习,如果都没配默认都要做,   如果配了就是配哪个做哪个没配不做
 | ||||||
|  |         //大车夜考,如果都没配默认都算完成,  如果配了就是配哪个做哪个没配不做
 | ||||||
|  |         //如果是满分学习的 czlx=1 m_stuInfo.czlx
 | ||||||
|         if(m_stuInfo.mfxx && itemNo != Sub3ItemType13Yjxs && IS_A1A2A3B1B2C6(cartype)) |         if(m_stuInfo.mfxx && itemNo != Sub3ItemType13Yjxs && IS_A1A2A3B1B2C6(cartype)) | ||||||
|         { |         { | ||||||
|             std::string s  = "," + std::to_string(itemNo) + ","; |             if(m_car.MFXX_KSXM != "") | ||||||
|             std::string ss = "," + m_car.MFXX_KSXM + ","; |  | ||||||
|             if(!Tools::pos(s, ss)) //非必考直接算完成变绿
 |  | ||||||
|             { |             { | ||||||
|                 examItem->NoID = true; |                 std::string s  = "," + std::to_string(itemNo) + ","; | ||||||
|                 KM3EndItem(itemNo,true,false); |                 std::string ss = "," + m_car.MFXX_KSXM + ","; | ||||||
|  |                 if(!Tools::pos(s, ss)) | ||||||
|  |                 { | ||||||
|  |                     examItem->NoID = true; | ||||||
|  |                     KM3EndItem(itemNo,true,false); | ||||||
|  |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         //对夜考项目进行特殊处理 //大车夜考非必考项目,一开始考试就通知外壳合格变绿
 |         //对夜考项目进行特殊处理
 | ||||||
|         if(m_car.Night_ID == true && itemNo != Sub3ItemType13Yjxs) |         if(m_car.Night_ID == true && itemNo != Sub3ItemType13Yjxs) | ||||||
|         { |         { | ||||||
|             std::string s  = "," + std::to_string(itemNo) + ","; |             std::string s  = "," + std::to_string(itemNo) + ","; | ||||||
|             std::string ss = "," + m_car.DC_YK_Must + ","; |             std::string ss = "," + m_car.DC_YK_Must + ","; | ||||||
|             if(!Tools::pos(s, ss)) //非必考直接算完成变绿
 |             if(!Tools::pos(s, ss)) | ||||||
|             { |             { | ||||||
|                 //examItem->Item_Color = itemStateHg;
 |  | ||||||
|                 //examItem->TestPro = ItemProFlagIdle;
 |  | ||||||
|                 //examItem->FinishFlag = true;
 |  | ||||||
|                 examItem->NoID = true; |                 examItem->NoID = true; | ||||||
|                 KM3EndItem(itemNo,isReplay(),false); //轨迹回放工具回放模式要发时间,不然项目不好变绿
 |                 KM3EndItem(itemNo,isReplay(),false); //轨迹回放工具回放模式要发时间,不然项目不好变绿
 | ||||||
|             } |             } | ||||||
| @ -3230,22 +3232,23 @@ void ExamCarSub3::Km3NewEnterItem() | |||||||
|     TChuanGan* cg = m_cg; |     TChuanGan* cg = m_cg; | ||||||
|     //1、非前进状态忽略
 |     //1、非前进状态忽略
 | ||||||
|     TChuanGan* his1 = historyChuanGan(1); |     TChuanGan* his1 = historyChuanGan(1); | ||||||
|     if(cg->move != moveForward || his1->move != moveForward) |     if(cg->move == moveBackward || his1->move == moveBackward) | ||||||
|     { |     { | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|  |     if(cg->move == moveStop && his1->move == moveStop && | ||||||
|  |        cg->real.gps.sd < 0.1 && his1->real.gps.sd < 0.1) | ||||||
|  |     { | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  |     //if(cg->move != moveForward || his1->move != moveForward)
 | ||||||
|  |     //{
 | ||||||
|  |     //    return;
 | ||||||
|  |     //}
 | ||||||
|  | 
 | ||||||
|     //2、速度是0也退出
 |     //2、速度是0也退出
 | ||||||
|     //if(cg->real.gps.sd < 0.1 || his1->real.gps.sd < 0.1) return; //ai_CS_GPS
 |     //if(cg->real.gps.sd < 0.1 || his1->real.gps.sd < 0.1) return; //ai_CS_GPS
 | ||||||
|     //3、非差分状态忽略//非差分状态不允许进项目
 |     //3、非差分状态忽略//非差分状态不允许进项目
 | ||||||
|     //417参数为1,在差分状态才能进入自动评判项目 417没设的话,不判断是不是差分状态 20250428
 |  | ||||||
|     if(TableSysSet->get417() == "1") |  | ||||||
|     { |  | ||||||
|         if(!cg->real.gps.rtkEnabled) |  | ||||||
|         { |  | ||||||
|             return; |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     if(!cg->real.gps.valid()) return; |     if(!cg->real.gps.valid()) return; | ||||||
| 
 | 
 | ||||||
|     static constexpr double KK0 = GPS_DIV; |     static constexpr double KK0 = GPS_DIV; | ||||||
| @ -3412,7 +3415,14 @@ void ExamCarSub3::Km3NewEnterItem() | |||||||
|         } |         } | ||||||
|         else |         else | ||||||
|         { |         { | ||||||
|             ReadItemByPoint(crossPointNo); |             //417参数为1,在差分状态才能进入自动评判项目 417没设的话,不判断是不是差分状态 20250428
 | ||||||
|  |             if(TableSysSet->get417() == "1" && !cg->real.gps.rtkEnabled) | ||||||
|  |             { | ||||||
|  |             } | ||||||
|  |             else | ||||||
|  |             { | ||||||
|  |                 ReadItemByPoint(crossPointNo); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         //(*2024-03-05*)
 |         //(*2024-03-05*)
 | ||||||
|  | |||||||
| @ -3,7 +3,14 @@ | |||||||
| 
 | 
 | ||||||
| #define ENTER_ITEM_AND_MARK(mark) \ | #define ENTER_ITEM_AND_MARK(mark) \ | ||||||
| { \ | { \ | ||||||
|     if(doEnterItem()) { loginfo("enter item %d-%s", itemNo(), itemName().c_str()); }  \ |     if(doEnterMark(true)) { loginfo("enter item %d-%s", itemNo(), itemName().c_str()); }  \ | ||||||
|  |     m_existMark = true; \ | ||||||
|  |     { mark; };      \ | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | #define ENTER_COMM_AND_MARK(mark) \ | ||||||
|  | { \ | ||||||
|  |     if(doEnterMark(false)) { loginfo("enter item %d-%s", itemNo(), itemName().c_str()); }  \ | ||||||
|     m_existMark = true; \ |     m_existMark = true; \ | ||||||
|     { mark; };      \ |     { mark; };      \ | ||||||
| } | } | ||||||
| @ -107,11 +114,11 @@ JUDGE_STAGE_IMPL(Sub2Judge03Cftc, Sub2CftcStage0) | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     //中停扣分(前进状态中停的)
 |     //中停扣分(前进状态中停的) //侧方只有在开始后退以后才扣中停
 | ||||||
|     if(cgcu->move == moveForward && cg01->move == moveStop && cg05->move == moveStop && cg10->move == moveStop) |     //if(cgcu->move == moveForward && cg01->move == moveStop && cg05->move == moveStop && cg10->move == moveStop)
 | ||||||
|     { |     //{
 | ||||||
|         ENTER_ITEM_AND_MARK(JUDGE_MARK_ITEM_MUST_MORE(MARK_SUB2_CFTC_02)); //add enter
 |     //    ENTER_ITEM_AND_MARK(JUDGE_MARK_ITEM_MUST_MORE(MARK_SUB2_CFTC_02)); //add enter
 | ||||||
|     } |     //}
 | ||||||
| 
 | 
 | ||||||
|     //穿越结束线了
 |     //穿越结束线了
 | ||||||
|     if(m_endLineFlag == true && cgcu->move == moveForward) |     if(m_endLineFlag == true && cgcu->move == moveForward) | ||||||
| @ -353,6 +360,15 @@ bool Sub2Judge03Cftc::doEnterItem() | |||||||
|     return false; |     return false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | bool Sub2Judge03Cftc::doEnterMark(bool isItemMark) | ||||||
|  | { | ||||||
|  |     if(isItemMark) //只有项目扣分才会进项目事件,压线通用评判不会触发进项目
 | ||||||
|  |     { | ||||||
|  |         return doEnterItem(); | ||||||
|  |     } | ||||||
|  |     return true; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void Sub2Judge03Cftc::calcCrossLine() | void Sub2Judge03Cftc::calcCrossLine() | ||||||
| { | { | ||||||
|     TChuanGan* cgcu = m_car->historyChuanGan(); |     TChuanGan* cgcu = m_car->historyChuanGan(); | ||||||
| @ -530,18 +546,18 @@ void Sub2Judge03Cftc::touchLineMark(LineNum num) | |||||||
|             } |             } | ||||||
|             else |             else | ||||||
|             { |             { | ||||||
|                 ENTER_ITEM_AND_MARK(JUDGE_MARK_COMM_MUST_MORE(MARK_SUB2_COMM_91)); //标准的
 |                 ENTER_COMM_AND_MARK(JUDGE_MARK_COMM_MUST_MORE(MARK_SUB2_COMM_91)); //标准的
 | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         else if(m_stage == Sub2CftcStage1 || m_stage == Sub2CftcStage2) |         else if(m_stage == Sub2CftcStage1 || m_stage == Sub2CftcStage2) | ||||||
|         { |         { | ||||||
|             if(s609_2 == 1) |             if(s609_2 == 1) | ||||||
|             { |             { | ||||||
|                 ENTER_ITEM_AND_MARK(JUDGE_MARK_COMM_MUST_MORE(MARK_SUB2_COMM_91)); |                 ENTER_COMM_AND_MARK(JUDGE_MARK_COMM_MUST_MORE(MARK_SUB2_COMM_91)); | ||||||
|             } |             } | ||||||
|             else |             else | ||||||
|             { |             { | ||||||
|                ENTER_ITEM_AND_MARK(JUDGE_MARK_ITEM_MUST_MORE(MARK_SUB2_CFTC_03)); //标准的
 |                 ENTER_ITEM_AND_MARK(JUDGE_MARK_ITEM_MUST_MORE(MARK_SUB2_CFTC_03)); //标准的
 | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -56,6 +56,7 @@ private: | |||||||
|     void calcCrossLine(); |     void calcCrossLine(); | ||||||
|     //执行进项目
 |     //执行进项目
 | ||||||
|     bool doEnterItem(); |     bool doEnterItem(); | ||||||
|  |     bool doEnterMark(bool isItemMark); | ||||||
|     //判断是否非标准测绘项目L23线 非标准返回false
 |     //判断是否非标准测绘项目L23线 非标准返回false
 | ||||||
|     bool isStandard(); |     bool isStandard(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -175,6 +175,7 @@ void Sub3Judge12Lkdt::dealJudgeItem() | |||||||
|                 ctl->ZXD_GuanBi = true; |                 ctl->ZXD_GuanBi = true; | ||||||
|             } |             } | ||||||
|             m_exam->TestPro = ItemProFlagEnd; |             m_exam->TestPro = ItemProFlagEnd; | ||||||
|  |             JudgeFlagEnd(); | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @ -236,6 +237,7 @@ void Sub3Judge12Lkdt::dealJudgeItem() | |||||||
|             if(cg->ai_ljjl_cm - m_itemv.StopLine_JLCM >= dis2) |             if(cg->ai_ljjl_cm - m_itemv.StopLine_JLCM >= dis2) | ||||||
|             { |             { | ||||||
|                 m_exam->TestPro = ItemProFlagEnd; |                 m_exam->TestPro = ItemProFlagEnd; | ||||||
|  |                 JudgeFlagEnd(); | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| @ -326,6 +328,7 @@ void Sub3Judge12Lkdt::dealJudgeItem() | |||||||
|         if(cg->ai_ljjl_cm - m_itemv.Start_JL_CM > m_itemv.XMJL_Mi * 100) |         if(cg->ai_ljjl_cm - m_itemv.Start_JL_CM > m_itemv.XMJL_Mi * 100) | ||||||
|         { |         { | ||||||
|             m_exam->TestPro = ItemProFlagEnd; |             m_exam->TestPro = ItemProFlagEnd; | ||||||
|  |             JudgeFlagEnd(); | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @ -394,6 +397,7 @@ void Sub3Judge12Lkdt::dealJudgeItem() | |||||||
|                 if(OKFlag == true) |                 if(OKFlag == true) | ||||||
|                 { |                 { | ||||||
|                     m_exam->TestPro = ItemProFlagEnd; |                     m_exam->TestPro = ItemProFlagEnd; | ||||||
|  |                     JudgeFlagEnd(); | ||||||
|                     return; |                     return; | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
| @ -429,22 +433,6 @@ void Sub3Judge12Lkdt::dealJudgeItem() | |||||||
|         str += buf; |         str += buf; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if(m_exam->TestPro == ItemProFlagEnd) |  | ||||||
|     { |  | ||||||
|         if(m_itemv.LuK_Fx_PointNo > 0) |  | ||||||
|         { |  | ||||||
|             if(m_itemv.OKFangXiangPt_SuccessFlag == false && m_itemv.ReadNextLuDuanFlag == true) |  | ||||||
|             { |  | ||||||
|                 JUDGE_MARK_SUB3(12, "41", true); |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|         if(m_itemv.slowDown.Js_Passed == false) |  | ||||||
|         { |  | ||||||
|             //对可能出现危险的情形未采取减速、鸣喇叭等安全措施
 |  | ||||||
|             JUDGE_MARK_SUB3(12, "46", false); //20170505
 |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     str += msg; |     str += msg; | ||||||
|     showStatus(JUDGE_UTF8S("[大路口掉头]") + str); |     showStatus(JUDGE_UTF8S("[大路口掉头]") + str); | ||||||
| 
 | 
 | ||||||
| @ -465,6 +453,25 @@ void Sub3Judge12Lkdt::JudgeFXD() | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void Sub3Judge12Lkdt::JudgeFlagEnd() | ||||||
|  | { | ||||||
|  |     if(m_exam->TestPro == ItemProFlagEnd) | ||||||
|  |     { | ||||||
|  |         if(m_itemv.LuK_Fx_PointNo > 0) | ||||||
|  |         { | ||||||
|  |             if(m_itemv.OKFangXiangPt_SuccessFlag == false && m_itemv.ReadNextLuDuanFlag == true) | ||||||
|  |             { | ||||||
|  |                 JUDGE_MARK_SUB3(12, "41", true); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         if(m_itemv.slowDown.Js_Passed == false) | ||||||
|  |         { | ||||||
|  |             //对可能出现危险的情形未采取减速、鸣喇叭等安全措施
 | ||||||
|  |             JUDGE_MARK_SUB3(12, "46", false); //20170505
 | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void Sub3Judge12Lkdt::NS3JudgeVision_41501(bool opportunity) | void Sub3Judge12Lkdt::NS3JudgeVision_41501(bool opportunity) | ||||||
| { | { | ||||||
|     //不观察左、右方交通情况,转弯通过路口时,未观察侧前方交通情况,
 |     //不观察左、右方交通情况,转弯通过路口时,未观察侧前方交通情况,
 | ||||||
|  | |||||||
| @ -36,6 +36,7 @@ public: | |||||||
| 
 | 
 | ||||||
| protected: | protected: | ||||||
|     void JudgeFXD(); |     void JudgeFXD(); | ||||||
|  |     void JudgeFlagEnd(); | ||||||
| private: | private: | ||||||
|     TSub3Item12Lkdt m_itemv; |     TSub3Item12Lkdt m_itemv; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -12,8 +12,10 @@ export default class TcpClient { | |||||||
|   private localIpPort: string = '' |   private localIpPort: string = '' | ||||||
|   private oppositeIp: string = '' |   private oppositeIp: string = '' | ||||||
|   private oppositeIpPort: string = '' |   private oppositeIpPort: string = '' | ||||||
|   private num: number = 0//重连次数
 |   private num: number = 0 | ||||||
|   private tcpSendNum: number = 0//重连次数
 |   //重连次数
 | ||||||
|  |   private tcpSendNum: number = 0 | ||||||
|  |   //重连次数
 | ||||||
|   private folderPath |   private folderPath | ||||||
| 
 | 
 | ||||||
|   private tcp: any = null |   private tcp: any = null | ||||||
| @ -50,7 +52,7 @@ export default class TcpClient { | |||||||
| 
 | 
 | ||||||
|   bindTcp() { |   bindTcp() { | ||||||
|     this.writeLog({ |     this.writeLog({ | ||||||
|       time:dateFormat(new Date()), |       time: dateFormat(new Date()), | ||||||
|       message: `${TAG} tcpbind localIp${this.localIp} ${this.localIpPort}`, |       message: `${TAG} tcpbind localIp${this.localIp} ${this.localIpPort}`, | ||||||
|     }) |     }) | ||||||
|     return new Promise((resolve, reject) => { |     return new Promise((resolve, reject) => { | ||||||
| @ -59,7 +61,7 @@ export default class TcpClient { | |||||||
|       }, err => { |       }, err => { | ||||||
|         if (err) { |         if (err) { | ||||||
|           this.writeLog({ |           this.writeLog({ | ||||||
|             time:dateFormat(new Date()), |             time: dateFormat(new Date()), | ||||||
|             message: `${TAG} tcpbind error ${JSON.stringify(err)}`, |             message: `${TAG} tcpbind error ${JSON.stringify(err)}`, | ||||||
|           }) |           }) | ||||||
|           setTimeout(async () => { |           setTimeout(async () => { | ||||||
| @ -84,8 +86,8 @@ export default class TcpClient { | |||||||
| 
 | 
 | ||||||
|   connectTcp() { |   connectTcp() { | ||||||
|     this.writeLog({ |     this.writeLog({ | ||||||
|       time:dateFormat(new Date()), |       time: dateFormat(new Date()), | ||||||
|       message: `${TAG} tcpConnect oppositeIp ${ this.oppositeIp} ${this.oppositeIpPort}`, |       message: `${TAG} tcpConnect oppositeIp ${this.oppositeIp} ${this.oppositeIpPort}`, | ||||||
|     }) |     }) | ||||||
|     return new Promise((resolve, reject) => { |     return new Promise((resolve, reject) => { | ||||||
|       let promise = this.tcp.connect({ |       let promise = this.tcp.connect({ | ||||||
| @ -98,9 +100,9 @@ export default class TcpClient { | |||||||
|           keepAlive: true, |           keepAlive: true, | ||||||
|         }, err => { |         }, err => { | ||||||
|           if (err) { |           if (err) { | ||||||
|             console.log('getCloseTconnectsuccess','error',globalThis.getCloseTcp) |             console.log('getCloseTconnectsuccess', 'error', globalThis.getCloseTcp) | ||||||
|             this.writeLog({ |             this.writeLog({ | ||||||
|               time:dateFormat(new Date()), |               time: dateFormat(new Date()), | ||||||
|               message: `${TAG} TCPconnect error ${JSON.stringify(err)}`, |               message: `${TAG} TCPconnect error ${JSON.stringify(err)}`, | ||||||
|             }) |             }) | ||||||
|             setTimeout(() => { |             setTimeout(() => { | ||||||
| @ -114,9 +116,9 @@ export default class TcpClient { | |||||||
|         globalThis.getCloseTcp = false |         globalThis.getCloseTcp = false | ||||||
|         resolve(true) |         resolve(true) | ||||||
|       }).catch(err => { |       }).catch(err => { | ||||||
|         console.log('socketTag','error') |         console.log('socketTag', 'error') | ||||||
|         this.writeLog({ |         this.writeLog({ | ||||||
|           time:dateFormat(new Date()), |           time: dateFormat(new Date()), | ||||||
|           message: `${TAG} TCPconnect error2 ${JSON.stringify(err)}`, |           message: `${TAG} TCPconnect error2 ${JSON.stringify(err)}`, | ||||||
|         }) |         }) | ||||||
|         // globalThis.getCloseTcp = true
 |         // globalThis.getCloseTcp = true
 | ||||||
| @ -144,14 +146,14 @@ export default class TcpClient { | |||||||
|       }).catch(err => { |       }).catch(err => { | ||||||
|         console.log(`${TAG} TCP send error ${JSON.stringify(err)}`) |         console.log(`${TAG} TCP send error ${JSON.stringify(err)}`) | ||||||
|         this.tcpSendNum++ |         this.tcpSendNum++ | ||||||
|         if(!globalThis.getCloseTcp&&this.tcpSendNum>10){ |         if (!globalThis.getCloseTcp && this.tcpSendNum > 10) { | ||||||
|  |           globalThis.getCloseTcp = true | ||||||
|           setTimeout(async () => { |           setTimeout(async () => { | ||||||
|             getTCP(true) |             getTCP(true) | ||||||
|           }, 3000) |           }, 3000) | ||||||
|           this.tcpSendNum=0 |           this.tcpSendNum = 0 | ||||||
|           return |           return | ||||||
|         } |         } | ||||||
|         globalThis.getCloseTcp=true |  | ||||||
|         // this.writeLog({
 |         // this.writeLog({
 | ||||||
|         //   time:dateFormat(new Date()),
 |         //   time:dateFormat(new Date()),
 | ||||||
|         //   message: `${TAG} TCPsend error ${JSON.stringify(err)}`,
 |         //   message: `${TAG} TCPsend error ${JSON.stringify(err)}`,
 | ||||||
| @ -167,7 +169,7 @@ export default class TcpClient { | |||||||
|       //   time:dateFormat(new Date()),
 |       //   time:dateFormat(new Date()),
 | ||||||
|       //   PLC:`${TAG} Tcponmessage`,
 |       //   PLC:`${TAG} Tcponmessage`,
 | ||||||
|       // })
 |       // })
 | ||||||
|       globalThis.tcpStep=0 |       globalThis.tcpStep = 0 | ||||||
|       globalThis.tcpUdpError = false |       globalThis.tcpUdpError = false | ||||||
| 
 | 
 | ||||||
|       // console.log('messageLengt',,value.message.length))
 |       // console.log('messageLengt',,value.message.length))
 | ||||||
| @ -182,10 +184,10 @@ export default class TcpClient { | |||||||
|         callback && callback('') |         callback && callback('') | ||||||
|       } |       } | ||||||
|       clearInterval(globalThis.intervaltcp) |       clearInterval(globalThis.intervaltcp) | ||||||
|       globalThis.intervaltcp=setInterval(()=>{ |       globalThis.intervaltcp = setInterval(() => { | ||||||
|         //程序断开
 |         //程序断开
 | ||||||
|         if (globalThis.tcpUdpError) { |         if (globalThis.tcpUdpError) { | ||||||
|           console.log(TAG,'tcp信号丢失') |           console.log(TAG, 'tcp信号丢失') | ||||||
|           // getTCP()
 |           // getTCP()
 | ||||||
|           prompt.showToast({ |           prompt.showToast({ | ||||||
|             message: 'tcp信号丢失', |             message: 'tcp信号丢失', | ||||||
| @ -193,24 +195,27 @@ export default class TcpClient { | |||||||
|           }); |           }); | ||||||
|         } |         } | ||||||
|         this.writeLog({ |         this.writeLog({ | ||||||
|           time:dateFormat(new Date()), |           time: dateFormat(new Date()), | ||||||
|           message: `${TAG} tcp信号丢失`, |           message: `${TAG} tcp信号丢失`, | ||||||
|         }) |         }) | ||||||
|         globalThis.tcpUdpError = true; |         globalThis.tcpUdpError = true; | ||||||
|       },3000) |       }, 3000) | ||||||
|       // callback(value.message)
 |       // callback(value.message)
 | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
|   async writeLog(param){ | 
 | ||||||
|  |   async writeLog(param) { | ||||||
|     // const fileUtil = new FileUtil(globalThis.context)
 |     // const fileUtil = new FileUtil(globalThis.context)
 | ||||||
|     // fileUtil.editFile(`${this.folderPath}/plcLog.txt`, JSON.stringify(param)+`\n`)
 |     // fileUtil.editFile(`${this.folderPath}/plcLog.txt`, JSON.stringify(param)+`\n`)
 | ||||||
|   } |   } | ||||||
|   async initPath(){ | 
 | ||||||
|  |   async initPath() { | ||||||
|     return |     return | ||||||
|     const fileUtil = new FileUtil(globalThis.context) |     const fileUtil = new FileUtil(globalThis.context) | ||||||
|     const date=dateFormat(new Date).split(' ')[0] |     const date = dateFormat(new Date).split(' ')[0] | ||||||
|     this.folderPath = await fileUtil.initFolder(`/PLC/${date}`); |     this.folderPath = await fileUtil.initFolder(`/PLC/${date}`); | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   offTcp(callback) { |   offTcp(callback) { | ||||||
|     console.log(TAG, 'tcpofff') |     console.log(TAG, 'tcpofff') | ||||||
|     this.tcp.off('testTagofmessg', callback); |     this.tcp.off('testTagofmessg', callback); | ||||||
| @ -223,10 +228,10 @@ export default class TcpClient { | |||||||
|       promise.then(() => { |       promise.then(() => { | ||||||
|         globalThis.getCloseTcp = true |         globalThis.getCloseTcp = true | ||||||
|         this.writeLog({ |         this.writeLog({ | ||||||
|           time:dateFormat(new Date()), |           time: dateFormat(new Date()), | ||||||
|           message: `${TAG} tcp closeSuccess`, |           message: `${TAG} tcp closeSuccess`, | ||||||
|         }) |         }) | ||||||
|         console.log('getCloseTcpsocketTagclose','success',globalThis.getCloseTcp) |         console.log('getCloseTcpsocketTagclose', 'success', globalThis.getCloseTcp) | ||||||
| 
 | 
 | ||||||
|         console.log(TAG, 'tcpCloseSuccess') |         console.log(TAG, 'tcpCloseSuccess') | ||||||
|         callback() |         callback() | ||||||
| @ -236,10 +241,10 @@ export default class TcpClient { | |||||||
|           getTCP(true) |           getTCP(true) | ||||||
|         }, 9000) |         }, 9000) | ||||||
|         this.writeLog({ |         this.writeLog({ | ||||||
|           time:dateFormat(new Date()), |           time: dateFormat(new Date()), | ||||||
|           message: `${TAG} tcpclose error ${JSON.stringify(err)}`, |           message: `${TAG} tcpclose error ${JSON.stringify(err)}`, | ||||||
|         }) |         }) | ||||||
|         console.log('getCloseTcpsocketTagclose','error',globalThis.getCloseTcp) |         console.log('getCloseTcpsocketTagclose', 'error', globalThis.getCloseTcp) | ||||||
| 
 | 
 | ||||||
|         reslove(false) |         reslove(false) | ||||||
|       }); |       }); | ||||||
|  | |||||||
| @ -61,8 +61,6 @@ struct Index { | |||||||
|   private avPlayer |   private avPlayer | ||||||
|   private context = getContext(this) as common.UIAbilityContext; |   private context = getContext(this) as common.UIAbilityContext; | ||||||
|   private serviceExtProxy: IdlServiceExtProxy |   private serviceExtProxy: IdlServiceExtProxy | ||||||
|   @State judgeVersion: string = "" |  | ||||||
|   private version: string = judgeConfig.version |  | ||||||
| 
 | 
 | ||||||
|   @Styles |   @Styles | ||||||
|   commStyle(){ |   commStyle(){ | ||||||
| @ -199,12 +197,12 @@ struct Index { | |||||||
|       Column() { |       Column() { | ||||||
|         Row() { |         Row() { | ||||||
|           Column() { |           Column() { | ||||||
|             Text('V外壳:' + this.version) |             Text('V外壳:' + globalThis.version) | ||||||
|               .fontColor('#CCAE7A') |               .fontColor('#CCAE7A') | ||||||
|               .fontSize(18 * globalThis.ratio) |               .fontSize(18 * globalThis.ratio) | ||||||
|               .width('30%') |               .width('30%') | ||||||
|               .margin({ bottom: 10 }) |               .margin({ bottom: 10 }) | ||||||
|             Text('V评判:' + this.judgeVersion) |             Text('V评判:' + globalThis.judgeVersion) | ||||||
|               .fontColor('#CCAE7A') |               .fontColor('#CCAE7A') | ||||||
|               .fontSize(18 * globalThis.ratio) |               .fontSize(18 * globalThis.ratio) | ||||||
|               .width('30%') |               .width('30%') | ||||||
| @ -600,7 +598,6 @@ struct Index { | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   async initParams() { |   async initParams() { | ||||||
|     this.judgeVersion = await examJudgeVersion() |  | ||||||
|     await getUDP(this.context, false) |     await getUDP(this.context, false) | ||||||
|     this.loading = false |     this.loading = false | ||||||
|     await getDeviceInfo(this.context) |     await getDeviceInfo(this.context) | ||||||
|  | |||||||
| @ -117,6 +117,7 @@ export default struct RealTime { | |||||||
|   async aboutToDisappear() { |   async aboutToDisappear() { | ||||||
|     clearInterval(this.timer) |     clearInterval(this.timer) | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   async aboutToAppear() { |   async aboutToAppear() { | ||||||
|     this.version = (await examJudgeVersion()) + "/" + judgeConfig.version |     this.version = (await examJudgeVersion()) + "/" + judgeConfig.version | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| //考试回放开关
 | //考试回放开关
 | ||||||
| export const judgeConfig = { | export const judgeConfig = { | ||||||
|   // 外壳版本号
 |   // 外壳版本号
 | ||||||
|   version: "2025.05.15.01", |   version: "2025.05.20.01", | ||||||
|   //本地目录开关
 |   //本地目录开关
 | ||||||
|   isTrajectoryOpen: false, |   isTrajectoryOpen: false, | ||||||
|   //是否开启拍照
 |   //是否开启拍照
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user