From c484cbb09d445e2ab30ea011c6d2ffd87202bb26 Mon Sep 17 00:00:00 2001
From: yy1717 <fctom1215@outlook.com>
Date: 星期五, 23 十月 2020 18:05:34 +0800
Subject: [PATCH] 添加可用户配置的评判参数。
---
lib/src/main/cpp/test_items2/car_start.cpp | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/lib/src/main/cpp/test_items2/car_start.cpp b/lib/src/main/cpp/test_items2/car_start.cpp
index 9d0fb35..fdc3a59 100644
--- a/lib/src/main/cpp/test_items2/car_start.cpp
+++ b/lib/src/main/cpp/test_items2/car_start.cpp
@@ -13,10 +13,6 @@
#define DEBUG(fmt, args...) LOGD("<road_exam car_start> <%s>: " fmt, __func__, ##args)
-static const int MAX_ENGINE_RPM = 2500;
-static const double START_CAR_MOVE_DISTANCE = 10.0;
-static const double START_CAR_CHECK_DOOR_DISTANCE = 1.0;
-
static double startCarMoveDistance;
static bool checkEngineRPM, checkStartCarSignal, checkDoor, handBreakActive;
@@ -32,7 +28,7 @@
checkStartCarSignal = false;
checkDoor = false;
handBreakActive = false;
- PlayTTS("璇疯捣姝�", cb);
+ PlayTTS(examParam.start_car_begin_tts, cb);
DEBUG("杞﹁締璧锋");
}
@@ -61,7 +57,7 @@
}
}
- if (moveDistance > START_CAR_MOVE_DISTANCE) {
+ if (moveDistance > examParam.start_car_limit_distance) {
sensor = ReadCarSensorValue(HAND_BREAK);
if (sensor.name == HAND_BREAK && sensor.value == BREAK_ACTIVE) {
@@ -74,11 +70,11 @@
AddExamFault(26, rtkTime);
}
- PlayTTS("瀹屾垚璧锋", NULL);
+ PlayTTS(examParam.start_car_end_tts, NULL);
DEBUG("############# 瀹屾垚璧锋 ############");
return false;
- } else if (moveDistance >= START_CAR_CHECK_DOOR_DISTANCE) {
+ } else if (moveDistance >= examParam.open_door_drive_allow_distance) {
if (!checkDoor) {
checkDoor = true;
@@ -96,7 +92,7 @@
}
}
- if (ReadCarStatus(ENGINE_RPM) > MAX_ENGINE_RPM && !checkEngineRPM) {
+ if (ReadCarStatus(ENGINE_RPM) > examParam.start_car_max_rpm && !checkEngineRPM) {
// 杞�熻秴鏍囷紝涓嶅悎鏍�
DEBUG("杞�熻秴鏍�");
AddExamFault(29, rtkTime);
--
Gitblit v1.8.0