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
fb32766e
Commit
fb32766e
authored
Oct 30, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix fitMapViewportToMissionItems
parent
901cf22d
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
140 additions
and
82 deletions
+140
-82
FlightMap.qml
src/FlightMap/FlightMap.qml
+1
-0
MissionLineView.qml
src/FlightMap/MapItems/MissionLineView.qml
+2
-2
MapFitFunctions.qml
src/FlightMap/Widgets/MapFitFunctions.qml
+35
-13
ComplexMissionItem.h
src/MissionManager/ComplexMissionItem.h
+0
-4
QGCMapCircle.h
src/MissionManager/QGCMapCircle.h
+3
-3
QGCMapPolygon.h
src/MissionManager/QGCMapPolygon.h
+2
-2
StructureScanComplexItem.cc
src/MissionManager/StructureScanComplexItem.cc
+25
-1
TransectStyleComplexItem.cc
src/MissionManager/TransectStyleComplexItem.cc
+2
-11
TransectStyleComplexItem.h
src/MissionManager/TransectStyleComplexItem.h
+0
-4
VisualMissionItem.cc
src/MissionManager/VisualMissionItem.cc
+10
-1
VisualMissionItem.h
src/MissionManager/VisualMissionItem.h
+11
-0
PlanToolBar.qml
src/PlanView/PlanToolBar.qml
+5
-5
QGCApplication.cc
src/QGCApplication.cc
+31
-26
QGCGeoBoundingCube.cc
src/QmlControls/QGCGeoBoundingCube.cc
+9
-2
QGCGeoBoundingCube.h
src/QmlControls/QGCGeoBoundingCube.h
+4
-8
No files found.
src/FlightMap/FlightMap.qml
View file @
fb32766e
...
...
@@ -49,6 +49,7 @@ Map {
property
var
activeVehicleCoordinate
:
_activeVehicle
?
_activeVehicle
.
coordinate
:
QtPositioning
.
coordinate
()
function
setVisibleRegion
(
region
)
{
// TODO: Is this still necessary with Qt 5.11?
// This works around a bug on Qt where if you set a visibleRegion and then the user moves or zooms the map
// and then you set the same visibleRegion the map will not move/scale appropriately since it thinks there
// is nothing to do.
...
...
src/FlightMap/MapItems/MissionLineView.qml
View file @
fb32766e
...
...
@@ -26,9 +26,9 @@ MapItemView {
line.color
:
"
#be781c
"
// Hack, can't get palette to work in here
z
:
QGroundControl
.
zOrderWaypointLines
path
:
[
path
:
object
?
[
object
.
coordinate1
,
object
.
coordinate2
,
]
]
:
[]
}
}
src/FlightMap/Widgets/MapFitFunctions.qml
View file @
fb32766e
...
...
@@ -10,7 +10,8 @@
import
QtQuick
2.3
import
QtPositioning
5.3
import
QGroundControl
1.0
import
QGroundControl
1.0
import
QGroundControl
.
FlightMap
1.0
/// Set of functions for fitting the map viewpoer to a specific constraint
Item
{
...
...
@@ -62,38 +63,46 @@ Item {
var
south
=
north
var
east
=
normalizeLon
(
coordList
[
0
].
longitude
)
var
west
=
east
for
(
var
i
=
1
;
i
<
coordList
.
length
;
i
++
)
{
for
(
var
i
=
1
;
i
<
coordList
.
length
;
i
++
)
{
var
lat
=
normalizeLat
(
coordList
[
i
].
latitude
)
var
lon
=
normalizeLon
(
coordList
[
i
].
longitude
)
north
=
Math
.
max
(
north
,
lat
)
south
=
Math
.
min
(
south
,
lat
)
east
=
Math
.
max
(
east
,
lon
)
west
=
Math
.
min
(
west
,
lon
)
east
=
Math
.
max
(
east
,
lon
)
west
=
Math
.
min
(
west
,
lon
)
}
// Expand the coordinate bounding rect to make room for the tools around the edge of the map
var
latDegreesPerPixel
=
(
north
-
south
)
/
mapFitViewport
.
width
var
lonDegreesPerPixel
=
(
east
-
west
)
/
mapFitViewport
.
height
var
lonDegreesPerPixel
=
(
east
-
west
)
/
mapFitViewport
.
height
north
=
Math
.
min
(
north
+
(
mapFitViewport
.
y
*
latDegreesPerPixel
),
180
)
south
=
Math
.
max
(
south
-
((
map
.
height
-
mapFitViewport
.
bottom
)
*
latDegreesPerPixel
),
0
)
west
=
Math
.
max
(
west
-
(
mapFitViewport
.
x
*
lonDegreesPerPixel
),
0
)
east
=
Math
.
min
(
east
+
((
map
.
width
-
mapFitViewport
.
right
)
*
lonDegreesPerPixel
),
360
)
west
=
Math
.
max
(
west
-
(
mapFitViewport
.
x
*
lonDegreesPerPixel
),
0
)
east
=
Math
.
min
(
east
+
((
map
.
width
-
mapFitViewport
.
right
)
*
lonDegreesPerPixel
),
360
)
// Back off on zoom level
east
=
Math
.
min
(
east
*
1.0000075
,
360
)
north
=
Math
.
min
(
north
*
1.0000075
,
180
)
west
=
west
*
0.9999925
south
=
south
*
0.9999925
// Fix the map region to the new bounding rect
var
topLeftCoord
=
QtPositioning
.
coordinate
(
north
-
90.0
,
west
-
180.0
)
var
topLeftCoord
=
QtPositioning
.
coordinate
(
north
-
90.0
,
west
-
180.0
)
var
bottomRightCoord
=
QtPositioning
.
coordinate
(
south
-
90.0
,
east
-
180.0
)
map
.
setVisibleRegion
(
QtPositioning
.
rectangle
(
topLeftCoord
,
bottomRightCoord
))
// Back off on zoom level
map
.
zoomLevel
=
Math
.
abs
(
map
.
zoomLevel
)
-
1
}
function
addMissionItemCoordsForFit
(
coordList
)
{
for
(
var
i
=
1
;
i
<
_missionController
.
visualItems
.
count
;
i
++
)
{
for
(
var
i
=
1
;
i
<
_missionController
.
visualItems
.
count
;
i
++
)
{
var
missionItem
=
_missionController
.
visualItems
.
get
(
i
)
if
(
missionItem
.
specifiesCoordinate
&&
!
missionItem
.
isStandaloneCoordinate
)
{
coordList
.
push
(
missionItem
.
coordinate
)
if
(
missionItem
.
boundingCube
.
isValid
())
{
coordList
.
push
(
missionItem
.
boundingCube
.
pointNW
)
coordList
.
push
(
missionItem
.
boundingCube
.
pointSE
)
}
else
{
coordList
.
push
(
missionItem
.
coordinate
)
}
}
}
}
...
...
@@ -103,6 +112,19 @@ Item {
// Being called prior to controller.start
return
}
/*
for (var i=1; i<_missionController.visualItems.count; i++) {
var missionItem = _missionController.visualItems.get(i)
if (missionItem.specifiesCoordinate && !missionItem.isStandaloneCoordinate) {
console.log(missionItem.boundingCube.pointNW)
console.log(missionItem.boundingCube.pointSE)
var loc = QtPositioning.rectangle(missionItem.boundingCube.pointNW, missionItem.boundingCube.pointSE)
console.log(loc)
map.visibleRegion = loc
return
}
}
*/
var
coordList
=
[
]
addMissionItemCoordsForFit
(
coordList
)
fitMapViewportToAllCoordinates
(
coordList
)
...
...
src/MissionManager/ComplexMissionItem.h
View file @
fb32766e
...
...
@@ -28,10 +28,6 @@ public:
/// Signals complexDistanceChanged
virtual
double
complexDistance
(
void
)
const
=
0
;
/// @return The item bounding cube
/// Signals boundingCubeChanged
virtual
QGCGeoBoundingCube
boundingCube
(
void
)
const
{
return
QGCGeoBoundingCube
();
}
/// Load the complex mission item from Json
/// @param complexObject Complex mission item json object
/// @param sequenceNumber Sequence number for first MISSION_ITEM in survey
...
...
src/MissionManager/QGCMapCircle.h
View file @
fb32766e
...
...
@@ -23,9 +23,9 @@ class QGCMapCircle : public QObject
Q_OBJECT
public:
QGCMapCircle
(
QObject
*
parent
=
NULL
);
QGCMapCircle
(
const
QGeoCoordinate
&
center
,
double
radius
,
QObject
*
parent
=
NULL
);
QGCMapCircle
(
const
QGCMapCircle
&
other
,
QObject
*
parent
=
NULL
);
QGCMapCircle
(
QObject
*
parent
=
nullptr
);
QGCMapCircle
(
const
QGeoCoordinate
&
center
,
double
radius
,
QObject
*
parent
=
nullptr
);
QGCMapCircle
(
const
QGCMapCircle
&
other
,
QObject
*
parent
=
nullptr
);
const
QGCMapCircle
&
operator
=
(
const
QGCMapCircle
&
other
);
...
...
src/MissionManager/QGCMapPolygon.h
View file @
fb32766e
...
...
@@ -24,8 +24,8 @@ class QGCMapPolygon : public QObject
Q_OBJECT
public:
QGCMapPolygon
(
QObject
*
parent
=
NULL
);
QGCMapPolygon
(
const
QGCMapPolygon
&
other
,
QObject
*
parent
=
NULL
);
QGCMapPolygon
(
QObject
*
parent
=
nullptr
);
QGCMapPolygon
(
const
QGCMapPolygon
&
other
,
QObject
*
parent
=
nullptr
);
const
QGCMapPolygon
&
operator
=
(
const
QGCMapPolygon
&
other
);
...
...
src/MissionManager/StructureScanComplexItem.cc
View file @
fb32766e
...
...
@@ -237,6 +237,30 @@ bool StructureScanComplexItem::load(const QJsonObject& complexObject, int sequen
void
StructureScanComplexItem
::
_flightPathChanged
(
void
)
{
// Calc bounding cube
double
north
=
0.0
;
double
south
=
180.0
;
double
east
=
0.0
;
double
west
=
360.0
;
double
bottom
=
100000.
;
double
top
=
0.
;
QList
<
QGeoCoordinate
>
vertices
=
_flightPolygon
.
coordinateList
();
for
(
int
i
=
0
;
i
<
vertices
.
count
();
i
++
)
{
QGeoCoordinate
vertex
=
vertices
[
i
];
double
lat
=
vertex
.
latitude
()
+
90.0
;
double
lon
=
vertex
.
longitude
()
+
180.0
;
north
=
fmax
(
north
,
lat
);
south
=
fmin
(
south
,
lat
);
east
=
fmax
(
east
,
lon
);
west
=
fmin
(
west
,
lon
);
bottom
=
fmin
(
bottom
,
vertex
.
altitude
());
top
=
fmax
(
top
,
vertex
.
altitude
());
}
//-- Update bounding cube for airspace management control
_setBoundingCube
(
QGCGeoBoundingCube
(
QGeoCoordinate
(
north
-
90.0
,
west
-
180.0
,
bottom
),
QGeoCoordinate
(
south
-
90.0
,
east
-
180.0
,
top
)));
emit
coordinateChanged
(
coordinate
());
emit
exitCoordinateChanged
(
exitCoordinate
());
emit
greatestDistanceToChanged
();
...
...
@@ -458,7 +482,7 @@ void StructureScanComplexItem::_recalcCameraShots(void)
return
;
}
int
cameraShots
=
distance
/
triggerDistance
;
int
cameraShots
=
static_cast
<
int
>
(
distance
/
triggerDistance
)
;
_setCameraShots
(
cameraShots
*
_layersFact
.
rawValue
().
toInt
());
}
...
...
src/MissionManager/TransectStyleComplexItem.cc
View file @
fb32766e
...
...
@@ -41,14 +41,13 @@ const int TransectStyleComplexItem::_terrainQueryTimeoutMsecs = 1000
TransectStyleComplexItem
::
TransectStyleComplexItem
(
Vehicle
*
vehicle
,
bool
flyView
,
QString
settingsGroup
,
QObject
*
parent
)
:
ComplexMissionItem
(
vehicle
,
flyView
,
parent
)
,
_sequenceNumber
(
0
)
,
_dirty
(
false
)
,
_terrainPolyPathQuery
(
NULL
)
,
_terrainPolyPathQuery
(
nullptr
)
,
_ignoreRecalc
(
false
)
,
_complexDistance
(
0
)
,
_cameraShots
(
0
)
,
_cameraCalc
(
vehicle
,
settingsGroup
)
,
_followTerrain
(
false
)
,
_loadedMissionItemsParent
(
NULL
)
,
_loadedMissionItemsParent
(
nullptr
)
,
_metaDataMap
(
FactMetaData
::
createMapFromJsonFile
(
QStringLiteral
(
":/json/TransectStyle.SettingsGroup.json"
),
this
))
,
_turnAroundDistanceFact
(
settingsGroup
,
_metaDataMap
[
_vehicle
->
multiRotor
()
?
turnAroundDistanceMultiRotorName
:
turnAroundDistanceName
])
,
_cameraTriggerInTurnAroundFact
(
settingsGroup
,
_metaDataMap
[
cameraTriggerInTurnAroundName
])
...
...
@@ -401,14 +400,6 @@ void TransectStyleComplexItem::_rebuildTransects(void)
emit
timeBetweenShotsChanged
();
}
void
TransectStyleComplexItem
::
_setBoundingCube
(
QGCGeoBoundingCube
bc
)
{
if
(
bc
!=
_boundingCube
)
{
_boundingCube
=
bc
;
emit
boundingCubeChanged
();
}
}
void
TransectStyleComplexItem
::
_queryTransectsPathHeightInfo
(
void
)
{
_transectsPathHeightInfo
.
clear
();
...
...
src/MissionManager/TransectStyleComplexItem.h
View file @
fb32766e
...
...
@@ -77,7 +77,6 @@ public:
int
lastSequenceNumber
(
void
)
const
final
;
QString
mapVisualQML
(
void
)
const
override
=
0
;
bool
load
(
const
QJsonObject
&
complexObject
,
int
sequenceNumber
,
QString
&
errorString
)
override
=
0
;
QGCGeoBoundingCube
boundingCube
(
void
)
const
override
{
return
_boundingCube
;
}
double
complexDistance
(
void
)
const
final
{
return
_complexDistance
;
}
double
greatestDistanceTo
(
const
QGeoCoordinate
&
other
)
const
final
;
...
...
@@ -147,14 +146,11 @@ protected:
double
_triggerDistance
(
void
)
const
;
bool
_hasTurnaround
(
void
)
const
;
double
_turnaroundDistance
(
void
)
const
;
void
_setBoundingCube
(
QGCGeoBoundingCube
bc
);
int
_sequenceNumber
;
bool
_dirty
;
QGeoCoordinate
_coordinate
;
QGeoCoordinate
_exitCoordinate
;
QGCMapPolygon
_surveyAreaPolygon
;
QGCGeoBoundingCube
_boundingCube
;
enum
CoordType
{
CoordTypeInterior
,
///< Interior waypoint for flight path only
...
...
src/MissionManager/VisualMissionItem.cc
View file @
fb32766e
...
...
@@ -45,7 +45,7 @@ VisualMissionItem::VisualMissionItem(Vehicle* vehicle, bool flyView, QObject* pa
VisualMissionItem
::
VisualMissionItem
(
const
VisualMissionItem
&
other
,
bool
flyView
,
QObject
*
parent
)
:
QObject
(
parent
)
,
_vehicle
(
NULL
)
,
_vehicle
(
nullptr
)
,
_flyView
(
flyView
)
,
_isCurrentItem
(
false
)
,
_dirty
(
false
)
...
...
@@ -203,3 +203,12 @@ void VisualMissionItem::_terrainDataReceived(bool success, QList<double> heights
emit
terrainAltitudeChanged
(
_terrainAltitude
);
sender
()
->
deleteLater
();
}
void
VisualMissionItem
::
_setBoundingCube
(
QGCGeoBoundingCube
bc
)
{
if
(
bc
!=
_boundingCube
)
{
_boundingCube
=
bc
;
emit
boundingCubeChanged
();
}
}
src/MissionManager/VisualMissionItem.h
View file @
fb32766e
...
...
@@ -68,6 +68,8 @@ public:
Q_PROPERTY
(
double
missionVehicleYaw
READ
missionVehicleYaw
NOTIFY
missionVehicleYawChanged
)
///< Expected vehicle yaw at this point in mission
Q_PROPERTY
(
bool
flyView
READ
flyView
CONSTANT
)
Q_PROPERTY
(
QGCGeoBoundingCube
*
boundingCube
READ
boundingCube
NOTIFY
boundingCubeChanged
)
// The following properties are calculated/set by the MissionController recalc methods
Q_PROPERTY
(
double
altDifference
READ
altDifference
WRITE
setAltDifference
NOTIFY
altDifferenceChanged
)
///< Change in altitude from previous waypoint
...
...
@@ -121,6 +123,9 @@ public:
virtual
double
specifiedGimbalYaw
(
void
)
=
0
;
virtual
double
specifiedGimbalPitch
(
void
)
=
0
;
//-- Default implementation returns an invalid bounding cube
virtual
QGCGeoBoundingCube
*
boundingCube
(
void
)
{
return
&
_boundingCube
;
}
/// Update item to mission flight status at point where this item appears in mission.
/// IMPORTANT: Overrides must call base class implementation
virtual
void
setMissionFlightStatus
(
MissionController
::
MissionFlightStatus_t
&
missionFlightStatus
);
...
...
@@ -192,6 +197,7 @@ signals:
void
missionVehicleYawChanged
(
double
missionVehicleYaw
);
void
terrainAltitudeChanged
(
double
terrainAltitude
);
void
additionalTimeDelayChanged
(
void
);
void
boundingCubeChanged
(
void
);
void
coordinateHasRelativeAltitudeChanged
(
bool
coordinateHasRelativeAltitude
);
void
exitCoordinateHasRelativeAltitudeChanged
(
bool
exitCoordinateHasRelativeAltitude
);
...
...
@@ -214,11 +220,16 @@ protected:
double
_missionGimbalYaw
;
double
_missionVehicleYaw
;
QGCGeoBoundingCube
_boundingCube
;
///< The bounding "cube" of this element.
MissionController
::
MissionFlightStatus_t
_missionFlightStatus
;
/// This is used to reference any subsequent mission items which do not specify a coordinate.
QmlObjectListModel
_childItems
;
protected:
void
_setBoundingCube
(
QGCGeoBoundingCube
bc
);
private
slots
:
void
_updateTerrainAltitude
(
void
);
void
_reallyUpdateTerrainAltitude
(
void
);
...
...
src/PlanView/PlanToolBar.qml
View file @
fb32766e
...
...
@@ -46,12 +46,12 @@ Rectangle {
property
real
_smallValueWidth
:
ScreenTools
.
defaultFontPixelWidth
*
3
property
real
_labelToValueSpacing
:
ScreenTools
.
defaultFontPixelWidth
property
real
_rowSpacing
:
ScreenTools
.
isMobile
?
1
:
0
property
real
_distance
:
_statusValid
?
currentMissionItem
.
distance
:
NaN
property
real
_altDifference
:
_statusValid
?
currentMissionItem
.
altDifference
:
NaN
property
real
_gradient
:
_statusValid
&&
currentMissionItem
.
distance
>
0
?
Math
.
atan
(
currentMissionItem
.
altDifference
/
currentMissionItem
.
distance
)
:
NaN
property
real
_distance
:
_statusValid
&&
currentMissionItem
?
currentMissionItem
.
distance
:
NaN
property
real
_altDifference
:
_statusValid
&&
currentMissionItem
?
currentMissionItem
.
altDifference
:
NaN
property
real
_gradient
:
_statusValid
&&
currentMissionItem
&&
currentMissionItem
.
distance
>
0
?
Math
.
atan
(
currentMissionItem
.
altDifference
/
currentMissionItem
.
distance
)
:
NaN
property
real
_gradientPercent
:
isNaN
(
_gradient
)
?
NaN
:
_gradient
*
100
property
real
_azimuth
:
_statusValid
?
currentMissionItem
.
azimuth
:
NaN
property
real
_heading
:
_statusValid
?
currentMissionItem
.
missionVehicleYaw
:
NaN
property
real
_azimuth
:
_statusValid
&&
currentMissionItem
?
currentMissionItem
.
azimuth
:
NaN
property
real
_heading
:
_statusValid
&&
currentMissionItem
?
currentMissionItem
.
missionVehicleYaw
:
NaN
property
real
_missionDistance
:
_missionValid
?
missionDistance
:
NaN
property
real
_missionMaxTelemetry
:
_missionValid
?
missionMaxTelemetry
:
NaN
property
real
_missionTime
:
_missionValid
?
missionTime
:
NaN
...
...
src/QGCApplication.cc
View file @
fb32766e
...
...
@@ -377,6 +377,7 @@ QGCApplication::~QGCApplication()
void
QGCApplication
::
_initCommon
(
void
)
{
static
const
char
*
kRefOnly
=
"Reference only"
;
QSettings
settings
;
// Register our Qml objects
...
...
@@ -384,31 +385,35 @@ void QGCApplication::_initCommon(void)
qmlRegisterType
<
QGCPalette
>
(
"QGroundControl.Palette"
,
1
,
0
,
"QGCPalette"
);
qmlRegisterType
<
QGCMapPalette
>
(
"QGroundControl.Palette"
,
1
,
0
,
"QGCMapPalette"
);
qmlRegisterUncreatableType
<
CoordinateVector
>
(
"QGroundControl"
,
1
,
0
,
"CoordinateVector"
,
"Reference only"
);
qmlRegisterUncreatableType
<
QmlObjectListModel
>
(
"QGroundControl"
,
1
,
0
,
"QmlObjectListModel"
,
"Reference only"
);
qmlRegisterUncreatableType
<
MissionCommandTree
>
(
"QGroundControl"
,
1
,
0
,
"MissionCommandTree"
,
"Reference only"
);
qmlRegisterUncreatableType
<
CameraCalc
>
(
"QGroundControl"
,
1
,
0
,
"CameraCalc"
,
"Reference only"
);
qmlRegisterUncreatableType
<
AutoPilotPlugin
>
(
"QGroundControl.AutoPilotPlugin"
,
1
,
0
,
"AutoPilotPlugin"
,
"Reference only"
);
qmlRegisterUncreatableType
<
VehicleComponent
>
(
"QGroundControl.AutoPilotPlugin"
,
1
,
0
,
"VehicleComponent"
,
"Reference only"
);
qmlRegisterUncreatableType
<
Vehicle
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"Vehicle"
,
"Reference only"
);
qmlRegisterUncreatableType
<
MissionItem
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"MissionItem"
,
"Reference only"
);
qmlRegisterUncreatableType
<
MissionManager
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"MissionManager"
,
"Reference only"
);
qmlRegisterUncreatableType
<
ParameterManager
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"ParameterManager"
,
"Reference only"
);
qmlRegisterUncreatableType
<
QGCCameraManager
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"QGCCameraManager"
,
"Reference only"
);
qmlRegisterUncreatableType
<
QGCCameraControl
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"QGCCameraControl"
,
"Reference only"
);
qmlRegisterUncreatableType
<
LinkInterface
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"LinkInterface"
,
"Reference only"
);
qmlRegisterUncreatableType
<
JoystickManager
>
(
"QGroundControl.JoystickManager"
,
1
,
0
,
"JoystickManager"
,
"Reference only"
);
qmlRegisterUncreatableType
<
Joystick
>
(
"QGroundControl.JoystickManager"
,
1
,
0
,
"Joystick"
,
"Reference only"
);
qmlRegisterUncreatableType
<
QGCPositionManager
>
(
"QGroundControl.QGCPositionManager"
,
1
,
0
,
"QGCPositionManager"
,
"Reference only"
);
qmlRegisterUncreatableType
<
QGCMapPolygon
>
(
"QGroundControl.FlightMap"
,
1
,
0
,
"QGCMapPolygon"
,
"Reference only"
);
qmlRegisterUncreatableType
<
MissionController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"MissionController"
,
"Reference only"
);
qmlRegisterUncreatableType
<
GeoFenceController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"GeoFenceController"
,
"Reference only"
);
qmlRegisterUncreatableType
<
RallyPointController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"RallyPointController"
,
"Reference only"
);
qmlRegisterUncreatableType
<
VisualMissionItem
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"VisualMissionItem"
,
"Reference only"
);
qmlRegisterUncreatableType
<
FactValueSliderListModel
>
(
"QGroundControl.FactControls"
,
1
,
0
,
"FactValueSliderListModel"
,
"Reference only"
);
qmlRegisterType
<
QGCGeoBoundingCube
>
(
"QGroundControl"
,
1
,
0
,
"QGCGeoBoundingCube"
);
qmlRegisterUncreatableType
<
CoordinateVector
>
(
"QGroundControl"
,
1
,
0
,
"CoordinateVector"
,
kRefOnly
);
qmlRegisterUncreatableType
<
QmlObjectListModel
>
(
"QGroundControl"
,
1
,
0
,
"QmlObjectListModel"
,
kRefOnly
);
qmlRegisterUncreatableType
<
MissionCommandTree
>
(
"QGroundControl"
,
1
,
0
,
"MissionCommandTree"
,
kRefOnly
);
qmlRegisterUncreatableType
<
CameraCalc
>
(
"QGroundControl"
,
1
,
0
,
"CameraCalc"
,
kRefOnly
);
qmlRegisterUncreatableType
<
AutoPilotPlugin
>
(
"QGroundControl.AutoPilotPlugin"
,
1
,
0
,
"AutoPilotPlugin"
,
kRefOnly
);
qmlRegisterUncreatableType
<
VehicleComponent
>
(
"QGroundControl.AutoPilotPlugin"
,
1
,
0
,
"VehicleComponent"
,
kRefOnly
);
qmlRegisterUncreatableType
<
Vehicle
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"Vehicle"
,
kRefOnly
);
qmlRegisterUncreatableType
<
MissionItem
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"MissionItem"
,
kRefOnly
);
qmlRegisterUncreatableType
<
MissionManager
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"MissionManager"
,
kRefOnly
);
qmlRegisterUncreatableType
<
ParameterManager
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"ParameterManager"
,
kRefOnly
);
qmlRegisterUncreatableType
<
QGCCameraManager
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"QGCCameraManager"
,
kRefOnly
);
qmlRegisterUncreatableType
<
QGCCameraControl
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"QGCCameraControl"
,
kRefOnly
);
qmlRegisterUncreatableType
<
LinkInterface
>
(
"QGroundControl.Vehicle"
,
1
,
0
,
"LinkInterface"
,
kRefOnly
);
qmlRegisterUncreatableType
<
JoystickManager
>
(
"QGroundControl.JoystickManager"
,
1
,
0
,
"JoystickManager"
,
kRefOnly
);
qmlRegisterUncreatableType
<
Joystick
>
(
"QGroundControl.JoystickManager"
,
1
,
0
,
"Joystick"
,
kRefOnly
);
qmlRegisterUncreatableType
<
QGCPositionManager
>
(
"QGroundControl.QGCPositionManager"
,
1
,
0
,
"QGCPositionManager"
,
kRefOnly
);
qmlRegisterUncreatableType
<
MissionController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"MissionController"
,
kRefOnly
);
qmlRegisterUncreatableType
<
GeoFenceController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"GeoFenceController"
,
kRefOnly
);
qmlRegisterUncreatableType
<
RallyPointController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"RallyPointController"
,
kRefOnly
);
qmlRegisterUncreatableType
<
VisualMissionItem
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"VisualMissionItem"
,
kRefOnly
);
qmlRegisterUncreatableType
<
FactValueSliderListModel
>
(
"QGroundControl.FactControls"
,
1
,
0
,
"FactValueSliderListModel"
,
kRefOnly
);
qmlRegisterUncreatableType
<
QGCMapPolygon
>
(
"QGroundControl.FlightMap"
,
1
,
0
,
"QGCMapPolygon"
,
kRefOnly
);
qmlRegisterUncreatableType
<
QGCGeoBoundingCube
>
(
"QGroundControl.FlightMap"
,
1
,
0
,
"QGCGeoBoundingCube"
,
kRefOnly
);
// qRegisterMetaType<QGCGeoBoundingCube>("QGCGeoBoundingCube");
qmlRegisterType
<
QGCMapCircle
>
(
"QGroundControl.FlightMap"
,
1
,
0
,
"QGCMapCircle"
);
qmlRegisterType
<
ParameterEditorController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"ParameterEditorController"
);
qmlRegisterType
<
ESP8266ComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"ESP8266ComponentController"
);
...
...
@@ -421,7 +426,7 @@ void QGCApplication::_initCommon(void)
qmlRegisterType
<
LogDownloadController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"LogDownloadController"
);
qmlRegisterType
<
SyslinkComponentController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"SyslinkComponentController"
);
qmlRegisterType
<
EditPositionDialogController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"EditPositionDialogController"
);
qmlRegisterType
<
QGCMapCircle
>
(
"QGroundControl.FlightMap"
,
1
,
0
,
"QGCMapCircle"
);
#ifndef __mobile__
qmlRegisterType
<
ViewWidgetController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"ViewWidgetController"
);
qmlRegisterType
<
CustomCommandWidgetController
>
(
"QGroundControl.Controllers"
,
1
,
0
,
"CustomCommandWidgetController"
);
...
...
src/QmlControls/QGCGeoBoundingCube.cc
View file @
fb32766e
...
...
@@ -18,6 +18,13 @@ double QGCGeoBoundingCube::MaxSouth = -90.0;
double
QGCGeoBoundingCube
::
MaxWest
=
-
180.0
;
double
QGCGeoBoundingCube
::
MaxEast
=
180.0
;
//-----------------------------------------------------------------------------
QGCGeoBoundingCube
::
QGCGeoBoundingCube
(
QObject
*
parent
)
:
QObject
(
parent
)
{
reset
();
}
//-----------------------------------------------------------------------------
bool
QGCGeoBoundingCube
::
isValid
()
const
...
...
@@ -30,8 +37,8 @@ QGCGeoBoundingCube::isValid() const
void
QGCGeoBoundingCube
::
reset
()
{
point
SE
=
QGeoCoordinate
(
);
point
NW
=
QGeoCoordinate
(
);
point
NW
=
QGeoCoordinate
(
MaxSouth
,
MaxEast
,
MaxAlt
);
point
SE
=
QGeoCoordinate
(
MaxNorth
,
MaxWest
,
MinAlt
);
}
//-----------------------------------------------------------------------------
...
...
src/QmlControls/QGCGeoBoundingCube.h
View file @
fb32766e
...
...
@@ -18,6 +18,8 @@
class
QGCGeoBoundingCube
:
public
QObject
{
Q_OBJECT
public:
QGCGeoBoundingCube
(
QObject
*
parent
=
nullptr
);
QGCGeoBoundingCube
(
const
QGCGeoBoundingCube
&
other
)
:
QObject
()
{
...
...
@@ -25,12 +27,6 @@ public:
pointSE
=
other
.
pointSE
;
}
QGCGeoBoundingCube
()
:
pointNW
(
QGeoCoordinate
(
MaxSouth
,
MaxEast
,
MaxAlt
))
,
pointSE
(
QGeoCoordinate
(
MaxNorth
,
MaxWest
,
MinAlt
))
{
}
QGCGeoBoundingCube
(
QGeoCoordinate
p1
,
QGeoCoordinate
p2
)
:
pointNW
(
p1
)
,
pointSE
(
p2
)
...
...
@@ -38,7 +34,7 @@ public:
}
Q_PROPERTY
(
QGeoCoordinate
pointNW
MEMBER
pointNW
CONSTANT
)
Q_PROPERTY
(
QGeoCoordinate
pointSE
MEMBER
point
NW
CONSTANT
)
Q_PROPERTY
(
QGeoCoordinate
pointSE
MEMBER
point
SE
CONSTANT
)
Q_INVOKABLE
void
reset
();
Q_INVOKABLE
bool
isValid
()
const
;
...
...
@@ -64,7 +60,7 @@ public:
}
//-- 2D
QList
<
QGeoCoordinate
>
polygon2D
(
double
clipTo
=
0
.
0
)
const
;
Q
_INVOKABLE
Q
List
<
QGeoCoordinate
>
polygon2D
(
double
clipTo
=
0
.
0
)
const
;
Q_INVOKABLE
double
width
()
const
;
Q_INVOKABLE
double
height
()
const
;
...
...
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