diff --git a/src/Airmap/AirMapFlightPlanManager.cc b/src/Airmap/AirMapFlightPlanManager.cc index 4e226debab512f2ba8be91b6b724125a4b0b62db..be97e05b014fde57a54f389e554c0beb5bcdef3b 100644 --- a/src/Airmap/AirMapFlightPlanManager.cc +++ b/src/Airmap/AirMapFlightPlanManager.cc @@ -150,7 +150,7 @@ AirMapFlightPlanManager::setFlightStartTime(QDateTime start) _flightEndTime = _flightStartTime.addSecs(30 * 60); emit flightEndTimeChanged(); } - qCDebug(AirMapManagerLog) << "Set time" << _flightStartTime << _flightEndTime; + qCDebug(AirMapManagerLog) << "Set time start time" << _flightStartTime << _flightEndTime; } //----------------------------------------------------------------------------- @@ -165,6 +165,7 @@ AirMapFlightPlanManager::setFlightEndTime(QDateTime end) _flightEndTime = end; emit flightEndTimeChanged(); } + qCDebug(AirMapManagerLog) << "Set time end time" << _flightStartTime << _flightEndTime; } //----------------------------------------------------------------------------- @@ -380,7 +381,7 @@ AirMapFlightPlanManager::_createFlightPlan() qCDebug(AirMapManagerLog) << "Flight Start:" << flightStartTime().toString(); qCDebug(AirMapManagerLog) << "Flight End: " << flightEndTime().toString(); - if (_pilotID == "") { + if (_pilotID == "" && !_shared.settings().userName.isEmpty() && !_shared.settings().password.isEmpty()) { //-- Need to get the pilot id before uploading the flight plan qCDebug(AirMapManagerLog) << "Getting pilot ID"; _state = State::GetPilotID; @@ -509,7 +510,7 @@ AirMapFlightPlanManager::_uploadFlightPlan() FlightPlans::Create::Parameters params; params.max_altitude = _flight.maxAltitude; params.min_altitude = 0.0; - params.buffer = 0.f; + params.buffer = 10.f; params.latitude = static_cast(_flight.takeoffCoord.latitude()); params.longitude = static_cast(_flight.takeoffCoord.longitude()); params.pilot.id = _pilotID.toStdString(); diff --git a/src/Airmap/AirMapSharedState.cc b/src/Airmap/AirMapSharedState.cc index f27da2cd8d18c40fb2cea1fa7d8f1fe6ff38067e..d62f70292c0fa9e5647439ab58b769e27d40b607 100644 --- a/src/Airmap/AirMapSharedState.cc +++ b/src/Airmap/AirMapSharedState.cc @@ -40,16 +40,16 @@ AirMapSharedState::login() } _isLoginInProgress = true; if (_settings.userName == "") { //use anonymous login - + qCDebug(AirMapManagerLog) << "Anonymous authentication"; Authenticator::AuthenticateAnonymously::Params params; - params.id = ""; + params.id = "Anonymous"; _client->authenticator().authenticate_anonymously(params, [this](const Authenticator::AuthenticateAnonymously::Result& result) { if (!_isLoginInProgress) { // was logout() called in the meanwhile? return; } if (result) { - qCDebug(AirMapManagerLog)<<"Successfully authenticated with AirMap: id="<< result.value().id.c_str(); + qCDebug(AirMapManagerLog) << "Successfully authenticated with AirMap: id="<< result.value().id.c_str(); emit authStatus(AirspaceManager::AuthStatus::Anonymous); _loginToken = QString::fromStdString(result.value().id); _processPendingRequests(); @@ -67,13 +67,14 @@ AirMapSharedState::login() params.oauth.password = _settings.password.toStdString(); params.oauth.client_id = _settings.clientID.toStdString(); params.oauth.device_id = "QGroundControl"; + qCDebug(AirMapManagerLog) << "User authentication" << _settings.userName; _client->authenticator().authenticate_with_password(params, [this](const Authenticator::AuthenticateWithPassword::Result& result) { if (!_isLoginInProgress) { // was logout() called in the meanwhile? return; } if (result) { - qCDebug(AirMapManagerLog)<<"Successfully authenticated with AirMap: id="<< result.value().id.c_str()<<", access=" + qCDebug(AirMapManagerLog) << "Successfully authenticated with AirMap: id="<< result.value().id.c_str()<<", access=" < 24) val = 24 + durationSlider.value = Math.ceil(val) + } + } + QGCLabel { + id: durationLabel + text: ('00' + hour).slice(-2) + ":" + ('00' + minute).slice(-2) + width: ScreenTools.defaultFontPixelWidth * 5 + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + property int hour: Math.floor(durationSlider.value * 0.25) + property int minute: (durationSlider.value * 15) % 60 + } } } }