1 #ifndef OSMSCOUT_CLIENT_QT_ROUTER_H 2 #define OSMSCOUT_CLIENT_QT_ROUTER_H 50 typedef std::function<void(size_t)> ProgressReporter;
55 std::chrono::system_clock::time_point lastDump;
57 ProgressReporter reporter;
60 explicit QtRoutingProgress(ProgressReporter reporter)
61 : lastDump(std::chrono::system_clock::now()),
63 reporter(std::move(reporter))
70 lastDump=std::chrono::system_clock::now();
74 void Progress(
const Distance ¤tMaxDistance,
75 const Distance &overallDistance)
77 double currentPercent=(currentMaxDistance.AsMeter()*100.0)/overallDistance.AsMeter();
79 std::chrono::system_clock::time_point now=std::chrono::system_clock::now();
81 maxPercent=std::max(maxPercent,currentPercent);
83 if (std::chrono::duration_cast<std::chrono::milliseconds>(now-lastDump).count()>100) {
85 reporter((
size_t)maxPercent);
96 osmscout::RouterParameter routerParameter;
125 void routeFailed(QString reason,
128 void routeCanceled(
int requestId);
130 void routingProgress(
int percent,
143 const osmscout::RoutePosition& start,
144 const osmscout::RoutePosition& target,
151 const std::string& start,
152 const std::string& target);
std::shared_ptr< Settings > SettingsRef
Definition: Settings.h:171
#define OSMSCOUT_CLIENT_QT_API
Definition: ClientQtImportExport.h:45
std::shared_ptr< LocationEntry > LocationEntryRef
Definition: LocationEntry.h:112
std::shared_ptr< Breaker > BreakerRef
Definition: Breaker.h:65
Definition: RoutingService.h:153
Vehicle
Definition: OSMScoutTypes.h:55
Definition: QtRouteData.h:40
std::shared_ptr< MultiDBRoutingService > MultiDBRoutingServiceRef
Definition: MultiDBRoutingService.h:154
Definition: RouteData.h:35
std::shared_ptr< QmlRoutingProfile > QmlRoutingProfileRef
Definition: QmlRoutingProfile.h:117
std::shared_ptr< DBThread > DBThreadRef
Definition: DBThread.h:239
Setup internal state of renderer for executing next steps with current projection and parameters...
Definition: MapPainter.h:57
Definition: Progress.h:34