Skip to content

Commit

Permalink
Update Max Alt
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Oct 25, 2024
1 parent 2464464 commit c758490
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions custom/src/CustomPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ void CustomPlugin::setToolbox(QGCToolbox *toolbox)

(void) connect(_gpuFactGroup->tetherLength(), &Fact::rawValueChanged, this, [this](QVariant value) {
qgcApp()->toolbox()->settingsManager()->flyViewSettings()->guidedMaximumAltitude()->setRawValue(value);
bool ok = false;
const uint8_t tetherLength = value.toUInt(&ok) + 4;
if (ok) {
ParameterManager *const parameterManager = qgcApp()->toolbox()->multiVehicleManager()->activeVehicle()->parameterManager();
if (parameterManager->parameterExists(ParameterManager::defaultComponentId, "FENCE_ALT_MAX")) {
Fact *const maxAlt = parameterManager->getParameter(ParameterManager::defaultComponentId, "FENCE_ALT_MAX");
maxAlt->setRawValue(tetherLength);
}
}
});


Expand Down Expand Up @@ -243,10 +252,10 @@ bool CustomPlugin::adjustSettingMetaData(const QString &settingsGroup, FactMetaD
}
} else if (settingsGroup == FlyViewSettings::settingsGroup) {
if (metaData.name() == FlyViewSettings::guidedMinimumAltitudeName) {
metaData.setRawDefaultValue(10);
metaData.setRawDefaultValue(32.8084);
return true;
} else if (metaData.name() == FlyViewSettings::guidedMaximumAltitudeName) {
metaData.setRawDefaultValue(121.92);
metaData.setRawDefaultValue(60.96);
return true;
} else if (metaData.name() == FlyViewSettings::showSimpleCameraControlName) {
metaData.setRawDefaultValue(false);
Expand Down

0 comments on commit c758490

Please sign in to comment.