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
29fb812c
Commit
29fb812c
authored
Sep 11, 2019
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fact gui problem solved
parent
5303a227
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
54 deletions
+45
-54
SettingsFact.cc
src/FactSystem/SettingsFact.cc
+1
-1
CircularSurveyItemEditor.qml
src/PlanView/CircularSurveyItemEditor.qml
+9
-9
CircularSurvey.SettingsGroup.json
src/Wima/CircularSurvey.SettingsGroup.json
+1
-0
CircularSurveyComplexItem.cc
src/Wima/CircularSurveyComplexItem.cc
+2
-5
CircularSurveyComplexItem.h
src/Wima/CircularSurveyComplexItem.h
+1
-0
WimaMeasurementArea.cc
src/Wima/WimaMeasurementArea.cc
+12
-10
WimaPlaner.cc
src/Wima/WimaPlaner.cc
+0
-6
WimaMeasurementAreaEditor.qml
src/WimaView/WimaMeasurementAreaEditor.qml
+6
-22
WimaView.qml
src/WimaView/WimaView.qml
+13
-1
No files found.
src/FactSystem/SettingsFact.cc
View file @
29fb812c
...
@@ -39,7 +39,7 @@ SettingsFact::SettingsFact(QString settingsGroup, FactMetaData* metaData, QObjec
...
@@ -39,7 +39,7 @@ SettingsFact::SettingsFact(QString settingsGroup, FactMetaData* metaData, QObjec
if
(
_visible
)
{
if
(
_visible
)
{
QVariant
typedValue
;
QVariant
typedValue
;
QString
errorString
;
QString
errorString
;
metaData
->
convertAndValidateRaw
(
settings
.
value
(
_name
,
rawDefaultValue
),
true
/* conertOnly */
,
typedValue
,
errorString
);
metaData
->
convertAndValidateRaw
(
settings
.
value
(
_name
,
rawDefaultValue
),
true
/* con
v
ertOnly */
,
typedValue
,
errorString
);
_rawValue
=
typedValue
;
_rawValue
=
typedValue
;
}
else
{
}
else
{
// Setting is not visible, force to default value always
// Setting is not visible, force to default value always
...
...
src/PlanView/CircularSurveyItemEditor.qml
View file @
29fb812c
...
@@ -104,22 +104,22 @@ Rectangle {
...
@@ -104,22 +104,22 @@ Rectangle {
FactTextField
{
FactTextField
{
fact
:
missionItem
.
deltaAlpha
fact
:
missionItem
.
deltaAlpha
Layout.fillWidth
:
true
Layout.fillWidth
:
true
onUpdated
:
angleSlider
.
value
=
missionItem
.
deltaAlpha
.
value
//
onUpdated: angleSlider.value = missionItem.deltaAlpha.value
}
}
QGCSlider
{
/*
QGCSlider {
id: angleSlider
id: angleSlider
minimumValue
:
0.
3
minimumValue: 0.
4
maximumValue
:
5
maximumValue:
20
stepSize
:
0.
1
stepSize: 1
tickmarksEnabled
:
fals
e
tickmarksEnabled:
tru
e
Layout.fillWidth: true
Layout.fillWidth: true
Layout.columnSpan: 2
Layout.columnSpan: 2
Layout.preferredHeight: ScreenTools.defaultFontPixelHeight * 1.5
Layout.preferredHeight: ScreenTools.defaultFontPixelHeight * 1.5
onValueChanged
:
missionItem
.
deltaAlpha
.
value
=
value
Component.onCompleted: value = missionItem.deltaAlpha.value
Component.onCompleted: value = missionItem.deltaAlpha.value
updateValueWhileDragging
:
true
onValueChanged: missionItem.deltaAlpha.value = value
}
updateValueWhileDragging: false
}*/
}
}
ColumnLayout
{
ColumnLayout
{
...
...
src/Wima/CircularSurvey.SettingsGroup.json
View file @
29fb812c
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
"type"
:
"double"
,
"type"
:
"double"
,
"units"
:
"Deg"
,
"units"
:
"Deg"
,
"min"
:
0.3
,
"min"
:
0.3
,
"max"
:
90
,
"decimalPlaces"
:
1
,
"decimalPlaces"
:
1
,
"defaultValue"
:
5
"defaultValue"
:
5
}
}
...
...
src/Wima/CircularSurveyComplexItem.cc
View file @
29fb812c
...
@@ -27,11 +27,6 @@ CircularSurveyComplexItem::CircularSurveyComplexItem(Vehicle *vehicle, bool flyV
...
@@ -27,11 +27,6 @@ CircularSurveyComplexItem::CircularSurveyComplexItem(Vehicle *vehicle, bool flyV
connect
(
&
_deltaAlpha
,
&
Fact
::
valueChanged
,
this
,
&
CircularSurveyComplexItem
::
_setDirty
);
connect
(
&
_deltaAlpha
,
&
Fact
::
valueChanged
,
this
,
&
CircularSurveyComplexItem
::
_setDirty
);
connect
(
this
,
&
CircularSurveyComplexItem
::
refPointChanged
,
this
,
&
CircularSurveyComplexItem
::
_setDirty
);
connect
(
this
,
&
CircularSurveyComplexItem
::
refPointChanged
,
this
,
&
CircularSurveyComplexItem
::
_setDirty
);
_deltaR
.
setRawValue
(
_deltaR
.
rawDefaultValue
());
_deltaAlpha
.
setRawValue
(
_deltaAlpha
.
rawDefaultValue
());
qDebug
()
<<
_deltaAlpha
.
rawDefaultValue
().
toDouble
();
qDebug
()
<<
_deltaAlpha
.
rawValue
().
toDouble
();
connect
(
&
_updateTimer
,
&
QTimer
::
timeout
,
this
,
&
CircularSurveyComplexItem
::
_updateItem
);
connect
(
&
_updateTimer
,
&
QTimer
::
timeout
,
this
,
&
CircularSurveyComplexItem
::
_updateItem
);
_updateTimer
.
start
(
100
);
_updateTimer
.
start
(
100
);
}
}
...
@@ -337,6 +332,8 @@ void CircularSurveyComplexItem::_rebuildTransectsPhase1()
...
@@ -337,6 +332,8 @@ void CircularSurveyComplexItem::_rebuildTransectsPhase1()
using
namespace
PolygonCalculus
;
using
namespace
PolygonCalculus
;
using
namespace
PlanimetryCalculus
;
using
namespace
PlanimetryCalculus
;
if
(
_surveyAreaPolygon
.
count
()
<
3
)
if
(
_surveyAreaPolygon
.
count
()
<
3
)
return
;
return
;
...
...
src/Wima/CircularSurveyComplexItem.h
View file @
29fb812c
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
#include "GeoUtilities.h"
#include "GeoUtilities.h"
#include "QVector"
#include "QVector"
#include "Circle.h"
#include "Circle.h"
#include "SettingsFact.h"
class
CircularSurveyComplexItem
:
public
TransectStyleComplexItem
class
CircularSurveyComplexItem
:
public
TransectStyleComplexItem
{
{
...
...
src/Wima/WimaMeasurementArea.cc
View file @
29fb812c
...
@@ -10,13 +10,23 @@ const char* WimaMeasurementArea::WimaMeasurementAreaName = "Measurement
...
@@ -10,13 +10,23 @@ const char* WimaMeasurementArea::WimaMeasurementAreaName = "Measurement
WimaMeasurementArea
::
WimaMeasurementArea
(
QObject
*
parent
)
WimaMeasurementArea
::
WimaMeasurementArea
(
QObject
*
parent
)
:
WimaArea
(
parent
)
:
WimaArea
(
parent
)
,
_metaDataMap
(
FactMetaData
::
createMapFromJsonFile
(
QStringLiteral
(
":/json/WimaMeasurementArea.SettingsGroup.json"
),
this
/* QObject parent */
))
,
_bottomLayerAltitude
(
SettingsFact
(
settingsGroup
,
_metaDataMap
[
bottomLayerAltitudeName
],
this
/* QObject parent */
))
,
_numberOfLayers
(
SettingsFact
(
settingsGroup
,
_metaDataMap
[
numberOfLayersName
],
this
/* QObject parent */
))
,
_layerDistance
(
SettingsFact
(
settingsGroup
,
_metaDataMap
[
layerDistanceName
],
this
/* QObject parent */
))
,
_borderPolygonOffset
(
SettingsFact
(
settingsGroup
,
_metaDataMap
[
borderPolygonOffsetName
],
this
/* QObject parent */
))
{
{
init
();
init
();
}
}
WimaMeasurementArea
::
WimaMeasurementArea
(
const
WimaMeasurementArea
&
other
,
QObject
*
parent
)
WimaMeasurementArea
::
WimaMeasurementArea
(
const
WimaMeasurementArea
&
other
,
QObject
*
parent
)
:
WimaArea
(
other
,
parent
)
:
WimaArea
(
other
,
parent
)
,
_metaDataMap
(
FactMetaData
::
createMapFromJsonFile
(
QStringLiteral
(
":/json/WimaMeasurementArea.SettingsGroup.json"
),
this
/* QObject parent */
))
,
_bottomLayerAltitude
(
SettingsFact
(
settingsGroup
,
_metaDataMap
[
bottomLayerAltitudeName
],
this
/* QObject parent */
))
,
_numberOfLayers
(
SettingsFact
(
settingsGroup
,
_metaDataMap
[
numberOfLayersName
],
this
/* QObject parent */
))
,
_layerDistance
(
SettingsFact
(
settingsGroup
,
_metaDataMap
[
layerDistanceName
],
this
/* QObject parent */
))
,
_borderPolygonOffset
(
SettingsFact
(
settingsGroup
,
_metaDataMap
[
borderPolygonOffsetName
],
this
/* QObject parent */
))
{
{
init
();
init
();
}
}
...
@@ -150,14 +160,6 @@ void WimaMeasurementArea::recalcBorderPolygon()
...
@@ -150,14 +160,6 @@ void WimaMeasurementArea::recalcBorderPolygon()
void
WimaMeasurementArea
::
init
()
void
WimaMeasurementArea
::
init
()
{
{
_metaDataMap
=
FactMetaData
::
createMapFromJsonFile
(
QStringLiteral
(
":/json/WimaMeasurementArea.SettingsGroup.json"
),
this
/* QObject parent */
);
_bottomLayerAltitude
=
SettingsFact
(
settingsGroup
,
_metaDataMap
[
bottomLayerAltitudeName
],
this
/* QObject parent */
);
_numberOfLayers
=
SettingsFact
(
settingsGroup
,
_metaDataMap
[
numberOfLayersName
],
this
/* QObject parent */
);
_layerDistance
=
SettingsFact
(
settingsGroup
,
_metaDataMap
[
layerDistanceName
],
this
/* QObject parent */
);
_borderPolygonOffset
=
SettingsFact
(
settingsGroup
,
_metaDataMap
[
borderPolygonOffsetName
],
this
/* QObject parent */
);
_borderPolygon
=
new
QGCMapPolygon
(
this
);
this
->
setObjectName
(
WimaMeasurementAreaName
);
this
->
setObjectName
(
WimaMeasurementAreaName
);
connect
(
this
,
&
WimaMeasurementArea
::
pathChanged
,
this
,
&
WimaMeasurementArea
::
recalcBorderPolygon
);
connect
(
this
,
&
WimaMeasurementArea
::
pathChanged
,
this
,
&
WimaMeasurementArea
::
recalcBorderPolygon
);
connect
(
&
_borderPolygonOffset
,
&
SettingsFact
::
rawValueChanged
,
this
,
&
WimaMeasurementArea
::
recalcBorderPolygon
);
connect
(
&
_borderPolygonOffset
,
&
SettingsFact
::
rawValueChanged
,
this
,
&
WimaMeasurementArea
::
recalcBorderPolygon
);
...
...
src/Wima/WimaPlaner.cc
View file @
29fb812c
...
@@ -220,16 +220,12 @@ bool WimaPlaner::updateMission()
...
@@ -220,16 +220,12 @@ bool WimaPlaner::updateMission()
CircularSurveyComplexItem
*
OldSurveyPt
=
nullptr
;
CircularSurveyComplexItem
*
OldSurveyPt
=
nullptr
;
QGeoCoordinate
oldSurveyRef
;
QGeoCoordinate
oldSurveyRef
;
double
oldSurveyDeltaR
=
0
;
double
oldSurveyDeltaAlpha
=
0
;
bool
oldSurveyExists
=
false
;
bool
oldSurveyExists
=
false
;
for
(
int
i
=
0
;
i
<
_missionController
->
visualItems
()
->
count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
_missionController
->
visualItems
()
->
count
();
i
++
)
{
OldSurveyPt
=
qobject_cast
<
CircularSurveyComplexItem
*>
(
missionItems
->
get
(
i
));
OldSurveyPt
=
qobject_cast
<
CircularSurveyComplexItem
*>
(
missionItems
->
get
(
i
));
if
(
OldSurveyPt
!=
nullptr
)
{
if
(
OldSurveyPt
!=
nullptr
)
{
oldSurveyRef
=
OldSurveyPt
->
refPoint
();
oldSurveyRef
=
OldSurveyPt
->
refPoint
();
oldSurveyDeltaR
=
OldSurveyPt
->
deltaR
()
->
rawValue
().
toDouble
();
oldSurveyDeltaAlpha
=
OldSurveyPt
->
deltaAlpha
()
->
rawValue
().
toDouble
();
oldSurveyExists
=
true
;
oldSurveyExists
=
true
;
break
;
break
;
}
}
...
@@ -276,8 +272,6 @@ bool WimaPlaner::updateMission()
...
@@ -276,8 +272,6 @@ bool WimaPlaner::updateMission()
}
else
{
}
else
{
if
(
oldSurveyExists
)
{
if
(
oldSurveyExists
)
{
survey
->
setRefPoint
(
oldSurveyRef
);
survey
->
setRefPoint
(
oldSurveyRef
);
survey
->
deltaR
()
->
setRawValue
(
oldSurveyDeltaR
);
survey
->
deltaAlpha
()
->
setRawValue
(
oldSurveyDeltaAlpha
);
}
else
{
}
else
{
survey
->
setRefPoint
(
_measurementArea
.
center
());
survey
->
setRefPoint
(
_measurementArea
.
center
());
}
}
...
...
src/WimaView/WimaMeasurementAreaEditor.qml
View file @
29fb812c
...
@@ -33,26 +33,10 @@ Rectangle {
...
@@ -33,26 +33,10 @@ Rectangle {
property
var
polygon
:
areaItem
property
var
polygon
:
areaItem
property
bool
initNecesarry
:
true
property
bool
initNecesarry
:
true
/*onPolylineInteractiveChanged: {
polyline.interactive = polylineInteractive;
}*/
onPolygonInteractiveChanged
:
{
onPolygonInteractiveChanged
:
{
polygon
.
interactive
=
polygonInteractive
;
polygon
.
interactive
=
polygonInteractive
;
}
}
/*function editPolyline(){
if (polylineInteractive){
//polyline.interactive = false;
polylineInteractive = false;
//polygonInteractive = true;
}else{
//polyline.interactive = true;
polylineInteractive = true;
//polygonInteractive = false;
}
}*/
...
@@ -73,7 +57,7 @@ Rectangle {
...
@@ -73,7 +57,7 @@ Rectangle {
Column
{
Column
{
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
setI
anchors.right
:
parent
.
right
spacing
:
_margin
spacing
:
_margin
visible
:
settingsHeader
.
checked
visible
:
settingsHeader
.
checked
...
@@ -87,29 +71,29 @@ Rectangle {
...
@@ -87,29 +71,29 @@ Rectangle {
QGCLabel
{
text
:
qsTr
(
"
Altitude
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Altitude
"
)
}
FactTextField
{
FactTextField
{
fact
:
areaItem
.
bottomLayerAltitude
fact
:
areaItem
.
bottomLayerAltitude
Layout.
alignment
:
Qt
.
AlignLeft
|
Qt
.
AlignVCenter
Layout.
fillWidth
:
true
}
}
QGCLabel
{
text
:
qsTr
(
"
Layers
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Layers
"
)
}
FactTextField
{
FactTextField
{
fact
:
areaItem
.
numberOfLayers
fact
:
areaItem
.
numberOfLayers
Layout.
alignment
:
Qt
.
AlignLeft
|
Qt
.
AlignVCenter
Layout.
fillWidth
:
true
}
}
QGCLabel
{
text
:
qsTr
(
"
Layer Dist.
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Layer Dist.
"
)
}
FactTextField
{
FactTextField
{
fact
:
areaItem
.
layerDistance
fact
:
areaItem
.
layerDistance
Layout.
alignment
:
Qt
.
AlignLeft
|
Qt
.
AlignVCenter
Layout.
fillWidth
:
true
}
}
QGCLabel
{
text
:
qsTr
(
"
Offset
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Offset
"
)
}
FactTextField
{
FactTextField
{
fact
:
areaItem
.
borderPolygonOffset
fact
:
areaItem
.
borderPolygonOffset
Layout.
alignment
:
Qt
.
AlignLeft
|
Qt
.
AlignVCenter
Layout.
fillWidth
:
true
}
}
...
...
src/WimaView/WimaView.qml
View file @
29fb812c
...
@@ -1018,7 +1018,7 @@ QGCView {
...
@@ -1018,7 +1018,7 @@ QGCView {
currentIndex
:
_missionController
.
currentPlanViewIndex
currentIndex
:
_missionController
.
currentPlanViewIndex
highlightMoveDuration
:
250
highlightMoveDuration
:
250
visible
:
_editingLayer
==
_layerMission
&&
!
planControlColapsed
visible
:
_editingLayer
==
_layerMission
&&
!
planControlColapsed
//-- List Elements
_missionController->setCurrentPlanViewIndex(sequenceNumber, true);
//-- List Elements
delegate
:
MissionItemEditor
{
delegate
:
MissionItemEditor
{
map
:
editorMap
map
:
editorMap
masterController
:
_planMasterController
masterController
:
_planMasterController
...
@@ -1063,6 +1063,18 @@ QGCView {
...
@@ -1063,6 +1063,18 @@ QGCView {
}
}
}
}
Component
{
id
:
syncLoadFromVehicleOverwrite
QGCViewMessage
{
id
:
syncLoadFromVehicleCheck
message
:
qsTr
(
"
You have unsaved/unsent changes. Loading from the Vehicle will lose these changes. Are you sure you want to load from the Vehicle?
"
)
function
accept
()
{
hideDialog
()
masterController
.
loadFromVehicle
()
}
}
}
Component
{
Component
{
id
:
syncLoadFromFileOverwrite
id
:
syncLoadFromFileOverwrite
QGCViewMessage
{
QGCViewMessage
{
...
...
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