From 3a48a0de38910517352557510882f2ff4d8436ae Mon Sep 17 00:00:00 2001
From: yy1717 <fctom1215@outlook.com>
Date: 星期五, 20 三月 2020 18:05:55 +0800
Subject: [PATCH] 路考
---
lib/src/main/cpp/master/comm_if.cpp | 34 +++++++++++++++++++++++++++++++---
1 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/lib/src/main/cpp/master/comm_if.cpp b/lib/src/main/cpp/master/comm_if.cpp
index 9f52d64..cf9abe8 100644
--- a/lib/src/main/cpp/master/comm_if.cpp
+++ b/lib/src/main/cpp/master/comm_if.cpp
@@ -492,11 +492,15 @@
if (!doc.HasParseError()) {
CleanRoadMap();
+ DEBUG("寮�濮嬭В鏋愯矾鑰冨湴鍥�");
+
vector<double> mapPoints;
mapPoints.clear();
if (doc.HasMember("points")) {
const Value &s = doc["points"];
+
+ DEBUG("寰楀埌鎵�鏈夌偣");
// X-Y鍧愭爣闆嗗悎
for (Value::ConstValueIterator itr2 = s.Begin();
itr2 != s.End(); ++itr2) {
@@ -510,6 +514,8 @@
const Value &a = doc["maps"];
for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr) {
+
+ DEBUG("寰楀埌鍚勫瓙鍦板浘");
if (itr->IsObject()) {
// a Map
int id, type;
@@ -520,7 +526,11 @@
vector<vector<int>> greenLines;
vector<vector<int>> triggerLines;
vector<vector<int>> redAreas;
+ vector<int> area;
+ vector<int> stopLine;
+ stopLine.clear();
+ area.clear();
tts.clear();
redLines.clear();
greenLines.clear();
@@ -557,8 +567,8 @@
}
}
- if (itr->HasMember("trigger_line")) {
- const Value &s = (*itr)["trigger_line"];
+ if (itr->HasMember("all_trigger_line")) {
+ const Value &s = (*itr)["all_trigger_line"];
for (Value::ConstValueIterator itrLine = s.Begin();
itrLine != s.End(); ++itrLine) {
@@ -585,6 +595,24 @@
}
}
+ if (itr->HasMember("area")) {
+ const Value &s = (*itr)["area"];
+
+ for (Value::ConstValueIterator itrPoint = s.Begin();
+ itrPoint != s.End(); ++itrPoint) {
+ area.push_back((*itrPoint).GetInt());
+ }
+ }
+
+ if (itr->HasMember("stop_line")) {
+ const Value &s = (*itr)["stop_line"];
+
+ for (Value::ConstValueIterator itrPoint = s.Begin();
+ itrPoint != s.End(); ++itrPoint) {
+ stopLine.push_back((*itrPoint).GetInt());
+ }
+ }
+
if (itr->HasMember("id")) {
const Value &s = (*itr)["id"];
id = s.GetInt();
@@ -605,7 +633,7 @@
tts = s.GetString();
}
- AddRoadMapParent(id, type, tts, redLines, redAreas, greenLines, triggerLines);
+ AddRoadMapParent(id, type, tts, redLines, redAreas, greenLines, triggerLines, area, stopLine);
}
}
}
--
Gitblit v1.8.0