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
a110c7f5
Commit
a110c7f5
authored
Jun 19, 2019
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload works now + .plan and .wima fully supported
parent
ce3fb543
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
357 additions
and
204 deletions
+357
-204
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+2
-0
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+12
-0
WimaArea.cc
src/Wima/WimaArea.cc
+7
-2
WimaArea.h
src/Wima/WimaArea.h
+11
-10
WimaController.cc
src/Wima/WimaController.cc
+147
-63
WimaController.h
src/Wima/WimaController.h
+12
-1
WimaToolBar.qml
src/WimaView/WimaToolBar.qml
+4
-4
WimaView.qml
src/WimaView/WimaView.qml
+139
-77
MainWindowInner.qml
src/ui/MainWindowInner.qml
+22
-32
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+1
-15
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
a110c7f5
...
...
@@ -34,6 +34,8 @@ QGCView {
id
:
root
viewPanel
:
_panel
property
var
wimaController
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
property
alias
guidedController
:
guidedActionsController
...
...
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
a110c7f5
...
...
@@ -32,6 +32,7 @@ FlightMap {
allowVehicleLocationCenter
:
!
_keepVehicleCentered
planView
:
false
property
alias
scaleState
:
mapScale
.
state
// The following properties must be set by the consumer
...
...
@@ -41,6 +42,7 @@ FlightMap {
property
var
rightPanelWidth
property
var
qgcView
///< QGCView control which contains this map
property
var
multiVehicleView
///< true: multi-vehicle view, false: single vehicle view
property
var
wimaController
property
rect
centerViewport
:
Qt
.
rect
(
0
,
0
,
width
,
height
)
...
...
@@ -191,6 +193,16 @@ FlightMap {
property
real
leftToolWidth
:
toolStrip
.
x
+
toolStrip
.
width
}
// Add wima Areas to the Map
WimaMapPolygonVisuals
{
mapControl
:
flightMap
mapPolygon
:
wimaController
?
wimaController
.
joinedArea
:
undefined
borderWidth
:
1
borderColor
:
"
transparent
"
interiorColor
:
"
gray
"
interiorOpacity
:
0.25
}
// Add trajectory points to the map
MapItemView
{
model
:
_mainIsMap
?
_activeVehicle
?
_activeVehicle
.
trajectoryPoints
:
0
:
0
...
...
src/Wima/WimaArea.cc
View file @
a110c7f5
...
...
@@ -106,7 +106,7 @@ QGeoCoordinate WimaArea::getClosestVertex(const QGeoCoordinate& coordinate) cons
return
this
->
vertexCoordinate
(
getClosestVertexIndex
(
coordinate
));
}
QGCMapPolygon
WimaArea
::
toQGCPolygon
(
const
WimaArea
&
poly
)
const
QGCMapPolygon
WimaArea
::
toQGCPolygon
(
const
WimaArea
&
poly
)
{
QGCMapPolygon
qgcPoly
;
qgcPoly
.
setPath
(
poly
.
path
());
...
...
@@ -117,6 +117,11 @@ QGCMapPolygon WimaArea::toQGCPolygon(const WimaArea &poly) const
return
QGCMapPolygon
(
qgcPoly
);
}
QGCMapPolygon
WimaArea
::
toQGCPolygon
()
const
{
return
toQGCPolygon
(
*
this
);
}
void
WimaArea
::
join
(
QList
<
WimaArea
*>*
polyList
,
WimaArea
*
joinedPoly
)
{
return
;
...
...
@@ -376,7 +381,7 @@ bool WimaArea::intersects(const QGCMapPolyline& line, const WimaArea& poly, QLis
double
WimaArea
::
distInsidePoly
(
const
QGeoCoordinate
&
c1
,
const
QGeoCoordinate
&
c2
,
const
WimaArea
&
poly
)
{
WimaArea
bigPoly
(
poly
);
bigPoly
.
offset
(
0.
0
1
);
// hack to compensate for numerical issues, migh be replaced in the future...
bigPoly
.
offset
(
0.1
);
// hack to compensate for numerical issues, migh be replaced in the future...
if
(
bigPoly
.
containsCoordinate
(
c1
)
&&
bigPoly
.
containsCoordinate
(
c2
))
{
QList
<
QGeoCoordinate
>
intersectionList
;
QList
<
QPair
<
int
,
int
>>
neighbourlist
;
...
...
src/Wima/WimaArea.h
View file @
a110c7f5
...
...
@@ -44,24 +44,25 @@ public:
template <class T>
QList<T*>* splitArea (int numberOfFractions); // use QScopedPointer to store return value*/
//iterates over all vertices in _polygon and returns the index of that one closest to coordinate
int
getClosestVertexIndex
(
const
QGeoCoordinate
&
coordinate
)
const
;
int
getClosestVertexIndex
(
const
QGeoCoordinate
&
coordinate
)
const
;
//iterates over all vertices in _polygon and returns that one closest to coordinate
QGeoCoordinate
getClosestVertex
(
const
QGeoCoordinate
&
coordinate
)
const
;
QGCMapPolygon
toQGCPolygon
(
const
WimaArea
&
poly
)
const
;
static
void
join
(
QList
<
WimaArea
*>*
polyList
,
WimaArea
*
joinedPoly
);
// change to & notation
QGeoCoordinate
getClosestVertex
(
const
QGeoCoordinate
&
coordinate
)
const
;
static
QGCMapPolygon
toQGCPolygon
(
const
WimaArea
&
poly
);
QGCMapPolygon
toQGCPolygon
()
const
;
static
void
join
(
QList
<
WimaArea
*>*
polyList
,
WimaArea
*
joinedPoly
);
// change to & notation
/// joins the poly1 and poly2 if possible, joins the polygons to form a simple polygon (no holes)
/// see https://en.wikipedia.org/wiki/Simple_polygon
/// @return the joined polygon of poly1 and poly2 if possible, poly1 else
static
void
join
(
WimaArea
&
poly1
,
WimaArea
&
poly2
,
WimaArea
&
joinedPoly
);
void
join
(
WimaArea
&
poly
);
bool
isDisjunct
(
QList
<
WimaArea
*>*
polyList
);
// change to & notation, if necessary
bool
isDisjunct
(
WimaArea
*
poly1
,
WimaArea
*
poly2
);
// change to & notation, if necessary
static
void
join
(
WimaArea
&
poly1
,
WimaArea
&
poly2
,
WimaArea
&
joinedPoly
);
void
join
(
WimaArea
&
poly
);
bool
isDisjunct
(
QList
<
WimaArea
*>*
polyList
);
// change to & notation, if necessary
bool
isDisjunct
(
WimaArea
*
poly1
,
WimaArea
*
poly2
);
// change to & notation, if necessary
/// calculates the next polygon vertex index
/// @return index + 1 if index < poly->count()-1 && index >= 0, or 0 if index == poly->count()-1, -1 else
int
nextVertexIndex
(
int
index
)
const
;
int
nextVertexIndex
(
int
index
)
const
;
/// calculates the previous polygon vertex index
/// @return index - 1 if index < poly->count() && index > 0, or poly->count()-1 if index == 0, -1 else
int
previousVertexIndex
(
int
index
)
const
;
int
previousVertexIndex
(
int
index
)
const
;
/// checks if line1 and line2 intersect with each other, takes latitude and longitute into account only (height neglected)
/// @param line1 line containing two coordinates, height not taken into account
/// @param line2 line containing two coordinates, height not taken into account
...
...
src/Wima/WimaController.cc
View file @
a110c7f5
This diff is collapsed.
Click to expand it.
src/Wima/WimaController.h
View file @
a110c7f5
...
...
@@ -21,6 +21,8 @@
class
WimaController
:
public
QObject
{
enum
FileType
{
WimaFile
,
PlanFile
};
Q_OBJECT
public:
WimaController
(
QObject
*
parent
=
nullptr
);
...
...
@@ -32,8 +34,10 @@ public:
Q_PROPERTY
(
int
currentPolygonIndex
READ
currentPolygonIndex
WRITE
setCurrentPolygonIndex
NOTIFY
currentPolygonIndexChanged
)
Q_PROPERTY
(
QString
currentFile
READ
currentFile
NOTIFY
currentFileChanged
)
Q_PROPERTY
(
QStringList
loadNameFilters
READ
loadNameFilters
CONSTANT
)
Q_PROPERTY
(
QStringList
saveNameFilters
READ
saveNameFilters
CONSTANT
)
Q_PROPERTY
(
QString
fileExtension
READ
fileExtension
CONSTANT
)
Q_PROPERTY
(
QGeoCoordinate
joinedAreaCenter
READ
joinedAreaCenter
CONSTANT
)
Q_PROPERTY
(
QGCMapPolygon
joinedArea
READ
joinedArea
NOTIFY
joinedAreaChanged
)
// Property accessors
...
...
@@ -43,8 +47,10 @@ public:
int
currentPolygonIndex
(
void
)
const
{
return
_currentPolygonIndex
;
}
QString
currentFile
(
void
)
const
{
return
_currentFile
;
}
QStringList
loadNameFilters
(
void
)
const
;
QStringList
saveNameFilters
(
void
)
const
;
QString
fileExtension
(
void
)
const
{
return
wimaFileExtension
;
}
QGeoCoordinate
joinedAreaCenter
(
void
)
const
{
return
_joinedArea
.
center
();
}
QGCMapPolygon
joinedArea
(
void
)
const
{
return
_joinedArea
.
toQGCPolygon
();
}
...
...
@@ -80,9 +86,13 @@ public:
// static Members
static
const
char
*
wimaFileExtension
;
static
const
char
*
areaItemsName
;
static
const
char
*
missionItemsName
;
// Member Methodes
QJsonDocument
saveToJson
();
QJsonDocument
saveToJson
(
FileType
fileType
);
...
...
@@ -92,6 +102,7 @@ signals:
void
visualItemsChanged
(
void
);
void
currentPolygonIndexChanged
(
int
index
);
void
currentFileChanged
();
void
joinedAreaChanged
();
private
slots
:
void
recalcVehicleCorridor
();
...
...
src/WimaView/WimaToolBar.qml
View file @
a110c7f5
...
...
@@ -9,7 +9,7 @@ import QGroundControl.Controls 1.0
import
QGroundControl
.
FactControls
1.0
import
QGroundControl
.
Palette
1.0
// Toolbar for
Plan
View
// Toolbar for
Wima
View
Rectangle
{
id
:
_root
height
:
ScreenTools
.
toolbarHeight
...
...
@@ -21,7 +21,7 @@ Rectangle {
visible
:
false
anchors.bottomMargin
:
1
signal
show
WimaFlight
View
signal
show
Fly
View
property
var
planMasterController
property
var
currentMissionItem
///< Mission item to display status for
...
...
@@ -100,12 +100,12 @@ Rectangle {
id
:
settingsButton
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
source
:
"
/qmlimages/
TelemRSSI
.svg
"
source
:
"
/qmlimages/
PaperPlane
.svg
"
logo
:
true
checked
:
false
onClicked
:
{
checked
=
false
show
WimaFlight
View
()
show
Fly
View
()
}
}
}
...
...
src/WimaView/WimaView.qml
View file @
a110c7f5
This diff is collapsed.
Click to expand it.
src/ui/MainWindowInner.qml
View file @
a110c7f5
...
...
@@ -28,12 +28,14 @@ Item {
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
true
}
property
var
wimaController
property
bool
wimaAvailable
:
wimaViewLoader
.
wimaController
!==
undefined
property
var
currentPopUp
:
null
property
real
currentCenterX
:
0
property
var
activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
string
formatedMessage
:
activeVehicle
?
activeVehicle
.
formatedMessage
:
""
property
var
_viewList
:
[
settingsViewLoader
,
setupViewLoader
,
planViewLoader
,
wimaViewLoader
,
wimaFlightView
,
flightView
,
analyzeViewLoader
]
property
var
_viewList
:
[
settingsViewLoader
,
setupViewLoader
,
planViewLoader
,
wimaViewLoader
,
flightView
,
analyzeViewLoader
]
readonly
property
string
_settingsViewSource
:
"
AppSettings.qml
"
readonly
property
string
_setupViewSource
:
"
SetupView.qml
"
...
...
@@ -48,6 +50,17 @@ Item {
}
}
onWimaAvailableChanged
:
{
if
(
available
)
{
wimaController
=
wimaViewLoader
.
wimaController
console
.
log
(
"
WimaController connected
"
);
}
else
{
wimaController
=
undefined
}
}
function
disableToolbar
()
{
toolbarBlocker
.
enabled
=
true
}
...
...
@@ -75,7 +88,7 @@ Item {
if
(
settingsViewLoader
.
source
!=
_settingsViewSource
)
{
settingsViewLoader
.
source
=
_settingsViewSource
}
settingsViewLoader
.
visible
=
true
settingsViewLoader
.
visible
=
true
,
wimaFlightView
toolBar
.
checkSettingsButton
()
}
...
...
@@ -125,18 +138,6 @@ Item {
wimaToolBar
.
visible
=
true
}
function
showWimaFlightView
()
{
mainWindow
.
enableToolbar
()
rootLoader
.
sourceComponent
=
null
if
(
currentPopUp
)
{
currentPopUp
.
close
()
}
ScreenTools
.
availableHeight
=
parent
.
height
-
toolBar
.
height
hideAllViews
()
wimaFlightView
.
visible
=
true
toolBar
.
checkWimaFlyButton
()
}
function
showFlyView
()
{
mainWindow
.
enableToolbar
()
rootLoader
.
sourceComponent
=
null
...
...
@@ -219,6 +220,8 @@ Item {
visible
:
false
onYes
:
finishCloseProcess
()
function
check
()
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicle
)
{
activeConnectionsCloseDialog
.
open
()
...
...
@@ -323,7 +326,6 @@ Item {
onShowPlanView
:
mainWindow
.
showPlanView
()
onShowWimaView
:
mainWindow
.
showWimaView
()
onShowAnalyzeView
:
mainWindow
.
showAnalyzeView
()
onShowWimaFlightView
:
mainWindow
.
showWimaFlightView
()
onArmVehicle
:
flightView
.
guidedController
.
confirmAction
(
flightView
.
guidedController
.
actionArm
)
onDisarmVehicle
:
{
if
(
flightView
.
guidedController
.
showEmergenyStop
)
{
...
...
@@ -351,9 +353,9 @@ Item {
anchors.top
:
parent
.
top
z
:
toolBar
.
z
+
1
onShow
WimaFlight
View
:
{
onShow
Fly
View
:
{
wimaToolBar
.
visible
=
false
mainWindow
.
show
WimaFlight
View
()
mainWindow
.
show
Fly
View
()
}
}
...
...
@@ -396,7 +398,8 @@ Item {
visible
:
false
property
var
planToolBar
:
planToolBar
}
}
wimaController
:
wimaViewLoader
.
wimaController
?
wimaViewLoader
.
wimaController
:
undefined
Loader
{
id
:
planViewLoader
...
...
@@ -419,7 +422,7 @@ Item {
id
:
flightView
anchors.fill
:
parent
visible
:
true
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-- Loader helper for any child, no matter how deep can display an element
// on top of the video window.
Loader
{
...
...
@@ -428,19 +431,6 @@ Item {
}
}
FlightDisplayView
{
id
:
wimaFlightView
anchors.fill
:
parent
visible
:
true
//-------------------------------------------------------------------------
//-- Loader helper for any child, no matter how deep can display an element
// on top of the video window.
/*Loader {
id: rootVideoLoader
anchors.centerIn: parent
}*/
}
Loader
{
id
:
analyzeViewLoader
anchors.left
:
parent
.
left
...
...
src/ui/toolbar/MainToolBar.qml
View file @
a110c7f5
...
...
@@ -31,7 +31,6 @@ Rectangle {
signal
showSetupView
signal
showPlanView
signal
showWimaView
signal
showWimaFlightView
signal
showFlyView
signal
showAnalyzeView
signal
armVehicle
...
...
@@ -55,10 +54,6 @@ Rectangle {
wimaButton
.
checked
=
true
}
function
checkWimaFlyButton
()
{
wimaFlyButton
.
checked
=
true
}
function
checkFlyButton
()
{
flyButton
.
checked
=
true
}
...
...
@@ -69,7 +64,7 @@ Rectangle {
Component.onCompleted
:
{
//-- TODO: Get this from the actual state
plan
Button
.
checked
=
true
fly
Button
.
checked
=
true
}
// Prevent all clicks from going through to lower layers
...
...
@@ -149,15 +144,6 @@ Rectangle {
onClicked
:
toolBar
.
showWimaView
()
}
QGCToolBarButton
{
id
:
wimaFlyButton
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
exclusiveGroup
:
mainActionGroup
source
:
"
/qmlimages/TelemRSSI.svg
"
onClicked
:
toolBar
.
showWimaFlyView
()
}
QGCToolBarButton
{
id
:
analyzeButton
anchors.top
:
parent
.
top
...
...
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