Compare commits
	
		
			10 Commits
		
	
	
		
			3b79f0f4dd
			...
			dba195cf8d
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| dba195cf8d | |||
| c42286a6e4 | |||
| d5544ae8e9 | |||
| 28244bd8e7 | |||
| a15aae60d7 | |||
| 9083b82678 | |||
| 5b99e81b05 | |||
| 73360f518c | |||
| 514d3beb60 | |||
| 5770833621 | 
| @ -5,6 +5,11 @@ | ||||
|       "path": "./src/main/cpp/CMakeLists.txt", | ||||
|       "arguments": "", | ||||
|       "cppFlags": "", | ||||
|     }, | ||||
|     "sourceOption": { | ||||
|       "workers": [ | ||||
|         './src/main/ets/workers/worker.ts' | ||||
|       ] | ||||
|     } | ||||
|   }, | ||||
|   "targets": [ | ||||
| @ -16,3 +21,4 @@ | ||||
|     } | ||||
|   ] | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -38,6 +38,7 @@ ErrorCode ExamCarSub3::examBeginExam() | ||||
|     //    loginfo("exam-item xmdm=%d", item.xmdm);
 | ||||
|     //}
 | ||||
| 
 | ||||
|     m_pub = TPubKM3(); | ||||
|     std::string sError; | ||||
|     if(!Init_KM3_Global(sError)) | ||||
|     { | ||||
| @ -1182,7 +1183,7 @@ void ExamCarSub3::Deal_KM3_Judge() | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     m_KsLjLc = m_stuInfo.yklc + m_cg->ai_ljjl; | ||||
|     m_pub.m_KsLjLc = m_stuInfo.yklc + m_cg->ai_ljjl; | ||||
|     m_cg->tkCnt = GetCurrentTick2(); | ||||
|     m_cg->RTKKM3.CrossPointNo = lastCrossPtNo(); | ||||
| 
 | ||||
| @ -1196,20 +1197,21 @@ void ExamCarSub3::Deal_KM3_Judge() | ||||
|     //    CallRenGongEnterItem(mitemno);
 | ||||
|     //}
 | ||||
| 
 | ||||
|     if(m_cg->real.sensor.rmndg == SYES) | ||||
|     { | ||||
|         TKM3Item* item = findExamItem(Sub3ItemType41Mndg); | ||||
|         if(item && item->TestPro == ItemProFlagIdle) | ||||
|         { | ||||
|             item->Item_Color = itemStateZk; | ||||
|             item->TestPro = ItemProFlagInit; | ||||
|             item->FinishFlag = false; | ||||
|             //item->StartTime = GetCurrentTime2();
 | ||||
|             //item->EndTime = 0;
 | ||||
|             //item->MsgData = "";
 | ||||
|             //createEventEnterItem({item->ItemNo, ""});
 | ||||
|         } | ||||
|     } | ||||
|     //240710
 | ||||
|     //if(m_cg->real.sensor.rmndg == SYES)
 | ||||
|     //{
 | ||||
|     //    TKM3Item* item = findExamItem(Sub3ItemType41Mndg);
 | ||||
|     //    if(item && item->TestPro == ItemProFlagIdle)
 | ||||
|     //    {
 | ||||
|     //        item->Item_Color = itemStateZk;
 | ||||
|     //        item->TestPro = ItemProFlagInit;
 | ||||
|     //        item->FinishFlag = false;
 | ||||
|     //        //item->StartTime = GetCurrentTime2();
 | ||||
|     //        //item->EndTime = 0;
 | ||||
|     //        //item->MsgData = "";
 | ||||
|     //        //createEventEnterItem({item->ItemNo, ""});
 | ||||
|     //    }
 | ||||
|     //}
 | ||||
| 
 | ||||
|     m_curItem = nullptr; | ||||
|     //执行具体的专项评判
 | ||||
| @ -2289,7 +2291,7 @@ void ExamCarSub3::RTKJudge_SubItem() | ||||
|                 RTKKM3.CrossLineAttr = TRTKResult::CrossLineAttr1; | ||||
|                 RTKKM3.ShapeNo = SNO; | ||||
|                 //RTKKM3.LS_ShapeNo = 0;
 | ||||
|                 m_SNO = 0; | ||||
|                 m_pub.m_SNO = 0; | ||||
|                 break; | ||||
|             } | ||||
|         } | ||||
| @ -2301,7 +2303,7 @@ void ExamCarSub3::RTKJudge_SubItem() | ||||
|                 RTKKM3.CrossLineAttr = TRTKResult::CrossLineAttr1; | ||||
|                 RTKKM3.ShapeNo = SNO; | ||||
|                 //RTKKM3.LS_ShapeNo = SNO;
 | ||||
|                 m_SNO = SNO; | ||||
|                 m_pub.m_SNO = SNO; | ||||
|                 RTKKM3.CrossPoint = subItem->Point2; | ||||
| 
 | ||||
|                 const Pointi& p1 = subItem->Line3.PtBegin; | ||||
| @ -2311,19 +2313,19 @@ void ExamCarSub3::RTKJudge_SubItem() | ||||
|                 RTKKM3.CrossShapeLength = std::round(std::sqrt(x*x + y*y)); | ||||
|                 break; | ||||
|             } | ||||
|             if(m_SNO == SNO)   //RTKKM3.LS_ShapeNo == SNO
 | ||||
|             if(m_pub.m_SNO == SNO)   //RTKKM3.LS_ShapeNo == SNO
 | ||||
|             { | ||||
|                 if(GpsMath::IsCross(line, subItem->Line3)) | ||||
|                 { | ||||
|                     RTKKM3.CrossLineAttr = TRTKResult::CrossLineAttr2; //中心点右侧
 | ||||
|                     RTKKM3.ShapeNo = SNO; | ||||
|                     //RTKKM3.LS_ShapeNo = 0;
 | ||||
|                     m_SNO = 0; | ||||
|                     m_pub.m_SNO = 0; | ||||
|                 } | ||||
|                 else if(GpsMath::IsCross(line, subItem->Line2)) | ||||
|                 { | ||||
|                     //RTKKM3.LS_ShapeNo = 0;
 | ||||
|                     m_SNO = 0; | ||||
|                     m_pub.m_SNO = 0; | ||||
|                 } | ||||
|                 const Pointi& p1 = RTKKM3.CrossPoint; | ||||
|                 const Pointi& p2 = m_cg->body.b1_b; //CarStatus.BasePoint1_RealTime;
 | ||||
| @ -2332,7 +2334,7 @@ void ExamCarSub3::RTKJudge_SubItem() | ||||
|                 if(dis > RTKKM3.CrossShapeLength * 3)  //3--6  20170924
 | ||||
|                 { | ||||
|                     //RTKKM3.LS_ShapeNo = 0;
 | ||||
|                     m_SNO = 0; | ||||
|                     m_pub.m_SNO = 0; | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
| @ -3271,8 +3273,8 @@ void ExamCarSub3::Km3NewEnterItem() | ||||
|         cg->MapPoint_Road_Code = Road_Code; | ||||
| 
 | ||||
|         //得到穿越的点号,在路口项目中,会被转换成路段的点。(如果右路段信息的话,当然了,路口项目肯定是在特定的路段上的)
 | ||||
|         PubLastChuanYuePtNo = crossPointNo; | ||||
|         PubLastChuanYuePt_JLCM = disCM; | ||||
|         m_pub.PubLastChuanYuePtNo = crossPointNo; | ||||
|         m_pub.PubLastChuanYuePt_JLCM = disCM; | ||||
|         //如果不是项目点,忽略  //读卡进项目的
 | ||||
| 
 | ||||
|         //(*2024-03-05*)
 | ||||
| @ -3336,10 +3338,10 @@ void ExamCarSub3::ReadItemByPoint(int crossPointNo) | ||||
|         const std::string& s319 = TableSysSet->get319(); | ||||
|         //SysSet[319]: 1:必须达到里程,才能进入靠边停车
 | ||||
|         //SysSet[319]: 2:必须达到里程,并且完成必考项目。才能进入靠边停车
 | ||||
|         if(s319 == "1" && m_KsLjLc < m_car.XSJL) return; | ||||
|         if(s319 == "1" && m_pub.m_KsLjLc < m_car.XSJL) return; | ||||
|         if(s319 == "2") | ||||
|         { | ||||
|             if(m_KsLjLc < m_car.XSJL) return; | ||||
|             if(m_pub.m_KsLjLc < m_car.XSJL) return; | ||||
|             bool unfinished = false; | ||||
|             for(auto it = m_sub3Items.begin(); it != m_sub3Items.end(); it++) | ||||
|             { | ||||
| @ -3732,7 +3734,7 @@ bool ExamCarSub3::KM3AllPass() | ||||
|     if(isQualified())  //当前是合格的
 | ||||
|     { | ||||
|         int s336 = TableSysSet->asInt336(); | ||||
|         if(m_KsLjLc + s336 < m_car.XSJL) | ||||
|         if(m_pub.m_KsLjLc + s336 < m_car.XSJL) | ||||
|         { | ||||
|             return false; | ||||
|         } | ||||
| @ -3848,7 +3850,7 @@ void ExamCarSub3::KM3EndItem(int ItemNo) | ||||
|     examItem->GPS_n = 0; | ||||
|     if(examItem->ItemNo == Sub3ItemType04Bgcd || examItem->ItemNo == Sub3ItemType10Ccxx) | ||||
|     { | ||||
|         PUB_JDCC_ZT = 0; //借道超车
 | ||||
|         m_pub.PUB_JDCC_ZT = 0; //借道超车
 | ||||
|     } | ||||
|     //已考项目变量更新
 | ||||
|     if(!isExamAlready(ItemNo)) | ||||
| @ -3965,7 +3967,7 @@ bool ExamCarSub3::judgeMark(int ItemNo, const std::string& serial, bool OnlyOneI | ||||
|                 (ItemNo == Sub3ItemType04Bgcd && serial == "43") ) | ||||
|         { | ||||
|             if(m_cg->ai_ljjl < 500) return result; | ||||
|             if(m_KsLjLc + TableSysSet->asInt336() >= m_car.XSJL) return result; | ||||
|             if(m_pub.m_KsLjLc + TableSysSet->asInt336() >= m_car.XSJL) return result; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| @ -4416,7 +4418,7 @@ bool ExamCarSub3::ManualStartItem(int ItemNo) | ||||
|         if(ItemNo == Sub3ItemType04Bgcd || ItemNo == Sub3ItemType10Ccxx) | ||||
|         { | ||||
|             //ToDo:语音播报:取消变更车道
 | ||||
|             PUB_JDCC_ZT = 0; //借道超车
 | ||||
|             m_pub.PUB_JDCC_ZT = 0; //借道超车
 | ||||
|         } | ||||
|         //ToDo:语音播报:取消变更车道
 | ||||
|         createEventCancelItem({ItemNo, ""}); | ||||
|  | ||||
| @ -51,25 +51,25 @@ public:  //for IExamCarSub3 override | ||||
|     virtual TCar*      getTCar()       override { return &m_car; } | ||||
|     virtual TTestCtl*  getTTestCtl()   override { return &m_ctl; } | ||||
| 
 | ||||
|     virtual int        lastCrossPtNo() override { return PubLastChuanYuePtNo; } | ||||
|     virtual void       setPUB_JDCC_ZT(int v)  override { PUB_JDCC_ZT = v;} | ||||
|     virtual int        getPUB_JDCC_ZT() const override { return PUB_JDCC_ZT;} | ||||
|     virtual void       setChaoChe_Start_TM(int64 v) override { ChaoChe_Start_TM = v;} | ||||
|     virtual int64      getChaoChe_Start_TM() const override { return ChaoChe_Start_TM;} | ||||
|     virtual void       setChaoChe_End_TM(int64 v) override { ChaoChe_End_TM = v;} | ||||
|     virtual int64      getChaoChe_End_TM() const override { return ChaoChe_End_TM;} | ||||
|     virtual void       setPub_JSC_JL(int v) override { Pub_JSC_JL = v;} | ||||
|     virtual int        getPub_JSC_JL() const override { return Pub_JSC_JL; } | ||||
|     virtual void       setNJ_DiaoTou_JL(int v) override { NJ_DiaoTou_JL = v; } | ||||
|     virtual int        getNJ_DiaoTou_JL() const override { return NJ_DiaoTou_JL; } | ||||
|     virtual void       setPubCanJudge_XiHuoFlag(bool v) override { PubCanJudge_XiHuoFlag = v; } | ||||
|     virtual bool       getPubCanJudge_XiHuoFlag() const override { return PubCanJudge_XiHuoFlag; } | ||||
|     virtual void       setPubKaoBianTCFinish_LJJL(int v) override { PubKaoBianTCFinish_LJJL = v; } | ||||
|     virtual int        getPubKaoBianTCFinish_LJJL() const override { return PubKaoBianTCFinish_LJJL; } | ||||
|     virtual void       setKsLjLc(int v)  override { m_KsLjLc = v; } | ||||
|     virtual int        getKsLjLc() const override { return m_KsLjLc; } | ||||
|     virtual void       setyjdg_road_code_kf(bool v) override { yjdg_road_code_kf = v; } | ||||
|     virtual bool       getyjdg_road_code_kf() const override { return yjdg_road_code_kf; } | ||||
|     virtual int        lastCrossPtNo() override { return m_pub.PubLastChuanYuePtNo; } | ||||
|     virtual void       setPUB_JDCC_ZT(int v)  override { m_pub.PUB_JDCC_ZT = v;} | ||||
|     virtual int        getPUB_JDCC_ZT() const override { return m_pub.PUB_JDCC_ZT;} | ||||
|     virtual void       setChaoChe_Start_TM(int64 v) override { m_pub.ChaoChe_Start_TM = v;} | ||||
|     virtual int64      getChaoChe_Start_TM() const override { return m_pub.ChaoChe_Start_TM;} | ||||
|     virtual void       setChaoChe_End_TM(int64 v) override { m_pub.ChaoChe_End_TM = v;} | ||||
|     virtual int64      getChaoChe_End_TM() const override { return m_pub.ChaoChe_End_TM;} | ||||
|     virtual void       setPub_JSC_JL(int v) override { m_pub.Pub_JSC_JL = v;} | ||||
|     virtual int        getPub_JSC_JL() const override { return m_pub.Pub_JSC_JL; } | ||||
|     virtual void       setNJ_DiaoTou_JL(int v) override { m_pub.NJ_DiaoTou_JL = v; } | ||||
|     virtual int        getNJ_DiaoTou_JL() const override { return m_pub.NJ_DiaoTou_JL; } | ||||
|     virtual void       setPubCanJudge_XiHuoFlag(bool v) override { m_pub.PubCanJudge_XiHuoFlag = v; } | ||||
|     virtual bool       getPubCanJudge_XiHuoFlag() const override { return m_pub.PubCanJudge_XiHuoFlag; } | ||||
|     virtual void       setPubKaoBianTCFinish_LJJL(int v) override { m_pub.PubKaoBianTCFinish_LJJL = v; } | ||||
|     virtual int        getPubKaoBianTCFinish_LJJL() const override { return m_pub.PubKaoBianTCFinish_LJJL; } | ||||
|     virtual void       setKsLjLc(int v)  override { m_pub.m_KsLjLc = v; } | ||||
|     virtual int        getKsLjLc() const override { return m_pub.m_KsLjLc; } | ||||
|     virtual void       setyjdg_road_code_kf(bool v) override { m_pub.yjdg_road_code_kf = v; } | ||||
|     virtual bool       getyjdg_road_code_kf() const override { return m_pub.yjdg_road_code_kf; } | ||||
| 
 | ||||
| protected: | ||||
|     bool Init_KM3_Global(std::string& sError); | ||||
| @ -151,6 +151,7 @@ private: | ||||
| 
 | ||||
|     TCar m_car; | ||||
|     TTestCtl m_ctl; | ||||
|     TPubKM3 m_pub; | ||||
| 
 | ||||
|     std::vector<int> m_carPosMeshList; | ||||
|     const int m_DrawArc_Step = 40; | ||||
| @ -158,25 +159,6 @@ private: | ||||
|     int E_1Deg2Cm = 0; //经度1度=多少厘米
 | ||||
|     const int N_1Deg2Cm = 11110792; //北纬1度=X cm
 | ||||
| 
 | ||||
|     int m_KsZgDw = 0; //记录考试中的最高档位
 | ||||
|     int m_KsZgSs = 0; //记录考试中的最高时速
 | ||||
|     int m_KsLjLc = 0; //记录考试累计里程(米)
 | ||||
| 
 | ||||
|     int PubLastChuanYuePtNo = 0; //最后一次经过的点
 | ||||
|     int PubLastChuanYuePt_JLCM = 0; //最后一次经过的点偏移量
 | ||||
| 
 | ||||
|     int NJ_DiaoTou_JL = 0; //个性需求
 | ||||
|     int64 ChaoChe_Start_TM = 0; //2018011 超车开始时间
 | ||||
|     int64 ChaoChe_End_TM = 0; //2018011 超车结束时间
 | ||||
|     int PUB_JDCC_ZT = 0; //借道超车状态 0:非借道 1:表示超车  2:表示正在返回原车道  3:回原车道道完成  20180227
 | ||||
|     bool yjdg_road_code_kf = false; | ||||
| 
 | ||||
|     int Pub_JSC_JL = 0; | ||||
|     bool PubCanJudge_XiHuoFlag = true;  //注意初始必须是true
 | ||||
|     int PubKaoBianTCFinish_LJJL = 0; | ||||
| 
 | ||||
|     int m_SNO = 0; | ||||
| 
 | ||||
|     //TCarStatus m_carStatus;
 | ||||
| 
 | ||||
|     //int64 m_ContinuedStartTime = 0; //续考的上次开始考试时间  20150205
 | ||||
|  | ||||
| @ -110,32 +110,32 @@ bool ExamSensor::convertDatas(TChuanGan* cg) | ||||
| { | ||||
|     TSensorInfo& sor = cg->real.sensor; | ||||
|     sor.dw_plc = sor.dw; | ||||
|     if(m_car->examSubject() == ExamSubject2) | ||||
|     { | ||||
|     } | ||||
|     else if(m_car->examSubject() == ExamSubject3) | ||||
|     { | ||||
|         IExamCarSub3* car = dynamic_cast<IExamCarSub3*>(m_car); | ||||
|         TCar* tcar = car->getTCar(); | ||||
|         //给雾灯信号赋值的时候,一定要遵守下面的规则
 | ||||
|         switch(tcar->WD_Signal) | ||||
|         { | ||||
|         case 0: sor.wd = sor.ygq;     break; | ||||
|         case 1: sor.wd = 1 - sor.yy;  break; //这是取反的的意思如果有信号1, 1-1就是0;
 | ||||
|             //20140411
 | ||||
|         case 2: sor.wd = 1 - sor.ygq; break; //这是取反的的意思如果有信号1, 1-1就是0;
 | ||||
|         case 3: sor.wd = sor.yy;      break; | ||||
|         default:break; | ||||
|         } | ||||
| 
 | ||||
|         if(tcar->CarTypeName == XCharacter("吉利豪情")) | ||||
|         { | ||||
|             if(sor.ygq == SNOT) | ||||
|             { | ||||
|                 sor.wd = SNOT; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|     // if(m_car->examSubject() == ExamSubject2)
 | ||||
|     // {
 | ||||
|     // }
 | ||||
|     // else if(m_car->examSubject() == ExamSubject3)
 | ||||
|     // {
 | ||||
|     //     IExamCarSub3* car = dynamic_cast<IExamCarSub3*>(m_car);
 | ||||
|     //     TCar* tcar = car->getTCar();
 | ||||
|     //     //给雾灯信号赋值的时候,一定要遵守下面的规则
 | ||||
|     //     switch(tcar->WD_Signal)
 | ||||
|     //     {
 | ||||
|     //     case 0: sor.wd = sor.ygq;     break;
 | ||||
|     //     case 1: sor.wd = 1 - sor.yy;  break; //这是取反的的意思如果有信号1, 1-1就是0;
 | ||||
|     //         //20140411
 | ||||
|     //     case 2: sor.wd = 1 - sor.ygq; break; //这是取反的的意思如果有信号1, 1-1就是0;
 | ||||
|     //     case 3: sor.wd = sor.yy;      break;
 | ||||
|     //     default:break;
 | ||||
|     //     }
 | ||||
|     //
 | ||||
|     //     if(tcar->CarTypeName == XCharacter("吉利豪情"))
 | ||||
|     //     {
 | ||||
|     //         if(sor.ygq == SNOT)
 | ||||
|     //         {
 | ||||
|     //             sor.wd = SNOT;
 | ||||
|     //         }
 | ||||
|     //     }
 | ||||
|     // }
 | ||||
| 
 | ||||
|     //油门计算,松油门信号
 | ||||
|     sor.sym = 0; | ||||
|  | ||||
| @ -428,7 +428,10 @@ struct TSub3Item41Mndg  //模拟灯光 41 | ||||
|     int64 Lt_LastChange_TM = 0; //灯光最后变化时间
 | ||||
|     int Lt_YJ_cs = 0; //远近光灯变化次数  20150327
 | ||||
| 
 | ||||
|     std::array<std::string, 7> Lt_Change; //: array[0..6] of string; //0:未定义   1:示宽,2:双跳,3:雾灯,4:远光,5:近光,6:交替,         注意:记录灯光的变化,示宽是从有到无,其他是从无到有
 | ||||
|     //std::array<std::string, 7> Lt_Change; //: array[0..6] of string; //0:未定义   1:示宽,2:双跳,3:雾灯,4:远光,5:近光,6:交替,         注意:记录灯光的变化,示宽是从有到无,其他是从无到有
 | ||||
|     std::string Lt_Change; | ||||
| 
 | ||||
|     std::string Lt_Change_Last; | ||||
| 
 | ||||
|     int8 ItemNo = 0, ItemStatus = 0; //St 控制具体项目  St1控制指定项目的状态
 | ||||
|     int64 Snd_Wav_Start_TM = 0; //语音开始时间
 | ||||
|  | ||||
| @ -63,24 +63,26 @@ void Sub3Judge20Comm::dealJudgeItem() | ||||
|     //自动靠边停车计算
 | ||||
|     Call_Auto_KBTC(); | ||||
|     //Step0-2触发模拟灯光
 | ||||
|     if(!m_car->isReplay()) //(Data_Replay.Kind = 2) then //杨海洋实际考试模式(就是说非回放模式的)
 | ||||
|     { | ||||
|         CallMoNiDengGuang(); //yhyflag
 | ||||
|     } | ||||
|     else | ||||
|     { | ||||
|         //回放相关的
 | ||||
|         if(sor.rmndg == SYES) | ||||
|         { | ||||
|             TKM3Item* item = m_car->findExamItem(Sub3ItemType41Mndg); | ||||
|             if(item && item->TestPro == ItemProFlagIdle) | ||||
|             { | ||||
|                 item->Item_Color = itemStateZk; | ||||
|                 item->TestPro = ItemProFlagInit; | ||||
|                 item->FinishFlag = false; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     CallMoNiDengGuang();  //240710
 | ||||
|     //if(!m_car->isReplay()) //(Data_Replay.Kind = 2) then //杨海洋实际考试模式(就是说非回放模式的)
 | ||||
|     //{
 | ||||
|     //    CallMoNiDengGuang(); //yhyflag  
 | ||||
|     //}
 | ||||
|     //else
 | ||||
|     //{
 | ||||
|     //    //回放相关的
 | ||||
|     //    if(sor.rmndg == SYES)
 | ||||
|     //    {
 | ||||
|     //        TKM3Item* item = m_car->findExamItem(Sub3ItemType41Mndg);
 | ||||
|     //        if(item && item->TestPro == ItemProFlagIdle)
 | ||||
|     //        {
 | ||||
|     //            item->Item_Color = itemStateZk;
 | ||||
|     //            item->TestPro = ItemProFlagInit;
 | ||||
|     //            item->FinishFlag = false;
 | ||||
|     //        }
 | ||||
|     //    }
 | ||||
|     //}
 | ||||
| 
 | ||||
|     //1、溜车评判
 | ||||
|     Judge_LiuChe(); | ||||
|  | ||||
| @ -96,6 +96,7 @@ bool Sub3Judge41Mndg::dealJudgeEnter() | ||||
|     //Pub_Log('开始模拟夜间New');
 | ||||
|     //灯光初始化
 | ||||
|     m_itemv = TSub3Item41Mndg(); | ||||
|     m_itemv.Lt_Change.resize(7, N0); | ||||
|     //m_exam->TestPro = ItemProFlagJudge;
 | ||||
|     //ToDo2:生成进项目事件
 | ||||
| 
 | ||||
| @ -141,7 +142,6 @@ bool Sub3Judge41Mndg::dealJudgeEnter() | ||||
| void Sub3Judge41Mndg::dealJudgeItem() | ||||
| { | ||||
|     HELP_COST_TIME(""); | ||||
| 
 | ||||
|     if(m_exam->TestPro != ItemProFlagJudge) return; | ||||
| 
 | ||||
|     //回放模式 这里要从轨迹文件加载灯光项目
 | ||||
| @ -373,18 +373,18 @@ void Sub3Judge41Mndg::UpdateDengGuangChange() | ||||
|                     { | ||||
|                         if(MilliSecondsBetween(gps.sj, m_itemv.Lt_YJ_TM) < m_itemv.P_YJGD_JT_YS) | ||||
|                         { | ||||
|                             m_itemv.Lt_Change[6] = "1"; | ||||
|                             m_itemv.Lt_Change[6] = Y1; | ||||
|                             m_itemv.Lt_YJ_TM = 0; | ||||
|                             m_itemv.Lt_YJ_cs++; //Inc(m_itemv.Lt_YJ_cs); //20150327
 | ||||
|                             if(ksdd == siteof::shijiazhuang1001) | ||||
|                             { | ||||
|                                 if(m_itemv.Lt_YJ_cs >= 2) | ||||
|                                 { | ||||
|                                     m_itemv.Lt_Change[6] = "1"; | ||||
|                                     m_itemv.Lt_Change[6] = Y1; | ||||
|                                 } | ||||
|                                 else | ||||
|                                 { | ||||
|                                     m_itemv.Lt_Change[6] = "0"; | ||||
|                                     m_itemv.Lt_Change[6] = N0; | ||||
|                                 } | ||||
|                             } | ||||
| 
 | ||||
| @ -392,9 +392,9 @@ void Sub3Judge41Mndg::UpdateDengGuangChange() | ||||
|                             if(ksdd == siteof::gdjykm3 || ksdd == siteof::jiuquan) | ||||
|                             { | ||||
|                                 if(m_itemv.Lt_YJ_cs == 2) | ||||
|                                     m_itemv.Lt_Change[6] = "1"; | ||||
|                                     m_itemv.Lt_Change[6] = Y1; | ||||
|                                 else | ||||
|                                     m_itemv.Lt_Change[6] = "0"; | ||||
|                                     m_itemv.Lt_Change[6] = N0; | ||||
|                             } | ||||
|                         } | ||||
|                     } | ||||
| @ -432,26 +432,26 @@ void Sub3Judge41Mndg::UpdateDengGuangChange() | ||||
|                         if(tm <= m_itemv.P_YJGD_JT_YS) | ||||
|                         { | ||||
|                             //(m_itemv.Snd_No = 2) and (m_itemv.Snd_No1 = 1) and (m_itemv.St=1) 超车
 | ||||
|                             m_itemv.Lt_Change[6] = "1"; | ||||
|                             m_itemv.Lt_Change[6] = Y1; | ||||
|                             m_itemv.Lt_YJ_TM = 0; //成功闪灯一次,远近关灯时间清空
 | ||||
|                             m_itemv.Lt_YJ_cs++; //Inc(m_itemv.Lt_YJ_cs);
 | ||||
|                             if(ksdd == siteof::shijiazhuang1001) | ||||
|                             { | ||||
|                                 if(m_itemv.Lt_YJ_cs >= 2) | ||||
|                                     m_itemv.Lt_Change[6] = "1"; | ||||
|                                     m_itemv.Lt_Change[6] = Y1; | ||||
|                                 else | ||||
|                                     m_itemv.Lt_Change[6] = "0"; | ||||
|                                     m_itemv.Lt_Change[6] = N0; | ||||
|                             } | ||||
| 
 | ||||
|                             if(ksdd == siteof::gdjykm3 || ksdd == siteof::jiuquan) | ||||
|                             { | ||||
|                                 if(m_itemv.Lt_YJ_cs == 2) | ||||
|                                 { | ||||
|                                     m_itemv.Lt_Change[6] = "1"; | ||||
|                                     m_itemv.Lt_Change[6] = Y1; | ||||
|                                 } | ||||
|                                 else | ||||
|                                 { | ||||
|                                     m_itemv.Lt_Change[6] = "0"; | ||||
|                                     m_itemv.Lt_Change[6] = N0; | ||||
|                                 } | ||||
|                             } | ||||
|                         } | ||||
| @ -461,7 +461,7 @@ void Sub3Judge41Mndg::UpdateDengGuangChange() | ||||
|             //如果有闪灯信号,直接赋值就可以了(前提是要有硬件支持)
 | ||||
|             if(sor.sde == SYES && sor1.sde == SNOT) | ||||
|             { | ||||
|                 m_itemv.Lt_Change[6] = "1"; | ||||
|                 m_itemv.Lt_Change[6] = Y1; | ||||
|             } | ||||
| 
 | ||||
|             //远光,近光,
 | ||||
| @ -471,14 +471,14 @@ void Sub3Judge41Mndg::UpdateDengGuangChange() | ||||
|                 { | ||||
|                     if(sor.ygd == SYES) | ||||
|                     { | ||||
|                         m_itemv.Lt_Change[4] = "1"; | ||||
|                         m_itemv.Lt_Change[4] = Y1; | ||||
|                         m_itemv.Lt_YJ_TM = 0; | ||||
|                     } | ||||
|                     else | ||||
|                     { | ||||
|                         if(sor.jgd == SYES) | ||||
|                         { | ||||
|                             m_itemv.Lt_Change[5] = "1"; | ||||
|                             m_itemv.Lt_Change[5] = Y1; | ||||
|                             m_itemv.Lt_YJ_TM = 0; | ||||
|                         } | ||||
|                     } | ||||
| @ -510,12 +510,12 @@ void Sub3Judge41Mndg::UpdateDengGuangChange() | ||||
|             } | ||||
|             if(Flag1 == true || Flag2 == true || Flag3 == true || Flag4 == true) | ||||
|             { | ||||
|                 m_itemv.Lt_Change[1] = "1"; | ||||
|                 m_itemv.Lt_Change[1] = Y1; | ||||
|             } | ||||
|             //双跳,
 | ||||
|             if(sor.shtd == SYES && sor1.shtd == SNOT) | ||||
|             { | ||||
|                 m_itemv.Lt_Change[2] = "1"; | ||||
|                 m_itemv.Lt_Change[2] = Y1; | ||||
|             } | ||||
| 
 | ||||
|             //雾灯, 20181015
 | ||||
| @ -523,12 +523,12 @@ void Sub3Judge41Mndg::UpdateDengGuangChange() | ||||
|             { | ||||
|                 if(sor.wd == SYES && sor1.wd == SNOT) | ||||
|                 { | ||||
|                     m_itemv.Lt_Change[3] = "1"; | ||||
|                     m_itemv.Lt_Change[3] = Y1; | ||||
|                 } | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 m_itemv.Lt_Change[3] = "0"; | ||||
|                 m_itemv.Lt_Change[3] = N0; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| @ -1296,7 +1296,7 @@ void Sub3Judge41Mndg::JiaoTi_DengGuang() | ||||
|     { | ||||
|         for(size_t i = 0; i < m_itemv.Lt_Change.size(); i++) | ||||
|         { | ||||
|             m_itemv.Lt_Change[i] = "0"; | ||||
|             m_itemv.Lt_Change[i] = N0; | ||||
|         } | ||||
| 
 | ||||
|         m_itemv.Lt_YJ_TM = 0; | ||||
| @ -1323,7 +1323,7 @@ void Sub3Judge41Mndg::JiaoTi_DengGuang() | ||||
|     else if(m_itemv.ItemStatus == 3)  //操作结果
 | ||||
|     { | ||||
|         //检查灯光错误
 | ||||
|         if(m_itemv.P_IF_Err_Kf) | ||||
|         if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last) | ||||
|         { | ||||
|             //检查上一个灯光题目:是不是 “车辆发生故障”
 | ||||
|             bool b5 = (m_itemv.LastSubItemNo == 5); | ||||
| @ -1339,7 +1339,7 @@ void Sub3Judge41Mndg::JiaoTi_DengGuang() | ||||
|                     if(i == 2 || i == 3) | ||||
|                     { | ||||
|                         // //0:未定义   1:示宽, 2:双跳, 3:雾灯,4:远光,5:近光,6:交替,         注意:记录灯光的变化,示宽是从有到无,其他是从无到有
 | ||||
|                         if(m_itemv.Lt_Change[i] == "1") | ||||
|                         if(m_itemv.Lt_Change[i] == Y1) | ||||
|                         { | ||||
|                             //打错灯了
 | ||||
|                             if(m_itemv.SubWav1 == 2 || m_itemv.SubWav1 == 3)  //按规则翻译,夜间超车相关的
 | ||||
| @ -1411,7 +1411,7 @@ void Sub3Judge41Mndg::JiaoTi_DengGuang() | ||||
|                 if(sor.zfxd == SYES && sor1.zfxd == SYES) | ||||
|                 { | ||||
|                     m_itemv.Cc_Jd = 1; | ||||
|                     m_itemv.Lt_Change[6] = "0"; | ||||
|                     m_itemv.Lt_Change[6] = N0; | ||||
|                 } | ||||
|                 //20171123
 | ||||
|                 if(ksdd == siteof::guizhoubj && MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_zys) | ||||
| @ -1454,7 +1454,7 @@ void Sub3Judge41Mndg::JiaoTi_DengGuang() | ||||
|             } | ||||
|             else if(m_itemv.Cc_Jd == 1) | ||||
|             { | ||||
|                 if(m_itemv.Lt_Change[6] == "1") | ||||
|                 if(m_itemv.Lt_Change[6] == Y1) | ||||
|                 { | ||||
|                     m_itemv.Cc_Jd = 2; | ||||
|                 } | ||||
| @ -1555,7 +1555,7 @@ void Sub3Judge41Mndg::JiaoTi_DengGuang() | ||||
|             //雾天行驶 要判断双跳灯+雾灯
 | ||||
|             //检查灯光正确
 | ||||
|             //非特殊地点版本
 | ||||
|             if(m_itemv.Lt_Change[6] == "1") | ||||
|             if(m_itemv.Lt_Change[6] == Y1) | ||||
|             { | ||||
|                 if(m_itemv.Lt_LastChange_TM == 0) //灯光正确了
 | ||||
|                 { | ||||
| @ -1609,7 +1609,7 @@ void Sub3Judge41Mndg::JiaoTi_DengGuang() | ||||
|             } | ||||
| 
 | ||||
|             //20171009 检查双跳灯
 | ||||
|             if(m_itemv.P_IF_Err_Kf) | ||||
|             if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last) | ||||
|             { | ||||
|                 if(m_itemv.Lt_YesID) | ||||
|                 { | ||||
| @ -1666,7 +1666,7 @@ void Sub3Judge41Mndg::JiaoTi_DengGuang() | ||||
|                     } | ||||
|                     else | ||||
|                     { | ||||
|                         if(m_itemv.Lt_Change[6] == "1") | ||||
|                         if(m_itemv.Lt_Change[6] == Y1) | ||||
|                         { | ||||
|                             m_itemv.ItemNo = 0; | ||||
|                         } | ||||
| @ -1723,7 +1723,7 @@ void Sub3Judge41Mndg::Open_JinGuangDeng() | ||||
|     else if(m_itemv.ItemStatus == 3) | ||||
|     { | ||||
|         //检查灯光错误
 | ||||
|         if(m_itemv.P_IF_Err_Kf) | ||||
|         if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last) | ||||
|         { | ||||
|             //检查上一个灯光题目:是不是 “车辆发生故障”
 | ||||
|             bool b5 = (m_itemv.LastSubItemNo == 5); | ||||
| @ -1742,7 +1742,7 @@ void Sub3Judge41Mndg::Open_JinGuangDeng() | ||||
|                 //0:未定义   1:示宽,2:双跳,3:雾灯,4:远光,5:近光,6:交替,         注意:记录灯光的变化,示宽是从有到无,其他是从无到有
 | ||||
|                 if(i == 4 || (b5 == false && i == 6))  //20170527   20171009
 | ||||
|                 { | ||||
|                     if(m_itemv.Lt_Change[i] == "1") | ||||
|                     if(m_itemv.Lt_Change[i] == Y1) | ||||
|                     { | ||||
|                         if(ksdd == siteof::shanghaikm3 || ksdd == siteof::jiuquan) | ||||
|                         { | ||||
| @ -1858,7 +1858,7 @@ void Sub3Judge41Mndg::Open_JinGuangDeng() | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     if(m_itemv.Lt_Change[5] == "1")  //相当于近光灯持续了一段时间
 | ||||
|                     if(m_itemv.Lt_Change[5] == Y1)  //相当于近光灯持续了一段时间
 | ||||
|                         m_itemv.Lt_YesID = true; | ||||
|                 } | ||||
|             } | ||||
| @ -1878,13 +1878,13 @@ void Sub3Judge41Mndg::Open_JinGuangDeng() | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     if(m_itemv.Lt_Change[5] == "1")  //相当于近光灯持续了一段时间
 | ||||
|                     if(m_itemv.Lt_Change[5] == Y1)  //相当于近光灯持续了一段时间
 | ||||
|                         m_itemv.Lt_YesID = true; | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         //20171009 检查双跳灯
 | ||||
|         if(m_itemv.P_IF_Err_Kf) | ||||
|         if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last) | ||||
|         { | ||||
|             if(m_itemv.Lt_YesID) | ||||
|             { | ||||
| @ -2115,7 +2115,7 @@ void Sub3Judge41Mndg::Open_YuanGuangDeng() | ||||
|     else if(m_itemv.ItemStatus == 3) | ||||
|     { | ||||
|         //检查灯光错误
 | ||||
|         if(m_itemv.P_IF_Err_Kf) | ||||
|         if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last) | ||||
|         { | ||||
|             //检查上一个灯光题目:是不是 “车辆发生故障”
 | ||||
|             bool b5 = (m_itemv.LastSubItemNo == 5); | ||||
| @ -2127,7 +2127,7 @@ void Sub3Judge41Mndg::Open_YuanGuangDeng() | ||||
|                 { //20171010
 | ||||
|                     if(i != 4 && i != 1 && i != 6 && i != 5)  //20140812
 | ||||
|                     { | ||||
|                         if(m_itemv.Lt_Change[i] == "1") | ||||
|                         if(m_itemv.Lt_Change[i] == Y1) | ||||
|                         { | ||||
|                             if(m_itemv.SubWav1 == 2) //远光灯 20150126
 | ||||
|                             { | ||||
| @ -2154,7 +2154,7 @@ void Sub3Judge41Mndg::Open_YuanGuangDeng() | ||||
|                 { | ||||
|                     if(i != 4 && i != 1)  //20140812
 | ||||
|                     { | ||||
|                         if(m_itemv.Lt_Change[i] == "1") | ||||
|                         if(m_itemv.Lt_Change[i] == Y1) | ||||
|                         { | ||||
|                             if(m_itemv.SubWav1 == 2) //远光灯 20150126
 | ||||
|                             { | ||||
| @ -2192,7 +2192,7 @@ void Sub3Judge41Mndg::Open_YuanGuangDeng() | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 if(m_itemv.Lt_Change[4] == "1")  //相当于远光灯持续了一段时间
 | ||||
|                 if(m_itemv.Lt_Change[4] == Y1)  //相当于远光灯持续了一段时间
 | ||||
|                 { | ||||
|                     m_itemv.Lt_YesID = true; | ||||
|                 } | ||||
| @ -2208,7 +2208,7 @@ void Sub3Judge41Mndg::Open_YuanGuangDeng() | ||||
|             } | ||||
|         } | ||||
|         //20171009 检查双跳灯
 | ||||
|         if(m_itemv.P_IF_Err_Kf) | ||||
|         if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last) | ||||
|         { | ||||
|             if(m_itemv.Lt_YesID) | ||||
|             { | ||||
| @ -2297,7 +2297,7 @@ void Sub3Judge41Mndg::CheLiangGuZhang() | ||||
|     { | ||||
|         const std::string& s421 = TableSysSet->get421(); | ||||
|         //检查灯光错误
 | ||||
|         if(m_itemv.P_IF_Err_Kf) | ||||
|         if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last) | ||||
|         { | ||||
|             for(int i = 1; i <= 6; i++) | ||||
|             { | ||||
| @ -2307,7 +2307,7 @@ void Sub3Judge41Mndg::CheLiangGuZhang() | ||||
|                     ////0:未定义   1:示宽,2:双跳,3:雾灯,4:远光,5:近光,6:交替,         注意:记录灯光的变化,示宽是从有到无,其他是从无到有
 | ||||
|                     if(i == 3) | ||||
|                     { | ||||
|                         if(m_itemv.Lt_Change[i] == "1") | ||||
|                         if(m_itemv.Lt_Change[i] == Y1) | ||||
|                         { | ||||
|                             //打错灯了
 | ||||
|                             if(m_itemv.SubWav1 == 1) | ||||
| @ -2335,7 +2335,7 @@ void Sub3Judge41Mndg::CheLiangGuZhang() | ||||
|                         { | ||||
|                             if(i != 1 && i != 2 && i != 6) | ||||
|                             { | ||||
|                                 if(m_itemv.Lt_Change[i] == "1") | ||||
|                                 if(m_itemv.Lt_Change[i] == Y1) | ||||
|                                 { | ||||
|                                     //打错灯了
 | ||||
|                                     if(ksdd == siteof::guizhouzy) | ||||
| @ -2367,7 +2367,7 @@ void Sub3Judge41Mndg::CheLiangGuZhang() | ||||
|                             if((ksdd == siteof::jiuquan && i != 1 && i != 5) || (ksdd != siteof::jiuquan && i != 1 && i != 2 && i != 5))  //之前判断方法    //20170809
 | ||||
|                             { | ||||
|                                 ////0:未定义   1:示宽,2:双跳,3:雾灯,4:远光,5:近光,6:交替,         注意:记录灯光的变化,示宽是从有到无,其他是从无到有
 | ||||
|                                 if(m_itemv.Lt_Change[i] == "1") | ||||
|                                 if(m_itemv.Lt_Change[i] == Y1) | ||||
|                                 { | ||||
|                                     //打错灯了
 | ||||
|                                     if(m_itemv.SubWav1 == 1) | ||||
| @ -2393,7 +2393,7 @@ void Sub3Judge41Mndg::CheLiangGuZhang() | ||||
|                         if(i != 1 && i!= 2 && i != 5)  //20140923   新增不判远光灯
 | ||||
|                         { | ||||
|                             ////0:未定义   1:示宽,2:双跳,3:雾灯,4:远光,5:近光,6:交替,         注意:记录灯光的变化,示宽是从有到无,其他是从无到有
 | ||||
|                             if(m_itemv.Lt_Change[i] == "1") | ||||
|                             if(m_itemv.Lt_Change[i] == Y1) | ||||
|                             { | ||||
|                                 //打错灯了
 | ||||
|                                 if(m_itemv.SubWav1 == 1) | ||||
| @ -2570,14 +2570,14 @@ void Sub3Judge41Mndg::GuZhangJieChu() | ||||
|     else if(m_itemv.ItemStatus == 3) | ||||
|     { | ||||
|         //检查灯光错误
 | ||||
|         if(m_itemv.P_IF_Err_Kf) | ||||
|         if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last) | ||||
|         { | ||||
|             //示宽,双跳,雾灯,远光,近光,交替,   注意:记录灯光的变化,示宽是从有到无,其他是从无到有
 | ||||
|             for(int i = 1; i <= 6; i++) | ||||
|             { | ||||
|                 if(i == 3) | ||||
|                 { | ||||
|                     if(m_itemv.Lt_Change[i] == "1") | ||||
|                     if(m_itemv.Lt_Change[i] == Y1) | ||||
|                     { | ||||
|                         //打错灯了
 | ||||
|                         JUDGE_MARK_SUB3(41, "01", true); | ||||
| @ -2665,14 +2665,14 @@ void Sub3Judge41Mndg::CloseAllDengGuang() | ||||
|     else if(m_itemv.ItemStatus == 3) | ||||
|     { | ||||
|         //检查灯光错误
 | ||||
|         if(m_itemv.P_IF_Err_Kf) | ||||
|         if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last) | ||||
|         { | ||||
|             for(int i = 1; i <= 6; i++) | ||||
|             { | ||||
|                 //示宽,双跳,雾灯,远光,近光,交替,         注意:记录灯光的变化,示宽是从有到无,其他是从无到有
 | ||||
|                 if(i == 3) | ||||
|                 { | ||||
|                     if(m_itemv.Lt_Change[i] == "1") | ||||
|                     if(m_itemv.Lt_Change[i] == Y1) | ||||
|                     { | ||||
|                         //打错灯了
 | ||||
|                         JUDGE_MARK_SUB3(41, "01", true); | ||||
| @ -2971,9 +2971,11 @@ void Sub3Judge41Mndg::CSH_DengGuangSubItem() | ||||
|     { | ||||
|         for(size_t i = 0; i < m_itemv.Lt_Change.size(); i++) | ||||
|         { | ||||
|             m_itemv.Lt_Change[i] = "0"; | ||||
|             m_itemv.Lt_Change[i] = N0; | ||||
|         } | ||||
| 
 | ||||
|         m_itemv.Lt_Change_Last = m_itemv.Lt_Change; | ||||
| 
 | ||||
|         m_itemv.Lt_YJ_TM = 0; | ||||
|         m_itemv.Lt_YJ_cs = 0; //20150327
 | ||||
|     } | ||||
|  | ||||
| @ -212,6 +212,10 @@ protected: | ||||
|     void playSound(const std::string& kind, int SubWav1, int SubWav2); | ||||
| 
 | ||||
| private: | ||||
| 
 | ||||
|     #define Y1  ('1') | ||||
|     #define N0  ('0') | ||||
| 
 | ||||
|     TSub3Item41Mndg m_itemv; | ||||
| 
 | ||||
|     std::map<std::string, std::string> m_lights; //HeFaDengGuangDataList //加载合法的灯光  //参考头文件注释说明[灯光类型]
 | ||||
|  | ||||
| @ -1293,6 +1293,28 @@ struct TTestCtl | ||||
|     bool Dw_Cgd_OK = false; | ||||
| }; | ||||
| 
 | ||||
| struct TPubKM3 | ||||
| { | ||||
|     int m_KsZgDw = 0; //记录考试中的最高档位
 | ||||
|     int m_KsZgSs = 0; //记录考试中的最高时速
 | ||||
|     int m_KsLjLc = 0; //记录考试累计里程(米)
 | ||||
| 
 | ||||
|     int PubLastChuanYuePtNo = 0; //最后一次经过的点
 | ||||
|     int PubLastChuanYuePt_JLCM = 0; //最后一次经过的点偏移量
 | ||||
| 
 | ||||
|     int NJ_DiaoTou_JL = 0; //个性需求
 | ||||
|     int64 ChaoChe_Start_TM = 0; //2018011 超车开始时间
 | ||||
|     int64 ChaoChe_End_TM = 0; //2018011 超车结束时间
 | ||||
|     int PUB_JDCC_ZT = 0; //借道超车状态 0:非借道 1:表示超车  2:表示正在返回原车道  3:回原车道道完成  20180227
 | ||||
|     bool yjdg_road_code_kf = false; | ||||
| 
 | ||||
|     int Pub_JSC_JL = 0; | ||||
|     bool PubCanJudge_XiHuoFlag = true;  //注意初始必须是true
 | ||||
|     int PubKaoBianTCFinish_LJJL = 0; | ||||
| 
 | ||||
|     int m_SNO = 0; | ||||
| }; | ||||
| 
 | ||||
| /*
 | ||||
| //后面去掉可能没用了
 | ||||
| struct TCarStatus | ||||
|  | ||||
| @ -69,7 +69,7 @@ export async function getUDP2() { | ||||
| 
 | ||||
|         udpClient2.bindUdp() | ||||
|         udpClient2.onError_Callback() | ||||
|         udpClient2.onMessage_1((val) => { | ||||
|         udpClient2.onMessage_2((val) => { | ||||
|           if (val.id == '32') { | ||||
|             globalThis.signNum = val.body[1] | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										
											BIN
										
									
								
								entry/src/main/ets/pages/.DS_Store
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								entry/src/main/ets/pages/.DS_Store
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| @ -270,13 +270,13 @@ struct Index { | ||||
|       }) | ||||
|     }) | ||||
|     const projects = this.projects; | ||||
|     // if (!projects.length) { | ||||
|     //   Prompt.showToast({ | ||||
|     //     message: '读取数据库信息失败,请重新考试!', | ||||
|     //     duration: 8000 | ||||
|     //   }); | ||||
|     //   router.back(); | ||||
|     // } | ||||
|     if (!projects.length) { | ||||
|       Prompt.showToast({ | ||||
|         message: '读取数据库信息失败,请重新考试!', | ||||
|         duration: 8000 | ||||
|       }); | ||||
|       router.back(); | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   // 获取场地设备信息 | ||||
| @ -931,7 +931,6 @@ struct Index { | ||||
|     //不允许人工触发的项目列表,以","分隔 | ||||
|     const unExitManualProjects = judgeConfigObj['332'].split(',') || []; | ||||
| 
 | ||||
| 
 | ||||
|     //直线行驶中不进其他考试项目(0-否 1-是) | ||||
|     const param348 = judgeConfigObj['348'] || '0', | ||||
|       //里程不够允许手工点靠边停车(0-否 1-是) | ||||
| @ -943,7 +942,6 @@ struct Index { | ||||
|       //307参数里设置的项目,项目已经做过,后续不能人工触发; | ||||
|       param307 = (judgeConfigObj['307'] || '').split(','); | ||||
| 
 | ||||
| 
 | ||||
|     //非行驶状态(没有速度),人工项目不能触发(按钮灰色) | ||||
|     if (carztStr === '停车') { | ||||
|       return false | ||||
| @ -960,7 +958,11 @@ struct Index { | ||||
| 
 | ||||
|     //项目进行中不能人工触发 | ||||
|     if (isProjectIn) { | ||||
|       return currentXmdm == projectCode | ||||
|       if (param340 == 1 && isManualProjectIn && (currentXmdm == projectCode)) { | ||||
|         return true | ||||
|       }else{ | ||||
|         return false | ||||
|       } | ||||
|     } | ||||
| 
 | ||||
|     //项目路段信息判断 | ||||
| @ -978,10 +980,6 @@ struct Index { | ||||
|       return false | ||||
|     } | ||||
| 
 | ||||
|     //查询是否有正在进行的项目 | ||||
|     if (param340 == 1 && isManualProjectIn && currentXmdm == projectCode) { | ||||
|       return true | ||||
|     } | ||||
| 
 | ||||
|     //319不为0,或者387不为1,里程不够时,靠边停车项目不能触发 | ||||
|     if ((param387 != '1' || param319 != '0') && index === 5) { | ||||
| @ -1031,9 +1029,9 @@ struct Index { | ||||
| 
 | ||||
|     //405参数为2是,如果在最左侧车道,超车项目不能触发; | ||||
|     if(projectCode == '10' && | ||||
|        judgeConfigObj['402'] == '2' && | ||||
|        (num === count) && | ||||
|         num > 0 | ||||
|       judgeConfigObj['402'] == '2' && | ||||
|       (num === count) && | ||||
|       num > 0 | ||||
|     ){ | ||||
|       return false | ||||
|     } | ||||
|  | ||||
| @ -308,7 +308,7 @@ export default struct SignDisplayCom { | ||||
| 
 | ||||
| 
 | ||||
|     if (showBack) { | ||||
|       globalThis.udpClient.onMessage((msg) => { | ||||
|       globalThis.udpClient.onMessage_1((msg) => { | ||||
|         console.log('msgmsg', msg) | ||||
|         if (msg) { | ||||
|           getSignal(msg) | ||||
| @ -333,7 +333,7 @@ export default struct SignDisplayCom { | ||||
|     const that = this | ||||
|     const showBack = this.showBack; | ||||
|     if (showBack) { | ||||
|       globalThis.udpClient.onMessage((msg) => { | ||||
|       globalThis.udpClient.onMessage_1((msg) => { | ||||
|         getSignal(msg) | ||||
|       }) | ||||
|     } else { | ||||
|  | ||||
							
								
								
									
										353
									
								
								entry/src/main/ets/pages/compontents/faceCompareByhaikang.ets
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										353
									
								
								entry/src/main/ets/pages/compontents/faceCompareByhaikang.ets
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,353 @@ | ||||
| //@ts-ignore | ||||
| 
 | ||||
| import util from '@ohos.util'; | ||||
| 
 | ||||
| import { voiceService } from '../../common/service/voiceService' | ||||
| import { faceCompare } from '../../api/userInfo' | ||||
| import FileUtil from '../../common/utils/File' | ||||
| import { VideoConfig } from '../interfaces' | ||||
| import common from '@ohos.app.ability.common'; | ||||
| 
 | ||||
| import { string2Bytes } from '../../common/utils/tools' | ||||
| import { takePhoto } from '../../common/service/videoService' | ||||
| import { GlobalConfig } from '../../config/index' | ||||
| 
 | ||||
| @Component | ||||
| struct FaceCompare { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| 
 | ||||
|   @State imageBase64: string = 'data:image/jpeg;base64,' | ||||
|   @Prop sfzh: string; | ||||
|   @Prop lsh: string; | ||||
|   @Prop firstImage: string; | ||||
|   @Link faceCompareSucess: number; | ||||
|   @Link showFaceCompare: boolean; | ||||
|   @Link getqkFlag: boolean; | ||||
|   @Link faceCatchImg: string; | ||||
|   @State imageThumbnail: string = ''; | ||||
|   private times = 1; //人脸比对失败次数, 超过3次将不会自动比对,需要点击重新打开重新触发 | ||||
|   private vocObj = null; | ||||
|   @State callBackFlag: boolean = false; | ||||
|   @State @Watch('clearIntervalFn') showFaceCompareFlag: Boolean = false; | ||||
|   @State video_url: string = 'rtsp://admin:12345qwe@192.168.5.41:8000/h264/ch2/main/av_stream' | ||||
|   @State previewUri: Resource = $r('app.media.2_nor') | ||||
|   @State curRate: PlaybackSpeed = PlaybackSpeed.Speed_Forward_1_00_X | ||||
|   @State showControls: boolean = false | ||||
|   private controller: VideoController = new VideoController() | ||||
|   @State isAutoPlay: boolean = true | ||||
|   @State signNum: number = 0; | ||||
|   private fileUtil: FileUtil | ||||
|   private interval: any | ||||
|   @State param: VideoConfig = { | ||||
|     spls: '', | ||||
|     videoNum: '1', | ||||
|     faceFlag: false, | ||||
|     pztd: '1', | ||||
|     ljlx: '', | ||||
|     ip: '192.168.7.112', | ||||
|     port: '554', | ||||
|     userName: 'admin', | ||||
|     pwd: '12345qwe', | ||||
|     td1: '1', | ||||
|     td2: '2', | ||||
|     td3: '3', | ||||
|     td4: '4', | ||||
|     videoRecord1: false, | ||||
|     videoRecord2: false, | ||||
|     videoRecord3: false, | ||||
|     videoRecord4: false, | ||||
|     rlls: '1', | ||||
|     spzd4:false, | ||||
|     spzd3:false, | ||||
|     spzd2:false, | ||||
|     spzd1:false, | ||||
|     zdyz:'500', | ||||
|   } | ||||
|   private context = getContext(this) as common.UIAbilityContext; | ||||
| 
 | ||||
|   build() { | ||||
|     Column() { | ||||
|       Column() { | ||||
|         Text('照片比对') | ||||
|           .lineHeight('16%') | ||||
|           .height('16%') | ||||
|           .fontWeight(FontWeight.Bold) | ||||
|           .fontSize(24) | ||||
| 
 | ||||
|         Row() { | ||||
|           Row() { | ||||
|             Video({ | ||||
|               src: this.showFaceCompare ? `rtsp://${this.param.userName}:${this.param.pwd}@${this.param.ip}:${this.param.port}/h264/ch${this.param.rlls}/main/av_stream` : '', | ||||
|               previewUri: this.previewUri, | ||||
|               currentProgressRate: PlaybackSpeed.Speed_Forward_1_00_X, | ||||
|               controller: this.controller, | ||||
|             }) | ||||
|               .muted(true) | ||||
|               .width('100%') | ||||
|               .height('100%') | ||||
|               .autoPlay(this.isAutoPlay) | ||||
|               .controls(this.showControls) | ||||
|           } | ||||
|           .width('48%') | ||||
|           .height('100%') | ||||
| 
 | ||||
| 
 | ||||
|           Row() { | ||||
|             Image(this.firstImage) | ||||
|               .width('100%') | ||||
|               .height('100%') | ||||
|               .backgroundColor(Color.Black) | ||||
|           } | ||||
|           .width('48%') | ||||
|           .height('100%') | ||||
|         } | ||||
|         .width('88.9%') | ||||
|         .height('53.2%') | ||||
|         .justifyContent(FlexAlign.SpaceBetween) | ||||
| 
 | ||||
|         Text('正在等待拍照…') | ||||
|           .lineHeight('16%') | ||||
|           .height('16%') | ||||
|           .fontWeight(FontWeight.Bold) | ||||
|           .fontColor('#CC7E00') | ||||
| 
 | ||||
|         Column() { | ||||
|           Row() { | ||||
|             Text('若验证无响应,点击此处') | ||||
|               .lineHeight('100%') | ||||
|               .height('100%') | ||||
|               .fontColor('#000000') | ||||
| 
 | ||||
|             Column() { | ||||
|               Text('重新打开') | ||||
|                 .lineHeight('100%') | ||||
|                 .height('100%') | ||||
|                 .fontColor(Color.White) | ||||
|                 .fontSize(23) | ||||
|             } | ||||
|             .width('22.8%') | ||||
|             .height('89.9%') | ||||
|             .backgroundImage($r('app.media.nor')) | ||||
|             .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|             .onClick(async () => { | ||||
|               this.times = 1; | ||||
| 
 | ||||
|             }) | ||||
|           } | ||||
|           .width('88.9%') | ||||
|           .height('100%') | ||||
|           .justifyContent(FlexAlign.SpaceBetween) | ||||
|         } | ||||
|         .width('100%') | ||||
|         .height('16%') | ||||
|         .position({ y: '84%' }) | ||||
|         .borderRadius({ topLeft: 0, topRight: 0, bottomLeft: 15, bottomRight: 15 }) | ||||
|         .backgroundColor('#CCC4B8') | ||||
|       } | ||||
|       .width('68.75%') | ||||
|       .height('73.2%') | ||||
|       .backgroundColor('#E5E3DF') | ||||
|       .borderRadius(15) | ||||
|       .margin({ top: '4%' }) | ||||
| 
 | ||||
|       Column() { | ||||
|       } | ||||
|       .width('8.5%') | ||||
|       .height('15.1%') | ||||
|       .backgroundImage($r('app.media.close')) | ||||
|       .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|       .onClick(() => { | ||||
|         this.controller.stop() | ||||
|         this.vocObj && this.vocObj.releasePlayer() | ||||
|         this.showFaceCompare = !this.showFaceCompare | ||||
|         this.showFaceCompareFlag=!this.showFaceCompareFlag | ||||
|         this.faceCompareSucess = -1 | ||||
|         globalThis.statue = 2 | ||||
| 
 | ||||
| 
 | ||||
|       }) | ||||
|     } | ||||
|     .width('100%') | ||||
|     .height('100%') | ||||
|     .backgroundColor('rgba(0, 0, 0, 0.8)') | ||||
|     .position({ x: 0, y: 0 }) | ||||
|   } | ||||
| 
 | ||||
|   onPageShow() { | ||||
|   } | ||||
| 
 | ||||
|   async aboutToAppear() { | ||||
|     const fileUtil = new FileUtil(this.context) | ||||
|     this.fileUtil = fileUtil | ||||
|     this.getVideoConfig() | ||||
|   } | ||||
| 
 | ||||
|   clearIntervalFn() { | ||||
|     this.callBackFlag = false | ||||
|     clearInterval(this.interval) | ||||
|     this.vocObj && this.vocObj.releasePlayer() | ||||
|   } | ||||
| 
 | ||||
|   getqkFn() { | ||||
|     let tmpList = []; | ||||
|     tmpList.push(string2Bytes(globalThis.signNum, 1 * 8)[0]) | ||||
|     const param = { | ||||
|       id: 41, | ||||
|       list: tmpList, | ||||
|       carNo: globalThis.carInfo.carNo, | ||||
|       placeId: globalThis.carInfo.examinationRoomId | ||||
|     } | ||||
|     globalThis.udpClient2.sendMsgExt(param, this.context) | ||||
|   } | ||||
| 
 | ||||
|   async faceComparFn() { | ||||
|     console.log('mmmmm0',1) | ||||
| 
 | ||||
|     takePhoto(this.param, this.context, 'jt/',0,({base64})=>{ | ||||
|       faceCompare({ | ||||
|         sfzh: this.sfzh, | ||||
|         firstImage: this.firstImage.substr(22), | ||||
|         secondImage: base64, | ||||
|         type: 2, | ||||
|         verifyType: 1 | ||||
|       }).then(res => { | ||||
|         console.log('mmmmm8',res) | ||||
| 
 | ||||
|         if (res) { | ||||
|           this.controller.stop() | ||||
|           this.showFaceCompare = !this.showFaceCompare | ||||
|           this.showFaceCompareFlag=!this.showFaceCompareFlag | ||||
|           this.faceCompareSucess = 1; | ||||
|           // this.faceCatchImg = result | ||||
|           this.vocObj.playAudio({ | ||||
|             type: 1, | ||||
|             name: 'yzcg.wav' | ||||
|           }) | ||||
|         } else { | ||||
|           this.times++; | ||||
|           //3s后开始语音提示 | ||||
|           this.vocObj.playAudio({ | ||||
|             type: 1, | ||||
|             name: 'face_fail.mp3' | ||||
|           }) | ||||
| 
 | ||||
|         } | ||||
|       }) | ||||
|     }) | ||||
|     console.log('mmmmm8',9) | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|   } | ||||
| 
 | ||||
|   async heartMsg(context) { | ||||
|     let tmpList = [] | ||||
|     const str = this.lsh | ||||
|     for (let i = 0;i < str.length; i++) { | ||||
|       tmpList.push(string2Bytes(str.charCodeAt(i), 1 * 8)[0]) | ||||
|     } | ||||
|     const param = { | ||||
|       id: 46, | ||||
|       list: tmpList, | ||||
|       carNo: globalThis.carInfo.carNo, | ||||
|       placeId: globalThis.carInfo.examinationRoomId, | ||||
|       sendCallback: () => { | ||||
|         this.callBackFlag = true | ||||
|       } | ||||
|     } | ||||
|     globalThis.udpClient2 && globalThis.udpClient2.sendMsgExt(param, this.context) | ||||
|     clearInterval(this.interval) | ||||
|     this.interval = setInterval(() => { | ||||
|       if (this.callBackFlag) { | ||||
|         const param2 = { | ||||
|           id: 47, | ||||
|           list: tmpList, | ||||
|           carNo: globalThis.carInfo.carNo, | ||||
|           placeId: globalThis.carInfo.examinationRoomId, | ||||
|         } | ||||
|         globalThis.udpClient2 && globalThis.udpClient2.sendMsgExt(param2, this.context) | ||||
|       } | ||||
|     }, 1000) | ||||
|     globalThis.udpClient2.setMsgCallBack((val) => { | ||||
|       if (val.id == '48') { | ||||
|         if (val.body[13] == '1') { | ||||
|           this.showFaceCompareFlag=!this.showFaceCompareFlag | ||||
|           this.showFaceCompare = !this.showFaceCompare | ||||
|           this.vocObj && this.vocObj.releasePlayer() | ||||
|           this.faceCompareSucess = 1 | ||||
|           clearInterval(this.interval) | ||||
|         } else if (val.body[13] == '0' && this.callBackFlag) { | ||||
|           globalThis.statue = 2 | ||||
|           this.vocObj && this.vocObj.playAudio({ | ||||
|             type: 1, | ||||
|             name: 'face_chekc_fail.wav' | ||||
|           }) | ||||
|         } | ||||
|       } | ||||
|     }) | ||||
| 
 | ||||
|   } | ||||
| 
 | ||||
|   async getVideoConfig() { | ||||
|     console.log('faceEnterIn') | ||||
|     this.vocObj = new voiceService(async (status, val, next) => { | ||||
|       if (status == 'idle') { | ||||
|         if (val == 'face_check.mp3' || val == 'face_fail.mp3') { | ||||
|           if (this.times >= 3) { | ||||
|             globalThis.statue = 3 | ||||
|             this.faceCompareSucess = -1; | ||||
|             this.vocObj && this.vocObj.playAudio({ | ||||
|               type: 1, | ||||
|               name: 'face_checking.wav' | ||||
|             }) | ||||
|             this.heartMsg(this.context) | ||||
|           } else { | ||||
|             setTimeout(() => { | ||||
|               this.faceComparFn() | ||||
|             }, 2000) | ||||
|           } | ||||
|         } else if (val == 'yzcg.wav') { | ||||
|           this.showFaceCompare = !this.showFaceCompare | ||||
|           this.showFaceCompareFlag=!this.showFaceCompareFlag | ||||
|           globalThis.statue = 4 | ||||
|           this.faceCompareSucess = 1; | ||||
|           this.vocObj && this.vocObj.releasePlayer() | ||||
| 
 | ||||
|         } else if (val == 'face_chekc_fail.wav') { | ||||
|           this.vocObj && this.vocObj.releasePlayer() | ||||
|           this.faceCompareSucess = -1 | ||||
|           this.showFaceCompare = !this.showFaceCompare | ||||
|           this.showFaceCompareFlag=!this.showFaceCompareFlag | ||||
|         } | ||||
|       } | ||||
|     }); | ||||
| 
 | ||||
|     const data = await this.fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/config3.txt'); | ||||
|     console.log('faceEnterIn,data',data) | ||||
| 
 | ||||
|     setTimeout(() => { | ||||
|       this.vocObj && this.vocObj.playAudio({ | ||||
|         type: 1, | ||||
|         name: 'face_check.mp3' | ||||
|       }) | ||||
|     }, 1000) | ||||
|     this.param = JSON.parse(data) | ||||
|     this.param.userName = JSON.parse(data).userName | ||||
|     this.param.ip = this.param.ip | ||||
|     this.param.pwd = this.param.pwd | ||||
|     this.param.port = this.param.port | ||||
|     this.param.rlls = this.param.rlls | ||||
|     this.controller.start() | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|   async aboutToDisappear() { | ||||
| 
 | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export default FaceCompare | ||||
							
								
								
									
										329
									
								
								entry/src/main/ets/pages/compontents/faceCompare_bak.ets
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										329
									
								
								entry/src/main/ets/pages/compontents/faceCompare_bak.ets
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,329 @@ | ||||
| import camera from '@ohos.multimedia.camera'; | ||||
| import image from '@ohos.multimedia.image' | ||||
| import util from '@ohos.util'; | ||||
| import { writeFile } from '../../common/service/fileService' | ||||
| import TopLogo from '../compontents/topLogo' | ||||
| 
 | ||||
| import buffer from '@ohos.buffer'; | ||||
| 
 | ||||
| @Component | ||||
| struct FaceCompare { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| 
 | ||||
|   private cameraObj: any = null; | ||||
|   private cameraManager: any = null; | ||||
|   private surfaceId : string =''; | ||||
|   private xcomponentController: XComponentController = new XComponentController(); | ||||
|   // 相机会话 | ||||
|   private captureSession: any = null; | ||||
|   // 相机输入流 | ||||
|   private cameraInput: any = null; | ||||
|   // 预览输出流 | ||||
|   private previewOutput: any = null; | ||||
|   // 拍照输出流 | ||||
|   private photoOutput: any = null; | ||||
|   // 照片接收对象 | ||||
|   private imageRecever: any = null; | ||||
| 
 | ||||
|   @State imageBase64: string = 'data:image/jpeg;base64,' | ||||
| 
 | ||||
| 
 | ||||
|   private timeSetTimeout: number = 0; //定时器执行次数 | ||||
|   private timer: any = 0; //定时器 | ||||
| 
 | ||||
|   build(){ | ||||
|     Column() { | ||||
|       TopLogo() | ||||
|       Row() { | ||||
|         XComponent({ | ||||
|           id: 'xcomponent', | ||||
|           type: 'surface', | ||||
|           controller: this.xcomponentController | ||||
|         }) | ||||
|           .onLoad(async () => { | ||||
|             this.xcomponentController.setXComponentSurfaceSize({surfaceWidth:640,surfaceHeight:480}); | ||||
|             this.surfaceId = this.xcomponentController.getXComponentSurfaceId() | ||||
|             console.log('jiangsong: xcomponentController this.surfaceId = ' + this.surfaceId) | ||||
|             await this.initCamera(); | ||||
|           }) | ||||
|           .width('420px') | ||||
|           .height('240px') | ||||
|       } | ||||
|       .backgroundColor(Color.Yellow) | ||||
|       .position({x: 0, y: 0}) | ||||
| 
 | ||||
|       Row() { | ||||
|         Text('拍照') | ||||
|           .width('100px') | ||||
|           .height('55px') | ||||
|           .backgroundColor(Color.Blue) | ||||
|           .onClick(() => { | ||||
|             this.takePhoto() | ||||
|           }) | ||||
|       } | ||||
|       Row() { | ||||
|         Image(this.imageBase64) | ||||
|           .width(420).height(240).border({ width: 1 }) | ||||
|       } | ||||
|     } | ||||
|     .width('100%') | ||||
|   } | ||||
| 
 | ||||
|   async aboutToAppear() { | ||||
|   } | ||||
|   async aboutToDisappear() { | ||||
|     // 停止当前会话 | ||||
|     this.captureSession.stop() | ||||
|     // 释放相机输入流 | ||||
|     this.cameraInput.close() | ||||
|     // 释放预览输出流 | ||||
|     this.previewOutput.release() | ||||
|     // 释放拍照输出流 | ||||
|     this.photoOutput.release() | ||||
|     // 释放会话 | ||||
|     this.captureSession.release() | ||||
|     // 会话置空 | ||||
|     this.captureSession = null | ||||
|   } | ||||
| 
 | ||||
|   async initCamera(){ | ||||
|     let cameraManager = await camera.getCameraManager(globalThis.context) | ||||
|     if (!cameraManager) { | ||||
|       console.error("jiangsong camera.getCameraManager error") | ||||
|       return; | ||||
|     } | ||||
|     // 监听相机状态变化 | ||||
|     cameraManager.on('cameraStatus', (err, cameraStatusInfo) => { | ||||
|       console.info(`jiangsong camera : ${cameraStatusInfo.camera.cameraId}`); | ||||
|       console.info(`jiangsong status: ${cameraStatusInfo.status}`); | ||||
|     }) | ||||
| 
 | ||||
|     // 获取相机列表 | ||||
|     let cameraArray = await cameraManager.getSupportedCameras(); | ||||
|     if (cameraArray.length <= 0) { | ||||
|       console.error("jiangsong cameraManager.getSupportedCameras error") | ||||
|       return; | ||||
|     } | ||||
| 
 | ||||
|     for (let index = 0; index < cameraArray.length; index++) { | ||||
|       console.info('cameraId : ' + cameraArray[index].cameraId);                          // 获取相机ID | ||||
|       console.info('cameraPosition : ' + cameraArray[index].cameraPosition);              // 获取相机位置 | ||||
|       console.info('cameraType : ' + cameraArray[index].cameraType);                      // 获取相机类型 | ||||
|       console.info('connectionType : ' + cameraArray[index].connectionType);              // 获取相机连接类型 | ||||
|     } | ||||
| 
 | ||||
|     // 创建相机输入流 | ||||
|     try { | ||||
|       this.cameraInput = cameraManager.createCameraInput(cameraArray[0]); | ||||
|     } catch (error) { | ||||
|       console.error('jiangsong Failed to createCameraInput errorCode = ' + error.code); | ||||
|     } | ||||
| 
 | ||||
|     // 监听cameraInput错误信息 | ||||
|     let cameraDevice = cameraArray[0]; | ||||
|     this.cameraInput.on('error', cameraDevice, (error) => { | ||||
|       console.info(`jiangsong Camera input error code: ${error.code}`); | ||||
|     }) | ||||
| 
 | ||||
|     // 打开相机 | ||||
|     await this.cameraInput.open((err) => { | ||||
|       if (err) { | ||||
|         console.error(`jiangsong Failed to open the camera. ${err.code}`); | ||||
|         return; | ||||
|       } | ||||
|       console.log('jiangsong Callback returned with camera opened.'); | ||||
|     }); | ||||
|     // 获取相机设备支持的输出流能力 | ||||
|     let cameraOutputCap = await cameraManager.getSupportedOutputCapability(cameraArray[0]); | ||||
|     if (!cameraOutputCap) { | ||||
|       console.error("jiangsong cameraManager.getSupportedOutputCapability error") | ||||
|       return; | ||||
|     } | ||||
|     console.info("outputCapability: " + JSON.stringify(cameraOutputCap)); | ||||
| 
 | ||||
|     let previewProfilesArray = cameraOutputCap.previewProfiles; | ||||
|     if (!previewProfilesArray) { | ||||
|       console.error("jiangsong createOutput previewProfilesArray == null || undefined") | ||||
|     } | ||||
| 
 | ||||
|     let photoProfilesArray = cameraOutputCap.photoProfiles; | ||||
|     if (!photoProfilesArray) { | ||||
|       console.error("jiangsong createOutput photoProfilesArray == null || undefined") | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     // 创建预览输出流,其中参数 surfaceId 参考上文 XComponent 组件,预览流为XComponent组件提供的surface | ||||
|     try { | ||||
|       this.previewOutput = cameraManager.createPreviewOutput(previewProfilesArray[0], this.surfaceId) | ||||
|     } catch (error) { | ||||
|       console.error("jiangsong Failed to create the PreviewOutput instance.") | ||||
|     } | ||||
| 
 | ||||
|     // 监听预览输出错误信息 | ||||
|     this.previewOutput.on('error', (error) => { | ||||
|       console.info(`jiangosng Preview output error code: ${error.code}`); | ||||
|     }) | ||||
| 
 | ||||
|     // 创建ImageReceiver对象,并设置照片参数:分辨率大小是根据前面 photoProfilesArray 获取的当前设备所支持的拍照分辨率大小去设置 | ||||
|     this.imageRecever = await image.createImageReceiver(1920, 1080, 4, 8) | ||||
|     // 获取照片显示SurfaceId | ||||
|     let photoSurfaceId = await this.imageRecever.getReceivingSurfaceId() | ||||
|     // 创建拍照输出流 | ||||
|     try { | ||||
|       this.photoOutput = cameraManager.createPhotoOutput(photoProfilesArray[0], photoSurfaceId) | ||||
|     } catch (error) { | ||||
|       console.error('jiangsong Failed to createPhotoOutput errorCode = ' + error.code); | ||||
|     } | ||||
|     //创建会话 | ||||
|     try { | ||||
|       this.captureSession = cameraManager.createCaptureSession() | ||||
|     } catch (error) { | ||||
|       console.error('jiangsong Failed to create the CaptureSession instance. errorCode = ' + error.code); | ||||
|     } | ||||
| 
 | ||||
|     // 监听session错误信息 | ||||
|     this.captureSession.on('error', (error) => { | ||||
|       console.info(`jiangsong Capture session error code: ${error.code}`); | ||||
|     }) | ||||
| 
 | ||||
|     // 开始配置会话 | ||||
|     try { | ||||
|       this.captureSession.beginConfig() | ||||
|     } catch (error) { | ||||
|       console.error('jiangsong Failed to beginConfig. errorCode = ' + error.code); | ||||
|     } | ||||
| 
 | ||||
|     // 向会话中添加相机输入流 | ||||
|     try { | ||||
|       this.captureSession.addInput(this.cameraInput) | ||||
|     } catch (error) { | ||||
|       console.error('jiangsong Failed to addInput. errorCode = ' + error.code); | ||||
|     } | ||||
| 
 | ||||
|     // 向会话中添加预览输出流 | ||||
|     try { | ||||
|       this.captureSession.addOutput(this.previewOutput) | ||||
|     } catch (error) { | ||||
|       console.error('jiangsong Failed to addOutput(previewOutput). errorCode = ' + error.code); | ||||
|     } | ||||
| 
 | ||||
|     // 向会话中添加拍照输出流 | ||||
|     try { | ||||
|       this.captureSession.addOutput(this.photoOutput) | ||||
|     } catch (error) { | ||||
|       console.error('jiangsong Failed to addOutput(photoOutput). errorCode = ' + error.code); | ||||
|     } | ||||
| 
 | ||||
|     // 提交会话配置 | ||||
|     await this.captureSession.commitConfig() | ||||
| 
 | ||||
|     // 启动会话 | ||||
|     await this.captureSession.start().then(() => { | ||||
|       console.info('jiangsong Promise returned to indicate the session start success.'); | ||||
|     }) | ||||
|     // 判断设备是否支持闪光灯 | ||||
|     let flashStatus | ||||
|     try { | ||||
|       flashStatus = this.captureSession.hasFlash() | ||||
|     } catch (error) { | ||||
|       console.error('jiangsong Failed to hasFlash. errorCode = ' + error.code); | ||||
|     } | ||||
|     console.info('jiangsong Promise returned with the flash light support status:' + flashStatus); | ||||
| 
 | ||||
|     if (flashStatus) { | ||||
|       // 判断是否支持自动闪光灯模式 | ||||
|       let flashModeStatus | ||||
|       try { | ||||
|         let status = this.captureSession.isFlashModeSupported(camera.FlashMode.FLASH_MODE_AUTO) | ||||
|         flashModeStatus = status | ||||
|       } catch (error) { | ||||
|         console.error('jiangsong Failed to check whether the flash mode is supported. errorCode = ' + error.code); | ||||
|       } | ||||
|       if(flashModeStatus) { | ||||
|         // 设置自动闪光灯模式 | ||||
|         try { | ||||
|           this.captureSession.setFlashMode(camera.FlashMode.FLASH_MODE_AUTO) | ||||
|         } catch (error) { | ||||
|           console.error('jiangsong Failed to set the flash mode. errorCode = ' + error.code); | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   takePhoto() { | ||||
|     let settings = { | ||||
|       quality: camera.QualityLevel.QUALITY_LEVEL_HIGH,                                     // 设置图片质量高 | ||||
|       rotation: camera.ImageRotation.ROTATION_0                                            // 设置图片旋转角度0 | ||||
|     } | ||||
|     // 使用当前拍照设置进行拍照 | ||||
|     this.photoOutput.capture(settings, async (err) => { | ||||
|       if (err) { | ||||
|         console.error(`jiangsong Failed to capture the photo ${err.message}` + JSON.stringify(err)); | ||||
|         return; | ||||
|       } | ||||
|       console.info('jiangsong Callback invoked to indicate the photo capture request success.'); | ||||
| 
 | ||||
|       this.imageRecever.getReceivingSurfaceId().then( id => { | ||||
|         console.log('jiangsong getReceivingSurfaceId succeeded.'); | ||||
|       }).catch(error => { | ||||
|         console.log('jiangsong getReceivingSurfaceId failed.'); | ||||
|       }) | ||||
| 
 | ||||
|       this.getPhoto(); | ||||
|       this.timeSetTimeout = 0; | ||||
|       clearTimeout(this.timer ); | ||||
|     }); | ||||
|   } | ||||
| 
 | ||||
|   getPhoto() { | ||||
|     this.imageRecever.readLatestImage((err, img) => { | ||||
|       if(err) { | ||||
|         console.log('jiangsong readLatestImage failed.' +  JSON.stringify((err))); | ||||
|         this.timeSetTimeout ++; | ||||
|         if(this.timeSetTimeout > 20) { | ||||
|           return; | ||||
|         } | ||||
|         this.timer = setTimeout(() => { | ||||
|           this.getPhoto() | ||||
|         }, 300) | ||||
|       } else { | ||||
|         console.log('jiangsong img.clipRect.' + JSON.stringify(img.clipRect)); | ||||
| 
 | ||||
|         img.getComponent(4, (err, component) => { | ||||
|           if(err) { | ||||
|             console.log('jiangsong getComponent failed.' + JSON.stringify(err)); | ||||
|           } else { | ||||
| 
 | ||||
|             const imagePackerApi = image.createImagePacker(); | ||||
|             let packOpts = { format:"image/jpeg", quality:98 }; | ||||
| 
 | ||||
|             let buf = buffer.from(component.byteBuffer); | ||||
|             let str = buf.toString('base64') | ||||
|             this.imageBase64 = this.imageBase64 + str | ||||
|             // console.error('jiangsong this.imageBase64.length: ' + this.imageBase64.length); | ||||
|             // console.error('jiangsong this.imageBase64.length: ' + this.imageBase64.slice(1, 100)); | ||||
|             // | ||||
|             // const imageSource = image.createImageSource(component.byteBuffer); | ||||
|             // imagePackerApi.packing(imageSource, packOpts).then(async data => { | ||||
|             //   console.log('jiangsong encodeToStringSync data.' + typeof data); | ||||
|             //   // let res = await writeFile({ | ||||
|             //   //   fileName: '/test.jpg', | ||||
|             //   //   buffer: data | ||||
|             //   // }); | ||||
|             // | ||||
|             //   let buf = buffer.from(data); | ||||
|             //   let str = buf.toString('base64') | ||||
|             //   this.imageBase64 = this.imageBase64 + str | ||||
|             // }).catch(error => { | ||||
|             //   console.error('jiangsong Failed to pack the image. And the error is: ' + error); | ||||
|             // }) | ||||
|           } | ||||
|         }) | ||||
|       } | ||||
|     }); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export default FaceCompare | ||||
							
								
								
									
										39
									
								
								entry/src/main/ets/pages/compontents/judge/amplify-popup.ets
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								entry/src/main/ets/pages/compontents/judge/amplify-popup.ets
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,39 @@ | ||||
| const folder = 'judge/km3/amplify/' | ||||
| const amplifyImgs = [ | ||||
|   'km_zxB.png','km_hcB.png', | ||||
|   'km_bdB.png', | ||||
|   'km_ccB.png','km_dtB.png','km_tcB.png', | ||||
| ] | ||||
| const amplifyArrs = [ | ||||
|   {name:'直线',projectCode:'3',projectCodeCenter:'40300'}, | ||||
|   {name:'会车',projectCode:'9',projectCodeCenter:'41300'}, | ||||
|   {name:'变道',projectCode:'4',projectCodeCenter:'40500'}, | ||||
|   {name:'超车',projectCode:'10',projectCodeCenter:'41400'}, | ||||
|   {name:'掉头',projectCode:'12',projectCodeCenter:'41500'}, | ||||
|   {name:'停车',projectCode:'11',projectCodeCenter:'40600'}, | ||||
| ] | ||||
| 
 | ||||
| @Component | ||||
| struct EndPopup { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
|   private amplifyImgIndex:number = 0 | ||||
|   private closeAmplifyPop:Function = ()=>{} | ||||
|   private confirmAmplify:Function = ()=>{} | ||||
| 
 | ||||
|   build(){ | ||||
|     Column(){ | ||||
|       Column(){ | ||||
| 
 | ||||
|       }.width(530).height(386).backgroundImage($rawfile(`${folder}${amplifyImgs[this.amplifyImgIndex]}`)).backgroundImageSize({width:'100%',height:'100%'}).position({y:'25%',x:'37%'}).justifyContent(FlexAlign.Center) | ||||
|        .onClick((e:ClickEvent)=>{ | ||||
|           this.confirmAmplify(amplifyArrs[this.amplifyImgIndex]) | ||||
|        }) | ||||
| 
 | ||||
|     }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.9)') | ||||
|     .onClick(()=>{this.closeAmplifyPop()}) | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export default EndPopup | ||||
							
								
								
									
										154
									
								
								entry/src/main/ets/pages/compontents/judge/deduction-popup.ets
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										154
									
								
								entry/src/main/ets/pages/compontents/judge/deduction-popup.ets
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,154 @@ | ||||
| import {MarkRule} from '../../judgeSDK/api/judgeSDK' | ||||
| interface SEL{ | ||||
|   fontColor:string | ||||
|   bgColor:string | ||||
| } | ||||
| 
 | ||||
| @Component | ||||
| struct DeductedPopup { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| 
 | ||||
|   @State fontSize:number = 25 | ||||
|   @State unselected:SEL = {fontColor:'#000000', bgColor:'#CCC4B8'} | ||||
|   @State selected:SEL =   {fontColor:'#FFAD33', bgColor:'#26231E'} | ||||
| 
 | ||||
|   @State currentIndex:number = 0 | ||||
|   @State currentPageIndex:number = 0 | ||||
|   //通用评判扣分 | ||||
|   @State currentUniversalPageIndex:number = 0; | ||||
|   private  markRules:MarkRule[] = [] | ||||
|   @State universalMarkRules:MarkRule[] = [] | ||||
|   @State manualMarkRules:MarkRule[] = [] | ||||
|   @State currentItems:string[] = [] | ||||
| 
 | ||||
|   @State lineBg:Array<string> = ['#4D4136','#26231E'] | ||||
|   @State selectedLine:number = undefined | ||||
|   private  closePopup:Function = ()=> {} | ||||
|   private  confirmMark:Function = (itemno:number,serial:string) => {} | ||||
|   @State selectedLineStyle:SEL = { | ||||
|     fontColor:'#FFF', | ||||
|     bgColor:'#B36E00' | ||||
|   } | ||||
| 
 | ||||
|   aboutToAppear(){ | ||||
|     this.universalMarkRules = this.markRules.filter(item => this.currentItems.includes(item.itemno+'')) | ||||
|   } | ||||
|   //上一页 下一页 | ||||
|   goPage(typeIndex){ | ||||
|     const currentIndex = this.currentIndex | ||||
|     if(currentIndex){ | ||||
|       //通用评判 | ||||
|       typeIndex ? (this.currentUniversalPageIndex += 1) : (this.currentUniversalPageIndex -= 1) | ||||
|     }else{ | ||||
|       typeIndex ? (this.currentPageIndex += 1) : (this.currentPageIndex -= 1) | ||||
|     } | ||||
|     this.selectedLine = -1 | ||||
|   } | ||||
| 
 | ||||
|   //选中扣分项 | ||||
|   getSelectedLine(index){ | ||||
|     const {selectedLine,selectedLineStyle,lineBg} = this; | ||||
|     if(selectedLine === index){ | ||||
|       return selectedLineStyle.bgColor | ||||
|     } | ||||
|     if(index % 2 === 0){ | ||||
|       return lineBg[0] | ||||
|     }else{ | ||||
|       return lineBg[1] | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   //获取当前页的数据 | ||||
|   getCurrentMarkRuleList(){ | ||||
|     const {currentIndex,currentUniversalPageIndex,currentPageIndex,markRules,universalMarkRules} = this; | ||||
|     if(currentIndex){ | ||||
|       //通用评判 | ||||
|       return universalMarkRules.slice(currentUniversalPageIndex*7,(currentUniversalPageIndex + 1)*7) | ||||
|     }else{ | ||||
|       return universalMarkRules.slice(currentPageIndex*7,(currentPageIndex + 1)*7) | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   build(){ | ||||
|     Column(){ | ||||
|       Column(){ | ||||
|         Column(){ | ||||
|           Row(){ | ||||
|             Row(){ | ||||
|               ForEach(['人工评判','通用评判'],(text,index)=>{ | ||||
| 
 | ||||
|                 Row(){ | ||||
|                   Text(text).fontColor(index === this.currentIndex ? this.selected.fontColor : this.unselected.fontColor).fontSize(this.fontSize).fontWeight(500) | ||||
|                 } | ||||
|                 .width(180).height(70) | ||||
|                 .backgroundColor(index === this.currentIndex ? this.selected.bgColor: this.unselected.bgColor ).justifyContent(FlexAlign.Center).justifyContent(FlexAlign.Center) | ||||
|                 .borderRadius({topLeft:20,topRight:20}).margin({right:10}) | ||||
|                 .onClick(()=>{ | ||||
|                   this.currentIndex = index; | ||||
|                   this.selectedLine = -1; | ||||
|                   if(index === 1) { | ||||
|                     this.universalMarkRules = this.markRules.filter(item => item.itemno == 20 ) | ||||
|                   }else{ | ||||
|                     this.universalMarkRules = this.markRules.filter(item => this.currentItems.includes(item.itemno+'')) | ||||
|                   } | ||||
|                 }) | ||||
|               }) | ||||
|             } | ||||
|             Row(){ | ||||
|               if( | ||||
|                 (Math.ceil(this.universalMarkRules.length / 7 - 1)) >= (this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex) && | ||||
|                   (this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex) > 0 | ||||
|               ){ | ||||
|                 Row(){ | ||||
|                   Row(){}.width(36).height(36).backgroundImage($rawfile(`judge/km3/zuo_nor.png`)).margin({left:24,top:4}) | ||||
|                   Text('上一页'){}.fontColor('#FFF').fontSize(this.fontSize) | ||||
|                 }.width(160).height(80).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}) | ||||
|                 .onClick(()=>{this.goPage(0)}) | ||||
|               } | ||||
| 
 | ||||
|               if( | ||||
|                 (Math.ceil(this.universalMarkRules.length / 7 - 1))  > (this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex) | ||||
|               ){ | ||||
|                 Row(){ | ||||
|                   Text('下一页'){}.fontColor('#FFF').fontSize(this.fontSize).padding({left:30}) | ||||
|                   Row(){}.width(36).height(36).backgroundImage($rawfile(`judge/km3/you_nor.png`)).margin({left:4,top:4}) | ||||
|                 }.width(160).height(80).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}) | ||||
|                 .onClick(()=>{this.goPage(1)}) | ||||
|               } | ||||
| 
 | ||||
| 
 | ||||
|               Row(){ | ||||
|                 Text('扣  分'){}.fontColor('#FFF').fontSize(this.fontSize).padding({left:49}) | ||||
|               }.width(160).height(80).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}) | ||||
|                .onClick(()=>{ | ||||
|                  const index = this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex; | ||||
|                  const mark = this.universalMarkRules[index * 7 + this.selectedLine] | ||||
|                  mark && this.confirmMark(mark.itemno,mark.markserial) | ||||
|                }) | ||||
|             } | ||||
|           }.width('100%').justifyContent(FlexAlign.SpaceBetween) | ||||
|           Column(){ | ||||
|             ForEach(this.getCurrentMarkRuleList(),(item,index) => { | ||||
|               Row(){ | ||||
|                 Text(`${item.markshow} (${item.markcatalog})`).fontColor('#FFF').fontSize(this.fontSize).fontWeight(500) | ||||
|                 Row(){ | ||||
|                   Text(item.markreal + '').fontColor('#FFF').fontSize(this.fontSize).fontWeight(500) | ||||
|                 } | ||||
|               } | ||||
|               .width('100%').height(75).justifyContent(FlexAlign.SpaceBetween).alignItems(VerticalAlign.Center) | ||||
|               .padding({left:20,right:20}) | ||||
|               .backgroundColor(this.getSelectedLine(index)) | ||||
|               .onClick(()=>{this.selectedLine = index}) | ||||
|             }) | ||||
|           } | ||||
|         } | ||||
|       }.width(1300).height(710).position({x:'15%',y:'10%'}).backgroundColor('#E6E3DF').padding({top:15,bottom:15,left:25,right:25}).borderRadius(20) | ||||
|       Row(){}.width(100).height(100).position({y:'85%',x:'50%'}).backgroundImage($rawfile('judge/km3/close_nor.png')).backgroundImageSize({width:'100%',height:'100%'}) | ||||
|         .onClick(()=>{this.closePopup()}) | ||||
|     }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)') | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export default DeductedPopup | ||||
							
								
								
									
										27
									
								
								entry/src/main/ets/pages/compontents/judge/end-popup.ets
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								entry/src/main/ets/pages/compontents/judge/end-popup.ets
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,27 @@ | ||||
| 
 | ||||
| @Component | ||||
| struct EndPopup { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| 
 | ||||
|   private title:string = '' | ||||
|   private cancelFn:(event?: ClickEvent) => void | ||||
|   private confirmFn:(event?: ClickEvent) => void | ||||
| 
 | ||||
|   build(){ | ||||
|     Column(){ | ||||
|       Column(){ | ||||
|         Text(this.title).fontSize(36).margin({bottom:20}) | ||||
|         Row(){}.height(100) | ||||
|         Row(){ | ||||
|           Text('取消').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(250).height(95).fontSize(28).fontColor('#FFF').textAlign(TextAlign.Center).onClick(this.cancelFn) | ||||
|           Text('确定').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(250).height(95).fontSize(28).fontColor('#FFF').textAlign(TextAlign.Center).margin({left:45}).onClick(this.confirmFn) | ||||
|         } | ||||
|       }.width('75%').height('70%').backgroundColor('#E6E3DF').borderRadius(38).position({y:'12%',x:'12.5%'}).justifyContent(FlexAlign.Center) | ||||
| 
 | ||||
|     }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)') | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export default EndPopup | ||||
							
								
								
									
										21
									
								
								entry/src/main/ets/pages/compontents/judge/loading-popup.ets
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								entry/src/main/ets/pages/compontents/judge/loading-popup.ets
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,21 @@ | ||||
| 
 | ||||
| @Component | ||||
| struct LoadingPopup { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| 
 | ||||
|   private title:string = '' | ||||
| 
 | ||||
|   build(){ | ||||
|     Column(){ | ||||
|       Column(){ | ||||
|         Image($rawfile('judge/loading-car.gif')).width(250).margin({top:20,bottom:20}) | ||||
|         Text(this.title).fontSize(32).margin({top:70}) | ||||
|       }.width('70%').height('70%').backgroundColor('#E6E3DF').borderRadius(38).position({y:'15%',x:'15%'}).justifyContent(FlexAlign.Center) | ||||
| 
 | ||||
|     }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)') | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export default LoadingPopup | ||||
							
								
								
									
										83
									
								
								entry/src/main/ets/pages/compontents/judge/real-time.ets
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										83
									
								
								entry/src/main/ets/pages/compontents/judge/real-time.ets
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,83 @@ | ||||
| // @ts-nocheck | ||||
| import hilog from '@ohos.hilog'; | ||||
| import apiJudgeSdk from 'libJudgeSdk.so'; | ||||
| // import apiJudgeSdk from '@ohos.judgesdk'; | ||||
| 
 | ||||
| import Judge from '../../judgeSDK/utils/judge-real' | ||||
| // import Judge from '../../judgeSDK/judge-track-playback' | ||||
| import {Project,ProjectObj,MarkRule} from '../../judgeSDK/api/judgeSDK.d' | ||||
| import AccountTable from '../../../common/database/tables/AccountTable'; | ||||
| import MA_SYSSET from '../../../common//constants/MA_SYSSET'; | ||||
| import common from '@ohos.app.ability.common'; | ||||
| import { getSyncData } from '../../../common/service/initable' | ||||
| import {testAllitems,testUIAllitems,testMarkRules} from '../../judgeSDK/dataTest/index' | ||||
| 
 | ||||
| @Component | ||||
| struct RealTime { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| 
 | ||||
|   private height:number = 0 | ||||
|   private width:number = 0 | ||||
| 
 | ||||
|   @State message: string = '开始绘制' | ||||
| 
 | ||||
|   // 控制XComponent组件的创建和销毁 | ||||
|   @State draw: boolean = false | ||||
|   //监管接口序列号 | ||||
|   @State serialNumber:number = 0 | ||||
| 
 | ||||
|   //模拟考试项目 | ||||
|   @State projects:Project[] = [] | ||||
|   @State projectsObj:ProjectObj = {} | ||||
|   @State markRuleListObj:MarkRule ={} | ||||
|   private context = getContext(this) as common.UIAbilityContext; | ||||
| 
 | ||||
|   // xcomponentController: XComponentController = new XComponentController() | ||||
| 
 | ||||
|   build() { | ||||
|     Row() { | ||||
|       Column() { | ||||
|         if (this.draw) { | ||||
|           XComponent({ | ||||
|             id: 'duolun_plugin_id_draw', //显示轨迹窗口id名称,注意这个ID要和C++侧一致,不能变 | ||||
|             type: 'surface', | ||||
|             libraryname: 'JudgeSdk' | ||||
|             // libraryname: 'judgesdk' | ||||
|           }) | ||||
|             .width(this.width) | ||||
|             .height(this.height) | ||||
|             .onLoad(() => { | ||||
|               apiJudgeSdk.examJudgeMapSetDrawing(true); //停止绘制地图轨迹,false:表示结束绘制 | ||||
|             }) | ||||
|             .onDestroy(() => { | ||||
|               apiJudgeSdk.examJudgeMapSetDrawing(false); //停止绘制地图轨迹,false:表示结束绘制 | ||||
|               this.draw = false; | ||||
|               clearInterval(globalThis.realTimer) | ||||
|             }) | ||||
|         } else { | ||||
|           Column() {} | ||||
|           .width(this.width) | ||||
|           .height(this.height) | ||||
|         } | ||||
|       } | ||||
|       .width('100%') | ||||
|       .backgroundColor('#fff') | ||||
|     } | ||||
|     .height('100%') | ||||
|   } | ||||
| 
 | ||||
|   async aboutToAppear() { | ||||
| 
 | ||||
|     const judge = new Judge(this) | ||||
|   } | ||||
| 
 | ||||
|   aboutToDisappear() { | ||||
|     //apiJudgeSdk.stopRender(); | ||||
| 
 | ||||
|   } | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| export default RealTime | ||||
							
								
								
									
										25
									
								
								entry/src/main/ets/pages/compontents/judge/video-play.ets
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								entry/src/main/ets/pages/compontents/judge/video-play.ets
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,25 @@ | ||||
| 
 | ||||
| @Component | ||||
| export default struct EndPopup { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| 
 | ||||
|   private title:string = '' | ||||
|   private cancelFn:(event?: ClickEvent) => void | ||||
|   private confirmFn:(event?: ClickEvent) => void | ||||
| 
 | ||||
|   build(){ | ||||
|     Column(){ | ||||
|       Column(){ | ||||
|         Text(this.title).fontSize(38).margin({bottom:20}) | ||||
|         Row(){}.height(50) | ||||
|         Row(){ | ||||
|           Text('取消').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(250).height(100).fontSize(30).fontColor('#FFF').textAlign(TextAlign.Center).onClick(this.cancelFn) | ||||
|           Text('确定').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(250).height(100).fontSize(30).fontColor('#FFF').textAlign(TextAlign.Center).margin({left:45}).onClick(this.confirmFn) | ||||
|         } | ||||
|       }.width('80%').height('70%').backgroundColor('#E6E3DF').borderRadius(38).position({y:'12%',x:'10%'}).justifyContent(FlexAlign.Center) | ||||
| 
 | ||||
|     }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)') | ||||
|   } | ||||
| } | ||||
| @ -13,6 +13,7 @@ import FileLog from './utils/fileLog'; | ||||
| import JudgeTask from './utils/judgeTask'; | ||||
| import { judgeConfig } from './utils/judgeConfig'; | ||||
| 
 | ||||
| 
 | ||||
| import { uploadExamProgressData, writeObjectOut } from '../../api/judge'; | ||||
| import { | ||||
|   Array2Byte, | ||||
| @ -292,7 +293,7 @@ export default class Judge { | ||||
|     const xmdm = event == 2 ? xmjs.xmdm : xmks.xmdm | ||||
|     const xmxh = event == 2 ? xmjs.xmxh : xmks.xmxh; | ||||
|     const isManualProjectIn = this.artSubject3ProjectsCodesArr.includes(xmdm); | ||||
|     const {examSubject} = this.judgeUI | ||||
|     const {examSubject,projects} = this.judgeUI | ||||
|     switch (event) { | ||||
|     //项目开始
 | ||||
|       case 1: | ||||
| @ -314,13 +315,16 @@ export default class Judge { | ||||
|         this.xmmcSingleCode = xmmcSingleCode | ||||
|         this.xmdm = xmdm; | ||||
|         this.xmxh = xmxh; | ||||
|         this.judgeUI.isProjectIn = true; | ||||
|         this.judgeUI.isProjectIn = true | ||||
|         this.judgeUI.isDeductedPopShow = true | ||||
|         break; | ||||
| 
 | ||||
|     //项目结束
 | ||||
|       case 2: | ||||
|         judgeUI.projectsObj[xmdm].type = (xmjs.xmhg === 0 ? '4' : '3'); | ||||
|         //计算项目是否全部结束
 | ||||
|         console.info(judgeTag,projects.filter(project => project.type == '2').length ) | ||||
|         this.judgeUI.isProjectIn = (projects.filter(project => project.type == '2').length) > 0 | ||||
|         if(isManualProjectIn){ | ||||
|           this.judgeUI.isManualProjectIn = false | ||||
|         } | ||||
| @ -329,7 +333,6 @@ export default class Judge { | ||||
|         this.xmmcCode = ''; | ||||
|         this.xmmcSingleCode = 0; | ||||
|         this.xmdm = ''; | ||||
|         this.judgeUI.isProjectIn = false; | ||||
|         this.judgeUI.isDeductedPopShow = false | ||||
|         this.judgeUI.currentXmdm = undefined; | ||||
|         break; | ||||
| @ -450,7 +453,7 @@ export default class Judge { | ||||
|     // 扣分
 | ||||
|       case 3: | ||||
|         //扣分时实时播报语音(0-否+1-是)
 | ||||
|         if(judgeConfigObj['418'] == '1'){ | ||||
|         if(judgeConfigObj['418'] == '1' || judgeConfig.kfVoiceOpen){ | ||||
|           avPlayer.playAudio([`voice/${kf[kfLen -1].markcatalog}.mp3`]) | ||||
|         } | ||||
|         await judgeTask.addTask(async () => { | ||||
| @ -643,6 +646,7 @@ export default class Judge { | ||||
|     const {isExam,judgeUI,endExam,handleSEP,kfArr,avPlayer,judgeTask} = this; | ||||
|     const singlePlay = globalThis.singlePlay | ||||
|     const {judgeConfigObj,totalScore,} = judgeUI | ||||
|     this.judgeUI.loadingPopupVisible = true; | ||||
| 
 | ||||
|     if (judgeConfigObj['344'] == 1) { | ||||
|       Prompt.showToast({ | ||||
| @ -651,7 +655,8 @@ export default class Judge { | ||||
|       }); | ||||
|       return | ||||
|     } | ||||
| 
 | ||||
|     //结束评判函数
 | ||||
|     await examJudgeEndExam(); | ||||
|     //TODO 科目三考试合格 考官综合评判
 | ||||
| 
 | ||||
|     //TODO 语音播放扣分项
 | ||||
| @ -676,8 +681,6 @@ export default class Judge { | ||||
|             const bytes = await this.getMessageHeartbeat(true); | ||||
|             globalThis.judgeUdp.send(bytes) | ||||
|           } | ||||
|           //结束评判函数
 | ||||
|           await examJudgeEndExam(); | ||||
|           globalThis.isJudge = false | ||||
|           //TODO endExam函数逻辑待验证
 | ||||
|           !singlePlay && await endExam(isManual) | ||||
|  | ||||
| @ -9,10 +9,11 @@ export const judgeConfig = { | ||||
|   // 本地模型地址
 | ||||
|   modelPath: 'models/model_enc', | ||||
|   // 轨迹回放地址
 | ||||
|   // trajectoryPath: 'logs/2024_07_08/0000000000001_342323199501470011_测试学员1_2024_07_08_14_59_51/judge_exam_data.txt',
 | ||||
|   trajectoryPath: 'logs/2024_07_08/0000000000001_342323199501470011_测试学员1_2024_07_09_14_49_36/judge_exam_data.txt', | ||||
|   // trajectoryPath: 'logs/2024_07_11/0000000000001_342323199501470011_测试学员1_2024_07_11_14_25_52/judge_exam_data.txt',
 | ||||
|   // trajectoryPath: 'logs/2024_07_11/0000000000001_342323199501470011_测试学员1_2024_07_01_11_30_16/judge_exam_data.txt',
 | ||||
|   trajectoryPath: 'logs/2024_07_11/0000000000001_342323199501470011_测试学员1_2024_07_11_14_25_52/judge_exam_data.txt', | ||||
|   //扣分语音是否强制开启
 | ||||
|   kfVoiceOpen:false, | ||||
|   //TODO 济南临时特殊配置
 | ||||
|   systemParamConfig:{ | ||||
| 
 | ||||
|   } | ||||
|   systemParamConfig:{} | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user