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
69996a2e
Commit
69996a2e
authored
Aug 13, 2018
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
6d658c51
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
13 deletions
+26
-13
PX4FirmwarePlugin.cc
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
+1
-1
MissionController.cc
src/MissionManager/MissionController.cc
+0
-2
SimpleMissionItem.cc
src/MissionManager/SimpleMissionItem.cc
+24
-7
SimpleMissionItem.h
src/MissionManager/SimpleMissionItem.h
+1
-3
No files found.
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
View file @
69996a2e
...
...
@@ -285,7 +285,7 @@ QList<MAV_CMD> PX4FirmwarePlugin::supportedMissionCommands(void)
list
<<
MAV_CMD_NAV_WAYPOINT
<<
MAV_CMD_NAV_LOITER_UNLIM
<<
MAV_CMD_NAV_LOITER_TIME
<<
MAV_CMD_NAV_LOITER_TO_ALT
<<
MAV_CMD_NAV_LAND
<<
MAV_CMD_NAV_TAKEOFF
<<
MAV_CMD_NAV_LAND
<<
MAV_CMD_NAV_TAKEOFF
<<
MAV_CMD_NAV_RETURN_TO_LAUNCH
<<
MAV_CMD_DO_JUMP
<<
MAV_CMD_DO_VTOL_TRANSITION
<<
MAV_CMD_NAV_VTOL_TAKEOFF
<<
MAV_CMD_NAV_VTOL_LAND
<<
MAV_CMD_DO_DIGICAM_CONTROL
...
...
src/MissionManager/MissionController.cc
View file @
69996a2e
...
...
@@ -355,7 +355,6 @@ int MissionController::insertSimpleMissionItem(QGeoCoordinate coordinate, int i)
newItem
->
setCommand
(
takeoffCmd
);
}
}
newItem
->
setDefaultsForCommand
();
if
(
newItem
->
specifiesAltitude
())
{
double
prevAltitude
;
int
prevAltitudeMode
;
...
...
@@ -382,7 +381,6 @@ int MissionController::insertROIMissionItem(QGeoCoordinate coordinate, int i)
MAV_CMD_DO_SET_ROI_LOCATION
:
MAV_CMD_DO_SET_ROI
));
_initVisualItem
(
newItem
);
newItem
->
setDefaultsForCommand
();
newItem
->
setCoordinate
(
coordinate
);
double
prevAltitude
;
...
...
src/MissionManager/SimpleMissionItem.cc
View file @
69996a2e
...
...
@@ -78,7 +78,7 @@ SimpleMissionItem::SimpleMissionItem(Vehicle* vehicle, bool flyView, QObject* pa
_connectSignals
();
_updateOptionalSections
();
setDefaultsForCommand
();
_
setDefaultsForCommand
();
_rebuildFacts
();
setDirty
(
false
);
...
...
@@ -213,7 +213,7 @@ void SimpleMissionItem::_connectSignals(void)
connect
(
&
_missionItem
.
_frameFact
,
&
Fact
::
valueChanged
,
this
,
&
SimpleMissionItem
::
_sendFriendlyEditAllowedChanged
);
// A command change triggers a number of other changes as well.
connect
(
&
_missionItem
.
_commandFact
,
&
Fact
::
valueChanged
,
this
,
&
SimpleMissionItem
::
setDefaultsForCommand
);
connect
(
&
_missionItem
.
_commandFact
,
&
Fact
::
valueChanged
,
this
,
&
SimpleMissionItem
::
_
setDefaultsForCommand
);
connect
(
&
_missionItem
.
_commandFact
,
&
Fact
::
valueChanged
,
this
,
&
SimpleMissionItem
::
commandNameChanged
);
connect
(
&
_missionItem
.
_commandFact
,
&
Fact
::
valueChanged
,
this
,
&
SimpleMissionItem
::
commandDescriptionChanged
);
connect
(
&
_missionItem
.
_commandFact
,
&
Fact
::
valueChanged
,
this
,
&
SimpleMissionItem
::
abbreviationChanged
);
...
...
@@ -729,15 +729,32 @@ bool SimpleMissionItem::readyForSave(void) const
return
!
specifiesAltitude
()
||
!
qIsNaN
(
_missionItem
.
_param7Fact
.
rawValue
().
toDouble
());
}
void
SimpleMissionItem
::
setDefaultsForCommand
(
void
)
void
SimpleMissionItem
::
_
setDefaultsForCommand
(
void
)
{
// We set these global defaults first, then if there are param defaults they will get reset
// First reset params 1-4 to 0, we leave 5-7 alone to preserve any previous location information on command change
_missionItem
.
_param1Fact
.
setRawValue
(
0
);
_missionItem
.
_param2Fact
.
setRawValue
(
0
);
_missionItem
.
_param3Fact
.
setRawValue
(
0
);
_missionItem
.
_param4Fact
.
setRawValue
(
0
);
if
(
!
specifiesCoordinate
()
&&
!
isStandaloneCoordinate
())
{
// No need to carry across previous lat/lon
_missionItem
.
_param5Fact
.
setRawValue
(
0
);
_missionItem
.
_param6Fact
.
setRawValue
(
0
);
}
// Set global defaults first, then if there are param defaults they will get reset
_altitudeMode
=
AltitudeRelative
;
emit
altitudeModeChanged
();
double
defaultAlt
=
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
appSettings
()
->
defaultMissionItemAltitude
()
->
rawValue
().
toDouble
();
_altitudeFact
.
setRawValue
(
defaultAlt
);
_missionItem
.
_param7Fact
.
setRawValue
(
defaultAlt
);
_amslAltAboveTerrainFact
.
setRawValue
(
qQNaN
());
if
(
specifiesCoordinate
()
||
isStandaloneCoordinate
()
||
specifiesAltitudeOnly
())
{
double
defaultAlt
=
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
appSettings
()
->
defaultMissionItemAltitude
()
->
rawValue
().
toDouble
();
_altitudeFact
.
setRawValue
(
defaultAlt
);
_missionItem
.
_param7Fact
.
setRawValue
(
defaultAlt
);
}
else
{
_altitudeFact
.
setRawValue
(
0
);
_missionItem
.
_param7Fact
.
setRawValue
(
0
);
}
MAV_CMD
command
=
(
MAV_CMD
)
this
->
command
();
const
MissionCommandUIInfo
*
uiInfo
=
_commandTree
->
getUIInfo
(
_vehicle
,
command
);
...
...
src/MissionManager/SimpleMissionItem.h
View file @
69996a2e
...
...
@@ -134,9 +134,6 @@ public:
int
lastSequenceNumber
(
void
)
const
final
;
void
save
(
QJsonArray
&
missionItems
)
final
;
public
slots
:
void
setDefaultsForCommand
(
void
);
signals:
void
commandChanged
(
int
command
);
void
friendlyEditAllowedChanged
(
bool
friendlyEditAllowed
);
...
...
@@ -160,6 +157,7 @@ private slots:
void
_rebuildFacts
(
void
);
void
_rebuildTextFieldFacts
(
void
);
void
_possibleAdditionalTimeDelayChanged
(
void
);
void
_setDefaultsForCommand
(
void
);
private:
void
_connectSignals
(
void
);
...
...
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