Browse Source

Fix mission command overrides for offline edit

QGC4.4
Don Gagne 9 years ago
parent
commit
8cefc56676
  1. 15
      src/FirmwarePlugin/APM/MavCmdInfoCommon.json
  2. 15
      src/FirmwarePlugin/APM/MavCmdInfoFixedWing.json
  3. 6
      src/MissionManager/MissionCommands.cc
  4. 3
      src/MissionManager/MissionItem.cc

15
src/FirmwarePlugin/APM/MavCmdInfoCommon.json

@ -2,5 +2,20 @@ @@ -2,5 +2,20 @@
"version": 1,
"mavCmdInfo": [
{
"id": 22,
"rawName": "MAV_CMD_NAV_TAKEOFF",
"friendlyName": "Takeoff",
"description": "Take off from the ground.",
"specifiesCoordinate": false,
"friendlyEdit": true,
"category": "Basic",
"param1": {
"label": "Pitch:",
"units": "radians",
"default": 0.26179939,
"decimalPlaces": 2
}
}
]
}

15
src/FirmwarePlugin/APM/MavCmdInfoFixedWing.json

@ -2,20 +2,5 @@ @@ -2,20 +2,5 @@
"version": 1,
"mavCmdInfo": [
{
"id": 22,
"rawName": "MAV_CMD_NAV_TAKEOFF",
"friendlyName": "Takeoff",
"description": "Take off from the ground.",
"specifiesCoordinate": false,
"friendlyEdit": true,
"category": "Basic",
"param1": {
"label": "Pitch:",
"units": "radians",
"default": 0.26179939,
"decimalPlaces": 2
}
}
]
}

6
src/MissionManager/MissionCommands.cc

@ -153,11 +153,11 @@ MavCmdInfo* MissionCommands::getMavCmdInfo(MAV_CMD command, Vehicle* vehicle) co @@ -153,11 +153,11 @@ MavCmdInfo* MissionCommands::getMavCmdInfo(MAV_CMD command, Vehicle* vehicle) co
if (_autopilotToMultiRotorMissionCommands[firmwareType]->contains(command)) {
mavCmdInfo = _autopilotToMultiRotorMissionCommands[firmwareType]->getMavCmdInfo(command);
}
} else {
if (_autopilotToCommonMissionCommands[firmwareType]->contains(command)) {
mavCmdInfo = _autopilotToCommonMissionCommands[firmwareType]->getMavCmdInfo(command);
}
}
if (!mavCmdInfo && _autopilotToCommonMissionCommands[firmwareType]->contains(command)) {
mavCmdInfo = _autopilotToCommonMissionCommands[firmwareType]->getMavCmdInfo(command);
}
if (!mavCmdInfo) {

3
src/MissionManager/MissionItem.cc

@ -813,7 +813,8 @@ void MissionItem::setDefaultsForCommand(void) @@ -813,7 +813,8 @@ void MissionItem::setDefaultsForCommand(void)
MAV_CMD command = (MAV_CMD)this->command();
if (_missionCommands->contains(command)) {
foreach (const MavCmdParamInfo* paramInfo, _missionCommands->getMavCmdInfo(command, _vehicle)->paramInfoMap()) {
MavCmdInfo* mavCmdInfo = _missionCommands->getMavCmdInfo(command, _vehicle);
foreach (const MavCmdParamInfo* paramInfo, mavCmdInfo->paramInfoMap()) {
Fact* rgParamFacts[7] = { &_param1Fact, &_param2Fact, &_param3Fact, &_param4Fact, &_param5Fact, &_param6Fact, &_param7Fact };
rgParamFacts[paramInfo->param()-1]->setRawValue(paramInfo->defaultValue());

Loading…
Cancel
Save