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
87ae0874
Commit
87ae0874
authored
Jun 18, 2019
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
befor editing WimaView.qml (allow only one masterController)
parent
8f6a4a95
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
389 additions
and
172 deletions
+389
-172
WimaArea.cc
src/Wima/WimaArea.cc
+2
-0
WimaController.cc
src/Wima/WimaController.cc
+129
-25
WimaController.h
src/Wima/WimaController.h
+9
-6
WimaToolBar.qml
src/WimaView/WimaToolBar.qml
+3
-3
WimaView.qml
src/WimaView/WimaView.qml
+191
-124
MainWindowInner.qml
src/ui/MainWindowInner.qml
+37
-10
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+18
-4
No files found.
src/Wima/WimaArea.cc
View file @
87ae0874
...
@@ -127,6 +127,8 @@ void WimaArea::join(WimaArea &poly1, WimaArea &poly2, WimaArea &joinedPoly)
...
@@ -127,6 +127,8 @@ void WimaArea::join(WimaArea &poly1, WimaArea &poly2, WimaArea &joinedPoly)
if
(
poly1
.
count
()
>=
3
&&
poly2
.
count
()
>=
3
)
{
if
(
poly1
.
count
()
>=
3
&&
poly2
.
count
()
>=
3
)
{
joinedPoly
.
clear
();
poly1
.
verifyClockwiseWinding
();
poly1
.
verifyClockwiseWinding
();
poly2
.
verifyClockwiseWinding
();
poly2
.
verifyClockwiseWinding
();
...
...
src/Wima/WimaController.cc
View file @
87ae0874
...
@@ -45,7 +45,14 @@ void WimaController::setCurrentPolygonIndex(int index)
...
@@ -45,7 +45,14 @@ void WimaController::setCurrentPolygonIndex(int index)
void
WimaController
::
removeArea
(
int
index
)
void
WimaController
::
removeArea
(
int
index
)
{
{
if
(
index
>=
0
&&
index
<
_visualItems
->
count
()){
if
(
index
>=
0
&&
index
<
_visualItems
->
count
()){
_visualItems
->
removeAt
(
index
);
WimaArea
*
area
=
qobject_cast
<
WimaArea
*>
(
_visualItems
->
removeAt
(
index
));
if
(
area
==
nullptr
)
{
qWarning
(
"WimaController::removeArea(): nullptr catched, internal error."
);
return
;
}
disconnect
(
area
,
&
WimaArea
::
pathChanged
,
this
,
&
WimaController
::
updateJoinedArea
);
emit
visualItemsChanged
();
emit
visualItemsChanged
();
...
@@ -67,41 +74,88 @@ void WimaController::removeArea(int index)
...
@@ -67,41 +74,88 @@ void WimaController::removeArea(int index)
}
}
void
WimaController
::
addGOperationArea
()
bool
WimaController
::
addGOperationArea
()
{
{
WimaGOperationArea
*
newPoly
=
new
WimaGOperationArea
(
this
);
// check if opArea exists already
_visualItems
->
append
(
newPoly
);
WimaGOperationArea
*
opArea
=
nullptr
;
for
(
int
i
=
0
;
i
<
_visualItems
->
count
();
i
++
)
{
WimaGOperationArea
*
currentArea
=
qobject_cast
<
WimaGOperationArea
*>
(
_visualItems
->
get
(
i
));
if
(
currentArea
!=
nullptr
)
{
opArea
=
currentArea
;
return
false
;
}
}
// create one if no opArea available
opArea
=
new
WimaGOperationArea
(
this
);
connect
(
opArea
,
&
WimaArea
::
pathChanged
,
this
,
&
WimaController
::
updateJoinedArea
);
_visualItems
->
append
(
opArea
);
int
newIndex
=
_visualItems
->
count
()
-
1
;
int
newIndex
=
_visualItems
->
count
()
-
1
;
setCurrentPolygonIndex
(
newIndex
);
setCurrentPolygonIndex
(
newIndex
);
emit
visualItemsChanged
();
emit
visualItemsChanged
();
return
true
;
}
}
void
WimaController
::
addServiceArea
()
bool
WimaController
::
addServiceArea
()
{
{
WimaServiceArea
*
newPoly
=
new
WimaServiceArea
(
this
);
// check if serArea exists already
_visualItems
->
append
(
newPoly
);
WimaServiceArea
*
serArea
=
nullptr
;
for
(
int
i
=
0
;
i
<
_visualItems
->
count
();
i
++
)
{
WimaServiceArea
*
currentArea
=
qobject_cast
<
WimaServiceArea
*>
(
_visualItems
->
get
(
i
));
if
(
currentArea
!=
nullptr
)
{
serArea
=
currentArea
;
return
false
;
}
}
// create one if no serArea available
serArea
=
new
WimaServiceArea
(
this
);
connect
(
serArea
,
&
WimaArea
::
pathChanged
,
this
,
&
WimaController
::
updateJoinedArea
);
_visualItems
->
append
(
serArea
);
int
newIndex
=
_visualItems
->
count
()
-
1
;
int
newIndex
=
_visualItems
->
count
()
-
1
;
setCurrentPolygonIndex
(
newIndex
);
setCurrentPolygonIndex
(
newIndex
);
emit
visualItemsChanged
();
emit
visualItemsChanged
();
return
true
;
}
}
void
WimaController
::
addVehicleCorridor
()
bool
WimaController
::
addVehicleCorridor
()
{
{
WimaVCorridor
*
corridor
=
new
WimaVCorridor
(
this
);
// check if corridor exists already
WimaVCorridor
*
corridor
=
nullptr
;
for
(
int
i
=
0
;
i
<
_visualItems
->
count
();
i
++
)
{
WimaVCorridor
*
currentArea
=
qobject_cast
<
WimaVCorridor
*>
(
_visualItems
->
get
(
i
));
if
(
currentArea
!=
nullptr
)
{
corridor
=
currentArea
;
return
false
;
}
}
// create one if no corridor available
corridor
=
new
WimaVCorridor
(
this
);
connect
(
corridor
,
&
WimaArea
::
pathChanged
,
this
,
&
WimaController
::
updateJoinedArea
);
_visualItems
->
append
(
corridor
);
_visualItems
->
append
(
corridor
);
int
newIndex
=
_visualItems
->
count
()
-
1
;
int
newIndex
=
_visualItems
->
count
()
-
1
;
setCurrentPolygonIndex
(
newIndex
);
setCurrentPolygonIndex
(
newIndex
);
emit
visualItemsChanged
();
emit
visualItemsChanged
();
return
true
;
}
}
void
WimaController
::
removeAll
Areas
()
void
WimaController
::
removeAll
()
{
{
bool
changesApplied
=
false
;
bool
changesApplied
=
false
;
while
(
_visualItems
->
count
()
>
0
)
{
while
(
_visualItems
->
count
()
>
0
)
{
_visualItems
->
removeAt
(
0
);
removeArea
(
0
);
changesApplied
=
true
;
changesApplied
=
true
;
}
}
_missionController
->
removeAll
();
_currentFile
=
""
;
_currentFile
=
""
;
emit
currentFileChanged
();
emit
currentFileChanged
();
...
@@ -165,14 +219,7 @@ bool WimaController::updateMission()
...
@@ -165,14 +219,7 @@ bool WimaController::updateMission()
break
;
break
;
}
}
}
}
// join service area and op area
WimaArea
joinedArea
;
if
(
corridor
!=
nullptr
)
{
WimaArea
::
join
(
*
corridor
,
*
serArea
,
joinedArea
);
joinedArea
.
join
(
*
opArea
);
}
else
{
WimaArea
::
join
(
*
serArea
,
*
opArea
,
joinedArea
);
}
#if debug
#if debug
WimaArea
*
joinedAreaPt
=
new
WimaArea
(
joinedArea
,
this
);
WimaArea
*
joinedAreaPt
=
new
WimaArea
(
joinedArea
,
this
);
...
@@ -180,10 +227,23 @@ bool WimaController::updateMission()
...
@@ -180,10 +227,23 @@ bool WimaController::updateMission()
#endif
#endif
// extract survey if present
QmlObjectListModel
*
missionItems
=
_missionController
->
visualItems
();
SurveyComplexItem
*
oldSurveyItem
;
{
int
i
=
0
;
while
(
i
<
missionItems
->
count
()
)
{
oldSurveyItem
=
qobject_cast
<
SurveyComplexItem
*>
(
missionItems
->
get
(
i
));
if
(
oldSurveyItem
!=
nullptr
){
break
;
}
i
++
;
}
}
// reset visual items
// reset visual items
_missionController
->
removeAll
();
_missionController
->
removeAll
();
QmlObjectListModel
*
missionItems
=
_missionController
->
visualItems
();
missionItems
=
_missionController
->
visualItems
();
// set home position to serArea center
// set home position to serArea center
MissionSettingsItem
*
settingsItem
=
qobject_cast
<
MissionSettingsItem
*>
(
missionItems
->
get
(
0
));
MissionSettingsItem
*
settingsItem
=
qobject_cast
<
MissionSettingsItem
*>
(
missionItems
->
get
(
0
));
if
(
settingsItem
==
nullptr
){
if
(
settingsItem
==
nullptr
){
...
@@ -205,13 +265,14 @@ bool WimaController::updateMission()
...
@@ -205,13 +265,14 @@ bool WimaController::updateMission()
}
else
{
}
else
{
survey
->
surveyAreaPolygon
()
->
clear
();
survey
->
surveyAreaPolygon
()
->
clear
();
survey
->
surveyAreaPolygon
()
->
appendVertices
(
opArea
->
coordinateList
());
survey
->
surveyAreaPolygon
()
->
appendVertices
(
opArea
->
coordinateList
());
//survey->
}
}
// calculate path from take off to opArea
// calculate path from take off to opArea
QGeoCoordinate
start
=
serArea
->
center
();
QGeoCoordinate
start
=
serArea
->
center
();
QGeoCoordinate
end
=
survey
->
visualTransectPoints
().
first
().
value
<
QGeoCoordinate
>
();
QGeoCoordinate
end
=
survey
->
visualTransectPoints
().
first
().
value
<
QGeoCoordinate
>
();
QList
<
QGeoCoordinate
>
path
;
QList
<
QGeoCoordinate
>
path
;
WimaArea
::
dijkstraPath
(
start
,
end
,
joinedArea
,
path
);
WimaArea
::
dijkstraPath
(
start
,
end
,
_
joinedArea
,
path
);
for
(
int
i
=
1
;
i
<
path
.
count
()
-
1
;
i
++
)
{
for
(
int
i
=
1
;
i
<
path
.
count
()
-
1
;
i
++
)
{
_missionController
->
insertSimpleMissionItem
(
path
.
value
(
i
),
i
+
1
);
_missionController
->
insertSimpleMissionItem
(
path
.
value
(
i
),
i
+
1
);
index
++
;
index
++
;
...
@@ -221,7 +282,7 @@ bool WimaController::updateMission()
...
@@ -221,7 +282,7 @@ bool WimaController::updateMission()
start
=
survey
->
visualTransectPoints
().
last
().
value
<
QGeoCoordinate
>
();
start
=
survey
->
visualTransectPoints
().
last
().
value
<
QGeoCoordinate
>
();
end
=
serArea
->
center
();
end
=
serArea
->
center
();
path
.
clear
();
path
.
clear
();
WimaArea
::
dijkstraPath
(
start
,
end
,
joinedArea
,
path
);
WimaArea
::
dijkstraPath
(
start
,
end
,
_
joinedArea
,
path
);
for
(
int
i
=
1
;
i
<
path
.
count
()
-
1
;
i
++
)
{
for
(
int
i
=
1
;
i
<
path
.
count
()
-
1
;
i
++
)
{
_missionController
->
insertSimpleMissionItem
(
path
.
value
(
i
),
index
++
);
_missionController
->
insertSimpleMissionItem
(
path
.
value
(
i
),
index
++
);
}
}
...
@@ -240,9 +301,6 @@ bool WimaController::updateMission()
...
@@ -240,9 +301,6 @@ bool WimaController::updateMission()
}
}
}
}
//saveToFile("TestFile.wima");
//loadFromFile("TestFile.wima");
return
true
;
return
true
;
}
}
...
@@ -376,6 +434,7 @@ bool WimaController::loadFromFile(const QString &filename)
...
@@ -376,6 +434,7 @@ bool WimaController::loadFromFile(const QString &filename)
_currentFile
.
sprintf
(
"%s/%s.%s"
,
fileInfo
.
path
().
toLocal8Bit
().
data
(),
fileInfo
.
completeBaseName
().
toLocal8Bit
().
data
(),
wimaFileExtension
);
_currentFile
.
sprintf
(
"%s/%s.%s"
,
fileInfo
.
path
().
toLocal8Bit
().
data
(),
fileInfo
.
completeBaseName
().
toLocal8Bit
().
data
(),
wimaFileExtension
);
emit
currentFileChanged
();
emit
currentFileChanged
();
updateJoinedArea
();
return
true
;
return
true
;
...
@@ -410,6 +469,51 @@ void WimaController::recalcPolygonInteractivity(int index)
...
@@ -410,6 +469,51 @@ void WimaController::recalcPolygonInteractivity(int index)
}
}
}
}
void
WimaController
::
updateJoinedArea
()
{
// pick first WimaGOperationArea
WimaGOperationArea
*
opArea
=
nullptr
;
for
(
int
i
=
0
;
i
<
_visualItems
->
count
();
i
++
)
{
WimaGOperationArea
*
currentArea
=
qobject_cast
<
WimaGOperationArea
*>
(
_visualItems
->
get
(
i
));
if
(
currentArea
!=
nullptr
){
opArea
=
currentArea
;
break
;
}
}
if
(
opArea
==
nullptr
)
return
;
// pick first WimaServiceArea
WimaServiceArea
*
serArea
=
nullptr
;
for
(
int
i
=
0
;
i
<
_visualItems
->
count
();
i
++
)
{
WimaServiceArea
*
currentArea
=
qobject_cast
<
WimaServiceArea
*>
(
_visualItems
->
get
(
i
));
if
(
currentArea
!=
nullptr
){
serArea
=
currentArea
;
break
;
}
}
if
(
serArea
==
nullptr
)
return
;
// pick first WimaVCorridor
WimaVCorridor
*
corridor
=
nullptr
;
for
(
int
i
=
0
;
i
<
_visualItems
->
count
();
i
++
)
{
WimaVCorridor
*
currentArea
=
qobject_cast
<
WimaVCorridor
*>
(
_visualItems
->
get
(
i
));
if
(
currentArea
!=
nullptr
){
corridor
=
currentArea
;
break
;
}
}
// join service area, op area and corridor
if
(
corridor
!=
nullptr
)
{
WimaArea
::
join
(
*
corridor
,
*
serArea
,
_joinedArea
);
_joinedArea
.
join
(
*
opArea
);
}
else
{
WimaArea
::
join
(
*
serArea
,
*
opArea
,
_joinedArea
);
}
}
void
WimaController
::
resetAllInteractive
()
void
WimaController
::
resetAllInteractive
()
{
{
int
itemCount
=
_visualItems
->
count
();
int
itemCount
=
_visualItems
->
count
();
...
...
src/Wima/WimaController.h
View file @
87ae0874
...
@@ -33,6 +33,7 @@ public:
...
@@ -33,6 +33,7 @@ public:
Q_PROPERTY
(
QString
currentFile
READ
currentFile
NOTIFY
currentFileChanged
)
Q_PROPERTY
(
QString
currentFile
READ
currentFile
NOTIFY
currentFileChanged
)
Q_PROPERTY
(
QStringList
loadNameFilters
READ
loadNameFilters
CONSTANT
)
Q_PROPERTY
(
QStringList
loadNameFilters
READ
loadNameFilters
CONSTANT
)
Q_PROPERTY
(
QString
fileExtension
READ
fileExtension
CONSTANT
)
Q_PROPERTY
(
QString
fileExtension
READ
fileExtension
CONSTANT
)
Q_PROPERTY
(
QGeoCoordinate
joinedAreaCenter
READ
joinedAreaCenter
CONSTANT
)
// Property accessors
// Property accessors
...
@@ -42,7 +43,8 @@ public:
...
@@ -42,7 +43,8 @@ public:
int
currentPolygonIndex
(
void
)
const
{
return
_currentPolygonIndex
;
}
int
currentPolygonIndex
(
void
)
const
{
return
_currentPolygonIndex
;
}
QString
currentFile
(
void
)
const
{
return
_currentFile
;
}
QString
currentFile
(
void
)
const
{
return
_currentFile
;
}
QStringList
loadNameFilters
(
void
)
const
;
QStringList
loadNameFilters
(
void
)
const
;
QString
fileExtension
(
void
)
const
{
return
wimaFileExtension
;
}
QString
fileExtension
(
void
)
const
{
return
wimaFileExtension
;
}
QGeoCoordinate
joinedAreaCenter
(
void
)
const
{
return
_joinedArea
.
center
();
}
...
@@ -52,14 +54,13 @@ public:
...
@@ -52,14 +54,13 @@ public:
/// Sets the integer index pointing to the current polygon. Current polygon is set interactive.
/// Sets the integer index pointing to the current polygon. Current polygon is set interactive.
void
setCurrentPolygonIndex
(
int
index
);
void
setCurrentPolygonIndex
(
int
index
);
Q_INVOKABLE
void
addGOperationArea
();
Q_INVOKABLE
bool
addGOperationArea
();
/// Removes an area from _visualItems
/// Removes an area from _visualItems
/// @param index Index of the area to be removed
/// @param index Index of the area to be removed
Q_INVOKABLE
void
removeArea
(
int
index
);
Q_INVOKABLE
void
removeArea
(
int
index
);
Q_INVOKABLE
void
addServiceArea
();
Q_INVOKABLE
bool
addServiceArea
();
/// @return true if a vehicle corridor was added sucessfully and false otherwise.
Q_INVOKABLE
bool
addVehicleCorridor
();
Q_INVOKABLE
void
addVehicleCorridor
();
Q_INVOKABLE
void
removeAll
();
Q_INVOKABLE
void
removeAllAreas
();
Q_INVOKABLE
void
startMission
();
Q_INVOKABLE
void
startMission
();
Q_INVOKABLE
void
abortMission
();
Q_INVOKABLE
void
abortMission
();
...
@@ -97,11 +98,13 @@ private slots:
...
@@ -97,11 +98,13 @@ private slots:
void
recalcVehicleMeasurementAreas
();
void
recalcVehicleMeasurementAreas
();
void
recalcAll
();
void
recalcAll
();
void
recalcPolygonInteractivity
(
int
index
);
void
recalcPolygonInteractivity
(
int
index
);
void
updateJoinedArea
();
private:
private:
bool
_planView
;
bool
_planView
;
QmlObjectListModel
*
_visualItems
;
QmlObjectListModel
*
_visualItems
;
WimaArea
_joinedArea
;
PlanMasterController
*
_masterController
;
PlanMasterController
*
_masterController
;
MissionController
*
_missionController
;
MissionController
*
_missionController
;
int
_currentPolygonIndex
;
int
_currentPolygonIndex
;
...
...
src/WimaView/WimaToolBar.qml
View file @
87ae0874
...
@@ -21,7 +21,7 @@ Rectangle {
...
@@ -21,7 +21,7 @@ Rectangle {
visible
:
false
visible
:
false
anchors.bottomMargin
:
1
anchors.bottomMargin
:
1
signal
show
Fly
View
signal
show
WimaFlight
View
property
var
planMasterController
property
var
planMasterController
property
var
currentMissionItem
///< Mission item to display status for
property
var
currentMissionItem
///< Mission item to display status for
...
@@ -100,12 +100,12 @@ Rectangle {
...
@@ -100,12 +100,12 @@ Rectangle {
id
:
settingsButton
id
:
settingsButton
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
source
:
"
/qmlimages/
PaperPlane
.svg
"
source
:
"
/qmlimages/
TelemRSSI
.svg
"
logo
:
true
logo
:
true
checked
:
false
checked
:
false
onClicked
:
{
onClicked
:
{
checked
=
false
checked
=
false
show
Fly
View
()
show
WimaFlight
View
()
}
}
}
}
}
}
...
...
src/WimaView/WimaView.qml
View file @
87ae0874
This diff is collapsed.
Click to expand it.
src/ui/MainWindowInner.qml
View file @
87ae0874
...
@@ -33,7 +33,7 @@ Item {
...
@@ -33,7 +33,7 @@ Item {
property
var
activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
string
formatedMessage
:
activeVehicle
?
activeVehicle
.
formatedMessage
:
""
property
string
formatedMessage
:
activeVehicle
?
activeVehicle
.
formatedMessage
:
""
property
var
_viewList
:
[
settingsViewLoader
,
setupViewLoader
,
planViewLoader
,
wimaViewLoader
,
flightView
,
analyzeViewLoader
]
property
var
_viewList
:
[
settingsViewLoader
,
setupViewLoader
,
planViewLoader
,
wimaViewLoader
,
wimaFlightView
,
flightView
,
analyzeViewLoader
]
readonly
property
string
_settingsViewSource
:
"
AppSettings.qml
"
readonly
property
string
_settingsViewSource
:
"
AppSettings.qml
"
readonly
property
string
_setupViewSource
:
"
SetupView.qml
"
readonly
property
string
_setupViewSource
:
"
SetupView.qml
"
...
@@ -125,6 +125,18 @@ Item {
...
@@ -125,6 +125,18 @@ Item {
wimaToolBar
.
visible
=
true
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
()
{
function
showFlyView
()
{
mainWindow
.
enableToolbar
()
mainWindow
.
enableToolbar
()
rootLoader
.
sourceComponent
=
null
rootLoader
.
sourceComponent
=
null
...
@@ -301,7 +313,7 @@ Item {
...
@@ -301,7 +313,7 @@ Item {
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
opacity
:
planToolBar
.
visible
?
0
:
1
opacity
:
planToolBar
.
visible
||
wimaToolBar
.
visible
?
0
:
1
z
:
QGroundControl
.
zOrderTopMost
z
:
QGroundControl
.
zOrderTopMost
Component.onCompleted
:
ScreenTools
.
availableHeight
=
parent
.
height
-
toolBar
.
height
Component.onCompleted
:
ScreenTools
.
availableHeight
=
parent
.
height
-
toolBar
.
height
...
@@ -311,6 +323,7 @@ Item {
...
@@ -311,6 +323,7 @@ Item {
onShowPlanView
:
mainWindow
.
showPlanView
()
onShowPlanView
:
mainWindow
.
showPlanView
()
onShowWimaView
:
mainWindow
.
showWimaView
()
onShowWimaView
:
mainWindow
.
showWimaView
()
onShowAnalyzeView
:
mainWindow
.
showAnalyzeView
()
onShowAnalyzeView
:
mainWindow
.
showAnalyzeView
()
onShowWimaFlightView
:
mainWindow
.
showWimaFlightView
()
onArmVehicle
:
flightView
.
guidedController
.
confirmAction
(
flightView
.
guidedController
.
actionArm
)
onArmVehicle
:
flightView
.
guidedController
.
confirmAction
(
flightView
.
guidedController
.
actionArm
)
onDisarmVehicle
:
{
onDisarmVehicle
:
{
if
(
flightView
.
guidedController
.
showEmergenyStop
)
{
if
(
flightView
.
guidedController
.
showEmergenyStop
)
{
...
@@ -330,22 +343,22 @@ Item {
...
@@ -330,22 +343,22 @@ Item {
}
}
}
}
Plan
ToolBar
{
Wima
ToolBar
{
id
:
plan
ToolBar
id
:
wima
ToolBar
height
:
ScreenTools
.
toolbarHeight
height
:
ScreenTools
.
toolbarHeight
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
z
:
toolBar
.
z
+
1
z
:
toolBar
.
z
+
1
onShow
Fly
View
:
{
onShow
WimaFlight
View
:
{
plan
ToolBar
.
visible
=
false
wima
ToolBar
.
visible
=
false
mainWindow
.
show
Fly
View
()
mainWindow
.
show
WimaFlight
View
()
}
}
}
}
Wima
ToolBar
{
Plan
ToolBar
{
id
:
wima
ToolBar
id
:
plan
ToolBar
height
:
ScreenTools
.
toolbarHeight
height
:
ScreenTools
.
toolbarHeight
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
...
@@ -353,7 +366,7 @@ Item {
...
@@ -353,7 +366,7 @@ Item {
z
:
toolBar
.
z
+
1
z
:
toolBar
.
z
+
1
onShowFlyView
:
{
onShowFlyView
:
{
wima
ToolBar
.
visible
=
false
plan
ToolBar
.
visible
=
false
mainWindow
.
showFlyView
()
mainWindow
.
showFlyView
()
}
}
}
}
...
@@ -401,6 +414,7 @@ Item {
...
@@ -401,6 +414,7 @@ Item {
property
var
toolbar
:
wimaToolBar
property
var
toolbar
:
wimaToolBar
}
}
FlightDisplayView
{
FlightDisplayView
{
id
:
flightView
id
:
flightView
anchors.fill
:
parent
anchors.fill
:
parent
...
@@ -414,6 +428,19 @@ Item {
...
@@ -414,6 +428,19 @@ 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
{
Loader
{
id
:
analyzeViewLoader
id
:
analyzeViewLoader
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
...
...
src/ui/toolbar/MainToolBar.qml
View file @
87ae0874
...
@@ -31,6 +31,7 @@ Rectangle {
...
@@ -31,6 +31,7 @@ Rectangle {
signal
showSetupView
signal
showSetupView
signal
showPlanView
signal
showPlanView
signal
showWimaView
signal
showWimaView
signal
showWimaFlightView
signal
showFlyView
signal
showFlyView
signal
showAnalyzeView
signal
showAnalyzeView
signal
armVehicle
signal
armVehicle
...
@@ -54,6 +55,10 @@ Rectangle {
...
@@ -54,6 +55,10 @@ Rectangle {
wimaButton
.
checked
=
true
wimaButton
.
checked
=
true
}
}
function
checkWimaFlyButton
()
{
wimaFlyButton
.
checked
=
true
}
function
checkFlyButton
()
{
function
checkFlyButton
()
{
flyButton
.
checked
=
true
flyButton
.
checked
=
true
}
}
...
@@ -64,7 +69,7 @@ Rectangle {
...
@@ -64,7 +69,7 @@ Rectangle {
Component.onCompleted
:
{
Component.onCompleted
:
{
//-- TODO: Get this from the actual state
//-- TODO: Get this from the actual state
fly
Button
.
checked
=
true
plan
Button
.
checked
=
true
}
}
// Prevent all clicks from going through to lower layers
// Prevent all clicks from going through to lower layers
...
@@ -126,6 +131,15 @@ Rectangle {
...
@@ -126,6 +131,15 @@ Rectangle {
onClicked
:
toolBar
.
showPlanView
()
onClicked
:
toolBar
.
showPlanView
()
}
}
QGCToolBarButton
{
id
:
flyButton
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
exclusiveGroup
:
mainActionGroup
source
:
"
/qmlimages/PaperPlane.svg
"
onClicked
:
toolBar
.
showFlyView
()
}
QGCToolBarButton
{
QGCToolBarButton
{
id
:
wimaButton
id
:
wimaButton
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
...
@@ -136,12 +150,12 @@ Rectangle {
...
@@ -136,12 +150,12 @@ Rectangle {
}
}
QGCToolBarButton
{
QGCToolBarButton
{
id
:
f
lyButton
id
:
wimaF
lyButton
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
exclusiveGroup
:
mainActionGroup
exclusiveGroup
:
mainActionGroup
source
:
"
/qmlimages/
PaperPlane
.svg
"
source
:
"
/qmlimages/
TelemRSSI
.svg
"
onClicked
:
toolBar
.
showFlyView
()
onClicked
:
toolBar
.
show
Wima
FlyView
()
}
}
QGCToolBarButton
{
QGCToolBarButton
{
...
...
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