File tree Expand file tree Collapse file tree
ardupilot_methodic_configurator Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919"""
2020
2121import argparse
22+ import os
2223from logging import basicConfig as logging_basicConfig
2324from logging import debug as logging_debug
2425from logging import error as logging_error
@@ -520,6 +521,26 @@ def main() -> None:
520521 if not files :
521522 vehicle_directory_selection (state )
522523
524+ if (
525+ state .flight_controller .fc_parameters
526+ and state .flight_controller .info .flight_sw_version .startswith ("4.6." )
527+ and state .local_filesystem .doc_dict
528+ and "FSTRATE_ENABLE" in state .local_filesystem .doc_dict
529+ ):
530+ show_error_message (
531+ _ ("Incompatible parameter definition file detected" ),
532+ _ (
533+ "The parameter definition file 'apm.pdef.xml' is incompatible with ArduPilot 4.6.x firmware. "
534+ "It appears to be from the master branch. The file will be deleted. "
535+ "Please restart the ArduPilot Methodic Configurator."
536+ ),
537+ )
538+ # delete apm.pdef.xml file as it is from master and not from 4.6.x
539+ file_path = os .path .join (state .local_filesystem .vehicle_dir , "apm.pdef.xml" )
540+ if os .path .exists (file_path ):
541+ os .remove (file_path )
542+ sys_exit (1 )
543+
523544 # Run component editor workflow
524545 component_editor (state )
525546
You can’t perform that action at this time.
0 commit comments