diff --git a/QGCExternalLibs.pri b/QGCExternalLibs.pri index 3b09a0e..6ceaaec 100644 --- a/QGCExternalLibs.pri +++ b/QGCExternalLibs.pri @@ -245,9 +245,9 @@ contains (DEFINES, DISABLE_AIRMAP) { } } else:LinuxBuild { #-- 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_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.commands = \ @@ -256,15 +256,15 @@ contains (DEFINES, DISABLE_AIRMAP) { mkdir -p "$${AIRMAP_PLATFORM_SDK_PATH}/include/airmap" && \ 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 && \ - 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_PREFIX}/include/airmap/*" "$${AIRMAP_PLATFORM_SDK_PATH}/include/airmap/" && \ - rm -rf "$${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}" && \ + 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_DIR}/usr/include/airmap/*" "$${AIRMAP_PLATFORM_SDK_PATH}/include/airmap/" && \ + rm -rf "$${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_DIR}" && \ rm "$${AIRMAP_PLATFORM_SDK_FILENAME}" airmap_platform_sdk_install.depends = QMAKE_EXTRA_TARGETS += airmap_platform_sdk_install 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 } else { message("Skipping support for Airmap (unsupported platform)") diff --git a/QGCPostLinkCommon.pri b/QGCPostLinkCommon.pri index 17283c9..ab859bd 100644 --- a/QGCPostLinkCommon.pri +++ b/QGCPostLinkCommon.pri @@ -147,7 +147,7 @@ LinuxBuild { # Airmap 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 diff --git a/src/Airmap/qt/advisory.cpp b/src/Airmap/qt/advisory.cpp index 5b951e5..802f8b7 100644 --- a/src/Airmap/qt/advisory.cpp +++ b/src/Airmap/qt/advisory.cpp @@ -23,7 +23,7 @@ airmap::qt::Advisory::Advisory(const std::shared_ptr& dispatcher, } 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->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) { - 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->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, 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->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); }); diff --git a/src/Airmap/qt/aircrafts.cpp b/src/Airmap/qt/aircrafts.cpp index c5b4664..2b9b064 100644 --- a/src/Airmap/qt/aircrafts.cpp +++ b/src/Airmap/qt/aircrafts.cpp @@ -24,7 +24,7 @@ airmap::qt::Aircrafts::Aircrafts(const std::shared_ptr& dispatcher, void airmap::qt::Aircrafts::manufacturers(const Manufacturers::Parameters& parameters, 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->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) { - 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->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) { - 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->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); }); diff --git a/src/Airmap/qt/airspaces.cpp b/src/Airmap/qt/airspaces.cpp index 0a5bff0..fd35773 100644 --- a/src/Airmap/qt/airspaces.cpp +++ b/src/Airmap/qt/airspaces.cpp @@ -23,7 +23,7 @@ airmap::qt::Airspaces::Airspaces(const std::shared_ptr& dispatcher, } 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->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) { - 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->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); }); diff --git a/src/Airmap/qt/authenticator.cpp b/src/Airmap/qt/authenticator.cpp index 3067f1a..c0feb1e 100644 --- a/src/Airmap/qt/authenticator.cpp +++ b/src/Airmap/qt/authenticator.cpp @@ -24,7 +24,7 @@ airmap::qt::Authenticator::Authenticator(const std::shared_ptr& disp void airmap::qt::Authenticator::authenticate_with_password(const AuthenticateWithPassword::Params& parameters, 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->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, 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->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, 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->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); }); diff --git a/src/Airmap/qt/client.h b/src/Airmap/qt/client.h index b718a1c..d1b15c5 100644 --- a/src/Airmap/qt/client.h +++ b/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, QObject* parent, const CreateCallback& cb); - ~Client(); + ~Client() override; // From airmap::Client Authenticator& authenticator() override; diff --git a/src/Airmap/qt/dispatcher.cpp b/src/Airmap/qt/dispatcher.cpp index 6051572..f30b28b 100644 --- a/src/Airmap/qt/dispatcher.cpp +++ b/src/Airmap/qt/dispatcher.cpp @@ -68,7 +68,7 @@ airmap::qt::Dispatcher::ToNative::ToNative(const std::shared_ptr& conte } 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) @@ -79,7 +79,7 @@ void airmap::qt::Dispatcher::dispatch_to_qt(const std::function& task) { to_qt_->dispatch(task); } -void airmap::qt::Dispatcher::dispatch_to_native(const std::function& task) { +void airmap::qt::Dispatcher::dispatch_to_airmap(const std::function& task) { to_native_->dispatch(task); } diff --git a/src/Airmap/qt/dispatcher.h b/src/Airmap/qt/dispatcher.h index 6b9bbaa..8b7a2ca 100644 --- a/src/Airmap/qt/dispatcher.h +++ b/src/Airmap/qt/dispatcher.h @@ -62,7 +62,7 @@ class Dispatcher : public QObject { explicit Dispatcher(const std::shared_ptr& context); void dispatch_to_qt(const Task& task); - void dispatch_to_native(const Task& task); + void dispatch_to_airmap(const Task& task); private: std::shared_ptr to_qt_; diff --git a/src/Airmap/qt/flight_plans.cpp b/src/Airmap/qt/flight_plans.cpp index 45d8b2b..093f55d 100644 --- a/src/Airmap/qt/flight_plans.cpp +++ b/src/Airmap/qt/flight_plans.cpp @@ -23,7 +23,7 @@ airmap::qt::FlightPlans::FlightPlans(const std::shared_ptr& dispatch } 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->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) { - 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->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) { - 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->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) { - 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->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, 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->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) { - 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->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); }); diff --git a/src/Airmap/qt/flights.cpp b/src/Airmap/qt/flights.cpp index 7e9f833..f09a343 100644 --- a/src/Airmap/qt/flights.cpp +++ b/src/Airmap/qt/flights.cpp @@ -23,7 +23,7 @@ airmap::qt::Flights::Flights(const std::shared_ptr& dispatcher, } 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->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) { - 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->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, 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->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, 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->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, 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->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) { - 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->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) { - 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->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, 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->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, 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->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); }); diff --git a/src/Airmap/qt/pilots.cpp b/src/Airmap/qt/pilots.cpp index 439075d..ce0fbca 100644 --- a/src/Airmap/qt/pilots.cpp +++ b/src/Airmap/qt/pilots.cpp @@ -22,7 +22,7 @@ airmap::qt::Pilots::Pilots(const std::shared_ptr& dispatcher, const } 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->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) { - 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->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) { - 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->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, 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->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, 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->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) { - 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->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) { - 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->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, 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->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, 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->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); }); diff --git a/src/Airmap/qt/rulesets.cpp b/src/Airmap/qt/rulesets.cpp index 255a4a2..a6dedb7 100644 --- a/src/Airmap/qt/rulesets.cpp +++ b/src/Airmap/qt/rulesets.cpp @@ -23,7 +23,7 @@ airmap::qt::RuleSets::RuleSets(const std::shared_ptr& dispatcher, } 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->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) { - 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->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) { - 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->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, 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->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, 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->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); }); diff --git a/src/Airmap/qt/status.cpp b/src/Airmap/qt/status.cpp index b804d9d..4d391f7 100644 --- a/src/Airmap/qt/status.cpp +++ b/src/Airmap/qt/status.cpp @@ -22,7 +22,7 @@ airmap::qt::Status::Status(const std::shared_ptr& dispatcher, const } 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->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) { - 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->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) { - 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->dispatcher_->dispatch_to_qt([sp, result, cb]() { cb(result); }); }); diff --git a/src/Airmap/qt/telemetry.cpp b/src/Airmap/qt/telemetry.cpp index dccd5bb..5de2359 100644 --- a/src/Airmap/qt/telemetry.cpp +++ b/src/Airmap/qt/telemetry.cpp @@ -26,7 +26,7 @@ airmap::qt::Telemetry::Telemetry(const std::shared_ptr& dispatcher, void airmap::qt::Telemetry::submit_updates(const Flight& flight, const std::string& key, const std::initializer_list& 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); }); } diff --git a/src/Airmap/qt/traffic.cpp b/src/Airmap/qt/traffic.cpp index ca03050..47c3676 100644 --- a/src/Airmap/qt/traffic.cpp +++ b/src/Airmap/qt/traffic.cpp @@ -49,7 +49,7 @@ airmap::qt::Traffic::Traffic(const std::shared_ptr& dispatcher, } 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) { if (result) { auto m = result.value();