配置文件一点格式优化

This commit is contained in:
张开科 2024-11-07 15:26:43 +08:00
parent ada778ae69
commit b9770c3385
3 changed files with 122 additions and 122 deletions

View File

@ -836,7 +836,7 @@ gcode:
_CLEAR_LAST_FILE _CLEAR_LAST_FILE
######################################## ########################################
# Adaptive mesh # Adaptive mesh
######################################## ########################################
[gcode_macro Adaptive_Mesh] [gcode_macro Adaptive_Mesh]
@ -916,13 +916,13 @@ gcode:
{% set points_x = (((adapted_x_max - adapted_x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %} # Define probe_count's x point count and round up {% set points_x = (((adapted_x_max - adapted_x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %} # Define probe_count's x point count and round up
{% set points_y = (((adapted_y_max - adapted_y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %} # Define probe_count's y point count and round up {% set points_y = (((adapted_y_max - adapted_y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %} # Define probe_count's y point count and round up
{% if (([points_x, points_y]|max) > 6) %} # {% if (([points_x, points_y]|max) > 6) %} #
{% set algorithm = "bicubic" %} # {% set algorithm = "bicubic" %} #
{% set min_points = 4 %} # {% set min_points = 4 %} #
{% else %} # Calculate if algorithm should be bicubic or lagrange {% else %} # Calculate if algorithm should be bicubic or lagrange
{% set algorithm = "lagrange" %} # {% set algorithm = "lagrange" %} #
{% set min_points = 3 %} # {% set min_points = 3 %} #
{% endif %} # {% endif %} #
{% set points_x = [points_x , min_points]|max %} # Set probe_count's x points to fit the calculated algorithm {% set points_x = [points_x , min_points]|max %} # Set probe_count's x points to fit the calculated algorithm
{% set points_y = [points_y , min_points]|max %} # Set probe_count's y points to fit the calculated algorithm {% set points_y = [points_y , min_points]|max %} # Set probe_count's y points to fit the calculated algorithm
@ -932,45 +932,45 @@ gcode:
{% if verbose_enable == True %} # If verbose is enabled, print information about KAMP's calculations {% if verbose_enable == True %} # If verbose is enabled, print information about KAMP's calculations
{% if printer.exclude_object.objects != [] %} {% if printer.exclude_object.objects != [] %}
{ action_respond_info( "Algorithm: {}.".format( { action_respond_info( "Algorithm: {}.".format(
(algorithm), (algorithm),
)) } )) }
{ action_respond_info("Default probe count: {},{}.".format( { action_respond_info("Default probe count: {},{}.".format(
(probe_count[0]), (probe_count[0]),
(probe_count[1]), (probe_count[1]),
)) } )) }
{ action_respond_info("Adapted probe count: {},{}.".format( { action_respond_info("Adapted probe count: {},{}.".format(
(points_x), (points_x),
(points_y), (points_y),
)) }
{action_respond_info("Default mesh bounds: {}, {}.".format(
(bed_mesh_min[0],bed_mesh_min[1]),
(bed_mesh_max[0],bed_mesh_max[1]),
)) } )) }
{% if mesh_margin > 0 %} {action_respond_info("Default mesh bounds: {}, {}.".format(
{action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format( (bed_mesh_min[0],bed_mesh_min[1]),
(mesh_margin), (bed_mesh_max[0],bed_mesh_max[1]),
(mesh_margin), )) }
)) }
{% else %}
{action_respond_info("Mesh margin is 0, margin not increased.")}
{% endif %}
{% if fuzz_amount > 0 %} {% if mesh_margin > 0 %}
{action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format( {action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format(
(fuzz_amount), (mesh_margin),
)) } (mesh_margin),
{% else %} )) }
{action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")} {% else %}
{% endif %} {action_respond_info("Mesh margin is 0, margin not increased.")}
{% endif %}
{ action_respond_info("Adapted mesh bounds: {}, {}.".format( {% if fuzz_amount > 0 %}
(adapted_x_min, adapted_y_min), {action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format(
(adapted_x_max, adapted_y_max), (fuzz_amount),
)) }
{% else %}
{action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")}
{% endif %}
{ action_respond_info("Adapted mesh bounds: {}, {}.".format(
(adapted_x_min, adapted_y_min),
(adapted_x_max, adapted_y_max),
)) } )) }
{action_respond_info("KAMP adjustments successful. Happy KAMPing!")} {action_respond_info("KAMP adjustments successful. Happy KAMPing!")}
@ -982,6 +982,6 @@ gcode:
{% endif %} {% endif %}
{% endif %} {% endif %}
_BED_MESH_CALIBRATE PROFILE={default_profile} mesh_min={adapted_x_min},{adapted_y_min} mesh_max={adapted_x_max},{adapted_y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y} # End of verbose _BED_MESH_CALIBRATE PROFILE={default_profile} mesh_min={adapted_x_min},{adapted_y_min} mesh_max={adapted_x_max},{adapted_y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y} # End of verbose
BED_MESH_PROFILE LOAD={default_profile} BED_MESH_PROFILE LOAD={default_profile}

View File

@ -829,7 +829,7 @@ gcode:
_CLEAR_LAST_FILE _CLEAR_LAST_FILE
######################################## ########################################
# Adaptive mesh # Adaptive mesh
######################################## ########################################
[gcode_macro Adaptive_Mesh] [gcode_macro Adaptive_Mesh]
@ -909,13 +909,13 @@ gcode:
{% set points_x = (((adapted_x_max - adapted_x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %} # Define probe_count's x point count and round up {% set points_x = (((adapted_x_max - adapted_x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %} # Define probe_count's x point count and round up
{% set points_y = (((adapted_y_max - adapted_y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %} # Define probe_count's y point count and round up {% set points_y = (((adapted_y_max - adapted_y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %} # Define probe_count's y point count and round up
{% if (([points_x, points_y]|max) > 6) %} # {% if (([points_x, points_y]|max) > 6) %} #
{% set algorithm = "bicubic" %} # {% set algorithm = "bicubic" %} #
{% set min_points = 4 %} # {% set min_points = 4 %} #
{% else %} # Calculate if algorithm should be bicubic or lagrange {% else %} # Calculate if algorithm should be bicubic or lagrange
{% set algorithm = "lagrange" %} # {% set algorithm = "lagrange" %} #
{% set min_points = 3 %} # {% set min_points = 3 %} #
{% endif %} # {% endif %} #
{% set points_x = [points_x , min_points]|max %} # Set probe_count's x points to fit the calculated algorithm {% set points_x = [points_x , min_points]|max %} # Set probe_count's x points to fit the calculated algorithm
{% set points_y = [points_y , min_points]|max %} # Set probe_count's y points to fit the calculated algorithm {% set points_y = [points_y , min_points]|max %} # Set probe_count's y points to fit the calculated algorithm
@ -925,45 +925,45 @@ gcode:
{% if verbose_enable == True %} # If verbose is enabled, print information about KAMP's calculations {% if verbose_enable == True %} # If verbose is enabled, print information about KAMP's calculations
{% if printer.exclude_object.objects != [] %} {% if printer.exclude_object.objects != [] %}
{ action_respond_info( "Algorithm: {}.".format( { action_respond_info( "Algorithm: {}.".format(
(algorithm), (algorithm),
)) } )) }
{ action_respond_info("Default probe count: {},{}.".format( { action_respond_info("Default probe count: {},{}.".format(
(probe_count[0]), (probe_count[0]),
(probe_count[1]), (probe_count[1]),
)) } )) }
{ action_respond_info("Adapted probe count: {},{}.".format( { action_respond_info("Adapted probe count: {},{}.".format(
(points_x), (points_x),
(points_y), (points_y),
)) }
{action_respond_info("Default mesh bounds: {}, {}.".format(
(bed_mesh_min[0],bed_mesh_min[1]),
(bed_mesh_max[0],bed_mesh_max[1]),
)) } )) }
{% if mesh_margin > 0 %} {action_respond_info("Default mesh bounds: {}, {}.".format(
{action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format( (bed_mesh_min[0],bed_mesh_min[1]),
(mesh_margin), (bed_mesh_max[0],bed_mesh_max[1]),
(mesh_margin), )) }
)) }
{% else %}
{action_respond_info("Mesh margin is 0, margin not increased.")}
{% endif %}
{% if fuzz_amount > 0 %} {% if mesh_margin > 0 %}
{action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format( {action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format(
(fuzz_amount), (mesh_margin),
)) } (mesh_margin),
{% else %} )) }
{action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")} {% else %}
{% endif %} {action_respond_info("Mesh margin is 0, margin not increased.")}
{% endif %}
{ action_respond_info("Adapted mesh bounds: {}, {}.".format( {% if fuzz_amount > 0 %}
(adapted_x_min, adapted_y_min), {action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format(
(adapted_x_max, adapted_y_max), (fuzz_amount),
)) }
{% else %}
{action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")}
{% endif %}
{ action_respond_info("Adapted mesh bounds: {}, {}.".format(
(adapted_x_min, adapted_y_min),
(adapted_x_max, adapted_y_max),
)) } )) }
{action_respond_info("KAMP adjustments successful. Happy KAMPing!")} {action_respond_info("KAMP adjustments successful. Happy KAMPing!")}
@ -975,6 +975,6 @@ gcode:
{% endif %} {% endif %}
{% endif %} {% endif %}
_BED_MESH_CALIBRATE PROFILE={default_profile} mesh_min={adapted_x_min},{adapted_y_min} mesh_max={adapted_x_max},{adapted_y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y} # End of verbose _BED_MESH_CALIBRATE PROFILE={default_profile} mesh_min={adapted_x_min},{adapted_y_min} mesh_max={adapted_x_max},{adapted_y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y} # End of verbose
BED_MESH_PROFILE LOAD={default_profile} BED_MESH_PROFILE LOAD={default_profile}

View File

@ -775,7 +775,7 @@ gcode:
{% if printer["dual_carriage"] is defined %} {% if printer["dual_carriage"] is defined %}
{% set current_idex_mode = printer["dual_carriage"].carriage_1|lower %} {% set current_idex_mode = printer["dual_carriage"].carriage_1|lower %}
{% if current_idex_mode == 'copy' or current_idex_mode == 'mirror' %} {% if current_idex_mode == 'copy' or current_idex_mode == 'mirror' %}
SAVE_DUAL_CARRIAGE_STATE SAVE_DUAL_CARRIAGE_STATE
SYNC_EXTRUDER_MOTION EXTRUDER=extruder1 MOTION_QUEUE=extruder1 SYNC_EXTRUDER_MOTION EXTRUDER=extruder1 MOTION_QUEUE=extruder1
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=resume_dual VALUE=True SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=resume_dual VALUE=True
{% endif %} {% endif %}
@ -837,7 +837,7 @@ gcode:
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=resume_dual VALUE=False SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=resume_dual VALUE=False
{% endif %} {% endif %}
{% endif %} {% endif %}
_FILAMENT_UPDATE _FILAMENT_UPDATE
#### Printer comming from timeout idle state #### #### Printer comming from timeout idle state ####
{% if printer.idle_timeout.state|upper == "IDLE" or idle_state %} {% if printer.idle_timeout.state|upper == "IDLE" or idle_state %}
@ -995,7 +995,7 @@ gcode:
_CLEAR_LAST_FILE _CLEAR_LAST_FILE
######################################## ########################################
# Adaptive mesh # Adaptive mesh
######################################## ########################################
[gcode_macro Adaptive_Mesh] [gcode_macro Adaptive_Mesh]
@ -1075,13 +1075,13 @@ gcode:
{% set points_x = (((adapted_x_max - adapted_x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %} # Define probe_count's x point count and round up {% set points_x = (((adapted_x_max - adapted_x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %} # Define probe_count's x point count and round up
{% set points_y = (((adapted_y_max - adapted_y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %} # Define probe_count's y point count and round up {% set points_y = (((adapted_y_max - adapted_y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %} # Define probe_count's y point count and round up
{% if (([points_x, points_y]|max) > 6) %} # {% if (([points_x, points_y]|max) > 6) %} #
{% set algorithm = "bicubic" %} # {% set algorithm = "bicubic" %} #
{% set min_points = 4 %} # {% set min_points = 4 %} #
{% else %} # Calculate if algorithm should be bicubic or lagrange {% else %} # Calculate if algorithm should be bicubic or lagrange
{% set algorithm = "lagrange" %} # {% set algorithm = "lagrange" %} #
{% set min_points = 3 %} # {% set min_points = 3 %} #
{% endif %} # {% endif %} #
{% set points_x = [points_x , min_points]|max %} # Set probe_count's x points to fit the calculated algorithm {% set points_x = [points_x , min_points]|max %} # Set probe_count's x points to fit the calculated algorithm
{% set points_y = [points_y , min_points]|max %} # Set probe_count's y points to fit the calculated algorithm {% set points_y = [points_y , min_points]|max %} # Set probe_count's y points to fit the calculated algorithm
@ -1091,45 +1091,45 @@ gcode:
{% if verbose_enable == True %} # If verbose is enabled, print information about KAMP's calculations {% if verbose_enable == True %} # If verbose is enabled, print information about KAMP's calculations
{% if printer.exclude_object.objects != [] %} {% if printer.exclude_object.objects != [] %}
{ action_respond_info( "Algorithm: {}.".format( { action_respond_info( "Algorithm: {}.".format(
(algorithm), (algorithm),
)) } )) }
{ action_respond_info("Default probe count: {},{}.".format( { action_respond_info("Default probe count: {},{}.".format(
(probe_count[0]), (probe_count[0]),
(probe_count[1]), (probe_count[1]),
)) } )) }
{ action_respond_info("Adapted probe count: {},{}.".format( { action_respond_info("Adapted probe count: {},{}.".format(
(points_x), (points_x),
(points_y), (points_y),
)) }
{action_respond_info("Default mesh bounds: {}, {}.".format(
(bed_mesh_min[0],bed_mesh_min[1]),
(bed_mesh_max[0],bed_mesh_max[1]),
)) } )) }
{% if mesh_margin > 0 %} {action_respond_info("Default mesh bounds: {}, {}.".format(
{action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format( (bed_mesh_min[0],bed_mesh_min[1]),
(mesh_margin), (bed_mesh_max[0],bed_mesh_max[1]),
(mesh_margin), )) }
)) }
{% else %}
{action_respond_info("Mesh margin is 0, margin not increased.")}
{% endif %}
{% if fuzz_amount > 0 %} {% if mesh_margin > 0 %}
{action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format( {action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format(
(fuzz_amount), (mesh_margin),
)) } (mesh_margin),
{% else %} )) }
{action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")} {% else %}
{% endif %} {action_respond_info("Mesh margin is 0, margin not increased.")}
{% endif %}
{ action_respond_info("Adapted mesh bounds: {}, {}.".format( {% if fuzz_amount > 0 %}
(adapted_x_min, adapted_y_min), {action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format(
(adapted_x_max, adapted_y_max), (fuzz_amount),
)) }
{% else %}
{action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")}
{% endif %}
{ action_respond_info("Adapted mesh bounds: {}, {}.".format(
(adapted_x_min, adapted_y_min),
(adapted_x_max, adapted_y_max),
)) } )) }
{action_respond_info("KAMP adjustments successful. Happy KAMPing!")} {action_respond_info("KAMP adjustments successful. Happy KAMPing!")}
@ -1141,6 +1141,6 @@ gcode:
{% endif %} {% endif %}
{% endif %} {% endif %}
_BED_MESH_CALIBRATE PROFILE={default_profile} mesh_min={adapted_x_min},{adapted_y_min} mesh_max={adapted_x_max},{adapted_y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y} # End of verbose _BED_MESH_CALIBRATE PROFILE={default_profile} mesh_min={adapted_x_min},{adapted_y_min} mesh_max={adapted_x_max},{adapted_y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y} # End of verbose
BED_MESH_PROFILE LOAD={default_profile} BED_MESH_PROFILE LOAD={default_profile}