@@ -230,6 +230,7 @@ def __init__(self, version: str, local_filesystem: LocalFilesystem) -> None:
230230 _vehicle_components_strings = _ ("Version" )
231231 _vehicle_components_strings = _ ("Firmware" )
232232 _vehicle_components_strings = _ ("Type" )
233+ _vehicle_components_strings = _ ("MCU Series" )
233234 _vehicle_components_strings = _ ("Notes" )
234235 _vehicle_components_strings = _ ("Frame" )
235236 _vehicle_components_strings = _ ("Specifications" )
@@ -270,7 +271,7 @@ def update_json_data(self) -> None:
270271 if "Capacity mAh" not in self .data ["Components" ]["Battery" ]["Specifications" ]:
271272 self .data ["Components" ]["Battery" ]["Specifications" ]["Capacity mAh" ] = 0
272273
273- # To update old JSON files that do not have these new fields
274+ # To update old JSON files that do not have these new "Frame.Specifications.TOW * Kg" fields
274275 if "Frame" not in self .data ["Components" ]:
275276 self .data ["Components" ]["Frame" ] = {}
276277 if "Specifications" not in self .data ["Components" ]["Frame" ]:
@@ -286,6 +287,17 @@ def update_json_data(self) -> None:
286287
287288 self .data ["Program version" ] = __version__
288289
290+ # To update old JSON files that do not have this new "Flight Controller.Specifications.MCU Series" field
291+ if "Flight Controller" not in self .data ["Components" ]:
292+ self .data ["Components" ]["Flight Controller" ] = {}
293+ if "Specifications" not in self .data ["Components" ]["Flight Controller" ]:
294+ self .data ["Components" ]["Flight Controller" ] = {
295+ "Product" : self .data ["Components" ]["Flight Controller" ]["Product" ],
296+ "Firmware" : self .data ["Components" ]["Flight Controller" ]["Firmware" ],
297+ "Specifications" : {"MCU Series" : "Unknown" },
298+ "Notes" : self .data ["Components" ]["Flight Controller" ]["Notes" ],
299+ }
300+
289301 def set_vehicle_type_and_version (self , vehicle_type : str , version : str ) -> None :
290302 self ._set_component_value_and_update_ui (("Flight Controller" , "Firmware" , "Type" ), vehicle_type )
291303 if version :
@@ -299,6 +311,10 @@ def set_fc_model(self, model: str) -> None:
299311 if model and model not in (_ ("Unknown" ), "MAVLink" ):
300312 self ._set_component_value_and_update_ui (("Flight Controller" , "Product" , "Model" ), model )
301313
314+ def set_mcu_series (self , mcu : str ) -> None :
315+ if mcu :
316+ self ._set_component_value_and_update_ui (("Flight Controller" , "Specifications" , "MCU Series" ), mcu )
317+
302318 def set_vehicle_configuration_template (self , configuration_template : str ) -> None :
303319 self .data ["Configuration template" ] = configuration_template
304320
0 commit comments