From c083541e0adf89613acbd0c123eb0fe790593324 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Mon, 3 Jun 2024 21:30:38 +0800 Subject: [PATCH] Thumbnails feature revamp. (#5555) * Thumbnails feature revamp. Support generating different size/format combinations * misc fix Co-authored-by: Lukas Matena --- .../Elegoo/machine/fdm_neptune_4_common.json | 7 +- .../Prusa/machine/Prusa MINI 0.25 nozzle.json | 189 +++++++------- .../Prusa/machine/Prusa MINI 0.4 nozzle.json | 181 +++++++------- .../Prusa/machine/Prusa MINI 0.6 nozzle.json | 181 +++++++------- .../Prusa/machine/Prusa MINI 0.8 nozzle.json | 181 +++++++------- .../machine/Prusa MINIIS 0.25 nozzle.json | 8 +- .../machine/Prusa MINIIS 0.4 nozzle.json | 233 +++++++++--------- .../machine/Prusa MINIIS 0.6 nozzle.json | 8 +- .../machine/Prusa MINIIS 0.8 nozzle.json | 8 +- .../Prusa/machine/Prusa MK4 0.25 nozzle.json | 160 ++++++------ .../Prusa/machine/Prusa MK4 0.4 nozzle.json | 146 +++++------ .../Prusa/machine/Prusa MK4 0.6 nozzle.json | 160 ++++++------ .../Prusa/machine/Prusa MK4 0.8 nozzle.json | 160 ++++++------ .../Qidi/machine/fdm_qidi_x3_common.json | 7 +- src/libslic3r/Config.cpp | 16 +- src/libslic3r/Config.hpp | 4 + src/libslic3r/GCode.cpp | 37 +-- src/libslic3r/GCode/Thumbnails.cpp | 76 ++++++ src/libslic3r/GCode/Thumbnails.hpp | 43 ++-- src/libslic3r/Preset.cpp | 11 + src/libslic3r/PrintConfig.cpp | 63 ++++- src/libslic3r/PrintConfig.hpp | 11 +- src/slic3r/GUI/Field.cpp | 60 ++++- src/slic3r/GUI/OptionsGroup.cpp | 9 +- src/slic3r/GUI/Tab.cpp | 39 ++- src/slic3r/GUI/UnsavedChangesDialog.cpp | 3 - 26 files changed, 1146 insertions(+), 855 deletions(-) diff --git a/resources/profiles/Elegoo/machine/fdm_neptune_4_common.json b/resources/profiles/Elegoo/machine/fdm_neptune_4_common.json index 659cc3c5d1f..337d90dd492 100644 --- a/resources/profiles/Elegoo/machine/fdm_neptune_4_common.json +++ b/resources/profiles/Elegoo/machine/fdm_neptune_4_common.json @@ -137,8 +137,9 @@ "nozzle_type": "undefine", "auxiliary_fan": "0", "thumbnails": [ - "320x320", - "160x160" + "320x320/PNG", + "32x32/COLPIC", + "160x160/COLPIC" ], - "thumbnails_format": "ColPic" + "thumbnails_format": "PNG" } diff --git a/resources/profiles/Prusa/machine/Prusa MINI 0.25 nozzle.json b/resources/profiles/Prusa/machine/Prusa MINI 0.25 nozzle.json index 28e2a63c7a0..6f0c2797ce8 100644 --- a/resources/profiles/Prusa/machine/Prusa MINI 0.25 nozzle.json +++ b/resources/profiles/Prusa/machine/Prusa MINI 0.25 nozzle.json @@ -1,95 +1,100 @@ { - "type": "machine", - "setting_id": "GM003", - "name": "Prusa MINI 0.25 nozzle", - "from": "system", - "instantiation": "true", - "inherits": "fdm_machine_common", - "gcode_flavor": "marlin2", - "printer_model": "MINI", - "printer_variant": "0.25", - "default_filament_profile": [ - "Prusa Generic PLA" - ], - "default_print_profile": "0.20mm Standard @MINI 0.25", - "nozzle_diameter": [ - "0.25" - ], - "max_layer_height": [ - "0.15" + "type": "machine", + "setting_id": "GM003", + "name": "Prusa MINI 0.25 nozzle", + "from": "system", + "instantiation": "true", + "inherits": "fdm_machine_common", + "gcode_flavor": "marlin2", + "printer_model": "MINI", + "printer_variant": "0.25", + "default_filament_profile": [ + "Prusa Generic PLA" + ], + "default_print_profile": "0.20mm Standard @MINI 0.25", + "nozzle_diameter": [ + "0.25" + ], + "max_layer_height": [ + "0.15" ], "min_layer_height": [ - "0.05" - ], - "bed_exclude_area": [ - "0x0" - ], - "printable_area": [ - "0x0", - "180x0", - "180x180", - "0x180" - ], - "machine_max_acceleration_extruding": [ - "1250", - "2000" - ], - "machine_max_acceleration_x": [ - "2500", - "2000" - ], - "machine_max_acceleration_y": [ - "2500", - "2000" - ], - "machine_max_acceleration_z": [ - "400", - "200" - ], - "machine_max_jerk_e": [ - "10", - "2.5" - ], - "machine_max_jerk_x": [ - "8", - "9" - ], - "machine_max_jerk_y": [ - "8", - "9" - ], - "machine_max_speed_e": [ - "80", - "25" - ], - "machine_max_speed_x": [ - "180", - "200" - ], - "machine_max_speed_y": [ - "180", - "200" - ], - "retraction_length": [ - "3.2" - ], - "retraction_minimum_travel": [ - "1.5" - ], - "retraction_speed": [ - "70" - ], - "printable_height": "180", - "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", - "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n", - "machine_end_gcode": "G1 E-1 F2100 ; retract\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+2, max_print_height)} F720 ; Move print head up{endif}\nG1 X178 Y178 F4200 ; park print head\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+30, max_print_height)} F720 ; Move print head further up{endif}\nG4 ; wait\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nM221 S100 ; reset flow\nM900 K0 ; reset LA\nM84 ; disable motors\n; max_layer_z = [max_layer_z]", - "machine_pause_gcode": "M601", - "machine_start_gcode": "M862.3 P \"[printer_model]\" ; printer model check\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S170 ; set extruder temp for bed leveling\nM140 S[first_layer_bed_temperature] ; set bed temp\nM109 R170 ; wait for bed leveling temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM204 T1250 ; set travel acceleration\nG28 ; home all without mesh bed level\nG29 ; mesh bed leveling \nM204 T[machine_max_acceleration_travel] ; restore travel acceleration\nM104 S[first_layer_temperature] ; set extruder temp\nG92 E0\nG1 Y-2 X179 F2400\nG1 Z3 F720\nM109 S[first_layer_temperature] ; wait for extruder temp\n\n; intro line\nG1 X170 F1000\nG1 Z0.2 F720\nG1 X110 E8 F900\nG1 X40 E10 F700\nG92 E0\n\nM221 S95 ; set flow", - "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_MINI\n", - - "scan_first_layer": "0", - "machine_load_filament_time": "17", - "machine_unload_filament_time": "16", - "nozzle_type": "hardened_steel", - "auxiliary_fan": "0" -} + "0.05" + ], + "bed_exclude_area": [ + "0x0" + ], + "printable_area": [ + "0x0", + "180x0", + "180x180", + "0x180" + ], + "machine_max_acceleration_extruding": [ + "1250", + "2000" + ], + "machine_max_acceleration_x": [ + "2500", + "2000" + ], + "machine_max_acceleration_y": [ + "2500", + "2000" + ], + "machine_max_acceleration_z": [ + "400", + "200" + ], + "machine_max_jerk_e": [ + "10", + "2.5" + ], + "machine_max_jerk_x": [ + "8", + "9" + ], + "machine_max_jerk_y": [ + "8", + "9" + ], + "machine_max_speed_e": [ + "80", + "25" + ], + "machine_max_speed_x": [ + "180", + "200" + ], + "machine_max_speed_y": [ + "180", + "200" + ], + "retraction_length": [ + "3.2" + ], + "retraction_minimum_travel": [ + "1.5" + ], + "retraction_speed": [ + "70" + ], + "printable_height": "180", + "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n", + "machine_end_gcode": "G1 E-1 F2100 ; retract\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+2, max_print_height)} F720 ; Move print head up{endif}\nG1 X178 Y178 F4200 ; park print head\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+30, max_print_height)} F720 ; Move print head further up{endif}\nG4 ; wait\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nM221 S100 ; reset flow\nM900 K0 ; reset LA\nM84 ; disable motors\n; max_layer_z = [max_layer_z]", + "machine_pause_gcode": "M601", + "machine_start_gcode": "M862.3 P \"[printer_model]\" ; printer model check\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S170 ; set extruder temp for bed leveling\nM140 S[first_layer_bed_temperature] ; set bed temp\nM109 R170 ; wait for bed leveling temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM204 T1250 ; set travel acceleration\nG28 ; home all without mesh bed level\nG29 ; mesh bed leveling \nM204 T[machine_max_acceleration_travel] ; restore travel acceleration\nM104 S[first_layer_temperature] ; set extruder temp\nG92 E0\nG1 Y-2 X179 F2400\nG1 Z3 F720\nM109 S[first_layer_temperature] ; wait for extruder temp\n\n; intro line\nG1 X170 F1000\nG1 Z0.2 F720\nG1 X110 E8 F900\nG1 X40 E10 F700\nG92 E0\n\nM221 S95 ; set flow", + "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_MINI\n", + "scan_first_layer": "0", + "machine_load_filament_time": "17", + "machine_unload_filament_time": "16", + "nozzle_type": "hardened_steel", + "auxiliary_fan": "0", + "thumbnails": [ + "16x16/QOI", + "220x124/QOI", + "200x240/QOI", + "640x480/PNG" + ] +} \ No newline at end of file diff --git a/resources/profiles/Prusa/machine/Prusa MINI 0.4 nozzle.json b/resources/profiles/Prusa/machine/Prusa MINI 0.4 nozzle.json index 27b9beac8ae..edee392acb6 100644 --- a/resources/profiles/Prusa/machine/Prusa MINI 0.4 nozzle.json +++ b/resources/profiles/Prusa/machine/Prusa MINI 0.4 nozzle.json @@ -1,89 +1,94 @@ { - "type": "machine", - "setting_id": "GM003", - "name": "Prusa MINI 0.4 nozzle", - "from": "system", - "instantiation": "true", - "inherits": "fdm_machine_common", - "gcode_flavor": "marlin2", - "printer_model": "MINI", - "printer_variant": "0.4", - "default_filament_profile": [ - "Prusa Generic PLA" - ], - "default_print_profile": "0.20mm Standard @MINI", - "nozzle_diameter": [ - "0.4" - ], - "bed_exclude_area": [ - "0x0" - ], - "printable_area": [ - "0x0", - "180x0", - "180x180", - "0x180" - ], - "machine_max_acceleration_extruding": [ - "1250", - "2000" - ], - "machine_max_acceleration_x": [ - "2500", - "2000" - ], - "machine_max_acceleration_y": [ - "2500", - "2000" - ], - "machine_max_acceleration_z": [ - "400", - "200" - ], - "machine_max_jerk_e": [ - "10", - "2.5" - ], - "machine_max_jerk_x": [ - "8", - "9" - ], - "machine_max_jerk_y": [ - "8", - "9" - ], - "machine_max_speed_e": [ - "80", - "25" - ], - "machine_max_speed_x": [ - "180", - "200" - ], - "machine_max_speed_y": [ - "180", - "200" - ], - "retraction_length": [ - "3.2" - ], - "retraction_minimum_travel": [ - "1.5" - ], - "retraction_speed": [ - "70" - ], - "printable_height": "180", - "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", - "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n", - "machine_end_gcode": "G1 E-1 F2100 ; retract\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+2, max_print_height)} F720 ; Move print head up{endif}\nG1 X178 Y178 F4200 ; park print head\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+30, max_print_height)} F720 ; Move print head further up{endif}\nG4 ; wait\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nM221 S100 ; reset flow\nM900 K0 ; reset LA\nM84 ; disable motors\n; max_layer_z = [max_layer_z]", - "machine_pause_gcode": "M601", - "machine_start_gcode": "M862.3 P \"[printer_model]\" ; printer model check\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S170 ; set extruder temp for bed leveling\nM140 S[first_layer_bed_temperature] ; set bed temp\nM109 R170 ; wait for bed leveling temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM204 T1250 ; set travel acceleration\nG28 ; home all without mesh bed level\nG29 ; mesh bed leveling \nM204 T[machine_max_acceleration_travel] ; restore travel acceleration\nM104 S[first_layer_temperature] ; set extruder temp\nG92 E0\nG1 Y-2 X179 F2400\nG1 Z3 F720\nM109 S[first_layer_temperature] ; wait for extruder temp\n\n; intro line\nG1 X170 F1000\nG1 Z0.2 F720\nG1 X110 E8 F900\nG1 X40 E10 F700\nG92 E0\n\nM221 S95 ; set flow", - "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_MINI\n", - - "scan_first_layer": "0", - "machine_load_filament_time": "17", - "machine_unload_filament_time": "16", - "nozzle_type": "hardened_steel", - "auxiliary_fan": "0" -} + "type": "machine", + "setting_id": "GM003", + "name": "Prusa MINI 0.4 nozzle", + "from": "system", + "instantiation": "true", + "inherits": "fdm_machine_common", + "gcode_flavor": "marlin2", + "printer_model": "MINI", + "printer_variant": "0.4", + "default_filament_profile": [ + "Prusa Generic PLA" + ], + "default_print_profile": "0.20mm Standard @MINI", + "nozzle_diameter": [ + "0.4" + ], + "bed_exclude_area": [ + "0x0" + ], + "printable_area": [ + "0x0", + "180x0", + "180x180", + "0x180" + ], + "machine_max_acceleration_extruding": [ + "1250", + "2000" + ], + "machine_max_acceleration_x": [ + "2500", + "2000" + ], + "machine_max_acceleration_y": [ + "2500", + "2000" + ], + "machine_max_acceleration_z": [ + "400", + "200" + ], + "machine_max_jerk_e": [ + "10", + "2.5" + ], + "machine_max_jerk_x": [ + "8", + "9" + ], + "machine_max_jerk_y": [ + "8", + "9" + ], + "machine_max_speed_e": [ + "80", + "25" + ], + "machine_max_speed_x": [ + "180", + "200" + ], + "machine_max_speed_y": [ + "180", + "200" + ], + "retraction_length": [ + "3.2" + ], + "retraction_minimum_travel": [ + "1.5" + ], + "retraction_speed": [ + "70" + ], + "printable_height": "180", + "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n", + "machine_end_gcode": "G1 E-1 F2100 ; retract\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+2, max_print_height)} F720 ; Move print head up{endif}\nG1 X178 Y178 F4200 ; park print head\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+30, max_print_height)} F720 ; Move print head further up{endif}\nG4 ; wait\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nM221 S100 ; reset flow\nM900 K0 ; reset LA\nM84 ; disable motors\n; max_layer_z = [max_layer_z]", + "machine_pause_gcode": "M601", + "machine_start_gcode": "M862.3 P \"[printer_model]\" ; printer model check\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S170 ; set extruder temp for bed leveling\nM140 S[first_layer_bed_temperature] ; set bed temp\nM109 R170 ; wait for bed leveling temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM204 T1250 ; set travel acceleration\nG28 ; home all without mesh bed level\nG29 ; mesh bed leveling \nM204 T[machine_max_acceleration_travel] ; restore travel acceleration\nM104 S[first_layer_temperature] ; set extruder temp\nG92 E0\nG1 Y-2 X179 F2400\nG1 Z3 F720\nM109 S[first_layer_temperature] ; wait for extruder temp\n\n; intro line\nG1 X170 F1000\nG1 Z0.2 F720\nG1 X110 E8 F900\nG1 X40 E10 F700\nG92 E0\n\nM221 S95 ; set flow", + "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_MINI\n", + "scan_first_layer": "0", + "machine_load_filament_time": "17", + "machine_unload_filament_time": "16", + "nozzle_type": "hardened_steel", + "auxiliary_fan": "0", + "thumbnails": [ + "16x16/QOI", + "220x124/QOI", + "200x240/QOI", + "640x480/PNG" + ] +} \ No newline at end of file diff --git a/resources/profiles/Prusa/machine/Prusa MINI 0.6 nozzle.json b/resources/profiles/Prusa/machine/Prusa MINI 0.6 nozzle.json index b9f916b3803..e0eecf124f7 100644 --- a/resources/profiles/Prusa/machine/Prusa MINI 0.6 nozzle.json +++ b/resources/profiles/Prusa/machine/Prusa MINI 0.6 nozzle.json @@ -1,89 +1,94 @@ { - "type": "machine", - "setting_id": "GM003", - "name": "Prusa MINI 0.6 nozzle", - "from": "system", - "instantiation": "true", - "inherits": "fdm_machine_common", - "gcode_flavor": "marlin2", - "printer_model": "MINI", - "printer_variant": "0.6", - "default_filament_profile": [ - "Prusa Generic PLA" - ], - "default_print_profile": "0.20mm Standard @MINI 0.6", - "nozzle_diameter": [ - "0.6" - ], - "bed_exclude_area": [ - "0x0" - ], - "printable_area": [ - "0x0", - "180x0", - "180x180", - "0x180" - ], - "machine_max_acceleration_extruding": [ - "1250", - "2000" - ], - "machine_max_acceleration_x": [ - "2500", - "2000" - ], - "machine_max_acceleration_y": [ - "2500", - "2000" - ], - "machine_max_acceleration_z": [ - "400", - "200" - ], - "machine_max_jerk_e": [ - "10", - "2.5" - ], - "machine_max_jerk_x": [ - "8", - "9" - ], - "machine_max_jerk_y": [ - "8", - "9" - ], - "machine_max_speed_e": [ - "80", - "25" - ], - "machine_max_speed_x": [ - "180", - "200" - ], - "machine_max_speed_y": [ - "180", - "200" - ], - "retraction_length": [ - "3.2" - ], - "retraction_minimum_travel": [ - "1.5" - ], - "retraction_speed": [ - "70" - ], - "printable_height": "180", - "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", - "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n", - "machine_end_gcode": "G1 E-1 F2100 ; retract\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+2, max_print_height)} F720 ; Move print head up{endif}\nG1 X178 Y178 F4200 ; park print head\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+30, max_print_height)} F720 ; Move print head further up{endif}\nG4 ; wait\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nM221 S100 ; reset flow\nM900 K0 ; reset LA\nM84 ; disable motors\n; max_layer_z = [max_layer_z]", - "machine_pause_gcode": "M601", - "machine_start_gcode": "M862.3 P \"[printer_model]\" ; printer model check\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S170 ; set extruder temp for bed leveling\nM140 S[first_layer_bed_temperature] ; set bed temp\nM109 R170 ; wait for bed leveling temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM204 T1250 ; set travel acceleration\nG28 ; home all without mesh bed level\nG29 ; mesh bed leveling \nM204 T[machine_max_acceleration_travel] ; restore travel acceleration\nM104 S[first_layer_temperature] ; set extruder temp\nG92 E0\nG1 Y-2 X179 F2400\nG1 Z3 F720\nM109 S[first_layer_temperature] ; wait for extruder temp\n\n; intro line\nG1 X170 F1000\nG1 Z0.2 F720\nG1 X110 E8 F900\nG1 X40 E10 F700\nG92 E0\n\nM221 S95 ; set flow", - "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_MINI\n", - - "scan_first_layer": "0", - "machine_load_filament_time": "17", - "machine_unload_filament_time": "16", - "nozzle_type": "hardened_steel", - "auxiliary_fan": "0" -} + "type": "machine", + "setting_id": "GM003", + "name": "Prusa MINI 0.6 nozzle", + "from": "system", + "instantiation": "true", + "inherits": "fdm_machine_common", + "gcode_flavor": "marlin2", + "printer_model": "MINI", + "printer_variant": "0.6", + "default_filament_profile": [ + "Prusa Generic PLA" + ], + "default_print_profile": "0.20mm Standard @MINI 0.6", + "nozzle_diameter": [ + "0.6" + ], + "bed_exclude_area": [ + "0x0" + ], + "printable_area": [ + "0x0", + "180x0", + "180x180", + "0x180" + ], + "machine_max_acceleration_extruding": [ + "1250", + "2000" + ], + "machine_max_acceleration_x": [ + "2500", + "2000" + ], + "machine_max_acceleration_y": [ + "2500", + "2000" + ], + "machine_max_acceleration_z": [ + "400", + "200" + ], + "machine_max_jerk_e": [ + "10", + "2.5" + ], + "machine_max_jerk_x": [ + "8", + "9" + ], + "machine_max_jerk_y": [ + "8", + "9" + ], + "machine_max_speed_e": [ + "80", + "25" + ], + "machine_max_speed_x": [ + "180", + "200" + ], + "machine_max_speed_y": [ + "180", + "200" + ], + "retraction_length": [ + "3.2" + ], + "retraction_minimum_travel": [ + "1.5" + ], + "retraction_speed": [ + "70" + ], + "printable_height": "180", + "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n", + "machine_end_gcode": "G1 E-1 F2100 ; retract\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+2, max_print_height)} F720 ; Move print head up{endif}\nG1 X178 Y178 F4200 ; park print head\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+30, max_print_height)} F720 ; Move print head further up{endif}\nG4 ; wait\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nM221 S100 ; reset flow\nM900 K0 ; reset LA\nM84 ; disable motors\n; max_layer_z = [max_layer_z]", + "machine_pause_gcode": "M601", + "machine_start_gcode": "M862.3 P \"[printer_model]\" ; printer model check\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S170 ; set extruder temp for bed leveling\nM140 S[first_layer_bed_temperature] ; set bed temp\nM109 R170 ; wait for bed leveling temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM204 T1250 ; set travel acceleration\nG28 ; home all without mesh bed level\nG29 ; mesh bed leveling \nM204 T[machine_max_acceleration_travel] ; restore travel acceleration\nM104 S[first_layer_temperature] ; set extruder temp\nG92 E0\nG1 Y-2 X179 F2400\nG1 Z3 F720\nM109 S[first_layer_temperature] ; wait for extruder temp\n\n; intro line\nG1 X170 F1000\nG1 Z0.2 F720\nG1 X110 E8 F900\nG1 X40 E10 F700\nG92 E0\n\nM221 S95 ; set flow", + "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_MINI\n", + "scan_first_layer": "0", + "machine_load_filament_time": "17", + "machine_unload_filament_time": "16", + "nozzle_type": "hardened_steel", + "auxiliary_fan": "0", + "thumbnails": [ + "16x16/QOI", + "220x124/QOI", + "200x240/QOI", + "640x480/PNG" + ] +} \ No newline at end of file diff --git a/resources/profiles/Prusa/machine/Prusa MINI 0.8 nozzle.json b/resources/profiles/Prusa/machine/Prusa MINI 0.8 nozzle.json index 4a052e215ef..aa0173249aa 100644 --- a/resources/profiles/Prusa/machine/Prusa MINI 0.8 nozzle.json +++ b/resources/profiles/Prusa/machine/Prusa MINI 0.8 nozzle.json @@ -1,89 +1,94 @@ { - "type": "machine", - "setting_id": "GM003", - "name": "Prusa MINI 0.8 nozzle", - "from": "system", - "instantiation": "true", - "inherits": "fdm_machine_common", - "gcode_flavor": "marlin2", - "printer_model": "MINI", - "printer_variant": "0.8", - "default_filament_profile": [ - "Prusa Generic PLA" - ], - "default_print_profile": "0.20mm Standard @MINI 0.8", - "nozzle_diameter": [ - "0.8" - ], - "bed_exclude_area": [ - "0x0" - ], - "printable_area": [ - "0x0", - "180x0", - "180x180", - "0x180" - ], - "machine_max_acceleration_extruding": [ - "1250", - "2000" - ], - "machine_max_acceleration_x": [ - "2500", - "2000" - ], - "machine_max_acceleration_y": [ - "2500", - "2000" - ], - "machine_max_acceleration_z": [ - "400", - "200" - ], - "machine_max_jerk_e": [ - "10", - "2.5" - ], - "machine_max_jerk_x": [ - "8", - "9" - ], - "machine_max_jerk_y": [ - "8", - "9" - ], - "machine_max_speed_e": [ - "80", - "25" - ], - "machine_max_speed_x": [ - "180", - "200" - ], - "machine_max_speed_y": [ - "180", - "200" - ], - "retraction_length": [ - "3.2" - ], - "retraction_minimum_travel": [ - "1.5" - ], - "retraction_speed": [ - "70" - ], - "printable_height": "180", - "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", - "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n", - "machine_end_gcode": "G1 E-1 F2100 ; retract\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+2, max_print_height)} F720 ; Move print head up{endif}\nG1 X178 Y178 F4200 ; park print head\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+30, max_print_height)} F720 ; Move print head further up{endif}\nG4 ; wait\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nM221 S100 ; reset flow\nM900 K0 ; reset LA\nM84 ; disable motors\n; max_layer_z = [max_layer_z]", - "machine_pause_gcode": "M601", - "machine_start_gcode": "M862.3 P \"[printer_model]\" ; printer model check\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S170 ; set extruder temp for bed leveling\nM140 S[first_layer_bed_temperature] ; set bed temp\nM109 R170 ; wait for bed leveling temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM204 T1250 ; set travel acceleration\nG28 ; home all without mesh bed level\nG29 ; mesh bed leveling \nM204 T[machine_max_acceleration_travel] ; restore travel acceleration\nM104 S[first_layer_temperature] ; set extruder temp\nG92 E0\nG1 Y-2 X179 F2400\nG1 Z3 F720\nM109 S[first_layer_temperature] ; wait for extruder temp\n\n; intro line\nG1 X170 F1000\nG1 Z0.2 F720\nG1 X110 E8 F900\nG1 X40 E10 F700\nG92 E0\n\nM221 S95 ; set flow", - "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_MINI\n", - - "scan_first_layer": "0", - "machine_load_filament_time": "17", - "machine_unload_filament_time": "16", - "nozzle_type": "hardened_steel", - "auxiliary_fan": "0" -} + "type": "machine", + "setting_id": "GM003", + "name": "Prusa MINI 0.8 nozzle", + "from": "system", + "instantiation": "true", + "inherits": "fdm_machine_common", + "gcode_flavor": "marlin2", + "printer_model": "MINI", + "printer_variant": "0.8", + "default_filament_profile": [ + "Prusa Generic PLA" + ], + "default_print_profile": "0.20mm Standard @MINI 0.8", + "nozzle_diameter": [ + "0.8" + ], + "bed_exclude_area": [ + "0x0" + ], + "printable_area": [ + "0x0", + "180x0", + "180x180", + "0x180" + ], + "machine_max_acceleration_extruding": [ + "1250", + "2000" + ], + "machine_max_acceleration_x": [ + "2500", + "2000" + ], + "machine_max_acceleration_y": [ + "2500", + "2000" + ], + "machine_max_acceleration_z": [ + "400", + "200" + ], + "machine_max_jerk_e": [ + "10", + "2.5" + ], + "machine_max_jerk_x": [ + "8", + "9" + ], + "machine_max_jerk_y": [ + "8", + "9" + ], + "machine_max_speed_e": [ + "80", + "25" + ], + "machine_max_speed_x": [ + "180", + "200" + ], + "machine_max_speed_y": [ + "180", + "200" + ], + "retraction_length": [ + "3.2" + ], + "retraction_minimum_travel": [ + "1.5" + ], + "retraction_speed": [ + "70" + ], + "printable_height": "180", + "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n", + "machine_end_gcode": "G1 E-1 F2100 ; retract\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+2, max_print_height)} F720 ; Move print head up{endif}\nG1 X178 Y178 F4200 ; park print head\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+30, max_print_height)} F720 ; Move print head further up{endif}\nG4 ; wait\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nM221 S100 ; reset flow\nM900 K0 ; reset LA\nM84 ; disable motors\n; max_layer_z = [max_layer_z]", + "machine_pause_gcode": "M601", + "machine_start_gcode": "M862.3 P \"[printer_model]\" ; printer model check\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S170 ; set extruder temp for bed leveling\nM140 S[first_layer_bed_temperature] ; set bed temp\nM109 R170 ; wait for bed leveling temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM204 T1250 ; set travel acceleration\nG28 ; home all without mesh bed level\nG29 ; mesh bed leveling \nM204 T[machine_max_acceleration_travel] ; restore travel acceleration\nM104 S[first_layer_temperature] ; set extruder temp\nG92 E0\nG1 Y-2 X179 F2400\nG1 Z3 F720\nM109 S[first_layer_temperature] ; wait for extruder temp\n\n; intro line\nG1 X170 F1000\nG1 Z0.2 F720\nG1 X110 E8 F900\nG1 X40 E10 F700\nG92 E0\n\nM221 S95 ; set flow", + "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_MINI\n", + "scan_first_layer": "0", + "machine_load_filament_time": "17", + "machine_unload_filament_time": "16", + "nozzle_type": "hardened_steel", + "auxiliary_fan": "0", + "thumbnails": [ + "16x16/QOI", + "220x124/QOI", + "200x240/QOI", + "640x480/PNG" + ] +} \ No newline at end of file diff --git a/resources/profiles/Prusa/machine/Prusa MINIIS 0.25 nozzle.json b/resources/profiles/Prusa/machine/Prusa MINIIS 0.25 nozzle.json index 97e63d54c0a..178e3e65e2d 100644 --- a/resources/profiles/Prusa/machine/Prusa MINIIS 0.25 nozzle.json +++ b/resources/profiles/Prusa/machine/Prusa MINIIS 0.25 nozzle.json @@ -26,5 +26,11 @@ ], "retraction_minimum_travel": [ "1.0" - ] + ], + "thumbnails": [ + "16x16/QOI", + "220x124/QOI", + "200x240/QOI", + "640x480/PNG" + ] } diff --git a/resources/profiles/Prusa/machine/Prusa MINIIS 0.4 nozzle.json b/resources/profiles/Prusa/machine/Prusa MINIIS 0.4 nozzle.json index d5fa1be6408..418dc5fef3f 100644 --- a/resources/profiles/Prusa/machine/Prusa MINIIS 0.4 nozzle.json +++ b/resources/profiles/Prusa/machine/Prusa MINIIS 0.4 nozzle.json @@ -1,117 +1,118 @@ { - "type": "machine", - "setting_id": "GM003", - "name": "Prusa MINIIS 0.4 nozzle", - "from": "system", - "instantiation": "true", - "inherits": "fdm_machine_common", - "gcode_flavor": "marlin2", - "printer_model": "MINIIS", - "printer_variant": "0.4", - "default_filament_profile": [ - "Prusa Generic PLA @MINIIS" - ], - "default_print_profile": "0.20mm Standard @MINIIS", - "nozzle_diameter": [ - "0.4" - ], - "bed_exclude_area": [ - "0x0" - ], - "printable_area": [ - "0x0", - "180x0", - "180x180", - "0x180" - ], - "machine_max_acceleration_e": [ - "5000", - "5000" - ], - "machine_max_acceleration_extruding": [ - "4000", - "4000" - ], - "machine_max_acceleration_retracting": [ - "1250", - "1250" - ], - "machine_max_acceleration_x": [ - "4000", - "4000" - ], - "machine_max_acceleration_y": [ - "4000", - "4000" - ], - "machine_max_acceleration_z": [ - "400", - "400" - ], - "machine_max_acceleration_travel": [ - "4000", - "4000" - ], - "machine_max_jerk_e": [ - "10", - "2.5" - ], - "machine_max_jerk_x": [ - "8", - "8" - ], - "machine_max_jerk_y": [ - "8", - "8" - ], - "machine_max_jerk_z": [ - "2", - "2" - ], - "machine_max_speed_e": [ - "80", - "25" - ], - "machine_max_speed_x": [ - "400", - "400" - ], - "machine_max_speed_y": [ - "400", - "400" - ], - "retraction_length": [ - "2.5" - ], - "retraction_minimum_travel": [ - "1.5" - ], - "retraction_speed": [ - "70" - ], - "deretraction_speed": [ - "40" - ], - "z_hop": [ - "0.2" - ], - "host_type": "prusalink", - "printable_height": "180", - "machine_end_gcode": "{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+2, max_print_height)} F720 ; Move print head up{endif}\nG1 X170 Y170 F4200 ; park print head\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+50, max_print_height)} F720 ; Move print head further up{endif}\nG4 ; wait\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nM221 S100 ; reset flow\nM572 S0 ; reset PA\nM569 S1 X Y ; reset to stealthchop for X Y\nM84 ; disable motors\n; max_layer_z = [max_layer_z]", - "machine_pause_gcode": "M601", - "machine_start_gcode": "M862.3 P \"MINI\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM862.5 P2 ; g-code level check\nM862.6 P\"Input shaper\" ; FW feature check\nM115 6.0.0+14794\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S170 ; set extruder temp for bed leveling\nM140 S[first_layer_bed_temperature] ; set bed temp\nM109 R170 ; wait for bed leveling temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM569 S1 X Y ; set stealthchop for X Y\nM204 T1250 ; set travel acceleration\nG28 ; home all without mesh bed level\nG29 ; mesh bed leveling \nM104 S[first_layer_temperature] ; set extruder temp\nG92 E0\n\nG1 X0 Y-2 Z3 F2400\n\nM109 S[first_layer_temperature] ; wait for extruder temp\n\n; intro line\nG1 X10 Z0.2 F1000\nG1 X70 E8 F900\nG1 X140 E10 F700\nG92 E0\n\nM569 S0 X Y ; set spreadcycle for X Y\nM204 T[machine_max_acceleration_travel] ; restore travel acceleration\nM572 W0.06 ; set smooth time\nM221 S95 ; set flow", - "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\nG92 E0.0\n;[layer_z]\nM201 X{interpolate_table(extruded_weight_total, (0,4000), (1000,1700), (10000,1700))} Y{interpolate_table(extruded_weight_total, (0,4000), (1000,1700), (10000,1700))}\n{if ! spiral_mode}M74 W[extruded_weight_total]{endif}\n", - "change_filament_gcode": "M600\nG1 E0.4 F1500 ; prime after color change", - "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", - "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_MINIIS\nNO_TEMPLATES", - "scan_first_layer": "0", - "machine_load_filament_time": "17", - "machine_unload_filament_time": "16", - "nozzle_type": "brass", - "auxiliary_fan": "0", - "thumbnails": [ - "16x16", - "313x173", - "440x240" - ] -} + "type": "machine", + "setting_id": "GM003", + "name": "Prusa MINIIS 0.4 nozzle", + "from": "system", + "instantiation": "true", + "inherits": "fdm_machine_common", + "gcode_flavor": "marlin2", + "printer_model": "MINIIS", + "printer_variant": "0.4", + "default_filament_profile": [ + "Prusa Generic PLA @MINIIS" + ], + "default_print_profile": "0.20mm Standard @MINIIS", + "nozzle_diameter": [ + "0.4" + ], + "bed_exclude_area": [ + "0x0" + ], + "printable_area": [ + "0x0", + "180x0", + "180x180", + "0x180" + ], + "machine_max_acceleration_e": [ + "5000", + "5000" + ], + "machine_max_acceleration_extruding": [ + "4000", + "4000" + ], + "machine_max_acceleration_retracting": [ + "1250", + "1250" + ], + "machine_max_acceleration_x": [ + "4000", + "4000" + ], + "machine_max_acceleration_y": [ + "4000", + "4000" + ], + "machine_max_acceleration_z": [ + "400", + "400" + ], + "machine_max_acceleration_travel": [ + "4000", + "4000" + ], + "machine_max_jerk_e": [ + "10", + "2.5" + ], + "machine_max_jerk_x": [ + "8", + "8" + ], + "machine_max_jerk_y": [ + "8", + "8" + ], + "machine_max_jerk_z": [ + "2", + "2" + ], + "machine_max_speed_e": [ + "80", + "25" + ], + "machine_max_speed_x": [ + "400", + "400" + ], + "machine_max_speed_y": [ + "400", + "400" + ], + "retraction_length": [ + "2.5" + ], + "retraction_minimum_travel": [ + "1.5" + ], + "retraction_speed": [ + "70" + ], + "deretraction_speed": [ + "40" + ], + "z_hop": [ + "0.2" + ], + "host_type": "prusalink", + "printable_height": "180", + "machine_end_gcode": "{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+2, max_print_height)} F720 ; Move print head up{endif}\nG1 X170 Y170 F4200 ; park print head\n{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+50, max_print_height)} F720 ; Move print head further up{endif}\nG4 ; wait\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nM221 S100 ; reset flow\nM572 S0 ; reset PA\nM569 S1 X Y ; reset to stealthchop for X Y\nM84 ; disable motors\n; max_layer_z = [max_layer_z]", + "machine_pause_gcode": "M601", + "machine_start_gcode": "M862.3 P \"MINI\" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM862.5 P2 ; g-code level check\nM862.6 P\"Input shaper\" ; FW feature check\nM115 6.0.0+14794\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S170 ; set extruder temp for bed leveling\nM140 S[first_layer_bed_temperature] ; set bed temp\nM109 R170 ; wait for bed leveling temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM569 S1 X Y ; set stealthchop for X Y\nM204 T1250 ; set travel acceleration\nG28 ; home all without mesh bed level\nG29 ; mesh bed leveling \nM104 S[first_layer_temperature] ; set extruder temp\nG92 E0\n\nG1 X0 Y-2 Z3 F2400\n\nM109 S[first_layer_temperature] ; wait for extruder temp\n\n; intro line\nG1 X10 Z0.2 F1000\nG1 X70 E8 F900\nG1 X140 E10 F700\nG92 E0\n\nM569 S0 X Y ; set spreadcycle for X Y\nM204 T[machine_max_acceleration_travel] ; restore travel acceleration\nM572 W0.06 ; set smooth time\nM221 S95 ; set flow", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\nG92 E0.0\n;[layer_z]\nM201 X{interpolate_table(extruded_weight_total, (0,4000), (1000,1700), (10000,1700))} Y{interpolate_table(extruded_weight_total, (0,4000), (1000,1700), (10000,1700))}\n{if ! spiral_mode}M74 W[extruded_weight_total]{endif}\n", + "change_filament_gcode": "M600\nG1 E0.4 F1500 ; prime after color change", + "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", + "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_MINIIS\nNO_TEMPLATES", + "scan_first_layer": "0", + "machine_load_filament_time": "17", + "machine_unload_filament_time": "16", + "nozzle_type": "brass", + "auxiliary_fan": "0", + "thumbnails": [ + "16x16/QOI", + "220x124/QOI", + "200x240/QOI", + "640x480/PNG" + ] +} \ No newline at end of file diff --git a/resources/profiles/Prusa/machine/Prusa MINIIS 0.6 nozzle.json b/resources/profiles/Prusa/machine/Prusa MINIIS 0.6 nozzle.json index b3df3dff2bf..69775ca1e54 100644 --- a/resources/profiles/Prusa/machine/Prusa MINIIS 0.6 nozzle.json +++ b/resources/profiles/Prusa/machine/Prusa MINIIS 0.6 nozzle.json @@ -26,5 +26,11 @@ ], "retraction_speed": [ "70" - ] + ], + "thumbnails": [ + "16x16/QOI", + "220x124/QOI", + "200x240/QOI", + "640x480/PNG" +] } diff --git a/resources/profiles/Prusa/machine/Prusa MINIIS 0.8 nozzle.json b/resources/profiles/Prusa/machine/Prusa MINIIS 0.8 nozzle.json index c6c0fad3b96..9eb6861bfb3 100644 --- a/resources/profiles/Prusa/machine/Prusa MINIIS 0.8 nozzle.json +++ b/resources/profiles/Prusa/machine/Prusa MINIIS 0.8 nozzle.json @@ -29,5 +29,11 @@ ], "deretraction_speed": [ "20" -] +], + "thumbnails": [ + "16x16/QOI", + "220x124/QOI", + "200x240/QOI", + "640x480/PNG" + ] } diff --git a/resources/profiles/Prusa/machine/Prusa MK4 0.25 nozzle.json b/resources/profiles/Prusa/machine/Prusa MK4 0.25 nozzle.json index 2e672aee1f1..bdf5a19c8d2 100644 --- a/resources/profiles/Prusa/machine/Prusa MK4 0.25 nozzle.json +++ b/resources/profiles/Prusa/machine/Prusa MK4 0.25 nozzle.json @@ -1,80 +1,82 @@ { - "type": "machine", - "setting_id": "GM004", - "name": "Prusa MK4 0.25 nozzle", - "from": "system", - "instantiation": "true", - "inherits": "fdm_machine_common", - "gcode_flavor": "marlin2", - "printer_model": "MK4IS", - "default_filament_profile": [ - "Prusa Generic PLA @MK4" - ], - "default_print_profile": "0.08mm Standard @MK4", - "nozzle_diameter": [ - "0.25" - ], - "printer_variant": "0.25", - "bed_exclude_area": [ - "0x0" - ], - "printable_area": [ - "0x0", - "250x0", - "250x210", - "0x210" - ], - "machine_max_acceleration_e": [ - "2500", - "2500" - ], - "machine_max_acceleration_extruding": [ - "4000", - "4000" - ], - "machine_max_acceleration_retracting": [ - "1200", - "1200" - ], - "machine_max_acceleration_x": [ - "4000", - "4000" - ], - "machine_max_acceleration_y": [ - "4000", - "4000" - ], - "machine_max_acceleration_z": [ - "200", - "200" - ], - "machine_max_acceleration_travel": [ - "4000", - "4000" - ], - "max_layer_height": [ - "0.16" - ], - "min_layer_height": [ - "0.04" - ], - "host_type": "prusalink", - "printable_height": "220", - "machine_end_gcode": "{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+1, max_print_height)} F720 ; Move print head up{endif}\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nG1 X241 Y170 F3600 ; park\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+23, max_print_height)} F300 ; Move print head up{endif}\nG4 ; wait\nM572 S0 ; reset PA\nM593 X T2 F0 ; disable IS\nM593 Y T2 F0 ; disable IS\nM84 X Y E ; disable motors\n; max_layer_z = [max_layer_z]", - "machine_pause_gcode": "M601", - "machine_start_gcode": "M17 ; enable steppers\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM862.3 P \"MK4\" ; printer model check\nM862.5 P2 ; g-code level check\nM862.6 P\"Input shaper\" ; FW feature check\nM115 U5.0.0-RC+11963\n\nM555 X{(min(print_bed_max[0], first_layer_print_min[0] + 32) - 32)} Y{(max(0, first_layer_print_min[1]) - 4)} W{((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) - ((min(print_bed_max[0], first_layer_print_min[0] + 32) - 32))} H{((first_layer_print_max[1])) - ((max(0, first_layer_print_min[1]) - 4))}\n\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\n\nM140 S[first_layer_bed_temperature] ; set bed temp\n{if filament_type[initial_tool]==\"PC\" or filament_type[initial_tool]==\"PA\"}\nM104 S{first_layer_temperature[initial_tool]-25} ; set extruder temp for bed leveling\nM109 R{first_layer_temperature[initial_tool]-25} ; wait for temp\n{elsif filament_type[initial_tool]==\"FLEX\"}\nM104 S210 ; set extruder temp for bed leveling\nM109 R210 ; wait for temp\n{else}\nM104 S170 ; set extruder temp for bed leveling\nM109 R170 ; wait for temp\n{endif}\n\nM84 E ; turn off E motor\n\nG28 ; home all without mesh bed level\n\nG1 X{10 + 32} Y-4 Z5 F4800\n\nM302 S160 ; lower cold extrusion limit to 160C\n\n{if filament_type[initial_tool]==\"FLEX\"}\nG1 E-4 F2400 ; retraction\n{else}\nG1 E-2 F2400 ; retraction\n{endif}\n\nM84 E ; turn off E motor\n\nG29 P9 X10 Y-4 W32 H4\n\n{if first_layer_bed_temperature[initial_tool]<=60}M106 S100{endif}\n\nG0 Z40 F10000\n\nM190 S[first_layer_bed_temperature] ; wait for bed temp\n\nM107\n\n;\n; MBL\n;\nM84 E ; turn off E motor\nG29 P1 ; invalidate mbl & probe print area\nG29 P1 X0 Y0 W50 H20 C ; probe near purge place\nG29 P3.2 ; interpolate mbl probes\nG29 P3.13 ; extrapolate mbl outside probe area\nG29 A ; activate mbl\n\n; prepare for purge\nM104 S{first_layer_temperature[0]}\nG0 X0 Y-4 Z15 F4800 ; move away and ready for the purge\nM109 S{first_layer_temperature[0]}\n\nG92 E0\nM569 S0 E ; set spreadcycle mode for extruder\n\n;\n; Extrude purge line\n;\nG92 E0 ; reset extruder position\nG1 E{(filament_type[0] == \"FLEX\" ? 4 : 2)} F2400 ; deretraction after the initial one before nozzle cleaning\nG0 E7 X15 Z0.2 F500 ; purge\nG0 X25 E4 F500 ; purge\nG0 X35 E4 F650 ; purge\nG0 X45 E4 F800 ; purge\nG0 X{45 + 3} Z{0.05} F{8000} ; wipe, move close to the bed\nG0 X{45 + 3 * 2} Z0.2 F{8000} ; wipe, move quickly away from the bed\n\nG92 E0\nM221 S100 ; set flow to 100%", - "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\nG92 E0.0\n;[layer_z]\nM201 X{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))} Y{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))}\n{if !spiral_mode}M74 W[extruded_weight_total]{endif}", - "change_filament_gcode": "M600\nG1 E0.4 F1500 ; prime after color change", - "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", - "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_MODEL_MK4IS\nPG", - "scan_first_layer": "0", - "machine_load_filament_time": "17", - "machine_unload_filament_time": "16", - "nozzle_type": "hardened_steel", - "auxiliary_fan": "0", - "thumbnails": [ - "16x16", - "313x173", - "440x240" - ] -} + "type": "machine", + "setting_id": "GM004", + "name": "Prusa MK4 0.25 nozzle", + "from": "system", + "instantiation": "true", + "inherits": "fdm_machine_common", + "gcode_flavor": "marlin2", + "printer_model": "MK4IS", + "default_filament_profile": [ + "Prusa Generic PLA @MK4" + ], + "default_print_profile": "0.08mm Standard @MK4", + "nozzle_diameter": [ + "0.25" + ], + "printer_variant": "0.25", + "bed_exclude_area": [ + "0x0" + ], + "printable_area": [ + "0x0", + "250x0", + "250x210", + "0x210" + ], + "machine_max_acceleration_e": [ + "2500", + "2500" + ], + "machine_max_acceleration_extruding": [ + "4000", + "4000" + ], + "machine_max_acceleration_retracting": [ + "1200", + "1200" + ], + "machine_max_acceleration_x": [ + "4000", + "4000" + ], + "machine_max_acceleration_y": [ + "4000", + "4000" + ], + "machine_max_acceleration_z": [ + "200", + "200" + ], + "machine_max_acceleration_travel": [ + "4000", + "4000" + ], + "max_layer_height": [ + "0.16" + ], + "min_layer_height": [ + "0.04" + ], + "host_type": "prusalink", + "printable_height": "220", + "machine_end_gcode": "{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+1, max_print_height)} F720 ; Move print head up{endif}\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nG1 X241 Y170 F3600 ; park\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+23, max_print_height)} F300 ; Move print head up{endif}\nG4 ; wait\nM572 S0 ; reset PA\nM593 X T2 F0 ; disable IS\nM593 Y T2 F0 ; disable IS\nM84 X Y E ; disable motors\n; max_layer_z = [max_layer_z]", + "machine_pause_gcode": "M601", + "machine_start_gcode": "M17 ; enable steppers\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM862.3 P \"MK4\" ; printer model check\nM862.5 P2 ; g-code level check\nM862.6 P\"Input shaper\" ; FW feature check\nM115 U5.0.0-RC+11963\n\nM555 X{(min(print_bed_max[0], first_layer_print_min[0] + 32) - 32)} Y{(max(0, first_layer_print_min[1]) - 4)} W{((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) - ((min(print_bed_max[0], first_layer_print_min[0] + 32) - 32))} H{((first_layer_print_max[1])) - ((max(0, first_layer_print_min[1]) - 4))}\n\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\n\nM140 S[first_layer_bed_temperature] ; set bed temp\n{if filament_type[initial_tool]==\"PC\" or filament_type[initial_tool]==\"PA\"}\nM104 S{first_layer_temperature[initial_tool]-25} ; set extruder temp for bed leveling\nM109 R{first_layer_temperature[initial_tool]-25} ; wait for temp\n{elsif filament_type[initial_tool]==\"FLEX\"}\nM104 S210 ; set extruder temp for bed leveling\nM109 R210 ; wait for temp\n{else}\nM104 S170 ; set extruder temp for bed leveling\nM109 R170 ; wait for temp\n{endif}\n\nM84 E ; turn off E motor\n\nG28 ; home all without mesh bed level\n\nG1 X{10 + 32} Y-4 Z5 F4800\n\nM302 S160 ; lower cold extrusion limit to 160C\n\n{if filament_type[initial_tool]==\"FLEX\"}\nG1 E-4 F2400 ; retraction\n{else}\nG1 E-2 F2400 ; retraction\n{endif}\n\nM84 E ; turn off E motor\n\nG29 P9 X10 Y-4 W32 H4\n\n{if first_layer_bed_temperature[initial_tool]<=60}M106 S100{endif}\n\nG0 Z40 F10000\n\nM190 S[first_layer_bed_temperature] ; wait for bed temp\n\nM107\n\n;\n; MBL\n;\nM84 E ; turn off E motor\nG29 P1 ; invalidate mbl & probe print area\nG29 P1 X0 Y0 W50 H20 C ; probe near purge place\nG29 P3.2 ; interpolate mbl probes\nG29 P3.13 ; extrapolate mbl outside probe area\nG29 A ; activate mbl\n\n; prepare for purge\nM104 S{first_layer_temperature[0]}\nG0 X0 Y-4 Z15 F4800 ; move away and ready for the purge\nM109 S{first_layer_temperature[0]}\n\nG92 E0\nM569 S0 E ; set spreadcycle mode for extruder\n\n;\n; Extrude purge line\n;\nG92 E0 ; reset extruder position\nG1 E{(filament_type[0] == \"FLEX\" ? 4 : 2)} F2400 ; deretraction after the initial one before nozzle cleaning\nG0 E7 X15 Z0.2 F500 ; purge\nG0 X25 E4 F500 ; purge\nG0 X35 E4 F650 ; purge\nG0 X45 E4 F800 ; purge\nG0 X{45 + 3} Z{0.05} F{8000} ; wipe, move close to the bed\nG0 X{45 + 3 * 2} Z0.2 F{8000} ; wipe, move quickly away from the bed\n\nG92 E0\nM221 S100 ; set flow to 100%", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\nG92 E0.0\n;[layer_z]\nM201 X{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))} Y{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))}\n{if !spiral_mode}M74 W[extruded_weight_total]{endif}", + "change_filament_gcode": "M600\nG1 E0.4 F1500 ; prime after color change", + "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", + "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_MODEL_MK4IS\nPG", + "scan_first_layer": "0", + "machine_load_filament_time": "17", + "machine_unload_filament_time": "16", + "nozzle_type": "hardened_steel", + "auxiliary_fan": "0", + "thumbnails": [ + "16x16/QOI", + "313x173/QOI", + "440x240/QOI", + "480x240/QOI", + "640x480/PNG" + ] +} \ No newline at end of file diff --git a/resources/profiles/Prusa/machine/Prusa MK4 0.4 nozzle.json b/resources/profiles/Prusa/machine/Prusa MK4 0.4 nozzle.json index ecc26b3b323..ad6d6eb8607 100644 --- a/resources/profiles/Prusa/machine/Prusa MK4 0.4 nozzle.json +++ b/resources/profiles/Prusa/machine/Prusa MK4 0.4 nozzle.json @@ -1,73 +1,75 @@ { - "type": "machine", - "setting_id": "GM003", - "name": "Prusa MK4 0.4 nozzle", - "from": "system", - "instantiation": "true", - "inherits": "fdm_machine_common", - "gcode_flavor": "marlin2", - "printer_model": "MK4IS", - "default_filament_profile": [ - "Prusa Generic PLA @MK4" - ], - "default_print_profile": "0.20mm Standard @MK4", - "nozzle_diameter": [ - "0.4" - ], - "bed_exclude_area": [ - "0x0" - ], - "printable_area": [ - "0x0", - "250x0", - "250x210", - "0x210" - ], - "machine_max_acceleration_e": [ - "2500", - "2500" - ], - "machine_max_acceleration_extruding": [ - "4000", - "4000" - ], - "machine_max_acceleration_retracting": [ - "1200", - "1200" - ], - "machine_max_acceleration_x": [ - "4000", - "4000" - ], - "machine_max_acceleration_y": [ - "4000", - "4000" - ], - "machine_max_acceleration_z": [ - "200", - "200" - ], - "machine_max_acceleration_travel": [ - "4000", - "4000" - ], - "host_type": "prusalink", - "printable_height": "220", - "machine_end_gcode": "{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+1, max_print_height)} F720 ; Move print head up{endif}\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nG1 X241 Y170 F3600 ; park\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+23, max_print_height)} F300 ; Move print head up{endif}\nG4 ; wait\nM572 S0 ; reset PA\nM593 X T2 F0 ; disable IS\nM593 Y T2 F0 ; disable IS\nM84 X Y E ; disable motors\n; max_layer_z = [max_layer_z]", - "machine_pause_gcode": "M601", - "machine_start_gcode": "M17 ; enable steppers\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM862.3 P \"MK4\" ; printer model check\nM862.5 P2 ; g-code level check\nM862.6 P\"Input shaper\" ; FW feature check\nM115 U5.0.0-RC+11963\n\nM555 X{(min(print_bed_max[0], first_layer_print_min[0] + 32) - 32)} Y{(max(0, first_layer_print_min[1]) - 4)} W{((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) - ((min(print_bed_max[0], first_layer_print_min[0] + 32) - 32))} H{((first_layer_print_max[1])) - ((max(0, first_layer_print_min[1]) - 4))}\n\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\n\nM140 S[first_layer_bed_temperature] ; set bed temp\n{if filament_type[initial_tool]==\"PC\" or filament_type[initial_tool]==\"PA\"}\nM104 S{first_layer_temperature[initial_tool]-25} ; set extruder temp for bed leveling\nM109 R{first_layer_temperature[initial_tool]-25} ; wait for temp\n{elsif filament_type[initial_tool]==\"FLEX\"}\nM104 S210 ; set extruder temp for bed leveling\nM109 R210 ; wait for temp\n{else}\nM104 S170 ; set extruder temp for bed leveling\nM109 R170 ; wait for temp\n{endif}\n\nM84 E ; turn off E motor\n\nG28 ; home all without mesh bed level\n\nG1 X{10 + 32} Y-4 Z5 F4800\n\nM302 S160 ; lower cold extrusion limit to 160C\n\n{if filament_type[initial_tool]==\"FLEX\"}\nG1 E-4 F2400 ; retraction\n{else}\nG1 E-2 F2400 ; retraction\n{endif}\n\nM84 E ; turn off E motor\n\nG29 P9 X10 Y-4 W32 H4\n\n{if first_layer_bed_temperature[initial_tool]<=60}M106 S100{endif}\n\nG0 Z40 F10000\n\nM190 S[first_layer_bed_temperature] ; wait for bed temp\n\nM107\n\n;\n; MBL\n;\nM84 E ; turn off E motor\nG29 P1 ; invalidate mbl & probe print area\nG29 P1 X0 Y0 W50 H20 C ; probe near purge place\nG29 P3.2 ; interpolate mbl probes\nG29 P3.13 ; extrapolate mbl outside probe area\nG29 A ; activate mbl\n\n; prepare for purge\nM104 S{first_layer_temperature[0]}\nG0 X0 Y-4 Z15 F4800 ; move away and ready for the purge\nM109 S{first_layer_temperature[0]}\n\nG92 E0\nM569 S0 E ; set spreadcycle mode for extruder\n\n;\n; Extrude purge line\n;\nG92 E0 ; reset extruder position\nG1 E{(filament_type[0] == \"FLEX\" ? 4 : 2)} F2400 ; deretraction after the initial one before nozzle cleaning\nG0 E7 X15 Z0.2 F500 ; purge\nG0 X25 E4 F500 ; purge\nG0 X35 E4 F650 ; purge\nG0 X45 E4 F800 ; purge\nG0 X{45 + 3} Z{0.05} F{8000} ; wipe, move close to the bed\nG0 X{45 + 3 * 2} Z0.2 F{8000} ; wipe, move quickly away from the bed\n\nG92 E0\nM221 S100 ; set flow to 100%", - "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\nG92 E0.0\n;[layer_z]\nM201 X{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))} Y{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))}\n{if !spiral_mode}M74 W[extruded_weight_total]{endif}", - "change_filament_gcode": "M600\nG1 E0.4 F1500 ; prime after color change", - "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", - "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_MODEL_MK4IS\nPG", - "scan_first_layer": "0", - "machine_load_filament_time": "17", - "machine_unload_filament_time": "16", - "nozzle_type": "hardened_steel", - "auxiliary_fan": "0", - "thumbnails": [ - "16x16", - "313x173", - "440x240" - ] -} + "type": "machine", + "setting_id": "GM003", + "name": "Prusa MK4 0.4 nozzle", + "from": "system", + "instantiation": "true", + "inherits": "fdm_machine_common", + "gcode_flavor": "marlin2", + "printer_model": "MK4IS", + "default_filament_profile": [ + "Prusa Generic PLA @MK4" + ], + "default_print_profile": "0.20mm Standard @MK4", + "nozzle_diameter": [ + "0.4" + ], + "bed_exclude_area": [ + "0x0" + ], + "printable_area": [ + "0x0", + "250x0", + "250x210", + "0x210" + ], + "machine_max_acceleration_e": [ + "2500", + "2500" + ], + "machine_max_acceleration_extruding": [ + "4000", + "4000" + ], + "machine_max_acceleration_retracting": [ + "1200", + "1200" + ], + "machine_max_acceleration_x": [ + "4000", + "4000" + ], + "machine_max_acceleration_y": [ + "4000", + "4000" + ], + "machine_max_acceleration_z": [ + "200", + "200" + ], + "machine_max_acceleration_travel": [ + "4000", + "4000" + ], + "host_type": "prusalink", + "printable_height": "220", + "machine_end_gcode": "{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+1, max_print_height)} F720 ; Move print head up{endif}\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nG1 X241 Y170 F3600 ; park\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+23, max_print_height)} F300 ; Move print head up{endif}\nG4 ; wait\nM572 S0 ; reset PA\nM593 X T2 F0 ; disable IS\nM593 Y T2 F0 ; disable IS\nM84 X Y E ; disable motors\n; max_layer_z = [max_layer_z]", + "machine_pause_gcode": "M601", + "machine_start_gcode": "M17 ; enable steppers\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM862.3 P \"MK4\" ; printer model check\nM862.5 P2 ; g-code level check\nM862.6 P\"Input shaper\" ; FW feature check\nM115 U5.0.0-RC+11963\n\nM555 X{(min(print_bed_max[0], first_layer_print_min[0] + 32) - 32)} Y{(max(0, first_layer_print_min[1]) - 4)} W{((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) - ((min(print_bed_max[0], first_layer_print_min[0] + 32) - 32))} H{((first_layer_print_max[1])) - ((max(0, first_layer_print_min[1]) - 4))}\n\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\n\nM140 S[first_layer_bed_temperature] ; set bed temp\n{if filament_type[initial_tool]==\"PC\" or filament_type[initial_tool]==\"PA\"}\nM104 S{first_layer_temperature[initial_tool]-25} ; set extruder temp for bed leveling\nM109 R{first_layer_temperature[initial_tool]-25} ; wait for temp\n{elsif filament_type[initial_tool]==\"FLEX\"}\nM104 S210 ; set extruder temp for bed leveling\nM109 R210 ; wait for temp\n{else}\nM104 S170 ; set extruder temp for bed leveling\nM109 R170 ; wait for temp\n{endif}\n\nM84 E ; turn off E motor\n\nG28 ; home all without mesh bed level\n\nG1 X{10 + 32} Y-4 Z5 F4800\n\nM302 S160 ; lower cold extrusion limit to 160C\n\n{if filament_type[initial_tool]==\"FLEX\"}\nG1 E-4 F2400 ; retraction\n{else}\nG1 E-2 F2400 ; retraction\n{endif}\n\nM84 E ; turn off E motor\n\nG29 P9 X10 Y-4 W32 H4\n\n{if first_layer_bed_temperature[initial_tool]<=60}M106 S100{endif}\n\nG0 Z40 F10000\n\nM190 S[first_layer_bed_temperature] ; wait for bed temp\n\nM107\n\n;\n; MBL\n;\nM84 E ; turn off E motor\nG29 P1 ; invalidate mbl & probe print area\nG29 P1 X0 Y0 W50 H20 C ; probe near purge place\nG29 P3.2 ; interpolate mbl probes\nG29 P3.13 ; extrapolate mbl outside probe area\nG29 A ; activate mbl\n\n; prepare for purge\nM104 S{first_layer_temperature[0]}\nG0 X0 Y-4 Z15 F4800 ; move away and ready for the purge\nM109 S{first_layer_temperature[0]}\n\nG92 E0\nM569 S0 E ; set spreadcycle mode for extruder\n\n;\n; Extrude purge line\n;\nG92 E0 ; reset extruder position\nG1 E{(filament_type[0] == \"FLEX\" ? 4 : 2)} F2400 ; deretraction after the initial one before nozzle cleaning\nG0 E7 X15 Z0.2 F500 ; purge\nG0 X25 E4 F500 ; purge\nG0 X35 E4 F650 ; purge\nG0 X45 E4 F800 ; purge\nG0 X{45 + 3} Z{0.05} F{8000} ; wipe, move close to the bed\nG0 X{45 + 3 * 2} Z0.2 F{8000} ; wipe, move quickly away from the bed\n\nG92 E0\nM221 S100 ; set flow to 100%", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\nG92 E0.0\n;[layer_z]\nM201 X{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))} Y{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))}\n{if !spiral_mode}M74 W[extruded_weight_total]{endif}", + "change_filament_gcode": "M600\nG1 E0.4 F1500 ; prime after color change", + "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", + "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_MODEL_MK4IS\nPG", + "scan_first_layer": "0", + "machine_load_filament_time": "17", + "machine_unload_filament_time": "16", + "nozzle_type": "hardened_steel", + "auxiliary_fan": "0", + "thumbnails": [ + "16x16/QOI", + "313x173/QOI", + "440x240/QOI", + "480x240/QOI", + "640x480/PNG" + ] +} \ No newline at end of file diff --git a/resources/profiles/Prusa/machine/Prusa MK4 0.6 nozzle.json b/resources/profiles/Prusa/machine/Prusa MK4 0.6 nozzle.json index 18bdc378d04..c55b17db55e 100644 --- a/resources/profiles/Prusa/machine/Prusa MK4 0.6 nozzle.json +++ b/resources/profiles/Prusa/machine/Prusa MK4 0.6 nozzle.json @@ -1,80 +1,82 @@ { - "type": "machine", - "setting_id": "GM002", - "name": "Prusa MK4 0.6 nozzle", - "from": "system", - "instantiation": "true", - "inherits": "fdm_machine_common", - "gcode_flavor": "marlin2", - "printer_model": "MK4IS", - "default_filament_profile": [ - "Prusa Generic PLA @MK4" - ], - "default_print_profile": "0.32mm Standard @MK4", - "nozzle_diameter": [ - "0.6" - ], - "printer_variant": "0.6", - "bed_exclude_area": [ - "0x0" - ], - "printable_area": [ - "0x0", - "250x0", - "250x210", - "0x210" - ], - "machine_max_acceleration_e": [ - "2500", - "2500" - ], - "machine_max_acceleration_extruding": [ - "4000", - "4000" - ], - "machine_max_acceleration_retracting": [ - "1200", - "1200" - ], - "machine_max_acceleration_x": [ - "4000", - "4000" - ], - "machine_max_acceleration_y": [ - "4000", - "4000" - ], - "machine_max_acceleration_z": [ - "200", - "200" - ], - "machine_max_acceleration_travel": [ - "4000", - "4000" - ], - "max_layer_height": [ - "0.4" - ], - "min_layer_height": [ - "0.12" - ], - "host_type": "prusalink", - "printable_height": "220", - "machine_end_gcode": "{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+1, max_print_height)} F720 ; Move print head up{endif}\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nG1 X241 Y170 F3600 ; park\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+23, max_print_height)} F300 ; Move print head up{endif}\nG4 ; wait\nM572 S0 ; reset PA\nM593 X T2 F0 ; disable IS\nM593 Y T2 F0 ; disable IS\nM84 X Y E ; disable motors\n; max_layer_z = [max_layer_z]", - "machine_pause_gcode": "M601", - "machine_start_gcode": "M17 ; enable steppers\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM862.3 P \"MK4\" ; printer model check\nM862.5 P2 ; g-code level check\nM862.6 P\"Input shaper\" ; FW feature check\nM115 U5.0.0-RC+11963\n\nM555 X{(min(print_bed_max[0], first_layer_print_min[0] + 32) - 32)} Y{(max(0, first_layer_print_min[1]) - 4)} W{((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) - ((min(print_bed_max[0], first_layer_print_min[0] + 32) - 32))} H{((first_layer_print_max[1])) - ((max(0, first_layer_print_min[1]) - 4))}\n\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\n\nM140 S[first_layer_bed_temperature] ; set bed temp\n{if filament_type[initial_tool]==\"PC\" or filament_type[initial_tool]==\"PA\"}\nM104 S{first_layer_temperature[initial_tool]-25} ; set extruder temp for bed leveling\nM109 R{first_layer_temperature[initial_tool]-25} ; wait for temp\n{elsif filament_type[initial_tool]==\"FLEX\"}\nM104 S210 ; set extruder temp for bed leveling\nM109 R210 ; wait for temp\n{else}\nM104 S170 ; set extruder temp for bed leveling\nM109 R170 ; wait for temp\n{endif}\n\nM84 E ; turn off E motor\n\nG28 ; home all without mesh bed level\n\nG1 X{10 + 32} Y-4 Z5 F4800\n\nM302 S160 ; lower cold extrusion limit to 160C\n\n{if filament_type[initial_tool]==\"FLEX\"}\nG1 E-4 F2400 ; retraction\n{else}\nG1 E-2 F2400 ; retraction\n{endif}\n\nM84 E ; turn off E motor\n\nG29 P9 X10 Y-4 W32 H4\n\n{if first_layer_bed_temperature[initial_tool]<=60}M106 S100{endif}\n\nG0 Z40 F10000\n\nM190 S[first_layer_bed_temperature] ; wait for bed temp\n\nM107\n\n;\n; MBL\n;\nM84 E ; turn off E motor\nG29 P1 ; invalidate mbl & probe print area\nG29 P1 X0 Y0 W50 H20 C ; probe near purge place\nG29 P3.2 ; interpolate mbl probes\nG29 P3.13 ; extrapolate mbl outside probe area\nG29 A ; activate mbl\n\n; prepare for purge\nM104 S{first_layer_temperature[0]}\nG0 X0 Y-4 Z15 F4800 ; move away and ready for the purge\nM109 S{first_layer_temperature[0]}\n\nG92 E0\nM569 S0 E ; set spreadcycle mode for extruder\n\n;\n; Extrude purge line\n;\nG92 E0 ; reset extruder position\nG1 E{(filament_type[0] == \"FLEX\" ? 4 : 2)} F2400 ; deretraction after the initial one before nozzle cleaning\nG0 E7 X15 Z0.2 F500 ; purge\nG0 X25 E4 F500 ; purge\nG0 X35 E4 F650 ; purge\nG0 X45 E4 F800 ; purge\nG0 X{45 + 3} Z{0.05} F{8000} ; wipe, move close to the bed\nG0 X{45 + 3 * 2} Z0.2 F{8000} ; wipe, move quickly away from the bed\n\nG92 E0\nM221 S100 ; set flow to 100%", - "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\nG92 E0.0\n;[layer_z]\nM201 X{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))} Y{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))}\n{if !spiral_mode}M74 W[extruded_weight_total]{endif}", - "change_filament_gcode": "M600\nG1 E0.4 F1500 ; prime after color change", - "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", - "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_MODEL_MK4IS\nPG", - "scan_first_layer": "0", - "machine_load_filament_time": "17", - "machine_unload_filament_time": "16", - "nozzle_type": "hardened_steel", - "auxiliary_fan": "0", - "thumbnails": [ - "16x16", - "313x173", - "440x240" - ] -} + "type": "machine", + "setting_id": "GM002", + "name": "Prusa MK4 0.6 nozzle", + "from": "system", + "instantiation": "true", + "inherits": "fdm_machine_common", + "gcode_flavor": "marlin2", + "printer_model": "MK4IS", + "default_filament_profile": [ + "Prusa Generic PLA @MK4" + ], + "default_print_profile": "0.32mm Standard @MK4", + "nozzle_diameter": [ + "0.6" + ], + "printer_variant": "0.6", + "bed_exclude_area": [ + "0x0" + ], + "printable_area": [ + "0x0", + "250x0", + "250x210", + "0x210" + ], + "machine_max_acceleration_e": [ + "2500", + "2500" + ], + "machine_max_acceleration_extruding": [ + "4000", + "4000" + ], + "machine_max_acceleration_retracting": [ + "1200", + "1200" + ], + "machine_max_acceleration_x": [ + "4000", + "4000" + ], + "machine_max_acceleration_y": [ + "4000", + "4000" + ], + "machine_max_acceleration_z": [ + "200", + "200" + ], + "machine_max_acceleration_travel": [ + "4000", + "4000" + ], + "max_layer_height": [ + "0.4" + ], + "min_layer_height": [ + "0.12" + ], + "host_type": "prusalink", + "printable_height": "220", + "machine_end_gcode": "{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+1, max_print_height)} F720 ; Move print head up{endif}\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nG1 X241 Y170 F3600 ; park\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+23, max_print_height)} F300 ; Move print head up{endif}\nG4 ; wait\nM572 S0 ; reset PA\nM593 X T2 F0 ; disable IS\nM593 Y T2 F0 ; disable IS\nM84 X Y E ; disable motors\n; max_layer_z = [max_layer_z]", + "machine_pause_gcode": "M601", + "machine_start_gcode": "M17 ; enable steppers\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM862.3 P \"MK4\" ; printer model check\nM862.5 P2 ; g-code level check\nM862.6 P\"Input shaper\" ; FW feature check\nM115 U5.0.0-RC+11963\n\nM555 X{(min(print_bed_max[0], first_layer_print_min[0] + 32) - 32)} Y{(max(0, first_layer_print_min[1]) - 4)} W{((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) - ((min(print_bed_max[0], first_layer_print_min[0] + 32) - 32))} H{((first_layer_print_max[1])) - ((max(0, first_layer_print_min[1]) - 4))}\n\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\n\nM140 S[first_layer_bed_temperature] ; set bed temp\n{if filament_type[initial_tool]==\"PC\" or filament_type[initial_tool]==\"PA\"}\nM104 S{first_layer_temperature[initial_tool]-25} ; set extruder temp for bed leveling\nM109 R{first_layer_temperature[initial_tool]-25} ; wait for temp\n{elsif filament_type[initial_tool]==\"FLEX\"}\nM104 S210 ; set extruder temp for bed leveling\nM109 R210 ; wait for temp\n{else}\nM104 S170 ; set extruder temp for bed leveling\nM109 R170 ; wait for temp\n{endif}\n\nM84 E ; turn off E motor\n\nG28 ; home all without mesh bed level\n\nG1 X{10 + 32} Y-4 Z5 F4800\n\nM302 S160 ; lower cold extrusion limit to 160C\n\n{if filament_type[initial_tool]==\"FLEX\"}\nG1 E-4 F2400 ; retraction\n{else}\nG1 E-2 F2400 ; retraction\n{endif}\n\nM84 E ; turn off E motor\n\nG29 P9 X10 Y-4 W32 H4\n\n{if first_layer_bed_temperature[initial_tool]<=60}M106 S100{endif}\n\nG0 Z40 F10000\n\nM190 S[first_layer_bed_temperature] ; wait for bed temp\n\nM107\n\n;\n; MBL\n;\nM84 E ; turn off E motor\nG29 P1 ; invalidate mbl & probe print area\nG29 P1 X0 Y0 W50 H20 C ; probe near purge place\nG29 P3.2 ; interpolate mbl probes\nG29 P3.13 ; extrapolate mbl outside probe area\nG29 A ; activate mbl\n\n; prepare for purge\nM104 S{first_layer_temperature[0]}\nG0 X0 Y-4 Z15 F4800 ; move away and ready for the purge\nM109 S{first_layer_temperature[0]}\n\nG92 E0\nM569 S0 E ; set spreadcycle mode for extruder\n\n;\n; Extrude purge line\n;\nG92 E0 ; reset extruder position\nG1 E{(filament_type[0] == \"FLEX\" ? 4 : 2)} F2400 ; deretraction after the initial one before nozzle cleaning\nG0 E7 X15 Z0.2 F500 ; purge\nG0 X25 E4 F500 ; purge\nG0 X35 E4 F650 ; purge\nG0 X45 E4 F800 ; purge\nG0 X{45 + 3} Z{0.05} F{8000} ; wipe, move close to the bed\nG0 X{45 + 3 * 2} Z0.2 F{8000} ; wipe, move quickly away from the bed\n\nG92 E0\nM221 S100 ; set flow to 100%", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\nG92 E0.0\n;[layer_z]\nM201 X{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))} Y{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))}\n{if !spiral_mode}M74 W[extruded_weight_total]{endif}", + "change_filament_gcode": "M600\nG1 E0.4 F1500 ; prime after color change", + "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", + "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_MODEL_MK4IS\nPG", + "scan_first_layer": "0", + "machine_load_filament_time": "17", + "machine_unload_filament_time": "16", + "nozzle_type": "hardened_steel", + "auxiliary_fan": "0", + "thumbnails": [ + "16x16/QOI", + "313x173/QOI", + "440x240/QOI", + "480x240/QOI", + "640x480/PNG" + ] +} \ No newline at end of file diff --git a/resources/profiles/Prusa/machine/Prusa MK4 0.8 nozzle.json b/resources/profiles/Prusa/machine/Prusa MK4 0.8 nozzle.json index dc2643c67e4..42cfe3a8079 100644 --- a/resources/profiles/Prusa/machine/Prusa MK4 0.8 nozzle.json +++ b/resources/profiles/Prusa/machine/Prusa MK4 0.8 nozzle.json @@ -1,80 +1,82 @@ { - "type": "machine", - "setting_id": "GM001", - "name": "Prusa MK4 0.8 nozzle", - "from": "system", - "instantiation": "true", - "inherits": "fdm_machine_common", - "gcode_flavor": "marlin2", - "printer_model": "MK4IS", - "default_filament_profile": [ - "Prusa Generic PLA @MK4" - ], - "default_print_profile": "0.40mm Standard @MK4", - "nozzle_diameter": [ - "0.8" - ], - "printer_variant": "0.8", - "bed_exclude_area": [ - "0x0" - ], - "printable_area": [ - "0x0", - "250x0", - "250x210", - "0x210" - ], - "machine_max_acceleration_e": [ - "2500", - "2500" - ], - "machine_max_acceleration_extruding": [ - "4000", - "4000" - ], - "machine_max_acceleration_retracting": [ - "1200", - "1200" - ], - "machine_max_acceleration_x": [ - "4000", - "4000" - ], - "machine_max_acceleration_y": [ - "4000", - "4000" - ], - "machine_max_acceleration_z": [ - "200", - "200" - ], - "machine_max_acceleration_travel": [ - "4000", - "4000" - ], - "max_layer_height": [ - "0.6" - ], - "min_layer_height": [ - "0.2" - ], - "host_type": "prusalink", - "printable_height": "220", - "machine_end_gcode": "{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+1, max_print_height)} F720 ; Move print head up{endif}\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nG1 X241 Y170 F3600 ; park\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+23, max_print_height)} F300 ; Move print head up{endif}\nG4 ; wait\nM572 S0 ; reset PA\nM593 X T2 F0 ; disable IS\nM593 Y T2 F0 ; disable IS\nM84 X Y E ; disable motors\n; max_layer_z = [max_layer_z]", - "machine_pause_gcode": "M601", - "machine_start_gcode": "M17 ; enable steppers\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM862.3 P \"MK4\" ; printer model check\nM862.5 P2 ; g-code level check\nM862.6 P\"Input shaper\" ; FW feature check\nM115 U5.0.0-RC+11963\n\nM555 X{(min(print_bed_max[0], first_layer_print_min[0] + 32) - 32)} Y{(max(0, first_layer_print_min[1]) - 4)} W{((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) - ((min(print_bed_max[0], first_layer_print_min[0] + 32) - 32))} H{((first_layer_print_max[1])) - ((max(0, first_layer_print_min[1]) - 4))}\n\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\n\nM140 S[first_layer_bed_temperature] ; set bed temp\n{if filament_type[initial_tool]==\"PC\" or filament_type[initial_tool]==\"PA\"}\nM104 S{first_layer_temperature[initial_tool]-25} ; set extruder temp for bed leveling\nM109 R{first_layer_temperature[initial_tool]-25} ; wait for temp\n{elsif filament_type[initial_tool]==\"FLEX\"}\nM104 S210 ; set extruder temp for bed leveling\nM109 R210 ; wait for temp\n{else}\nM104 S170 ; set extruder temp for bed leveling\nM109 R170 ; wait for temp\n{endif}\n\nM84 E ; turn off E motor\n\nG28 ; home all without mesh bed level\n\nG1 X{10 + 32} Y-4 Z5 F4800\n\nM302 S160 ; lower cold extrusion limit to 160C\n\n{if filament_type[initial_tool]==\"FLEX\"}\nG1 E-4 F2400 ; retraction\n{else}\nG1 E-2 F2400 ; retraction\n{endif}\n\nM84 E ; turn off E motor\n\nG29 P9 X10 Y-4 W32 H4\n\n{if first_layer_bed_temperature[initial_tool]<=60}M106 S100{endif}\n\nG0 Z40 F10000\n\nM190 S[first_layer_bed_temperature] ; wait for bed temp\n\nM107\n\n;\n; MBL\n;\nM84 E ; turn off E motor\nG29 P1 ; invalidate mbl & probe print area\nG29 P1 X0 Y0 W50 H20 C ; probe near purge place\nG29 P3.2 ; interpolate mbl probes\nG29 P3.13 ; extrapolate mbl outside probe area\nG29 A ; activate mbl\n\n; prepare for purge\nM104 S{first_layer_temperature[0]}\nG0 X0 Y-4 Z15 F4800 ; move away and ready for the purge\nM109 S{first_layer_temperature[0]}\n\nG92 E0\nM569 S0 E ; set spreadcycle mode for extruder\n\n;\n; Extrude purge line\n;\nG92 E0 ; reset extruder position\nG1 E{(filament_type[0] == \"FLEX\" ? 4 : 2)} F2400 ; deretraction after the initial one before nozzle cleaning\nG0 E7 X15 Z0.2 F500 ; purge\nG0 X25 E4 F500 ; purge\nG0 X35 E4 F650 ; purge\nG0 X45 E4 F800 ; purge\nG0 X{45 + 3} Z{0.05} F{8000} ; wipe, move close to the bed\nG0 X{45 + 3 * 2} Z0.2 F{8000} ; wipe, move quickly away from the bed\n\nG92 E0\nM221 S100 ; set flow to 100%", - "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\nG92 E0.0\n;[layer_z]\nM201 X{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))} Y{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))}\n{if !spiral_mode}M74 W[extruded_weight_total]{endif}", - "change_filament_gcode": "M600\nG1 E0.4 F1500 ; prime after color change", - "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", - "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_MODEL_MK4IS\nPG", - "scan_first_layer": "0", - "machine_load_filament_time": "17", - "machine_unload_filament_time": "16", - "nozzle_type": "hardened_steel", - "auxiliary_fan": "0", - "thumbnails": [ - "16x16", - "313x173", - "440x240" - ] -} + "type": "machine", + "setting_id": "GM001", + "name": "Prusa MK4 0.8 nozzle", + "from": "system", + "instantiation": "true", + "inherits": "fdm_machine_common", + "gcode_flavor": "marlin2", + "printer_model": "MK4IS", + "default_filament_profile": [ + "Prusa Generic PLA @MK4" + ], + "default_print_profile": "0.40mm Standard @MK4", + "nozzle_diameter": [ + "0.8" + ], + "printer_variant": "0.8", + "bed_exclude_area": [ + "0x0" + ], + "printable_area": [ + "0x0", + "250x0", + "250x210", + "0x210" + ], + "machine_max_acceleration_e": [ + "2500", + "2500" + ], + "machine_max_acceleration_extruding": [ + "4000", + "4000" + ], + "machine_max_acceleration_retracting": [ + "1200", + "1200" + ], + "machine_max_acceleration_x": [ + "4000", + "4000" + ], + "machine_max_acceleration_y": [ + "4000", + "4000" + ], + "machine_max_acceleration_z": [ + "200", + "200" + ], + "machine_max_acceleration_travel": [ + "4000", + "4000" + ], + "max_layer_height": [ + "0.6" + ], + "min_layer_height": [ + "0.2" + ], + "host_type": "prusalink", + "printable_height": "220", + "machine_end_gcode": "{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+1, max_print_height)} F720 ; Move print head up{endif}\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nG1 X241 Y170 F3600 ; park\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+23, max_print_height)} F300 ; Move print head up{endif}\nG4 ; wait\nM572 S0 ; reset PA\nM593 X T2 F0 ; disable IS\nM593 Y T2 F0 ; disable IS\nM84 X Y E ; disable motors\n; max_layer_z = [max_layer_z]", + "machine_pause_gcode": "M601", + "machine_start_gcode": "M17 ; enable steppers\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM862.3 P \"MK4\" ; printer model check\nM862.5 P2 ; g-code level check\nM862.6 P\"Input shaper\" ; FW feature check\nM115 U5.0.0-RC+11963\n\nM555 X{(min(print_bed_max[0], first_layer_print_min[0] + 32) - 32)} Y{(max(0, first_layer_print_min[1]) - 4)} W{((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) - ((min(print_bed_max[0], first_layer_print_min[0] + 32) - 32))} H{((first_layer_print_max[1])) - ((max(0, first_layer_print_min[1]) - 4))}\n\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\n\nM140 S[first_layer_bed_temperature] ; set bed temp\n{if filament_type[initial_tool]==\"PC\" or filament_type[initial_tool]==\"PA\"}\nM104 S{first_layer_temperature[initial_tool]-25} ; set extruder temp for bed leveling\nM109 R{first_layer_temperature[initial_tool]-25} ; wait for temp\n{elsif filament_type[initial_tool]==\"FLEX\"}\nM104 S210 ; set extruder temp for bed leveling\nM109 R210 ; wait for temp\n{else}\nM104 S170 ; set extruder temp for bed leveling\nM109 R170 ; wait for temp\n{endif}\n\nM84 E ; turn off E motor\n\nG28 ; home all without mesh bed level\n\nG1 X{10 + 32} Y-4 Z5 F4800\n\nM302 S160 ; lower cold extrusion limit to 160C\n\n{if filament_type[initial_tool]==\"FLEX\"}\nG1 E-4 F2400 ; retraction\n{else}\nG1 E-2 F2400 ; retraction\n{endif}\n\nM84 E ; turn off E motor\n\nG29 P9 X10 Y-4 W32 H4\n\n{if first_layer_bed_temperature[initial_tool]<=60}M106 S100{endif}\n\nG0 Z40 F10000\n\nM190 S[first_layer_bed_temperature] ; wait for bed temp\n\nM107\n\n;\n; MBL\n;\nM84 E ; turn off E motor\nG29 P1 ; invalidate mbl & probe print area\nG29 P1 X0 Y0 W50 H20 C ; probe near purge place\nG29 P3.2 ; interpolate mbl probes\nG29 P3.13 ; extrapolate mbl outside probe area\nG29 A ; activate mbl\n\n; prepare for purge\nM104 S{first_layer_temperature[0]}\nG0 X0 Y-4 Z15 F4800 ; move away and ready for the purge\nM109 S{first_layer_temperature[0]}\n\nG92 E0\nM569 S0 E ; set spreadcycle mode for extruder\n\n;\n; Extrude purge line\n;\nG92 E0 ; reset extruder position\nG1 E{(filament_type[0] == \"FLEX\" ? 4 : 2)} F2400 ; deretraction after the initial one before nozzle cleaning\nG0 E7 X15 Z0.2 F500 ; purge\nG0 X25 E4 F500 ; purge\nG0 X35 E4 F650 ; purge\nG0 X45 E4 F800 ; purge\nG0 X{45 + 3} Z{0.05} F{8000} ; wipe, move close to the bed\nG0 X{45 + 3 * 2} Z0.2 F{8000} ; wipe, move quickly away from the bed\n\nG92 E0\nM221 S100 ; set flow to 100%", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\nG92 E0.0\n;[layer_z]\nM201 X{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))} Y{interpolate_table(extruded_weight_total, (0,4000), (1400,2500), (10000,2500))}\n{if !spiral_mode}M74 W[extruded_weight_total]{endif}", + "change_filament_gcode": "M600\nG1 E0.4 F1500 ; prime after color change", + "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", + "printer_notes": "Don't remove the following keywords! These keywords are used in the \"compatible printer\" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_MODEL_MK4IS\nPG", + "scan_first_layer": "0", + "machine_load_filament_time": "17", + "machine_unload_filament_time": "16", + "nozzle_type": "hardened_steel", + "auxiliary_fan": "0", + "thumbnails": [ + "16x16/QOI", + "313x173/QOI", + "440x240/QOI", + "480x240/QOI", + "640x480/PNG" + ] +} \ No newline at end of file diff --git a/resources/profiles/Qidi/machine/fdm_qidi_x3_common.json b/resources/profiles/Qidi/machine/fdm_qidi_x3_common.json index ec546728269..2186dc925f8 100644 --- a/resources/profiles/Qidi/machine/fdm_qidi_x3_common.json +++ b/resources/profiles/Qidi/machine/fdm_qidi_x3_common.json @@ -19,10 +19,11 @@ "0.4" ], "thumbnails": [ - "380x380", - "210x210" + "380x380/COLPIC", + "210x210/COLPIC", + "380x380/PNG" ], - "thumbnails_format": "ColPic", + "thumbnails_format": "PNG", "machine_start_gcode": "G28\nG0 Z50 F600\nM190 S[first_layer_bed_temperature]\nG28 Z\nG29 ; mesh bed leveling ,comment this code to close it\nG0 X0 Y0 Z50 F6000\nM109 S[first_layer_temperature]\nM83\nG0 Z5 F1200\nG0 X{first_layer_print_min[0]} Y{max(0, first_layer_print_min[1] - 2)} F12000\nG0 Z0.2 F600\nG1 E3 F1800\nG0 Z0.3 F600\nG1 X{min(first_layer_print_min[0] + 30,print_bed_max[0])} E6 F600", "machine_end_gcode": "M104 S0\nM140 S0\nG92 E0\nG1 E-3 F1800\nG90\n{if max_layer_z < max_print_height / 2}\nG1 Z{max_print_height / 2 + 10} F600\n{else}\nG1 Z{min(max_print_height, max_layer_z + 10)}\n{endif}\nG0 X5 Y{print_bed_max[1]-11} F12000\nM141 S0", "scan_first_layer": "0" diff --git a/src/libslic3r/Config.cpp b/src/libslic3r/Config.cpp index 7b95f4cf08d..e826bb4c5b3 100644 --- a/src/libslic3r/Config.cpp +++ b/src/libslic3r/Config.cpp @@ -1014,6 +1014,10 @@ int ConfigBase::load_from_json(const std::string &file, ConfigSubstitutionContex } } } + + // Do legacy conversion on a completely loaded dictionary. + // Perform composite conversions, for example merging multiple keys into one key. + this->handle_legacy_composite(); return 0; } catch (const std::ifstream::failure &err) { @@ -1103,6 +1107,9 @@ ConfigSubstitutions ConfigBase::load(const boost::property_tree::ptree &tree, Fo // ignore } } + // Do legacy conversion on a completely loaded dictionary. + // Perform composite conversions, for example merging multiple keys into one key. + this->handle_legacy_composite(); return std::move(substitutions_ctxt.substitutions); } @@ -1189,7 +1196,10 @@ size_t ConfigBase::load_from_gcode_string_legacy(ConfigBase& config, const char* end = start; } - // BBS + // Do legacy conversion on a completely loaded dictionary. + // Perform composite conversions, for example merging multiple keys into one key. + config.handle_legacy_composite(); + free(result); return num_key_value_pairs; } @@ -1368,6 +1378,10 @@ ConfigSubstitutions ConfigBase::load_from_gcode_file(const std::string &file, Fo throw Slic3r::RuntimeError(format("Suspiciously low number of configuration values extracted from %1%: %2%", file, key_value_pairs)); } + // Do legacy conversion on a completely loaded dictionary. + // Perform composite conversions, for example merging multiple keys into one key. + this->handle_legacy_composite(); + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": finished to parse_file %1%") % file.c_str(); return std::move(substitutions_ctxt.substitutions); } diff --git a/src/libslic3r/Config.hpp b/src/libslic3r/Config.hpp index a9973b4682c..3ce062ac39d 100644 --- a/src/libslic3r/Config.hpp +++ b/src/libslic3r/Config.hpp @@ -2057,6 +2057,10 @@ class ConfigBase : public ConfigOptionResolver // If the opt_key is no more valid in this version of Slic3r, opt_key is cleared by handle_legacy(). // handle_legacy() is called internally by set_deserialize(). virtual void handle_legacy(t_config_option_key &/*opt_key*/, std::string &/*value*/) const {} + // Called after a config is loaded as a whole. + // Perform composite conversions, for example merging multiple keys into one key. + // For conversion of single options, the handle_legacy() method above is called. + virtual void handle_legacy_composite() {} public: using ConfigOptionResolver::option; diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index bac3ea7323f..06467608ed1 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1978,19 +1978,6 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato if (!print.config().small_area_infill_flow_compensation_model.empty()) m_small_area_infill_flow_compensator = make_unique(print.config()); - // if thumbnail type of BTT_TFT, insert above header - // if not, it is inserted under the header in its normal spot - GCodeThumbnailsFormat m_gcode_thumbnail_format = GCodeThumbnailsFormat::PNG; - if (thumbnail_cb != nullptr) { - m_gcode_thumbnail_format = print.full_print_config().opt_enum("thumbnails_format"); - if (m_gcode_thumbnail_format == GCodeThumbnailsFormat::BTT_TFT) - GCodeThumbnails::export_thumbnails_to_file( - thumbnail_cb, print.get_plate_index(), print.full_print_config().option("thumbnails")->values, - m_gcode_thumbnail_format, - [&file](const char *sz) { file.write(sz); }, - [&print]() { print.throw_if_canceled(); }); - } - file.write_format("; HEADER_BLOCK_START\n"); // Write information on the generator. file.write_format("; generated by %s on %s\n", Slic3r::header_slic3r_generated().c_str(), Slic3r::Utils::local_timestamp().c_str()); @@ -2066,15 +2053,18 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato print.config().nozzle_temperature_initial_layer.get_at(0)); file.write("; CONFIG_BLOCK_END\n\n"); } else if (thumbnail_cb != nullptr) { - if (m_gcode_thumbnail_format != GCodeThumbnailsFormat::BTT_TFT) { - auto thumbnaim_fmt = m_gcode_thumbnail_format; - // Orca: if the thumbnail format is ColPic, we write PNG in the beginning of gcode file and ColPic in the end of gcode file. - if (m_gcode_thumbnail_format == GCodeThumbnailsFormat::ColPic) - thumbnaim_fmt = GCodeThumbnailsFormat::PNG; - GCodeThumbnails::export_thumbnails_to_file( - thumbnail_cb, print.get_plate_index(), print.full_print_config().option("thumbnails")->values, - thumbnaim_fmt, [&file](const char* sz) { file.write(sz); }, [&print]() { print.throw_if_canceled(); }); + // generate the thumbnails + auto [thumbnails, errors] = GCodeThumbnails::make_and_check_thumbnail_list(print.full_print_config()); + + if (errors != enum_bitmask()) { + std::string error_str = format("Invalid thumbnails value:"); + error_str += GCodeThumbnails::get_error_string(errors); + throw Slic3r::ExportError(error_str); } + + if (!thumbnails.empty()) + GCodeThumbnails::export_thumbnails_to_file( + thumbnail_cb, print.get_plate_index(), thumbnails, [&file](const char* sz) { file.write(sz); }, [&print]() { print.throw_if_canceled(); }); } } @@ -2781,11 +2771,6 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder) .c_str()); file.write("\n"); - if (m_gcode_thumbnail_format == GCodeThumbnailsFormat::ColPic) - GCodeThumbnails::export_thumbnails_to_file( - thumbnail_cb, print.get_plate_index(), print.full_print_config().option("thumbnails")->values, - m_gcode_thumbnail_format, [&file](const char* sz) { file.write(sz); }, [&print]() { print.throw_if_canceled(); }); - file.write("; CONFIG_BLOCK_START\n"); std::string full_config; append_full_config(print, full_config); diff --git a/src/libslic3r/GCode/Thumbnails.cpp b/src/libslic3r/GCode/Thumbnails.cpp index 5d78584a4c0..b16432c25f1 100644 --- a/src/libslic3r/GCode/Thumbnails.cpp +++ b/src/libslic3r/GCode/Thumbnails.cpp @@ -528,5 +528,81 @@ int ColPic_EncodeStr(unsigned short* fromcolor16, int picw, int pich, unsigned c outputdata[qty] = 0; return qty; } +std::pair make_and_check_thumbnail_list(const std::string& thumbnails_string, const std::string_view def_ext /*= "PNG"sv*/) +{ + if (thumbnails_string.empty()) + return {}; + + std::istringstream is(thumbnails_string); + std::string point_str; + + ThumbnailErrors errors; + + // generate thumbnails data to process it + + GCodeThumbnailDefinitionsList thumbnails_list; + while (std::getline(is, point_str, ',')) { + Vec2d point(Vec2d::Zero()); + GCodeThumbnailsFormat format; + std::istringstream iss(point_str); + std::string coord_str; + if (std::getline(iss, coord_str, 'x') && !coord_str.empty()) { + std::istringstream(coord_str) >> point(0); + if (std::getline(iss, coord_str, '/') && !coord_str.empty()) { + std::istringstream(coord_str) >> point(1); + + if (0 < point(0) && point(0) < 1000 && 0 < point(1) && point(1) < 1000) { + std::string ext_str; + std::getline(iss, ext_str, '/'); + + if (ext_str.empty()) + ext_str = def_ext.empty() ? "PNG"sv : def_ext; + + // check validity of extention + boost::to_upper(ext_str); + if (!ConfigOptionEnum::from_string(ext_str, format)) { + format = GCodeThumbnailsFormat::PNG; + errors = enum_bitmask(errors | ThumbnailError::InvalidExt); + } + + thumbnails_list.emplace_back(std::make_pair(format, point)); + } + else + errors = enum_bitmask(errors | ThumbnailError::OutOfRange); + continue; + } + } + errors = enum_bitmask(errors | ThumbnailError::InvalidVal); + } + + return std::make_pair(std::move(thumbnails_list), errors); +} + +std::pair make_and_check_thumbnail_list(const ConfigBase& config) +{ + // ??? Unit tests or command line slicing may not define "thumbnails" or "thumbnails_format". + // ??? If "thumbnails_format" is not defined, export to PNG. + + // generate thumbnails data to process it + + if (const auto thumbnails_value = config.option("thumbnails")) + return make_and_check_thumbnail_list(thumbnails_value->value); + + return {}; +} + +std::string get_error_string(const ThumbnailErrors& errors) +{ + std::string error_str; + + if (errors.has(ThumbnailError::InvalidVal)) + error_str += "\n - " + format("Invalid input format. Expected vector of dimensions in the following format: \"%1%\"", "XxY/EXT, XxY/EXT, ..."); + if (errors.has(ThumbnailError::OutOfRange)) + error_str += "\n - Input value is out of range"; + if (errors.has(ThumbnailError::InvalidExt)) + error_str += "\n - Some extension in the input is invalid"; + + return error_str; +} } // namespace Slic3r::GCodeThumbnails diff --git a/src/libslic3r/GCode/Thumbnails.hpp b/src/libslic3r/GCode/Thumbnails.hpp index 0d6e3f1bcb7..c0ecfd342da 100644 --- a/src/libslic3r/GCode/Thumbnails.hpp +++ b/src/libslic3r/GCode/Thumbnails.hpp @@ -7,7 +7,6 @@ #include "../Point.hpp" #include "../PrintConfig.hpp" -#include "PrintConfig.hpp" #include "ThumbnailData.hpp" #include @@ -16,6 +15,12 @@ #include +namespace Slic3r { + enum class ThumbnailError : int { InvalidVal, OutOfRange, InvalidExt }; + using ThumbnailErrors = enum_bitmask; + ENABLE_ENUM_BITMASK_OPERATORS(ThumbnailError); +} + namespace Slic3r::GCodeThumbnails { struct CompressedImageBuffer @@ -29,20 +34,30 @@ struct CompressedImageBuffer std::string get_hex(const unsigned int input); std::string rjust(std::string input, unsigned int width, char fill_char); std::unique_ptr compress_thumbnail(const ThumbnailData &data, GCodeThumbnailsFormat format); +std::string get_error_string(const ThumbnailErrors& errors); + + +typedef std::vector> GCodeThumbnailDefinitionsList; +using namespace std::literals; +std::pair make_and_check_thumbnail_list(const std::string& thumbnails_string, const std::string_view def_ext = "PNG"sv); +std::pair make_and_check_thumbnail_list(const ConfigBase &config); + template -inline void export_thumbnails_to_file(ThumbnailsGeneratorCallback &thumbnail_cb, - int plate_id, - const std::vector &sizes, - GCodeThumbnailsFormat format, - WriteToOutput output, - ThrowIfCanceledCallback throw_if_canceled) +inline void export_thumbnails_to_file(ThumbnailsGeneratorCallback& thumbnail_cb, + int plate_id, + const std::vector>& thumbnails_list, + WriteToOutput output, + ThrowIfCanceledCallback throw_if_canceled) { // Write thumbnails using base64 encoding - if (thumbnail_cb != nullptr) { + if (thumbnail_cb == nullptr) + return; + short i = 0; + bool first_ColPic = true; + for (const auto& [format, size] : thumbnails_list) { static constexpr const size_t max_row_length = 78; - ThumbnailsList thumbnails = thumbnail_cb(ThumbnailsParams{sizes, true, true, true, true, plate_id}); - short i = 0; + ThumbnailsList thumbnails = thumbnail_cb(ThumbnailsParams{{size}, true, true, true, true, plate_id}); for (const ThumbnailData &data : thumbnails) { if (data.is_valid()) { auto compressed = compress_thumbnail(data, format); @@ -51,15 +66,16 @@ inline void export_thumbnails_to_file(ThumbnailsGeneratorCallback &thumbnail_cb, // write BTT_TFT header output((";" + rjust(get_hex(data.width), 4, '0') + rjust(get_hex(data.height), 4, '0') + "\r\n").c_str()); output((char *) compressed->data); - if (i == (thumbnails.size() - 1)) + if (i == (thumbnails_list.size() - 1)) output("; bigtree thumbnail end\r\n\r\n"); } else if (format == GCodeThumbnailsFormat::ColPic) { - if (i == 0) { + if (first_ColPic) { output((boost::format("\n\n;gimage:%s\n\n") % reinterpret_cast(compressed->data)).str().c_str()); } else { output((boost::format("\n\n;simage:%s\n\n") % reinterpret_cast(compressed->data)).str().c_str()); } + first_ColPic = false; } else { output("; THUMBNAIL_BLOCK_START\n"); @@ -84,10 +100,9 @@ inline void export_thumbnails_to_file(ThumbnailsGeneratorCallback &thumbnail_cb, } throw_if_canceled(); } - - i++; } } + i++; } } diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index b766a160218..69217ad6048 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -55,6 +55,7 @@ #include "Utils.hpp" #include "Time.hpp" #include "PlaceholderParser.hpp" +#include "libslic3r/GCode/Thumbnails.hpp" using boost::property_tree::ptree; @@ -2637,6 +2638,16 @@ inline t_config_option_keys deep_diff(const ConfigBase &config_this, const Confi } else if (opt_key == "default_filament_profile") { // Ignore this field, it is not presented to the user, therefore showing a "modified" flag for this parameter does not help. // Also the length of this field may differ, which may lead to a crash if the block below is used. + } + else if (opt_key == "thumbnails") { + // "thumbnails" can not contain extensions in old config but they are valid and use PNG extension by default + // So, check if "thumbnails" is really changed + // We will compare full thumbnails instead of exactly config values + auto [thumbnails, er] = GCodeThumbnails::make_and_check_thumbnail_list(config_this); + auto [thumbnails_new, er_new] = GCodeThumbnails::make_and_check_thumbnail_list(config_other); + if (thumbnails != thumbnails_new || er != er_new) + // if those strings are actually the same, erase them from the list of dirty oprions + diff.emplace_back(opt_key); } else { switch (other_opt->type()) { case coInts: add_correct_opts_to_diff(opt_key, diff, config_other, config_this); break; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 0fc18015509..f31b1269f34 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -24,6 +24,7 @@ #include "Config.hpp" #include "I18N.hpp" +#include "GCode/Thumbnails.hpp" #include #include #include @@ -422,7 +423,7 @@ static const t_config_enum_values s_keys_map_GCodeThumbnailsFormat = { { "JPG", int(GCodeThumbnailsFormat::JPG) }, { "QOI", int(GCodeThumbnailsFormat::QOI) }, { "BTT_TFT", int(GCodeThumbnailsFormat::BTT_TFT) }, - { "ColPic", int(GCodeThumbnailsFormat::ColPic) } + { "COLPIC", int(GCodeThumbnailsFormat::ColPic) } }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(GCodeThumbnailsFormat) @@ -4907,12 +4908,12 @@ def = this->add("filament_loading_speed", coFloats); def->mode = comAdvanced; def->set_default_value(new ConfigOptionBool(true)); - def = this->add("thumbnails", coPoints); + def = this->add("thumbnails", coString); def->label = L("G-code thumbnails"); def->tooltip = L("Picture sizes to be stored into a .gcode and .sl1 / .sl1s files, in the following format: \"XxY, XxY, ...\""); def->mode = comAdvanced; def->gui_type = ConfigOptionDef::GUIType::one_string; - def->set_default_value(new ConfigOptionPoints{Vec2d(300, 300)}); + def->set_default_value(new ConfigOptionString("48x48/PNG,300x300/PNG")); def = this->add("thumbnails_format", coEnum); def->label = L("Format of G-code thumbnails"); @@ -4923,7 +4924,7 @@ def = this->add("filament_loading_speed", coFloats); def->enum_values.push_back("JPG"); def->enum_values.push_back("QOI"); def->enum_values.push_back("BTT_TFT"); - def->enum_values.push_back("ColPic"); + def->enum_values.push_back("COLPIC"); def->enum_labels.push_back("PNG"); def->enum_labels.push_back("JPG"); def->enum_labels.push_back("QOI"); @@ -5950,6 +5951,60 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va } } +// Called after a config is loaded as a whole. +// Perform composite conversions, for example merging multiple keys into one key. +// Don't convert single options here, implement such conversion in PrintConfigDef::handle_legacy() instead. +void PrintConfigDef::handle_legacy_composite(DynamicPrintConfig &config) +{ + if (config.has("thumbnails")) { + std::string extention; + if (config.has("thumbnails_format")) { + if (const ConfigOptionDef* opt = config.def()->get("thumbnails_format")) { + extention = opt->enum_values.at(config.option("thumbnails_format")->getInt()); + } + } + + std::string thumbnails_str = config.opt_string("thumbnails"); + auto [thumbnails_list, errors] = GCodeThumbnails::make_and_check_thumbnail_list(thumbnails_str, extention); + + if (errors != enum_bitmask()) { + std::string error_str = "\n" + format("Invalid value provided for parameter %1%: %2%", "thumbnails", thumbnails_str); + error_str += GCodeThumbnails::get_error_string(errors); + throw BadOptionValueException(error_str); + } + + if (!thumbnails_list.empty()) { + const auto& extentions = ConfigOptionEnum::get_enum_names(); + thumbnails_str.clear(); + for (const auto& [ext, size] : thumbnails_list) + thumbnails_str += format("%1%x%2%/%3%, ", size.x(), size.y(), extentions[int(ext)]); + thumbnails_str.resize(thumbnails_str.length() - 2); + + config.set_key_value("thumbnails", new ConfigOptionString(thumbnails_str)); + } + } + + if (config.has("wiping_volumes_matrix") && !config.has("wiping_volumes_use_custom_matrix")) { + // This is apparently some pre-2.7.3 config, where the wiping_volumes_matrix was always used. + // The 2.7.3 introduced an option to use defaults derived from config. In case the matrix + // contains only default values, switch it to default behaviour. The default values + // were zeros on the diagonal and 140 otherwise. + std::vector matrix = config.opt("wiping_volumes_matrix")->values; + int num_of_extruders = int(std::sqrt(matrix.size()) + 0.5); + int i = -1; + bool custom = false; + for (int j = 0; j < int(matrix.size()); ++j) { + if (j % num_of_extruders == 0) + ++i; + if (i != j % num_of_extruders && !is_approx(matrix[j], 140.)) { + custom = true; + break; + } + } + config.set_key_value("wiping_volumes_use_custom_matrix", new ConfigOptionBool(custom)); + } +} + const PrintConfigDef print_config_def; DynamicPrintConfig DynamicPrintConfig::full_print_config() diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 64a360e74dc..5dde9c6056b 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -419,6 +419,8 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(AuthorizationType) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(PerimeterGeneratorType) #undef CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS +class DynamicPrintConfig; + // Defines each and every confiuration option of Slic3r, including the properties of the GUI dialogs. // Does not store the actual values, but defines default values. class PrintConfigDef : public ConfigDef @@ -427,6 +429,7 @@ class PrintConfigDef : public ConfigDef PrintConfigDef(); static void handle_legacy(t_config_option_key &opt_key, std::string &value); + static void handle_legacy_composite(DynamicPrintConfig &config); // Array options growing with the number of extruders const std::vector& extruder_option_keys() const { return m_extruder_option_keys; } @@ -509,6 +512,12 @@ class DynamicPrintConfig : public DynamicConfig void handle_legacy(t_config_option_key &opt_key, std::string &value) const override { PrintConfigDef::handle_legacy(opt_key, value); } + // Called after a config is loaded as a whole. + // Perform composite conversions, for example merging multiple keys into one key. + // For conversion of single options, the handle_legacy() method above is called. + void handle_legacy_composite() override + { PrintConfigDef::handle_legacy_composite(*this); } + //BBS special case Support G/ Support W std::string get_filament_type(std::string &displayed_filament_type, int id = 0); @@ -1256,7 +1265,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, nozzle_volume)) ((ConfigOptionPoints, start_end_points)) ((ConfigOptionEnum, timelapse_type)) - ((ConfigOptionPoints, thumbnails)) + ((ConfigOptionString, thumbnails)) // BBS: move from PrintObjectConfig ((ConfigOptionBool, independent_support_layer_height)) // SoftFever diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 4979215dce8..dd4b4549187 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -2,6 +2,7 @@ #include "GUI_App.hpp" #include "I18N.hpp" #include "Field.hpp" +#include "libslic3r/GCode/Thumbnails.hpp" #include "wxExtensions.hpp" #include "Plater.hpp" #include "MainFrame.hpp" @@ -83,6 +84,22 @@ wxString get_thumbnails_string(const std::vector& values) return ret_str; } +ThumbnailErrors validate_thumbnails_string(wxString& str, const wxString& def_ext = "PNG") +{ + std::string input_string = into_u8(str); + + str.Clear(); + + auto [thumbnails_list, errors] = GCodeThumbnails::make_and_check_thumbnail_list(input_string); + if (!thumbnails_list.empty()) { + const auto& extentions = ConfigOptionEnum::get_enum_names(); + for (const auto& [format, size] : thumbnails_list) + str += format_wxstr("%1%x%2%/%3%, ", size.x(), size.y(), extentions[int(format)]); + str.resize(str.Len() - 2); + } + + return errors; +} Field::~Field() { @@ -396,6 +413,31 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true set_value(stVal, false); // it's no needed but can be helpful, when inputted value contained "," instead of "." } } + if (m_opt.opt_key == "thumbnails") { + wxString str_out = str; + ThumbnailErrors errors = validate_thumbnails_string(str_out); + if (errors != enum_bitmask()) { + set_value(str_out, true); + wxString error_str; + if (errors.has(ThumbnailError::InvalidVal)) + error_str += format_wxstr(_L("Invalid input format. Expected vector of dimensions in the following format: \"%1%\""), + "XxY/EXT, XxY/EXT, ..."); + if (errors.has(ThumbnailError::OutOfRange)) { + if (!error_str.empty()) + error_str += "\n\n"; + error_str += _L("Input value is out of range"); + } + if (errors.has(ThumbnailError::InvalidExt)) { + if (!error_str.empty()) + error_str += "\n\n"; + error_str += _L("Some extension in the input is invalid"); + } + show_error(m_parent, error_str); + } else if (str_out != str) { + str = str_out; + set_value(str, true); + } + } m_value = into_u8(str); break; } @@ -434,16 +476,16 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true if (!str.IsEmpty()) { bool invalid_val = false; bool out_of_range_val = false; - wxStringTokenizer thumbnails(str, ","); - while (thumbnails.HasMoreTokens()) { - wxString token = thumbnails.GetNextToken(); + wxStringTokenizer points(str, ","); + while (points.HasMoreTokens()) { + wxString token = points.GetNextToken(); double x, y; - wxStringTokenizer thumbnail(token, "x"); - if (thumbnail.HasMoreTokens()) { - wxString x_str = thumbnail.GetNextToken(); - if (x_str.ToDouble(&x) && thumbnail.HasMoreTokens()) { - wxString y_str = thumbnail.GetNextToken(); - if (y_str.ToDouble(&y) && !thumbnail.HasMoreTokens()) { + wxStringTokenizer _point(token, "x"); + if (_point.HasMoreTokens()) { + wxString x_str = _point.GetNextToken(); + if (x_str.ToDouble(&x) && _point.HasMoreTokens()) { + wxString y_str = _point.GetNextToken(); + if (y_str.ToDouble(&y) && !_point.HasMoreTokens()) { if (m_opt_id == "bed_exclude_area") { if (0 <= x && 0 <= y) { out_values.push_back(Vec2d(x, y)); diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index c45db1c87e5..64d365c75e0 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -692,8 +692,9 @@ void ConfigOptionsGroup::back_to_config_value(const DynamicPrintConfig& config, opt_key == "printable_area" || opt_key == "compatible_printers" || opt_key == "compatible_prints" || opt_key == "thumbnails" || opt_key == "bed_custom_texture" || opt_key == "bed_custom_model") { value = get_config_value(config, opt_key); - this->change_opt_value(opt_key, value); - OptionsGroup::on_change_OG(opt_key, value); + set_value(opt_key, value); + this->change_opt_value(opt_key, get_value(opt_key)); + OptionsGroup::on_change_OG(opt_key, get_value(opt_key)); return; } else { auto opt_id = m_opt_map.find(opt_key)->first; @@ -1072,8 +1073,6 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config if (opt_key == "printable_area") ret = get_thumbnails_string(config.option(opt_key)->values); else if (opt_key == "bed_exclude_area") - ret = get_thumbnails_string(config.option(opt_key)->values); - else if (opt_key == "thumbnails") ret = get_thumbnails_string(config.option(opt_key)->values); else ret = config.option(opt_key)->get_at(idx); @@ -1188,8 +1187,6 @@ boost::any ConfigOptionsGroup::get_config_value2(const DynamicPrintConfig& confi ret = get_thumbnails_string(config.option(opt_key)->values); else if (opt_key == "bed_exclude_area") ret = get_thumbnails_string(config.option(opt_key)->values); - else if (opt_key == "thumbnails") - ret = get_thumbnails_string(config.option(opt_key)->values); else ret = config.option(opt_key)->get_at(idx); break; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 619c4bc8776..2cafe207816 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -66,6 +66,7 @@ #include "MarkdownTip.hpp" #include "Search.hpp" #include "BedShapeDialog.hpp" +#include "libslic3r/GCode/Thumbnails.hpp" #include "BedShapeDialog.hpp" // #include "BonjourDialog.hpp" @@ -3669,7 +3670,43 @@ void TabPrinter::build_fff() option = optgroup->get_option("thumbnails"); option.opt.full_width = true; optgroup->append_single_option_line(option, "thumbnails"); - optgroup->append_single_option_line("thumbnails_format", "thumbnails"); + // optgroup->append_single_option_line("thumbnails_format", "thumbnails"); + optgroup->m_on_change = [this](t_config_option_key opt_key, boost::any value) { + wxTheApp->CallAfter([this, opt_key, value]() { + if (opt_key == "thumbnails" && m_config->has("thumbnails_format")) { + // to backward compatibility we need to update "thumbnails_format" from new "thumbnails" + const std::string val = boost::any_cast(value); + if (!value.empty()) { + auto [thumbnails_list, errors] = GCodeThumbnails::make_and_check_thumbnail_list(val); + + if (errors != enum_bitmask()) { + // TRN: First argument is parameter name, the second one is the value. + std::string error_str = format(_u8L("Invalid value provided for parameter %1%: %2%"), "thumbnails", val); + error_str += GCodeThumbnails::get_error_string(errors); + InfoDialog(parent(), _L("G-code flavor is switched"), from_u8(error_str)).ShowModal(); + } + + if (!thumbnails_list.empty()) { + GCodeThumbnailsFormat old_format = GCodeThumbnailsFormat(m_config->option("thumbnails_format")->getInt()); + GCodeThumbnailsFormat new_format = thumbnails_list.begin()->first; + if (old_format != new_format) { + DynamicPrintConfig new_conf = *m_config; + + auto* opt = m_config->option("thumbnails_format")->clone(); + opt->setInt(int(new_format)); + new_conf.set_key_value("thumbnails_format", opt); + + load_config(new_conf); + } + } + } + } + + update_dirty(); + on_value_change(opt_key, value); + }); + }; + optgroup->append_single_option_line("use_relative_e_distances"); optgroup->append_single_option_line("use_firmware_retraction"); // optgroup->append_single_option_line("spaghetti_detector"); diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index cf22df0cfa6..48084bd5bf7 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -1367,9 +1367,6 @@ static wxString get_string_value(std::string opt_key, const DynamicPrintConfig& else if (opt_key == "bed_exclude_area") { return get_thumbnails_string(config.option(opt_key)->values); } - else if (opt_key == "thumbnails") { - return get_thumbnails_string(config.option(opt_key)->values); - } else if (opt_key == "head_wrap_detect_zone") { return get_thumbnails_string(config.option(opt_key)->values); }