yy1717
2020-03-20 3a48a0de38910517352557510882f2ff4d8436ae
lib/src/main/cpp/test_items2/road_exam.cpp
@@ -10,6 +10,7 @@
#include "../defs.h"
#include "../test_common/car_sensor.h"
#include "../native-lib.h"
#include "through_something.h"
#include <vector>
#include <list>
@@ -400,14 +401,38 @@
    if (currExamMapIndex == -1) {
        currExamMapIndex = CrashTriggerLine(RoadMapList, car, CarModelList);
        if (currExamMapIndex != -1) {
            DEBUG("进入路考子地图 index = %d id = %d item = %d", currExamMapIndex, RoadMapList[currExamMapIndex].id, RoadMapList[currExamMapIndex].type);
            if (!RoadMapList[currExamMapIndex].tts.empty()) {
                PlayTTS(RoadMapList[currExamMapIndex].tts.c_str(), 0);
            }
            StartThroughExam(currExamMapIndex, RoadMapList);
        }
    } else {
    }
}
bool ExitSonArea(int index, LIST_ROAD_MAP &RoadMapList, const car_model *car)
{
    bool ret = false;
    if (index < 0 || index > RoadMapList.size())
        return true;
    if (RoadMapList[index].area.point != NULL) {
        // 需要车身全部离开
        Polygon carBody;
        carBody.num = car->bodyNum;
        carBody.point = (PointF *)malloc(carBody.num * sizeof(PointF));
        for (int i = 0; i < carBody.num; ++i) {
            carBody.point[i] = car->carXY[car->body[i]];
        }
        if (IntersectionOf(&carBody, &RoadMapList[index].area) == GM_None) {
            ret = true;
        }
        free(carBody.point);
    }
    return ret;
}
static void Rtk2DriveTimer(struct drive_timer &tm, const struct RtkTime *rtkTime)
@@ -494,7 +519,7 @@
    MakeLine(&rearAxle, &car->carXY[car->left_rear_tire[TIRE_OUTSIDE]], &car->carXY[car->right_rear_tire[TIRE_OUTSIDE]]);
    for (int i = 0; i < RoadMapList.size(); ++i) {
        if (RoadMapList[i].type == 100) {
        if (RoadMapList[i].type == GENERAL_MAP) {
            // 每条线都检测
            for (int j = 0; j < RoadMapList[i].redLineNum; ++j) {
@@ -536,7 +561,7 @@
    }
    for (int i = 0; i < RoadMapList.size(); ++i) {
        if (RoadMapList[i].type == 100) {
        if (RoadMapList[i].type == GENERAL_MAP) {
            // 每条红区都检测
            for (int j = 0; j < RoadMapList[i].redAreaNum; ++j) {
@@ -566,7 +591,7 @@
    MakeLine(&rearAxle, &car->carXY[car->left_rear_tire[TIRE_OUTSIDE]], &car->carXY[car->right_rear_tire[TIRE_OUTSIDE]]);
    for (int i = 0; i < RoadMapList.size(); ++i) {
        if (RoadMapList[i].type == 100) {
        if (RoadMapList[i].type == GENERAL_MAP) {
            // 每条线都检测
            for (int j = 0; j < RoadMapList[i].greenLineNum; ++j) {
@@ -621,7 +646,7 @@
    }
    for (int i = 0; i < RoadMapList.size(); ++i) {
        if (RoadMapList[i].type == 100) {
        if (RoadMapList[i].type == GENERAL_MAP) {
            // 每条线都检测
            for (int j = 0; j < RoadMapList[i].triggerLineNum; ++j) {