Commit a6ea3d79 authored by Gus Grubba's avatar Gus Grubba

Flight Details and File Flight Plan WIP

Permit refactoring
QGCButton tweaks
parent 32ed1ec0
......@@ -94,7 +94,7 @@ void AirMapFlightManager::createFlight(const QList<MissionItem*>& missionItems)
qCDebug(AirMapManagerLog) << "Got Pilot ID:"<<_pilotID;
_uploadFlight();
} else {
_flightPermitStatus = AirspaceFlightPlanProvider::PermitUnknown;
_flightPermitStatus = AirspaceFlightPlanProvider::PermitNone;
emit flightPermitStatusChanged();
_state = State::Idle;
......@@ -372,7 +372,7 @@ void AirMapFlightManager::endFlight()
}
_endFlight(_currentFlightId);
_flightPermitStatus = AirspaceFlightPlanProvider::PermitUnknown;
_flightPermitStatus = AirspaceFlightPlanProvider::PermitNone;
emit flightPermitStatusChanged();
}
......
......@@ -108,7 +108,7 @@ private:
QString _currentFlightId; ///< Flight ID, empty if there is none
QString _pendingFlightId; ///< current flight ID, not necessarily accepted yet (once accepted, it's equal to _currentFlightId)
QString _pendingFlightPlan; ///< current flight plan, waiting to be submitted
AirspaceFlightPlanProvider::PermitStatus _flightPermitStatus = AirspaceFlightPlanProvider::PermitUnknown;
AirspaceFlightPlanProvider::PermitStatus _flightPermitStatus = AirspaceFlightPlanProvider::PermitNone;
QString _pilotID; ///< Pilot ID in the form "auth0|abc123"
bool _noFlightCreatedYet = true;
QTimer _pollTimer; ///< timer to poll for approval check
......
......@@ -143,7 +143,7 @@ AirMapFlightPlanManager::_createFlightPlan()
qCDebug(AirMapManagerLog) << "Got Pilot ID:"<<_pilotID;
_uploadFlightPlan();
} else {
_flightPermitStatus = AirspaceFlightPlanProvider::PermitUnknown;
_flightPermitStatus = AirspaceFlightPlanProvider::PermitNone;
emit flightPermitStatusChanged();
_state = State::Idle;
QString description = QString::fromStdString(result.error().description() ? result.error().description().get() : "");
......
......@@ -88,7 +88,7 @@ private:
QmlObjectListModel _rulesets;
AirspaceAdvisoryProvider::AdvisoryColor _airspaceColor;
AirspaceFlightPlanProvider::PermitStatus _flightPermitStatus = AirspaceFlightPlanProvider::PermitUnknown;
AirspaceFlightPlanProvider::PermitStatus _flightPermitStatus = AirspaceFlightPlanProvider::PermitNone;
};
......@@ -37,8 +37,8 @@ AirMapManager::AirMapManager(QGCApplication* app, QGCToolbox* toolbox)
{
_logger = std::make_shared<qt::Logger>();
qt::register_types(); // TODO: still needed?
_logger->logging_category().setEnabled(QtDebugMsg, false);
_logger->logging_category().setEnabled(QtInfoMsg, false);
_logger->logging_category().setEnabled(QtDebugMsg, true);
_logger->logging_category().setEnabled(QtInfoMsg, true);
_logger->logging_category().setEnabled(QtWarningMsg, true);
_dispatchingLogger = std::make_shared<qt::DispatchingLogger>(_logger);
connect(&_shared, &AirMapSharedState::error, this, &AirMapManager::_error);
......
......@@ -248,8 +248,8 @@ void AirMapRulesetsManager::setROI(const QGCGeoBoundingCube& roi)
//-- Sort rules by display order
std::sort(pRuleSet->_rules.objectList()->begin(), pRuleSet->_rules.objectList()->end(), rules_sort);
_ruleSets.append(pRuleSet);
/*
qCDebug(AirMapManagerLog) << "Adding ruleset" << pRuleSet->name();
/*
qDebug() << "------------------------------------------";
qDebug() << "Jurisdiction:" << ruleset.jurisdiction.name.data() << (int)ruleset.jurisdiction.region;
qDebug() << "Name: " << ruleset.name.data();
......
......@@ -27,6 +27,7 @@ Item {
property bool _validAdvisories: QGroundControl.airspaceManager.advisories.valid
property color _textColor: qgcPal.text
property bool _colapsed: !QGroundControl.airspaceManager.airspaceVisible
property var _flightPermit: QGroundControl.airspaceManager.flightPlan.flightPermitStatus
readonly property real _radius: ScreenTools.defaultFontPixelWidth * 0.5
readonly property color _colorOrange: "#d75e0d"
......@@ -342,6 +343,26 @@ Item {
}
}
//-- Footer
Row {
spacing: ScreenTools.defaultFontPixelWidth * 2
anchors.horizontalCenter: parent.horizontalCenter
QGCButton {
text: qsTr("Details")
backRadius: 4
heightFactor: 0.3333
showBorder: true
enabled: _flightPermit !== AirspaceFlightPlanProvider.PermitNone
width: ScreenTools.defaultFontPixelWidth * 10
}
QGCButton {
text: qsTr("File Plan")
backRadius: 4
heightFactor: 0.3333
showBorder: true
enabled: _flightPermit !== AirspaceFlightPlanProvider.PermitNone
width: ScreenTools.defaultFontPixelWidth * 10
}
}
QGCLabel {
text: qsTr("Powered by <b>AIRMAP</b>")
color: _textColor
......
<RCC>
<qresource prefix="/qml">
<file alias="QGroundControl/Airmap/qmldir">QGroundControl.Airmap.qmldir</file>
<file alias="AirmapSettings.qml">AirmapSettings.qml</file>
<file alias="QGroundControl/Airmap/AirspaceControl.qml">AirspaceControl.qml</file>
<file alias="QGroundControl/Airmap/AirspaceRegulation.qml">AirspaceRegulation.qml</file>
<file alias="QGroundControl/Airmap/AirspaceWeather.qml">AirspaceWeather.qml</file>
<file alias="QGroundControl/Airmap/qmldir">QGroundControl.Airmap.qmldir</file>
<file alias="QGroundControl/Airmap/RuleSelector.qml">RuleSelector.qml</file>
<file alias="AirmapSettings.qml">AirmapSettings.qml</file>
</qresource>
<qresource prefix="/json">
<file alias="AirMap.SettingsGroup.json">AirMap.SettingsGroup.json</file>
......
......@@ -29,7 +29,7 @@ class AirspaceFlightPlanProvider : public QObject
public:
enum PermitStatus {
PermitUnknown = 0,
PermitNone = 0, //-- No flght plan
PermitPending,
PermitAccepted,
PermitRejected,
......@@ -48,7 +48,7 @@ public:
Q_PROPERTY(QmlObjectListModel* ruleSets READ ruleSets NOTIFY advisoryChanged)
Q_PROPERTY(AirspaceAdvisoryProvider::AdvisoryColor airspaceColor READ airspaceColor NOTIFY advisoryChanged)
virtual PermitStatus flightPermitStatus () const { return PermitUnknown; }
virtual PermitStatus flightPermitStatus () const { return PermitNone; }
virtual QDateTime flightStartTime () const = 0;
virtual QDateTime flightEndTime () const = 0;
virtual bool valid () = 0; ///< Current advisory list is valid
......
......@@ -634,7 +634,7 @@ QGCView {
width: airspaceRow.width + (ScreenTools.defaultFontPixelWidth * 3)
height: airspaceRow.height * 1.25
color: qgcPal.globalTheme === QGCPalette.Light ? Qt.rgba(1,1,1,0.95) : Qt.rgba(0,0,0,0.75)
visible: QGroundControl.airmapSupported && _mainIsMap && flightPermit && flightPermit !== AirspaceFlightPlanProvider.PermitUnknown && !messageArea.visible && !criticalMmessageArea.visible
visible: QGroundControl.airmapSupported && _mainIsMap && flightPermit && flightPermit !== AirspaceFlightPlanProvider.PermitNone && !messageArea.visible && !criticalMmessageArea.visible
radius: 3
border.width: 1
border.color: qgcPal.globalTheme === QGCPalette.Light ? Qt.rgba(0,0,0,0.35) : Qt.rgba(1,1,1,0.35)
......
......@@ -6,12 +6,14 @@ import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
Button {
property bool primary: false ///< primary button for a group of buttons
property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text
property bool primary: false ///< primary button for a group of buttons
property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text
property bool showBorder: _qgcPal.globalTheme === QGCPalette.Light
property real backRadius: 0
property real heightFactor: 0.5
property var _qgcPal: QGCPalette { colorGroupEnabled: enabled }
property bool _showHighlight: (pressed | hovered | checked) && !__forceHoverOff
property bool _showBorder: _qgcPal.globalTheme === QGCPalette.Light
// This fixes the issue with button hover where if a Button is near the edge oa QQuickWidget you can
// move the mouse fast enough such that the MouseArea does not trigger an onExited. This is turn
......@@ -22,7 +24,7 @@ Button {
property int __lastGlobalMouseX: 0
property int __lastGlobalMouseY: 0
property int _horizontalPadding: ScreenTools.defaultFontPixelWidth
property int _verticalPadding: Math.round(ScreenTools.defaultFontPixelHeight / 2)
property int _verticalPadding: Math.round(ScreenTools.defaultFontPixelHeight * heightFactor)
Connections {
target: __behavior
......@@ -58,9 +60,11 @@ Button {
/*! This defines the background of the button. */
background: Rectangle {
id: backRect
implicitWidth: ScreenTools.implicitButtonWidth
implicitHeight: ScreenTools.implicitButtonHeight
border.width: _showBorder ? 1: 0
radius: backRadius
border.width: showBorder ? 1 : 0
border.color: _qgcPal.buttonText
color: _showHighlight ?
control._qgcPal.buttonHighlight :
......
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