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
faa7500c
Commit
faa7500c
authored
Sep 09, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Fact members for storage
parent
d11aef13
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
105 deletions
+101
-105
MissionItem.cc
src/MissionItem.cc
+88
-85
MissionItem.h
src/MissionItem.h
+11
-18
Waypoint2DIcon.cc
src/ui/map/Waypoint2DIcon.cc
+2
-2
No files found.
src/MissionItem.cc
View file @
faa7500c
This diff is collapsed.
Click to expand it.
src/MissionItem.h
View file @
faa7500c
...
...
@@ -53,7 +53,7 @@ public:
int
frame
=
MAV_FRAME_GLOBAL
,
int
action
=
MAV_CMD_NAV_WAYPOINT
);
MissionItem
(
const
MissionItem
&
other
);
MissionItem
(
const
MissionItem
&
other
,
QObject
*
parent
=
NULL
);
~
MissionItem
();
const
MissionItem
&
operator
=
(
const
MissionItem
&
other
);
...
...
@@ -125,23 +125,23 @@ public:
bool
getAutoContinue
()
const
{
return
_autocontinue
;
}
double
getLoiterOrbit
()
const
{
return
_
orbit
;
double
loiterOrbitRadius
()
const
{
return
_
loiterOrbitRadiusFact
->
value
().
toDouble
()
;
}
double
getAcceptanceRadius
()
const
{
return
_param2
;
return
getParam2
()
;
}
double
getHoldTime
()
const
{
return
_param1
;
return
getParam1
()
;
}
double
getParam1
()
const
{
return
_param1
;
return
_param1
Fact
->
value
().
toDouble
()
;
}
double
getParam2
()
const
{
return
_param2
;
return
_param2
Fact
->
value
().
toDouble
()
;
}
double
getParam3
()
const
{
return
_orbit
;
return
loiterOrbitRadius
()
;
}
double
getParam4
()
const
{
return
yawRadians
();
...
...
@@ -195,7 +195,7 @@ public:
void
setFrame
(
int
_frame
);
void
setAutocontinue
(
bool
autoContinue
);
void
setCurrent
(
bool
_current
);
void
setLoiterOrbit
(
double
_orbit
);
void
setLoiterOrbit
Radius
(
double
radius
);
void
setParam1
(
double
_param1
);
void
setParam2
(
double
_param2
);
void
setParam3
(
double
param3
);
...
...
@@ -226,27 +226,20 @@ private:
int
_sequenceNumber
;
QGeoCoordinate
_coordinate
;
double
_yawRadians
;
int
_frame
;
int
_action
;
bool
_autocontinue
;
bool
_isCurrentItem
;
double
_orbit
;
double
_param1
;
double
_param2
;
quint64
_reachedTime
;
Fact
*
_yawFact
;
Fact
*
_pitchFact
;
Fact
*
_loiterRadiusFact
;
Fact
*
_yawRadiansFact
;
Fact
*
_loiterOrbitRadiusFact
;
Fact
*
_param1Fact
;
Fact
*
_param2Fact
;
FactMetaData
*
_yawMetaData
;
FactMetaData
*
_pitchMetaData
;
FactMetaData
*
_acceptanceRadiusMetaData
;
FactMetaData
*
_holdTimeMetaData
;
FactMetaData
*
_loiterRadiusMetaData
;
FactMetaData
*
_loiterTurnsMetaData
;
FactMetaData
*
_loiterSecondsMetaData
;
FactMetaData
*
_delaySecondsMetaData
;
...
...
src/ui/map/Waypoint2DIcon.cc
View file @
faa7500c
...
...
@@ -104,7 +104,7 @@ QRectF Waypoint2DIcon::boundingRect() const
}
if
(((
waypoint
->
getAction
()
==
(
int
)
MAV_CMD_NAV_LOITER_UNLIM
)
||
(
waypoint
->
getAction
()
==
(
int
)
MAV_CMD_NAV_LOITER_TIME
)
||
(
waypoint
->
getAction
()
==
(
int
)
MAV_CMD_NAV_LOITER_TURNS
)))
{
loiter
=
map
->
metersToPixels
(
waypoint
->
getLoiterOrbit
(),
coord
);
loiter
=
map
->
metersToPixels
(
waypoint
->
loiterOrbitRadius
(),
coord
);
}
}
...
...
@@ -306,7 +306,7 @@ void Waypoint2DIcon::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
penDash
.
setWidth
(
1
);
//penDash.setStyle(Qt::DotLine);
// A negative radius indicates counter-clockwise rotation, but we still want to draw it positive
const
int
loiter
=
map
->
metersToPixels
(
fabs
(
waypoint
->
getLoiterOrbit
()),
Coord
());
const
int
loiter
=
map
->
metersToPixels
(
fabs
(
waypoint
->
loiterOrbitRadius
()),
Coord
());
if
(
loiter
>
picture
.
width
()
/
2
)
{
painter
->
setPen
(
penBlack
);
...
...
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