diff --git a/src/MissionManager/AirMapManager.cc b/src/MissionManager/AirMapManager.cc index 878e8f92197c39849edf1f10a790c049ab1c9526..c651537f1c646b1f5c035d1a978ce675e6607154 100644 --- a/src/MissionManager/AirMapManager.cc +++ b/src/MissionManager/AirMapManager.cc @@ -569,8 +569,12 @@ void AirMapFlightManager::_uploadFlight() root.insert("buffer", 2); QJsonObject flightFeatures; - flightFeatures.insert("sita_uav_registration_id", ""); // TODO - flightFeatures.insert("sita_pilot_registration_id", ""); // TODO + if (_sitaUavRegistrationId != "") { + flightFeatures.insert("sita_uav_registration_id", _sitaUavRegistrationId); + } + if (_sitaPilotRegistrationId != "") { + flightFeatures.insert("sita_pilot_registration_id", _sitaPilotRegistrationId); + } root.insert("flight_features", flightFeatures); root.insert("takeoff_latitude", _flight.takeoffCoord.latitude()); @@ -1196,6 +1200,8 @@ void AirMapManager::setToolbox(QGCToolbox* toolbox) AirMapSettings* ap = toolbox->settingsManager()->airMapSettings(); _networkingData.airmapAPIKey = ap->apiKey()->rawValueString(); _networkingData.login.setCredentials(ap->clientID()->rawValueString(), ap->userName()->rawValueString(), ap->password()->rawValueString()); + _flightManager.setSitaPilotRegistrationId(ap->sitaUserReg()->rawValueString()); + _flightManager.setSitaUavRegistrationId(ap->sitaUavReg()->rawValueString()); } void AirMapManager::setROI(QGeoCoordinate& center, double radiusMeters) diff --git a/src/MissionManager/AirMapManager.h b/src/MissionManager/AirMapManager.h index 6dc4657b95b8ad0946096b13bcd5e89865639c3d..85379e8e7547c876b13bd2d64dbed3408df2099f 100644 --- a/src/MissionManager/AirMapManager.h +++ b/src/MissionManager/AirMapManager.h @@ -245,6 +245,13 @@ public: const QString& flightID() const { return _currentFlightId; } + void setSitaUavRegistrationId(const QString& sitaUavRegistrationId) { + _sitaUavRegistrationId = sitaUavRegistrationId; + } + void setSitaPilotRegistrationId(const QString& sitaPilotRegistrationId) { + _sitaPilotRegistrationId = sitaPilotRegistrationId; + } + public slots: void endFlight(); @@ -300,6 +307,9 @@ private: QString _pilotID; ///< Pilot ID in the form "auth0|abc123" bool _noFlightCreatedYet = true; QTimer _pollTimer; ///< timer to poll for approval check + + QString _sitaUavRegistrationId; + QString _sitaPilotRegistrationId; }; /// class to send telemetry data to AirMap