Browse Source

updated lib references; renaming and replacing calls dispatched to platform-sdk code

QGC4.4
jennerl 4 years ago committed by Don Gagne
parent
commit
587a8c67bc
  1. 12
      QGCExternalLibs.pri
  2. 2
      QGCPostLinkCommon.pri
  3. 6
      src/Airmap/qt/advisory.cpp
  4. 6
      src/Airmap/qt/aircrafts.cpp
  5. 4
      src/Airmap/qt/airspaces.cpp
  6. 6
      src/Airmap/qt/authenticator.cpp
  7. 2
      src/Airmap/qt/client.h
  8. 4
      src/Airmap/qt/dispatcher.cpp
  9. 2
      src/Airmap/qt/dispatcher.h
  10. 12
      src/Airmap/qt/flight_plans.cpp
  11. 18
      src/Airmap/qt/flights.cpp
  12. 18
      src/Airmap/qt/pilots.cpp
  13. 10
      src/Airmap/qt/rulesets.cpp
  14. 6
      src/Airmap/qt/status.cpp
  15. 2
      src/Airmap/qt/telemetry.cpp
  16. 2
      src/Airmap/qt/traffic.cpp

12
QGCExternalLibs.pri

@ -245,9 +245,9 @@ contains (DEFINES, DISABLE_AIRMAP) {
} }
} else:LinuxBuild { } else:LinuxBuild {
#-- Download and install platform-sdk libs and headers iff they're not already in the build directory #-- Download and install platform-sdk libs and headers iff they're not already in the build directory
AIRMAP_PLATFORM_SDK_URL = "https://github.com/airmap/platform-sdk/releases/download/2.0/airmap-platform-sdk-1.1.0-Linux.deb" AIRMAP_PLATFORM_SDK_URL = "https://github.com/airmap/platform-sdk/releases/download/2.0/airmap-platform-sdk-2.0.0-Linux.deb"
AIRMAP_PLATFORM_SDK_FILENAME = "airmap-platform-sdk.deb" AIRMAP_PLATFORM_SDK_FILENAME = "airmap-platform-sdk.deb"
AIRMAP_PLATFORM_SDK_INSTALL_PREFIX = "airmap-platform-sdk" AIRMAP_PLATFORM_SDK_INSTALL_DIR = "tmp"
airmap_platform_sdk_install.target = $${AIRMAP_PLATFORM_SDK_PATH}/include/airmap airmap_platform_sdk_install.target = $${AIRMAP_PLATFORM_SDK_PATH}/include/airmap
airmap_platform_sdk_install.commands = \ airmap_platform_sdk_install.commands = \
@ -256,15 +256,15 @@ contains (DEFINES, DISABLE_AIRMAP) {
mkdir -p "$${AIRMAP_PLATFORM_SDK_PATH}/include/airmap" && \ mkdir -p "$${AIRMAP_PLATFORM_SDK_PATH}/include/airmap" && \
wget -q -O "$${OUT_PWD}/$${AIRMAP_PLATFORM_SDK_FILENAME}" "$${AIRMAP_PLATFORM_SDK_URL}" && \ wget -q -O "$${OUT_PWD}/$${AIRMAP_PLATFORM_SDK_FILENAME}" "$${AIRMAP_PLATFORM_SDK_URL}" && \
ar p "$${AIRMAP_PLATFORM_SDK_FILENAME}" data.tar.gz | tar xvz -C "$${AIRMAP_PLATFORM_SDK_PATH}/" --strip-components=1 && \ ar p "$${AIRMAP_PLATFORM_SDK_FILENAME}" data.tar.gz | tar xvz -C "$${AIRMAP_PLATFORM_SDK_PATH}/" --strip-components=1 && \
mv -u "$${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}/lib/x86_64-linux-gnu/*" "$${AIRMAP_PLATFORM_SDK_PATH}/linux/$${AIRMAP_QT_PATH}/" && \ mv -u "$${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_DIR}/usr/lib/x86_64-linux-gnu/*" "$${AIRMAP_PLATFORM_SDK_PATH}/linux/$${AIRMAP_QT_PATH}/" && \
mv -u "$${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}/include/airmap/*" "$${AIRMAP_PLATFORM_SDK_PATH}/include/airmap/" && \ mv -u "$${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_DIR}/usr/include/airmap/*" "$${AIRMAP_PLATFORM_SDK_PATH}/include/airmap/" && \
rm -rf "$${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}" && \ rm -rf "$${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_DIR}" && \
rm "$${AIRMAP_PLATFORM_SDK_FILENAME}" rm "$${AIRMAP_PLATFORM_SDK_FILENAME}"
airmap_platform_sdk_install.depends = airmap_platform_sdk_install.depends =
QMAKE_EXTRA_TARGETS += airmap_platform_sdk_install QMAKE_EXTRA_TARGETS += airmap_platform_sdk_install
PRE_TARGETDEPS += $$airmap_platform_sdk_install.target PRE_TARGETDEPS += $$airmap_platform_sdk_install.target
LIBS += -L$${AIRMAP_PLATFORM_SDK_PATH}/linux/$${AIRMAP_QT_PATH} -lairmap-qt LIBS += -L$${AIRMAP_PLATFORM_SDK_PATH}/linux/$${AIRMAP_QT_PATH} -lairmap-cpp
DEFINES += QGC_AIRMAP_ENABLED DEFINES += QGC_AIRMAP_ENABLED
} else { } else {
message("Skipping support for Airmap (unsupported platform)") message("Skipping support for Airmap (unsupported platform)")

2
QGCPostLinkCommon.pri

@ -147,7 +147,7 @@ LinuxBuild {
# Airmap # Airmap
contains (DEFINES, QGC_AIRMAP_ENABLED) { contains (DEFINES, QGC_AIRMAP_ENABLED) {
QMAKE_POST_LINK += && $$QMAKE_COPY $$OUT_PWD/libs/airmap-platform-sdk/linux/$$AIRMAP_QT_PATH/libairmap-qt.so.1.1.0 $$DESTDIR/Qt/libs/ QMAKE_POST_LINK += && $$QMAKE_COPY $$OUT_PWD/libs/airmap-platform-sdk/linux/$$AIRMAP_QT_PATH/libairmap-cpp.so.2.0.0 $$DESTDIR/Qt/libs/
} }
# QGroundControl start script # QGroundControl start script

6
src/Airmap/qt/advisory.cpp

@ -23,7 +23,7 @@ airmap::qt::Advisory::Advisory(const std::shared_ptr<Dispatcher>& dispatcher,
} }
void airmap::qt::Advisory::for_id(const ForId::Parameters& parameters, const ForId::Callback& cb) { void airmap::qt::Advisory::for_id(const ForId::Parameters& parameters, const ForId::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->advisory().for_id(parameters, [this, sp, cb](const auto& result) { sp->client_->advisory().for_id(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -31,7 +31,7 @@ void airmap::qt::Advisory::for_id(const ForId::Parameters& parameters, const For
} }
void airmap::qt::Advisory::search(const Search::Parameters& parameters, const Search::Callback& cb) { void airmap::qt::Advisory::search(const Search::Parameters& parameters, const Search::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->advisory().search(parameters, [this, sp, cb](const auto& result) { sp->client_->advisory().search(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -40,7 +40,7 @@ void airmap::qt::Advisory::search(const Search::Parameters& parameters, const Se
void airmap::qt::Advisory::report_weather(const ReportWeather::Parameters& parameters, void airmap::qt::Advisory::report_weather(const ReportWeather::Parameters& parameters,
const ReportWeather::Callback& cb) { const ReportWeather::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->advisory().report_weather(parameters, [this, sp, cb](const auto& result) { sp->client_->advisory().report_weather(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });

6
src/Airmap/qt/aircrafts.cpp

@ -24,7 +24,7 @@ airmap::qt::Aircrafts::Aircrafts(const std::shared_ptr<Dispatcher>& dispatcher,
void airmap::qt::Aircrafts::manufacturers(const Manufacturers::Parameters& parameters, void airmap::qt::Aircrafts::manufacturers(const Manufacturers::Parameters& parameters,
const Manufacturers::Callback& cb) { const Manufacturers::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->aircrafts().manufacturers(parameters, [this, sp, cb](const auto& result) { sp->client_->aircrafts().manufacturers(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -32,7 +32,7 @@ void airmap::qt::Aircrafts::manufacturers(const Manufacturers::Parameters& param
} }
void airmap::qt::Aircrafts::models(const Models::Parameters& parameters, const Models::Callback& cb) { void airmap::qt::Aircrafts::models(const Models::Parameters& parameters, const Models::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->aircrafts().models(parameters, [this, sp, cb](const auto& result) { sp->client_->aircrafts().models(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -40,7 +40,7 @@ void airmap::qt::Aircrafts::models(const Models::Parameters& parameters, const M
} }
void airmap::qt::Aircrafts::model_for_id(const ModelForId::Parameters& parameters, const ModelForId::Callback& cb) { void airmap::qt::Aircrafts::model_for_id(const ModelForId::Parameters& parameters, const ModelForId::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->aircrafts().model_for_id(parameters, [this, sp, cb](const auto& result) { sp->client_->aircrafts().model_for_id(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });

4
src/Airmap/qt/airspaces.cpp

@ -23,7 +23,7 @@ airmap::qt::Airspaces::Airspaces(const std::shared_ptr<Dispatcher>& dispatcher,
} }
void airmap::qt::Airspaces::search(const Search::Parameters& parameters, const Search::Callback& cb) { void airmap::qt::Airspaces::search(const Search::Parameters& parameters, const Search::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->airspaces().search(parameters, [this, sp, cb](const auto& result) { sp->client_->airspaces().search(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -31,7 +31,7 @@ void airmap::qt::Airspaces::search(const Search::Parameters& parameters, const S
} }
void airmap::qt::Airspaces::for_ids(const ForIds::Parameters& parameters, const ForIds::Callback& cb) { void airmap::qt::Airspaces::for_ids(const ForIds::Parameters& parameters, const ForIds::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->airspaces().for_ids(parameters, [this, sp, cb](const auto& result) { sp->client_->airspaces().for_ids(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });

6
src/Airmap/qt/authenticator.cpp

@ -24,7 +24,7 @@ airmap::qt::Authenticator::Authenticator(const std::shared_ptr<Dispatcher>& disp
void airmap::qt::Authenticator::authenticate_with_password(const AuthenticateWithPassword::Params& parameters, void airmap::qt::Authenticator::authenticate_with_password(const AuthenticateWithPassword::Params& parameters,
const AuthenticateWithPassword::Callback& cb) { const AuthenticateWithPassword::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->authenticator().authenticate_with_password(parameters, [this, sp, cb](const auto& result) { sp->client_->authenticator().authenticate_with_password(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -33,7 +33,7 @@ void airmap::qt::Authenticator::authenticate_with_password(const AuthenticateWit
void airmap::qt::Authenticator::authenticate_anonymously(const AuthenticateAnonymously::Params& parameters, void airmap::qt::Authenticator::authenticate_anonymously(const AuthenticateAnonymously::Params& parameters,
const AuthenticateAnonymously::Callback& cb) { const AuthenticateAnonymously::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->authenticator().authenticate_anonymously(parameters, [this, sp, cb](const auto& result) { sp->client_->authenticator().authenticate_anonymously(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -42,7 +42,7 @@ void airmap::qt::Authenticator::authenticate_anonymously(const AuthenticateAnony
void airmap::qt::Authenticator::renew_authentication(const RenewAuthentication::Params& parameters, void airmap::qt::Authenticator::renew_authentication(const RenewAuthentication::Params& parameters,
const RenewAuthentication::Callback& cb) { const RenewAuthentication::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->authenticator().renew_authentication(parameters, [this, sp, cb](const auto& result) { sp->client_->authenticator().renew_authentication(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });

2
src/Airmap/qt/client.h

@ -45,7 +45,7 @@ class AIRMAP_EXPORT Client : public QObject, public airmap::Client {
static void create(const Client::Configuration& configuration, const std::shared_ptr<Logger>& logger, QObject* parent, static void create(const Client::Configuration& configuration, const std::shared_ptr<Logger>& logger, QObject* parent,
const CreateCallback& cb); const CreateCallback& cb);
~Client(); ~Client() override;
// From airmap::Client // From airmap::Client
Authenticator& authenticator() override; Authenticator& authenticator() override;

4
src/Airmap/qt/dispatcher.cpp

@ -68,7 +68,7 @@ airmap::qt::Dispatcher::ToNative::ToNative(const std::shared_ptr<Context>& conte
} }
void airmap::qt::Dispatcher::ToNative::dispatch(const Task& task) { void airmap::qt::Dispatcher::ToNative::dispatch(const Task& task) {
context_->dispatch(task); context_->schedule_in(task);
} }
airmap::qt::Dispatcher::Dispatcher(const std::shared_ptr<Context>& context) airmap::qt::Dispatcher::Dispatcher(const std::shared_ptr<Context>& context)
@ -79,7 +79,7 @@ void airmap::qt::Dispatcher::dispatch_to_qt(const std::function<void()>& task) {
to_qt_->dispatch(task); to_qt_->dispatch(task);
} }
void airmap::qt::Dispatcher::dispatch_to_native(const std::function<void()>& task) { void airmap::qt::Dispatcher::dispatch_to_airmap(const std::function<void()>& task) {
to_native_->dispatch(task); to_native_->dispatch(task);
} }

2
src/Airmap/qt/dispatcher.h

@ -62,7 +62,7 @@ class Dispatcher : public QObject {
explicit Dispatcher(const std::shared_ptr<Context>& context); explicit Dispatcher(const std::shared_ptr<Context>& context);
void dispatch_to_qt(const Task& task); void dispatch_to_qt(const Task& task);
void dispatch_to_native(const Task& task); void dispatch_to_airmap(const Task& task);
private: private:
std::shared_ptr<ToQt> to_qt_; std::shared_ptr<ToQt> to_qt_;

12
src/Airmap/qt/flight_plans.cpp

@ -23,7 +23,7 @@ airmap::qt::FlightPlans::FlightPlans(const std::shared_ptr<Dispatcher>& dispatch
} }
void airmap::qt::FlightPlans::for_id(const ForId::Parameters& parameters, const ForId::Callback& cb) { void airmap::qt::FlightPlans::for_id(const ForId::Parameters& parameters, const ForId::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->flight_plans().for_id(parameters, [this, sp, cb](const auto& result) { sp->client_->flight_plans().for_id(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -31,7 +31,7 @@ void airmap::qt::FlightPlans::for_id(const ForId::Parameters& parameters, const
} }
void airmap::qt::FlightPlans::create_by_polygon(const Create::Parameters& parameters, const Create::Callback& cb) { void airmap::qt::FlightPlans::create_by_polygon(const Create::Parameters& parameters, const Create::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->flight_plans().create_by_polygon(parameters, [this, sp, cb](const auto& result) { sp->client_->flight_plans().create_by_polygon(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -39,7 +39,7 @@ void airmap::qt::FlightPlans::create_by_polygon(const Create::Parameters& parame
} }
void airmap::qt::FlightPlans::update(const Update::Parameters& parameters, const Update::Callback& cb) { void airmap::qt::FlightPlans::update(const Update::Parameters& parameters, const Update::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->flight_plans().update(parameters, [this, sp, cb](const auto& result) { sp->client_->flight_plans().update(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -47,7 +47,7 @@ void airmap::qt::FlightPlans::update(const Update::Parameters& parameters, const
} }
void airmap::qt::FlightPlans::delete_(const Delete::Parameters& parameters, const Delete::Callback& cb) { void airmap::qt::FlightPlans::delete_(const Delete::Parameters& parameters, const Delete::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->flight_plans().delete_(parameters, [this, sp, cb](const auto& result) { sp->client_->flight_plans().delete_(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -56,7 +56,7 @@ void airmap::qt::FlightPlans::delete_(const Delete::Parameters& parameters, cons
void airmap::qt::FlightPlans::render_briefing(const RenderBriefing::Parameters& parameters, void airmap::qt::FlightPlans::render_briefing(const RenderBriefing::Parameters& parameters,
const RenderBriefing::Callback& cb) { const RenderBriefing::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->flight_plans().render_briefing(parameters, [this, sp, cb](const auto& result) { sp->client_->flight_plans().render_briefing(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -64,7 +64,7 @@ void airmap::qt::FlightPlans::render_briefing(const RenderBriefing::Parameters&
} }
void airmap::qt::FlightPlans::submit(const Submit::Parameters& parameters, const Submit::Callback& cb) { void airmap::qt::FlightPlans::submit(const Submit::Parameters& parameters, const Submit::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->flight_plans().submit(parameters, [this, sp, cb](const auto& result) { sp->client_->flight_plans().submit(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });

18
src/Airmap/qt/flights.cpp

@ -23,7 +23,7 @@ airmap::qt::Flights::Flights(const std::shared_ptr<Dispatcher>& dispatcher,
} }
void airmap::qt::Flights::search(const Search::Parameters& parameters, const Search::Callback& cb) { void airmap::qt::Flights::search(const Search::Parameters& parameters, const Search::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->flights().search(parameters, [this, sp, cb](const auto& result) { sp->client_->flights().search(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -31,7 +31,7 @@ void airmap::qt::Flights::search(const Search::Parameters& parameters, const Sea
} }
void airmap::qt::Flights::for_id(const ForId::Parameters& parameters, const ForId::Callback& cb) { void airmap::qt::Flights::for_id(const ForId::Parameters& parameters, const ForId::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->flights().for_id(parameters, [this, sp, cb](const auto& result) { sp->client_->flights().for_id(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -40,7 +40,7 @@ void airmap::qt::Flights::for_id(const ForId::Parameters& parameters, const ForI
void airmap::qt::Flights::create_flight_by_point(const CreateFlight::Parameters& parameters, void airmap::qt::Flights::create_flight_by_point(const CreateFlight::Parameters& parameters,
const CreateFlight::Callback& cb) { const CreateFlight::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->flights().create_flight_by_point(parameters, [this, sp, cb](const auto& result) { sp->client_->flights().create_flight_by_point(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -49,7 +49,7 @@ void airmap::qt::Flights::create_flight_by_point(const CreateFlight::Parameters&
void airmap::qt::Flights::create_flight_by_path(const CreateFlight::Parameters& parameters, void airmap::qt::Flights::create_flight_by_path(const CreateFlight::Parameters& parameters,
const CreateFlight::Callback& cb) { const CreateFlight::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->flights().create_flight_by_path(parameters, [this, sp, cb](const auto& result) { sp->client_->flights().create_flight_by_path(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -58,7 +58,7 @@ void airmap::qt::Flights::create_flight_by_path(const CreateFlight::Parameters&
void airmap::qt::Flights::create_flight_by_polygon(const CreateFlight::Parameters& parameters, void airmap::qt::Flights::create_flight_by_polygon(const CreateFlight::Parameters& parameters,
const CreateFlight::Callback& cb) { const CreateFlight::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->flights().create_flight_by_polygon(parameters, [this, sp, cb](const auto& result) { sp->client_->flights().create_flight_by_polygon(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -66,7 +66,7 @@ void airmap::qt::Flights::create_flight_by_polygon(const CreateFlight::Parameter
} }
void airmap::qt::Flights::end_flight(const EndFlight::Parameters& parameters, const EndFlight::Callback& cb) { void airmap::qt::Flights::end_flight(const EndFlight::Parameters& parameters, const EndFlight::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->flights().end_flight(parameters, [this, sp, cb](const auto& result) { sp->client_->flights().end_flight(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -74,7 +74,7 @@ void airmap::qt::Flights::end_flight(const EndFlight::Parameters& parameters, co
} }
void airmap::qt::Flights::delete_flight(const DeleteFlight::Parameters& parameters, const DeleteFlight::Callback& cb) { void airmap::qt::Flights::delete_flight(const DeleteFlight::Parameters& parameters, const DeleteFlight::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->flights().delete_flight(parameters, [this, sp, cb](const auto& result) { sp->client_->flights().delete_flight(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -83,7 +83,7 @@ void airmap::qt::Flights::delete_flight(const DeleteFlight::Parameters& paramete
void airmap::qt::Flights::start_flight_communications(const StartFlightCommunications::Parameters& parameters, void airmap::qt::Flights::start_flight_communications(const StartFlightCommunications::Parameters& parameters,
const StartFlightCommunications::Callback& cb) { const StartFlightCommunications::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->flights().start_flight_communications(parameters, [this, sp, cb](const auto& result) { sp->client_->flights().start_flight_communications(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -92,7 +92,7 @@ void airmap::qt::Flights::start_flight_communications(const StartFlightCommunica
void airmap::qt::Flights::end_flight_communications(const EndFlightCommunications::Parameters& parameters, void airmap::qt::Flights::end_flight_communications(const EndFlightCommunications::Parameters& parameters,
const EndFlightCommunications::Callback& cb) { const EndFlightCommunications::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->flights().end_flight_communications(parameters, [this, sp, cb](const auto& result) { sp->client_->flights().end_flight_communications(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });

18
src/Airmap/qt/pilots.cpp

@ -22,7 +22,7 @@ airmap::qt::Pilots::Pilots(const std::shared_ptr<Dispatcher>& dispatcher, const
} }
void airmap::qt::Pilots::authenticated(const Authenticated::Parameters& parameters, const Authenticated::Callback& cb) { void airmap::qt::Pilots::authenticated(const Authenticated::Parameters& parameters, const Authenticated::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->pilots().authenticated(parameters, [this, sp, cb](const auto& result) { sp->client_->pilots().authenticated(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -30,7 +30,7 @@ void airmap::qt::Pilots::authenticated(const Authenticated::Parameters& paramete
} }
void airmap::qt::Pilots::for_id(const ForId::Parameters& parameters, const ForId::Callback& cb) { void airmap::qt::Pilots::for_id(const ForId::Parameters& parameters, const ForId::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->pilots().for_id(parameters, [this, sp, cb](const auto& result) { sp->client_->pilots().for_id(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -38,7 +38,7 @@ void airmap::qt::Pilots::for_id(const ForId::Parameters& parameters, const ForId
} }
void airmap::qt::Pilots::update_for_id(const UpdateForId::Parameters& parameters, const UpdateForId::Callback& cb) { void airmap::qt::Pilots::update_for_id(const UpdateForId::Parameters& parameters, const UpdateForId::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->pilots().update_for_id(parameters, [this, sp, cb](const auto& result) { sp->client_->pilots().update_for_id(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -47,7 +47,7 @@ void airmap::qt::Pilots::update_for_id(const UpdateForId::Parameters& parameters
void airmap::qt::Pilots::start_verify_pilot_phone_for_id(const StartVerifyPilotPhoneForId::Parameters& parameters, void airmap::qt::Pilots::start_verify_pilot_phone_for_id(const StartVerifyPilotPhoneForId::Parameters& parameters,
const StartVerifyPilotPhoneForId::Callback& cb) { const StartVerifyPilotPhoneForId::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->pilots().start_verify_pilot_phone_for_id(parameters, [this, sp, cb](const auto& result) { sp->client_->pilots().start_verify_pilot_phone_for_id(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -56,7 +56,7 @@ void airmap::qt::Pilots::start_verify_pilot_phone_for_id(const StartVerifyPilotP
void airmap::qt::Pilots::finish_verify_pilot_phone_for_id(const FinishVerifyPilotPhoneForId::Parameters& parameters, void airmap::qt::Pilots::finish_verify_pilot_phone_for_id(const FinishVerifyPilotPhoneForId::Parameters& parameters,
const FinishVerifyPilotPhoneForId::Callback& cb) { const FinishVerifyPilotPhoneForId::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->pilots().finish_verify_pilot_phone_for_id(parameters, [this, sp, cb](const auto& result) { sp->client_->pilots().finish_verify_pilot_phone_for_id(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -64,7 +64,7 @@ void airmap::qt::Pilots::finish_verify_pilot_phone_for_id(const FinishVerifyPilo
} }
void airmap::qt::Pilots::aircrafts(const Aircrafts::Parameters& parameters, const Aircrafts::Callback& cb) { void airmap::qt::Pilots::aircrafts(const Aircrafts::Parameters& parameters, const Aircrafts::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->pilots().aircrafts(parameters, [this, sp, cb](const auto& result) { sp->client_->pilots().aircrafts(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -72,7 +72,7 @@ void airmap::qt::Pilots::aircrafts(const Aircrafts::Parameters& parameters, cons
} }
void airmap::qt::Pilots::add_aircraft(const AddAircraft::Parameters& parameters, const AddAircraft::Callback& cb) { void airmap::qt::Pilots::add_aircraft(const AddAircraft::Parameters& parameters, const AddAircraft::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->pilots().add_aircraft(parameters, [this, sp, cb](const auto& result) { sp->client_->pilots().add_aircraft(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -81,7 +81,7 @@ void airmap::qt::Pilots::add_aircraft(const AddAircraft::Parameters& parameters,
void airmap::qt::Pilots::delete_aircraft(const DeleteAircraft::Parameters& parameters, void airmap::qt::Pilots::delete_aircraft(const DeleteAircraft::Parameters& parameters,
const DeleteAircraft::Callback& cb) { const DeleteAircraft::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->pilots().delete_aircraft(parameters, [this, sp, cb](const auto& result) { sp->client_->pilots().delete_aircraft(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -90,7 +90,7 @@ void airmap::qt::Pilots::delete_aircraft(const DeleteAircraft::Parameters& param
void airmap::qt::Pilots::update_aircraft(const UpdateAircraft::Parameters& parameters, void airmap::qt::Pilots::update_aircraft(const UpdateAircraft::Parameters& parameters,
const UpdateAircraft::Callback& cb) { const UpdateAircraft::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->pilots().update_aircraft(parameters, [this, sp, cb](const auto& result) { sp->client_->pilots().update_aircraft(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });

10
src/Airmap/qt/rulesets.cpp

@ -23,7 +23,7 @@ airmap::qt::RuleSets::RuleSets(const std::shared_ptr<Dispatcher>& dispatcher,
} }
void airmap::qt::RuleSets::search(const Search::Parameters& parameters, const Search::Callback& cb) { void airmap::qt::RuleSets::search(const Search::Parameters& parameters, const Search::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->rulesets().search(parameters, [this, sp, cb](const auto& result) { sp->client_->rulesets().search(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -31,7 +31,7 @@ void airmap::qt::RuleSets::search(const Search::Parameters& parameters, const Se
} }
void airmap::qt::RuleSets::for_id(const ForId::Parameters& parameters, const ForId::Callback& cb) { void airmap::qt::RuleSets::for_id(const ForId::Parameters& parameters, const ForId::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->rulesets().for_id(parameters, [this, sp, cb](const auto& result) { sp->client_->rulesets().for_id(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -39,7 +39,7 @@ void airmap::qt::RuleSets::for_id(const ForId::Parameters& parameters, const For
} }
void airmap::qt::RuleSets::fetch_rules(const FetchRules::Parameters& parameters, const FetchRules::Callback& cb) { void airmap::qt::RuleSets::fetch_rules(const FetchRules::Parameters& parameters, const FetchRules::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->rulesets().fetch_rules(parameters, [this, sp, cb](const auto& result) { sp->client_->rulesets().fetch_rules(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -48,7 +48,7 @@ void airmap::qt::RuleSets::fetch_rules(const FetchRules::Parameters& parameters,
void airmap::qt::RuleSets::evaluate_rulesets(const EvaluateRules::Parameters& parameters, void airmap::qt::RuleSets::evaluate_rulesets(const EvaluateRules::Parameters& parameters,
const EvaluateRules::Callback& cb) { const EvaluateRules::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->rulesets().evaluate_rulesets(parameters, [this, sp, cb](const auto& result) { sp->client_->rulesets().evaluate_rulesets(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -57,7 +57,7 @@ void airmap::qt::RuleSets::evaluate_rulesets(const EvaluateRules::Parameters& pa
void airmap::qt::RuleSets::evaluate_flight_plan(const EvaluateFlightPlan::Parameters& parameters, void airmap::qt::RuleSets::evaluate_flight_plan(const EvaluateFlightPlan::Parameters& parameters,
const EvaluateFlightPlan::Callback& cb) { const EvaluateFlightPlan::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->rulesets().evaluate_flight_plan(parameters, [this, sp, cb](const auto& result) { sp->client_->rulesets().evaluate_flight_plan(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });

6
src/Airmap/qt/status.cpp

@ -22,7 +22,7 @@ airmap::qt::Status::Status(const std::shared_ptr<Dispatcher>& dispatcher, const
} }
void airmap::qt::Status::get_status_by_point(const GetStatus::Parameters& parameters, const GetStatus::Callback& cb) { void airmap::qt::Status::get_status_by_point(const GetStatus::Parameters& parameters, const GetStatus::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->status().get_status_by_point(parameters, [this, sp, cb](const auto& result) { sp->client_->status().get_status_by_point(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -30,7 +30,7 @@ void airmap::qt::Status::get_status_by_point(const GetStatus::Parameters& parame
} }
void airmap::qt::Status::get_status_by_path(const GetStatus::Parameters& parameters, const GetStatus::Callback& cb) { void airmap::qt::Status::get_status_by_path(const GetStatus::Parameters& parameters, const GetStatus::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->status().get_status_by_path(parameters, [this, sp, cb](const auto& result) { sp->client_->status().get_status_by_path(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });
@ -38,7 +38,7 @@ void airmap::qt::Status::get_status_by_path(const GetStatus::Parameters& paramet
} }
void airmap::qt::Status::get_status_by_polygon(const GetStatus::Parameters& parameters, const GetStatus::Callback& cb) { void airmap::qt::Status::get_status_by_polygon(const GetStatus::Parameters& parameters, const GetStatus::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->status().get_status_by_polygon(parameters, [this, sp, cb](const auto& result) { sp->client_->status().get_status_by_polygon(parameters, [this, sp, cb](const auto& result) {
sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); sp->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); });
}); });

2
src/Airmap/qt/telemetry.cpp

@ -26,7 +26,7 @@ airmap::qt::Telemetry::Telemetry(const std::shared_ptr<Dispatcher>& dispatcher,
void airmap::qt::Telemetry::submit_updates(const Flight& flight, const std::string& key, void airmap::qt::Telemetry::submit_updates(const Flight& flight, const std::string& key,
const std::initializer_list<Update>& updates) { const std::initializer_list<Update>& updates) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), flight, key, updates]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), flight, key, updates]() {
sp->client_->telemetry().submit_updates(flight, key, updates); sp->client_->telemetry().submit_updates(flight, key, updates);
}); });
} }

2
src/Airmap/qt/traffic.cpp

@ -49,7 +49,7 @@ airmap::qt::Traffic::Traffic(const std::shared_ptr<Dispatcher>& dispatcher,
} }
void airmap::qt::Traffic::monitor(const Monitor::Params& parameters, const Monitor::Callback& cb) { void airmap::qt::Traffic::monitor(const Monitor::Params& parameters, const Monitor::Callback& cb) {
dispatcher_->dispatch_to_native([this, sp = shared_from_this(), parameters, cb]() { dispatcher_->dispatch_to_airmap([this, sp = shared_from_this(), parameters, cb]() {
sp->client_->traffic().monitor(parameters, [this, sp, parameters, cb](const auto& result) { sp->client_->traffic().monitor(parameters, [this, sp, parameters, cb](const auto& result) {
if (result) { if (result) {
auto m = result.value(); auto m = result.value();

Loading…
Cancel
Save