Implemented 'skip_waypoints' for the 'Table' service.
This commit is contained in:
parent
600f48e15a
commit
660c0cc602
@ -2,11 +2,11 @@
|
|||||||
#define ENGINE_API_NEAREST_API_HPP
|
#define ENGINE_API_NEAREST_API_HPP
|
||||||
|
|
||||||
#include "engine/api/base_api.hpp"
|
#include "engine/api/base_api.hpp"
|
||||||
|
#include "engine/api/base_result.hpp"
|
||||||
#include "engine/api/nearest_parameters.hpp"
|
#include "engine/api/nearest_parameters.hpp"
|
||||||
|
|
||||||
#include "engine/api/json_factory.hpp"
|
#include "engine/api/json_factory.hpp"
|
||||||
#include "engine/phantom_node.hpp"
|
#include "engine/phantom_node.hpp"
|
||||||
#include "base_result.hpp"
|
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "extractor/maneuver_override.hpp"
|
#include "extractor/maneuver_override.hpp"
|
||||||
#include "engine/api/base_api.hpp"
|
#include "engine/api/base_api.hpp"
|
||||||
|
#include "engine/api/base_result.hpp"
|
||||||
#include "engine/api/json_factory.hpp"
|
#include "engine/api/json_factory.hpp"
|
||||||
#include "engine/api/route_parameters.hpp"
|
#include "engine/api/route_parameters.hpp"
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define ENGINE_API_TABLE_HPP
|
#define ENGINE_API_TABLE_HPP
|
||||||
|
|
||||||
#include "engine/api/base_api.hpp"
|
#include "engine/api/base_api.hpp"
|
||||||
|
#include "engine/api/base_result.hpp"
|
||||||
#include "engine/api/json_factory.hpp"
|
#include "engine/api/json_factory.hpp"
|
||||||
#include "engine/api/table_parameters.hpp"
|
#include "engine/api/table_parameters.hpp"
|
||||||
|
|
||||||
@ -83,24 +84,32 @@ class TableAPI final : public BaseAPI
|
|||||||
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<fbresult::Waypoint>>> sources;
|
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<fbresult::Waypoint>>> sources;
|
||||||
if (parameters.sources.empty())
|
if (parameters.sources.empty())
|
||||||
{
|
{
|
||||||
sources = MakeWaypoints(fb_result, phantoms);
|
if (!parameters.skip_waypoints) {
|
||||||
|
sources = MakeWaypoints(fb_result, phantoms);
|
||||||
|
}
|
||||||
number_of_sources = phantoms.size();
|
number_of_sources = phantoms.size();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sources = MakeWaypoints(fb_result, phantoms, parameters.sources);
|
if (!parameters.skip_waypoints) {
|
||||||
|
sources = MakeWaypoints(fb_result, phantoms, parameters.sources);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<fbresult::Waypoint>>>
|
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<fbresult::Waypoint>>>
|
||||||
destinations;
|
destinations;
|
||||||
if (parameters.destinations.empty())
|
if (parameters.destinations.empty())
|
||||||
{
|
{
|
||||||
destinations = MakeWaypoints(fb_result, phantoms);
|
if (!parameters.skip_waypoints) {
|
||||||
|
destinations = MakeWaypoints(fb_result, phantoms);
|
||||||
|
}
|
||||||
number_of_destinations = phantoms.size();
|
number_of_destinations = phantoms.size();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
destinations = MakeWaypoints(fb_result, phantoms, parameters.destinations);
|
if (!parameters.skip_waypoints) {
|
||||||
|
destinations = MakeWaypoints(fb_result, phantoms, parameters.destinations);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::optional<flatbuffers::Offset<flatbuffers::Vector<float>>> durations = boost::none;
|
boost::optional<flatbuffers::Offset<flatbuffers::Vector<float>>> durations = boost::none;
|
||||||
@ -162,22 +171,30 @@ class TableAPI final : public BaseAPI
|
|||||||
// symmetric case
|
// symmetric case
|
||||||
if (parameters.sources.empty())
|
if (parameters.sources.empty())
|
||||||
{
|
{
|
||||||
response.values["sources"] = MakeWaypoints(phantoms);
|
if (!parameters.skip_waypoints) {
|
||||||
|
response.values["sources"] = MakeWaypoints(phantoms);
|
||||||
|
}
|
||||||
number_of_sources = phantoms.size();
|
number_of_sources = phantoms.size();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
response.values["sources"] = MakeWaypoints(phantoms, parameters.sources);
|
if (!parameters.skip_waypoints) {
|
||||||
|
response.values["sources"] = MakeWaypoints(phantoms, parameters.sources);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parameters.destinations.empty())
|
if (parameters.destinations.empty())
|
||||||
{
|
{
|
||||||
response.values["destinations"] = MakeWaypoints(phantoms);
|
if (!parameters.skip_waypoints) {
|
||||||
|
response.values["destinations"] = MakeWaypoints(phantoms);
|
||||||
|
}
|
||||||
number_of_destinations = phantoms.size();
|
number_of_destinations = phantoms.size();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
response.values["destinations"] = MakeWaypoints(phantoms, parameters.destinations);
|
if (!parameters.skip_waypoints) {
|
||||||
|
response.values["destinations"] = MakeWaypoints(phantoms, parameters.destinations);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parameters.annotations & TableParameters::AnnotationsType::Duration)
|
if (parameters.annotations & TableParameters::AnnotationsType::Duration)
|
||||||
|
Loading…
Reference in New Issue
Block a user