yy1717
2020-08-25 0701276b4fec856d5427e4776eec3cc7c56ec065
lib/src/main/cpp/test_items2/road_exam.cpp
@@ -411,7 +411,7 @@
        index = 0;
    }
    while (n++ < RoadMap.roads.size()) {
    while (n < RoadMap.roads.size()) {
        bool changeSegment = false;
        vector<PointF> roadOutLine;
        Polygon area;
@@ -453,6 +453,7 @@
        free(area.point);
        index = (index + 1) % RoadMap.roads.size();
        n++;
    }
    if (n >= RoadMap.roads.size()) {
@@ -924,12 +925,13 @@
        if (newLane.road == Lane.road && newLane.sep == Lane.sep) {
            gain = newLane.no - Lane.no;
        } else {
            DEBUG("车道分段切换");
            ChangeLane.gain = 0;
        }
        // 检查转向灯
        if (gain != 0) {
            DEBUG("变道 gain %d", gain);
            DEBUG("变道 new lane %d, gain %d", newLane.no, gain);
            car_sensor_value_t lamp = ReadCarSensorValue(TURN_SIGNAL_LAMP);
            if (lamp.name == TURN_SIGNAL_LAMP) {
                if (gain < 0) {
@@ -1209,6 +1211,19 @@
    return guide;
}
static void RingBreak(void)
{
    static int oldValue = BREAK_INACTIVE;
    car_sensor_value_t brk = ReadCarSensorValue(BREAK);
    if (brk.name == BREAK) {
        if (brk.value == BREAK_ACTIVE && oldValue != BREAK_ACTIVE) {
            PlayRing();
        }
        oldValue = brk.value;
    }
}
void TestRoadGeneral(road_exam_map &RoadMap, const car_model *car, LIST_CAR_MODEL &CarModelList, double speed, int moveDirect, const struct RtkTime *rtkTime)
{
    double BigStraightRoadFree = 0, RoadCrossingFree = 0, TargetFree = 0;
@@ -1216,6 +1231,9 @@
    UpdateCarSensor(rtkTime);
    UpdataOdo(speed, moveDirect, rtkTime);
    // 刹车提示音
    RingBreak();
    // 超速检测
    if (speed > MAX_SPEED) {
@@ -1536,7 +1554,7 @@
            if (RoadExamStatus == ROAD_EXAM_ITEM_CAR_START) {
                freeRunExceptDistance = 60.0;
            } else {
                freeRunExceptDistance = 200.0;
                freeRunExceptDistance = 250.0;
            }
            RoadExamStatus = ROAD_EXAM_FREE_RUN;