yy1717
2020-08-10 d9dc7419b35b7762bc5222cf874ccc39d2d66f43
lib/src/main/cpp/master/comm_if.cpp
@@ -808,7 +808,7 @@
                                MakeLine(&road.startLine, &p1, &p2);
                            }
                            if (itr->HasMember("stop_line")) {
                            /*if (itr->HasMember("stop_line")) {
                                const Value &a2 = (*itr)["stop_line"];
                                PointF p1, p2;
@@ -824,7 +824,52 @@
                                }
                                MakeLine(&road.stopLine, &p1, &p2);
                            }*/
                            if (itr->HasMember("crossing") && itr->IsArray()) {
                                const Value &a2 = (*itr)["crossing"];
                                vector<stop_line_t> crossing;
                                for (Value::ConstValueIterator itr2 = a2.Begin(); itr2 != a2.End(); ++itr2) {
                                    stop_line_t temp;
                                    if (!itr2->IsObject()) {
                                        break;
                                    }
                                    if (itr2->HasMember("active")) {
                                        const Value &s = (*itr2)["active"];
                                        temp.active = s.GetInt();
                                    }
                                    if (itr2->HasMember("stop_flag")) {
                                        const Value &s = (*itr2)["stop_flag"];
                                        temp.stopFlag = s.GetInt();
                                    }
                                    if (itr2->HasMember("tts")) {
                                        const Value &s = (*itr2)["tts"];
                                        temp.tts = s.GetString();
                                    }
                                    if (itr2->HasMember("line")) {
                                        const Value &s = (*itr2)["line"];
                                        PointF p1, p2;
                                        int n = 0;
                                        if (s.IsArray() && s.Size() >= 2) {
                                            for (Value::ConstValueIterator itr3 = s.Begin(); itr3 != s.End(); ++itr3, ++n) {
                                                if (n == 0) {
                                                    p1 = mapPoints[(*itr3).GetInt()];
                                                } else if (n == 1) {
                                                    p2 = mapPoints[(*itr3).GetInt()];
                                                }
                                            }
                                            MakeLine(&temp.line, &p1, &p2);
                                        }
                                    }
                                    crossing.push_back(temp);
                                }
                                road.stopLine.assign(crossing.begin(), crossing.end());
                            }
                            if (itr->HasMember("active")) {
                                const Value &s = (*itr)["active"];
                                DEBUG("路口动作 %d", s.GetInt());