Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
a6ea3d79
Commit
a6ea3d79
authored
Feb 19, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flight Details and File Flight Plan WIP
Permit refactoring QGCButton tweaks
parent
32ed1ec0
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
43 additions
and
18 deletions
+43
-18
AirMapFlightManager.cc
src/Airmap/AirMapFlightManager.cc
+2
-2
AirMapFlightManager.h
src/Airmap/AirMapFlightManager.h
+1
-1
AirMapFlightPlanManager.cc
src/Airmap/AirMapFlightPlanManager.cc
+1
-1
AirMapFlightPlanManager.h
src/Airmap/AirMapFlightPlanManager.h
+1
-1
AirMapManager.cc
src/Airmap/AirMapManager.cc
+2
-2
AirMapRulesetsManager.cc
src/Airmap/AirMapRulesetsManager.cc
+1
-1
AirspaceControl.qml
src/Airmap/AirspaceControl.qml
+21
-0
airmap.qrc
src/Airmap/airmap.qrc
+2
-2
AirspaceFlightPlanProvider.h
src/AirspaceManagement/AirspaceFlightPlanProvider.h
+2
-2
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+1
-1
QGCButton.qml
src/QmlControls/QGCButton.qml
+9
-5
No files found.
src/Airmap/AirMapFlightManager.cc
View file @
a6ea3d79
...
...
@@ -94,7 +94,7 @@ void AirMapFlightManager::createFlight(const QList<MissionItem*>& missionItems)
qCDebug
(
AirMapManagerLog
)
<<
"Got Pilot ID:"
<<
_pilotID
;
_uploadFlight
();
}
else
{
_flightPermitStatus
=
AirspaceFlightPlanProvider
::
Permit
Unknown
;
_flightPermitStatus
=
AirspaceFlightPlanProvider
::
Permit
None
;
emit
flightPermitStatusChanged
();
_state
=
State
::
Idle
;
...
...
@@ -372,7 +372,7 @@ void AirMapFlightManager::endFlight()
}
_endFlight
(
_currentFlightId
);
_flightPermitStatus
=
AirspaceFlightPlanProvider
::
Permit
Unknown
;
_flightPermitStatus
=
AirspaceFlightPlanProvider
::
Permit
None
;
emit
flightPermitStatusChanged
();
}
...
...
src/Airmap/AirMapFlightManager.h
View file @
a6ea3d79
...
...
@@ -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
::
Permit
Unknown
;
AirspaceFlightPlanProvider
::
PermitStatus
_flightPermitStatus
=
AirspaceFlightPlanProvider
::
Permit
None
;
QString
_pilotID
;
///< Pilot ID in the form "auth0|abc123"
bool
_noFlightCreatedYet
=
true
;
QTimer
_pollTimer
;
///< timer to poll for approval check
...
...
src/Airmap/AirMapFlightPlanManager.cc
View file @
a6ea3d79
...
...
@@ -143,7 +143,7 @@ AirMapFlightPlanManager::_createFlightPlan()
qCDebug
(
AirMapManagerLog
)
<<
"Got Pilot ID:"
<<
_pilotID
;
_uploadFlightPlan
();
}
else
{
_flightPermitStatus
=
AirspaceFlightPlanProvider
::
Permit
Unknown
;
_flightPermitStatus
=
AirspaceFlightPlanProvider
::
Permit
None
;
emit
flightPermitStatusChanged
();
_state
=
State
::
Idle
;
QString
description
=
QString
::
fromStdString
(
result
.
error
().
description
()
?
result
.
error
().
description
().
get
()
:
""
);
...
...
src/Airmap/AirMapFlightPlanManager.h
View file @
a6ea3d79
...
...
@@ -88,7 +88,7 @@ private:
QmlObjectListModel
_rulesets
;
AirspaceAdvisoryProvider
::
AdvisoryColor
_airspaceColor
;
AirspaceFlightPlanProvider
::
PermitStatus
_flightPermitStatus
=
AirspaceFlightPlanProvider
::
Permit
Unknown
;
AirspaceFlightPlanProvider
::
PermitStatus
_flightPermitStatus
=
AirspaceFlightPlanProvider
::
Permit
None
;
};
src/Airmap/AirMapManager.cc
View file @
a6ea3d79
...
...
@@ -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
,
fals
e
);
_logger
->
logging_category
().
setEnabled
(
QtInfoMsg
,
fals
e
);
_logger
->
logging_category
().
setEnabled
(
QtDebugMsg
,
tru
e
);
_logger
->
logging_category
().
setEnabled
(
QtInfoMsg
,
tru
e
);
_logger
->
logging_category
().
setEnabled
(
QtWarningMsg
,
true
);
_dispatchingLogger
=
std
::
make_shared
<
qt
::
DispatchingLogger
>
(
_logger
);
connect
(
&
_shared
,
&
AirMapSharedState
::
error
,
this
,
&
AirMapManager
::
_error
);
...
...
src/Airmap/AirMapRulesetsManager.cc
View file @
a6ea3d79
...
...
@@ -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();
...
...
src/Airmap/AirspaceControl.qml
View file @
a6ea3d79
...
...
@@ -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
...
...
src/Airmap/airmap.qrc
View file @
a6ea3d79
<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>
...
...
src/AirspaceManagement/AirspaceFlightPlanProvider.h
View file @
a6ea3d79
...
...
@@ -29,7 +29,7 @@ class AirspaceFlightPlanProvider : public QObject
public:
enum
PermitStatus
{
Permit
Unknown
=
0
,
Permit
None
=
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
Permit
Unknown
;
}
virtual
PermitStatus
flightPermitStatus
()
const
{
return
Permit
None
;
}
virtual
QDateTime
flightStartTime
()
const
=
0
;
virtual
QDateTime
flightEndTime
()
const
=
0
;
virtual
bool
valid
()
=
0
;
///< Current advisory list is valid
...
...
src/FlightDisplay/FlightDisplayView.qml
View file @
a6ea3d79
...
...
@@ -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
.
Permit
Unknown
&&
!
messageArea
.
visible
&&
!
criticalMmessageArea
.
visible
visible
:
QGroundControl
.
airmapSupported
&&
_mainIsMap
&&
flightPermit
&&
flightPermit
!==
AirspaceFlightPlanProvider
.
Permit
None
&&
!
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
)
...
...
src/QmlControls/QGCButton.qml
View file @
a6ea3d79
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment