diff --git a/gcode_metadata/metadata.py b/gcode_metadata/metadata.py index 10f871d..78ffb80 100644 --- a/gcode_metadata/metadata.py +++ b/gcode_metadata/metadata.py @@ -502,8 +502,16 @@ def set_attr(self, name, value): "extruder_colour": MMUAttribute(separator=";", value_type=str, - conversion=same_or_nothing) - } + conversion=same_or_nothing), + "nozzle_high_flow": + MMUAttribute(separator=",", + value_type=int, + conversion=same_or_nothing), + "filament_abrasive": + MMUAttribute(separator=",", + value_type=int, + conversion=same_or_nothing), + } # These keys are primary defined by PrusaSlicer # Keys ending in "per tool" mean there is a list inside diff --git a/tests/gcodes/fdn_full_0.15mm_PETG_MK3S_2h6m.gcode b/tests/gcodes/fdn_full_0.15mm_PETG_MK3S_2h6m.gcode index 78c5443..cd35591 100644 --- a/tests/gcodes/fdn_full_0.15mm_PETG_MK3S_2h6m.gcode +++ b/tests/gcodes/fdn_full_0.15mm_PETG_MK3S_2h6m.gcode @@ -209877,6 +209877,7 @@ M73 Q100 S0 ; extrusion_width = 0.45 ; fan_always_on = 1 ; fan_below_layer_time = 20 +; filament_abrasive = 1 ; filament_colour = #FF8000 ; filament_cooling_final_speed = 3.4 ; filament_cooling_initial_speed = 2.2 @@ -209975,6 +209976,7 @@ M73 Q100 S0 ; mmu_segmented_region_max_width = 0 ; notes = ; nozzle_diameter = 0.4 +; nozzle_high_flow = 0 ; only_retract_when_crossing_perimeters = 0 ; ooze_prevention = 0 ; output_filename_format = {input_filename_base}_{layer_height}mm_{filament_type[0]}_{printer_model}_{print_time}.gcode diff --git a/tests/gcodes/mmu_attribute_test.gcode b/tests/gcodes/mmu_attribute_test.gcode index 086a0c3..29ff0b7 100644 --- a/tests/gcodes/mmu_attribute_test.gcode +++ b/tests/gcodes/mmu_attribute_test.gcode @@ -147977,6 +147977,7 @@ M73 Q100 S0 ; extrusion_width = 0.45 ; fan_always_on = 1,1,0,0,0 ; fan_below_layer_time = 20,100,10,10,10 +; filament_abrasive = 1,1,1,1,1 ; filament_colour = #FF8000;#FF8000;#FF8000;#FF8000;#FF8000 ; filament_cooling_final_speed = 2.5,3.5,2.5,2.5,2.5 ; filament_cooling_initial_speed = 5,10,5,5,5 @@ -148103,6 +148104,7 @@ M73 Q100 S0 ; multimaterial_purging = 80 ; notes = ; nozzle_diameter = 0.4,0.4,0.4,porkchop,0.4 +; nozzle_high_flow = 1,0,0,1,0 ; only_one_perimeter_first_layer = 0 ; only_retract_when_crossing_perimeters = 0 ; ooze_prevention = 0 diff --git a/tests/test_metadata.py b/tests/test_metadata.py index c7fbed7..b317047 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -163,6 +163,8 @@ def test_mmu(self): ; bed_temperature = 90,60,105,105,105 ; filament_type = PETG;PLA;ASA;PETG;PETG ; extruder_colour = #FF8000;#DB5182;#3EC0FF;#FF4F4F;#FBEB7D + ; nozzle_high_flow = 1,0,0,1,0 + ; filament_abrasive = 1,1,1,1,1 """ fname = os.path.join(gcodes_dir, "mmu_attribute_test.gcode") meta = get_metadata(fname, False) @@ -183,6 +185,10 @@ def test_mmu(self): assert meta.data['extruder_colour per tool'] == [ '#FF8000', '#DB5182', '#3EC0FF', '#FF4F4F', '#FBEB7D' ] + print(meta.data) + assert meta.data['filament_abrasive per tool'] == [1, 1, 1, 1, 1] + assert meta.data['filament_abrasive'] == 1 + assert meta.data['nozzle_high_flow per tool'] == [1, 0, 0, 1, 0] # This might be wrong, we might want to not allow negative values, # but it's fun, so whatever assert meta.data['filament cost'] == 0 @@ -205,6 +211,7 @@ def test_full(self): 'bed_temperature': 90, 'brim_width': 0, 'estimated printing time (normal mode)': '2h 6m 5s', + 'filament_abrasive': 1, 'filament cost': 0.41, 'filament used [cm3]': 10.65, 'filament used [g]': 13.52, @@ -212,6 +219,7 @@ def test_full(self): 'filament_type': 'PETG', 'fill_density': '20%', 'nozzle_diameter': 0.4, + 'nozzle_high_flow': 0, 'printer_model': 'MK3S', 'layer_height': 0.15, 'support_material': 0,