Skip to content

Commit

Permalink
IMPROVEMENT: Simplify the code that populates "component editor" from…
Browse files Browse the repository at this point in the history
… FC parameters
  • Loading branch information
amilcarlucas committed Aug 15, 2024
1 parent 09e1fc8 commit 6523e76
Show file tree
Hide file tree
Showing 3 changed files with 313 additions and 88 deletions.
8 changes: 5 additions & 3 deletions MethodicConfigurator/ardupilot_methodic_configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,16 @@ def connect_to_fc_and_read_parameters(args):

def component_editor(args, flight_controller, vehicle_type, local_filesystem, vehicle_dir_window):
component_editor_window = ComponentEditorWindow(VERSION, local_filesystem)
component_editor_window.set_vehicle_type_and_version(vehicle_type, flight_controller.info.flight_sw_version_and_type)
component_editor_window.set_fc_manufacturer(flight_controller.info.vendor)
component_editor_window.set_fc_model(flight_controller.info.product)
if vehicle_dir_window and \
vehicle_dir_window.created_new_vehicle_from_template and \
vehicle_dir_window.use_fc_params.get() and \
flight_controller.fc_parameters:
# copy vehicle parameters to component editor values
component_editor_window.set_values_from_fc_parameters(flight_controller.fc_parameters, local_filesystem.doc_dict)
component_editor_window.populate_frames()
component_editor_window.set_vehicle_type_and_version(vehicle_type, flight_controller.info.flight_sw_version_and_type)
component_editor_window.set_fc_manufacturer(flight_controller.info.vendor)
component_editor_window.set_fc_model(flight_controller.info.product)
if args.skip_component_editor:
component_editor_window.root.after(10, component_editor_window.root.destroy)
component_editor_window.root.mainloop()
Expand Down
Loading

0 comments on commit 6523e76

Please sign in to comment.