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
72c1e9a3
Commit
72c1e9a3
authored
Oct 21, 2019
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
calc button added to plan view
parent
5456ee2a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
17 deletions
+35
-17
WimaPlaner.cc
src/Wima/WimaPlaner.cc
+24
-10
WimaPlaner.h
src/Wima/WimaPlaner.h
+2
-1
WimaToolBar.qml
src/WimaView/WimaToolBar.qml
+7
-6
WimaView.qml
src/WimaView/WimaView.qml
+2
-0
No files found.
src/Wima/WimaPlaner.cc
View file @
72c1e9a3
...
...
@@ -182,7 +182,6 @@ bool WimaPlaner::updateMission()
{
QString
errorString
;
setMissionReady
(
false
);
#define debug 0
if
(
!
recalcJoinedArea
(
errorString
))
{
...
...
@@ -252,18 +251,28 @@ bool WimaPlaner::updateMission()
if
(
survey
==
nullptr
){
qWarning
(
"WimaPlaner::updateMission(): survey == nullptr"
);
return
false
;
}
else
{
if
(
oldSurveyExists
)
{
survey
->
setRefPoint
(
oldSurveyRef
);
}
else
{
survey
->
setRefPoint
(
_measurementArea
.
center
());
}
}
if
(
oldSurveyExists
)
{
survey
->
setRefPoint
(
oldSurveyRef
);
survey
->
setAutoGenerated
(
true
);
// prevents reinitialisation from gui
survey
->
surveyAreaPolygon
()
->
clear
();
survey
->
surveyAreaPolygon
()
->
appendVertices
(
_measurementArea
.
coordinateList
());
disconnect
(
OldSurveyPt
->
deltaR
(),
&
Fact
::
rawValueChanged
,
this
,
&
WimaPlaner
::
resetMissionReady
);
disconnect
(
OldSurveyPt
->
deltaAlpha
(),
&
Fact
::
rawValueChanged
,
this
,
&
WimaPlaner
::
resetMissionReady
);
disconnect
(
OldSurveyPt
->
isSnakePath
(),
&
Fact
::
rawValueChanged
,
this
,
&
WimaPlaner
::
resetMissionReady
);
disconnect
(
OldSurveyPt
->
transectMinLength
(),
&
Fact
::
rawValueChanged
,
this
,
&
WimaPlaner
::
resetMissionReady
);
}
else
{
survey
->
setRefPoint
(
_measurementArea
.
center
());
}
survey
->
setAutoGenerated
(
true
);
// prevents reinitialisation from gui
survey
->
surveyAreaPolygon
()
->
clear
();
survey
->
surveyAreaPolygon
()
->
appendVertices
(
_measurementArea
.
coordinateList
());
connect
(
survey
->
deltaR
(),
&
Fact
::
rawValueChanged
,
this
,
&
WimaPlaner
::
resetMissionReady
);
connect
(
survey
->
deltaAlpha
(),
&
Fact
::
rawValueChanged
,
this
,
&
WimaPlaner
::
resetMissionReady
);
connect
(
survey
->
isSnakePath
(),
&
Fact
::
rawValueChanged
,
this
,
&
WimaPlaner
::
resetMissionReady
);
connect
(
survey
->
transectMinLength
(),
&
Fact
::
rawValueChanged
,
this
,
&
WimaPlaner
::
resetMissionReady
);
// calculate path from take off to opArea
if
(
survey
->
visualTransectPoints
().
size
()
==
0
)
{
...
...
@@ -652,6 +661,11 @@ void WimaPlaner::setMissionReady(bool ready)
}
}
void
WimaPlaner
::
resetMissionReady
()
{
setMissionReady
(
false
);
}
QJsonDocument
WimaPlaner
::
saveToJson
(
FileType
fileType
)
{
/// This function save all areas (of WimaPlaner) and all mission items (of MissionController) to a QJsonDocument
...
...
src/Wima/WimaPlaner.h
View file @
72c1e9a3
...
...
@@ -123,7 +123,8 @@ signals:
private
slots
:
void
recalcPolygonInteractivity
(
int
index
);
bool
recalcJoinedArea
(
QString
&
errorString
);
void
pushToContainer
();
void
pushToContainer
();
void
resetMissionReady
();
private:
// Member Functions
...
...
src/WimaView/WimaToolBar.qml
View file @
72c1e9a3
...
...
@@ -24,6 +24,7 @@ Rectangle {
signal
showFlyView
property
var
planMasterController
property
var
wimaPlaner
property
var
currentMissionItem
///< Mission item to display status for
property
var
missionItems
:
_controllerValid
?
planMasterController
.
missionController
.
visualItems
:
undefined
...
...
@@ -284,18 +285,18 @@ Rectangle {
anchors.rightMargin
:
_margins
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
_controllerDirty
?
qsTr
(
"
Upload Required
"
)
:
qsTr
(
"
Upload
"
)
enabled
:
!
_controllerSyncInProgress
visible
:
!
_controllerOffline
&&
!
_controllerSyncInProgress
&&
!
uploadCompleteText
.
visibl
e
primary
:
_controllerDirt
y
onClicked
:
planMasterController
.
upload
()
text
:
qsTr
(
"
Calculate
"
)
enabled
:
true
visible
:
tru
e
primary
:
!
wimaPlaner
.
missionRead
y
onClicked
:
wimaPlaner
.
updateMission
()
PropertyAnimation
on
opacity
{
easing.type
:
Easing
.
OutQuart
from
:
0.5
to
:
1
loops
:
Animation
.
Infinite
running
:
_controllerDirty
&&
!
_controllerSyncInProgress
running
:
!
wimaPlaner
.
missionReady
alwaysRunToEnd
:
true
duration
:
2000
}
...
...
src/WimaView/WimaView.qml
View file @
72c1e9a3
...
...
@@ -74,6 +74,8 @@ QGCView {
Component.onCompleted
:
{
toolbar
.
planMasterController
=
Qt
.
binding
(
function
()
{
return
_planMasterController
})
toolbar
.
currentMissionItem
=
Qt
.
binding
(
function
()
{
return
_missionController
.
currentPlanViewItem
})
toolbar
.
wimaPlaner
=
Qt
.
binding
(
function
()
{
return
_wimaPlaner
})
}
function
addComplexItem
(
complexItemName
)
{
...
...
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