diff --git a/entry/src/main/cpp/bin/libJudgeSdk.so b/entry/src/main/cpp/bin/libJudgeSdk.so index 0e220073..738b606d 100644 Binary files a/entry/src/main/cpp/bin/libJudgeSdk.so and b/entry/src/main/cpp/bin/libJudgeSdk.so differ diff --git a/entry/src/main/cpp/sdk/common/HVersion.h b/entry/src/main/cpp/sdk/common/HVersion.h index c05ddbaf..50fe437a 100644 --- a/entry/src/main/cpp/sdk/common/HVersion.h +++ b/entry/src/main/cpp/sdk/common/HVersion.h @@ -27,7 +27,7 @@ #define JUDGE_VERSION_MAJOR 1 #define JUDGE_VERSION_MINOR 0 #define JUDGE_VERSION_PATCH 3 -#define JUDGE_VERSION_STAMP "2505130900b" +#define JUDGE_VERSION_STAMP "2505132200b" #if JUDGE_USE_OLD # undef JUDGE_VERSION_STAMP # define JUDGE_VERSION_STAMP "2411121010b.old" diff --git a/entry/src/main/cpp/sdk/exam/ExamCarSub2.cpp b/entry/src/main/cpp/sdk/exam/ExamCarSub2.cpp index 412b5dd7..dffce997 100644 --- a/entry/src/main/cpp/sdk/exam/ExamCarSub2.cpp +++ b/entry/src/main/cpp/sdk/exam/ExamCarSub2.cpp @@ -284,13 +284,35 @@ bool ExamCarSub2::examMarkItem(ExamItemCode itemNo, const std::string& serial, b void ExamCarSub2::examNonGps(TChuanGan* cg) { - const TGpsInfo& gps = cg->real.gps; - if(!gps.rtkEnabled || !gps.valid() || cg->real.gps.errorFlag) + const TGpsInfo* gps = nullptr; + bool ok = true; + const TGpsInfo* gps1 = &cg->real.gps; + //如果gps1异常了就直接报gps1,如gps1正常就检查gps2 + if(!gps1->rtkEnabled || !gps1->valid() || gps1->errorFlag) + { + gps = gps1; + ok = false; + } + else + { + ExamCarType cartype = carType(); + if(IS_A2C6(cartype)) + { + const TGpsInfo* gps2 = &cg->real.gps2; + if(!gps2->rtkEnabled || !gps2->valid() || gps2->errorFlag) + { + gps = gps2; + ok = false; + } + } + } + + if(!ok) { if(m_nontime == 0) { - m_nontime = gps.sj; - m_nongps = gps; + m_nontime = Tools::nowTime(); + m_nongps = *gps; createEventNonGps({TNonGpsReport, m_nongps}); //上报GPS异常数据 } else diff --git a/entry/src/main/cpp/sdk/exam/ExamCarSub3.cpp b/entry/src/main/cpp/sdk/exam/ExamCarSub3.cpp index fed0a8ab..08778168 100644 --- a/entry/src/main/cpp/sdk/exam/ExamCarSub3.cpp +++ b/entry/src/main/cpp/sdk/exam/ExamCarSub3.cpp @@ -268,7 +268,7 @@ bool ExamCarSub3::Init_KM3_Global() const TDBCarInfo* carInfo = TableCarInfo->findCarInfo(carId); if(nullptr == carInfo || carInfo->CARCLASS.empty()) { - logerror("database not find carID=%d or carClass=%p is empty, init error", carId, carInfo); + logerror("database carInfo error, carID=%d, carInfo=0x%p, carClass=%s", carId, carInfo, carInfo->CARCLASS.c_str()); return false; } TASSERT_BOOL(carInfo->CARCLASS == carClass(), ""); @@ -409,7 +409,8 @@ bool ExamCarSub3::Init_KM3_Global() //当前时间到达夜考时间点了 //if( (Now() - Trunc(now())) > (Car.Night_Hr / 24 + Car.Night_Mi / 24 / 60) ) DateTimex dt = Tools::nowDateTime(); - if(dt.hour*60 + dt.minute >= m_car.Night_Hr*60 + m_car.Night_Mi) + //考试模式判断时间,训练模式用外壳传的参数 + if((isExamMode() && (dt.hour*60 + dt.minute >= m_car.Night_Hr*60 + m_car.Night_Mi)) || (isExamDrill() && isSfyk())) { //如果不考模拟灯光 if(!m_stuInfo.dmndg) @@ -4405,13 +4406,35 @@ bool ExamCarSub3::examMarkItem(ExamItemCode itemNo, const std::string& serial, b void ExamCarSub3::examNonGps(TChuanGan* cg) { - const TGpsInfo& gps = cg->real.gps; - if(!gps.rtkEnabled || !gps.valid() || cg->real.gps.errorFlag) + const TGpsInfo* gps = nullptr; + bool ok = true; + const TGpsInfo* gps1 = &cg->real.gps; + //如果gps1异常了就直接报gps1,如gps1正常就检查gps2 + if(!gps1->rtkEnabled || !gps1->valid() || gps1->errorFlag) + { + gps = gps1; + ok = false; + } + else + { + ExamCarType cartype = carType(); + if(IS_A2C6(cartype)) + { + const TGpsInfo* gps2 = &cg->real.gps2; + if(!gps2->rtkEnabled || !gps2->valid() || gps2->errorFlag) + { + gps = gps2; + ok = false; + } + } + } + + if(!ok) { if(m_nontime == 0) { m_nontime = Tools::nowTime(); - m_nongps = gps; + m_nongps = *gps; createEventNonGps({TNonGpsReport, m_nongps}); //上报GPS异常数据 } else @@ -5848,6 +5871,8 @@ void ExamCarSub3::Calc_LaneDistance_Tail() { calcToLaneArc2(Lj, road->Area, body.b1_b_G, body.ZH_W_b_G, RTKKM3_Tail.Wheel_LB_ToBaseLine); calcToLaneArc2(Lj, road->Area, body.b1_b_G, body.YH_W_b_G, RTKKM3_Tail.Wheel_RB_ToBaseLine); + calcToLaneArc2(Lj, road->Area, body.b1_b_G, body.b(RF_I), RTKKM3_Tail.Body_RF_ToBaseLine); + calcToLaneArc2(Lj, road->Area, body.b1_b_G, body.b(RB_I), RTKKM3_Tail.Body_RB_ToBaseLine); } //else if(p == 3) //3:车身左侧与本车道左侧距离 @@ -5870,6 +5895,8 @@ void ExamCarSub3::Calc_LaneDistance_Tail() { calcToLaneLine(Lj, road->Area.Pts, body.b1_b_G, body.ZH_W_b_G, RTKKM3_Tail.Wheel_LB_ToBaseLine); calcToLaneLine(Lj, road->Area.Pts, body.b1_b_G, body.YH_W_b_G, RTKKM3_Tail.Wheel_RB_ToBaseLine); + calcToLaneLine(Lj, road->Area.Pts, body.b1_b_G, body.b(RF_I), RTKKM3_Tail.Body_RF_ToBaseLine, true); + calcToLaneLine(Lj, road->Area.Pts, body.b1_b_G, body.b(RB_I), RTKKM3_Tail.Body_RB_ToBaseLine, true); } //else if(p == 3) //3:车身左侧与本车道左侧距离 diff --git a/entry/src/main/cpp/sdk/exam/ExamSensor.cpp b/entry/src/main/cpp/sdk/exam/ExamSensor.cpp index 16d8e8aa..60f1cc12 100644 --- a/entry/src/main/cpp/sdk/exam/ExamSensor.cpp +++ b/entry/src/main/cpp/sdk/exam/ExamSensor.cpp @@ -1004,82 +1004,80 @@ void ExamSensor::setStatus(TChuanGan* cg, CarMoveState s) bool ExamSensor::filterWrong(TChuanGan* cg) { - TGpsInfo& gps = cg->real.gps; - - //位置差分, 角度差分 - if(gps.dwzt == gpsStatusNARROW_INT && gps.jdzt == gpsStatusANGLE) - { - gps.rtkEnabled = true; - } - else - { - gps.rtkEnabled = false; - logwarning("rtk Enabled not, dwzt=%d, jdzt=%d", gps.dwzt, gps.jdzt); - } - TChuanGan* his = m_car->historyChuanGan(); - gps.errorFlag = false; - //过滤GPS漂移数据 - if(his != nullptr) + bool ok1 = filterGpsWrong(&cg->real.gps, his != nullptr ? &his->real.gps : nullptr); + bool ok2 = true; + ExamCarType cartype = m_car->carType(); + if(IS_A2C6(cartype)) { - const TGpsInfo& h_gps = his->real.gps; - int64 interval = std::abs(gps.sj - h_gps.sj); - //如果是正常连续数据才判断漂移,有可能是断网收不到数据,然后过了几秒又收到数据距离会远超过限制距离 - if(interval < 1*SECOND) - { - TGPSPoint p1 = h_gps.to(); - TGPSPoint p2 = gps.to(); - double distance = GpsMath::calcGpsDistanceCM(p1, p2, p1.gc); - if(distance > DEVIATION_RANGE_DISTANCE_CM) - { - logwarning("deviation rang distance=%0.2f CM", distance); - gps.errorFlag = true; - } - double angle = std::abs(gps.hxj - h_gps.hxj); - if(angle > DEVIATION_RANGE_ANGLE_MIN && angle < DEVIATION_RANGE_ANGLE_MAX) - { - logwarning("deviation rang angle=%0.2f", angle); - gps.errorFlag = true; - } - } + ok2 = filterGpsWrong(&cg->real.gps2, his != nullptr ? &his->real.gps2 : nullptr); } m_car->examNonGps(cg); - if(gps.errorFlag) + //ExamSubject sub = m_car->examSubject(); + //if(ExamSubject2 == sub) + //{ + // return ok1 && ok2; + //} + //else if(ExamSubject3 == sub) + //{ + // return ok1 && ok2; + //} + + return ok1 && ok2; +} + +bool ExamSensor::filterGpsWrong(TGpsInfo* gps, const TGpsInfo* h_gps) +{ + //位置差分, 角度差分 + if(gps->dwzt == gpsStatusNARROW_INT && gps->jdzt == gpsStatusANGLE) { - logwarning("errorFlag invalid dwzt=%d, jdzt=%d, jd=%0.8f, wd=%0.8f", gps.dwzt, gps.jdzt, gps.jd, gps.wd); + gps->rtkEnabled = true; + } + else + { + gps->rtkEnabled = false; + logwarning("rtk Enabled not, dwzt=%d, jdzt=%d", gps->dwzt, gps->jdzt); + } + + gps->errorFlag = false; + //过滤GPS漂移数据 + if(h_gps != nullptr) + { + int64 interval = std::abs(gps->sj - h_gps->sj); + //如果是正常连续数据才判断漂移,有可能是断网收不到数据,然后过了几秒又收到数据距离会远超过限制距离 + if(interval < 1*SECOND) + { + TGPSPoint p1 = h_gps->to(); + TGPSPoint p2 = gps->to(); + double distance = GpsMath::calcGpsDistanceCM(p1, p2, p1.gc); + if(distance > DEVIATION_RANGE_DISTANCE_CM) + { + logwarning("deviation rang distance=%0.2f CM", distance); + gps->errorFlag = true; + } + double angle = std::abs(gps->hxj - h_gps->hxj); + if(angle > DEVIATION_RANGE_ANGLE_MIN && angle < DEVIATION_RANGE_ANGLE_MAX) + { + logwarning("deviation rang angle=%0.2f", angle); + gps->errorFlag = true; + } + } + } + + if(gps->errorFlag) + { + logwarning("errorFlag invalid dwzt=%d, jdzt=%d, jd=%0.8f, wd=%0.8f", gps->dwzt, gps->jdzt, gps->jd, gps->wd); return false; } - if(!gps.valid()) + if(!gps->valid()) { - logwarning("gps invalid dwzt=%d, jdzt=%d, jd=%0.8f, wd=%0.8f", gps.dwzt, gps.jdzt, gps.jd, gps.wd); + logwarning("gps invalid dwzt=%d, jdzt=%d, jd=%0.8f, wd=%0.8f", gps->dwzt, gps->jdzt, gps->jd, gps->wd); return false; } - ExamSubject sub = m_car->examSubject(); - if(ExamSubject2 == sub) - { - //return gps.rtkEnabled == true && gps.valid(); - return gps.valid(); //2025-03-20 modify - } - else if(ExamSubject3 == sub) - { - if(gps.valid()) //20240811 yhy - { - //数据是正常的 - } - else - { - //if(m_car->historyCount() > 0) - //{ - // cloneWith(m_car->historyChuanGan(), cg); - //} - } - return true; - } - return true; } diff --git a/entry/src/main/cpp/sdk/exam/ExamSensor.h b/entry/src/main/cpp/sdk/exam/ExamSensor.h index 0e4072a8..5276616d 100644 --- a/entry/src/main/cpp/sdk/exam/ExamSensor.h +++ b/entry/src/main/cpp/sdk/exam/ExamSensor.h @@ -26,6 +26,7 @@ public: virtual bool calcCarBody(TChuanGan* cg); //过滤异常数据 virtual bool filterWrong(TChuanGan* cg); + virtual bool filterGpsWrong(TGpsInfo* gps, const TGpsInfo* h_gps); //计算考车状态(科目三) virtual bool GetCarDirStauts(TChuanGan* cg); //计算考车状态(科目二) diff --git a/entry/src/main/cpp/sdk/exam/IExamCar.cpp b/entry/src/main/cpp/sdk/exam/IExamCar.cpp index 18c636e2..c3ba0db9 100644 --- a/entry/src/main/cpp/sdk/exam/IExamCar.cpp +++ b/entry/src/main/cpp/sdk/exam/IExamCar.cpp @@ -483,6 +483,26 @@ void IExamCar::examPerformSummary() exam.bxjl = dis.y*10; //单位毫米 所以要乘10 exam.hint = m_message; exam.lane = historyChuanGan()->RTKKM3; + ExamCarType cartype = carType(); + if(IS_A2C6(cartype)) + { + //对于牵引车,车身距离都是指的挂车(车厢),如果车轮,车前轮指的是车头的轮子,车后轮指的挂车最后面轮子,和军华确认过的 2025-05-13 + const TRTKResult& rtkTail = historyChuanGan()->RTKKM3_Tail; + TRTKResult& lane = exam.lane; + + lane.Body_LF_ToLeftEdge = rtkTail.Body_LF_ToLeftEdge; + lane.Body_LB_ToLeftEdge = rtkTail.Body_LB_ToLeftEdge; + lane.Body_RF_ToRightEdge = rtkTail.Body_RF_ToRightEdge; + lane.Body_RB_ToRightEdge = rtkTail.Body_RB_ToRightEdge; + lane.Body_RF_ToBaseLine = rtkTail.Body_RF_ToBaseLine; + lane.Body_RB_ToBaseLine = rtkTail.Body_RB_ToBaseLine; + + lane.Wheel_RB_ToRightEdge = rtkTail.Wheel_RB_ToRightEdge; + lane.Wheel_RB_ToBaseLine = rtkTail.Wheel_RB_ToBaseLine; + lane.Wheel_LB_ToRightEdge = rtkTail.Wheel_LB_ToRightEdge; + lane.Wheel_LB_ToBaseLine = rtkTail.Wheel_LB_ToBaseLine; + + } std::string data = XParser::toAny(exam); FactoryExamService->examJudgeCallbackPerformToCaller(data.c_str(), data.size()); diff --git a/entry/src/main/cpp/sdk/graphic/GraphicImage.cpp b/entry/src/main/cpp/sdk/graphic/GraphicImage.cpp index 2b2258bb..94aa126f 100644 --- a/entry/src/main/cpp/sdk/graphic/GraphicImage.cpp +++ b/entry/src/main/cpp/sdk/graphic/GraphicImage.cpp @@ -136,12 +136,6 @@ const char* GraphicImage::image() #endif int offset_y = 1; - if(m_showVersion) - { - drawText(Pointi(1, offset_y), JUDGE_VERSION_INFO, RGB_BLUE, 16); - offset_y += 16; - } - if(m_showTime) { int64 tick = Tools::nowTime(); @@ -149,6 +143,11 @@ const char* GraphicImage::image() drawText(Pointi(1, offset_y), tm.c_str(), RGB_PERILLA, 16); offset_y += 16; } + //if(m_showVersion) + //{ + // drawText(Pointi(1, offset_y), JUDGE_VERSION_INFO, RGB_BLUE, 16); + // offset_y += 16; + //} toRgb(); return (const char*)m_rgb; diff --git a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge11Kbtc.cpp b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge11Kbtc.cpp index fc728ebd..c81de233 100644 --- a/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge11Kbtc.cpp +++ b/entry/src/main/cpp/sdk/judge/sub3/Sub3Judge11Kbtc.cpp @@ -699,8 +699,14 @@ void Sub3Judge11Kbtc::DoStatus_3() } //压路边线 - Judge_KBTC_YaXian(); - Judge_KBTC_YaXian_Tail(); //A2C6-20250314 + if(!IS_A2C6(m_carType)) + { + Judge_KBTC_YaXian(); + } + else + { + Judge_KBTC_YaXian_Tail(); //A2C6-20250314 + } } else @@ -1077,8 +1083,14 @@ void Sub3Judge11Kbtc::DoStatus_4() { if(m_car->rtkEnabled()) { - Judge_KBTC_YaXian(); - Judge_KBTC_YaXian_Tail(); //A2C6-20250314 + if(!IS_A2C6(m_carType)) + { + Judge_KBTC_YaXian(); + } + else + { + Judge_KBTC_YaXian_Tail(); //A2C6-20250314 + } } } // 20171211 } @@ -1307,7 +1319,6 @@ void Sub3Judge11Kbtc::Judge_KBTC_YaXian() RightJL1_RF = RTKKM3_1.Body_RF_ToBaseLine; RightJL2_RF = RTKKM3_2.Body_RF_ToBaseLine; - RightJL0_RB = RTKKM3_0.Body_RB_ToBaseLine; RightJL1_RB = RTKKM3_1.Body_RB_ToBaseLine; RightJL2_RB = RTKKM3_2.Body_RB_ToBaseLine; @@ -1457,16 +1468,20 @@ void Sub3Judge11Kbtc::Judge_KBTC_YaXian_Tail() RightJL1_RF = RTKKM3_Tail_1.Body_RF_ToBaseLine; RightJL2_RF = RTKKM3_Tail_2.Body_RF_ToBaseLine; - RightJL0_RB = RTKKM3_Tail_0.Body_RB_ToBaseLine; RightJL1_RB = RTKKM3_Tail_1.Body_RB_ToBaseLine; RightJL2_RB = RTKKM3_Tail_2.Body_RB_ToBaseLine; } else { - RightJL0_RF = RTKKM3_Tail_0.Wheel_RF_ToBaseLine; - RightJL1_RF = RTKKM3_Tail_1.Wheel_RF_ToBaseLine; - RightJL2_RF = RTKKM3_Tail_2.Wheel_RF_ToBaseLine; + //对于牵引车,车身距离都是指的挂车(车厢),如果车轮,车前轮指的是车头的轮子,车后轮指的挂车最后面轮子,和军华确认过的 2025-05-13 + const TRTKResult& RTKKM3_0 = m_car->historyRtkKM3(0); + const TRTKResult& RTKKM3_1 = m_car->historyRtkKM3(1); + const TRTKResult& RTKKM3_2 = m_car->historyRtkKM3(2); + + RightJL0_RF = RTKKM3_0.Wheel_RF_ToBaseLine; + RightJL1_RF = RTKKM3_1.Wheel_RF_ToBaseLine; + RightJL2_RF = RTKKM3_2.Wheel_RF_ToBaseLine; RightJL0_RB = RTKKM3_Tail_0.Wheel_RB_ToBaseLine; RightJL1_RB = RTKKM3_Tail_1.Wheel_RB_ToBaseLine; diff --git a/entry/src/main/ets/common/service/initable.ts b/entry/src/main/ets/common/service/initable.ts index 186df5fd..46849e3e 100644 --- a/entry/src/main/ets/common/service/initable.ts +++ b/entry/src/main/ets/common/service/initable.ts @@ -352,7 +352,7 @@ export async function getEsCarModel(context) { "rtkType": "1", //1:车模 2:场地模型 "rspType": "0", //返回类型 "paraKdid": globalThis.timeInfo.paraKdid, //参数平台kdid - "examinationRoomId": globalThis.timeInfo.kdid, //考试平台kdid + "examinationRoomId": globalThis.tim*eInfo.kdid, //考试平台kdid // "carMac":"MAC-HCPAD-210", "carMac": globalThis.deviceNo } @@ -392,28 +392,27 @@ export async function upDataZhongxinginitialization(param) { return new Promise(async (resolve, reject) => { console.log('teststet00', JSON.stringify(param)) let flag = true - if (param.singlePlay) { - console.log('teststet0', JSON.stringify(param)) - const fileUtil = new FileUtil(param.context) - const tableList = ['MA_SYSSET', 'MA_SYSTEMPARM', 'MA_MARKRULE', 'MA_MARKRULESET', 'ES_CARINFO', 'MA_MAP_ROAD', 'MA_MAP_ROAD_LANE', 'MAP_SUBITEM', 'MA_T_CARPARMSET', 'MA_MAP_ITEMCLASS', 'MA_MAP_POINT', 'MA_MAP_POINT_ITEM']; - for (let i = 0; i <= tableList.length - 1; i++) { - const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + `/config/tableList/${tableList[i]}.txt`); - const result = await sqlInsertCommonFn(tableList[i], JSON.parse(data) || [], param.context) - - result ? (flag = true) : (flag = false) - } - console.log('teststet1', JSON.stringify(param)) - - if (!flag) { - prompt.showToast({ - message: '本地文件初始化数据库失败', - duration: 3000 - }); - } - console.log("init table1") - resolve(flag) - return - } + // if (param.singlePlay) { + // console.log('teststet0', JSON.stringify(param)) + // const fileUtil = new FileUtil(param.context) + // const tableList = ['MA_SYSSET', 'MA_SYSTEMPARM', 'MA_MARKRULE', 'MA_MARKRULESET', 'ES_CARINFO', 'MA_MAP_ROAD', 'MA_MAP_ROAD_LANE', 'MAP_SUBITEM', 'MA_T_CARPARMSET', 'MA_MAP_ITEMCLASS', 'MA_MAP_POINT', 'MA_MAP_POINT_ITEM']; + // for (let i = 0; i <= tableList.length - 1; i++) { + // const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + `/config/tableList/${tableList[i]}.txt`); + // const result = await sqlInsertCommonFn(tableList[i], JSON.parse(data) || [], param.context) + // result ? (flag = true) : (flag = false) + // } + // console.log('teststet1', JSON.stringify(param)) + // + // if (!flag) { + // prompt.showToast({ + // message: '本地文件初始化数据库失败', + // duration: 3000 + // }); + // } + // console.log("init table1") + // resolve(flag) + // return + // } if (!param.carId) { console.log("init table2") resolve(false) diff --git a/entry/src/main/ets/common/utils/GlobalUdp.ts b/entry/src/main/ets/common/utils/GlobalUdp.ts index 65d11ca0..2a4ed223 100644 --- a/entry/src/main/ets/common/utils/GlobalUdp.ts +++ b/entry/src/main/ets/common/utils/GlobalUdp.ts @@ -33,9 +33,10 @@ export async function getUDP(context, errorFlag?) { console.log('getUDPonMessage_1msgmsgByGloalUdp') }) globalThis.udpClient.onError_Callback(() => { + let onMessage_1 = globalThis.udpClient.onMessage_1 getUDP(context, true) - if (errorFlag && globalThis.udpClient && globalThis.udpClient.onMessage_1) { - globalThis.udpClient.onMessage_1 = globalThis.udpClient.onMessage_1 + if (errorFlag && globalThis.udpClient && onMessage_1) { + globalThis.udpClient.onMessage_1 = onMessage_1 } }) getChuankouFn() @@ -69,9 +70,10 @@ export async function getUDPGps2(context, errorFlag?) { console.log('getUDPGPS2 onMessage_1 MsgByGlobalUdpGPS2') }) globalThis.udpClientGps2.onError_Callback(() => { + let onMessage_1 = globalThis.udpClientGps2.onMessage_1 getUDPGps2(context, true) - if (errorFlag && globalThis.udpClientGps2 && globalThis.udpClientGps2.onMessage_1) { - globalThis.udpClientGps2.onMessage_1 = globalThis.udpClientGps2.onMessage_1 + if (errorFlag && globalThis.udpClientGps2 && onMessage_1) { + globalThis.udpClientGps2.onMessage_1 = onMessage_1 } }) resolve(`http://${result.centerIp}:${result.centerPort}`) @@ -98,9 +100,11 @@ export async function getUDP2(context, errorFlag?) { console.info('surenjun udp2=> ', globalThis.carInfo?.messagePort) udpClient2.bindUdp() udpClient2.onError_Callback(() => { + let onMessage_2 = globalThis.udpClient2.onMessage_2 + getUDP2(context, true); - if (errorFlag && globalThis.udpClient2 && globalThis.udpClient2.onMessage_2) { - globalThis.udpClient2.onMessage_2 = globalThis.udpClient2.onMessage_2 + if (errorFlag && globalThis.udpClient2 && onMessage_2) { + globalThis.udpClient2.onMessage_2 = onMessage_2 } }) if (!errorFlag) { diff --git a/entry/src/main/ets/common/utils/UdpClientByCenter.ts b/entry/src/main/ets/common/utils/UdpClientByCenter.ts index f26021ba..ed46a8fc 100644 --- a/entry/src/main/ets/common/utils/UdpClientByCenter.ts +++ b/entry/src/main/ets/common/utils/UdpClientByCenter.ts @@ -245,10 +245,8 @@ export default class UdpClientByCenter { //plc onMessage_1(callback?) { - console.log("udp onmessage") this.onMessage_1Callback = callback; this.udp?.on('message', (val) => { - console.log("udp receive", val) this.message_1Fn(val) }) } @@ -291,7 +289,6 @@ export default class UdpClientByCenter { globalThis.dialogOpen = false this.chafenFlag = 0 } - console.log("udp message", newArr.toString()) callback && callback(newArr.toString()) this.currentValue = newArr.toString(); } else { diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index d9e28185..1bd3dc83 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -68,8 +68,6 @@ export default class EntryAbility extends UIAbility { globalThis.context = this.context; globalThis.isJudgeInitBool = false console.info('jiangsong globalThis.pathDir = ' + globalThis.pathDir); - // this.requestPermission(this.context) - // this.featureAbilityAuth() const windowClass = await windowStage.getMainWindow(); globalThis.windowClass = windowClass diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index a46b48b9..7af78da4 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -93,6 +93,7 @@ struct Index { if (this.loading) { return } + this.loading = true const param = { carId: globalThis.carInfo?.carId, examinationRoomId: globalThis.carInfo?.examinationRoomId, @@ -106,7 +107,6 @@ struct Index { centerHost: globalThis.timeInfo?.url, singlePlay: globalThis.singlePlay } - this.loading = true getSingleCenterTable(param).then(async (ret) => { if (ret) { const result = await getSyncData('ES_CARINFO') @@ -365,6 +365,7 @@ struct Index { const result = await getSyncData('ES_CARINFO') const carInfo = result[0] || {}; if ((globalThis.isA1 && carInfo.kscx != "A1") || (globalThis.isA3 && carInfo.kscx != "A3")) { + console.log("lixiao 重新拉表") this.networkExam(true) return } diff --git a/entry/src/main/ets/pages/UserInfo.ets b/entry/src/main/ets/pages/UserInfo.ets index 0342e583..db4b2455 100644 --- a/entry/src/main/ets/pages/UserInfo.ets +++ b/entry/src/main/ets/pages/UserInfo.ets @@ -1261,77 +1261,80 @@ struct UserInfo { .margin({ left: 53 * this.ratio }) Column() { - imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.yydj_btn') }) - .margin({ bottom: 12 * this.ratio }) - .onClick(async () => { - if (globalThis.singlePlay) { + if (globalThis.singlePlay) { + imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.满分学习_nor') }) + .margin({ bottom: 12 * this.ratio }) + .onClick(async () => { await this.prePareExam(5) - } - }) - - imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.gx_btn') }) - .margin({ bottom: 12 * this.ratio }) - .onClick(async () => { - if (globalThis.singlePlay) { + }) + imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.增驾_nor') }) + .margin({ bottom: 12 * this.ratio }) + .onClick(async () => { await this.prePareExam(3) - } else { - // this.avPlayer.playAudio(['button_media.wav']) + }) + imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.夜考_nor') }) + .margin({ bottom: 12 * this.ratio }) + .onClick(async () => { + await this.prePareExam(2) + }) + imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.白考_nor') }) + .margin({ bottom: 12 * this.ratio }) + .onClick(async () => { + await this.prePareExam(1) + }) + } else { + imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.yydj_btn') }) + .margin({ bottom: 12 * this.ratio }) + .onClick(async () => { + globalThis.judgeUdp.askVoice() + }) + + imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.gx_btn') }) + .margin({ bottom: 12 * this.ratio }) + .onClick(async () => { if (this.isExamStart && !globalThis.singlePlay) { return } this.faceCompareSucess = 0 this.numCount = 0 this.getExaminationStudentInfoFn() - } - - }) - imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.qk_btn') }) - .margin({ bottom: 12 * this.ratio }) - .onClick(async () => { - if (globalThis.singlePlay) { - await this.prePareExam(2) - } else { - // this.avPlayer.playAudio(['button_media.wav']) + }) + imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.qk_btn') }) + .margin({ bottom: 12 * this.ratio }) + .onClick(async () => { // 已开始考试不能缺考 已考过一次学员不能缺考 车上不能缺考 if (this.ksksLimit || (this.systemParam.Param352Str == '1' && this.currentUser.kssycs == '1') || this.systemParam.Param770Str == '1') { return } this.ksksLimit = true this.qkFlag = true - } - }) - - if (this.isBoardPrePareSetPopupOpen && (this.isSecondBoardPrePareSetPopupOpen && this.currentUser.kssycs == '2') && !this.isFirstBoardPrePareSetPopupBtnShow) { - //上车准备 - // Image($r('app.media.sczb_btn')).commStyle() - imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.sczb_btn') }) - .margin({ bottom: 12 * this.ratio }) - .onClick(async () => { - if (globalThis.singlePlay) { - - } else { - if (this.systemParam.Param612Str == '1') { - return - } - await this.prePareSCZB() - } }) - } else { - // Image($r('app.media.ksks_btn')) - // .commStyle() - imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.ksks_btn') }) - .margin({ bottom: 12 * this.ratio }) - .onClick(async () => { - if (globalThis.singlePlay) { - await this.prePareExam(1) - } else { + + if (this.isBoardPrePareSetPopupOpen && (this.isSecondBoardPrePareSetPopupOpen && this.currentUser.kssycs == '2') && !this.isFirstBoardPrePareSetPopupBtnShow) { + imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.sczb_btn') }) + .margin({ bottom: 12 * this.ratio }) + .onClick(async () => { + if (globalThis.singlePlay) { + + } else { + if (this.systemParam.Param612Str == '1') { + return + } + await this.prePareSCZB() + } + }) + } else { + imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.ksks_btn') }) + .margin({ bottom: 12 * this.ratio }) + .onClick(async () => { if (this.systemParam.Param612Str == '1') { return } await this.prePareExam() - } - }) + }) + } } + } } diff --git a/entry/src/main/ets/pages/VehicleType.ets b/entry/src/main/ets/pages/VehicleType.ets index 73eeb347..0a91980c 100644 --- a/entry/src/main/ets/pages/VehicleType.ets +++ b/entry/src/main/ets/pages/VehicleType.ets @@ -48,42 +48,16 @@ struct Index { Column() { Row() { - Row() { - Text("A1").fontSize(126) - } - .backgroundColor("#e6e3df") - .borderRadius(30) - .width("20%") - .height("64%") - .justifyContent(FlexAlign.Center) - .shadow({ - radius: 64, - color: "#a5711a", - }) - .alignItems(VerticalAlign.Center) - .margin({ left: 80 * globalThis.ratio }) - .onClick(async () => { + imageBtn({ btnWidth: '28%', btnHeight: '71%', imgSrc: $r('app.media.A1-xz') }) + .margin({ right: 80 * globalThis.ratio }).onClick(async () => { globalThis.isA1 = true router.pushUrl({ url: 'pages/Index' }, router.RouterMode.Single); }) - Row() { - Text("A3").fontSize(126) - } - .backgroundColor("#e6e3df") - .borderRadius(30) - .width("20%") - .height("64%") - .justifyContent(FlexAlign.Center) - .shadow({ - radius: 64, - color: "#a5711a", - }) - .alignItems(VerticalAlign.Center) - .margin({ right: 80 * globalThis.ratio }) - .onClick(async () => { + imageBtn({ btnWidth: '28%', btnHeight: '71%', imgSrc: $r('app.media.A3_xz') }) + .margin({ right: 80 * globalThis.ratio }).onClick(async () => { globalThis.isA3 = true router.pushUrl({ url: 'pages/Index' diff --git a/entry/src/main/ets/pages/compontents/judge/RealTime.ets b/entry/src/main/ets/pages/compontents/judge/RealTime.ets index 6527fe36..f660f9b1 100644 --- a/entry/src/main/ets/pages/compontents/judge/RealTime.ets +++ b/entry/src/main/ets/pages/compontents/judge/RealTime.ets @@ -66,10 +66,6 @@ export default struct RealTime { Column() { if (this.draw) { Stack({ alignContent: Alignment.TopEnd }) { - Row() { - Text(this.version).margin({ right: 10 }).fontSize(14).fontColor(0x333333) - } - XComponent({ id: 'duolun_plugin_id_draw', //显示轨迹窗口id名称,注意这个ID要和C++侧一致,不能变 type: 'surface', @@ -85,9 +81,13 @@ export default struct RealTime { this.draw = false; clearInterval(globalThis.realTimer) }) + }.width(this.widthNumber) .height(this.heightNumber) + Row() { + Text(this.version).margin({ right: 10 }).fontSize(14).fontColor(0x333333) + } } else { Column() { } diff --git a/entry/src/main/ets/pages/judgeSDK/utils/judgeConfig.ts b/entry/src/main/ets/pages/judgeSDK/utils/judgeConfig.ts index 807fcdc7..76b90b73 100644 --- a/entry/src/main/ets/pages/judgeSDK/utils/judgeConfig.ts +++ b/entry/src/main/ets/pages/judgeSDK/utils/judgeConfig.ts @@ -1,7 +1,7 @@ //考试回放开关 export const judgeConfig = { // 外壳版本号 - version: "2025.05.13.01", + version: "2025.05.14.01", // 是否A1A3共用一车 isUseSameCar: true, //本地目录开关 diff --git a/entry/src/main/resources/base/media/A1-xz.png b/entry/src/main/resources/base/media/A1-xz.png new file mode 100644 index 00000000..97171f16 Binary files /dev/null and b/entry/src/main/resources/base/media/A1-xz.png differ diff --git a/entry/src/main/resources/base/media/A3_xz.png b/entry/src/main/resources/base/media/A3_xz.png new file mode 100644 index 00000000..5ad3f7eb Binary files /dev/null and b/entry/src/main/resources/base/media/A3_xz.png differ diff --git a/entry/src/main/resources/base/media/增驾_nor.png b/entry/src/main/resources/base/media/增驾_nor.png new file mode 100644 index 00000000..6c999b2e Binary files /dev/null and b/entry/src/main/resources/base/media/增驾_nor.png differ diff --git a/entry/src/main/resources/base/media/夜考_nor.png b/entry/src/main/resources/base/media/夜考_nor.png new file mode 100644 index 00000000..f05a829d Binary files /dev/null and b/entry/src/main/resources/base/media/夜考_nor.png differ diff --git a/entry/src/main/resources/base/media/满分学习_nor.png b/entry/src/main/resources/base/media/满分学习_nor.png new file mode 100644 index 00000000..e02e5a23 Binary files /dev/null and b/entry/src/main/resources/base/media/满分学习_nor.png differ diff --git a/entry/src/main/resources/base/media/白考_nor.png b/entry/src/main/resources/base/media/白考_nor.png new file mode 100644 index 00000000..5124cbb3 Binary files /dev/null and b/entry/src/main/resources/base/media/白考_nor.png differ