Skip to content

Commit

Permalink
AP_DDS: Changed AP_DDS_Client.cpp to use the set_and_save_by_name_ifc…
Browse files Browse the repository at this point in the history
…hanged method to set parameter.
  • Loading branch information
paul.quillen committed Oct 30, 2024
1 parent 34a184a commit a1d28d0
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions libraries/AP_DDS/AP_DDS_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,6 @@ void AP_DDS_Client::on_request(uxrSession* uxr_session, uxrObjectId object_id, u
continue;
}

float old_value = vp->cast_to_float(var_type);

// Add existing parameter checks used in GCS_Param.cpp
if (parameter_flags & AP_PARAM_FLAG_INTERNAL_USE_ONLY) {
// The user can set BRD_OPTIONS to enable set of internal
Expand All @@ -794,14 +792,8 @@ void AP_DDS_Client::on_request(uxrSession* uxr_session, uxrObjectId object_id, u
continue;
}

// set the value
vp->set_float(param_value, var_type);

// Force the save if the value is not equal to the old one
bool force_save = !is_equal(param_value, old_value);

// save the change
vp->save(force_save);
// Set and save the value if it changed
bool force_save = vp->set_and_save_by_name_ifchanged(param_key, param_value);

if (force_save && (parameter_flags & AP_PARAM_FLAG_ENABLE)) {
AP_Param::invalidate_count();
Expand Down

0 comments on commit a1d28d0

Please sign in to comment.