From 748f3389919910920635ec1356b3564bd5e9fd45 Mon Sep 17 00:00:00 2001 From: fctom1215 <fctom1215@outlook.com> Date: 星期四, 27 八月 2020 17:06:00 +0800 Subject: [PATCH] 坐标 --- lib/src/main/cpp/test_items/stop_and_start.cpp | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/src/main/cpp/test_items/stop_and_start.cpp b/lib/src/main/cpp/test_items/stop_and_start.cpp index 81e1b92..6af91c7 100644 --- a/lib/src/main/cpp/test_items/stop_and_start.cpp +++ b/lib/src/main/cpp/test_items/stop_and_start.cpp @@ -43,7 +43,7 @@ static bool slideNormalDistance = false; static bool reportSlideFault = false; static bool reportStartTimeout = false; - +static bool handBreakActive = false; static bool CrashRedLine(const Polygon *map, const car_model *car); static double DistanceOfHead2Stopline(const Polygon *map, const car_model *car); static double DistanceOfTire2Edge(const Polygon *map, const car_model *car); @@ -66,6 +66,7 @@ slideNormalDistance = false; reportSlideFault = false; reportStartTimeout = false; + handBreakActive = false; MA_EnterMap(mapIndex, MAP_TYPE_STOP_START, 1); } @@ -103,6 +104,11 @@ if (prevMoveDirect != moveDirect) { if (moveDirect == 0) { stopTimepoint = TimeMakeComposite(rtkTime->hh, rtkTime->mm, rtkTime->ss, rtkTime->mss*10); + } else if (stopCar && !handBreakActive) { + // 妫�鏌ユ槸鍚︽媺浣忔墜鍒� + handBreakActive = true; + AddExamFault(19, rtkTime); + DEBUG("娌℃媺鎵嬪埞"); } prevMoveDirect = moveDirect; } else if (moveDirect == 0) { @@ -139,12 +145,10 @@ AddExamFault(18, rtkTime); DEBUG("璺濈杈圭嚎瓒呭嚭30鍘樼背"); } + } - // 妫�鏌ユ槸鍚︽媺浣忔墜鍒� - if (ReadCarStatus(HAND_BREAK) != BREAK_ACTIVE) { - AddExamFault(19, rtkTime); - DEBUG("娌℃媺鎵嬪埞"); - } + if (stopCar && !handBreakActive && ReadCarStatus(HAND_BREAK) == BREAK_ACTIVE) { + handBreakActive = true; } } -- Gitblit v1.8.0