@@ -230,6 +230,7 @@ def __init__(self, version: str, local_filesystem: LocalFilesystem) -> None:
230
230
_vehicle_components_strings = _ ("Version" )
231
231
_vehicle_components_strings = _ ("Firmware" )
232
232
_vehicle_components_strings = _ ("Type" )
233
+ _vehicle_components_strings = _ ("MCU Series" )
233
234
_vehicle_components_strings = _ ("Notes" )
234
235
_vehicle_components_strings = _ ("Frame" )
235
236
_vehicle_components_strings = _ ("Specifications" )
@@ -270,7 +271,7 @@ def update_json_data(self) -> None:
270
271
if "Capacity mAh" not in self .data ["Components" ]["Battery" ]["Specifications" ]:
271
272
self .data ["Components" ]["Battery" ]["Specifications" ]["Capacity mAh" ] = 0
272
273
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
274
275
if "Frame" not in self .data ["Components" ]:
275
276
self .data ["Components" ]["Frame" ] = {}
276
277
if "Specifications" not in self .data ["Components" ]["Frame" ]:
@@ -286,6 +287,17 @@ def update_json_data(self) -> None:
286
287
287
288
self .data ["Program version" ] = __version__
288
289
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
+
289
301
def set_vehicle_type_and_version (self , vehicle_type : str , version : str ) -> None :
290
302
self ._set_component_value_and_update_ui (("Flight Controller" , "Firmware" , "Type" ), vehicle_type )
291
303
if version :
@@ -299,6 +311,10 @@ def set_fc_model(self, model: str) -> None:
299
311
if model and model not in (_ ("Unknown" ), "MAVLink" ):
300
312
self ._set_component_value_and_update_ui (("Flight Controller" , "Product" , "Model" ), model )
301
313
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
+
302
318
def set_vehicle_configuration_template (self , configuration_template : str ) -> None :
303
319
self .data ["Configuration template" ] = configuration_template
304
320
0 commit comments