Commit a6becbdd authored by Beat Küng's avatar Beat Küng

AirmapManager: make sure to pass the SITA reg data to the right objects

parent d09847fc
...@@ -569,8 +569,12 @@ void AirMapFlightManager::_uploadFlight() ...@@ -569,8 +569,12 @@ void AirMapFlightManager::_uploadFlight()
root.insert("buffer", 2); root.insert("buffer", 2);
QJsonObject flightFeatures; QJsonObject flightFeatures;
flightFeatures.insert("sita_uav_registration_id", ""); // TODO if (_sitaUavRegistrationId != "") {
flightFeatures.insert("sita_pilot_registration_id", ""); // TODO flightFeatures.insert("sita_uav_registration_id", _sitaUavRegistrationId);
}
if (_sitaPilotRegistrationId != "") {
flightFeatures.insert("sita_pilot_registration_id", _sitaPilotRegistrationId);
}
root.insert("flight_features", flightFeatures); root.insert("flight_features", flightFeatures);
root.insert("takeoff_latitude", _flight.takeoffCoord.latitude()); root.insert("takeoff_latitude", _flight.takeoffCoord.latitude());
...@@ -1196,6 +1200,8 @@ void AirMapManager::setToolbox(QGCToolbox* toolbox) ...@@ -1196,6 +1200,8 @@ void AirMapManager::setToolbox(QGCToolbox* toolbox)
AirMapSettings* ap = toolbox->settingsManager()->airMapSettings(); AirMapSettings* ap = toolbox->settingsManager()->airMapSettings();
_networkingData.airmapAPIKey = ap->apiKey()->rawValueString(); _networkingData.airmapAPIKey = ap->apiKey()->rawValueString();
_networkingData.login.setCredentials(ap->clientID()->rawValueString(), ap->userName()->rawValueString(), ap->password()->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) void AirMapManager::setROI(QGeoCoordinate& center, double radiusMeters)
......
...@@ -245,6 +245,13 @@ public: ...@@ -245,6 +245,13 @@ public:
const QString& flightID() const { return _currentFlightId; } const QString& flightID() const { return _currentFlightId; }
void setSitaUavRegistrationId(const QString& sitaUavRegistrationId) {
_sitaUavRegistrationId = sitaUavRegistrationId;
}
void setSitaPilotRegistrationId(const QString& sitaPilotRegistrationId) {
_sitaPilotRegistrationId = sitaPilotRegistrationId;
}
public slots: public slots:
void endFlight(); void endFlight();
...@@ -300,6 +307,9 @@ private: ...@@ -300,6 +307,9 @@ private:
QString _pilotID; ///< Pilot ID in the form "auth0|abc123" QString _pilotID; ///< Pilot ID in the form "auth0|abc123"
bool _noFlightCreatedYet = true; bool _noFlightCreatedYet = true;
QTimer _pollTimer; ///< timer to poll for approval check QTimer _pollTimer; ///< timer to poll for approval check
QString _sitaUavRegistrationId;
QString _sitaPilotRegistrationId;
}; };
/// class to send telemetry data to AirMap /// class to send telemetry data to AirMap
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment