From 0369c2c98f66ed6d3d44a32806625862d3582dc1 Mon Sep 17 00:00:00 2001 From: surenjun Date: Thu, 8 Aug 2024 20:12:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat=EF=BC=9A=E8=AF=84=E5=88=A4=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/cpp/sdk/common/HSystem.h | 35 +- .../cpp/sdk/database/sysparm/SysParmTable.h | 5 + .../cpp/sdk/database/sysset/SysSetTable.h | 2 +- entry/src/main/cpp/sdk/exam/ExamCarSub2.cpp | 5 +- entry/src/main/cpp/sdk/exam/ExamCarSub3.cpp | 328 ++++++++++++++---- entry/src/main/cpp/sdk/exam/ExamCarSub3.h | 12 + entry/src/main/cpp/sdk/exam/ExamSensor.cpp | 16 +- entry/src/main/cpp/sdk/exam/ExamService.cpp | 5 +- entry/src/main/cpp/sdk/exam/IExamCar.cpp | 10 +- entry/src/main/cpp/sdk/exam/IExamCar.h | 4 +- entry/src/main/cpp/sdk/graphic/GraphicImage.h | 2 +- .../cpp/sdk/judge/sub2/Sub2Judge00Dcrk.cpp | 34 ++ .../main/cpp/sdk/judge/sub2/Sub2Judge00Dcrk.h | 2 + .../cpp/sdk/judge/sub3/Sub3Judge01Sczb.cpp | 2 +- .../cpp/sdk/judge/sub3/Sub3Judge02Qbxx.cpp | 2 +- .../cpp/sdk/judge/sub3/Sub3Judge11Kbtc.cpp | 28 +- .../cpp/sdk/judge/sub3/Sub3Judge14Jjdw.cpp | 2 +- .../cpp/sdk/judge/sub3/Sub3Judge20Comm.cpp | 151 ++++---- entry/src/main/cpp/sdk/utility/GpsMath.cpp | 50 ++- entry/src/main/cpp/sdk/utility/GpsMath.h | 3 + entry/src/main/cpp/sdk/utility/HBean.h | 8 + entry/src/main/cpp/sdk/utility/HTypes.h | 9 +- entry/src/main/ets/common/utils/File.ts | 15 +- entry/src/main/ets/common/utils/UdpJudge.ts | 50 +-- entry/src/main/ets/common/utils/tools.ts | 5 + .../src/main/ets/entryability/EntryAbility.ts | 4 +- entry/src/main/ets/pages/Judge.ets | 39 +-- entry/src/main/ets/pages/UserInfo.ets | 67 ++-- .../ets/pages/compontents/SignDisplayCom.ets | 25 +- .../src/main/ets/pages/judgeSDK/api/index.ts | 3 - .../main/ets/pages/judgeSDK/api/judgeSDK.d.ts | 9 +- .../main/ets/pages/judgeSDK/dataTest/index.ts | 34 +- entry/src/main/ets/pages/judgeSDK/judge.ts | 144 ++++---- .../ets/pages/judgeSDK/utils/fileModel.ts | 4 +- .../ets/pages/judgeSDK/utils/filePhoto.ts | 4 +- .../ets/pages/judgeSDK/utils/judgeCommon.ts | 30 +- .../ets/pages/judgeSDK/utils/judgeConfig.ts | 9 +- 37 files changed, 752 insertions(+), 405 deletions(-) diff --git a/entry/src/main/cpp/sdk/common/HSystem.h b/entry/src/main/cpp/sdk/common/HSystem.h index 18a7ef58..c622ff38 100644 --- a/entry/src/main/cpp/sdk/common/HSystem.h +++ b/entry/src/main/cpp/sdk/common/HSystem.h @@ -107,6 +107,7 @@ *** JUDGE_USE_MEMORY //是否启用内存操作检查 *** JUDGE_USE_POOL //是否启用内存池调试信息 *** JUDGE_USE_ASSERT //是否启用断言提示 + *** JUDGE_USE_NICE //是否启用调试测试代码 *** JUDGE_USE_PERF //是否启用CPU性能分析 *** JUDGE_USE_LEAK //是否启用内存泄露检测 *** JUDGE_USE_TCMALLOC //是否启用tcmalloc优化内存使用操作 @@ -119,20 +120,26 @@ #define JUDGE_USE_LOG /* - * 是否启用一些调试用的信息,开发用 + * 是否启用外壳APP侧传入参数严格检查 */ #if defined(JUDGE_OS_OHOS) || defined(JUDGE_OS_ANDROID) || defined(JUDGE_DEBUG__) - - #define JUDGE_USE_STRICT //是否启用外壳APP侧传入参数严格检查 - + #define JUDGE_USE_STRICT #endif -#define JUDGE_USE_CODE //是否启用系统在返回错误码的时候输出日志 +/* + * 是否启用系统在返回错误码的时候输出日志 + */ +#define JUDGE_USE_CODE +/* + * 是否启用函数执行耗时检测 + * 是否启用内存操作检查 + * 是否启用内存池调试信息 + */ #if 0 - #define JUDGE_USE_COST //是否启用函数执行耗时检测 - #define JUDGE_USE_MEMORY //是否启用内存操作检查 - #define JUDGE_USE_POOL //是否启用内存池调试信息 + #define JUDGE_USE_COST + #define JUDGE_USE_MEMORY + #define JUDGE_USE_POOL #endif /* @@ -143,6 +150,11 @@ #define JUDGE_USE_ASSERT //是否启用断言提示 #endif +/* + * 是否启用测试调试代码 + */ +#define JUDGE_USE_NICE + /* * 是否启用CPU性能分析和内存泄露检测 * 注意:目前只在linux系统并且在编译测试工程时前提下条件下才能开启 @@ -159,6 +171,7 @@ //#define JUDGE_USE_TCMALLOC //是否启用tcmalloc优化内存使用操作 #endif + /* * 是否启用无锡科研所送检模式 * 作者: 杨海洋 @@ -189,12 +202,14 @@ * 7.下一次再去无锡所检测,左转弯要用原始的ret2000 * * - * */ -//#define JUDGE_USE_INSPECT +//#define JUDGE_USE_INSPECT +//********************************以上是预编译定义*************************************** + + /* * 基础整数类型定义 * diff --git a/entry/src/main/cpp/sdk/database/sysparm/SysParmTable.h b/entry/src/main/cpp/sdk/database/sysparm/SysParmTable.h index 4a9438c4..67b0414b 100644 --- a/entry/src/main/cpp/sdk/database/sysparm/SysParmTable.h +++ b/entry/src/main/cpp/sdk/database/sysparm/SysParmTable.h @@ -3,6 +3,11 @@ * * 作者: 杨海洋 * 日期: 2024-01-03 + * + ****************************************************************************** + * 1、免考项目参数设置:systemparm表: NO1=1并且TXT3=1的是免考的,NO2是项目代码 + * + * */ #ifndef SYSPARMTABLE_H diff --git a/entry/src/main/cpp/sdk/database/sysset/SysSetTable.h b/entry/src/main/cpp/sdk/database/sysset/SysSetTable.h index 5a623ec9..500b7e03 100644 --- a/entry/src/main/cpp/sdk/database/sysset/SysSetTable.h +++ b/entry/src/main/cpp/sdk/database/sysset/SysSetTable.h @@ -147,7 +147,7 @@ class JUDGE_API SysSetTable : public IDBTable SYSSET_DECLARE(19, type_array, ":"); //夜间考试考试时间 SYSSET_DECLARE(211); //考试地点参数 - SYSSET_DECLARE(301, type_array2, "^", ","); //条件1:档位,车速,持续时间,结束标志(0-不结束,1红闪,2黑闪),距离,^条件2:档位,车速,持续时间,0,距离,^评判时间(0-最后评判,1-里程达到就评判)^ //示例:4,35,3,0,1,^5,50,3,0,1,^ + SYSSET_DECLARE(301, type_array, "^"); //条件1:档位,车速,持续时间,结束标志(0-不结束,1红闪,2黑闪),距离,^条件2:档位,车速,持续时间,0,距离,^评判时间(0-最后评判,1-里程达到就评判)^ //示例:4,35,3,0,1,^5,50,3,0,1,^ SYSSET_DECLARE(303); //行驶距离限制(米) //3000 SYSSET_DECLARE(306); //直行键(0-直行,1-加速行驶) //1 SYSSET_DECLARE(307); //只考一次的项目 //5,15,16 diff --git a/entry/src/main/cpp/sdk/exam/ExamCarSub2.cpp b/entry/src/main/cpp/sdk/exam/ExamCarSub2.cpp index 7edc1b28..1b15c653 100644 --- a/entry/src/main/cpp/sdk/exam/ExamCarSub2.cpp +++ b/entry/src/main/cpp/sdk/exam/ExamCarSub2.cpp @@ -59,6 +59,7 @@ ErrorCode ExamCarSub2::examGoonExam() { if(m_stuInfo.ddxk) { + m_disForward = m_stuInfo.yklc; for(size_t i = 0; i < m_stuInfo.ykxm.size(); i++) { int itemNo = m_stuInfo.ykxm[i]; @@ -365,7 +366,7 @@ ISub2JudgeItem* ExamCarSub2::readEnterItem() //必须是前进状态进项目 if(historyMoveState() != moveForward) { - logdebug("not moveForward move=%d", m_cg->move); + //logdebug("not moveForward move=%d", m_cg->move); return nullptr; } for(auto k = m_itemsAll.begin(); k != m_itemsAll.end(); k++) @@ -389,7 +390,7 @@ ISub2JudgeItem* ExamCarSub2::readEnterItem() if(examItem->isFlagEnd()) { //已经考过,略过 - logdebug("exam already itemNo=%d.", itemEnter->itemNo()); + //logdebug("exam already itemNo=%d.", itemEnter->itemNo()); continue; } #endif diff --git a/entry/src/main/cpp/sdk/exam/ExamCarSub3.cpp b/entry/src/main/cpp/sdk/exam/ExamCarSub3.cpp index 3a959e59..98ce83f5 100644 --- a/entry/src/main/cpp/sdk/exam/ExamCarSub3.cpp +++ b/entry/src/main/cpp/sdk/exam/ExamCarSub3.cpp @@ -38,6 +38,7 @@ ErrorCode ExamCarSub3::examBeginExam() // loginfo("exam-item xmdm=%d", item.xmdm); //} + m_disOffset = false; m_pub = TPubKM3(); std::string sError; if(!Init_KM3_Global(sError)) @@ -73,6 +74,7 @@ ErrorCode ExamCarSub3::examGoonExam() if(m_stuInfo.ddxk) { + m_disForward = m_stuInfo.yklc; //1、项目更改颜色 for(size_t i = 0; i < m_stuInfo.ykxm.size(); i++) { @@ -596,9 +598,7 @@ bool ExamCarSub3::Init_KM3_Global(std::string& sError) const TSystemparm* parm6 = TableSysParm->findParm6(itemNo); examItem->Item_Code = (parm6 != nullptr ? parm6->TXT2 : ""); examItem->Item_Color = itemStateWk; - examItem->NoID = (parm1->TXT3 != "" ? true : false); //20180508 免考 - - //logdebug("ItemNo=%d,NoID=%s,TXT3=%s", examItem->ItemNo, examItem->NoID ? "true":"false", parm1->TXT3.c_str()); + examItem->NoID = (parm1->TXT3 == "1" ? true : false); //20180508 免考 //systemparm表: NO1=1并且TXT3=1的是免考的 20240731 //加减挡免考 if(ksdd != siteof::chongqingkm3 && ksdd != siteof::jilinsongyuan && itemNo == Sub3ItemType14Jjdw) @@ -1183,37 +1183,15 @@ void ExamCarSub3::Deal_KM3_Judge() } } - m_pub.m_KsLjLc = m_stuInfo.yklc/100 + m_cg->ai_ljjl; - m_cg->tkCnt = GetCurrentTick2(); - m_cg->RTKKM3.CrossPointNo = lastCrossPtNo(); + dealOffset(); //ToDo1:执行通用评判 m_commItem->dealJudgeItem(); - //(*2024-03-06*) - //ExamItemCode mitemno = m_cg->real.sensor.mitemno; - //if(mitemno != 0) - //{ - // CallRenGongEnterItem(mitemno); - //} - - //240710 - //if(m_cg->real.sensor.rmndg == SYES) - //{ - // TKM3Item* item = findExamItem(Sub3ItemType41Mndg); - // if(item && item->TestPro == ItemProFlagIdle) - // { - // item->Item_Color = itemStateZk; - // item->TestPro = ItemProFlagInit; - // item->FinishFlag = false; - // //item->StartTime = GetCurrentTime2(); - // //item->EndTime = 0; - // //item->MsgData = ""; - // //createEventEnterItem({item->ItemNo, ""}); - // } - //} - m_curItem = nullptr; + + dealItemNoIDEnd14Jjdw(); //必须放这里 + dealItemNoIDEndItem(); //必须放这里 //执行具体的专项评判 std::string msg; for(auto it = m_sub3Items.begin(); it != m_sub3Items.end(); it++) @@ -1336,6 +1314,17 @@ void ExamCarSub3::ClearRecord() RTKKM3.Wheel_RB_ToRightEdge = 0; RTKKM3.CrossLineAttr = TRTKResult::CrossLineAttr0; + + + //20240801 + RTKKM3.TouchLineDirCS = TRTKResult::TouchDir0; + RTKKM3.BackPointLaneNo = 0; + RTKKM3.BackPointLaneCount = 0; + RTKKM3.Body_RF_ToBaseLine = 0; + RTKKM3.Body_RB_ToBaseLine = 0; + + RTKKM3.DirInverse = 0; + RTKKM3.ShapeNoWheel = 0; } void ExamCarSub3::GetMeshIndex() @@ -1508,27 +1497,54 @@ bool ExamCarSub3::RTKLane() if(i > roadSize - 1) break; const TMapRoadRec* road = FactoryRoads->getRoad(i); - const Pointi& pt = m_cg->body.points_b[0]; //CarStatus.Body_24_RealTimePt[0]; + const Pointi& pt = m_cg->body.points_b[II(1)]; //CarStatus.Body_24_RealTimePt[0]; + const Pointi& ptBack = m_cg->body.points_b[II(13)]; for(int j = 0; j < road->LaneCount; j++) { const TModelPolygon& poly = road->Lanes[j]; if(poly.Pts.size() >= 5) { + bool flag = false; if(GpsMath::IsPtInArcLane(pt, poly)) { RTKKM3.FrontPointLaneNo = std::atoi(poly.LaneNo.c_str()); //共有几股车道 RTKKM3.FrontPointLaneCount = road->LaneCount; + flag = true; //break; + } + + if(GpsMath::IsPtInArcLane(ptBack, poly)) //20240801 yhy add + { + RTKKM3.BackPointLaneNo = std::atoi(poly.LaneNo.c_str()); + //共有几股车道 + RTKKM3.BackPointLaneCount = road->LaneCount; + flag = true; //break; + } + if(flag) + { break; } } else { + bool flag = false; if(GpsMath::IsPtInPoly(pt.x, pt.y, poly.Pts)) { RTKKM3.FrontPointLaneNo = std::atoi(poly.LaneNo.c_str()); //共有几股车道 RTKKM3.FrontPointLaneCount = road->LaneCount; + flag = true; //break; + } + + if(GpsMath::IsPtInPoly(ptBack.x, ptBack.y, poly.Pts)) //20240801 yhy add + { + RTKKM3.BackPointLaneNo = std::atoi(poly.LaneNo.c_str()); + //共有几股车道 + RTKKM3.BackPointLaneCount = road->LaneCount; + flag = true; //break; + } + if(flag) + { break; } } @@ -1538,7 +1554,7 @@ bool ExamCarSub3::RTKLane() //判断车轮压线类型 RTKKM3.TouchLineType = LineTag0; //2019-4-22 - RTKKM3.TouchDir = 0; + RTKKM3.TouchDir = TRTKResult::TouchDir0; for(int p = curRoadIndex - 1; p <= curRoadIndex + 1; p++) { if(p < 0 || p > roadSize - 1) continue; @@ -1851,6 +1867,7 @@ void ExamCarSub3::Calc_LaneDistance() const TMeshDefine* curMesh = FactoryMesh->getMesh(m_meshIndex); TASSERT_VOID(curMesh != nullptr, ""); + const TModelLine* laneDriving = nullptr; for(int p = 1; p <= 4; p++) { for(int i = curRoadIndex - 2; i <= curRoadIndex + 2; i++) @@ -1887,6 +1904,7 @@ void ExamCarSub3::Calc_LaneDistance() { if(p == 1) //1、车轮与本车道右侧距离 { + laneDriving = &road->BorderLines[0]; for(int k = 1; k <= 4; k++) { Pointi pt; @@ -1921,7 +1939,7 @@ void ExamCarSub3::Calc_LaneDistance() } else if(p == 2) //2:车轮与最右侧车道右侧距离 { - for(int k = 1; k <= 4; k++) + for(int k = 1; k <= 6; k++) { Pointi pt; switch(k) @@ -1930,6 +1948,8 @@ void ExamCarSub3::Calc_LaneDistance() case 2: pt = body.YQ_W_b; break; //CarStatus.CheLun_Wai_YQ_RealTime; case 3: pt = body.ZH_W_b; break; //CarStatus.CheLun_Wai_ZH_RealTime; case 4: pt = body.YH_W_b; break; //CarStatus.CheLun_Wai_YH_RealTime; + case 5: pt = body.points_b[RightBody1]; break; //20240801 + case 6: pt = body.points_b[RightBody2]; break; //20240801 default: break; } line.PtBegin = body.b1_b; // CarStatus.BasePoint1_RealTime; @@ -1948,6 +1968,8 @@ void ExamCarSub3::Calc_LaneDistance() case 2: RTKKM3.Wheel_RF_ToBaseLine = distance; break; case 3: RTKKM3.Wheel_LB_ToBaseLine = distance; break; case 4: RTKKM3.Wheel_RB_ToBaseLine = distance; break; + case 5: RTKKM3.Body_RF_ToBaseLine = distance; break; //20240801 + case 6: RTKKM3.Body_RB_ToBaseLine = distance; break; //20240801 default: break; } } @@ -2018,6 +2040,7 @@ void ExamCarSub3::Calc_LaneDistance() { if(p == 1) //1、车轮与本车道右侧距离 { + laneDriving = &road->BorderLines[0]; for(int k = 1; k <= 4; k++) { Pointi pt; @@ -2055,7 +2078,7 @@ void ExamCarSub3::Calc_LaneDistance() } else if(p == 2) //2:车轮与最右侧车道右侧距离 { - for(int k = 1; k <= 4; k++) + for(int k = 1; k <= 6; k++) { Pointi pt; switch(k) @@ -2064,6 +2087,8 @@ void ExamCarSub3::Calc_LaneDistance() case 2: pt = body.YQ_W_b; break; //CarStatus.CheLun_Wai_YQ_RealTime; case 3: pt = body.ZH_W_b; break; //CarStatus.CheLun_Wai_ZH_RealTime; case 4: pt = body.YH_W_b; break; //CarStatus.CheLun_Wai_YH_RealTime; + case 5: pt = body.points_b[RightBody1]; break; //20240801 + case 6: pt = body.points_b[RightBody2]; break; //20240801 default: break; } line.PtBegin = body.b1_b; @@ -2085,6 +2110,8 @@ void ExamCarSub3::Calc_LaneDistance() case 2: RTKKM3.Wheel_RF_ToBaseLine = distance; break; case 3: RTKKM3.Wheel_LB_ToBaseLine = distance; break; case 4: RTKKM3.Wheel_RB_ToBaseLine = distance; break; + case 5: RTKKM3.Body_RF_ToBaseLine = distance; break; //20240801 + case 6: RTKKM3.Body_RB_ToBaseLine = distance; break; //20240801 default: break; } } @@ -2155,17 +2182,22 @@ void ExamCarSub3::Calc_LaneDistance() } } } - } ///////////////////////////////////////////////////////////////////////// + } } } } } + + //计算是否逆向行驶1正向行驶 -1逆向行驶 + RTKKM3.DirInverse = driveDirection(laneDriving); + } //计算车身压线 void ExamCarSub3::Calc_CheShenYaXian() { TRTKResult& RTKKM3 = m_cg->RTKKM3; + int curLaneIndex = RTKKM3.LaneIndex; RTKKM3.TouchLineTypeCS = LineTag0; if(RTKKM3.MapRoadIndex == INVALID_INDEX) return; if(RTKKM3.LaneIndex == INVALID_INDEX) return; @@ -2178,7 +2210,7 @@ void ExamCarSub3::Calc_CheShenYaXian() poly.Pts[i] = ps[i]; } const TMapRoadRec* road = FactoryRoads->getRoad(RTKKM3.MapRoadIndex); - for(int i = RTKKM3.LaneIndex; i <= RTKKM3.LaneIndex + 1; i++) + for(int i = curLaneIndex; i <= curLaneIndex + 1; i++) { const TModelLine& line = road->BorderLines[i]; if(line.Radius == 0) @@ -2186,6 +2218,7 @@ void ExamCarSub3::Calc_CheShenYaXian() if(GpsMath::IsLineCrossPoly(line, poly)) { RTKKM3.TouchLineTypeCS = line.tag1; + RTKKM3.TouchLineDirCS = (i == curLaneIndex ? TRTKResult::TouchDir1 : TRTKResult::TouchDir_1); //20240801 yhy add break; } } @@ -2194,6 +2227,7 @@ void ExamCarSub3::Calc_CheShenYaXian() if(GpsMath::IsPolyCrossArc(poly, line)) { RTKKM3.TouchLineTypeCS = line.tag1; + RTKKM3.TouchLineDirCS = (i == curLaneIndex ? TRTKResult::TouchDir1 : TRTKResult::TouchDir_1); //20240801 yhy add break; } } @@ -2255,24 +2289,43 @@ void ExamCarSub3::RTKJudge_SubItem() if(curMesh->MapSubItemKeyLen == 0) return; TChuanGan* his = historyChuanGan(1); - //TASSERT_VOID(his != nullptr, ""); if(his == nullptr) return; - //if(CarStatus.Body_24_RealTimePt_LS[0].X = 0) and (CarStatus.Body_24_RealTimePt_LS[0].Y = 0) then Exit; TModelLine line; - line.PtBegin = m_cg->body.points_b[0]; //CarStatus.Body_24_RealTimePt[0].X; - line.PtEnd = his->body.points_b[0]; //CarStatus.Body_24_RealTimePt_LS[0].X; + line.PtBegin = m_cg->body.points_b[II(1)]; + line.PtEnd = his->body.points_b[II(1)]; + + //20240801 begin + TModelLine lineWF; + lineWF.PtBegin = GpsMath::calcCenterPoint(m_cg->body.ZQ_W_b, m_cg->body.YQ_W_b); + lineWF.PtEnd = GpsMath::calcCenterPoint(his->body.ZQ_W_b, his->body.YQ_W_b); + + //TModelLine lineWB; + //lineWB.PtBegin = GpsMath::calcCenterPoint(m_cg->body.ZH_W_b, m_cg->body.YH_W_b); + //lineWB.PtEnd = GpsMath::calcCenterPoint(his->body.ZH_W_b, his->body.YH_W_b); + + //TModelLine lineWZ; + //lineWZ.PtBegin = GpsMath::calcCenterPoint(m_cg->body.ZQ_W_b, m_cg->body.YQ_W_b); + //lineWZ.PtEnd = GpsMath::calcCenterPoint(m_cg->body.ZH_W_b, m_cg->body.YH_W_b); + + TModelPolygon polyW; + polyW.Pts.resize(4); + polyW.Pts[0] = m_cg->body.ZQ_W_b; + polyW.Pts[1] = m_cg->body.YQ_W_b; + polyW.Pts[2] = m_cg->body.YH_W_b; + polyW.Pts[3] = m_cg->body.ZH_W_b; + //20240801 end //车身24点 TModelPolygon poly1; - poly1.Pts.resize(24); //SetLength(TempPolygon1.Pts, 24); - for(int I = 0; I < 24; I++) + poly1.Pts.resize(24); + for(int i = 0; i < 24; i++) { - poly1.Pts[I] = m_cg->body.points_b[I]; + poly1.Pts[i] = m_cg->body.points_b[i]; } - for(int I = 0; I < curMesh->MapSubItemKeyLen; I++) + for(int i = 0; i < curMesh->MapSubItemKeyLen; i++) { //CrossLineAttr //0-未越线 1-停车线 2-中心点右侧线 3-等待控制线 20150119 - int idx = curMesh->MapSubItem_Keys[I]; + int idx = curMesh->MapSubItem_Keys[i]; const TMapSubItemRec* subItem = FactorySharps->getSharp(idx); SubNameTag subName = (SubNameTag)std::atoi(subItem->SubName.c_str()); int SNO = subItem->SNO; @@ -2283,65 +2336,83 @@ void ExamCarSub3::RTKJudge_SubItem() //如果subName=4 2个点关联的路口环岛线,外面几乎用不到,用于路口项目,不能读到这个路口环岛线,否则压扣分(Mark(5,'5'); if(subName == SubNameTag0) { + bool flag = false; if(GpsMath::IsCross(line, subItem->Line1)) { //0-未越线 1-停车线 2-中心点右侧线 3-等待控制线 20150119 RTKKM3.CrossLineAttr = TRTKResult::CrossLineAttr1; RTKKM3.ShapeNo = SNO; - //RTKKM3.LS_ShapeNo = 0; m_pub.m_SNO = 0; - break; + flag = true; //break; + } + //20240801 + if(GpsMath::IsCross(lineWF, subItem->Line1)) + { + RTKKM3.ShapeNoWheel = SNO; + flag = true; //break; + } + if(flag) + { + break; } } else if(subName == SubNameTag1) //3个点关联 { + bool flag = false; if(GpsMath::IsCross(line, subItem->Line1)) { //0-未越线 1-停车线 2-中心点右侧线 3-等待控制线 20150119 RTKKM3.CrossLineAttr = TRTKResult::CrossLineAttr1; RTKKM3.ShapeNo = SNO; - //RTKKM3.LS_ShapeNo = SNO; m_pub.m_SNO = SNO; RTKKM3.CrossPoint = subItem->Point2; - const Pointi& p1 = subItem->Line3.PtBegin; const Pointi& p2 = subItem->Line3.PtEnd; - // Result := Round(SQRT(SQR(pt2.X - pt1.X) + SQR(pt2.Y - pt1.Y))); int x = p1.x - p2.x; int y = p1.y - p2.y; RTKKM3.CrossShapeLength = std::round(std::sqrt(x*x + y*y)); - break; + flag = true; //break; } + //20240801 + if(GpsMath::IsCross(lineWF, subItem->Line1)) + { + RTKKM3.ShapeNoWheel = SNO; + flag = true; //break; + } + if(m_pub.m_SNO == SNO) //RTKKM3.LS_ShapeNo == SNO { if(GpsMath::IsCross(line, subItem->Line3)) { RTKKM3.CrossLineAttr = TRTKResult::CrossLineAttr2; //中心点右侧 RTKKM3.ShapeNo = SNO; - //RTKKM3.LS_ShapeNo = 0; m_pub.m_SNO = 0; } else if(GpsMath::IsCross(line, subItem->Line2)) { - //RTKKM3.LS_ShapeNo = 0; m_pub.m_SNO = 0; } const Pointi& p1 = RTKKM3.CrossPoint; - const Pointi& p2 = m_cg->body.b1_b; //CarStatus.BasePoint1_RealTime; + const Pointi& p2 = m_cg->body.b1_b; int x = p1.x - p2.x; int y = p1.y - p2.y; - int dis = std::round(std::sqrt(x*x + y*y)); //TempDis = Round(SQRT(SQR(TempPt1.X - TempPt2.X) + SQR(TempPt1.Y - TempPt2.Y))); + int dis = std::round(std::sqrt(x*x + y*y)); if(dis > RTKKM3.CrossShapeLength * 3) //3--6 20170924 { - //RTKKM3.LS_ShapeNo = 0; m_pub.m_SNO = 0; } } + + if(flag) + { + break; + } } else if(subName == SubNameTag2) //4个点关联 { + bool flag = false; //SubName=2,4个点关联的,比如:斑马线、公交站台 //ItemNo:6 斑马线,4个点关联 (需要减速、不能停车、夜考的时候,需要远近光灯交替) //ItemNo:53 黄色网格线(类似公交站台),禁止停车 - const Pointi& p = m_cg->body.b1_b; // CarStatus.BasePoint1_RealTime; + const Pointi& p = m_cg->body.b1_b; const TModelPolygon& poly2 = subItem->Polygon; if(GpsMath::IsIntersect(poly1, poly2) || GpsMath::IsPtInPoly(p.x, p.y, poly2.Pts)) { @@ -2350,32 +2421,55 @@ void ExamCarSub3::RTKJudge_SubItem() { RTKKM3.InShapeAttr = TRTKResult::InShapeAttr1; //0-不在形状里 1-在人行道内 2-在网格线内 RTKKM3.ShapeNo = SNO; - //RTKKM3.LS_ShapeNo = 0; } else if(itemNo == ItemNoTag53) //黄色网格线 { RTKKM3.InShapeAttr = TRTKResult::InShapeAttr2; RTKKM3.ShapeNo = SNO; - //RTKKM3.LS_ShapeNo = 0; } - break; + flag = true; //break; + } + + //20240801 + if(GpsMath::IsIntersect(polyW, poly2) + || GpsMath::IsPtInPoly(polyW.Pts[0], poly2.Pts) + || GpsMath::IsPtInPoly(polyW.Pts[1], poly2.Pts) + || GpsMath::IsPtInPoly(polyW.Pts[2], poly2.Pts) + || GpsMath::IsPtInPoly(polyW.Pts[3], poly2.Pts)) + { + RTKKM3.ShapeNoWheel = SNO; + flag = true; //break; + } + if(flag) + { + break; } } - else if(subName == SubNameTag3) //2个点关联的等待控制线 + else if(subName == SubNameTag3) //2个点关联的等待控制线 (深圳,在这个线上,处理特殊的等待业务) { RTKKM3.CrossLineAttr = TRTKResult::CrossLineAttr3; RTKKM3.ShapeNo = SNO; - //RTKKM3.LS_ShapeNo = 0; + RTKKM3.ShapeNoWheel = SNO; //20240801 break; } else if(subName == SubNameTag4) //2个点关联的路口环岛线,外面几乎用不到,用于路口项目,不能读到这个路口环岛线,否则压扣分(Mark(5,'5'); { + bool flag = false; if(GpsMath::IsLineCrossPoly(subItem->Line1, poly1)) { RTKKM3.CrossLineAttr = TRTKResult::CrossLineAttr4; RTKKM3.ShapeNo = SNO; - //RTKKM3.LS_ShapeNo = 0; - break; + flag = true; //break; + } + //20240801 + if(GpsMath::IsLineCrossPoly(subItem->Line1, polyW)) + { + RTKKM3.ShapeNoWheel = SNO; + flag = true; //break; + } + if(flag) + { + break; } } } @@ -3351,10 +3445,13 @@ void ExamCarSub3::ReadItemByPoint(int crossPointNo) const std::string& s319 = TableSysSet->get319(); //SysSet[319]: 1:必须达到里程,才能进入靠边停车 //SysSet[319]: 2:必须达到里程,并且完成必考项目。才能进入靠边停车 - if(s319 == "1" && m_pub.m_KsLjLc < m_car.XSJL) return; + if(s319 == "1") + { + if(!isMileage()) return; + } if(s319 == "2") { - if(m_pub.m_KsLjLc < m_car.XSJL) return; + if(!isMileage()) return; bool unfinished = false; for(auto it = m_sub3Items.begin(); it != m_sub3Items.end(); it++) { @@ -3377,6 +3474,7 @@ void ExamCarSub3::ReadItemByPoint(int crossPointNo) if(item->Item_Color == itemStateZk) { unfinished = true; + break; } } } @@ -3746,8 +3844,7 @@ bool ExamCarSub3::KM3AllPass() //里程不够 if(isQualified()) //当前是合格的 { - int s336 = TableSysSet->asInt336(); - if(m_pub.m_KsLjLc + s336 < m_car.XSJL) + if(!isMileage()) //里程不够 { return false; } @@ -3767,7 +3864,7 @@ bool ExamCarSub3::KM3AllPass() } //科目三项目结束,免考项目处理 //重要流程 - if(item->NoID == true) + if(item->NoID == true) //20240731 { if(item->FinishFlag == false) { @@ -3980,7 +4077,7 @@ bool ExamCarSub3::examMarkItem(int itemNo, const std::string& serial, bool once, (itemNo == Sub3ItemType04Bgcd && serial == "43") ) { if(m_cg->ai_ljjl < 500) return result; - if(m_pub.m_KsLjLc + TableSysSet->asInt336() >= m_car.XSJL) return result; + if(isMileage()) return result; } } @@ -4496,3 +4593,96 @@ bool ExamCarSub3::itemsSomeExaming2(ExamItemCode itemno) const TKM3Item* item = findExamItem(itemno); return item && (item->TestPro == ItemProFlagInit || item->TestPro == ItemProFlagJudge); } + +bool ExamCarSub3::isMileage() const +{ + return m_pub.m_KsLjLc > m_car.XSJL; +} + +void ExamCarSub3::dealOffset() +{ + m_pub.m_KsLjLc = m_cg->ai_ljjl; + m_cg->tkCnt = GetCurrentTick2(); + m_cg->RTKKM3.CrossPointNo = lastCrossPtNo(); + + int s336 = TableSysSet->asInt336(); + if(m_disOffset == false && s336 > 0 && m_pub.m_KsLjLc + s336 >= m_car.XSJL) + { + m_disOffset = true; + m_disForward += (s336*100); //基础里程设置补偿 + m_cg->ai_ljjl_cm = m_disForward; + m_cg->ai_ljjl = m_disForward/100.0; + m_pub.m_KsLjLc = m_cg->ai_ljjl; + } +} + +void ExamCarSub3::dealItemNoIDEndItem() +{ + if(isMileage()) + { + for(auto it = m_sub3Items.begin(); it != m_sub3Items.end(); it++) + { + TKM3Item* item = it->second->getExamItem(); + if(item->NoID == true && item->ItemNo != Sub3ItemType14Jjdw) //20240731 + { + if(item->FinishFlag == false) + { + KM3EndItem(item->ItemNo); + } + } + } + } +} + +void ExamCarSub3::dealItemNoIDEnd14Jjdw() +{ + TKM3Item* item14 = findExamItem(Sub3ItemType14Jjdw); //20240731 + if(item14 && item14->NoID == true) //免考加减挡的 即:全程加减档 + { + if(item14->Item_Color == itemStateWk) + { + TTestCtl* ctl = getTTestCtl(); + if(ctl->dw_kf_sj == 1) //301 第3个^参数 1:达到行驶里程 非1靠边停车开始前 + { + if(isMileage()) + { + //ToDo1:生成 全程加减挡 进项目事件 + //createEventEnterItem({item14->ItemNo, ""}); + KM3EndItem(item14->ItemNo); + } + } + else + { + TKM3Item* item = findExamItem(Sub3ItemType11Kbtc); + if(item && item->TestPro == ItemProFlagInit) + { + //ToDo1:生成 全程加减挡 进项目事件 + //createEventEnterItem({item14->ItemNo, ""}); + KM3EndItem(item14->ItemNo); + } + } + } + } +} + +DriveDirType ExamCarSub3::driveDirection(const TModelLine* lane) +{ + //ptBegin 车道线起始点 + //ptEnd 车道线起终点点 + //double angle1 = GpsMath::getAngle(lane->PtBegin, lane->PtEnd); + //double angle2 = GpsMath::getAngle(m_cg->body.points_b[II(13)], m_cg->body.points_b[II(1)]); + double a1 = GpsMath::GetAngle_HQ(lane->PtBegin, lane->PtEnd, -1); + double a2 = GpsMath::GetAngle_HQ(m_cg->body.points_b[II(13)], m_cg->body.points_b[II(1)], -1); + + DriveDirType dir = DriveDirX; + int angle = ((int)std::round(a1 - a2) + 360) % 360; + if(angle < 60 || angle > 300) + { + dir = DriveDirY; + } + else if(angle < 240 && angle > 120) + { + dir = DriveDirN; + } + return dir; +} diff --git a/entry/src/main/cpp/sdk/exam/ExamCarSub3.h b/entry/src/main/cpp/sdk/exam/ExamCarSub3.h index b96a6e99..924cc3a3 100644 --- a/entry/src/main/cpp/sdk/exam/ExamCarSub3.h +++ b/entry/src/main/cpp/sdk/exam/ExamCarSub3.h @@ -49,6 +49,9 @@ public: //for IExamCarSub3 override virtual bool isExamAlready(ExamItemCode ItemNo) const override { return m_ctl.PassedItem.find(ItemNo) != m_ctl.PassedItem.end();}; + virtual bool isMileage() const override; + + virtual TCar* getTCar() override { return &m_car; } virtual TTestCtl* getTTestCtl() override { return &m_ctl; } @@ -73,6 +76,14 @@ public: //for IExamCarSub3 override virtual bool getyjdg_road_code_kf() const override { return m_pub.yjdg_road_code_kf; } protected: + void dealOffset(); //行驶距离补偿 + + void dealItemNoIDEndItem(); + void dealItemNoIDEnd14Jjdw(); + + //行驶方向,1正向行驶,-1逆向行驶 + DriveDirType driveDirection(const TModelLine* lane); + bool Init_KM3_Global(std::string& sError); void UpdateCarParmWithSystemParm(); bool Init_KM3_Special(); @@ -160,6 +171,7 @@ private: int E_1Deg2Cm = 0; //经度1度=多少厘米 const int N_1Deg2Cm = 11110792; //北纬1度=X cm + bool m_disOffset = false; //TCarStatus m_carStatus; //int64 m_ContinuedStartTime = 0; //续考的上次开始考试时间 20150205 diff --git a/entry/src/main/cpp/sdk/exam/ExamSensor.cpp b/entry/src/main/cpp/sdk/exam/ExamSensor.cpp index a1f50659..6639c599 100644 --- a/entry/src/main/cpp/sdk/exam/ExamSensor.cpp +++ b/entry/src/main/cpp/sdk/exam/ExamSensor.cpp @@ -175,6 +175,15 @@ bool ExamSensor::convertDatas(TChuanGan* cg) TGpsInfo& gps = cg->real.gps; gps.errorFlag = true; + + //测试是否逆向行驶 + //static int s_count = 0; + //int ny = s_count++ % 10; + //if(ny < 5) + //{ + // gps.hxj += 180.0; + //} + //航向角(默认是按诺瓦泰的数据格式定义的,所以要加上180度) 1:天宝(北云)/C1 2:诺瓦泰 if(gps.bklx == boardTypeTB) { @@ -290,15 +299,16 @@ bool ExamSensor::calcCarBody(TChuanGan* cg) int x = 0, y = 0; GpsMath::calcEastAndNorthDistanceCM(m_basePoint, ps[II(33)], m_basePoint.gc, x, y); - if(cg->real.gps.rtkEnabled) + TGpsInfo& gps = cg->real.gps; + if(gps.rtkEnabled && gps.jd > 1 && gps.wd > 1) { - cg->real.gps.ai_gps = Pointi(x, y); + gps.ai_gps = Pointi(x, y); } else { if(m_car->historyCount() > 0) { - cg->real.gps.ai_gps = m_car->historyAiGps(); //20240702 yhy + gps.ai_gps = m_car->historyAiGps(); //20240702 yhy //return false; //这里不能返回false 第一帧数据就是非差分状态?如果做模拟灯光的时候一直没差分进不了项目了 } } diff --git a/entry/src/main/cpp/sdk/exam/ExamService.cpp b/entry/src/main/cpp/sdk/exam/ExamService.cpp index 4e58164b..3b17cfd1 100644 --- a/entry/src/main/cpp/sdk/exam/ExamService.cpp +++ b/entry/src/main/cpp/sdk/exam/ExamService.cpp @@ -45,7 +45,8 @@ int ExamService::examJudgeInit(const char* data, int len) //logdebug("MemorySpace [spaceTotal=%lld MB] [spaceFree=%lld MB], [spaceAvailable=%lld MB], [spaceSelf=%lld MB]", // space.spaceTotal, space.spaceFree, space.spaceAvailable, space.spaceSelf); - logdebug("call examJudgeInit."); + //logdebug("call examJudgeInit."); + logtrace("exam-init version=%s.", JUDGE_VERSION_INFO); if(m_init) { //已经初始化过了,不能重复初始化 @@ -105,7 +106,7 @@ int ExamService::examJudgeInit(const char* data, int len) return QE(code); } m_init = true; - loginfo("exam-init success version=%s.", JUDGE_VERSION_INFO); + logtrace("exam-init success kchp=%s,kchm=%d,kscx=%s.", m_initInfo->kchp.c_str(), m_initInfo->kchm, m_initInfo->kscx.c_str()); return QE(codeSuccess); } diff --git a/entry/src/main/cpp/sdk/exam/IExamCar.cpp b/entry/src/main/cpp/sdk/exam/IExamCar.cpp index 99718481..9176dc27 100644 --- a/entry/src/main/cpp/sdk/exam/IExamCar.cpp +++ b/entry/src/main/cpp/sdk/exam/IExamCar.cpp @@ -43,6 +43,7 @@ int IExamCar::examJudgeBeginExam(const char* data, int len) { HELP_COST_TIME(""); IAutoLock(m_mtx); + logtrace("begin-exam version=%s", JUDGE_VERSION_INFO); if(m_examState != examStateEnd) { logerror("error begin exam not end."); @@ -489,17 +490,17 @@ void IExamCar::doExamDatagram(Package* pkg) } -void IExamCar::calcDistance() +int IExamCar::calcDistance() { if(m_history->size() <= 1) { - return; + return 0; } const Pointi& h = historyAiGps(1); const Pointi& c = historyAiGps(); if( (c.x == 0 && c.y == 0) || (h.x == 0 && h.y == 0) ) { - return; + return 0; } double x = h.x - c.x; double y = h.y - c.y; @@ -517,11 +518,12 @@ void IExamCar::calcDistance() if(m_cg->move == moveForward) { - int gear = m_cg->real.sensor.dw; + int gear = m_cg->real.sensor.dw; //只有科三用到 m_disGears[gear] += a; } //logdebug("move=%d,dis=%dCM", state, a); + return 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 5cf63449..6b24df0f 100644 --- a/entry/src/main/cpp/sdk/exam/IExamCar.h +++ b/entry/src/main/cpp/sdk/exam/IExamCar.h @@ -127,7 +127,7 @@ public: //执行处理每一帧的GPS传感数据 virtual void doExamDatagram(Package* pkg); //前进 后退 距离计算 - virtual void calcDistance(); + virtual int calcDistance(); //当前系统时间(回放取的事GPS时间) virtual int64 GetCurrentTime2() const; @@ -219,6 +219,8 @@ public: virtual bool itemsSomeExaming2(ExamItemCode itemno) const = 0; //是否已考 virtual bool isExamAlready(ExamItemCode ItemNo) const = 0; + //里程是否满足 + virtual bool isMileage() const = 0; //获取TCar diff --git a/entry/src/main/cpp/sdk/graphic/GraphicImage.h b/entry/src/main/cpp/sdk/graphic/GraphicImage.h index ebb1ae16..33a579c2 100644 --- a/entry/src/main/cpp/sdk/graphic/GraphicImage.h +++ b/entry/src/main/cpp/sdk/graphic/GraphicImage.h @@ -70,7 +70,7 @@ private: const int m_channel = 4; const unsigned char m_default = 255; //默认底色 白色 bool m_showVersion = true; - bool m_showTime = false; + bool m_showTime = true; }; diff --git a/entry/src/main/cpp/sdk/judge/sub2/Sub2Judge00Dcrk.cpp b/entry/src/main/cpp/sdk/judge/sub2/Sub2Judge00Dcrk.cpp index c967a8b9..6799163b 100644 --- a/entry/src/main/cpp/sdk/judge/sub2/Sub2Judge00Dcrk.cpp +++ b/entry/src/main/cpp/sdk/judge/sub2/Sub2Judge00Dcrk.cpp @@ -33,6 +33,40 @@ void Sub2Judge00Dcrk::dealDrawItem() drawGpsSign(m_model->F8(), "F8", false); drawGpsSign(m_model->F9(), "F9", false); +#ifdef JUDGE_USE_NICE + + if(pureCarPointInItemArea(II(33))) + { + TChuanGan* cg = m_car->historyChuanGan(); + nice(cg->body.b1_a, cg->body.b2_a, RGB_RED); + nice(cg->body.points_a[II(8)], cg->body.points_a[II(18)], RGB_RED); + + TGPSPoint z1 = GpsMath::GetChuiZhu(cg->body.b1_a, cg->body.points_a[II(6)], cg->body.points_a[II(8)]); + nice(cg->body.b1_a, z1, RGB_PURPLE); + + TGPSPoint z2 = GpsMath::GetChuiZhu(cg->body.points_a[II(25)], m_model->P3(),m_model->P4()); + nice(cg->body.points_a[II(25)], z2, RGB_RED); + + TGPSPoint z3 = GpsMath::GetChuiZhu(cg->body.points_a[II(27)], m_model->P3(),m_model->P4()); + nice(cg->body.points_a[II(27)], z3, RGB_RED); + + nice(cg->body.points_a[II(1)], cg->body.points_a[II(13)], RGB_GREEN); + TGPSPoint z4 = GpsMath::GetChuiZhu(cg->body.points_a[II(13)], m_model->P4(), m_model->P5()); + nice(cg->body.points_a[II(13)], z4, RGB_RED); + } + +#endif + +} + +void Sub2Judge00Dcrk::nice(const TGPSPoint& p1, const TGPSPoint& p2, const RgbColor& color) +{ + int cm = GpsMath::calcGpsDistanceCM(p1,p2); + TGPSPoint c = GpsMath::calcCenterPoint(p1,p2); + char buf[32] = {0}; + SafeSprintf(buf, sizeof(buf), "%dcm", cm); + drawGpsLine(p1, p2, false, color, 16); + drawGpsText(c, buf, color, 16); } void Sub2Judge00Dcrk::dealJudgeItem() diff --git a/entry/src/main/cpp/sdk/judge/sub2/Sub2Judge00Dcrk.h b/entry/src/main/cpp/sdk/judge/sub2/Sub2Judge00Dcrk.h index d3cc4d5a..8fa604ae 100644 --- a/entry/src/main/cpp/sdk/judge/sub2/Sub2Judge00Dcrk.h +++ b/entry/src/main/cpp/sdk/judge/sub2/Sub2Judge00Dcrk.h @@ -38,6 +38,8 @@ private: //判断考试用时是否超时 bool examTimeout(); + void nice(const TGPSPoint& p1, const TGPSPoint& p2, const RgbColor& color); + private: enum{L1=1, L2, L3, L4, L5, L6, L7, L8, L9, L10, L11}; int64 m_dcrkTime = 0; //开始时间(从倒库开始计时) diff --git a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge01Sczb.cpp b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge01Sczb.cpp index 9bcda5fe..1c0e79e4 100644 --- a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge01Sczb.cpp +++ b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge01Sczb.cpp @@ -38,7 +38,7 @@ bool Sub3Judge01Sczb::dealJudgeEnter() const std::vector& s512 = TableSysSet->asArray512(); std::string Temp512_9 = s512.size() > 8 && s512[8] != "" ? s512[8].c_str() : ""; - const std::vector& s512_9 = Tools::split(Temp512_9, "^"); + const std::vector s512_9 = Tools::split(Temp512_9, "^"); m_itemv.newtype = s512_9.size() > 0 && s512_9[0] != "" ? std::atoi(s512_9[0].c_str()) : 0; m_itemv.time_tishi = s512_9.size() > 1 && s512_9[1] != "" ? std::atoi(s512_9[1].c_str()) : 0; m_itemv.time_raoche = s512_9.size() > 2 && s512_9[2] != "" ? std::atoi(s512_9[2].c_str()) : 0; diff --git a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge02Qbxx.cpp b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge02Qbxx.cpp index 470556b6..e611a271 100644 --- a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge02Qbxx.cpp +++ b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge02Qbxx.cpp @@ -20,7 +20,7 @@ bool Sub3Judge02Qbxx::dealJudgeEnter() //10s内未起步只评判第一次^第一次起步以打左方向灯开始计时^ const std::vector& s502 = TableSysSet->asArray502(); std::string str = s502.size() > 7 ? s502[7] : ""; - const std::vector& ss = Tools::split(str, "^"); + const std::vector ss = Tools::split(str, "^"); m_itemv.sys502_8_1 = ss.size() > 0 && ss[0] != "" ? std::atoi(ss[0].c_str()) : 0; m_itemv.sys502_8_2 = ss.size() > 1 && ss[1] != "" ? std::atoi(ss[1].c_str()) : 0; //StrToIntDef(GetDotStr(2, tempstr + '^', '^'), 0); diff --git a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge11Kbtc.cpp b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge11Kbtc.cpp index e829813f..f04e4427 100644 --- a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge11Kbtc.cpp +++ b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge11Kbtc.cpp @@ -712,8 +712,8 @@ void Sub3Judge11Kbtc::DoStatus_3() //特殊地点业务翻译 TTestCtl* ctl = m_car->getTTestCtl(); - const std::vector>& s301 = TableSysSet->asArray2_301(); - const std::vector& s301_1 = s301.size() > 0 ? s301[0] : std::vector(); + const std::vector& s301 = TableSysSet->asArray301(); + const std::vector s301_1 = s301.size() > 0 ? Tools::split(s301[0], ",") : std::vector(); const std::string s301_1_3 = s301_1.size() > 3 && s301_1[3] != "" ? s301_1[3] : ""; if(!ctl->Dw_Cs_Ok1 && s301_1_3 != "0" && ctl->dw_kf_sj == 0 && ksdd == siteof::zjwz) { @@ -1295,24 +1295,24 @@ void Sub3Judge11Kbtc::Judge_KBTC_YaXian() const std::string& s411 = TableSysSet->get411(); if(s411 != "1") { - RightJL0_RF = RTKKM3_0.Body_RF_ToRightEdge; - RightJL1_RF = RTKKM3_1.Body_RF_ToRightEdge; - RightJL2_RF = RTKKM3_2.Body_RF_ToRightEdge; + RightJL0_RF = RTKKM3_0.Body_RF_ToBaseLine; + RightJL1_RF = RTKKM3_1.Body_RF_ToBaseLine; + RightJL2_RF = RTKKM3_2.Body_RF_ToBaseLine; - RightJL0_RB = RTKKM3_0.Body_RB_ToRightEdge; - RightJL1_RB = RTKKM3_1.Body_RB_ToRightEdge; - RightJL2_RB = RTKKM3_2.Body_RB_ToRightEdge; + RightJL0_RB = RTKKM3_0.Body_RB_ToBaseLine; + RightJL1_RB = RTKKM3_1.Body_RB_ToBaseLine; + RightJL2_RB = RTKKM3_2.Body_RB_ToBaseLine; } else { - RightJL0_RF = RTKKM3_0.Wheel_RF_ToRightEdge; - RightJL1_RF = RTKKM3_1.Wheel_RF_ToRightEdge; - RightJL2_RF = RTKKM3_2.Wheel_RF_ToRightEdge; + RightJL0_RF = RTKKM3_0.Wheel_RF_ToBaseLine; + RightJL1_RF = RTKKM3_1.Wheel_RF_ToBaseLine; + RightJL2_RF = RTKKM3_2.Wheel_RF_ToBaseLine; - RightJL0_RB = RTKKM3_0.Wheel_RB_ToRightEdge; - RightJL1_RB = RTKKM3_1.Wheel_RB_ToRightEdge; - RightJL2_RB = RTKKM3_2.Wheel_RB_ToRightEdge; + RightJL0_RB = RTKKM3_0.Wheel_RB_ToBaseLine; + RightJL1_RB = RTKKM3_1.Wheel_RB_ToBaseLine; + RightJL2_RB = RTKKM3_2.Wheel_RB_ToBaseLine; } //ZXD_JL0 := (RightJL0_RF + RightJL0_RB) div 2; diff --git a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge14Jjdw.cpp b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge14Jjdw.cpp index 36b83a91..3c0de3d7 100644 --- a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge14Jjdw.cpp +++ b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge14Jjdw.cpp @@ -256,7 +256,7 @@ void Sub3Judge14Jjdw::CSH_Itmv14() std::string str2 = Str.size() > 1 ? Str[1] : ""; //GetDotStr(2, Str + ':', ':'); int dw = std::atoi(str1.c_str()); - const std::vector& stmp = Tools::split(str2, "-"); + const std::vector stmp = Tools::split(str2, "-"); m_itemv.DwCs_Range[dw].Low_Cs = stmp.size() > 0 ? std::atoi(stmp[0].c_str()) : 0; m_itemv.DwCs_Range[dw].High_Cs = stmp.size() > 1 ? std::atoi(stmp[1].c_str()) : 0; } diff --git a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge20Comm.cpp b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge20Comm.cpp index b4de8cc7..ab1531ba 100644 --- a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge20Comm.cpp +++ b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge20Comm.cpp @@ -159,22 +159,21 @@ void Sub3Judge20Comm::Init_ZongHe() //自动靠边停车参数 //SysSet[319]:里程不够不报靠边停车(0-否 1-是 2-必考项目完成,并且里程满足要求) //SysSet[415]:自动报靠边停车(启用标记^全部结束n米报^)启用标记:0-否 1-是 319参数为2有效 - const std::string& s319 = TableSysSet->get319(); if(s319 == "2") { const std::vector& s415 = TableSysSet->asArray415(); m_itemvCJH.bZdKbTc = s415.size() > 0 && s415[0] == "1"; //getdotstr(1, sysset[415] + '^', '^') = '1'); - m_itemvCJH.ZdKbTcJl = s415.size() > 1 && s415[1] != "" ? std::atoi(s415[1].c_str()) : 1; //strtointdef(getdotstr(2, sysset[415] + '^', '^'), 1); + m_itemvCJH.ZdKbTcJl = s415.size() > 1 && s415[1] != "" ? std::atoi(s415[1].c_str()) : 1; //strtointdef(getdotstr(2, sysset[415] + '^', '^'), 1); m_itemvCJH.KbTcJl = -1; } else { m_itemvCJH.bZdKbTc = false; m_itemvCJH.ZdKbTcJl = 1; + m_itemvCJH.KbTcJl = -1; } //溜车变量初始化 - //SysSet[529]:模拟灯光是否需要人脸验证 //说明:这个参数目前我没有实际的用到 m_sfyz_state = 0; @@ -213,7 +212,7 @@ void Sub3Judge20Comm::Init_ZongHe() if(str2 == "") continue; int dw = std::atoi(str1.c_str()); - const std::vector& stmp = Tools::split(str2, "-"); + const std::vector stmp = Tools::split(str2, "-"); itemv14->DwCs_Range[dw].Low_Cs = stmp.size() > 0 ? std::atoi(stmp[0].c_str()) : 0; itemv14->DwCs_Range[dw].High_Cs = stmp.size() > 1 ? std::atoi(stmp[1].c_str()) : 100; } @@ -243,7 +242,7 @@ void Sub3Judge20Comm::Init_ZongHe() //评判半联动用的,比如:前进状态下,离合器连续30秒 const std::vector& s500 = TableSysSet->asArray500(); std::string s500_1 = s500.size() > 0 ? s500[0] : ""; - const std::vector& ss500_1 = Tools::split(s500_1, "^"); + const std::vector ss500_1 = Tools::split(s500_1, "^"); m_itemvCJH.lhqxs = ss500_1.size() > 0 && ss500_1[0] != "" ? std::atoi(ss500_1[0].c_str()) : 30; //离合器距离 @@ -260,14 +259,14 @@ void Sub3Judge20Comm::Init_ZongHe() m_itemvCJH.DWKF_SJ = (s500.size() > 3 && s500[3] != "" ? std::atoi(s500[3].c_str()) : 20) * SECOND; //加速发动机转速阀值^加速发动机变化倍数^ std::string Str = s500.size() > 4 && s500[4] != "" ? s500[4] : ""; - const std::vector& s500_4 = Tools::split(Str, "^"); + const std::vector s500_4 = Tools::split(Str, "^"); m_itemvCJH.KongYouMen_FDJ_YZ = s500_4.size() > 0 && s500_4[0] != "" ? std::atoi(s500_4[0].c_str()) : 3000; //变化倍数 m_itemvCJH.KonbYouMen_FDJ_BS = s500_4.size() > 1 && s500_4[1] != "" ? std::atoi(s500_4[1].c_str()) : 3; //转向灯不关闭距离^项目结束后不关闭时间 Str = s500.size() > 5 && s500[5] != "" ? s500[5] : ""; - const std::vector& s500_5 = Tools::split(Str, "^"); + const std::vector s500_5 = Tools::split(Str, "^"); m_itemvCJH.ZXD_BGB_JL = s500_5.size() > 0 && s500_5[0] != "" ? std::atoi(s500_5[0].c_str()) : 3000; m_itemvCJH.ZXD_BGB_SJ = s500_5.size() > 1 && s500_5[1] != "" ? std::atoi(s500_5[1].c_str()) : 0; @@ -341,8 +340,8 @@ void Sub3Judge20Comm::Init_ZongHe() //条件1:档位,车速,持续时间,结束标志(0-不结束,1红闪,2黑闪),距离,^ //条件2:档位,车速,持续时间,0,距离,^评判时间(0-最后评判,1-里程达到就评判)^ - const std::vector>& s301 = TableSysSet->asArray2_301(); - const std::vector& s301_1 = s301.size() > 0 ? s301[0] : std::vector(); + const std::vector& s301 = TableSysSet->asArray301(); + const std::vector s301_1 = s301.size() > 0 ? Tools::split(s301[0], ",") : std::vector(); if(!s301_1.empty()) { m_itemvCJH.dw_cs_dw1 = s301_1.size() > 0 && s301_1[0] != "" ? std::atoi(s301_1[0].c_str()) : 1; @@ -358,7 +357,7 @@ void Sub3Judge20Comm::Init_ZongHe() m_itemvCJH.dw_cs_sl1 = 0; } - const std::vector& s301_2 = s301.size() > 1 ? s301[1] : std::vector(); + const std::vector& s301_2 = s301.size() > 1 ? Tools::split(s301[1], ",") : std::vector(); if(!s301_2.empty()) { m_itemvCJH.dw_cs_dw2 = s301_2.size() > 0 && s301_2[0] != "" ? std::atoi(s301_2[0].c_str()) : 1; @@ -375,9 +374,9 @@ void Sub3Judge20Comm::Init_ZongHe() m_itemvCJH.dw_cs_sl2 = 0; } - std::vector s301_3 = s301.size() > 2 ? s301[2] : std::vector(); + std::string s301_3 = s301.size() > 2 ? s301[2] : ""; //301评判时间,0-结束考试时评判,1-里程达标就评判 100-表示已评判过 20140630 //yhyflag - ctl->dw_kf_sj = s301_3.size() > 0 && s301_3[0] != "" ? std::atoi(s301_3[0].c_str()) : 1; // StrToIntdef(GetDotStr(3, Sysset[301] + '^', '^'), 1); + ctl->dw_kf_sj = s301_3 != "" ? std::atoi(s301_3.c_str()) : 0; // StrToIntdef(GetDotStr(3, Sysset[301] + '^', '^'), 1); //SysSet[530]:环境感知相关参数(原封不动翻译即可,前期用不到,赞不考虑) const std::vector& s530 = TableSysSet->asArray530(); @@ -385,7 +384,7 @@ void Sub3Judge20Comm::Init_ZongHe() m_itemvCJH.sslkfxp_sj = s530.size() > 0 && s530[0] != "" ? std::atoi(s530[0].c_str()) : 15; //StrToIntdef(GetDotStr(1, Sysset[530] + '^', '^'), 15); //单手离开方向盘时间秒,右边距离偏差cm const std::string& ss530 = s530.size() > 1 && s530[1] != "" ? s530[1] : ""; - const std::vector& s530_2 = Tools::split(ss530, ","); + const std::vector s530_2 = Tools::split(ss530, ","); m_itemvCJH.dslkfxp_sj = s530_2.size() > 0 && s530_2[0] != "" ? std::atoi(s530_2[0].c_str()) : 60; m_itemvCJH.dslkfxp_jlpc = s530_2.size() > 1 && s530_2[1] != "" ? std::atoi(s530_2[1].c_str()) : 30; @@ -567,7 +566,7 @@ void Sub3Judge20Comm::Init_ZongHe() std::string str2 = s394i.size() > 1 ? s394i[1] : ""; //GetDotStr(2, Str + ':', ':'); int dw = std::atoi(str1.c_str()); - const std::vector& stmp = Tools::split(str2, "-"); + const std::vector stmp = Tools::split(str2, "-"); m_itemvCJH.DwCs_Range[dw].Low_Cs = stmp.size() > 0 ? std::atoi(stmp[0].c_str()) : 0; m_itemvCJH.DwCs_Range[dw].High_Cs = stmp.size() > 1 ? std::atoi(stmp[1].c_str()) : 0; } @@ -2464,7 +2463,7 @@ void Sub3Judge20Comm::Judge_LianXuBianDao() //获取连续变道超车参数 std::string Temp = s512.size() > 1 && s512[1] != "" ? s512[1] : ""; - const std::vector& ss = Tools::split(Temp, "^"); + const std::vector ss = Tools::split(Temp, "^"); //0:abc 1:aba和abc都判 ctl->LianXuBianDaoKind = ss.size() > 0 && ss[0] != "" ? std::atoi(ss[0].c_str()) : 0; @@ -4602,8 +4601,11 @@ void Sub3Judge20Comm::Judge_DangWei_CS_ZS() const TChuanGan* his6 = m_car->historyChuanGan(6); //旧规则评判 int TempCS = std::round(gps.sd); + + const std::vector& s507 = TableSysSet->asArray507(); + std::string lhq = s507.size() > 9 ? s507[9] : ""; //507第10个参数 设置为1不管踩没踩离合器都判,否则踩离合器不判 /////////////////////////////////////////////////////////////////////////// - if(sor.lhq == SYES || Tools::less(std::round(gps.sd), 5) || + if((lhq != "1" && sor.lhq == SYES) || Tools::less(std::round(gps.sd), 5) || (ksdd != siteof::nj && (cg->move != moveForward || his1->move != moveForward || his2->move != moveForward || his3->move != moveForward || his4->move != moveForward || his5->move != moveForward || his6->move != moveForward))) @@ -4799,7 +4801,27 @@ void Sub3Judge20Comm::Judge_DangWei_CS_ZS() //24、全程次高挡评判 void Sub3Judge20Comm::Judge_CiGaoDang() { - if(m_car->allItemFinish() && m_car->isQualified()) //全程次高挡评判 KM3AllPass() + //按照军华说的 在行驶距离达到的实际判断全程次高档 20240731 + //301 第3个^参数 1:达到行驶里程 非1靠边停车开始前 20240805 + bool timing = false; //次高档时机 + TTestCtl* ctl = m_car->getTTestCtl(); + if(ctl->dw_kf_sj == 1) //301 第3个^参数 1:达到行驶里程 非1靠边停车开始前 + { + if(m_car->isMileage()) + { + timing = true; + } + } + else + { + TKM3Item* item = m_car->findExamItem(Sub3ItemType11Kbtc); + if(item && item->TestPro == ItemProFlagInit) + { + timing = true; + } + } + + if(timing) { if(m_itemvXLG.CGD_Nums == 0) { @@ -4815,79 +4837,43 @@ void Sub3Judge20Comm::Judge_CiGaoDang() //25、自动靠边停车(重点) void Sub3Judge20Comm::Call_Auto_KBTC() { + //SysSet[319]:里程不够不报靠边停车(0-否 1-是 2-必考项目完成,并且里程满足要求) + //SysSet[415]:自动报靠边停车(启用标记^全部结束n米报^)启用标记:0-否 1-是 319参数为2有效 const std::string& s319 = TableSysSet->get319(); - TCar* tcar = m_car->getTCar(); - const std::map& all = m_car->allExamItem(); //自动靠边停车 - if(s319 == "1" && m_car->getKsLjLc() < tcar->XSJL) + if(s319 == "1") { - return; + if(!m_car->isMileage()) return; } if(s319 == "2") { - if(m_car->getKsLjLc() < tcar->XSJL) return; - bool ErrorFlag = false; - for(auto it = all.begin(); it != all.end(); it++) + if(!m_car->isMileage()) return; + + //自动靠边停车计算 + //自动靠边停车 + if(m_itemvCJH.bZdKbTc) { - TKM3Item* item = it->second->getExamItem(); - if(item->NoID == true) + const std::map& all = m_car->allExamItem(); + //必考项目未完成 + for(auto it = all.begin(); it != all.end(); it++) { - if(item->FinishFlag == false) + TKM3Item* item = it->second->getExamItem(); + if(item->ItemNo == Sub3ItemType11Kbtc) { - m_car->KM3EndItem(item->ItemNo); - ErrorFlag = true; + if(item->Item_Color != itemStateWk) + { + return; + } + } + else + { + if(item->NoID == false && (item->Item_Color == itemStateWk || item->Item_Color == itemStateZk)) + { + return; + } } } - } - - if(ErrorFlag == true) - { - return; - } - - for(auto it = all.begin(); it != all.end(); it++) - { - TKM3Item* item = it->second->getExamItem(); - if(item->ItemNo == Sub3ItemType11Kbtc) continue; - if(item->FinishFlag == false) - { - return; - } - } - - } - //自动靠边停车计算 - //自动靠边停车 - if(m_itemvCJH.bZdKbTc) - { - //必考项目未完成 - for(auto it = all.begin(); it != all.end(); it++) - { - TKM3Item* item = it->second->getExamItem(); - if(item->ItemNo == Sub3ItemType11Kbtc) - { - if(item->Item_Color != itemStateWk) - { - return; - } - } - else - { - if(item->NoID == false && (item->Item_Color == itemStateWk || item->Item_Color == itemStateZk)) - { - return; - } - } - } - - //SysSet[319]:里程不够不报靠边停车(0-否 1-是 2-必考项目完成,并且里程满足要求) - //SysSet[415]:自动报靠边停车(启用标记^全部结束n米报^)启用标记:0-否 1-是 319参数为2有效 - const std::string& s319 = TableSysSet->get319(); - const std::string& ksdd = TableSysSet->get211(); - if(s319 == "2") - { const TChuanGan* cg = m_car->historyChuanGan(); - if(m_itemvCJH.KbTcJl == -1) { m_itemvCJH.KbTcJl = cg->ai_ljjl; @@ -4895,6 +4881,7 @@ void Sub3Judge20Comm::Call_Auto_KBTC() if(cg->ai_ljjl - m_itemvCJH.KbTcJl >= m_itemvCJH.ZdKbTcJl) { //20171008 + const std::string& ksdd = TableSysSet->get211(); if(ksdd == siteof::changzhoukm3) { if(cg->RTKKM3.BaseLaneCount > 0) @@ -4952,6 +4939,7 @@ void Sub3Judge20Comm::Judge_Extra() //m_car->createEventEnterItem({item13->ItemNo, ""}); } + /* //自动触发加减挡位 bool FindSCZB = false; bool FindMNDG = false; @@ -4990,21 +4978,18 @@ void Sub3Judge20Comm::Judge_Extra() if((SCZBFinishFlag == true || FindSCZB == false) && (MNDGFinishFlag == true || FindMNDG == false)) { - TKM3Item* item14 = m_car->findExamItem(Sub3ItemType14Jjdw); + TKM3Item* item14 = m_car->findExamItem(Sub3ItemType14Jjdw); //20240731 if(item14 && item14->NoID == true) //免考加减挡的 { if(item14->Item_Color == itemStateWk) { //ToDo1:生成 全程加减挡 进项目事件 - //item14->Item_Color = itemStateZk; - //item14->TestPro = ItemProFlagInit; - //item14->FinishFlag = false; - m_car->createEventEnterItem({item14->ItemNo, ""}); m_car->KM3EndItem(item14->ItemNo); } } } + */ m_DiaoTou_ID = 0; std::string CurrentRoadData = cg->MapPoint_Road_Code; diff --git a/entry/src/main/cpp/sdk/utility/GpsMath.cpp b/entry/src/main/cpp/sdk/utility/GpsMath.cpp index 32bc8171..960e607e 100644 --- a/entry/src/main/cpp/sdk/utility/GpsMath.cpp +++ b/entry/src/main/cpp/sdk/utility/GpsMath.cpp @@ -566,27 +566,59 @@ inline void GpsMath::getDimensionalCoordinate(const double& E1, const double& N1 ///以下是科目三的函数 2024-01-12 /////////////////////////////////////////////////// +/* +double GpsMath::getAngle(const Pointi& p1, const Pointi& p2) +{ + double angle = 0; + //修改坐标系 + if(p1.x == p2.x) + { + if(p1.y < p2.y) + { + angle = PI / 2; + } + else if(p1.y >= p2.y) + { + angle = PI * 3 / 2; + } + } + else + { + angle = std::atan2(p2.y - p1.y, p2.x - p1.x); + } + + if(angle < 0) + { + angle = angle + 2 * PI; + } + angle = angle / PI * 180; + return angle; +} +*/ + //1、获得点1指向点2的角度0-360度,该角度是X轴正方向顺时针旋转到有向线段(由点1指向点2所确定)的角度,例如:正东=0度,正北=270 double GpsMath::GetAngle_HQ(const Pointi& p1, const Pointi& p2, int MinusY) { - int result = 0; + double angle = 0; if(p1.x == p2.x) { if(p1.y * MinusY < p2.y * MinusY) - result = PI * 3 / 2; + angle = PI * 3 / 2; else if (p1.y * MinusY > p2.y * MinusY) - result = PI / 2; + angle = PI / 2; else - result = 0; + angle = 0; } else - result = std::atan2(p1.y * MinusY - p2.y * MinusY, p2.x - p1.x); //???yhyflag + { + angle = std::atan2(p1.y * MinusY - p2.y * MinusY, p2.x - p1.x); + } - if(result < 0) - result = result + 2 * PI; + if(angle < 0) + angle = angle + 2 * PI; - result = result / PI * 180; - return result; + angle = angle / PI * 180; + return angle; } diff --git a/entry/src/main/cpp/sdk/utility/GpsMath.h b/entry/src/main/cpp/sdk/utility/GpsMath.h index c4e73478..374d77b3 100644 --- a/entry/src/main/cpp/sdk/utility/GpsMath.h +++ b/entry/src/main/cpp/sdk/utility/GpsMath.h @@ -137,7 +137,10 @@ private: public: //科目三 + //计算角度 逆时针 + //static double getAngle(const Pointi& point1, const Pointi& point2); //1、获得点1指向点2的角度0-360度,该角度是X轴正方向顺时针旋转到有向线段(由点1指向点2所确定)的角度,例如:正东=0度,正北=270 + //MinusY= 1顺时针, -1逆时针 static double GetAngle_HQ(const Pointi& p1, const Pointi& p2, int MinusY = 1); //计算两点距离 static int PointDistance(const Pointi& p1, const Pointi& p2); diff --git a/entry/src/main/cpp/sdk/utility/HBean.h b/entry/src/main/cpp/sdk/utility/HBean.h index 88d5683b..8b292ab1 100644 --- a/entry/src/main/cpp/sdk/utility/HBean.h +++ b/entry/src/main/cpp/sdk/utility/HBean.h @@ -148,6 +148,14 @@ enum PlaySoundType PlaySoundEndNotify = 1, //1:表示是模拟灯光项目的语音,语音播报结束需要调用examJudgeSoundEnd通知评判。 }; +//行驶方向,***注意:枚举不能变,和外壳有对应关系 +enum DriveDirType +{ + DriveDirN = -1, //-1:逆向行驶 + DriveDirX = 0, //0:未知 + DriveDirY = 1, //1:正向行驶 +}; + //Tag1=0-无标线 //Tag1=1-中心线(黄色实线) diff --git a/entry/src/main/cpp/sdk/utility/HTypes.h b/entry/src/main/cpp/sdk/utility/HTypes.h index 79606121..489a5d83 100644 --- a/entry/src/main/cpp/sdk/utility/HTypes.h +++ b/entry/src/main/cpp/sdk/utility/HTypes.h @@ -334,7 +334,7 @@ struct TStuInfo int64 ddkssj = 0; //考试中断那次考试开始考试时间 1970年到现在的毫秒数 std::vector ykxm = {}; //已考项目 "1,3" 对应枚举 ExamItemCode DuanDian_FinishItems std::vector kfxm = {}; //扣分项目 "20,01;" 对应枚举 ExamItemCode DuanDian_Marks - int32 yklc = 0; //已考里程,单位米 + int32 yklc = 0; //已考里程,单位厘米 int8 sczb = 0; //CS_Finish_SCZB_Flag:Boolan; //yhy22 初始完成上车准备标志(外壳传递的)Boolan std::vector sczbkf = {}; //SCZBKouFenData:String[200]; //格式: ItemNo,MarkSerial; ItemNo,MarkSerial; @@ -850,15 +850,14 @@ struct TRTKResult int CrossPointNo = 0; //穿越点 - - //20240730 新增 还没计算 - int TouchLineDirCS = 0; //车身碰线 车身碰线方向 + //20240801 新增 还没计算 + int TouchLineDirCS = TouchDir0; //车身碰线 车身碰线方向 int BackPointLaneNo = 0; //后点车道 后点所在车道号 int BackPointLaneCount = 0; //后点车道 后点天线共有几股车道 int Body_RF_ToBaseLine = 0; //右前车身边线 指车身离右侧路边缘线距离 int Body_RB_ToBaseLine = 0; //右后车身边线 指车身离右侧路边缘线距离 - int DirInverse = 0; //车道属性 是否逆向行驶 + int DirInverse = 0; //车道属性 是否逆向行驶 对应DriveDirType枚举 int ShapeNoWheel = 0; //形状 车轮相交的形状线号 #ifdef JUDGE_USE_INSPECT diff --git a/entry/src/main/ets/common/utils/File.ts b/entry/src/main/ets/common/utils/File.ts index ee9a1bcd..be17fd93 100644 --- a/entry/src/main/ets/common/utils/File.ts +++ b/entry/src/main/ets/common/utils/File.ts @@ -33,10 +33,19 @@ export default class FileUtil{ let path = absolutePath folderList.forEach((folderName=>{ path += `/${folderName}`; - const isExit = fs.accessSync(path); - if(!isExit){ - fs.mkdirSync(path) + try { + const isExit = fs.accessSync(path); + if(!isExit){ + fs.mkdirSync(path) + } + } catch (e) { + promptAction.showToast({ + message:`初始化文件夹失败`+JSON.stringify(e), + duration:4000, + }) } + + })); return path; } diff --git a/entry/src/main/ets/common/utils/UdpJudge.ts b/entry/src/main/ets/common/utils/UdpJudge.ts index 73d493b9..d4dbc772 100644 --- a/entry/src/main/ets/common/utils/UdpJudge.ts +++ b/entry/src/main/ets/common/utils/UdpJudge.ts @@ -1,10 +1,10 @@ import systemTime from '@ohos.systemDateTime'; import { Array2Byte, fillZero, string2Bytes, stringToASC } from '../../common/utils/tools'; -import { testKmItems } from '../../pages/judgeSDK/dataTest/index'; +import { testKm2Items,testKm3Items } from '../../pages/judgeSDK/dataTest/index'; +import { judgeConfig } from '../../pages/judgeSDK/utils/judgeConfig'; import { setJudgeUdp, setTopLineUdp } from './GlobalUdp'; import { convertGpsCoord2 } from '../utils/tools'; - export const initJudgeUdp = async () => { globalThis.serialIndex = 0; globalThis.udpIndex = 0; @@ -19,8 +19,6 @@ export const initJudgeUdp = async () => { lightLineUdp.send(arrBlueBuffer); } globalThis.lightLineUdp = lightLineUdp - /*******************************************/ - globalThis.udpClient.onMessage_1(async (msg) => { const stachArr = msg.split(',') if (stachArr[0] != '#DN_GD') { @@ -40,25 +38,25 @@ export const getMessageHeartbeat = async (msg) => { const carInfo = globalThis.carInfo; const { examSubject,plateNo } = carInfo; const ksyh='0000000000000' + const {fourInOneScreen:{gpsDigit}} = judgeConfig const asclshArr = stringToASC(fillZero(globalThis.lsh || 0, 13)); const ascksyhArr = stringToASC(fillZero(ksyh || 0, 13)) const ascsbxhArr = stringToASC('00000000') // const ascsbxhArr = stringToASC('153216400880') const serialIndex = globalThis.serialIndex const tempData = await getPlcData(msg); + const examType = examSubject == 2?2:3 const {sensor,gps} = tempData; const {zfxd,yfxd,shtd,ygd,jgd,skd,dh1,dh2,lhq,jsc,ssc,fsc,lb,mkg,aqd,ygq,cs,fdjzs} = sensor const {jd,wd, hxj, fyj, hbg,} = gps const translateSignals = getTranslateSignals( [zfxd, yfxd, shtd, ygd, jgd, skd, dh1, dh2, lhq, jsc, ssc, fsc, lb, mkg, aqd, 0, 0, 0, 0, 0, 0, ygq, sensor.wd, 0] ) - console.log('jinweiduwaike',wd,jd,hxj,fyj,hbg) - const translateProject = getTranslateProject(); //@ts-ignore - const translateJd = convertGpsCoord2(wd).toFixed(7) * Math.pow(10, 7) + const translateJd = convertGpsCoord2(wd).toFixed(gpsDigit) * Math.pow(10, gpsDigit); //@ts-ignore - const translateWd = convertGpsCoord2(jd).toFixed(7) * Math.pow(10, 7) + const translateWd = convertGpsCoord2(jd).toFixed(gpsDigit) * Math.pow(10, gpsDigit) //@ts-ignore const translateProjects = translateProject.map(numStr => string2Bytes(parseInt(numStr, 2), 8)[0]) const arr = [ @@ -66,20 +64,20 @@ export const getMessageHeartbeat = async (msg) => { asclshArr.map(lsh => string2Bytes(lsh, 8)[0]), //考试员号 ascksyhArr.map(ksyh => string2Bytes(ksyh, 8)[0]), - // 科目类型(0:未考试 1:科目二 2:科目三) + 考试开始时间 - string2Bytes('00000000000', 4 * 8), + //科目类型(0:未考试 1:科目二 2:科目三) + 考试开始时间 + string2Bytes(`${0}${'00:00:00'}`, 4 * 8), // 消息序号 string2Bytes(serialIndex, 2 * 8), translateSignals, //@ts-ignore - string2Bytes(cs, 2 * 8), string2Bytes(fdjzs / 60, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8), + string2Bytes(Math.floor(gps.sd*1.852) , 2 * 8), string2Bytes(fdjzs / 100, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8), //GPS东向距离 string2Bytes(0, 4 * 8), //GPS北向距离 string2Bytes(0, 4 * 8), //航向角 俯仰角 高程(海拔) //@ts-ignore - string2Bytes((hxj + 90) * 100, 2 * 8), string2Bytes(fyj * 100, 2 * 8), string2Bytes(hbg * 100, 4 * 8), + string2Bytes((hxj) * 100, 2 * 8), string2Bytes(fyj * 100, 2 * 8), string2Bytes(hbg * 100, 4 * 8), //dddd translateProjects, //当前项目编号 @@ -121,26 +119,28 @@ const getTranslateSignals = (tempItems) => { // 中心所有项目转换 const getTranslateProject = () => { - const allKmItemsObj = {}; - testKmItems.forEach(item => { - allKmItemsObj[item.code] = item; - }) + const examSubject =globalThis.examSubject; - const tempItems = testKmItems.map(item => { - const current = allKmItemsObj[item.code]; + const tempItems = (examSubject == 2 ? testKm2Items:testKm3Items).map(code => { return { - code: item.code, - status: getCenterProjectStatus(current.status) + code, status:'0' } }) - const len = Math.floor(tempItems.length / 8); const arr = []; - for (let i = 0; i <= len; i++) { - const temp = tempItems.slice(i * 8, (i + 1) * 8); + for (let i = 0; i <= 4; i++) { + const temp = tempItems.slice(i * 4, (i + 1) * 4); let tempArr = temp.map(item => item.status) - if (i === 4) { - tempArr = tempArr.concat(['00', '00']) + if (i === 4 && examSubject) { + tempArr = examSubject == 2 + //bit36-bit39保留 + ? tempArr.concat(['00', '00']) + //bit30-bit39保留 + : tempArr.concat(['00', '00','00','00']) } + if (i === 3 && examSubject == 3) { + tempArr = tempArr.concat(['00']) + } + arr.push(tempArr.join('')); } return arr.map(numStr => parseInt(numStr, 2)); diff --git a/entry/src/main/ets/common/utils/tools.ts b/entry/src/main/ets/common/utils/tools.ts index 3dca0628..35b3a55b 100644 --- a/entry/src/main/ets/common/utils/tools.ts +++ b/entry/src/main/ets/common/utils/tools.ts @@ -100,6 +100,11 @@ export async function getCurrentHourTime():Promise { //@ts-ignore s = s < 10 ? '0' + s : s; let ss = date.getMilliseconds(); + //@ts-ignore + ss = ss < 10 ? '00' + ss : ss; + //@ts-ignore + ss = ss < 100 ? '0' + ss : ss; + return `${h}${m}${s}${ss}` } diff --git a/entry/src/main/ets/entryability/EntryAbility.ts b/entry/src/main/ets/entryability/EntryAbility.ts index 983a375a..a85e910d 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ts +++ b/entry/src/main/ets/entryability/EntryAbility.ts @@ -28,8 +28,8 @@ export default class EntryAbility extends UIAbility { globalThis.examinerInfo = {} globalThis.deviceNo = ''; globalThis.hasAuth = false - globalThis.version = '2022.08.13.01' - globalThis.judgeVersion = '2022.12.05.1' + globalThis.version = '2024.11.22.14' + globalThis.judgeVersion = '2024.11.22.14' globalThis.videoVersion= '1.0' // globalThis.version = '2023.12.13.01' // globalThis.judgeVersion = '2023.09.30.1' diff --git a/entry/src/main/ets/pages/Judge.ets b/entry/src/main/ets/pages/Judge.ets index 8c01d416..e55f0367 100644 --- a/entry/src/main/ets/pages/Judge.ets +++ b/entry/src/main/ets/pages/Judge.ets @@ -43,28 +43,21 @@ struct Index { this.startTime = time.split(' ')[1] this.startFullTime = await getCurrentTime(1); this.startHourTime = await getCurrentHourTime() + this.startExamTime = time setInterval(async () => { this.time = await getCurrentTime(); this.examTime += 1; }, 1000); - console.log('SURENJUN_JUDGE',10) //初始化数据库表 await this.initDb() - //断点续考 - console.log('SURENJUN_JUDGE',11) - await this.goDdxkItems() //初始化评判 - console.log('SURENJUN_JUDGE',6) - const judge = await this.initJudge(); - console.log('SURENJUN_JUDGE',7) - this.judge = judge } @@ -76,6 +69,7 @@ struct Index { const {isTrajectoryOpen,trajectoryPath} = judgeConfig await this.initStudent(); await this.initCar(); + //是否开启轨迹回放模式 if (isTrajectoryOpen) { this.initTrajectoryParam(trajectoryPath) @@ -85,16 +79,12 @@ struct Index { await this.initSysset(); this.singlePlay = globalThis.singlePlay } - await this.initCDSBInfo() // 科目三新增读取表数据 if (examSubject == 3) { - await this.initMapPoint() - await this.initMapPointItem() - //定时上传考试里程 // let mileageTimer = setInterval(()=>{ // this.uploadMileage() @@ -310,6 +300,8 @@ struct Index { }) }) const projects = this.projects; + console.info('surenjun',JSON.stringify(this.projectsObj)) + if (!projects.length) { Prompt.showToast({ message: '读取数据库信息失败,请重新联网更新!', @@ -341,10 +333,7 @@ struct Index { // 评判相关初始化 async initJudge() { - console.log('SURENJUN_JUDGE',0) - const judge = new Judge(this); - console.log('SURENJUN_JUDGE',30) await judge.onJudgeFn(async (judgeData) => { const {xmmcStr,carztStr,kfArr} = judgeData; this.xmmcStr = xmmcStr; @@ -833,13 +822,6 @@ struct Index { .margin({ bottom: 20 }) }.height('90%').justifyContent(FlexAlign.Start).padding({ top: 37, left: 60, bottom: 35, right: 60 }) - //loading 弹窗 - if (this.loadingPopupVisible) { - LoadingPopup({ - title: '正在生成考试记录,请稍后...', - }) - } - if (this.signDisplayComVisible) { Column() { SignDisplayCom({ @@ -922,6 +904,13 @@ struct Index { } }) } + + //loading 弹窗 + if (this.loadingPopupVisible) { + LoadingPopup({ + title: '正在生成考试记录,请稍后...', + }) + } } .height('100%').backgroundColor('#000').justifyContent(FlexAlign.Start) } @@ -955,9 +944,13 @@ struct Index { artSubject3ProjectsCodesArr, currentXmdm, } = this; - const projectCode = artSubject3ProjectsCodesArr[index] + const projectCode = artSubject3ProjectsCodesArr[index]; + console.info('surenjun',getIsExitManualProject(index)) if (getIsExitManualProject(index)) { // 正在进行的项目 取消项目 + console.info('surenjun isManualProjectIn=>',isManualProjectIn) + console.info('surenjun projectCode=>',projectCode) + console.info('surenjun currentXmdm=>',currentXmdm) if (isManualProjectIn && projectCode === currentXmdm) { await this.judge.setJudgeItem(currentXmdm, 2); Prompt.showToast({ diff --git a/entry/src/main/ets/pages/UserInfo.ets b/entry/src/main/ets/pages/UserInfo.ets index bd3c646e..eff162d5 100644 --- a/entry/src/main/ets/pages/UserInfo.ets +++ b/entry/src/main/ets/pages/UserInfo.ets @@ -17,14 +17,18 @@ import promptAction from '@ohos.promptAction'; import FilePhoto from './judgeSDK/utils/filePhoto'; import { getSyncData, upDateTableByArray } from '../common/service/initable'; import { CandidateData, EmptyCandidateObject } from '../mock/CandidateData'; -import BoardPrePareSetPopup from './compontents/judge/BoardPrePareSetPopup'; +import BoardPrePareSetPopup from './compontents/judge/BoardPrePareSetPopup' import LoadingPopup from './compontents/judge/LoadingPopup'; import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements'; +import { JudgeConfig } from '../config/judge'; import { judgeConfig } from './judgeSDK/utils/judgeConfig'; - +import { initJudgeUdp } from '../common/utils/UdpJudge'; @Entry @Component struct UserInfo { + private filePhoto: FilePhoto + private avPlayer + @State pageIndex: number = 0 @State ratio: number = 1700 / 960 @State index: number = 0 @@ -43,12 +47,9 @@ struct UserInfo { @State isBoardPrePareSetPopupOpen: boolean = false @State isFirstBoardPrePareSetPopupBtnShow: boolean = false @State isBoardPrePareSetPopupShow: boolean = false - @State isLoadingPopupVisible: boolean = false; - @State loadingText: string = '正在认证监管信息,请稍后...' - @State sczbkf: { - xmdm: number, - kfdm: string - }[] = [] + @State isLoadingPopupVisible:boolean = false; + @State loadingText:string = '正在认证监管信息,请稍后...' + @State sczbkf:{xmdm:number,kfdm:string}[] = [] @State currentUser: User = EmptyCandidateObject @State dataList: Array = [] @State list: Array = [] @@ -61,7 +62,7 @@ struct UserInfo { @State idCard: string = ''; @State grantDept: string = ''; //是否已经开始考试 - @State isExamStart: boolean = false; + @State isExamStart:boolean = false; @State effectDate: string = ''; @State interval: any = null; @State studentRefreshStatue: string = '0'; @@ -86,10 +87,7 @@ struct UserInfo { return photoBase64 } } - private filePhoto: FilePhoto - private avPlayer - private AccountTable = new AccountTable(() => { - }, USER); + private AccountTable = new AccountTable(() => {}, USER); private context = getContext(this) as common.UIAbilityContext; private labelBlocks = [ { label: '考生姓名', key: 'xm' }, @@ -520,12 +518,12 @@ struct UserInfo { this.currentUser.id = '1' const avPlayer = this.avPlayer; this.isLoadingPopupVisible = true - avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => { + avPlayer.playAudio([`voice/监管通信中.mp3`],false,async ()=>{ const code = await this.beginExam(); if (code != 1) { promptAction.showToast({ - message: '开始考试接口调用失败!', - duration: 4000 + message:'开始考试接口调用失败!', + duration:4000 }) return } @@ -549,30 +547,30 @@ struct UserInfo { // 检测车门、熄火信号 async checkSignal(): Promise { const {isCheckFireOpen} = judgeConfig - return new Promise((resolve, reject) => { - if (isCheckFireOpen) { + return new Promise((resolve,reject)=>{ + if(isCheckFireOpen){ resolve(true) // return } console.info('socketTag[PLC.UdpClient]', '注册udp回调') - let plcValue = globalThis.udpClient.getCurrentMessage(); - console.info('surenjun', plcValue) + let plcValue = globalThis.udpClient.getCurrentMessage(); + console.info('surenjun',plcValue) const msgArr = plcValue.split(',') || '' const mkg = msgArr[14]; const fdjzs = msgArr[25]; - if (mkg == 1) { + if(mkg == 1){ this.avPlayer.playAudio(['voice/关门.mp3']) promptAction.showToast({ - message: '请关闭车门', - duration: 4000 + message:'请关闭车门', + duration:4000 }) reject(false) } - if (fdjzs * 1 > 0) { + if(fdjzs*1 > 0){ this.avPlayer.playAudio(['voice/熄火.mp3']) promptAction.showToast({ - message: '请熄火', - duration: 4000 + message:'请熄火', + duration:4000 }) reject(false) } @@ -747,6 +745,7 @@ struct UserInfo { this.isFirstBoardPrePareSetPopupBtnShow = true; this.stepFlag = false this.stopDeviceById() + initJudgeUdp() } catch (e) { } @@ -762,11 +761,8 @@ struct UserInfo { if (!this.currentUser.xm) { return } - - console.info('surenjun currentUser', JSON.stringify(this.currentUser)) if (globalThis.singlePlay) { const {examSubject} = globalThis.carInfo; - console.info('surenjun => sczbkf', JSON.stringify(this.sczbkf)) await upDateTableByArray('USER', [this.currentUser]) router.pushUrl({ url: examSubject == 3 ? 'pages/Roads' : 'pages/Judge', @@ -781,6 +777,7 @@ struct UserInfo { if (this.FaceOpenStatue != '0') { this.showFaceCompare = true } else { + initJudgeUdp() this.sfbdinterfaceFn() } } catch (e) { @@ -847,7 +844,7 @@ struct UserInfo { } // loading - if (this.isLoadingPopupVisible) { + if(this.isLoadingPopupVisible){ LoadingPopup({ title: this.loadingText, }) @@ -887,7 +884,7 @@ struct CommText { build() { Text(this.text) - .fontSize(19.5 * this.ratio) + .fontSize(16 * this.ratio) .lineHeight(30 * this.ratio) .fontWeight(500) .fontColor(this.color) @@ -913,13 +910,9 @@ struct LabelBlock { build() { Row() { - Text(this.label).fontSize(18 * this.ratio).fontColor('#99948A') + Text(this.label).fontSize(16 * this.ratio).fontColor('#99948A') Row() { - Text(decodeURIComponent(this.value)) - .fontColor('#fff') - .textAlign(TextAlign.Center) - .width('100%') - .fontSize(20 * this.ratio) + Text(decodeURIComponent(this.value)).fontColor('#fff').textAlign(TextAlign.Center).width('100%') } .commLabelStyle() }.margin({ bottom: 10 * this.ratio }) diff --git a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets index 71a8d6fe..f8351370 100644 --- a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets +++ b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets @@ -235,28 +235,7 @@ export default struct SignDisplayCom { .backgroundImage($r('app.media.km_open')) .backgroundImageSize({ width: '100%', height: '100%' }) .visibility(this.active == 0 ? Visibility.Visible : Visibility.None) - Column() { - Column() { - Text( this.msg || '0') - .fontColor('#FFF5E5') - .fontSize(14 * this.ratio) - .width('100%') - .textAlign(TextAlign.Start) - } - .backgroundColor('#282828') - .width(this.ratio * 890) - .height(436 * this.ratio) - .margin({ left: 0 * this.ratio, top: 15 * this.ratio }) - - } - .width(936 * this.ratio) - .height(480 * this.ratio) - .margin({ left: 10 * this.ratio }) - .padding({ left: 10 * this.ratio, right: 10 * this.ratio }) - .backgroundImage($r('app.media.km_open')) - .backgroundImageSize({ width: '100%', height: '100%' }) - .visibility(this.active == 2 ? Visibility.Visible : Visibility.None) Row() { Flex({ direction: FlexDirection.Column }) { Row() { @@ -329,7 +308,7 @@ export default struct SignDisplayCom { if (showBack) { this.ratio = 1.4 globalThis.udpClient.onMessage_1((msg) => { - console.log('getUDPonMessage_1bysignDisplay0', msg) + console.log('msgmsg', msg) if (msg) { getSignal(msg) } @@ -354,8 +333,6 @@ export default struct SignDisplayCom { const showBack = this.showBack; if (showBack) { globalThis.udpClient.onMessage_1((msg) => { - console.log('getUDPonMessage_1bysignDisplay2', msg) - getSignal(msg) }) } else { diff --git a/entry/src/main/ets/pages/judgeSDK/api/index.ts b/entry/src/main/ets/pages/judgeSDK/api/index.ts index bcaf889b..1130ab6d 100644 --- a/entry/src/main/ets/pages/judgeSDK/api/index.ts +++ b/entry/src/main/ets/pages/judgeSDK/api/index.ts @@ -25,10 +25,7 @@ export async function examJudgeVersion(){ * @desc 设置评判日志级别和日志回调函数 */ export async function examJudgeSetLogCallback(level:number,handleLog:Function):Promise{ - console.log('SURENJUN_JUDGESDK',0) const temp = libJudgeSdk.examJudgeSetLogCallback(level,handleLog); - console.log('SURENJUN_JUDGESDK',1) - return await handle(temp,'examJudgeSetLogCallback') } 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 9ba7fded..f57a2339 100644 --- a/entry/src/main/ets/pages/judgeSDK/api/judgeSDK.d.ts +++ b/entry/src/main/ets/pages/judgeSDK/api/judgeSDK.d.ts @@ -113,7 +113,6 @@ export interface EXAMDATA { xmxh: string, xmhg: 1 | 0 }, - //扣分 kf: { //项目代码 @@ -131,7 +130,13 @@ export interface EXAMDATA { //前进距离 qjjl: number, //倒车距离 - dcjl: number + dcjl: number, + d1: number + d2: number + d3: number + d4: number + d5: number + d6: number }, //项目取消 diff --git a/entry/src/main/ets/pages/judgeSDK/dataTest/index.ts b/entry/src/main/ets/pages/judgeSDK/dataTest/index.ts index b2093672..fc7e9696 100644 --- a/entry/src/main/ets/pages/judgeSDK/dataTest/index.ts +++ b/entry/src/main/ets/pages/judgeSDK/dataTest/index.ts @@ -557,42 +557,72 @@ export const testUIAllitems = [ {"name":"直角转弯","abbreviation":"直角转弯","projectCode":"6","projectCodeCenter":"20700","type":"7"}, ] -//所有的科二项目 -export const testKmItems = [ +export const wuxiKm3Items = [ + {projectCode:'1',projectCodeCenter:'40100',name:'上车准备',abbreviation:'上车准备'}, + {projectCode:'2',projectCodeCenter:'40200',name:'起步',abbreviation:'起步'}, + {projectCode:'3',projectCodeCenter:'40300',name:'直线行驶',abbreviation:'直线行驶'}, + {projectCode:'4',projectCodeCenter:'40500',name:'变更车道',abbreviation:'变更车道'}, + {projectCode:'5',projectCodeCenter:'40700',name:'直行通过路口',abbreviation:'直行通过路口'}, + {projectCode:'6',projectCodeCenter:'41000',name:'通过人行横道线',abbreviation:'通过人行横道线'}, + {projectCode:'7',projectCodeCenter:'41100',name:'通过学校区域',abbreviation:'通过学校区域'}, + {projectCode:'8',projectCodeCenter:'41200',name:'通过公共汽车站',abbreviation:'通过公共汽车站'}, + {projectCode:'9' ,projectCodeCenter:'41300',name:'会车',abbreviation:'会车'}, + {projectCode:'10',projectCodeCenter:'41400',name:'超车',abbreviation:'超车'}, + {projectCode:'11',projectCodeCenter:'40600',name:'靠边停车',abbreviation:'靠边停车'}, + {projectCode:'12',projectCodeCenter:'41500',name:'掉头',abbreviation:'掉头'}, + {projectCode:'13',projectCodeCenter:'41600',name:'夜间行驶',abbreviation:'夜间行驶'}, + {projectCode:'14',projectCodeCenter:'40400',name:'加减档位操作',abbreviation:'加减档位操作'}, + {projectCode:'15',projectCodeCenter:'40800',name:'路口左转弯',abbreviation:'路口左转弯'}, + {projectCode:'16',projectCodeCenter:'40900',name:'路口右转弯',abbreviation:'路口右转弯'}, +] + +//所有的科二 科目三项目 +export const testKm2Items = [ {code:'20100',status:0}, {code:'20200',status:0}, {code:'20300',status:0}, {code:'20400',status:0}, + {code:'20500',status:0}, {code:'20600',status:0}, {code:'20700',status:0}, {code:'20800',status:0}, + {code:'20900',status:0}, {code:'21000',status:0}, {code:'21100',status:0}, {code:'21200',status:0}, + {code:'21300',status:0}, {code:'21400',status:0}, {code:'21500',status:0}, {code:'21600',status:0}, + {code:'21700',status:0}, {code:'21800',status:0}, +] + +export const testKm3Items= [ {code:'40100',status:0}, {code:'40200',status:0}, {code:'40300',status:0}, {code:'40400',status:0}, + {code:'40500',status:0}, {code:'40600',status:0}, {code:'40700',status:0}, {code:'40800',status:0}, + {code:'40900',status:0}, {code:'41000',status:0}, {code:'41100',status:0}, {code:'41200',status:0}, + {code:'41300',status:0}, {code:'41400',status:0}, {code:'41500',status:0}, {code:'41600',status:0}, + {code:'41700',status:0}, ] diff --git a/entry/src/main/ets/pages/judgeSDK/judge.ts b/entry/src/main/ets/pages/judgeSDK/judge.ts index 8541fc54..1f6f65d4 100644 --- a/entry/src/main/ets/pages/judgeSDK/judge.ts +++ b/entry/src/main/ets/pages/judgeSDK/judge.ts @@ -2,7 +2,7 @@ import systemTime from '@ohos.systemDateTime'; import router from '@ohos.router'; import util from '@ohos.util'; import buffer from '@ohos.buffer'; -import { testKmItems, testMarkRules } from './dataTest/index'; +import { testKm2Items,testKm3Items, testMarkRules } from './dataTest/index'; import { EXAMDATA, SOUND, KSJS } from './api/judgeSDK'; import VoiceAnnounce from './utils/voiceAnnouncements'; import FileModel from './utils/fileModel'; @@ -28,6 +28,7 @@ import { import { getCarStatus, getCarStatusType, + getDwStatusType, getCenterProjectStatus, getKmProjectVoice, getTranslateSignals, @@ -78,18 +79,19 @@ export default class Judge { this.trajectoryPath = trajectoryPath; this.isExam = !this.judgeUI.singlePlay; - const {projectsCenterObj} = judgeUI - + const {projectsCenterObj,examSubject} = judgeUI; //科目三待修改 - testKmItems.forEach(item => { + (examSubject ==2 ? testKm2Items : testKm3Items ).forEach(item => { this.testKmItems[item.code] = item; //考试项目存在 - if (projectsCenterObj[item.code]) { - this.testKmItems[item.code] = { - code: item.code, status: 1 - } + this.testKmItems[item.code] = { + code: item.code, + status: 1, + // status: projectsCenterObj[item.code]?.isRequired ? 1 : 0 } }) + + console.info(judgeTag+'testKmItems',JSON.stringify(this.testKmItems)) this.isExamEnd = false; } @@ -163,7 +165,7 @@ export default class Judge { await fileLog.setExamJudgeData(beginExamInfo) await examJudgeBeginExam(beginExamInfo); console.info(judgeTag, '6.开始考试注册完成') - avPlayer.playAudio(['voice/ksks.WAV']) + avPlayer.playAudio([globalThis.singlePlay?'voice/ksks.WAV':'voice/监管成功.mp3']) this.judgeUI.draw = true // 处理轨迹plc信息 if (isTrajectoryOpen) { @@ -299,6 +301,7 @@ export default class Judge { switch (event) { //项目开始 case 1: + console.info(judgeTag,'项目开始开始1') judgeUI.projectsObj[xmdm].type = '2'; if (isManualProjectIn) { //手动项目是否在进行中 @@ -310,6 +313,7 @@ export default class Judge { this.judgeUI.currentXmdm = xmdm; const xmmcStr = judgeUI.projectsObj[xmdm].name; const xmmcCode = judgeUI.projectsObj[xmdm].projectCodeCenter; + console.info(judgeTag,JSON.stringify(judgeUI.projectsObj[xmdm])) const xmmcSingleCode = judgeUI.projectsObj[xmdm].projectCode; this.testKmItems[xmmcCode].status = 2; this.xmmcStr = xmmcStr; @@ -319,19 +323,22 @@ export default class Judge { this.xmxh = xmxh; this.judgeUI.isProjectIn = true this.judgeUI.isDeductedPopShow = true + console.info(judgeTag,'项目开始开始2') break; //项目结束 - case 2: + case 2: { + const xmmcCode = judgeUI.projectsObj[xmdm].projectCodeCenter; judgeUI.projectsObj[xmdm].type = (xmjs.xmhg === 0 ? '4' : '3'); - //计算项目是否全部结束 + //计算项目是否全部结束 this.judgeUI.isProjectIn = (Reflect.ownKeys(judgeUI.projectsObj).filter( projectKey => judgeUI.projectsObj[projectKey].type == '2').length ) > 0; if (isManualProjectIn) { this.judgeUI.isManualProjectIn = false } - //统计必考项目数量 + this.testKmItems[xmmcCode].status = 3; + //统计必考项目数量 this.xmmcStr = '无'; this.xmmcCode = ''; this.xmmcSingleCode = 0; @@ -339,7 +346,7 @@ export default class Judge { this.judgeUI.isDeductedPopShow = false this.judgeUI.currentXmdm = undefined; break; - + } //扣分 case 3: const thisKf = getKfStr(`${kf.xmdm}_${kf.kfdm}`) @@ -445,17 +452,13 @@ export default class Judge { //项目已考不上传监管信息 if (!isEnd) { judgeTask.addTask(async () => { - console.info(judgeTag, `项目开始-${xmdm}-${projectsObj[xmdm].name}`) - await beginProject(xmdm) - }, { - isDelay: true - }) + console.info(judgeTag, `项目开始-${xmdm}-${projectsObj[xmdm].name}`) + await beginProject(xmdm) + },{isDelay: true}) judgeTask.addTask(async () => { console.info(judgeTag, `项目-${xmdm}-上传照片 start`) await uploadProgressPhoto(xmdm) - }, { - isDelay: true - }) + },{isDelay: true}) this.judgeUI.projectsObj[xmdm].isUpload = true; } break; @@ -476,11 +479,8 @@ export default class Judge { judgeTask.addTask(async () => { console.info(judgeTag, `项目结束-${xmdm}-${projectsObj[xmdm].name}`) await endProject(xmdm); - }, { - isDelay: true - }) + }, {isDelay: true}) } - } judgeUI.projectsObj[xmdm].isEnd = true; break; @@ -499,9 +499,7 @@ export default class Judge { await judgeTask.addTask(async () => { console.info(judgeTag, `项目扣分-${currentKf.markcatalog}-${currentKf.desc}`) await pointsDedute(currentKf.xmdm, currentKf) - }, { - isDelay: true - }) + }, {isDelay: true}) } break; @@ -524,13 +522,11 @@ export default class Judge { } if (event == 2 || event == 3) { setTimeout(() => { - console.info(judgeTag,'滚动开始') this.judgeUI.kfArrScroller.scrollTo({ yOffset: 999999, xOffset: 0 }) - console.info(judgeTag,'滚动结束') },500) - //科目三统计必考数量 + //统计必考项目完成数量 await this.setCountItems(); await checkExamIsEnd() } @@ -541,24 +537,27 @@ export default class Judge { if(xmdm == 20){ return true } - const {judgeTask,beginProject,pointsDedute,uploadProgressPhoto,endProject,checkExamIsEnd} = this; - const {projectsObj} = this.judgeUI - console.info(judgeTag + ' projectsObj=> ',JSON.stringify(projectsObj)) + const {judgeTask,beginProject,pointsDedute,uploadProgressPhoto,endProject,checkExamIsEnd,totalScore} = this; + const {projectsObj,passingScore:passingGrade} = this.judgeUI const {isUpload} = projectsObj[xmdm]; - console.info(judgeTag + ' projectsObj[xmdm] => ',JSON.stringify(projectsObj[xmdm])) //如果项目没有开始 + console.info('surenjun isUpload=>',isUpload) if(!isUpload){ console.info(judgeTag,'项目补传开始') //项目开始补传 judgeTask.addTask(async ()=>{await beginProject(xmdm)},{isDelay:true}) judgeTask.addTask(async ()=>{await uploadProgressPhoto(xmdm)},{isDelay:true}) + this.judgeUI.projectsObj[xmdm].isUpload = true; //扣分补传 if(currentType == 2){ judgeTask.addTask(async ()=>{await pointsDedute(xmdm,kf)},{isDelay:true}) } - judgeTask.addTask(async ()=>{await endProject(xmdm)},{isDelay:true}) - judgeTask.addTask(async ()=>{ + //扣分补传判断是否合格 不合格补传项目结束 + if(currentType == 1 || (currentType == 2 && totalScore < passingGrade)){ + judgeTask.addTask(async ()=>{await endProject(xmdm)},{isDelay:true}) this.judgeUI.projectsObj[xmdm].isEnd = true; + } + judgeTask.addTask(async ()=>{ checkExamIsEnd() }) return false; @@ -719,7 +718,7 @@ export default class Judge { } avPlayer.playAudio([`voice/${code}.mp3`], false, () => { if (type == 1) { - console.info(judgeTag, '播放结束:' + code) + // console.info(judgeTag, '播放结束:' + code) examJudgeSoundEnd({ itemno: xmdm, code, type }) @@ -832,8 +831,8 @@ export default class Judge { try { if (!singlePlay) { // TODO 待验证 - // const bytes = await this.getMessageHeartbeat(true); - // globalThis.judgeUdp.send(bytes) + const bytes = await this.getMessageHeartbeat(true); + globalThis.judgeUdp.send(bytes) } //TODO endExam函数逻辑待验证 await endExam() @@ -857,6 +856,7 @@ export default class Judge { await uploadDisConnectData(); const time = await getCurrentTime(); const photoBase64 = await getPhoto(); + const {d1,d2,d3,d4,d5} = ksjs const data = { xtlb: '17', jkxlh: serialNumber, jkid: '17C56', drvexam: { @@ -869,8 +869,8 @@ export default class Judge { jssj: time, kscj: (totalScore * 1) > 0 ? totalScore : 0, kslc: Math.ceil(((ksjs?.qjjl + ksjs?.dcjl) || 0) / 100), - //TODO - dwlc: '', + // 1,22;2,560;3,128;4,0;5,0; + dwlc: [d1,d2,d3,d4,d5].map((d,index) => `${index},${Math.floor(d /100)}`).join(';'), } } const code = await writeObjectOut(data,filePath); @@ -957,8 +957,6 @@ export default class Judge { getMessageHeartbeat = async (isEnd?: Boolean) => { const carInfo = globalThis.carInfo; const { examSubject,plateNo,ksyh } = carInfo; - // const ksyh='0000000000000' - // const ksyh=globalThis.ksyh ||'0000000000000' const { judgeUI, isExam, @@ -974,34 +972,32 @@ export default class Judge { getSbxh } = this; const {lsh,startHourTime,totalScore} = judgeUI; - const examType = isExam ? examSubject : 0; + const {fourInOneScreen:{gpsDigit}} = judgeConfig + const examType = examSubject == 2?2:3 const {sensor,gps} = tempData; - const {zfxd,yfxd,shtd,ygd,jgd,skd,dh1,dh2,lhq,jsc,ssc,fsc,lb,mkg,aqd,ygq,cs,fdjzs} = sensor + const {zfxd,yfxd,shtd,ygd,jgd,skd,dh1,dh2,lhq,jsc,ssc,fsc,lb,mkg,aqd,ygq,cs,fdjzs,dw} = sensor const {jd,wd, hxj, fyj, hbg,} = gps const translateProject = getTranslateProject(); const sbxh = getSbxh(xmdm, xmxh) const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo; - // const asclshArr = stringToASC(lsh); - const asclshArr = stringToASC(fillZero('0000000000000' || 0, 13)); - + const asclshArr = stringToASC(fillZero(lsh || 0, 13)); //13不足要补0 const ascksyhArr = stringToASC(fillZero(ksyh || 0, 13)) const ascsbxhArr = stringToASC(sbxh) const translateSignals = getTranslateSignals( - [zfxd, yfxd, shtd, ygd, jgd, skd, dh1, dh2, lhq, jsc, ssc, fsc, lb, mkg, aqd, 0, 0, 0, 0].concat(getCarStatusType(carzt)).concat([ygq, sensor.wd, 0]) + [zfxd, yfxd, shtd, ygd, jgd, skd, dh1, dh2, lhq, jsc, ssc, fsc, lb, mkg, aqd].concat(getDwStatusType(dw)).concat(getCarStatusType(carzt)).concat([ygq, sensor.wd, 0]) ) - //@ts-ignore - const translateJd = convertGpsCoord2(wd).toFixed(7) * Math.pow(10, 7); + const translateJd = convertGpsCoord2(wd).toFixed(gpsDigit) * Math.pow(10, gpsDigit); //@ts-ignore - const translateWd = convertGpsCoord2(jd).toFixed(7) * Math.pow(10, 7) + const translateWd = convertGpsCoord2(jd).toFixed(gpsDigit) * Math.pow(10, gpsDigit) //@ts-ignore const translateProjects = translateProject.map(numStr => string2Bytes(parseInt(numStr, 2), 8)[0]) - + // console.info(judgeTag,JSON.stringify(translateProject)) //@ts-ignore // const translateProjects= translateProject.map(num => string2Bytes(p,8)[0]) const arr = [ - //考生号 TODO 考试员号 + //考生号 asclshArr.map(lsh => string2Bytes(lsh, 8)[0]), //考试员号 ascksyhArr.map(ksyh => string2Bytes(ksyh, 8)[0]), @@ -1011,15 +1007,15 @@ export default class Judge { string2Bytes(isEnd ? 0 : serialIndex, 2 * 8), /*左向灯 右向灯 双跳灯 远光灯 近光灯 视宽灯 点火1 点火2 离合器 脚刹 手刹 副刹 喇叭 门开关 安全带 档位 车辆状态 雨刮器 雾灯 0*/ translateSignals, - //速度 发动机转速 GPS纬度 GPS经度 主天线位置 + //速度 发动机转速 GPS纬度 GPS经度 主天线位置 //@ts-ignore - string2Bytes(cs, 2 * 8), string2Bytes(fdjzs / 60, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8), + string2Bytes(Math.floor(gps.sd*1.852) , 2 * 8), string2Bytes(fdjzs / 100, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8), //GPS东向距离 string2Bytes(dxjl < 0 ? (dxjl + 4294967296) : dxjl, 4 * 8), //GPS北向距离 string2Bytes(bxjl < 0 ? (bxjl + 4294967296) : bxjl, 4 * 8), - //航向角 俯仰角 高程(海拔) - string2Bytes((hxj + 90) * 100, 2 * 8), string2Bytes(fyj * 100, 2 * 8), string2Bytes(hbg * 100, 4 * 8), + //航向角 俯仰角 高程(海拔) + string2Bytes((hxj) * 100, 2 * 8), string2Bytes(fyj * 100, 2 * 8), string2Bytes(hbg * 100, 4 * 8), //项目状态 parseInt('01010010',2) 二进制转成10进制 translateProjects, //当前项目编号 @@ -1036,7 +1032,6 @@ export default class Judge { //扣分项数量 string2Bytes(kfArr.length, 8), //n个扣分序号 - kfArr.map(kf => string2Bytes(kf.kfxh, 8)[0]) ] @@ -1076,22 +1071,31 @@ export default class Judge { } // 中心所有项目转换 getTranslateProject = () => { - // const {testKmItems} = this; - const tempItems = testKmItems.map(item => { + const {examSubject} = this.judgeUI; + const tempItems = (examSubject == 2 ? testKm2Items:testKm3Items).map(item => { const current = this.testKmItems[item.code]; return { code: item.code, status: getCenterProjectStatus(current.status) } }) - const len = Math.floor(tempItems.length / 8); + // console.info(judgeTag+'TranslateProject',JSON.stringify(tempItems)); + const arr = []; - for (let i = 0; i <= len; i++) { - const temp = tempItems.slice(i * 8, (i + 1) * 8); + for (let i = 0; i <= 4; i++) { + const temp = tempItems.slice(i * 4, (i + 1) * 4); let tempArr = temp.map(item => item.status) if (i === 4) { - tempArr = tempArr.concat(['00', '00']) + tempArr = examSubject == 2 + //bit36-bit39保留 + ? tempArr.concat(['00', '00']) + //bit30-bit39保留 + : tempArr.concat(['00', '00','00']) } + // if (i === 3 && examSubject == 3) { + // tempArr = tempArr.concat(['00']) + // } + arr.push(tempArr.join('')); } return arr.map(numStr => parseInt(numStr, 2)); @@ -1226,7 +1230,7 @@ export default class Judge { usbService.sendUSB(str) } this.judgeUI.isDwztRight = plcData.gps.dwzt == 4; - this.judgeUI.sd = (Math.floor((plcData.gps.sd as number) || 0) * 1.852) + ''; + this.judgeUI.sd = (Math.floor(((plcData.gps.sd as number) || 0) * 1.852)) + ''; this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + '' await examJudgeRealExam(plcData) const udpIndex = globalThis.udpIndex; @@ -1385,6 +1389,12 @@ export default class Judge { qjjl: number, // 累计倒车距离 dcjl: number + d1: number + d2: number + d3: number + d4: number + d5: number + d6: number } private kfArr: { //项目名称 diff --git a/entry/src/main/ets/pages/judgeSDK/utils/fileModel.ts b/entry/src/main/ets/pages/judgeSDK/utils/fileModel.ts index f5abffbc..9985c2f2 100644 --- a/entry/src/main/ets/pages/judgeSDK/utils/fileModel.ts +++ b/entry/src/main/ets/pages/judgeSDK/utils/fileModel.ts @@ -54,11 +54,11 @@ export default class FileModel{ const content = fileUtil.getFileContent(`${folderPath}/${fileName}`) return content; }catch (e){ + console.info('surenjun',JSON.stringify(e)) promptAction.showToast({ - message:"请检查模型路径是否正确!", + message:`请检查模型路径${folderPath}/${fileName}是否正确!`, duration:4000 }) - router.back() } } diff --git a/entry/src/main/ets/pages/judgeSDK/utils/filePhoto.ts b/entry/src/main/ets/pages/judgeSDK/utils/filePhoto.ts index 660ac918..34187c70 100644 --- a/entry/src/main/ets/pages/judgeSDK/utils/filePhoto.ts +++ b/entry/src/main/ets/pages/judgeSDK/utils/filePhoto.ts @@ -38,11 +38,13 @@ export default class FilePhoto{ return '' }else{ try { + console.info('surenjun','拍照开始') const res = await takePhoto(params, this.context, 'pz/',2); + console.info('surenjun','拍照结束' + JSON.stringify(res)) return res.base64 } catch (e) { promptAction.showToast({ - message: JSON.stringify(e), + message: '拍照异常' + JSON.stringify(e), duration: 2000 }); return '' diff --git a/entry/src/main/ets/pages/judgeSDK/utils/judgeCommon.ts b/entry/src/main/ets/pages/judgeSDK/utils/judgeCommon.ts index cbe28464..5fd39c46 100644 --- a/entry/src/main/ets/pages/judgeSDK/utils/judgeCommon.ts +++ b/entry/src/main/ets/pages/judgeSDK/utils/judgeCommon.ts @@ -1,8 +1,9 @@ import {string2Bytes,Array2Byte,getCurrentTime} from '../../../common/utils/tools' -import {testMarkRules,testRealExam,testKmItems} from '../dataTest/index' +import {testMarkRules,testRealExam} from '../dataTest/index' import promptAction from '@ohos.promptAction' import systemTime from '@ohos.systemDateTime'; +import { expect } from '@ohos/hypium'; //获取本地扣分项 export const getTestMarkRules = () =>{ @@ -46,6 +47,21 @@ export function getCarStatusType(carzt){ case -1:return [1,0] case 0: return [0,0] case 1: return [0,1] + default :return [0,0] + } +} + +// 获取档位信号 +export function getDwStatusType(dw){ + switch (dw){ + case 0:return [0,0,0,0] + case 1: return [0,0,0,1] + case 2: return [0,0,1,0] + case 3: return [0,0,1,1] + case 4: return [0,1,0,0] + case 5: return [0,1,0,1] + case 9: return [1,0,0,1] + default :return [0,0,0,0] } } @@ -53,12 +69,16 @@ export function getCarStatusType(carzt){ // 中心实时项目状态转换 export function getCenterProjectStatus(status){ switch (status){ - //不考 + //不考 case 0:return '00' - //未考 + //未考 case 1:return '01' - //已考 - case 2:return '10' + //正在考 + case 2:return '11' + //已考 + case 3:return '10' + + default :return '00' } } diff --git a/entry/src/main/ets/pages/judgeSDK/utils/judgeConfig.ts b/entry/src/main/ets/pages/judgeSDK/utils/judgeConfig.ts index a25399cf..a5cb5d8d 100644 --- a/entry/src/main/ets/pages/judgeSDK/utils/judgeConfig.ts +++ b/entry/src/main/ets/pages/judgeSDK/utils/judgeConfig.ts @@ -4,7 +4,7 @@ export const judgeConfig = { //本地目录开关 isTrajectoryOpen: false, //是否开启拍照 - isPhotoOpen: false, + isPhotoOpen: true, //扣分语音是否强制开启 kfVoiceOpen: true, // 是否忽略考试前熄火、车门检查 @@ -14,7 +14,12 @@ export const judgeConfig = { // 本地模型地址 modelPath: 'models/model_enc', // 济南科目三 - trajectoryPath: 'logs/2024_08_01/9999931199729_210601620482055232_蒲秀_2024_08_01_11_52_27/judge_exam_data.txt', + trajectoryPath: 'logs/2024_08_07/2024_08_07_11_35_39_0000000000001_342323199501470011_测试学员1/judge_exam_data.txt', + //四合一画面配置 + fourInOneScreen:{ + //gps位数 + gpsDigit:6 + }, // 杭州科目二 // trajectoryPath: 'logs/2024_07_19/0000000000001_342323199501470011_测试学员1_2024_07_19_06_49_12/judge_exam_data.txt', //TODO 济南临时特殊配置 -- 2.43.0.windows.1 From 36cb737068d4cf9e820da9fc32313e6907948331 Mon Sep 17 00:00:00 2001 From: surenjun Date: Thu, 8 Aug 2024 20:15:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat=EF=BC=9A=E8=AF=84=E5=88=A4=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/ets/entryability/EntryAbility.ts | 4 ++-- .../ets/pages/compontents/SignDisplayCom.ets | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/entry/src/main/ets/entryability/EntryAbility.ts b/entry/src/main/ets/entryability/EntryAbility.ts index a85e910d..983a375a 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ts +++ b/entry/src/main/ets/entryability/EntryAbility.ts @@ -28,8 +28,8 @@ export default class EntryAbility extends UIAbility { globalThis.examinerInfo = {} globalThis.deviceNo = ''; globalThis.hasAuth = false - globalThis.version = '2024.11.22.14' - globalThis.judgeVersion = '2024.11.22.14' + globalThis.version = '2022.08.13.01' + globalThis.judgeVersion = '2022.12.05.1' globalThis.videoVersion= '1.0' // globalThis.version = '2023.12.13.01' // globalThis.judgeVersion = '2023.09.30.1' diff --git a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets index f8351370..b1a3ea80 100644 --- a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets +++ b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets @@ -235,7 +235,28 @@ export default struct SignDisplayCom { .backgroundImage($r('app.media.km_open')) .backgroundImageSize({ width: '100%', height: '100%' }) .visibility(this.active == 0 ? Visibility.Visible : Visibility.None) + Column() { + Column() { + Text( this.msg || '0') + .fontColor('#FFF5E5') + .fontSize(14 * this.ratio) + .width('100%') + .textAlign(TextAlign.Start) + } + .backgroundColor('#282828') + .width(this.ratio * 890) + .height(436 * this.ratio) + .margin({ left: 0 * this.ratio, top: 15 * this.ratio }) + + } + .width(936 * this.ratio) + .height(480 * this.ratio) + .margin({ left: 10 * this.ratio }) + .padding({ left: 10 * this.ratio, right: 10 * this.ratio }) + .backgroundImage($r('app.media.km_open')) + .backgroundImageSize({ width: '100%', height: '100%' }) + .visibility(this.active == 2 ? Visibility.Visible : Visibility.None) Row() { Flex({ direction: FlexDirection.Column }) { Row() { -- 2.43.0.windows.1