Skip to content

Commit 0f28a4a

Browse files
committed
feat(export): Create a reusable.param with all reusable parameters between similar vehicles
1 parent e22f3ff commit 0f28a4a

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

ARCHITECTURE_5_parameter_editor.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,10 @@ At completion, the system generates several summary files:
358358

359359
- `complete.param`: All parameters with change reasons
360360
- `non-default_read-only.param`: Read-only parameters that differ from defaults
361-
- `non-default_writable_calibrations.param`: Vehicle-specific calibrations
362-
- `non-default_writable_ids.param`: Vehicle-specific IDs
363-
- `non-default_writable_non-calibrations_non-ids.param`: Reusable configuration parameters
361+
- `non-default_writable_calibrations.param`: Vehicle-specific calibrations that differ from defaults
362+
- `non-default_writable_ids.param`: Vehicle-specific IDs that differ from defaults
363+
- `non-default_writable_non-calibrations_non-ids.param`: Reusable configuration parameters that differ from defaults
364+
- `reusable.param`: Reusable configuration parameters including reusable defaults
364365

365366
### Configuration Steps Definition
366367

SYSTEM_REQUIREMENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ To semi-automate the steps and processes on that guide the following *system des
171171
- Non-default, writable calibrations *reason changed* annotated parameters in `non-default_writable_calibrations.param` file
172172
- Non-default, writable IDs *reason changed* annotated parameters in `non-default_writable_ids.param` file
173173
- Non-default, writable non-calibrations, non-IDs *reason changed* annotated parameters in `non-default_writable_non-calibrations_non-ids.param` file
174+
- Reusable *reason changed* annotated parameters in `reusable.param` file
174175
- automatically create a parameter backup before the first usage of the software to change parameters [PR #173](https://github.com/ArduPilot/MethodicConfigurator/pull/173)
175176
- Only backs up the parameters if a backup file does not exist and only if AMC has not yet been used to write parameters to the FC
176177

USERMANUAL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ pie title Summary files example
367367
"Non-default writable sensor calibrations - non-default_writable_calibrations.param" : 71
368368
"Non-default writable IDs - non-default_writable_ids.param" : 3
369369
"Non-default writable non-sensor-calibrations, non-IDs - non-default_writable_non-calibrations_non-ids.param" : 217
370+
"Reusable parameters, including defaults - reusable.param" : 945
370371
```
371372

372373
If the diagram above does not display correctly [look here](https://github.com/ArduPilot/MethodicConfigurator/blob/master/USERMANUAL.md#9-completing-the-configuration-process)
@@ -391,6 +392,7 @@ After the summary message box is displayed, the application will write the summa
391392
- `non-default_writable_calibrations.param`: Contains all non-default writable sensor calibration 🟨 parameters. These are non-reusable.
392393
- `non-default_writable_ids.param`: Contains all non-default writable IDs. These are non-reusable.
393394
- `non-default_writable_non-calibrations_non-ids.param`: Contains all non-default writable non-sensor-calibration, non-IDs parameters. These are reusable across similar vehicles.
395+
- `reusable.param`: the same as above, but includes (non-read only, non-calibration, non-IDs) default values
394396

395397
The summary files provide a clear overview of the changes made.
396398

ardupilot_methodic_configurator/data_model_parameter_editor.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,8 @@ def write_summary_files_workflow( # pylint: disable=too-many-locals
14181418
calibration_params = parameter_summary["calibrations"]
14191419
id_params = parameter_summary["ids"]
14201420
non_calibration_non_ids_params = parameter_summary["non_calibrations_non_ids"]
1421+
keys_to_remove = set(read_only_params) | set(calibration_params) | set(id_params)
1422+
reusable = ParDict({k: v for k, v in complete_params.items() if k not in keys_to_remove})
14211423

14221424
# Write individual summary files
14231425
wrote_complete = self._write_single_summary_file_workflow(
@@ -1444,6 +1446,12 @@ def write_summary_files_workflow( # pylint: disable=too-many-locals
14441446
annotate_doc=False,
14451447
ask_confirmation=ask_confirmation,
14461448
)
1449+
wrote_reusable = self._write_single_summary_file_workflow(
1450+
reusable,
1451+
"reusable.param",
1452+
annotate_doc=False,
1453+
ask_confirmation=ask_confirmation,
1454+
)
14471455

14481456
# Create list of files for zipping
14491457
files_to_zip = [
@@ -1452,6 +1460,7 @@ def write_summary_files_workflow( # pylint: disable=too-many-locals
14521460
(wrote_calibrations, "non-default_writable_calibrations.param"),
14531461
(wrote_ids, "non-default_writable_ids.param"),
14541462
(wrote_non_calibrations_non_ids, "non-default_writable_non-calibrations_non-ids.param"),
1463+
(wrote_reusable, "reusable.param"),
14551464
]
14561465

14571466
# Write zip file with user confirmation

0 commit comments

Comments
 (0)