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
6240302b
Commit
6240302b
authored
Jun 16, 2016
by
Nate Weibley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating CoordinateVector to be less noisy and easier to bind to VisualMissionItems
parent
b669753d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
CoordinateVector.cc
src/QmlControls/CoordinateVector.cc
+16
-7
CoordinateVector.h
src/QmlControls/CoordinateVector.h
+4
-1
No files found.
src/QmlControls/CoordinateVector.cc
View file @
6240302b
...
...
@@ -27,15 +27,24 @@ CoordinateVector::CoordinateVector(const QGeoCoordinate& coordinate1, const QGeo
}
CoordinateVector
::~
CoordinateVector
(
)
void
CoordinateVector
::
setCoordinates
(
const
QGeoCoordinate
&
coordinate1
,
const
QGeoCoordinate
&
coordinate2
)
{
setCoordinate1
(
coordinate1
);
setCoordinate2
(
coordinate2
);
}
void
CoordinateVector
::
setCoordinates
(
const
QGeoCoordinate
&
coordinate1
,
const
QGeoCoordinate
&
coordinate2
)
void
CoordinateVector
::
setCoordinate1
(
const
QGeoCoordinate
&
coordinate
)
{
if
(
_coordinate1
!=
coordinate
)
{
_coordinate1
=
coordinate
;
emit
coordinate1Changed
(
_coordinate1
);
}
}
void
CoordinateVector
::
setCoordinate2
(
const
QGeoCoordinate
&
coordinate
)
{
_coordinate1
=
coordinate1
;
_coordinate2
=
coordinate2
;
emit
coordinate1Changed
(
_coordinate1
);
emit
coordinate2Changed
(
_coordinate2
);
if
(
_coordinate2
!=
coordinate
)
{
_coordinate2
=
coordinate
;
emit
coordinate2Changed
(
_coordinate2
);
}
}
src/QmlControls/CoordinateVector.h
View file @
6240302b
...
...
@@ -21,12 +21,15 @@ class CoordinateVector : public QObject
public:
CoordinateVector
(
QObject
*
parent
=
NULL
);
CoordinateVector
(
const
QGeoCoordinate
&
coordinate1
,
const
QGeoCoordinate
&
coordinate2
,
QObject
*
parent
=
NULL
);
~
CoordinateVector
();
Q_PROPERTY
(
QGeoCoordinate
coordinate1
MEMBER
_coordinate1
NOTIFY
coordinate1Changed
)
Q_PROPERTY
(
QGeoCoordinate
coordinate2
MEMBER
_coordinate2
NOTIFY
coordinate2Changed
)
void
setCoordinates
(
const
QGeoCoordinate
&
coordinate1
,
const
QGeoCoordinate
&
coordinate2
);
public
slots
:
void
setCoordinate1
(
const
QGeoCoordinate
&
coordinate
);
void
setCoordinate2
(
const
QGeoCoordinate
&
coordinate
);
signals:
void
coordinate1Changed
(
QGeoCoordinate
coordinate
);
...
...
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