diff --git a/entry/src/main/cpp/BUILD.gn b/entry/src/main/cpp/BUILD.gn index 5e30cdf1..0c6ada09 100644 --- a/entry/src/main/cpp/BUILD.gn +++ b/entry/src/main/cpp/BUILD.gn @@ -1,4 +1,4 @@ -# FFmpeg build +# judge library build import("//build/ohos.gni") @@ -14,24 +14,21 @@ ohos_source_set("judge_dynamic") { "sdk/api/js/JSTypedef.cpp", "sdk/api/platform/JudgeApiFactory.cpp", "sdk/api/platform/JudgeSdk.cpp", - "sdk/common/CleverHelper.cpp", + "sdk/common/CostTimeHelper.cpp", "sdk/common/CryptoAlgorithm.cpp", - "sdk/common/HSystem.cpp", - "sdk/common/HVersion.cpp", "sdk/common/Loggerxx.cpp", + "sdk/common/ProfilerHelper.cpp", + "sdk/common/TAssert.cpp", "sdk/common/TQueue.cpp", "sdk/common/TimerPool.cpp", "sdk/common/Tools.cpp", - "sdk/database/IDBTables.cpp", "sdk/database/carinfo/CarInfoTable.cpp", - "sdk/database/iteminfo/ItemInfoTable.cpp", - "sdk/database/mappoint/MapPointItemTable.cpp", - "sdk/database/mappoint/MapPointTable.cpp", + "sdk/database/mark/MarkItemRule.cpp", "sdk/database/mark/MarkTable.cpp", "sdk/database/sysparm/SysParmTable.cpp", "sdk/database/sysset/SysSetTable.cpp", - "sdk/exam/ExamCarSub2.cpp", - "sdk/exam/ExamCarSub3.cpp", + "sdk/database/sysset/XSysSet.cpp", + "sdk/exam/ExamCar.cpp", "sdk/exam/ExamDatagram.cpp", "sdk/exam/ExamHistory.cpp", "sdk/exam/ExamSensor.cpp", @@ -42,55 +39,29 @@ ohos_source_set("judge_dynamic") { "sdk/graphic/IGraphicAbstract.cpp", "sdk/judge/IJudgeBrokerInterface.cpp", "sdk/judge/IJudgeItem.cpp", - "sdk/judge/sub2/ISub2JudgeItem.cpp", - "sdk/judge/sub2/ISub2JudgeWrap.cpp", - "sdk/judge/sub2/Sub2Judge00Dcrk.cpp", - "sdk/judge/sub2/Sub2Judge02Pdqb.cpp", - "sdk/judge/sub2/Sub2Judge03Cftc.cpp", - "sdk/judge/sub2/Sub2Judge05Qxxs.cpp", - "sdk/judge/sub2/Sub2Judge06Zjzw.cpp", - "sdk/judge/sub2/Sub2Judge20Comm.cpp", - "sdk/judge/sub3/ISub3JudgeItem.cpp", - "sdk/judge/sub3/ISub3JudgeWrap.cpp", - "sdk/judge/sub3/Sub3Judge01Sczb.cpp", - "sdk/judge/sub3/Sub3Judge02Qbxx.cpp", - "sdk/judge/sub3/Sub3Judge03Zxxs.cpp", - "sdk/judge/sub3/Sub3Judge04Bgcd.cpp", - "sdk/judge/sub3/Sub3Judge05Lkzx.cpp", - "sdk/judge/sub3/Sub3Judge06Rxhd.cpp", - "sdk/judge/sub3/Sub3Judge07Xxqy.cpp", - "sdk/judge/sub3/Sub3Judge08Gjzt.cpp", - "sdk/judge/sub3/Sub3Judge09Hcxx.cpp", - "sdk/judge/sub3/Sub3Judge10Ccxx.cpp", - "sdk/judge/sub3/Sub3Judge11Kbtc.cpp", - "sdk/judge/sub3/Sub3Judge12Dtxx.cpp", - "sdk/judge/sub3/Sub3Judge12Lkdt.cpp", - "sdk/judge/sub3/Sub3Judge12Ptdt.cpp", - "sdk/judge/sub3/Sub3Judge13Yjxs.cpp", - "sdk/judge/sub3/Sub3Judge14Jjdw.cpp", - "sdk/judge/sub3/Sub3Judge15Lkzz.cpp", - "sdk/judge/sub3/Sub3Judge16Lkyz.cpp", - "sdk/judge/sub3/Sub3Judge20Comm.cpp", - "sdk/judge/sub3/Sub3Judge41Mndg.cpp", + "sdk/judge/JudgeItemFactory.cpp", + "sdk/judge/sub2/ISub2Judge.cpp", + "sdk/judge/sub2/Sub2JudgeCftc.cpp", + "sdk/judge/sub2/Sub2JudgeComm.cpp", + "sdk/judge/sub2/Sub2JudgeDcrk.cpp", + "sdk/judge/sub2/Sub2JudgePdqb.cpp", + "sdk/judge/sub2/Sub2JudgeQxxs.cpp", + "sdk/judge/sub2/Sub2JudgeZjzw.cpp", + "sdk/judge/sub3/ISub3Judge.cpp", "sdk/parser/XIParser.cpp", "sdk/parser/XParser.cpp", "sdk/parser/XParser2.cpp", "sdk/survey/ISurveyCar.cpp", "sdk/survey/ISurveyItem.cpp", - "sdk/survey/ISurveySubject.cpp", + "sdk/survey/SurveyFactory.cpp", "sdk/survey/car/SurveyCar.cpp", - "sdk/survey/sub2/ISub2SurveyFactory.cpp", "sdk/survey/sub2/ISub2SurveyItem.cpp", "sdk/survey/sub2/Sub2SurveyCftc.cpp", "sdk/survey/sub2/Sub2SurveyDcrk.cpp", "sdk/survey/sub2/Sub2SurveyPdqb.cpp", "sdk/survey/sub2/Sub2SurveyQxxs.cpp", "sdk/survey/sub2/Sub2SurveyZjzw.cpp", - "sdk/survey/sub3/ISub3SurveyFactory.cpp", "sdk/survey/sub3/ISub3SurveyItem.cpp", - "sdk/survey/sub3/Sub3MeshDefines.cpp", - "sdk/survey/sub3/Sub3SurveyRoads.cpp", - "sdk/survey/sub3/Sub3SurveySharps.cpp", "sdk/track/TrackReader.cpp", "sdk/track/TrackWriter.cpp", "sdk/utility/Geometry.cpp", @@ -108,7 +79,7 @@ ohos_source_set("judge_dynamic") { "third/libb64/base64.cpp", "third/libb64/cdecode.c", "third/libb64/cencode.c", - "third/tinyxml2-9.0.0/tinyxml2.cpp", + "third/tinyxml2-9.0.0/tinyxml2.cpp" ] include_dirs = [ "sdk", @@ -121,8 +92,6 @@ ohos_source_set("judge_dynamic") { "sdk/common", "sdk/database", "sdk/database/carinfo", - "sdk/database/iteminfo", - "sdk/database/mappoint", "sdk/database/mark", "sdk/database/sysparm", "sdk/database/sysset", @@ -164,30 +133,24 @@ ohos_source_set("judge_dynamic") { "__OHOS_FAMILY__", ] cflags = [ - "-Wno-implicit-fallthrough", - "-Wno-unused-private-field", - "-Wunknown-warning-option", - "-Wno-unused-const-variable", "-Wno-unused-variable", "-Wno-deprecated-declarations", "-Wno-unused-command-line-argument", "-Wno-tautological-constant-out-of-range-compare", "-Wno-unused-function", "-Wno-unused-parameter", + "-Wno-unused-but-set-variable", "-fexceptions", ] cflags_cc = [ - "-Wno-implicit-fallthrough", - "-Wno-unused-private-field", - "-Wunknown-warning-option", - "-Wno-unused-const-variable", "-Wno-unused-variable", "-Wno-deprecated-declarations", "-Wno-unused-command-line-argument", "-Wno-tautological-constant-out-of-range-compare", "-Wno-unused-function", "-Wno-unused-parameter", + "-Wno-unused-but-set-variable", "-fexceptions", "-std=c++17", "-stdlib=libc++", diff --git a/entry/src/main/cpp/bin/extract_h_cpp_files.txt b/entry/src/main/cpp/bin/extract_h_cpp_files.txt index 9c3c0abc..a1a4940c 100644 --- a/entry/src/main/cpp/bin/extract_h_cpp_files.txt +++ b/entry/src/main/cpp/bin/extract_h_cpp_files.txt @@ -8,24 +8,23 @@ "sdk/api/js/JSTypedef.cpp", "sdk/api/platform/JudgeApiFactory.cpp", "sdk/api/platform/JudgeSdk.cpp", - "sdk/common/CleverHelper.cpp", + "sdk/common/CostTimeHelper.cpp", "sdk/common/CryptoAlgorithm.cpp", - "sdk/common/HSystem.cpp", - "sdk/common/HVersion.cpp", "sdk/common/Loggerxx.cpp", + "sdk/common/ProfilerHelper.cpp", + "sdk/common/TAssert.cpp", "sdk/common/TQueue.cpp", "sdk/common/TimerPool.cpp", "sdk/common/Tools.cpp", - "sdk/database/IDBTables.cpp", + "sdk/database/IDatabaseTable.cpp", "sdk/database/carinfo/CarInfoTable.cpp", - "sdk/database/iteminfo/ItemInfoTable.cpp", "sdk/database/mappoint/MapPointItemTable.cpp", "sdk/database/mappoint/MapPointTable.cpp", + "sdk/database/mark/MarkItemRule.cpp", "sdk/database/mark/MarkTable.cpp", "sdk/database/sysparm/SysParmTable.cpp", "sdk/database/sysset/SysSetTable.cpp", - "sdk/exam/ExamCarSub2.cpp", - "sdk/exam/ExamCarSub3.cpp", + "sdk/exam/ExamCar.cpp", "sdk/exam/ExamDatagram.cpp", "sdk/exam/ExamHistory.cpp", "sdk/exam/ExamSensor.cpp", @@ -36,36 +35,15 @@ "sdk/graphic/IGraphicAbstract.cpp", "sdk/judge/IJudgeBrokerInterface.cpp", "sdk/judge/IJudgeItem.cpp", - "sdk/judge/sub2/ISub2JudgeItem.cpp", - "sdk/judge/sub2/ISub2JudgeWrap.cpp", - "sdk/judge/sub2/Sub2Judge00Dcrk.cpp", - "sdk/judge/sub2/Sub2Judge02Pdqb.cpp", - "sdk/judge/sub2/Sub2Judge03Cftc.cpp", - "sdk/judge/sub2/Sub2Judge05Qxxs.cpp", - "sdk/judge/sub2/Sub2Judge06Zjzw.cpp", - "sdk/judge/sub2/Sub2Judge20Comm.cpp", - "sdk/judge/sub3/ISub3JudgeItem.cpp", - "sdk/judge/sub3/ISub3JudgeWrap.cpp", - "sdk/judge/sub3/Sub3Judge01Sczb.cpp", - "sdk/judge/sub3/Sub3Judge02Qbxx.cpp", - "sdk/judge/sub3/Sub3Judge03Zxxs.cpp", - "sdk/judge/sub3/Sub3Judge04Bgcd.cpp", - "sdk/judge/sub3/Sub3Judge05Lkzx.cpp", - "sdk/judge/sub3/Sub3Judge06Rxhd.cpp", - "sdk/judge/sub3/Sub3Judge07Xxqy.cpp", - "sdk/judge/sub3/Sub3Judge08Gjzt.cpp", - "sdk/judge/sub3/Sub3Judge09Hcxx.cpp", - "sdk/judge/sub3/Sub3Judge10Ccxx.cpp", - "sdk/judge/sub3/Sub3Judge11Kbtc.cpp", - "sdk/judge/sub3/Sub3Judge12Dtxx.cpp", - "sdk/judge/sub3/Sub3Judge12Lkdt.cpp", - "sdk/judge/sub3/Sub3Judge12Ptdt.cpp", - "sdk/judge/sub3/Sub3Judge13Yjxs.cpp", - "sdk/judge/sub3/Sub3Judge14Jjdw.cpp", - "sdk/judge/sub3/Sub3Judge15Lkzz.cpp", - "sdk/judge/sub3/Sub3Judge16Lkyz.cpp", - "sdk/judge/sub3/Sub3Judge20Comm.cpp", - "sdk/judge/sub3/Sub3Judge41Mndg.cpp", + "sdk/judge/JudgeItemFactory.cpp", + "sdk/judge/sub2/ISub2Judge.cpp", + "sdk/judge/sub2/Sub2JudgeCftc.cpp", + "sdk/judge/sub2/Sub2JudgeComm.cpp", + "sdk/judge/sub2/Sub2JudgeDcrk.cpp", + "sdk/judge/sub2/Sub2JudgePdqb.cpp", + "sdk/judge/sub2/Sub2JudgeQxxs.cpp", + "sdk/judge/sub2/Sub2JudgeZjzw.cpp", + "sdk/judge/sub3/ISub3Judge.cpp", "sdk/parser/XIParser.cpp", "sdk/parser/XParser.cpp", "sdk/parser/XParser2.cpp", @@ -115,7 +93,6 @@ "sdk/common", "sdk/database", "sdk/database/carinfo", - "sdk/database/iteminfo", "sdk/database/mappoint", "sdk/database/mark", "sdk/database/sysparm", diff --git a/entry/src/main/cpp/sdk/exam/ExamCarSub2.cpp b/entry/src/main/cpp/sdk/exam/ExamCarSub2.cpp index c5836e04..3a917283 100644 --- a/entry/src/main/cpp/sdk/exam/ExamCarSub2.cpp +++ b/entry/src/main/cpp/sdk/exam/ExamCarSub2.cpp @@ -152,7 +152,7 @@ ErrorCode ExamCarSub2::examSoundEnd(ExamItemCode itemno, const std::string& code { //科二不支持语音播报结束调用 TASSERT(false, "not-support!itemno=%d,code=%s,type=%d",itemno, code.c_str(), type); - return QE(errorArtifSoundEnd); + return QE(errorSoundEnd); } bool ExamCarSub2::examDrawMap() diff --git a/entry/src/main/cpp/sdk/exam/ExamCarSub3.cpp b/entry/src/main/cpp/sdk/exam/ExamCarSub3.cpp index 6363f622..418b2846 100644 --- a/entry/src/main/cpp/sdk/exam/ExamCarSub3.cpp +++ b/entry/src/main/cpp/sdk/exam/ExamCarSub3.cpp @@ -165,7 +165,7 @@ ErrorCode ExamCarSub3::examJudgeExam() ErrorCode ExamCarSub3::examArtifMark(ExamItemCode itemno, const std::string& serial) { - Mark(itemno, serial, false, true); + judgeMark(itemno, serial, false, true, true, 1); return QE(codeSuccess); } @@ -201,14 +201,15 @@ ErrorCode ExamCarSub3::examSoundEnd(ExamItemCode itemno, const std::string& code item41->playSoundEnd(code); } } + return QE(codeSuccess); } else { loginfo("sound-end itemno=%d, code=%s, type=%d", itemno, code.c_str(), type); - return QE(errorArtifSoundArg); + return QE(errorSoundArg); } - return QE(errorArtifSoundEnd); + return QE(errorSoundEnd); } @@ -1144,8 +1145,9 @@ void ExamCarSub3::Deal_KM3_Judge() // return; //} - const TGpsInfo& gps = historyGps(); - const TGpsInfo& gps1 = historyGps(1); + TChuanGan* his1 = historyChuanGan(1); + const TGpsInfo& gps = m_cg->real.gps; + const TGpsInfo& gps1 = his1->real.gps; if(gps.jd > 1 && gps.wd > 1 && gps1.jd > 1 && gps1.wd > 1) //rtkEnabled() { //1、计算考车位置 @@ -1165,10 +1167,24 @@ void ExamCarSub3::Deal_KM3_Judge() calcDistance(); //Calc_KM3JL() Km3NewEnterItem(); + + + { + //车道或路段变化事件 + const TRTKResult& rtk = m_cg->RTKKM3; + const TRTKResult& rtk1 = his1->RTKKM3; + if(rtk.MapRoad_Code_No != rtk1.MapRoad_Code_No || + rtk.BasePointInLaneNo != rtk1.BasePointInLaneNo || + rtk.BaseLaneCount != rtk1.BaseLaneCount) + { + createEventLane({rtk.MapRoad_Code_No.c_str(), rtk.BasePointInLaneNo, rtk.BaseLaneCount}); + } + } } m_KsLjLc = m_stuInfo.yklc + m_cg->ai_ljjl; m_cg->tkCnt = GetCurrentTick2(); + m_cg->RTKKM3.CrossPointNo = lastCrossPtNo(); //ToDo1:执行通用评判 m_commItem->dealJudgeItem(); @@ -3843,7 +3859,7 @@ void ExamCarSub3::KM3EndItem(int ItemNo) createEventFinishItem({examItem->ItemNo, "", markFlag ? 0 : 1}); } -bool ExamCarSub3::Mark(int ItemNo, const std::string& serial, bool OnlyOneID, bool ForceID, int8 Kind) +bool ExamCarSub3::judgeMark(int ItemNo, const std::string& serial, bool OnlyOneID, bool ForceID, bool event, int8 Kind) { //Kind:0 自动评判 1:考车人工扣分 2:远程下发的考试扣分 bool result = false; @@ -4125,7 +4141,10 @@ bool ExamCarSub3::Mark(int ItemNo, const std::string& serial, bool OnlyOneID, bo //ToDo:通知上层播报扣分语音或者上层自己去判断是否播报扣分语音 } - createEventMarkItem({mark.itemNo, mark.serial, mark.catalog}); + if(event) + { + createEventMarkItem({mark.itemNo, mark.serial, mark.catalog}); + } result = true; } diff --git a/entry/src/main/cpp/sdk/exam/ExamCarSub3.h b/entry/src/main/cpp/sdk/exam/ExamCarSub3.h index 65081164..7409ebfa 100644 --- a/entry/src/main/cpp/sdk/exam/ExamCarSub3.h +++ b/entry/src/main/cpp/sdk/exam/ExamCarSub3.h @@ -38,7 +38,7 @@ public: //for IExamCarSub3 override virtual bool allItemFinish() override; virtual ISub3JudgeItem* currentItem() const noexcept override { return m_curItem; } virtual ISub3JudgeItem* commItem() const noexcept override { return m_commItem; } - bool Mark(int ItemNo, const std::string& serial, bool OnlyOneID=false, bool ForceID=false, int8 Kind=0) override; + bool judgeMark(int ItemNo, const std::string& serial, bool OnlyOneID=false, bool ForceID=false, bool event=true, int8 Kind=0) override; virtual const std::map& allExamItem() const noexcept override { return m_sub3Items; } virtual bool isCrossroadExaming() const override; @@ -151,11 +151,6 @@ private: TCar m_car; TTestCtl m_ctl; - //TCarStatus m_carStatus; - - //int64 m_ContinuedStartTime = 0; //续考的上次开始考试时间 20150205 - //bool m_BContinued = false; //是否是续考 20150205 - //int m_ContinuedSjjg = 0; //续考时间间隔多少秒 20150205 std::vector m_carPosMeshList; const int m_DrawArc_Step = 40; @@ -180,12 +175,17 @@ private: bool PubCanJudge_XiHuoFlag = true; //注意初始必须是true int PubKaoBianTCFinish_LJJL = 0; + int m_SNO = 0; + + //TCarStatus m_carStatus; + + //int64 m_ContinuedStartTime = 0; //续考的上次开始考试时间 20150205 + //bool m_BContinued = false; //是否是续考 20150205 + //int m_ContinuedSjjg = 0; //续考时间间隔多少秒 20150205 //bool FinishKM3Flag = false; //int Test_Status; //考试中状态 0-考试中 1-考试结束,评判不继续 2-考试结束,继续评判(一般用于训练) //int64 m_StartTime = 0; - int m_SNO = 0; - }; #endif // EXAMCARSUB3_H diff --git a/entry/src/main/cpp/sdk/exam/ExamSensor.cpp b/entry/src/main/cpp/sdk/exam/ExamSensor.cpp index 2f2f5a50..122ac487 100644 --- a/entry/src/main/cpp/sdk/exam/ExamSensor.cpp +++ b/entry/src/main/cpp/sdk/exam/ExamSensor.cpp @@ -209,9 +209,19 @@ bool ExamSensor::convertDatas(TChuanGan* cg) } gps.errorFlag = false; - //return gps.rtkEnabled == true && gps.errorFlag == false; //不能如果不在差分,行驶距离什么的计算都不对 yhy 2024-06-18 - return true; //yhy 2024-04-30 - //return !Tools::isZero(gps.jd) && !Tools::isZero(gps.wd); + // return gps.rtkEnabled == true && gps.errorFlag == false; //不能如果不在差分,行驶距离什么的计算都不对 yhy 2024-06-18 + // return true; //yhy 2024-04-30 + // return !Tools::isZero(gps.jd) && !Tools::isZero(gps.wd); + ExamSubject sub = m_car->examSubject(); + if(ExamSubject2 == sub) + { + return gps.rtkEnabled == true && gps.jd > 1 && gps.wd > 1; + } + else if(ExamSubject3 == sub) + { + return true; + } + return true; } bool ExamSensor::calcCarBody(TChuanGan* cg) @@ -284,6 +294,14 @@ bool ExamSensor::calcCarBody(TChuanGan* cg) { cg->real.gps.ai_gps = Pointi(x, y); } + else + { + if(m_car->historyCount() == 0) + { + return false; //第一帧数据就是非差分状态? + } + cg->real.gps.ai_gps = m_car->historyAiGps(); //20240702 yhy + } if(ExamSubject2 == subject) { @@ -391,6 +409,12 @@ bool ExamSensor::GetCarDirStauts(TChuanGan* cg) } } + if(cg->real.gps.rtkEnabled == false) //20240702 yhy + { + cg->move = m_car->historyChuanGan()->move; + return true; + } + //if(cg.Rtk_Enabled = False) or (Lscg[zj(1)].Rtk_Enabled = False) or (Lscg[zj(2)].Rtk_Enabled = False) then Exit; if(cg->move == moveStop && cg->real.gps.rtkEnabled == false) { @@ -527,8 +551,8 @@ CarMoveState ExamSensor::calcMoveState() ExamCarType carType = m_car->carType(); if(IS_C1C2C5(carType) || IS_B1(carType) || IS_B2(carType) || IS_A1(carType) || IS_A3(carType)) //我们目前是C1,C2,C5车型,后续的车型做到再说 { - const TGPSPoint& hb = m_car->historyCarBody(II(13), 2); //拿到历史2帧的车身13点经纬度 - //const TGPSPoint hb = GpsMath::calcCenterPoint(m_car->historyCarBody(II(27), 2), m_car->historyCarBody(II(31), 2)); //LS2CheWeiZhongXinPt + //const TGPSPoint& hb = m_car->historyCarBody(II(13), 2); //拿到历史2帧的车身13点经纬度 + const TGPSPoint hb = GpsMath::calcCenterPoint(m_car->historyCarBody(II(27), 2), m_car->historyCarBody(II(31), 2)); //LS2CheWeiZhongXinPt const TGPSPoint& his = m_car->historyCarBody(II(1), 1); //拿到历史1帧的车身1点经纬度 const TGPSPoint& cur = m_car->historyCarBody(II(1), 0); //拿到当前1帧的车身1点经纬度 double hisDis = GpsMath::calcGpsDistanceCM(his, hb, gc); diff --git a/entry/src/main/cpp/sdk/exam/IExamCar.cpp b/entry/src/main/cpp/sdk/exam/IExamCar.cpp index be443c6f..5a9f480e 100644 --- a/entry/src/main/cpp/sdk/exam/IExamCar.cpp +++ b/entry/src/main/cpp/sdk/exam/IExamCar.cpp @@ -68,8 +68,10 @@ int IExamCar::examJudgeBeginExam(const char* data, int len) { char tag[256] = {0}; - SafeSprintf(tag, sizeof(tag), "target sfzmhm=%s, kscx=%s, kskm=%d, kchm=%d, kchp=%s", - m_stuInfo.sfzmhm.c_str(), m_carInfo->kscx.c_str(), m_carInfo->kskm, m_carInfo->kchm, m_carInfo->kchp.c_str()); + //SafeSprintf(tag, sizeof(tag), "target sfzmhm=%s, kscx=%s, kskm=%d, kchm=%d, kchp=%s", + // m_stuInfo.sfzmhm.c_str(), m_carInfo->kscx.c_str(), m_carInfo->kskm, m_carInfo->kchm, m_carInfo->kchp.c_str()); + // + SafeSprintf(tag, sizeof(tag), "target sfzmhm=%s", m_stuInfo.sfzmhm.c_str()); m_target = tag; } @@ -152,7 +154,7 @@ int IExamCar::examJudgeEndExam() int IExamCar::examJudgeRealExam(const char* data, int len) { - IAutoLock(m_mtx); + //IAutoLock(m_mtx); m_handle->addRealtime(Package::v1_json, data, len); return QE(codeSuccess); } @@ -334,7 +336,7 @@ void IExamCar::createEventSound(const TEventSound& event) exam.sound = event; std::string data = m_parser->toDataString(exam); FactoryExamService->examJudgeCallbackRealExamToCaller(data.c_str(), data.size()); - logtrace("sound-event %s itemno=%d, code=%s", target().c_str(), event.xmdm, event.code.c_str()); + logtrace("sound-event %s itemno=%d, code=%s, type=%d", target().c_str(), event.xmdm, event.code.c_str(), event.type); } void IExamCar::createEventLight(const TEventLight& event) @@ -345,7 +347,18 @@ void IExamCar::createEventLight(const TEventLight& event) exam.mndg = event; std::string data = m_parser->toDataString(exam); FactoryExamService->examJudgeCallbackRealExamToCaller(data.c_str(), data.size()); - logtrace("sound-light %s item=%d", target().c_str(), exam.mndg.c_str()); + logtrace("event-light %s item=%s", target().c_str(), exam.mndg.c_str()); +} + +void IExamCar::createEventLane(const TEventLane& event) +{ + TJudgeData exam; + exam.event = ExamEventTypeLane; + exam.sj = GetCurrentTime2(); + exam.lane = event; + std::string data = m_parser->toDataString(exam); + FactoryExamService->examJudgeCallbackRealExamToCaller(data.c_str(), data.size()); + logtrace("event-lane %s road=%s,num=%d,count=%d", target().c_str(), event.road.c_str(), event.num, event.count); } void IExamCar::examPerformSummary() @@ -360,8 +373,11 @@ void IExamCar::examPerformSummary() exam.dxjl = dis.x*10; //单位毫米 所以要乘10 exam.bxjl = dis.y*10; //单位毫米 所以要乘10 exam.hint = m_message; + exam.lane = historyChuanGan()->RTKKM3; + std::string data = m_parser->toDataString(exam); FactoryExamService->examJudgeCallbackPerformToCaller(data.c_str(), data.size()); + //logdebug("perform-summary %s data=%s", target().c_str(), data.c_str()); } void IExamCar::doExamDatagram(Package* pkg) @@ -470,6 +486,8 @@ void IExamCar::calcDistance() m_cg->ai_dcjl_cm = m_disBackward; m_cg->ai_ljjl = m_disForward/100.0; m_cg->ai_dcjl = m_disBackward/100.0; + + //logdebug("calcDistance state=%d a=%d", state, a); } int64 IExamCar::GetCurrentTime2() const diff --git a/entry/src/main/cpp/sdk/exam/IExamCar.h b/entry/src/main/cpp/sdk/exam/IExamCar.h index cb12de0b..e2085acd 100644 --- a/entry/src/main/cpp/sdk/exam/IExamCar.h +++ b/entry/src/main/cpp/sdk/exam/IExamCar.h @@ -53,6 +53,7 @@ public: virtual void createEventCancelItem(const TEventCancelItem& event) override; virtual void createEventSound(const TEventSound& event) override; virtual void createEventLight(const TEventLight& event) override; + virtual void createEventLane(const TEventLane& event) override; virtual void examPerformSummary() override; @@ -207,7 +208,7 @@ public: //通用评判项目对象,只要是考试状态不会是NULL virtual ISub3JudgeItem* commItem() const = 0; //Kind:0 自动评判 1:考车人工扣分 2:远程下发的考试扣分 - virtual bool Mark(int ItemNo, const std::string& MarkSerial, bool OnlyOneID=false, bool ForceID=false, int8 Kind=0) = 0; + virtual bool judgeMark(int ItemNo, const std::string& MarkSerial, bool OnlyOneID=false, bool ForceID=false, bool event=true, int8 Kind=0) = 0; virtual const std::map& allExamItem() const = 0; //路口项目是否正考,如果路口项目没有结束 diff --git a/entry/src/main/cpp/sdk/exam/IExamCarAbstract.h b/entry/src/main/cpp/sdk/exam/IExamCarAbstract.h index fdfcaa75..4d7a0612 100644 --- a/entry/src/main/cpp/sdk/exam/IExamCarAbstract.h +++ b/entry/src/main/cpp/sdk/exam/IExamCarAbstract.h @@ -40,6 +40,8 @@ public: virtual void createEventSound(const TEventSound& event) = 0; //模拟灯光事件 virtual void createEventLight(const TEventLight& event) = 0; + //车道和路段变化事件 + virtual void createEventLane(const TEventLane& event) = 0; //考试过程数据 virtual void examPerformSummary() = 0; diff --git a/entry/src/main/cpp/sdk/judge/sub3/ISub3JudgeWrap.h b/entry/src/main/cpp/sdk/judge/sub3/ISub3JudgeWrap.h index 99e99761..fdab2ff0 100644 --- a/entry/src/main/cpp/sdk/judge/sub3/ISub3JudgeWrap.h +++ b/entry/src/main/cpp/sdk/judge/sub3/ISub3JudgeWrap.h @@ -31,13 +31,13 @@ class JUDGE_API ISub3JudgeWrap : public ISub3JudgeItem { //itemno, serial, once, force - #define JUDGE_MARK_SUB3(itemno, serial, ...) \ - { \ - if(m_car->Mark(JUDGE_VA_ARGS(itemno, serial, ##__VA_ARGS__))) \ - { \ - logtrace("sub3-mark itemno=%d,serial=%s",itemno, serial); \ - } \ - } \ + #define JUDGE_MARK_SUB3(itemno, serial, ...) \ + { \ + if(m_car->judgeMark(JUDGE_VA_ARGS(itemno, serial, ##__VA_ARGS__))) \ + { \ + logtrace("sub3-mark itemno=%d,serial=%s", itemno, serial); \ + } \ + } \ public: explicit ISub3JudgeWrap() = default; diff --git a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge01Sczb.cpp b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge01Sczb.cpp index b04b2706..b6ab1be6 100644 --- a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge01Sczb.cpp +++ b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge01Sczb.cpp @@ -116,7 +116,7 @@ void Sub3Judge01Sczb::dealJudgeItem() const TKfXm& m = sczb_mark[i]; //强制扣分 //JudgeKM3Obj.Mark(StrToInt(Temp1), Temp2, False, True); - JUDGE_MARK_SUB3(m.xmdm, m.kfdm.c_str(), false, true); + JUDGE_MARK_SUB3(m.xmdm, m.kfdm.c_str(), false, true, false); } } m_exam->TestPro = ItemProFlagEnd; @@ -127,7 +127,7 @@ void Sub3Judge01Sczb::dealJudgeItem() const std::string& s364 = TableSysSet->get364(); if(s364 == "2") { - //return; + return; } const TChuanGan* cg = m_car->historyChuanGan(); diff --git a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge04Bgcd.cpp b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge04Bgcd.cpp index 681cf7af..2a02dbf3 100644 --- a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge04Bgcd.cpp +++ b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge04Bgcd.cpp @@ -141,7 +141,7 @@ void Sub3Judge04Bgcd::dealJudgeItem() if(sor.zfxd == SNOT && sor.yfxd == SYES) { - m_itemv.Temp_ZFXD = true; + m_itemv.Temp_YFXD = true; //跟踪3秒前 bool OKFlag = true; for(int i = 1; i <= 14; i++) diff --git a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge20Comm.cpp b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge20Comm.cpp index d6998132..0e662674 100644 --- a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge20Comm.cpp +++ b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge20Comm.cpp @@ -870,8 +870,12 @@ void Sub3Judge20Comm::CallMoNiDengGuang() const std::string s533 = TableSysSet->get533(); if(s533 == "" || s533 == "0") { - //ToDo:语音提示点火 - m_car->createEventSound({itemNo(), sound::sub3_ts_fdj}); + if(cg->tkCnt - m_engineTick > 10*SECOND) //10秒提示一次请启动发动机 + { + m_engineTick = cg->tkCnt; + //ToDo:语音提示点火 + m_car->createEventSound({itemNo(), sound::sub3_ts_fdj}); + } } } } @@ -4441,7 +4445,9 @@ void Sub3Judge20Comm::Judge_QiBu_GuaCuoDang() if(m_car->historyCount() < 2) return; const TChuanGan* cg = m_car->historyChuanGan(); const TChuanGan* his1 = m_car->historyChuanGan(1); - if(cg->move == moveForward && his1->move == moveStop) + const TChuanGan* his5 = m_car->historyChuanGan(5); + const TChuanGan* his10 = m_car->historyChuanGan(10); + if(cg->move == moveForward && his1->move == moveStop && his5->move == moveStop && his10->move == moveStop) { const TSensorInfo& sor = cg->real.sensor; diff --git a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge20Comm.h b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge20Comm.h index 359bc47f..7764fbb4 100644 --- a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge20Comm.h +++ b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge20Comm.h @@ -222,8 +222,9 @@ private: int64 m_PubLastMark_XuXian_TK = 0; - const int m_LaneChangeTime = 10; //连续变道时间 单位秒 杨海洋增加 + + int64 m_engineTick = 0; //提示启动发动机时刻 }; #endif // SUB3JUDGE20COMM_H diff --git a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge41Mndg.cpp b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge41Mndg.cpp index 83fa2473..39e44c01 100644 --- a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge41Mndg.cpp +++ b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge41Mndg.cpp @@ -26,7 +26,7 @@ bool Sub3Judge41Mndg::dealJudgeEnter() } const TGpsInfo& gps = m_car->historyGps(); - setSeed(gps.sj); + setSeed(gps.sj); //240709 gps.sj //加载合法的灯光 //参考头文件注释说明[灯光类型] // m_lights = @@ -61,7 +61,7 @@ bool Sub3Judge41Mndg::dealJudgeEnter() {"yj331", sound::sub3_417005}, //夜间直行通过路口(在有交通信号灯控制的路口直行) {"yj332", sound::sub3_4170017}, //夜间路口左转弯 {"yj333", sound::sub3_4170018}, //夜间路口右转弯 - {"yj341", sound::sub3_4170019}, //夜间在有路灯的道路上行驶 + {"yj341", sound::sub3_4170019}, //夜间在有路灯的道路上行驶 xxxx {"yj342", sound::sub3_417006}, //夜间在照明良好的道路上行驶 {"yj351", ""}, //请打开近光灯, !!!石家庄*删除 @@ -141,6 +141,7 @@ bool Sub3Judge41Mndg::dealJudgeEnter() void Sub3Judge41Mndg::dealJudgeItem() { HELP_COST_TIME(""); + if(m_exam->TestPro != ItemProFlagJudge) return; //回放模式 这里要从轨迹文件加载灯光项目 @@ -160,9 +161,13 @@ void Sub3Judge41Mndg::dealJudgeItem() const TGpsInfo& gps1 = his1->real.gps; const std::string& ksdd = TableSysSet->get211(); - if(sor.wav > 0) + //调试代码 + if(gps.sj - m_lastDealTick > 5*SECOND) { - logtrace("mndg-sound wavend=%d", sor.wav); + m_lastDealTick = gps.sj; + + logtrace("mndg-tick-Op_Step=%d,ItemStatus=%d,Item=%d%d%d", m_itemv.Op_Step,m_itemv.ItemStatus, + m_itemv.ItemNo,m_itemv.SubWav1,m_itemv.SubWav2); } if(ksdd == siteof::zjnb) @@ -265,6 +270,7 @@ void Sub3Judge41Mndg::dealJudgeItem() } else if(m_itemv.ItemNo == 100) //灯光结束 { + logtrace("mndg-item-end"); m_exam->TestPro = ItemProFlagEnd; if(m_car->isExamDrill()) //训练模式 { @@ -294,10 +300,14 @@ void Sub3Judge41Mndg::dealJudgeItem() } } } + else + { + logerror("mndg-error-Op_Step=%d,ItemNo=%d,Status=%d",m_itemv.Op_Step, m_itemv.ItemNo, m_itemv.ItemStatus); + } char buf[128] = {0}; - SafeSprintf(buf, sizeof(buf), "Step=%d,Data=%s,Wav=%d%d%d.wav", - m_itemv.Op_Step, m_itemv.Op_Rd_str.c_str(),m_itemv.ItemNo,m_itemv.SubWav1,m_itemv.SubWav2); + SafeSprintf(buf, sizeof(buf), "Step=%d,Status=%d,Data=%s,Wav=%d%d%d.wav", + m_itemv.Op_Step,m_itemv.ItemStatus,m_itemv.Op_Rd_str.c_str(),m_itemv.ItemNo,m_itemv.SubWav1,m_itemv.SubWav2); showStatus(buf); } @@ -527,6 +537,8 @@ void Sub3Judge41Mndg::UpdateDengGuangChange() //0、统一调度 void Sub3Judge41Mndg::CallItemProc() { + logtrace("mndg-Op_Step CallItemProc"); + const TChuanGan* cg = m_car->historyChuanGan(); const TGpsInfo& gps = cg->real.gps; const TSensorInfo& sor = cg->real.sensor; @@ -581,6 +593,9 @@ void Sub3Judge41Mndg::CallItemProc() { m_itemv.ItemNo = 100; } + + logtrace("mndg-item-Op_Step=%d,ItemStatus=%d,Item=%d%d%d", m_itemv.Op_Step,m_itemv.ItemStatus, + m_itemv.ItemNo,m_itemv.SubWav1,m_itemv.SubWav2); } } } @@ -1630,7 +1645,7 @@ void Sub3Judge41Mndg::JiaoTi_DengGuang() else { //20150803 20180205 - if(Tools::pos(siteof::guizhou, ksdd) && m_itemv.SubWav1 == 2 && m_itemv.SubWav2 == 1) + if(Tools::pos(siteof::guizhou, ksdd) && m_itemv.SubWav1 == 2 && m_itemv.SubWav2 == 1) { if(m_itemv.SubWav1 == 2) { @@ -2903,12 +2918,14 @@ void Sub3Judge41Mndg::YuTianXingShi() void Sub3Judge41Mndg::Wait_Snd_End() { + return; + const TChuanGan* cg = m_car->historyChuanGan(); const TGpsInfo& gps = cg->real.gps; const TSensorInfo& sor = cg->real.sensor; //等待语音完成 - if(sor.wav == SYES) //语音结束信号 + //if(sor.wav == SYES) //语音结束信号 { m_itemv.Snd_Wav_End_TM = gps.sj; CSH_DengGuangSubItem(); @@ -3009,6 +3026,7 @@ void Sub3Judge41Mndg::playSoundEnd(const std::string& code) m_itemv.Snd_Wav_End_TM = gps.sj; CSH_DengGuangSubItem(); m_itemv.ItemStatus = m_itemv.ItemStatus + 1; + logtrace("mndg-sound-end code=%s", code.c_str()); } } diff --git a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge41Mndg.h b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge41Mndg.h index 0850a31d..7316bccb 100644 --- a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge41Mndg.h +++ b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge41Mndg.h @@ -220,6 +220,8 @@ private: // 四套灯光语音,随机播放任意一套作为考试题目 const std::string m_s383arg = "0^1^4^"; //383参数 新模拟夜间(次数^错扣^固定^) + int64 m_lastDealTick = 0; + //bool PlaySnd_ID = false; //正在播报语音标志 //int PlaySnd_Cnt = 0, PlaySnd_Cnt1 = 0; //std::set g_lstsound; diff --git a/entry/src/main/cpp/sdk/parser/XParser.cpp b/entry/src/main/cpp/sdk/parser/XParser.cpp index a07753ec..fa530788 100644 --- a/entry/src/main/cpp/sdk/parser/XParser.cpp +++ b/entry/src/main/cpp/sdk/parser/XParser.cpp @@ -227,6 +227,7 @@ bool XParser::parseJudgeData(const std::string& data, TJudgeData& info) CHECK_GET_PARAM(object, "xmqx", info.xmqx); CHECK_GET_PARAM(object, "sound", info.sound); CHECK_GET_PARAM(object, "mndg", info.mndg); + CHECK_GET_PARAM(object, "lane", info.lane); //CHECK_GET_PARAM(object, "kszt", info.kszt); //CHECK_GET_PARAM(object, "dqxm", info.dqxm); @@ -259,6 +260,50 @@ bool XParser::parsePerform(const std::string& data, TPerformData& info) CHECK_GET_PARAM(object, "bxjl", info.bxjl); CHECK_GET_PARAM(object, "hint", info.hint); + const TInitInfo* infos = FactoryExamService->getInitInfo(); + if(infos && ExamSubject2 == infos->kskm) + { + } + else if(infos && ExamSubject3 == infos->kskm) + { + Json::Value& lane = object["lane"]; + + CHECK_GET_PARAM(lane, "MapRoad_Code_No", info.lane.MapRoad_Code_No); //路段组号 + CHECK_GET_PARAM(lane, "MapRoad_Name", info.lane.MapRoad_Name); //路段编码 + CHECK_GET_PARAM(lane, "TouchLineType", info.lane.TouchLineType); + CHECK_GET_PARAM(lane, "TouchDir", info.lane.TouchDir); + CHECK_GET_PARAM(lane, "TouchLineTypeCS", info.lane.TouchLineTypeCS); //车身压线类型 + //CHECK_GET_PARAM(lane, "xxxx", data.lane.TouchLineType); //车身压线方向 + CHECK_GET_PARAM(lane, "BasePointInLaneNo", info.lane.BasePointInLaneNo); + CHECK_GET_PARAM(lane, "BaseLaneCount", info.lane.BaseLaneCount); + CHECK_GET_PARAM(lane, "FrontPointLaneNo", info.lane.FrontPointLaneNo); + CHECK_GET_PARAM(lane, "FrontPointLaneCount", info.lane.FrontPointLaneCount); + //CHECK_GET_PARAM(lane, "xxxxx", info.lane.Body_RB_ToRightEdge); //后点车道:3/4(未找到) + //CHECK_GET_PARAM(lane, "xxxxx", info.lane.Body_RB_ToRightEdge); + CHECK_GET_PARAM(lane, "Body_LF_ToLeftEdge", info.lane.Body_LF_ToLeftEdge); + CHECK_GET_PARAM(lane, "Body_LB_ToLeftEdge", info.lane.Body_LB_ToLeftEdge); + CHECK_GET_PARAM(lane, "Body_RF_ToRightEdge", info.lane.Body_RF_ToRightEdge); + CHECK_GET_PARAM(lane, "Body_RB_ToRightEdge", info.lane.Body_RB_ToRightEdge); + //CHECK_GET_PARAM(lane, "xxxxx", data.lane.Body_RB_ToRightEdge); //右前/后车身边线:560/553(未找到,指车身离右侧路边缘线距离) + //CHECK_GET_PARAM(lane, "xxxxx", data.lane.Body_RB_ToRightEdge); + CHECK_GET_PARAM(lane, "Wheel_RF_ToRightEdge", info.lane.Wheel_RF_ToRightEdge); + CHECK_GET_PARAM(lane, "Wheel_RB_ToRightEdge", info.lane.Wheel_RB_ToRightEdge); + CHECK_GET_PARAM(lane, "Wheel_RF_ToBaseLine", info.lane.Wheel_RF_ToBaseLine); + CHECK_GET_PARAM(lane, "Wheel_RB_ToBaseLine", info.lane.Wheel_RB_ToBaseLine); + CHECK_GET_PARAM(lane, "Wheel_LF_ToRightEdge", info.lane.Wheel_LF_ToRightEdge); + CHECK_GET_PARAM(lane, "Wheel_LB_ToRightEdge", info.lane.Wheel_LB_ToRightEdge); + CHECK_GET_PARAM(lane, "Wheel_LF_ToBaseLine", info.lane.Wheel_LF_ToBaseLine); + CHECK_GET_PARAM(lane, "Wheel_LB_ToBaseLine", info.lane.Wheel_LB_ToBaseLine); + CHECK_GET_PARAM(lane, "BasePointInLaneDir", info.lane.BasePointInLaneDir); + CHECK_GET_PARAM(lane, "CrossLineAttr", info.lane.CrossLineAttr); + //CHECK_GET_PARAM(lane, "xxxxx", info.lane.Body_RB_ToRightEdge); //是否逆向行驶 + CHECK_GET_PARAM(lane, "InShapeAttr", info.lane.InShapeAttr); + CHECK_GET_PARAM(lane, "ShapeNo", info.lane.ShapeNo); //车身相交的形状线号 + //CHECK_GET_PARAM(lane, "xxxxx", info.lane.Body_RB_ToRightEdge); //车轮相交的形状线号 + CHECK_GET_PARAM(lane, "CrossPointNo", info.lane.CrossPointNo); + + } + return true; } @@ -274,6 +319,71 @@ std::string XParser::toDataString(const TPerformData& data) set(root, "dxjl", data.dxjl); set(root, "bxjl", data.bxjl); set(root, "hint", data.hint); + + /* + 路段组号:21(对应MapRoad_Code_No?是个整数) + 路段编码:0-0(对应MapRoad_Name?带符号-) + 车轮压线:0/0(TouchLineType/TouchDir) + 车身碰线:0/0(TouchLineTypeCS/与压线类似) + 基准车道:3/4(BasePointInLaneNo/BaseLaneCount,此点建议从定位天线点调整为车身中心点) + 前点车道:3/4(FrontPointLaneNo/FrontPointLaneCount) + 后点车道:3/4(未找到) + 左前/后车身距离:33/39(Body_LF_ToLeftEdge/Body_LB_ToLeftEdge) + 右前/后车身距离:69/63(Body_RF_ToRightEdge/Body_RB_ToRightEdge) + 右前/后车身边线:560/553(未找到,指车身离右侧路边缘线距离) + 右前/后轮距离:73/65(Wheel_RF_ToRightEdge/Wheel_RB_ToRightEdge) + 右前/后轮边线:564/555(Wheel_RF_ToBaseLine/Wheel_RB_ToBaseLine) + 左前/后轮距离:237/232(Wheel_LF_ToRightEdge/Wheel_LB_ToRightEdge) + 左前/后轮边线:728/722(Wheel_LF_ToBaseLine/Wheel_LB_ToBaseLine) + 车道属性:0/0/1(BasePointInLaneDir/CrossLineAttr/是否逆向行驶) + 形状:0/0/0(InShapeAttr/车身相交的形状线号/车轮相交的形状线号) + 路段点:0(车头穿越的测绘点,如项目点,路段点) + */ + + const TInitInfo* infos = FactoryExamService->getInitInfo(); //FactoryExamService->getExamCar()->examSubject(); + if(infos && ExamSubject2 == infos->kskm) + { + } + else if(infos && ExamSubject3 == infos->kskm) + { + Json::Value lane; + set(lane, "MapRoad_Code_No", data.lane.MapRoad_Code_No); //路段组号 + set(lane, "MapRoad_Name", data.lane.MapRoad_Name); //路段编码 + set(lane, "TouchLineType", data.lane.TouchLineType); + set(lane, "TouchDir", data.lane.TouchDir); + set(lane, "TouchLineTypeCS", data.lane.TouchLineTypeCS); //车身压线类型 + //set(lane, "xxxx", data.lane.TouchLineType); //车身压线方向 + set(lane, "BasePointInLaneNo", data.lane.BasePointInLaneNo); + set(lane, "BaseLaneCount", data.lane.BaseLaneCount); + set(lane, "FrontPointLaneNo", data.lane.FrontPointLaneNo); + set(lane, "FrontPointLaneCount", data.lane.FrontPointLaneCount); + //set(lane, "xxxxx", data.lane.Body_RB_ToRightEdge); //后点车道:3/4(未找到) + //set(lane, "xxxxx", data.lane.Body_RB_ToRightEdge); + set(lane, "Body_LF_ToLeftEdge", data.lane.Body_LF_ToLeftEdge); + set(lane, "Body_LB_ToLeftEdge", data.lane.Body_LB_ToLeftEdge); + set(lane, "Body_RF_ToRightEdge", data.lane.Body_RF_ToRightEdge); + set(lane, "Body_RB_ToRightEdge", data.lane.Body_RB_ToRightEdge); + //set(lane, "xxxxx", data.lane.Body_RB_ToRightEdge); //右前/后车身边线:560/553(未找到,指车身离右侧路边缘线距离) + //set(lane, "xxxxx", data.lane.Body_RB_ToRightEdge); + set(lane, "Wheel_RF_ToRightEdge", data.lane.Wheel_RF_ToRightEdge); + set(lane, "Wheel_RB_ToRightEdge", data.lane.Wheel_RB_ToRightEdge); + set(lane, "Wheel_RF_ToBaseLine", data.lane.Wheel_RF_ToBaseLine); + set(lane, "Wheel_RB_ToBaseLine", data.lane.Wheel_RB_ToBaseLine); + set(lane, "Wheel_LF_ToRightEdge", data.lane.Wheel_LF_ToRightEdge); + set(lane, "Wheel_LB_ToRightEdge", data.lane.Wheel_LB_ToRightEdge); + set(lane, "Wheel_LF_ToBaseLine", data.lane.Wheel_LF_ToBaseLine); + set(lane, "Wheel_LB_ToBaseLine", data.lane.Wheel_LB_ToBaseLine); + set(lane, "BasePointInLaneDir", data.lane.BasePointInLaneDir); + set(lane, "CrossLineAttr", data.lane.CrossLineAttr); + //set(lane, "xxxxx", data.lane.Body_RB_ToRightEdge); //是否逆向行驶 + set(lane, "InShapeAttr", data.lane.InShapeAttr); + set(lane, "ShapeNo", data.lane.ShapeNo); //车身相交的形状线号 + //set(lane, "xxxxx", data.lane.Body_RB_ToRightEdge); //车轮相交的形状线号 + set(lane, "CrossPointNo", data.lane.CrossPointNo); + + root["lane"] = lane; + } + return Tools::toJson(root); } @@ -291,6 +401,7 @@ std::string XParser::toDataString(const TJudgeData& data) set(root, "xmqx", data.xmqx); set(root, "sound", data.sound); set(root, "mndg", data.mndg); + set(root, "lane", data.lane); //set(root, "kszt", data.kszt); //set(root, "dqxm", data.dqxm); @@ -649,7 +760,6 @@ bool XParser::get(Json::Value& object, const char* key, TSensorInfo& store, cons CHECK_GET_PARAM(value, "yl", store.yl); CHECK_GET_PARAM(value, "yy", store.yy); CHECK_GET_PARAM(value, "rmndg", store.rmndg); - CHECK_GET_PARAM(value, "wav", store.wav); //20240405 CHECK_GET_PARAM(value, "mndg", store.mndg); //20240405 CHECK_GET_PARAM(value, "sde", store.sde); //20240405 CHECK_GET_PARAM(value, "xhd", store.xhd); @@ -742,8 +852,19 @@ bool XParser::get(Json::Value& object, const char* key, TEventFinishItem& store, bool XParser::get(Json::Value& object, const char* key, TEventSound& store, const TEventSound& defaults) noexcept { CHECK_GET_OBJECT({ - CHECK_GET_PARAM(value, "xmdm", store.xmdm); + CHECK_GET_PARAM(value, "xmdm", store.xmdm); CHECK_GET_PARAM(value, "code", store.code); + CHECK_GET_PARAM(value, "type", store.type); + }); + return true; +} + +bool XParser::get(Json::Value& object, const char* key, TEventLane& store, const TEventLane& defaults) noexcept +{ + CHECK_GET_OBJECT({ + CHECK_GET_PARAM(value, "road", store.road); + CHECK_GET_PARAM(value, "num", store.num); + CHECK_GET_PARAM(value, "count", store.count); }); return true; } @@ -1237,6 +1358,17 @@ inline bool XParser::set(Json::Value& object, const char* key, const TEventSound Json::Value value; set(value, "xmdm", store.xmdm); set(value, "code", store.code); + set(value, "type", store.type); + object[key] = value; + return true; +} + +inline bool XParser::set(Json::Value& object, const char* key, const TEventLane& store) noexcept +{ + Json::Value value; + set(value, "road", store.road); + set(value, "num", store.num); + set(value, "count", store.count); object[key] = value; return true; } @@ -1380,7 +1512,6 @@ inline bool XParser::set(Json::Value& object, const char* key, const TSensorInfo set(value, "yl", store.yl); set(value, "yy", store.yy); set(value, "rmndg", store.rmndg); - set(value, "wav", store.wav); set(value, "mndg", store.mndg); set(value, "sde", store.sde); set(value, "xhd", store.xhd); diff --git a/entry/src/main/cpp/sdk/parser/XParser.h b/entry/src/main/cpp/sdk/parser/XParser.h index 573cfa17..f0327cab 100644 --- a/entry/src/main/cpp/sdk/parser/XParser.h +++ b/entry/src/main/cpp/sdk/parser/XParser.h @@ -65,6 +65,7 @@ public: static bool get(Json::Value& object, const char* key, TExamXm& store, const TExamXm& defaults={}) noexcept; static bool get(Json::Value& object, const char* key, TEventFinishItem& store, const TEventFinishItem& defaults={}) noexcept; static bool get(Json::Value& object, const char* key, TEventSound& store, const TEventSound& defaults={}) noexcept; + static bool get(Json::Value& object, const char* key, TEventLane& store, const TEventLane& defaults={}) noexcept; static bool get(Json::Value& object, const char* key, TExamWay& store, const TExamWay& defaults={}) noexcept; @@ -127,6 +128,7 @@ public: static inline bool set(Json::Value& object, const char* key, const TExamXm& store) noexcept; static inline bool set(Json::Value& object, const char* key, const TEventFinishItem& store) noexcept; static inline bool set(Json::Value& object, const char* key, const TEventSound& store) noexcept; + static inline bool set(Json::Value& object, const char* key, const TEventLane& store) noexcept; static inline bool set(Json::Value& object, const char* key, const TExamWay& store) noexcept; diff --git a/entry/src/main/cpp/sdk/utility/HBean.h b/entry/src/main/cpp/sdk/utility/HBean.h index d2016fc9..d92c9dce 100644 --- a/entry/src/main/cpp/sdk/utility/HBean.h +++ b/entry/src/main/cpp/sdk/utility/HBean.h @@ -72,7 +72,8 @@ declare(ExamEventTypeExamFinish, 5, "", XCharacter("考试结束事件")) \ declare(ExamEventTypeItemCancel, 6, "", XCharacter("项目取消事件")) \ declare(ExamEventTypeSound, 7, "", XCharacter("语音播报和提示事件")) \ - declare(ExamEventTypeLight, 8, "", XCharacter("模拟灯光事件")) + declare(ExamEventTypeLight, 8, "", XCharacter("模拟灯光事件")) \ + declare(ExamEventTypeLane, 9, "", XCharacter("车道和路段变化事件")) enum ExamEventType{ EnumMakeExamEventType(ENUM_SELECT_1_CMD_4) ExamEventTypeUnknown }; JUDGE_C_API const char* ExamEventType2Name(ExamEventType code); JUDGE_C_API const char* ExamEventType2Desc(ExamEventType code); diff --git a/entry/src/main/cpp/sdk/utility/HErrorCode.h b/entry/src/main/cpp/sdk/utility/HErrorCode.h index a88292c5..f6ffa9a0 100644 --- a/entry/src/main/cpp/sdk/utility/HErrorCode.h +++ b/entry/src/main/cpp/sdk/utility/HErrorCode.h @@ -57,11 +57,11 @@ declare(errorArtifMark, "errorArtifMark", XCharacter("人工扣分失败")) \ declare(errorArtifItemArg, "errorArtifItemArg", XCharacter("人工项目参数错误")) \ declare(errorArtifItemAuto, "errorArtifItemAuto", XCharacter("人工项目失败")) \ - declare(errorArtifItemEnter, "errorArtiItemEnter", XCharacter("人工进项目失败")) \ - declare(errorArtifItemCancel, "errorArtiItemCancel", XCharacter("人工取消项目失败")) \ + declare(errorArtifItemEnter, "errorArtifItemEnter", XCharacter("人工进项目失败")) \ + declare(errorArtifItemCancel, "errorArtifItemCancel", XCharacter("人工取消项目失败")) \ declare(errorArtifItemEnd, "errorArtifItemEnd", XCharacter("人工结束项目失败")) \ - declare(errorArtifSoundArg, "errorArtifSoundArg", XCharacter("语音播报结束调用参数错误")) \ - declare(errorArtifSoundEnd, "errorArtifSoundEnd", XCharacter("语音播报结束调用通知失败")) \ + declare(errorSoundArg, "errorSoundArg", XCharacter("语音播报结束调用参数错误")) \ + declare(errorSoundEnd, "errorSoundEnd", XCharacter("语音播报结束调用通知失败")) \ declare(errorMapSetParam, "errorMapSetParam", XCharacter("设置地图轨迹参数错误")) \ declare(errorMapSetScaling, "errorMapSetScaling", XCharacter("设置地图轨迹缩放比例错误")) \ declare(errorMapStart, "errorMapStart", XCharacter("开始绘制轨迹错误")) \ diff --git a/entry/src/main/cpp/sdk/utility/HTypes.h b/entry/src/main/cpp/sdk/utility/HTypes.h index 0a0d728d..eaf03492 100644 --- a/entry/src/main/cpp/sdk/utility/HTypes.h +++ b/entry/src/main/cpp/sdk/utility/HTypes.h @@ -389,7 +389,6 @@ struct TSensorInfo int32 yl = 0; //雨量 int8 yy = 0; //油压 //2024-02-02 add int8 rmndg = 0; //yhy22 HuiFangDengGuangStart:Byte; 回放模拟灯光用的,后期你要把车上开始模拟灯光时刻记录下来,回放轨迹的时候,要根据你当前的标签,触发模拟灯光 - int8 wav = 0; //模拟灯光语音结束信号 //对应WavEnd std::string mndg = ""; //评判生成的模拟灯光考试项目 //对应 MoNiDengGuang int8 sde = 0; //闪灯 //20240405 add //如果有特殊硬件支持 模拟灯光用 std::string xhd = ""; //信号灯值,预留 @@ -448,7 +447,6 @@ struct TSensorInfo yl = 0; yy = 0; rmndg = 0; - wav = 0; mndg = ""; sde = 0; xhd = ""; @@ -720,6 +718,15 @@ struct TEventSound int32 type = PlaySoundDefault; //语音类型,0:默认普通语音,1:表示是模拟灯光项目的语音,语音播报结束需要调用examJudgeSoundEnd通知评判。 }; +struct TEventLane +{ + //TEventLane(int32 _road, int32 _num, int32 _count) + // : road(_road), num(_num), count(_count){} + std::string road = ""; //当前路段号 + int32 num = 0; //当前基准天线所在车道号 + int32 count = 0; //当前基准天线共有几股车道 +}; + //道路路段信息 struct TExamWay { @@ -757,6 +764,7 @@ struct TJudgeData TEventCancelItem xmqx = {}; //项目取消 TEventSound sound = {}; //语音播报和提示 TEventLight mndg = ""; //模拟灯光 + TEventLane lane = {}; //车道和路段变化 //int8 kszt = 0; //考试状态 //TExamXm dqxm = {}; //当前项目 @@ -766,6 +774,79 @@ struct TJudgeData //std::string lxxx = {}; //录像信息(录像文件名)扣分项目_扣分序号_录像倒退时长_录像顺延时长_是否扣分@关键数据2_03_10_5_1@-13_9 }; +struct TRTKResult +{ + std::string MapRoad_Name; //路段名字 + std::string MapRoad_Code_No; //road_code_no + int CrossShapeLength = 0; + Pointi CrossPoint; //穿越的点 + + int MapRoadIndex = INVALID_INDEX; + int LaneIndex = INVALID_INDEX; + + enum{TouchLineType0,TouchLineType1,TouchLineType2,TouchLineType3,TouchLineType4,TouchLineType5,TouchLineType6,TouchLineType7,TouchLineType8}; + int TouchLineType = TouchLineType0; // //对应 LineTag 路段状况:车轮是否压线以及压线类型: 0-无 1-中心实线 2-车道分界线(虚线) 3-路右边线 4-路左边线 5-非机动车道分界线 + //6:中心线虚线 7:道路分界线(实线) 8:道路边缘线(右黄) + + //DistanceToRightEdge: Integer; //路段状况:车身右侧离右边线距离 + int Body_RF_ToRightEdge = 0, Body_RB_ToRightEdge = 0; //车身右上、右下 与右边线距离 + //RightBodyToRightEdge_ZXD: Integer; //车身右中心点 与右边线距离 + int Body_LF_ToLeftEdge = 0, Body_LB_ToLeftEdge = 0; //车身左上、左下 与左边线距离 + //LeftBodyToLeftEdge_ZXD: Integer; //车身左中心点 与左边线距离 + + //DistanceToLeftEdge1: Integer; //车身距本车道右边线距离 ,车身距本车道左边线距离20171219 + + int Wheel_LF_ToRightEdge = 0, Wheel_RF_ToRightEdge = 0; //左/右前轮离本车道右边线距离 + int Wheel_LB_ToRightEdge = 0, Wheel_RB_ToRightEdge = 0; //左/右后轮离本车道右边线距离 + + int Wheel_LF_ToBaseLine = 0, Wheel_RF_ToBaseLine = 0; //左/右前轮离最右侧车道右边线距离 + int Wheel_LB_ToBaseLine = 0, Wheel_RB_ToBaseLine = 0; //左/右后轮离最右侧车道右边线距离 + + //2019-10-9 + int FrontPointLaneNo = 0; //路段状况:车头中心点所在车道号 + int BasePointInLaneNo = 0; //路段状况:基准天线所在车道号 + int OldBasePointInLaneNo = 0; + //路段状况:基准天线所在车道方向: 1-右转 2-直行 3-左转 4-掉头 + //1000 0100 0010 0001 + std::string BasePointInLaneDir; //车道属性 + std::string BasePointInLaneLeftLine; //基准点所在车道的上边线属性 + + int FrontPointLaneCount = 0; //路段状况:共有几股车道 + + int BaseLaneCount = 0; //路段状况:共有几股车道 + + int ShapeNo = 0; //当前的形状号 + //int LS_ShapeNo = 0; //临时的形状号(用于3点关联的形状线) + + enum{CrossLineAttr0 = 0,CrossLineAttr1,CrossLineAttr2,CrossLineAttr3,CrossLineAttr4 }; + int CrossLineAttr = CrossLineAttr0; //对应 SubNameTag 0-未越线 1-停车线 2-中心点右侧线 3-等待控制线 4-环岛相关的 + + enum{InShapeAttr0 = 0,InShapeAttr1, InShapeAttr2}; + int InShapeAttr = InShapeAttr0; //0-不在形状里 1-在人行道内 2-在网格线内 + Pointi PT1, PT2; //当前车道右边两点坐标 20141113 + + enum{TouchLineTypeCS0=0,TouchLineTypeCS1,TouchLineTypeCS2,TouchLineTypeCS3,TouchLineTypeCS4,TouchLineTypeCS5}; + int TouchLineTypeCS = TouchLineTypeCS0; // //对应 LineTag 路段状况:车身是否压线以及压线类型: 0-未压线 1-中心线 2-车道分界线 3-路右边线 4-路左边线 5-非机动车道分界线 20150105 + + //{加入路口白实线方向判断} + //所在区域 + enum{AreaDefine0 = 0, AreaDefine1}; + int AreaDefine = AreaDefine0; //所在区域定义 0-未定义 1-路口白实线 + //{加入路口白实线方向判断} + + enum{ChangeLane_1 = -1, ChangeLane0 = 0, ChangeLane1 = 1}; + int ChangeLane = ChangeLane0; //0 没有跨道;1 向左;-1 向右 + int ChangeLaneCrossLine = LineTag0; //对应 LineTag + enum{TouchDir_1 = -1, TouchDir0 = 0, TouchDir1 = 1}; + int TouchDir = TouchDir0; //相对于线来说, 1:从左->右方向压线 -1:从右->左方向压线 + + int CrossPointNo = 0; //穿越点 + +#ifdef JUDGE_USE_INSPECT + std::string BodySharpData; //解决无锡所路口左转227a用例误判问题 +#endif +}; + struct TPerformData { int64 time = 0; //考试用时(单位毫秒) @@ -776,6 +857,8 @@ struct TPerformData int32 dxjl = 0; //东向距离 单位毫米 int32 bxjl = 0; //北向距离 单位毫米 std::string hint = ""; //提示信息 + + TRTKResult lane; }; //************************************************************ @@ -864,76 +947,6 @@ struct TCarBody }; -struct TRTKResult -{ - std::string MapRoad_Name; //路段名字 - std::string MapRoad_Code_No; //road_code_no - int CrossShapeLength = 0; - Pointi CrossPoint; //穿越的点 - - int MapRoadIndex = INVALID_INDEX; - int LaneIndex = INVALID_INDEX; - - enum{TouchLineType0,TouchLineType1,TouchLineType2,TouchLineType3,TouchLineType4,TouchLineType5,TouchLineType6,TouchLineType7,TouchLineType8}; - int TouchLineType = TouchLineType0; // //对应 LineTag 路段状况:车轮是否压线以及压线类型: 0-无 1-中心实线 2-车道分界线(虚线) 3-路右边线 4-路左边线 5-非机动车道分界线 - //6:中心线虚线 7:道路分界线(实线) 8:道路边缘线(右黄) - - //DistanceToRightEdge: Integer; //路段状况:车身右侧离右边线距离 - int Body_RF_ToRightEdge = 0, Body_RB_ToRightEdge = 0; //车身右上、右下 与右边线距离 - //RightBodyToRightEdge_ZXD: Integer; //车身右中心点 与右边线距离 - int Body_LF_ToLeftEdge = 0, Body_LB_ToLeftEdge = 0; //车身左上、左下 与左边线距离 - //LeftBodyToLeftEdge_ZXD: Integer; //车身左中心点 与左边线距离 - - //DistanceToLeftEdge1: Integer; //车身距本车道右边线距离 ,车身距本车道左边线距离20171219 - - int Wheel_LF_ToRightEdge = 0, Wheel_RF_ToRightEdge = 0; //左/右前轮离本车道右边线距离 - int Wheel_LB_ToRightEdge = 0, Wheel_RB_ToRightEdge = 0; //左/右后轮离本车道右边线距离 - - int Wheel_LF_ToBaseLine = 0, Wheel_RF_ToBaseLine = 0; //左/右前轮离最右侧车道右边线距离 - int Wheel_LB_ToBaseLine = 0, Wheel_RB_ToBaseLine = 0; //左/右后轮离最右侧车道右边线距离 - - //2019-10-9 - int FrontPointLaneNo = 0; //路段状况:车头中心点所在车道号 - int BasePointInLaneNo = 0; //路段状况:基准天线所在车道号 - int OldBasePointInLaneNo = 0; - //路段状况:基准天线所在车道方向: 1-右转 2-直行 3-左转 4-掉头 - //1000 0100 0010 0001 - std::string BasePointInLaneDir; - std::string BasePointInLaneLeftLine; //基准点所在车道的上边线属性 - - int FrontPointLaneCount = 0; //路段状况:共有几股车道 - - int BaseLaneCount = 0; //路段状况:共有几股车道 - - int ShapeNo = 0; //当前的形状号 - //int LS_ShapeNo = 0; //临时的形状号(用于3点关联的形状线) - - enum{CrossLineAttr0 = 0,CrossLineAttr1,CrossLineAttr2,CrossLineAttr3,CrossLineAttr4 }; - int CrossLineAttr = CrossLineAttr0; //对应 SubNameTag 0-未越线 1-停车线 2-中心点右侧线 3-等待控制线 4-环岛相关的 - - enum{InShapeAttr0 = 0,InShapeAttr1, InShapeAttr2}; - int InShapeAttr = InShapeAttr0; //0-不在形状里 1-在人行道内 2-在网格线内 - Pointi PT1, PT2; //当前车道右边两点坐标 20141113 - - enum{TouchLineTypeCS0=0,TouchLineTypeCS1,TouchLineTypeCS2,TouchLineTypeCS3,TouchLineTypeCS4,TouchLineTypeCS5}; - int TouchLineTypeCS = TouchLineTypeCS0; // //对应 LineTag 路段状况:车身是否压线以及压线类型: 0-未压线 1-中心线 2-车道分界线 3-路右边线 4-路左边线 5-非机动车道分界线 20150105 - - //{加入路口白实线方向判断} - //所在区域 - enum{AreaDefine0 = 0, AreaDefine1}; - int AreaDefine = AreaDefine0; //所在区域定义 0-未定义 1-路口白实线 - //{加入路口白实线方向判断} - - enum{ChangeLane_1 = -1, ChangeLane0 = 0, ChangeLane1 = 1}; - int ChangeLane = ChangeLane0; //0 没有跨道;1 向左;-1 向右 - int ChangeLaneCrossLine = LineTag0; //对应 LineTag - enum{TouchDir_1 = -1, TouchDir0 = 0, TouchDir1 = 1}; - int TouchDir = TouchDir0; //相对于线来说, 1:从左->右方向压线 -1:从右->左方向压线 - -#ifdef JUDGE_USE_INSPECT - std::string BodySharpData; //解决无锡所路口左转227a用例误判问题 -#endif -}; //实时考试每一帧数据(包括接收调用方的数据和考试计算的数据) struct TChuanGan diff --git a/entry/src/main/cpp/test/test_sdk/ITestData.cpp b/entry/src/main/cpp/test/test_sdk/ITestData.cpp index 496eacc3..c9f8ee7c 100644 --- a/entry/src/main/cpp/test/test_sdk/ITestData.cpp +++ b/entry/src/main/cpp/test/test_sdk/ITestData.cpp @@ -5019,7 +5019,7 @@ void ITestData::setupSub3Data(const std::string& dirpath, const std::string& car if(value["sensor"].isMember("WavEnd")) { - info.sensor.wav = value["sensor"]["WavEnd"].asInt(); + //info.sensor.wav = value["sensor"]["WavEnd"].asInt(); } if(value["sensor"].isMember("MoNiDengGuang")) diff --git a/entry/src/main/cpp/test/test_sdk/TestJudge.cpp b/entry/src/main/cpp/test/test_sdk/TestJudge.cpp index 06ed4781..04677198 100644 --- a/entry/src/main/cpp/test/test_sdk/TestJudge.cpp +++ b/entry/src/main/cpp/test/test_sdk/TestJudge.cpp @@ -104,6 +104,16 @@ void TestJudge::letsGoItemJudge(const TTestDatas& data, int times) codeValue = examJudgeArtificialItem(itemno, type); ASSERT_TRUE(codeValue == codeSuccess) << codeValue; } + else if(root.isMember("method") && root["method"].asString() == "examJudgeSoundEnd" && + root.isMember("itemno") && root.isMember("code") && root.isMember("type")) + { + content = Tools::toJson(root); + int itemno = root["itemno"].asInt(); + std::string code = root["code"].asString(); + int type = root["type"].asInt(); + codeValue = examJudgeSoundEnd(itemno, code.c_str(), type); + ASSERT_TRUE(codeValue == codeSuccess) << codeValue; + } else { TASSERT(false, ""); diff --git a/entry/src/main/cpp/third/googletest-1.13.0/lib_linux_x64/libgmock.a b/entry/src/main/cpp/third/googletest-1.13.0/lib_linux_x64/libgmock.a deleted file mode 100644 index 7c59cbbb..00000000 Binary files a/entry/src/main/cpp/third/googletest-1.13.0/lib_linux_x64/libgmock.a and /dev/null differ diff --git a/entry/src/main/cpp/third/googletest-1.13.0/lib_linux_x64/libgmock_main.a b/entry/src/main/cpp/third/googletest-1.13.0/lib_linux_x64/libgmock_main.a deleted file mode 100644 index 22d77e28..00000000 Binary files a/entry/src/main/cpp/third/googletest-1.13.0/lib_linux_x64/libgmock_main.a and /dev/null differ diff --git a/entry/src/main/cpp/third/googletest-1.13.0/lib_linux_x64/libgtest.a b/entry/src/main/cpp/third/googletest-1.13.0/lib_linux_x64/libgtest.a deleted file mode 100644 index 570a5eb6..00000000 Binary files a/entry/src/main/cpp/third/googletest-1.13.0/lib_linux_x64/libgtest.a and /dev/null differ diff --git a/entry/src/main/cpp/third/googletest-1.13.0/lib_linux_x64/libgtest_main.a b/entry/src/main/cpp/third/googletest-1.13.0/lib_linux_x64/libgtest_main.a deleted file mode 100644 index 58d6a4cd..00000000 Binary files a/entry/src/main/cpp/third/googletest-1.13.0/lib_linux_x64/libgtest_main.a and /dev/null differ diff --git a/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libprofiler.a b/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libprofiler.a deleted file mode 100644 index 81fd7101..00000000 Binary files a/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libprofiler.a and /dev/null differ diff --git a/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libtcmalloc.a b/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libtcmalloc.a deleted file mode 100644 index 7784725f..00000000 Binary files a/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libtcmalloc.a and /dev/null differ diff --git a/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libtcmalloc_and_profiler.a b/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libtcmalloc_and_profiler.a deleted file mode 100644 index ec333a9a..00000000 Binary files a/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libtcmalloc_and_profiler.a and /dev/null differ diff --git a/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libtcmalloc_debug.a b/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libtcmalloc_debug.a deleted file mode 100644 index 6d448ebb..00000000 Binary files a/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libtcmalloc_debug.a and /dev/null differ diff --git a/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libtcmalloc_minimal.a b/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libtcmalloc_minimal.a deleted file mode 100644 index 7b03debd..00000000 Binary files a/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libtcmalloc_minimal.a and /dev/null differ diff --git a/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libtcmalloc_minimal_debug.a b/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libtcmalloc_minimal_debug.a deleted file mode 100644 index 54d74215..00000000 Binary files a/entry/src/main/cpp/third/gperftools-2.10/lib_linux_x64/libtcmalloc_minimal_debug.a and /dev/null differ diff --git a/entry/src/main/cpp/third/unwind-1.6.2/lib_linux_x64/libunwind-coredump.a b/entry/src/main/cpp/third/unwind-1.6.2/lib_linux_x64/libunwind-coredump.a deleted file mode 100644 index cc83a880..00000000 Binary files a/entry/src/main/cpp/third/unwind-1.6.2/lib_linux_x64/libunwind-coredump.a and /dev/null differ diff --git a/entry/src/main/cpp/third/unwind-1.6.2/lib_linux_x64/libunwind-ptrace.a b/entry/src/main/cpp/third/unwind-1.6.2/lib_linux_x64/libunwind-ptrace.a deleted file mode 100644 index 5349e58f..00000000 Binary files a/entry/src/main/cpp/third/unwind-1.6.2/lib_linux_x64/libunwind-ptrace.a and /dev/null differ diff --git a/entry/src/main/cpp/third/unwind-1.6.2/lib_linux_x64/libunwind-setjmp.a b/entry/src/main/cpp/third/unwind-1.6.2/lib_linux_x64/libunwind-setjmp.a deleted file mode 100644 index 1edf69bf..00000000 Binary files a/entry/src/main/cpp/third/unwind-1.6.2/lib_linux_x64/libunwind-setjmp.a and /dev/null differ diff --git a/entry/src/main/cpp/third/unwind-1.6.2/lib_linux_x64/libunwind-x86_64.a b/entry/src/main/cpp/third/unwind-1.6.2/lib_linux_x64/libunwind-x86_64.a deleted file mode 100644 index c4ab3534..00000000 Binary files a/entry/src/main/cpp/third/unwind-1.6.2/lib_linux_x64/libunwind-x86_64.a and /dev/null differ diff --git a/entry/src/main/cpp/third/unwind-1.6.2/lib_linux_x64/libunwind.a b/entry/src/main/cpp/third/unwind-1.6.2/lib_linux_x64/libunwind.a deleted file mode 100644 index e14e0a7f..00000000 Binary files a/entry/src/main/cpp/third/unwind-1.6.2/lib_linux_x64/libunwind.a and /dev/null differ diff --git a/entry/src/main/cpp/toolkit/replay/ReplayWrapper.cpp b/entry/src/main/cpp/toolkit/replay/ReplayWrapper.cpp index 1c1add85..7a1b0302 100644 --- a/entry/src/main/cpp/toolkit/replay/ReplayWrapper.cpp +++ b/entry/src/main/cpp/toolkit/replay/ReplayWrapper.cpp @@ -71,8 +71,13 @@ bool ReplayWrapper::replayRunning(bool running) else { replayReset(); - int codeValue = examJudgeEndExam(); - TASSERT(codeValue == codeSuccess, "codeValue=%s", errorCode2Name((ErrorCode)codeValue)); + + IExamCar* car = FactoryExamService->getExamCar(); + if(car != nullptr && car->examState() != examStateEnd) + { + int codeValue = examJudgeEndExam(); + TASSERT(codeValue == codeSuccess, "codeValue=%s", errorCode2Name((ErrorCode)codeValue)); + } //__LOOK__(""); // 日志输出未释放的内存 } @@ -187,6 +192,10 @@ bool ReplayWrapper::replayTrackReadStep(int playSpeed) { replayTrackTypeArtificialItem(data); }break; + case TTrackTypeSoundEnd: + { + replayTrackTypeSoundEnd(data); + }break; default: TASSERT(false, ""); return false; @@ -360,6 +369,28 @@ void ReplayWrapper::replayTrackTypeArtificialItem(const TTrackData::Ptr& data) } } +void ReplayWrapper::replayTrackTypeSoundEnd(const TTrackData::Ptr &data) +{ + Json::Value root; + bool ok = Tools::fromJson(data->data, root); + TASSERT(ok, ""); + + int itemno = root["itemno"].asInt(); + std::string code = root["code"].asString(); + int type = root["type"].asInt(); + int codeValue = examJudgeSoundEnd(itemno, code.c_str(), type); + //TASSERT(codeValue == codeSuccess, ""); + if(codeValue != codeSuccess) + { + logerror("examJudgeSoundEnd error %s", errorCode2Name((ErrorCode)codeValue)); + } + + { + QString soundCode = QString::fromUtf8(code.c_str()); + emit updateDataSoundEnd(itemno, soundCode, type); + } +} + void ReplayWrapper::replayXexamJudgeCallbackLogImpl(int level, const char* info, int len) { //QString unicode = replay::converAnyToString(QByteArray(info, len)); diff --git a/entry/src/main/cpp/toolkit/replay/ReplayWrapper.h b/entry/src/main/cpp/toolkit/replay/ReplayWrapper.h index e4fe20d3..c6f0ea13 100644 --- a/entry/src/main/cpp/toolkit/replay/ReplayWrapper.h +++ b/entry/src/main/cpp/toolkit/replay/ReplayWrapper.h @@ -53,6 +53,7 @@ public: void replayTrackTypeRealExam(const TTrackData::Ptr& data); void replayTrackTypeArtificialMark(const TTrackData::Ptr& data); void replayTrackTypeArtificialItem(const TTrackData::Ptr& data); + void replayTrackTypeSoundEnd(const TTrackData::Ptr& data); void replayXexamJudgeCallbackLogImpl(int level, const char* info, int len); void replayXexamJudgeCallbackRealExamImpl(const char* data, int len); @@ -67,6 +68,7 @@ signals: void updateDataRealExam(const QString& info); void updateDataArtificialMark(int itemno, const QString& serial); void updateDataArtificialItem(int itemno, int type); + void updateDataSoundEnd(int itemno, const QString& code, int type); void updateDataCallbackRealExam(const QString& info); void updateDataCallbackPerform(const QString& info); void updateDataFrameNum(int num, int total); diff --git a/entry/src/main/cpp/toolkit/ui/MainWindow.cpp b/entry/src/main/cpp/toolkit/ui/MainWindow.cpp index 07872fc1..ac426473 100644 --- a/entry/src/main/cpp/toolkit/ui/MainWindow.cpp +++ b/entry/src/main/cpp/toolkit/ui/MainWindow.cpp @@ -46,6 +46,7 @@ void MainWindow::init() KIT_CONNECT(updateDataRealExam(const QString&)); KIT_CONNECT(updateDataArtificialMark(int, const QString&)); KIT_CONNECT(updateDataArtificialItem(int, int)); + KIT_CONNECT(updateDataSoundEnd(int, const QString&, int)); KIT_CONNECT(updateDataCallbackRealExam(const QString&)); KIT_CONNECT(updateDataCallbackPerform(const QString&)); KIT_CONNECT(updateDataFrameNum(int, int)); @@ -186,6 +187,7 @@ void MainWindow::uninit() KIT_DISCONNECT(updateDataRealExam(const QString&)); KIT_DISCONNECT(updateDataArtificialMark(int, const QString&)); KIT_DISCONNECT(updateDataArtificialItem(int, int)); + KIT_DISCONNECT(updateDataSoundEnd(int, const QString&, int)); KIT_DISCONNECT(updateDataCallbackRealExam(const QString&)); KIT_DISCONNECT(updateDataCallbackPerform(const QString&)); KIT_DISCONNECT(updateDataFrameNum(int, int)); @@ -899,7 +901,10 @@ void MainWindow::updateDataBeginExam(const QString&) { const TKfXm& kfxm = value.kfxm[i]; updateItemProperty(kfxm.xmdm, KIT_RGB_RED); - updateMarkProperty(getMarkItemText(findMarkItemText(kfxm))); + + std::string time = toEasyTime(value.kskssj); + QString event = CL8(time.c_str()) + CL8("[断点续考扣分]"); + updateExamEvent(event + getMarkItemText(findMarkItemText(kfxm)), KIT_RGB_RED); m_replay->replayItemMarkPush(kfxm.xmdm, kfxm); //???通用项目扣分怎么知道是哪个项目扣分的? } } @@ -933,8 +938,8 @@ void MainWindow::updateDataRealExam(const QString& info) m_ui->rtkEnable->setStyleSheet("color:#FF0000;"); } - std::string gps_sj = Tools::toTimeString(value.gps.sj/SECOND) + "." + std::to_string(value.gps.sj%SECOND); - std::string gps2_sj = Tools::toTimeString(value.gps2.sj/SECOND) + "." + std::to_string(value.gps2.sj%SECOND); + std::string gps_sj = toEasyTime(value.gps.sj); + std::string gps2_sj = toEasyTime(value.gps2.sj); if(value.gps.bklx == boardTypeTB) { @@ -1036,7 +1041,6 @@ void MainWindow::updateDataRealExam(const QString& info) m_ui->cg_yl ->setText(CL8("雨量:") + kit::toString(cg.yl)); //雨量 m_ui->cg_yy ->setText(CL8("油压:") + kit::toString(cg.yy)); //油压 m_ui->cg_rmndg ->setText(CL8("灯光开始:") + kit::toString(cg.rmndg)); //灯光开始 - m_ui->cg_wav ->setText(CL8("语音结束:") + kit::toString(cg.wav)); //语音结束 m_ui->cg_mndg ->setText(CL8("灯光项目:") + kit::toString(cg.mndg)); //灯光项目 m_ui->cg_sde ->setText(CL8("闪灯:") + kit::toString(cg.sde)); //闪灯 m_ui->cg_xhd ->setText(CL8("信号灯值(预留):") + kit::toString(cg.xhd)); //信号灯值(预留) @@ -1046,27 +1050,20 @@ void MainWindow::updateDataRealExam(const QString& info) logtrace("item-mndg=%s", cg.mndg.c_str()); } - if(cg.wav > 0) - { - logtrace("wav-mndg=%d", cg.wav); - } - } void MainWindow::updateDataArtificialMark(int itemno, const QString& serial) { - int64 s = Tools::nowTime(); - std::string time = Tools::toTimeString(s/SECOND) + "."+ std::to_string(s%SECOND); + std::string time = toEasyTime(Tools::nowTime()); - QString event = CL8(time.c_str()) + "[" + CL8("人工扣分") + "]"; - QString text = event + getItemText(itemno) + CL8(",扣分代码:") + serial; - updateExamEvent(event, KIT_RGB_ORANGE); + QString event = CL8(time.c_str()) + CL8("[人工扣分]"); + TKfXm kfxm = {itemno, serial.toLocal8Bit().toStdString()}; + updateExamEvent(event + getMarkItemText(findMarkItemText(kfxm)), KIT_RGB_ORANGE); } void MainWindow::updateDataArtificialItem(int itemno, int type) { - int64 s = Tools::nowTime(); - std::string time = Tools::toTimeString(s/SECOND) + "."+ std::to_string(s%SECOND); + std::string time = toEasyTime(Tools::nowTime()); QString opt; if(type == ArtifItemTypeAuto) { @@ -1081,11 +1078,30 @@ void MainWindow::updateDataArtificialItem(int itemno, int type) opt = CL8("取消项目"); } - QString event = CL8(time.c_str()) + "[" + CL8("人工项目") + "]"; + QString event = CL8(time.c_str()) + CL8("[人工项目]"); QString text = event + getItemText(itemno) + CL8(",操作类型:") + opt; updateExamEvent(text, KIT_RGB_PURPLE); } +void MainWindow::updateDataSoundEnd(int itemno, const QString& code, int type) +{ + std::string time = toEasyTime(Tools::nowTime()); + QString opt; + if(type == PlaySoundDefault) + { + opt = CL8("默认"); + } + else if(type == PlaySoundEndNotify) + { + opt = CL8("模拟灯光项目语音播报类型"); + } + + TASSERT(type == PlaySoundEndNotify, ""); + QString event = CL8(time.c_str()) + CL8("[语音播报结束]"); + QString text = event + getItemText(itemno) + CL8("语音码:") + code + CL8(",类型:") + opt; + updateExamEvent(text, KIT_RGB_BLUE); +} + void MainWindow::updateDataCallbackRealExam(const QString& info) { IAutoLock(m_mtx); @@ -1097,7 +1113,7 @@ void MainWindow::updateDataCallbackRealExam(const QString& info) m_parser->parseJudgeData(org, value); ExamEventType eventType = (ExamEventType)value.event; - std::string time = Tools::toTimeString(value.sj/SECOND) + "."+ std::to_string(value.sj%SECOND); + std::string time = toEasyTime(value.sj); std::string desc = ExamEventType2Desc(eventType); //loginfo("recv time=%s, event=%s", time.c_str(), desc.c_str()); @@ -1106,7 +1122,7 @@ void MainWindow::updateDataCallbackRealExam(const QString& info) { int itemNo = value.xmks.xmdm; updateItemProperty(itemNo, KIT_RGB_PERILLA); - QString text = event + "," + getItemText(itemNo); + QString text = event + getItemText(itemNo); updateExamEvent(text); playSoundItem(itemNo, eventType); } @@ -1115,7 +1131,7 @@ void MainWindow::updateDataCallbackRealExam(const QString& info) int itemNo = value.xmjs.xmdm; QColor color = m_replay->replayItemMarkHas(itemNo) ? KIT_RGB_RED : KIT_RGB_GREEN; updateItemProperty(itemNo, color); - QString text = event + "," + getItemText(itemNo); + QString text = event + getItemText(itemNo); updateExamEvent(text); playSoundItem(itemNo, eventType); } @@ -1134,16 +1150,15 @@ void MainWindow::updateDataCallbackRealExam(const QString& info) //} //注意这里,在项目内的通用扣分是显示在当前项目还是通用评判? updateItemProperty(itemNo, KIT_RGB_RED); - updateMarkProperty(getMarkItemText(findMarkItemText(kfxm))); + QString text = event + getItemText(itemNo); + updateExamEvent(text + getMarkItemText(findMarkItemText(kfxm)), KIT_RGB_RED); m_replay->replayItemMarkPush(itemNo, kfxm); - QString text = event + "," + getItemText(itemNo); - updateExamEvent(text); bool ok = TableMark->has(value.kf.xmdm, value.kf.kfdm); TASSERT(ok, ""); const TMarkRule* rule = TableMark->find(value.kf.xmdm, value.kf.kfdm); - TASSERT(nullptr != rule, "") - m_markGrade -= std::abs(rule->markreal); + TASSERT(nullptr != rule, ""); + m_markGrade -= std::abs(rule->markreal); m_markTimes++; m_ui->pe_markGrade->setText(CL8("扣分/次数:") + kit::toString(m_markGrade) + "/" + kit::toString(m_markTimes)); @@ -1170,7 +1185,7 @@ void MainWindow::updateDataCallbackRealExam(const QString& info) { int itemNo = value.xmqx.xmdm; updateItemProperty(itemNo, KIT_RGB_BLUE); - QString text = event + "," + getItemText(itemNo); + QString text = event + getItemText(itemNo); updateExamEvent(text); playSoundItem(itemNo, eventType); } @@ -1178,7 +1193,7 @@ void MainWindow::updateDataCallbackRealExam(const QString& info) { int itemNo = value.sound.xmdm; QString s = QString::fromUtf8(value.sound.code.c_str()); - QString text = event + "," + getItemText(itemNo) + CL8(",语音代码:") + s; + QString text = event + getItemText(itemNo) + CL8(",语音代码:") + s; updateExamEvent(text); playSoundVoice(value.sound.code); } @@ -1328,7 +1343,7 @@ void MainWindow::updateExamEvent(const QString& text, const QColor& color) QString MainWindow::getItemText(ExamItemCode itemNo) { - QString itemInfo = CL8("项目:")+ itemNoToName(itemNo); + QString itemInfo = CL8("[项目:")+ itemNoToName(itemNo) + CL8("]"); return itemInfo; } @@ -1351,6 +1366,14 @@ QString MainWindow::itemNoToName(ExamItemCode itemNo) return itemName; } +std::string MainWindow::toEasyTime(int64 s) +{ + char buf[8] = {0}; + SafeSprintf(buf, sizeof(buf), "%03d", (int)(s%SECOND)); + std::string time = Tools::toTimeString(s/SECOND) + "." + buf; + return time; +} + void MainWindow::updateDataFrameNum(int num, int total) { //QString numInfo = QString("%1/%2").arg(num).arg(total); diff --git a/entry/src/main/cpp/toolkit/ui/MainWindow.h b/entry/src/main/cpp/toolkit/ui/MainWindow.h index 2f91936e..7045f0d3 100644 --- a/entry/src/main/cpp/toolkit/ui/MainWindow.h +++ b/entry/src/main/cpp/toolkit/ui/MainWindow.h @@ -58,6 +58,7 @@ private: virtual void updateExamEvent(const QString& text, const QColor& color = KIT_RGB_GREEN); virtual QString getItemText(ExamItemCode itemNo); virtual QString itemNoToName(ExamItemCode itemNo); + virtual std::string toEasyTime(int64 s); virtual void quitEvent(QEvent* event); @@ -82,6 +83,7 @@ private slots: //Q_SLOTS void updateDataRealExam(const QString& info); void updateDataArtificialMark(int itemno, const QString& serial); void updateDataArtificialItem(int itemno, int type); + void updateDataSoundEnd(int itemno, const QString& code, int type); void updateDataCallbackRealExam(const QString& info); void updateDataCallbackPerform(const QString& info); void updateDataFrameNum(int num, int total); diff --git a/entry/src/main/cpp/toolkit/ui/MainWindow.ui b/entry/src/main/cpp/toolkit/ui/MainWindow.ui index a18e3ef5..e455f6e7 100644 --- a/entry/src/main/cpp/toolkit/ui/MainWindow.ui +++ b/entry/src/main/cpp/toolkit/ui/MainWindow.ui @@ -2712,7 +2712,7 @@ p, li { white-space: pre-wrap; } 410 - 252 + 242 191 20 @@ -2767,24 +2767,11 @@ p, li { white-space: pre-wrap; } - - - - 410 - 204 - 71 - 20 - - - - 语音结束: - - 410 - 220 + 206 291 20 @@ -2797,7 +2784,7 @@ p, li { white-space: pre-wrap; } 410 - 236 + 224 71 20 diff --git a/entry/src/main/ets/common/service/initable.ts b/entry/src/main/ets/common/service/initable.ts index ba3770c3..35ec2823 100644 --- a/entry/src/main/ets/common/service/initable.ts +++ b/entry/src/main/ets/common/service/initable.ts @@ -28,7 +28,7 @@ import DeviceInfoTable from '../constants/DeviceInfoTable' import USER from '../constants/USER' import util from '@ohos.util'; import zlib from '@ohos.zlib'; -import FileModel from '../../pages/judgeSDK/utils/file-model'; +import FileModel from '../../pages/judgeSDK/utils/fileModel'; // @ts-nocheck //读表 //参数平台 diff --git a/entry/src/main/ets/common/utils/request.ts b/entry/src/main/ets/common/utils/request.ts index c9ea6fc4..993343db 100644 --- a/entry/src/main/ets/common/utils/request.ts +++ b/entry/src/main/ets/common/utils/request.ts @@ -1,7 +1,7 @@ import http from '@ohos.net.http'; import convertxml from '@ohos.convertxml'; import prompt from '@ohos.prompt' -import { sendGreen } from '../../pages/judgeSDK/utils/judge-common'; +import { sendGreen } from '../../pages/judgeSDK/utils/judgeCommon'; import {GlobalConfig} from '../../config/index' const config = { host:GlobalConfig.host, diff --git a/entry/src/main/ets/pages/Judge.ets b/entry/src/main/ets/pages/Judge.ets index 7ea3cdbd..b321fe48 100644 --- a/entry/src/main/ets/pages/Judge.ets +++ b/entry/src/main/ets/pages/Judge.ets @@ -6,10 +6,12 @@ import LoadingPopup from './compontents/judge/LoadingPopup'; import DeductedPopup from './compontents/judge/DeductionPopup'; import AmplifyPopup from './compontents/judge/AmplifyPopup'; import Judge from './judgeSDK/judge'; -import { defaultJudgeConfigObj } from './judgeSDK/utils//judge-common'; +import { defaultJudgeConfigObj } from './judgeSDK/utils//judgeCommon'; + import { CARINFO, CDSBInfo, + LANE, MAPITEMPOINTITEM, MAPPOINT, MarkRule, @@ -18,92 +20,19 @@ import { SYSSET, SYSTEMPARMARR } from './judgeSDK/api/judgeSDK.d'; + import { chunkArr, formatTime, getCurrentHourTime, getCurrentTime } from '../common/utils/tools'; import { examJudgeEndExam } from './judgeSDK/api/index'; import { getSyncData } from '../common/service/initable'; -import { judgeConfig } from './judgeSDK/utils/judge-config'; +import { judgeConfig } from './judgeSDK/utils/judgeConfig'; import FileUtil from '../common/utils/File'; import SignDisplayCom from './compontents/signDisplayCom'; - @Entry @Component struct Index { - scroller: Scroller = new Scroller() - //页面通用字体大小 - @State FONTSIZE: number = 28 - @State BIGFONTSIZE: number = 28 - //结束考试弹窗 - @State endPopupVisible: boolean = false - //等待弹窗(考试及格,考试不及格使用) - @State loadingPopupVisible: boolean = false - //实时轨迹弹窗 - @State signDisplayComVisible: boolean = false - @State isDdxk: boolean = false; - @State time: string = '' - //考试用时 - @State examTime: number = 0 - //开始时间 - @State startTime: string = '00:00:00' - @State startFullTime: string = '' - @State startHourTime: string = '' - //科目类型 - @State examSubject: 2 | 3 = 3; - @State ddxkTime: number = 0; - @State ddxkKsxmArr: string[] = [''] - @State ddxkKfArr: string[] = [''] - @State xmmcStr: string = '' - @State carztStr: string = '' - @State kfArr: { - xmmcStr?: string, - score: string, - desc: string - }[] = [] - @State name: string = '' - @State idCard: string = '' - @State totalScore: number = 100 - //模拟考试项目 - @State projects: Project[] = [] - @State projectsObj: ProjectObj = {} - @State projectsCenterObj: ProjectObj = {} - @State markRuleListObj: MarkRule = {} - @State cdsbInfoObj: CDSBInfo = {} - @State timer: number = 0 - @State judgeConfig: { [k: string]: string }[] = [] - @State judgeConfigObj: { [k: string]: any } = defaultJudgeConfigObj - //流水号 - @State lsh: string = '' - @State kszp: string = '' - @State ksdd: string = '' - @State kssycs: string = '' - @State kslx: string = '' - //监管接口序列号 - @State serialNumber: number = 0 - @State carType: string = '' - @State carName: string = '' - @State isDeductedPopShow: boolean = false - @State isAmplifyPopShow: boolean = false - @State amplifiedImgIndex: number = 0 - @State judge: any = {} - //行驶距离 - @State jl: number = 0 - //应考里程 - @State examMileage: string = '0' - @State artSubject3Projects: string[] = ['直线', '会车', '变道', '超车', '掉头', '停车'] - @State artSubject3ProjectsCodesArr: string[] = ['3', '9', '4', '10', '12', '11'] - @State manualMarkRules: MarkRule[] = [] - //科目三评判初始化数据 - @State systemparmArr: SYSTEMPARMARR[] = [] - @State mapPointItemArr: MAPITEMPOINTITEM[] = [] - @State carinfoArrr: CARINFO[] = [] - @State mapPointArr: MAPPOINT[] = [] - private context = getContext(this) as common.UIAbilityContext; - private img: ImageBitmap = new ImageBitmap("/resources/base/media/1.png") - //已考的考试项目 - private wantInfos = [] - async aboutToAppear() { - globalThis.windowClass.setWindowSystemBarEnable(['']) + globalThis.windowClass.setWindowSystemBarEnable([]) const time = await getCurrentTime() this.startTime = time.split(' ')[1] @@ -129,6 +58,7 @@ struct Index { //初始化相关数据库表 async initDb() { const examSubject = globalThis.carInfo.examSubject; + this.examSubject = examSubject; const {isTrajectoryOpen,trajectoryPath} = judgeConfig await this.initStudent(); await this.initCar(); @@ -137,9 +67,7 @@ struct Index { if (isTrajectoryOpen) { this.initTrajectoryParam(trajectoryPath) } else { - examSubject == 2 - ? await this.initSystemKm2Param() - : await this.initSystemKm3Param() + await this.initSystemParam() await this.initMarkRules(); await this.initSysset(); } @@ -200,10 +128,9 @@ struct Index { NoCancelId: mark.nocancelid * 1, GPS_SID: mark.gps_sid == 0 ? false : true } - const markserial = mark.markserial * 1; //筛选出人工评判的扣分 - if (markserial > 100 && markserial < 200) { + if (Number(tempObj.markserial) > 100 && Number(tempObj.markserial) < 200) { this.manualMarkRules.push(tempObj) } this.markRuleListObj[`${mark.itemno}_${mark.markserial}`] = { @@ -244,67 +171,49 @@ struct Index { this.examMileage = sys.v_value + ''; } + //364 绕车一周评判时机(1-开始考试后判 2-开始考试前判) + if (sys.v_no == '364' && sys.v_value == 2) { + let currentParams: any = router.getParams(); + const {sczb,kfdm} = currentParams; + kfdm.forEach(kf => { + const {xmdm, kfdm} = kf + const currentKf = this.markRuleListObj[`${xmdm}_${kfdm}`]; + const currentProject = this.projectsObj[xmdm] + this.kfArr.push({ + //扣分项目名称 + xmmcStr: currentProject.name, + //@ts-ignore + xmdm, + desc: currentKf.markshow, + score: currentKf.markreal, + markcatalog: currentKf.markcatalog, + markserial: currentKf.markserial, + kfxh: currentKf.kfxh + }) + this.totalScore += currentKf.markreal * 1; + }) + this.projectsObj['1'].type = kfdm.length ? '4' : '3'; + this.projectsObj = { + ...this.projectsObj + } + } + this.judgeConfigObj[sys.v_no] = value }); this.judgeConfig = syssetJudgeConfigArr; } - // 初始化systemParam表 - async initSystemKm2Param(sysParam?: SYSTEMPARMARR[]) { - const systemParms: any = sysParam || await getSyncData('MA_SYSTEMPARM') - const carName = this.carName; - - let carNo2 = '', allItems = []; - systemParms.forEach((systemParm) => { - const {no1,no2,no3} = systemParm; - - //获取当前考车的no2 - if (no1 == 3 && no3 == 1) { - const txt1 = decodeURI(systemParm.txt1) - if (txt1 === carName) { - carNo2 = no2; - } - } - - //获取当前考车的考试项目 - if (carNo2 !== '' && no2 == carNo2 && no3 == 10) { - allItems = decodeURIComponent(systemParm.txt1).split(',') - } - - // 存储当前考车考试项目 - if (allItems.length && no1 == 6 && allItems.includes(no2)) { - const txt2 = decodeURIComponent(systemParm.txt2) - const currentProject = { - name: decodeURI(systemParm.txt1), - abbreviation: decodeURI(systemParm.txt3), - projectCode: no2, - projectCodeCenter: txt2 - // sbxh:project.type - } - this.projectsObj[no2] = currentProject - this.projectsCenterObj[txt2] = currentProject - this.projects.push(currentProject) - } - }) - - const projects = this.projects; - if (!projects.length) { - Prompt.showToast({ - message: '读取数据库信息失败,请重新考试!', - duration: 8000 - }); - router.back(); - } - } - //初始化systemParam表 - async initSystemKm3Param(sysParam?: SYSTEMPARMARR[]) { + async initSystemParam(sysParam?: SYSTEMPARMARR[]) { const systemParms: any = sysParam || await getSyncData('MA_SYSTEMPARM') - + let currentParams: any = router.getParams(); + const {carName,carType,examSubject} = this; + //小车车型列表 + const sCarTypes = ['C1', 'C2', 'C5'] + this.wayno = currentParams.wayno const {isTrajectoryOpen} = judgeConfig - + let carNo = '', allItems = []; systemParms.forEach((systemParm) => { - if (isTrajectoryOpen) { systemParm.no1 = systemParm.NO1; systemParm.no2 = systemParm.NO2; @@ -313,8 +222,44 @@ struct Index { systemParm.txt2 = systemParm.TXT2; systemParm.txt3 = systemParm.TXT3; } - const {no1,no2,no3,} = systemParm; + //获取当前考车的no2 + if (no1 == 3 && no3 == 1) { + const txt1 = decodeURI(systemParm.txt1) + if (txt1 === carName) { + carNo = no2 + } + } + //获取当前考车的考试项目 + if (carNo !== '' && no1 == 3 && no2 == carNo && no3 == 10) { + allItems = decodeURIComponent(systemParm.txt1).split(',').filter(txt => txt !== '') + } + const txt2 = decodeURIComponent(systemParm.txt2); + if ( + //科目二获取项目 + (examSubject == 2 && allItems.length && no1 == 6 && allItems.includes(no2)) + || + //科目三获取项目 + (examSubject == 3 && no1 == 6) + ) { + + const name = decodeURI(systemParm.txt1) + //小车过滤掉 夜间模拟行驶 + if (sCarTypes.includes(carType) && name === '夜间行驶') { + return + } + const currentProject = { + name, + abbreviation: decodeURI(systemParm.txt3), + projectCode: no2, + projectCodeCenter: txt2, + //是否是必考 + isRequired: allItems.includes(no2 + ''), + } + this.projectsObj[no2] = currentProject + this.projectsCenterObj[txt2] = currentProject + this.projects.push(currentProject); + } this.systemparmArr.push({ 'NO1': no1 * 1, 'NO2': no2 * 1, @@ -323,31 +268,15 @@ struct Index { 'TXT2': decodeURIComponent(systemParm.txt2), 'TXT3': decodeURIComponent(systemParm.txt3), }) - - const txt2 = decodeURIComponent(systemParm.txt2) - if (no1 == 6) { - const currentProject = { - name: decodeURI(systemParm.txt1), - abbreviation: decodeURI(systemParm.txt3), - projectCode: no2, - projectCodeCenter: txt2 - } - this.projectsObj[no2] = currentProject - this.projectsCenterObj[txt2] = currentProject - this.projects.push(currentProject) - } - // if(no1 == 3 && no2 == 1 && no3 == 15){ - // this.examMileage = decodeURI(systemParm.txt1) - // } }) const projects = this.projects; - if (!projects.length) { - Prompt.showToast({ - message: '读取数据库信息失败,请重新考试!', - duration: 8000 - }); - router.back(); - } + // if (!projects.length) { + // Prompt.showToast({ + // message: '读取数据库信息失败,请重新考试!', + // duration: 8000 + // }); + // router.back(); + // } } // 获取场地设备信息 @@ -398,6 +327,7 @@ struct Index { const startTime = examItemsArrs[0] const ddxkKsxmArr = examItemsArrs[2]?.split(',').filter(item => item) || [] const ddxkKfArr = examItemsArrs[3]?.split('^').filter(item => item) || [] + if (ddxkKsxmArr?.length) { this.isDdxk = true ddxkKsxmArr.forEach(xmdm => { @@ -488,14 +418,12 @@ struct Index { const strArr = str.split('\n'); const [initData, beginData] = [strArr[0], strArr[1]]; const initDataObj = JSON.parse(initData) + // initDataObj.systemparm = const systemparm = initDataObj.systemparm; const examSubject = globalThis.carInfo.examSubject; this.examSubject = isTrajectoryOpen ? (initDataObj.kskm * 1) : examSubject; globalThis.carInfo.examSubject = this.examSubject - examSubject == 2 - ? await this.initSystemKm2Param(systemparm) - : await this.initSystemKm3Param(systemparm) - //@ts-ignore + await this.initSystemParam(systemparm) await this.initMarkRules(initDataObj.mark); await this.initSysset(initDataObj.sysset); } @@ -538,7 +466,7 @@ struct Index { if (this.examSubject == 3) { Row() { Text('考试路线:').fontColor('#E5CCA1').fontSize(this.FONTSIZE) - Text(`线路${globalThis.carInfo.wayno}`).fontColor('#FFAD33').fontSize(this.FONTSIZE) + Text(`线路${this.wayno}`).fontColor('#FFAD33').fontSize(this.FONTSIZE) } } @@ -578,7 +506,6 @@ struct Index { Row() { Flex({ direction: FlexDirection.Column }) { - if (this.kfArr.length) { List({}) { ForEach(this.kfArr, (item) => { @@ -593,7 +520,7 @@ struct Index { .justifyContent(FlexAlign.SpaceBetween) .padding({ top: 12, bottom: 12, left: 8, right: 5 }) - Text(item.desc) + Text(item.desc + `(${item.markcatalog})`) .fontSize(this.BIGFONTSIZE) .fontColor('#E5CBA1') .margin({ top: 10, bottom: 8, left: 5, right: 5 }) @@ -611,7 +538,6 @@ struct Index { .backgroundColor('#38260B') .justifyContent(FlexAlign.SpaceBetween) .padding({ top: 12, bottom: 12, left: 8, right: 3 }) - }.margin({ top: 35 }).padding({ left: 20, right: 20 }).alignItems(HorizontalAlign.Start) } @@ -698,45 +624,32 @@ struct Index { .padding(30) .margin({ right: 5 }) - Flex({ wrap: FlexWrap.Wrap, direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceAround }) { - List() { - ForEach(this.artSubject3Projects, (item, index) => { - ListItem() { - } - .backgroundImage( - $rawfile( - `judge/km3/${this.getIsExitManualProject(index) ? item : (item + '_gray')}.png` - ), ImageRepeat.NoRepeat) - .backgroundImageSize({ width: '100%', height: '100%' }) - .width(174) - .height(118) - .margin({ bottom: 15 }) - .onClick(() => { - if (this.getIsExitManualProject(index)) { - // 靠边停车时候可以触发 - if (this.judgeConfigObj['343'] == 0) { - const xmmcStr = this.xmmcStr; - if (xmmcStr == '无' || xmmcStr == '') { - this.amplifiedImgIndex = index; - this.isAmplifyPopShow = true - } else { - if (index === 5) { - Prompt.showToast({ - message: `${xmmcStr}未结束,不允许靠边停车`, - duration: 8000 - }); - } - - } - } else { - this.amplifiedImgIndex = index; - this.isAmplifyPopShow = true - } + if (this.projects.length) { + Flex({ + wrap: FlexWrap.Wrap, + direction: FlexDirection.Row, + justifyContent: FlexAlign.SpaceAround + }) { + List() { + ForEach(this.artSubject3Projects, (item, index) => { + ListItem() { } + .backgroundImage( + $rawfile( + `judge/km3/${this.getIsExitManualProject(index) ? (this.getIsEndManualProject(index)) : (item + '_gray')}.png` + ), ImageRepeat.NoRepeat) + .backgroundImageSize({ width: '100%', height: '100%' }) + .width(174) + .height(118) + .margin({ bottom: 15 }) + .onClick(() => { + this.setManualProjectFn(index) + }) }) - }) - }.lanes(3).margin({ left: 5, top: 18 }) + }.lanes(3).margin({ left: 5, top: 18 }) + } } + } .backgroundImage($rawfile('judge/project_bg.png'), ImageRepeat.NoRepeat) .backgroundImageSize({ width: '100%', height: '100%' }) @@ -863,7 +776,6 @@ struct Index { this.endPopupVisible = false; this.loadingPopupVisible = true globalThis.isJudge = false - examJudgeEndExam(); clearInterval(this.timer); clearInterval(globalThis.judgeTimer) globalThis.windowClass.setWindowSystemBarEnable(['navigation']) @@ -902,9 +814,10 @@ struct Index { } //科目三人工扣分弹窗 - if (this.isDeductedPopShow) { + if (this.isDeductedPopShow && this.examSubject == 3) { DeductedPopup({ currentItems: Reflect.ownKeys(this.projectsObj).map(projectKey => { + //@ts-ignore const project = this.projectsObj[projectKey] return project.type == '2' ? project.projectCode : '' }).filter(project => project !== ''), @@ -921,12 +834,12 @@ struct Index { } //科目三人工项目确认框 - if (this.isAmplifyPopShow) { + if (this.isAmplifyPopShow && this.examSubject == 3) { AmplifyPopup({ amplifyImgIndex: this.amplifiedImgIndex, confirmAmplify: async (amplify) => { const judge = this.judge - await judge.setJudgeItem(amplify.projectCode); + await judge.setJudgeItem(amplify.projectCode, 1); this.isAmplifyPopShow = false }, closeAmplifyPop: () => { @@ -948,41 +861,281 @@ struct Index { return '#FFAD33'; break; case '3': - return '#00FFD5'; + return '#ff109d0a'; break; case '4': return '#FF7566'; break; default: - return '#E6DECF';break; + return '#E6DECF'; + break; + } + } + + //人工项目操作 + async setManualProjectFn(index: number) { + const { + judgeConfigObj, + isManualProjectIn, + getIsExitManualProject, + artSubject3ProjectsCodesArr, + currentXmdm, + } = this; + const projectCode = artSubject3ProjectsCodesArr[index] + if (getIsExitManualProject(index)) { + // 正在进行的项目 取消项目 + if (isManualProjectIn && projectCode === currentXmdm) { + await this.judge.setJudgeItem(currentXmdm, 2); + Prompt.showToast({ + message: '项目取消', + duration: 2000 + }) + return + } + + // 靠边停车时候可以触发 + if (judgeConfigObj['343'] == 0) { + const xmmcStr = this.xmmcStr; + if (xmmcStr == '无' || xmmcStr == '') { + this.amplifiedImgIndex = index; + this.isAmplifyPopShow = true + } else { + if (index === 5) { + Prompt.showToast({ + message: `${xmmcStr}未结束,不允许靠边停车`, + duration: 8000 + }); + } + } + } else { + this.amplifiedImgIndex = index; + this.isAmplifyPopShow = true + } } } // 获取是否能人工进项目 getIsExitManualProject = (index: number) => { - const {judgeConfigObj,artSubject3ProjectsCodesArr,projectsObj} = this; - + const { + judgeConfigObj, + artSubject3ProjectsCodesArr, + projectsObj, + carztStr, + isManualProjectIn, + isProjectIn, + currentXmdm, + getProjectIsInRoad + } = this; + const projectCode = artSubject3ProjectsCodesArr[index]; + const projectType = projectsObj[projectCode].type; + //不允许人工触发的项目列表,以","分隔 const unExitManualProjects = judgeConfigObj['332'].split(',') || []; - const param348 = judgeConfigObj['348'] || '0'; - const param387 = judgeConfigObj['387'] || '0'; - if (judgeConfigObj['342'] === '3' || judgeConfigObj['342'] === '2') { + + //直线行驶中不进其他考试项目(0-否 1-是) + const param348 = judgeConfigObj['348'] || '0', + //里程不够允许手工点靠边停车(0-否 1-是) + param387 = judgeConfigObj['387'] || '0', + //里程不够不报靠边停车(0-否+1-是+2-必考项目未完成且里程不够不报项目) + param319 = judgeConfigObj['319'] || '0', + //人工项目是否能取消 1:可取消; + param340 = judgeConfigObj['340'] || '0', + //307参数里设置的项目,项目已经做过,后续不能人工触发; + param307 = (judgeConfigObj['307'] || '').split(','); + + + //非行驶状态(没有速度),人工项目不能触发(按钮灰色) + if (carztStr === '停车') { return false } + //车上是否能进行人工操作(0-能1-不能人工评判2-不能人工进项目3-都不能) + if (judgeConfigObj['342'] === '3' || judgeConfigObj['342'] === '2') { + return false + } + //不允许人工触发的项目列表 if (unExitManualProjects.includes(artSubject3ProjectsCodesArr[index])) { return false } + //项目进行中不能人工触发 + if (isProjectIn) { + return currentXmdm == projectCode + } + + //项目路段信息判断 + if(!getProjectIsInRoad(projectCode+'')){ + return false + } + + //@ts-ignore 直线行驶中不进其他考试项目(0-否 1-是) if (param348 == '0' && projectsObj['9']?.type == 2) { return index === 0 ? true : false } - if (param387 === '0' && index === 5) { - const {examMileage,jl} = this - return jl >= Number(examMileage) + //项目已经做过,后续不能人工触发 + if (param307.includes(projectCode) && (projectType == '3' || projectType == '4')) { + return false + } + + //查询是否有正在进行的项目 + if (param340 == 1 && isManualProjectIn && currentXmdm == projectCode) { + return true + } + + //319不为0,或者387不为1,里程不够时,靠边停车项目不能触发 + if ((param387 != '1' || param319 != '0') && index === 5) { + const {examMileage,isRequiredProjectsEnd,jl} = this; + //里程是否达标 && 必考项目是否全完成 + return jl >= Number(examMileage) && isRequiredProjectsEnd } return true } + // 判断项目是否在当前路段号 + getProjectIsInRoad = (projectCode:string,) => { + const { + judgeConfigObj, + lane:{road,num,count} + } = this; + + const projectRoads = { + //直线行驶 + '3': (judgeConfigObj['514'].split(',') || []), + //变更车道 + '4':judgeConfigObj['515'].split(',') || [], + //超车 + '10':judgeConfigObj['516'].split(',') || [], + //靠边停车 + '11':judgeConfigObj['517'].split(',') || [], + //会车 + '9':judgeConfigObj['518'].split(',') || [], + //掉头 + '12':judgeConfigObj['519'].split(',') || [], + }; + + //未测绘得道路上或者不在差分状态 + if(road === ''){ + return false + } + + //设置了514-519参数,只能在设置的路段触发对应项目 + if(projectRoads[projectCode].includes(road)){ + //如果525为1,则514-519设置的路段不能触发对应项目 + if(judgeConfigObj['525'] == '1'){ + return false + } + }else{ + return false + } + + //405参数为2是,如果在最左侧车道,超车项目不能触发; + if(projectCode == '10' && + judgeConfigObj['402'] == '2' && + (num === count) && + num > 0 + ){ + return false + } + + // 车道总数少于2条,超车和变道不能触发 + if(projectCode == '10' || projectCode == '4'){ + if(count < 2){return false} + } + + return true + + + } + // 获取人工项目是否已做 + getIsEndManualProject = (index: number) => { + const projectName = this.artSubject3Projects[index]; + const projectCode = this.artSubject3ProjectsCodesArr[index]; + const type = this.projectsObj[projectCode].type + if (type == '2') { + return projectName + } + return (type == '3' || type == '4') ? `${projectName}_red` : `${projectName}_green`; + } + scroller: Scroller = new Scroller() + //页面通用字体大小 + @State wayno: number = 0 + @State FONTSIZE: number = 28 + @State BIGFONTSIZE: number = 28 + //结束考试弹窗 + @State endPopupVisible: boolean = false + //等待弹窗(考试及格,考试不及格使用) + @State loadingPopupVisible: boolean = false + //实时轨迹弹窗 + @State signDisplayComVisible: boolean = false + @State isDdxk: boolean = false; + @State time: string = '' + //考试用时 + @State examTime: number = 0 + //开始时间 + @State startTime: string = '00:00:00' + @State startFullTime: string = '' + @State startHourTime: string = '' + //科目类型 + @State examSubject: 2 | 3 = 3; + @State ddxkTime: number = 0; + @State ddxkKsxmArr: string[] = [''] + @State ddxkKfArr: string[] = [''] + @State xmmcStr: string = '' + @State carztStr: string = '' + @State kfArr: { + xmmcStr?: string, + score: string, + desc: string + markcatalog: string + }[] = [] + @State name: string = '' + @State idCard: string = '' + @State totalScore: number = 100 + //模拟考试项目 + @State projects: Project[] = [] + @State projectsObj: ProjectObj = {} + @State projectsCenterObj: ProjectObj = {} + @State markRuleListObj: MarkRule = {} + @State cdsbInfoObj: CDSBInfo = {} + @State timer: number = 0 + @State judgeConfig: { [k: string]: string }[] = [] + @State judgeConfigObj: { [k: string]: any } = defaultJudgeConfigObj + //流水号 + @State lsh: string = '' + @State kszp: string = '' + @State ksdd: string = '' + @State kssycs: string = '' + @State kslx: string = '' + //监管接口序列号 + @State serialNumber: number = 0 + @State carType: string = '' + @State carName: string = '' + @State isDeductedPopShow: boolean = false + @State isAmplifyPopShow: boolean = false + @State amplifiedImgIndex: number = 0 + @State judge: any = {} + //行驶距离 + @State jl: number = 0 + //应考里程 + @State examMileage: string = '0' + @State artSubject3Projects: string[] = ['直线', '会车', '变道', '超车', '掉头', '停车'] + @State artSubject3ProjectsCodesArr: string[] = ['3', '9', '4', '10', '12', '11'] + @State manualMarkRules: MarkRule[] = [] + //科目三评判初始化数据 + @State systemparmArr: SYSTEMPARMARR[] = [] + @State mapPointItemArr: MAPITEMPOINTITEM[] = [] + @State carinfoArrr: CARINFO[] = [] + @State mapPointArr: MAPPOINT[] = [] + //手动项目是否在进行中 + @State isManualProjectIn: boolean = false; + //项目是否进行中 + @State isProjectIn: boolean = false; + //正在进行的项目代码 + @State currentXmdm: string = '' + //必考项目除靠边停车是否全部完成 + @State isRequiredProjectsEnd: boolean = false; + @State lane: LANE = { road: '', num: 0, count: 0 } + private context = getContext(this) as common.UIAbilityContext; + //已考考试项目 } diff --git a/entry/src/main/ets/pages/Roads.ets b/entry/src/main/ets/pages/Roads.ets index 3d0e2cf1..ee85a8ba 100644 --- a/entry/src/main/ets/pages/Roads.ets +++ b/entry/src/main/ets/pages/Roads.ets @@ -24,7 +24,6 @@ export default struct Index { const {no1,no2,no3,txt1,txt2} = systemParm; if (no1 == 4) { const temp = { no2, no3, txt1: decodeURI(txt1), txt2 } - console.info('surenjun', JSON.stringify(temp)) this.roadObj[no2] = no2 } }) @@ -57,10 +56,8 @@ export default struct Index { const roadArr = Reflect.ownKeys(this.roadObj).map((roadKey) => { return this.roadObj[roadKey] }); - globalThis.carInfo.wayno = roadArr[Math.floor(Math.random()*roadArr.length)]; - router.pushUrl({ - url: 'pages/Judge', - }, router.RouterMode.Single); + const wayno = roadArr[Math.floor(Math.random()*roadArr.length)]; + this.goJudge(wayno) }) ForEach(Reflect.ownKeys(this.roadObj), (roadIndex) => { ListItem() { @@ -81,10 +78,7 @@ export default struct Index { .height(220) .margin({ left: 5, bottom: 10 }) .onClick(async () => { - globalThis.carInfo.wayno = this.roadObj[roadIndex]; - router.pushUrl({ - url: 'pages/Judge', - }, router.RouterMode.Single); + this.goJudge(this.roadObj[roadIndex]) }) }) }.lanes(8).margin({ top: 50, left: 15 }) @@ -95,6 +89,18 @@ export default struct Index { } - outClick() { + goJudge(wayno) { + let currentParams: any = router.getParams() || {}; + const {sczb,kfdm} = currentParams; + router.replaceUrl({ + url: 'pages/Judge', + params:{ + sczb, + kfdm, + wayno + } + }, router.RouterMode.Single); + } + outClick(){} } \ No newline at end of file diff --git a/entry/src/main/ets/pages/UserInfo.ets b/entry/src/main/ets/pages/UserInfo.ets index dff3136f..c5dbf008 100644 --- a/entry/src/main/ets/pages/UserInfo.ets +++ b/entry/src/main/ets/pages/UserInfo.ets @@ -14,8 +14,9 @@ import common from '@ohos.app.ability.common'; import { User } from './interfaces'; import WebRTCVoice from './webRTC/'; import promptAction from '@ohos.promptAction'; +import { getSyncData } from '../common/service/initable'; import { CandidateData, EmptyCandidateObject } from '../mock/CandidateData'; - +import BoardPrePareSetPopup from './compontents/judge/BoardPrePareSetPopup' @Entry @Component struct UserInfo { @@ -34,6 +35,10 @@ struct UserInfo { @State url: string = '' @State lsh: string = '' @State qkFlag: boolean = false + @State isBoardPrePareSetPopupOpen: boolean = false + @State isFirstBoardPrePareSetPopupBtnShow: boolean = false + @State isBoardPrePareSetPopupShow: boolean = false + @State sczbkf:{xmdm:number,kfdm:string}[] = [] @State currentUser: User = EmptyCandidateObject @State dataList: Array = [] @State list: Array = [] @@ -194,7 +199,9 @@ struct UserInfo { this.qkFn() } - initData() { + async initData() { + this.sczbkf = [] + this.isFirstBoardPrePareSetPopupBtnShow = false; this.stepFlag = false this.faceCompareSucess = 0 this.showFaceCompare = false @@ -216,6 +223,15 @@ struct UserInfo { } else { // this.getExaminationStudentInfoFn() } + const syssetParams = await getSyncData('MA_SYSSET'); + //@ts-ignore + syssetParams.forEach(sys => { + //364 绕车一周评判时机(1-开始考试后判 2-开始考试前判) + if(sys.v_no === '364'){ + this.isBoardPrePareSetPopupOpen = true; + } + }) + } async heartMsg() { @@ -531,6 +547,7 @@ struct UserInfo { build() { Column() { + TopLogo({ outFlag: $outFlag }).margin({ bottom: 10 }) Row() { Row() { @@ -627,54 +644,70 @@ struct UserInfo { .onClick(() => { this.qkFlag = true }) - Image($r('app.media.ksks_btn')) - .commStyle() - .onClick(() => { - this.faceCompareSucess = 0 - globalThis.statue = 2 - if (!this.currentUser.xm) { - return - } - // if(globalThis.spzdFlag){ - // promptAction.showToast({ - // message: '摄像头被遮挡', - // duration: 2000 - // }); - // return - // } - //TODO 科目三先写死 - globalThis.carInfo.examSubject = 3; - if (globalThis.singlePlay) { - const {examSubject} = globalThis.carInfo; - this.AccountTable.query('0', (result) => { - if (result.length == 0) { - this.AccountTable.insertData(this.currentUser, (id) => { - this.AccountTable.query('0', (result) => { - router.pushUrl({ - url: examSubject == 3 ? 'pages/Roads':'pages/Judge', - }, router.RouterMode.Single); - this.stopDeviceById() - }) - }) - } else { - this.AccountTable.updateData(this.currentUser, (id) => { - this.AccountTable.query('0', (result) => { - router.pushUrl({ - url: examSubject == 3?'pages/Roads':'pages/Judge', - }, router.RouterMode.Single); - this.stopDeviceById() - }) - }) - } - }) - return - } - if (this.FaceOpenStatue != '0') { - this.showFaceCompare = true - } else { - this.sfbdinterfaceFn() - } + + if( this.isBoardPrePareSetPopupOpen && !this.isFirstBoardPrePareSetPopupBtnShow){ + //上车准备 + Image($r('app.media.sczb_btn')).commStyle().onClick(()=>{ + this.isBoardPrePareSetPopupShow = true; + this.isFirstBoardPrePareSetPopupBtnShow = true; }) + }else{ + Image($r('app.media.ksks_btn')) + .commStyle() + .onClick(() => { + this.faceCompareSucess = 0 + globalThis.statue = 2 + if (!this.currentUser.xm) { + return + } + // if(globalThis.spzdFlag){ + // promptAction.showToast({ + // message: '摄像头被遮挡', + // duration: 2000 + // }); + // return + // } + if (globalThis.singlePlay) { + const {examSubject} = globalThis.carInfo; + this.AccountTable.query('0', (result) => { + if (result.length == 0) { + this.AccountTable.insertData(this.currentUser, (id) => { + this.AccountTable.query('0', (result) => { + router.pushUrl({ + url: examSubject == 3 ? 'pages/Roads':'pages/Judge', + params:{ + sczb:Number(this.isBoardPrePareSetPopupOpen), + kfdm:this.sczbkf + } + }, router.RouterMode.Single); + this.stopDeviceById() + }) + }) + } else { + this.AccountTable.updateData(this.currentUser, (id) => { + this.AccountTable.query('0', (result) => { + router.pushUrl({ + url: examSubject == 3?'pages/Roads':'pages/Judge', + params:{ + sczb:Number(this.isBoardPrePareSetPopupOpen), + kfdm:this.sczbkf + } + }, router.RouterMode.Single); + this.stopDeviceById() + }) + }) + } + }) + return + } + if (this.FaceOpenStatue != '0') { + this.showFaceCompare = true + } else { + this.sfbdinterfaceFn() + } + }) + } + } } @@ -719,6 +752,19 @@ struct UserInfo { .backgroundColor('#E6E3DF') .borderRadius(19 * this.ratio) } + + // 上车准备 + if(this.isBoardPrePareSetPopupShow){ + BoardPrePareSetPopup({ + closePopup:()=>{ + this.isBoardPrePareSetPopupShow = false + }, + confirmMark:(kfdm)=>{ + this.sczbkf= kfdm + } + }) + } + } .height('100%') .width('100%') diff --git a/entry/src/main/ets/pages/compontents/judge/BoardPrePareSetPopup.ets b/entry/src/main/ets/pages/compontents/judge/BoardPrePareSetPopup.ets new file mode 100644 index 00000000..d13a1ff2 --- /dev/null +++ b/entry/src/main/ets/pages/compontents/judge/BoardPrePareSetPopup.ets @@ -0,0 +1,351 @@ +import { getSyncData } from '../../../common/service/initable'; +import { judgeConfig } from '../../judgeSDK/utils/judgeConfig'; +import FileUtil from '../../../common/utils/File'; +import common from '@ohos.app.ability.common'; +import VoiceAnnounce from '../../judgeSDK/utils/voiceAnnouncements'; + +import { + MarkRule, + SYSSET, +} from '../../judgeSDK/api/judgeSDK.d'; + +interface SEL { + fontColor: string + bgColor: string +} + +@Component +export default struct DeductedPopup { + private context = getContext(this) as common.UIAbilityContext; + private avPlayer + @State name: string = '' + @State idCard: string = '' + @State lsh: string = '' + @State kszp: string = '' + @State ksdd: string = '' + @State kssycs: string = '' + @State kslx: string = '' + @State kfdmArr: { + xmdm: number, + kfdm: string, + markreal: number + }[] = [] + //开始考试前判绕车一周评判是否开启 + @State isOpen: boolean = false + //监管序列号 + @State serialNumber: number = 0; + @State examSubject: number = 2; + @State markRuleListObj: MarkRule = {} + @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; + @State universalMarkRules: MarkRule[] = [] + @State manualMarkRules: MarkRule[] = [] + @State lineBg: Array = ['#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+'')) + const {isTrajectoryOpen} = judgeConfig; + if (isTrajectoryOpen) { + this.initDb() + } else { + this.initSysset() + this.initMarkRules() + } + this.avPlayer = new VoiceAnnounce(); + } + + //本地数据初始化 + async initDb() { + const {isTrajectoryOpen,trajectoryPath} = judgeConfig + const examSubject = globalThis.carInfo.examSubject; + //轨迹回放读取 systemparam表、markrule表 + const fileUtil = new FileUtil(this.context); + const folderPath = await fileUtil.initFolder(trajectoryPath); + const str = await fileUtil.readFile(folderPath); + const strArr = str.split('\n'); + const [initData, beginData] = [strArr[0], strArr[1]]; + const initDataObj = JSON.parse(initData); + this.examSubject = isTrajectoryOpen ? (initDataObj.kskm * 1) : examSubject; + await this.initMarkRules(initDataObj.mark); + await this.initSysset(initDataObj.sysset); + await this.initStudent() + } + + //获取sysset表数据 + async initSysset(sysset?: SYSSET[]) { + const syssetParams = sysset || await getSyncData('MA_SYSSET'); + //@ts-ignore + syssetParams.forEach(sys => { + //监管序列号 + if (sys.v_no == '901') { + this.serialNumber = sys.v_value || '123456' + } + console.info('surenjun',sys.v_no) + + //364 绕车一周评判时机(1-开始考试后判 2-开始考试前判) + if (sys.v_no == '364') { + const isOpen = sys.v_value == 2 + if (isOpen) { + this.avPlayer.playAudio(['voice/上车准备.mp3']) + console.info('surenjun','voice/上车准备.mp3') + } + + } + }) + } + + //获取markrule表数据 + async initMarkRules(markRules ?: MarkRule[]) { + const markRuleParams = markRules || (await getSyncData('MA_MARKRULE') as MarkRule[]) + + markRuleParams.forEach(mark => { + const tempObj = { + itemno: mark.itemno * 1, + markcatalog: mark.markcatalog, + markshow: decodeURI(mark.markshow), + markreal: mark.markreal * 1, + markstandard: mark.markstandard * 1, + markserial: mark.markserial, + kfxh: mark.kfxh, + OnlyOneKind: mark.onlyoneid * 1, + NoCancelId: mark.nocancelid * 1, + GPS_SID: mark.gps_sid == 0 ? false : true + } + + if (mark.itemno == 1 && Number(mark.markserial) > 100 && Number(mark.markserial) < 200) { + this.markRuleListObj[`${mark.itemno}_${mark.markserial}`] = { + ...tempObj, + markserial: mark.markserial, + }; + this.universalMarkRules.push(tempObj) + } + + }) + + } + + // 获取考生信息 + async initStudent() { + const students = await getSyncData('USER') + const stuInfo = students[0] || {}; + const {xm,sfzmhm,lsh,kszp,ksdd,kssycs,kslx} = stuInfo; + this.name = xm || '测试考生'; + this.idCard = sfzmhm || '01234567891010'; + this.lsh = lsh; + this.kszp = kszp; + this.ksdd = ksdd; + this.kssycs = kssycs; + this.kslx = kslx; + } + + //上一页 下一页 + 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,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]; + const {avPlayer,kssycs} = this; + this.kfdmArr.push({ xmdm: 1, kfdm: mark.markserial, markreal: mark.markreal }) + + //计算总扣分 + let score = this.kfdmArr.reduce((p, n) => { + p += n.markreal + return p + }, 0); + avPlayer.playAudio([`voice/${mark.markcatalog}.mp3`]); + console.info('surenjun',score) + if(!globalThis.singlePlay){ + if (score < -90) { + avPlayer.playAudio([ + 'voice/exam_waiting.mp3', + kssycs == '1' ? 'voice/unqualified_one.wav' : 'voice/unqualified_two.wav' + ]); + + }; + } + + this.confirmMark(this.kfdmArr.map((kf) => ({ + xmdm:kf.xmdm, + kfdm:kf.kfdm, + }))) + + }) + } + }.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)') + } +} \ No newline at end of file diff --git a/entry/src/main/ets/pages/compontents/judge/DeductionPopup.ets b/entry/src/main/ets/pages/compontents/judge/DeductionPopup.ets index fd9e9ecd..38e66c5a 100644 --- a/entry/src/main/ets/pages/compontents/judge/DeductionPopup.ets +++ b/entry/src/main/ets/pages/compontents/judge/DeductionPopup.ets @@ -10,7 +10,7 @@ export default struct DeductedPopup { super() } - @State fontSize:number = 25 + @State fontSize:number = 20 @State unselected:SEL = {fontColor:'#000000', bgColor:'#CCC4B8'} @State selected:SEL = {fontColor:'#FFAD33', bgColor:'#26231E'} @@ -82,7 +82,7 @@ export default struct DeductedPopup { Row(){ Text(text).fontColor(index === this.currentIndex ? this.selected.fontColor : this.unselected.fontColor).fontSize(this.fontSize).fontWeight(500) } - .width(180).height(70) + .width(110).height(60) .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(()=>{ @@ -102,9 +102,9 @@ export default struct DeductedPopup { (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}) + Image($rawfile(`judge/km3/zuo_nor.png`)).height(15).margin({left:20,top:0}) 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%'}) + }.width(120).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}) .onClick(()=>{this.goPage(0)}) } @@ -113,15 +113,14 @@ export default struct DeductedPopup { ){ 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%'}) + Image($rawfile(`judge/km3/you_nor.png`)).height(15).margin({right:6,top:0}) + }.width(120).height(60).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%'}) + Text('扣 分'){}.fontColor('#FFF').fontSize(this.fontSize).padding({left:35}) + }.width(120).height(60).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] @@ -137,16 +136,16 @@ export default struct DeductedPopup { Text(item.markreal + '').fontColor('#FFF').fontSize(this.fontSize).fontWeight(500) } } - .width('100%').height(75).justifyContent(FlexAlign.SpaceBetween).alignItems(VerticalAlign.Center) + .width('100%').height(70).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)') + }.width(1200).height(620).position({x:30,y:315}).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%'}) + + }.width('100%').height('100%').position({y:0}).onClick(()=>{this.closePopup()}) } } \ No newline at end of file diff --git a/entry/src/main/ets/pages/compontents/judge/RealTime.ets b/entry/src/main/ets/pages/compontents/judge/RealTime.ets index 9a69e4b2..7f17973a 100644 --- a/entry/src/main/ets/pages/compontents/judge/RealTime.ets +++ b/entry/src/main/ets/pages/compontents/judge/RealTime.ets @@ -1,5 +1,5 @@ import apiJudgeSdk from 'libJudgeSdk.so'; -import Judge from '../../judgeSDK/utils/judge-real'; +import Judge from '../../judgeSDK/utils/judgeReal'; import { MarkRule, Project, ProjectObj } from '../../judgeSDK/api/judgeSDK.d'; import common from '@ohos.app.ability.common'; diff --git a/entry/src/main/ets/pages/judgeSDK/api/index.ts b/entry/src/main/ets/pages/judgeSDK/api/index.ts index 6ca305c4..c5124d35 100644 --- a/entry/src/main/ets/pages/judgeSDK/api/index.ts +++ b/entry/src/main/ets/pages/judgeSDK/api/index.ts @@ -93,6 +93,8 @@ export async function examJudgeArtificialItem( //操作类型 type:number = 0 ){ + console.info('surenjun itemno=>',itemno) + console.info('surenjun type=>',type) const temp = libJudgeSdk.examJudgeArtificialItem(itemno,type); return await handle(temp,'examJudgeArtificialMark') } @@ -131,6 +133,7 @@ export function handleLog(level,infoStr, len){ * */ export async function examJudgeEndExam(){ + console.info('surenjun','考试结束调用') const temp = libJudgeSdk.examJudgeEndExam(); return await handle(temp,'examJudgeEndExam') } @@ -170,6 +173,26 @@ export async function examJudgeSetPerformCallback(fn){ const temp = libJudgeSdk.examJudgeSetPerformCallback(fn); return await handle(temp,'examJudgeSetPerformCallback') } + +/** + * + * @desc 语音播报结束 + * / + */ + +export async function examJudgeSoundEnd(param:{ + //项目代码 + itemno:number, + //语音码 + code:string, + //语音类型 + type:number, +}){ + const {itemno,code,type} = param; + const temp = libJudgeSdk.examJudgeSoundEnd(itemno,code,type); + return await handle(temp,'examJudgeSoundEnd') +} + /* * @desc通用处理函数 * diff --git a/entry/src/main/ets/pages/judgeSDK/api/judgeSDK.d.ts b/entry/src/main/ets/pages/judgeSDK/api/judgeSDK.d.ts index 4a49c751..f75ad652 100644 --- a/entry/src/main/ets/pages/judgeSDK/api/judgeSDK.d.ts +++ b/entry/src/main/ets/pages/judgeSDK/api/judgeSDK.d.ts @@ -16,7 +16,8 @@ export interface MarkRule{ itemno?:number markcatalog?:string markshow?:string - markserial?:number + markserial?:string + markstandard?:number, markreal?:number kfxh?:string onlyoneid?:number @@ -78,8 +79,8 @@ export interface MAPITEMPOINTITEM{ } export interface EXAMDATA{ - //1:项目开始 2:项目结束 3:扣分 4:考车状态 5:考试结束 6:项目取消 7:语音播放和提示 8:模拟灯光事件 - event:1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 + //1:项目开始 2:项目结束 3:扣分 4:考车状态 5:考试结束 6:项目取消 7:语音播放和提示 8:模拟灯光事件 9:车道信息事件 + event:1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 //时间 sj:number //考车状态 -1:后退 0:停车 1:前进 @@ -118,11 +119,12 @@ export interface EXAMDATA{ sound:{ xmdm:number, //语音播放文件代码 - code:string + code:string, + type:number }, //模拟灯光 - mndg:string - + mndg:string, + lane:LANE } @@ -138,7 +140,9 @@ export interface SOUND { //项目代码 xmdm:number //语音播放提示代码 - code:string + code:string, + //0:普通,1:模拟灯光 + type:number } export interface SYSSET { v_no:string, @@ -146,8 +150,21 @@ export interface SYSSET { v_value:string } +export interface LANE{ + //当前路段号 如果road为空字符串””,说明当前在未测绘得道路上或者不在差分状态 + road:string + /*当前基准天线所在车道号 + num等于0或者count等于0说明当前未在测绘路段,或者不在差分状态。 + num等于1的时候表示在最右侧车道 + num等于count的时候的表示在最左侧车道 + */ + num:number + //当前基准天线共有几股车道 + count:number +} + export interface ProjectObj { - [k:any]:Project + [k:string]:Project } diff --git a/entry/src/main/ets/pages/judgeSDK/dataTest/index.ts b/entry/src/main/ets/pages/judgeSDK/dataTest/index.ts index d6c76734..b2093672 100644 --- a/entry/src/main/ets/pages/judgeSDK/dataTest/index.ts +++ b/entry/src/main/ets/pages/judgeSDK/dataTest/index.ts @@ -550,11 +550,11 @@ export const testAllitems = [ ] export const testUIAllitems = [ - {name:'倒车入库',abbreviation:'倒车入库',projectCode:'0',projectCodeCenter:'20100',type:'1'}, - {name:'坡道停车',abbreviation:'坡道停车',projectCode:'2',projectCodeCenter:'20300',type:'10'}, - {name:'侧方停车',abbreviation:'侧方停车',projectCode:'3',projectCodeCenter:'20400',type:'5'}, - {name:'曲线行驶',abbreviation:'曲线行驶',projectCode:'5',projectCodeCenter:'20600',type:'7'}, - {name:'直角转弯',abbreviation:'直角转弯',projectCode:'6',projectCodeCenter:'20700',type:'3'}, + {"name":"倒车入库","abbreviation":"倒车入库","projectCode":"0","projectCodeCenter":"20100","type":"1"}, + {"name":"坡道停车","abbreviation":"坡道停车","projectCode":"2","projectCodeCenter":"20300","type":"10"}, + {"name":"侧方停车","abbreviation":"侧方停车","projectCode":"3","projectCodeCenter":"20400","type":"5"}, + {"name":"曲线行驶","abbreviation":"曲线行驶","projectCode":"5","projectCodeCenter":"20600","type":"7"}, + {"name":"直角转弯","abbreviation":"直角转弯","projectCode":"6","projectCodeCenter":"20700","type":"7"}, ] //所有的科二项目 diff --git a/entry/src/main/ets/pages/judgeSDK/judge.ts b/entry/src/main/ets/pages/judgeSDK/judge.ts index 1af8f29a..6e7e16ac 100644 --- a/entry/src/main/ets/pages/judgeSDK/judge.ts +++ b/entry/src/main/ets/pages/judgeSDK/judge.ts @@ -123,7 +123,7 @@ export default class Judge { await fileLog.setExamJudgeLogData(info); }) - console.info(judgeTag, '2.注册日志回调完成',isTrajectoryOpen) + console.info(judgeTag, '2.注册日志回调完成') let initInfo = isTrajectoryOpen ? JSON.parse(strArr[0]) : await this.getJudgeInitData(); @@ -321,7 +321,9 @@ export default class Judge { //项目结束 case 2: judgeUI.projectsObj[xmdm].type = (xmjs.xmhg === 0 ? '4' : '3'); - this.judgeUI.isManualProjectIn = false + if(isManualProjectIn){ + this.judgeUI.isManualProjectIn = false + } //统计必考项目数量 this.xmmcStr = '无'; this.xmmcCode = ''; diff --git a/entry/src/main/ets/pages/judgeSDK/utils/simulate-lights.ts b/entry/src/main/ets/pages/judgeSDK/utils/simulate-lights.ts deleted file mode 100644 index 96903f15..00000000 --- a/entry/src/main/ets/pages/judgeSDK/utils/simulate-lights.ts +++ /dev/null @@ -1,27 +0,0 @@ -import VoiceAnnounce from './voice-announcements' - -// 模拟灯光 -export default class SimulateLights{ - - //模拟灯光播放5个 - private avPlayer - - //语音文件存放目录 - private voiceDir:string = 'judge/km3/lights' - - constructor(avPlayer) { - this.avPlayer = avPlayer; - this.playLight() - } - - //播放灯光语音 - public async playLight(){ - - } - - //获取随机播放序号 - private async getRandomIndex(){ - - } - -} \ No newline at end of file diff --git a/entry/src/main/resources/base/media/img.png b/entry/src/main/resources/base/media/img.png new file mode 100644 index 00000000..b4d77dff Binary files /dev/null and b/entry/src/main/resources/base/media/img.png differ diff --git a/entry/src/main/resources/base/media/img_1.png b/entry/src/main/resources/base/media/img_1.png new file mode 100644 index 00000000..b4d77dff Binary files /dev/null and b/entry/src/main/resources/base/media/img_1.png differ diff --git a/entry/src/main/resources/base/media/sczb_btn.png b/entry/src/main/resources/base/media/sczb_btn.png new file mode 100644 index 00000000..bd3dee61 Binary files /dev/null and b/entry/src/main/resources/base/media/sczb_btn.png differ diff --git a/entry/src/main/resources/rawfile/voice/30203.mp3 b/entry/src/main/resources/rawfile/voice/30203.mp3 new file mode 100644 index 00000000..409e2637 Binary files /dev/null and b/entry/src/main/resources/rawfile/voice/30203.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/30207.mp3 b/entry/src/main/resources/rawfile/voice/30207.mp3 index 109f7677..7589ad16 100644 Binary files a/entry/src/main/resources/rawfile/voice/30207.mp3 and b/entry/src/main/resources/rawfile/voice/30207.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/30209.mp3 b/entry/src/main/resources/rawfile/voice/30209.mp3 index 059a9324..72db589e 100644 Binary files a/entry/src/main/resources/rawfile/voice/30209.mp3 and b/entry/src/main/resources/rawfile/voice/30209.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/40202.mp3 b/entry/src/main/resources/rawfile/voice/40202.mp3 new file mode 100644 index 00000000..784f3ae2 Binary files /dev/null and b/entry/src/main/resources/rawfile/voice/40202.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/40304.mp3 b/entry/src/main/resources/rawfile/voice/40304.mp3 new file mode 100644 index 00000000..338100bf Binary files /dev/null and b/entry/src/main/resources/rawfile/voice/40304.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/405004.mp3 b/entry/src/main/resources/rawfile/voice/405004.mp3 new file mode 100644 index 00000000..46e1f3af Binary files /dev/null and b/entry/src/main/resources/rawfile/voice/405004.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/40502.mp3 b/entry/src/main/resources/rawfile/voice/40502.mp3 index 37c3d04c..b019b0f2 100644 Binary files a/entry/src/main/resources/rawfile/voice/40502.mp3 and b/entry/src/main/resources/rawfile/voice/40502.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/406005.mp3 b/entry/src/main/resources/rawfile/voice/406005.mp3 new file mode 100644 index 00000000..891f7480 Binary files /dev/null and b/entry/src/main/resources/rawfile/voice/406005.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/40607.mp3 b/entry/src/main/resources/rawfile/voice/40607.mp3 index cdb0bb0d..eddb33be 100644 Binary files a/entry/src/main/resources/rawfile/voice/40607.mp3 and b/entry/src/main/resources/rawfile/voice/40607.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/40701.mp3 b/entry/src/main/resources/rawfile/voice/40701.mp3 index 0f3ef9cf..5484fe89 100644 Binary files a/entry/src/main/resources/rawfile/voice/40701.mp3 and b/entry/src/main/resources/rawfile/voice/40701.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/41001.mp3 b/entry/src/main/resources/rawfile/voice/41001.mp3 index 0c6c44ec..3a9a9512 100644 Binary files a/entry/src/main/resources/rawfile/voice/41001.mp3 and b/entry/src/main/resources/rawfile/voice/41001.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/41201.mp3 b/entry/src/main/resources/rawfile/voice/41201.mp3 index d96d9f39..3a9a9512 100644 Binary files a/entry/src/main/resources/rawfile/voice/41201.mp3 and b/entry/src/main/resources/rawfile/voice/41201.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/414004.mp3 b/entry/src/main/resources/rawfile/voice/414004.mp3 new file mode 100644 index 00000000..525e51ea Binary files /dev/null and b/entry/src/main/resources/rawfile/voice/414004.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/4170012.mp3 b/entry/src/main/resources/rawfile/voice/4170012.mp3 index adc1a4f8..57003c1f 100644 Binary files a/entry/src/main/resources/rawfile/voice/4170012.mp3 and b/entry/src/main/resources/rawfile/voice/4170012.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/4170013.mp3 b/entry/src/main/resources/rawfile/voice/4170013.mp3 index 4022dd07..79ddde11 100644 Binary files a/entry/src/main/resources/rawfile/voice/4170013.mp3 and b/entry/src/main/resources/rawfile/voice/4170013.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/4170019.mp3 b/entry/src/main/resources/rawfile/voice/4170019.mp3 index 25d3c420..a92bae40 100644 Binary files a/entry/src/main/resources/rawfile/voice/4170019.mp3 and b/entry/src/main/resources/rawfile/voice/4170019.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/41701.mp3 b/entry/src/main/resources/rawfile/voice/41701.mp3 index 1805402d..55d025b0 100644 Binary files a/entry/src/main/resources/rawfile/voice/41701.mp3 and b/entry/src/main/resources/rawfile/voice/41701.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/41703.mp3 b/entry/src/main/resources/rawfile/voice/41703.mp3 index f40842de..7d6d4a63 100644 Binary files a/entry/src/main/resources/rawfile/voice/41703.mp3 and b/entry/src/main/resources/rawfile/voice/41703.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/456001.mp3 b/entry/src/main/resources/rawfile/voice/456001.mp3 new file mode 100644 index 00000000..ba983fa3 Binary files /dev/null and b/entry/src/main/resources/rawfile/voice/456001.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/458001.mp3 b/entry/src/main/resources/rawfile/voice/458001.mp3 new file mode 100644 index 00000000..6aef219f Binary files /dev/null and b/entry/src/main/resources/rawfile/voice/458001.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/fscts.mp3 b/entry/src/main/resources/rawfile/voice/fscts.mp3 new file mode 100644 index 00000000..4d239c63 Binary files /dev/null and b/entry/src/main/resources/rawfile/voice/fscts.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/kfdesc.mp3 b/entry/src/main/resources/rawfile/voice/kfdesc.mp3 new file mode 100644 index 00000000..48f674ab Binary files /dev/null and b/entry/src/main/resources/rawfile/voice/kfdesc.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/qkgzhpp.mp3 b/entry/src/main/resources/rawfile/voice/qkgzhpp.mp3 new file mode 100644 index 00000000..5ad418b7 Binary files /dev/null and b/entry/src/main/resources/rawfile/voice/qkgzhpp.mp3 differ diff --git a/entry/src/main/resources/rawfile/voice/ts_gbcm.mp3 b/entry/src/main/resources/rawfile/voice/ts_gbcm.mp3 new file mode 100644 index 00000000..4001ea78 Binary files /dev/null and b/entry/src/main/resources/rawfile/voice/ts_gbcm.mp3 differ