fctom1215
2020-08-27 748f3389919910920635ec1356b3564bd5e9fd45
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;
        }
    }