mirror of
https://github.com/QIDITECH/QIDI_Q1_Pro.git
synced 2026-01-30 23:48:43 +03:00
Compare commits
16 Commits
V4.4.16
...
Q1_Pro_V4.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6048da6c1 | ||
|
|
e62f278aa6 | ||
|
|
16f019084d | ||
|
|
b3c00805bf | ||
|
|
0ce78cc607 | ||
|
|
d1d606ada4 | ||
|
|
9618b8bfca | ||
|
|
6336e7d34e | ||
|
|
a89c84c043 | ||
|
|
039e1167ac | ||
|
|
4c0049c0d8 | ||
|
|
66ab378950 | ||
|
|
4d3616a00d | ||
|
|
6de965941a | ||
|
|
474b134e40 | ||
|
|
ded3ca4041 |
26
README.md
26
README.md
@@ -7,13 +7,29 @@ QIDI_Q1_Pro is a server-side application designed specifically for the Q1_Pro mo
|
||||
|
||||
For convenience, QIDI provides version-specific packaged files. Please download the necessary compressed package file prefixed with "Q1_Pro." We offer several versions of the source code tailored to different needs; select the appropriate branch for download, with each branch name reflecting the corresponding version.
|
||||
|
||||
## Update Content for Version 4.4.16
|
||||
|
||||
**Note**: Post-update, the Klipper configuration file will be overwritten. The former configuration file will be renamed to printer_{datetime}.cfg as a backup, and the printer will require recalibration.
|
||||
## Update Content for Version 4.4.19
|
||||
|
||||
**1.** Fixed an issue where, under certain conditions, WLAN settings could prevent booting.
|
||||
**Note:** After updating, the Klipper configuration file will be replaced. The previous configuration file will be backed up as `printer_{datetime}.cfg`, printer recalibration will be required.
|
||||
|
||||
**2.** Parameters in the gcode_macro.cfg file have been modified.
|
||||
**1.** Modified platform calibration logic
|
||||
|
||||
During platform tilt calibration, the machine performs a sensorless homing downwards to ensure the heights of the left and right Z axes are consistent.
|
||||
|
||||
**2.** Optimized Gcode processing logic
|
||||
|
||||
We have increased the processing priority of certain Gcodes, such as SET_GCODE_OFFSET, to ensure they are executed immediately upon input. However, due to the presence of a move queue in the toolhead, which temporarily stores some parsed movements, the effect is not immediate. We plan to continue improving this in future versions.
|
||||
|
||||
**3.** Added functionality to move without homing
|
||||
|
||||
We have noticed that in some cases, such as when printing is unexpectedly interrupted, users may want to move the Z-axis to facilitate the removal of a broken model upon machine restart. Typically, this would require homing before movement, but homing can be obstructed by the model. Therefore, we have added the capability to move the Z-axis without homing and provided corresponding prompts.
|
||||
|
||||
**4.** Fixed issues with camera loading under specific circumstances
|
||||
**5.** Fixed display issues with connected WiFi name
|
||||
|
||||
We also addressed an issue where the display of connected WiFi names containing Unicode characters appeared blank, and this has been fixed.
|
||||
|
||||
**6.** Adjusted default parameters.
|
||||
|
||||
## Detailed update process
|
||||
|
||||
@@ -37,7 +53,7 @@ Should you encounter any issues related to machine mechanics, slicing software,
|
||||
|
||||
## Others
|
||||
|
||||
Unlike the typical method of directly accessing the Fluidd web interface via an IP address, the QIDI edition modifies the default port to 10088. Therefore, you must append :10088 to the machine's IP address to access the Fluidd page.
|
||||
Unlike the typical method of directly accessing the Fluidd web interface via an IP address, the QIDI edition modifies the default port to 10088. Therefore, you must append :10088 to the machine's IP address to access the Fluidd page. (Default port 80 now has been added after V4.4.18)
|
||||
|
||||
QIDI's 3D printers operate based on the Klipper system. Building on the Klipper open-source project, we've tailored its source code to meet specific user requirements. Similarly, we've adapted Moonraker to ensure our designed screens align with web operations. We extend our gratitude to the developers and maintainers of these open-source projects and encourage users to explore or support these robust platforms.
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
build/xindi
BIN
build/xindi
Binary file not shown.
225
config/Adaptive_Mesh.cfg
Normal file
225
config/Adaptive_Mesh.cfg
Normal file
@@ -0,0 +1,225 @@
|
||||
# # # Klipper Adaptive Meshing # # #
|
||||
|
||||
# Heads up! If you have any other BED_MESH_CALIBRATE macros defined elsewhere in your config, you will need to comment out / remove them for this to work. (Klicky/Euclid Probe)
|
||||
# You will also need to be sure that [exclude_object] is defined in printer.cfg, and your slicer is labeling objects.
|
||||
# This macro will parse information from objects in your gcode to define a min and max mesh area to probe, creating an adaptive mesh!
|
||||
# This macro will not increase probe_count values in your [bed_mesh] config. If you want richer meshes, be sure to increase probe_count. We recommend at least 5,5.
|
||||
|
||||
[gcode_macro BED_MESH_CALIBRATE]
|
||||
rename_existing: _BED_MESH_CALIBRATE
|
||||
|
||||
### This section allows control of status LEDs your printer may have.
|
||||
|
||||
variable_led_enable: False # Enables/disables the use of status LEDs in this macro.
|
||||
variable_status_macro: 'status_meshing' # If you have status LEDs in your printer (StealthBurner), you can use the macro that changes their status here.
|
||||
|
||||
### This section configures mesh point fuzzing, which allows probe points to be varied slightly if printing multiples of the same G-code file.
|
||||
|
||||
variable_fuzz_enable: False # Enables/disables the use of mesh point fuzzing to slightly randomize probing points to spread out wear on a build surface, default is False.
|
||||
variable_fuzz_min: 0 # If enabled, the minimum amount in mm a probe point can be randomized, default is 0.
|
||||
variable_fuzz_max: 4 # If enabled, the maximum amount in mm a probe point can be randomized, default is 4.
|
||||
|
||||
### This section is for configuring a mesh margin, which allows the probed mesh to be expanded outwards from the print area.
|
||||
|
||||
variable_margin_enable: False # Enables/disables adding a margin to the meshed area to pad a mesh out for specific needs, default is False.
|
||||
variable_margin_size: 5 # Size in millimeters to expand the mesh outwards from the print area in all directions.
|
||||
|
||||
### This section is for those using a dockable probe that is stored outside of the print area. ###
|
||||
|
||||
variable_probe_dock_enable: False # Enables/disables the use of a dockable probe that is stored outside of the print area, default is False.
|
||||
variable_attach_macro: 'Attach_Probe' # Here is where you define the macro that ATTACHES the probe to the printhead. E.g. 'Attach_Probe'
|
||||
variable_detach_macro: 'Dock_Probe' # Here is where you define the macro that DETACHES the probe from the printhead. E.g. 'Dock_Probe'
|
||||
|
||||
### This section is for those who are using Moonraker's Update Manager for KAMP, or want a more verbose macro. ###
|
||||
|
||||
variable_display_parameters: True # Display macro paramters in the console, useful for debugging the SETUP_KAMP_MESHING call, or more verbosity.
|
||||
|
||||
gcode:
|
||||
|
||||
{% if display_parameters == True %}
|
||||
{ action_respond_info("led_enable : %d" % (led_enable)) }
|
||||
{ action_respond_info("status_macro: \'%s\'" % (status_macro)) }
|
||||
{ action_respond_info("fuzz_enable : %d" % (fuzz_enable)) }
|
||||
{ action_respond_info("fuzz_min : %f" % (fuzz_min)) }
|
||||
{ action_respond_info("fuzz_max : %f" % (fuzz_max)) }
|
||||
{ action_respond_info("probe_dock_enable: %d" % (probe_dock_enable)) }
|
||||
{ action_respond_info("attach_macro: \'%s\'" % (attach_macro)) }
|
||||
{ action_respond_info("detach_macro: \'%s\'" % (detach_macro)) }
|
||||
{% endif %}
|
||||
|
||||
{% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %}
|
||||
{% set bed_mesh_min = printer.configfile.settings.bed_mesh.mesh_min %}
|
||||
{% set bed_mesh_max = printer.configfile.settings.bed_mesh.mesh_max %}
|
||||
{% set probe_count = printer.configfile.settings.bed_mesh.probe_count %}
|
||||
{% set probe_count = probe_count if probe_count|length > 1 else probe_count * 2 %}
|
||||
{% set max_probe_point_distance_x = ( bed_mesh_max[0] - bed_mesh_min[0] ) / (probe_count[0] - 1) %}
|
||||
{% set max_probe_point_distance_y = ( bed_mesh_max[1] - bed_mesh_min[1] ) / (probe_count[1] - 1) %}
|
||||
{% set x_min = all_points | map(attribute=0) | min | default(bed_mesh_min[0]) %}
|
||||
{% set y_min = all_points | map(attribute=1) | min | default(bed_mesh_min[1]) %}
|
||||
{% set x_max = all_points | map(attribute=0) | max | default(bed_mesh_max[0]) %}
|
||||
{% set y_max = all_points | map(attribute=1) | max | default(bed_mesh_max[1]) %}
|
||||
|
||||
{% if margin_enable == False %}
|
||||
{% set margin_size = 0 %}
|
||||
{% endif %}
|
||||
|
||||
{ action_respond_info("{} object points, clamping to bed mesh [{!r} {!r}]".format(
|
||||
all_points | count,
|
||||
bed_mesh_min,
|
||||
bed_mesh_max,
|
||||
)) }
|
||||
|
||||
{% if fuzz_enable == True %}
|
||||
{% set fuzz_range = range((fuzz_min * 100) | int, (fuzz_max * 100) | int + 1) %}
|
||||
{% set x_min = (bed_mesh_min[0] + fuzz_max - margin_size, x_min) | max - (fuzz_range | random / 100.0) %}
|
||||
{% set y_min = (bed_mesh_min[1] + fuzz_max - margin_size, y_min) | max - (fuzz_range | random / 100.0) %}
|
||||
{% set x_max = (bed_mesh_max[0] - fuzz_max + margin_size, x_max) | min + (fuzz_range | random / 100.0) %}
|
||||
{% set y_max = (bed_mesh_max[1] - fuzz_max + margin_size, y_max) | min + (fuzz_range | random / 100.0) %}
|
||||
{% else %}
|
||||
{% set x_min = [ bed_mesh_min[0], x_min - margin_size ] | max %}
|
||||
{% set y_min = [ bed_mesh_min[1], y_min - margin_size ] | max %}
|
||||
{% set x_max = [ bed_mesh_max[0], x_max + margin_size ] | min %}
|
||||
{% set y_max = [ bed_mesh_max[1], y_max + margin_size ] | min %}
|
||||
{% endif %}
|
||||
|
||||
{ action_respond_info("Object bounds, clamped to the bed_mesh: {!r}, {!r}".format(
|
||||
(x_min, y_min),
|
||||
(x_max, y_max),
|
||||
)) }
|
||||
|
||||
{% set points_x = (((x_max - x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %}
|
||||
{% set points_y = (((y_max - y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %}
|
||||
|
||||
{% if params.PROFILE is defined %}
|
||||
{% set PROFILE2 =params.PROFILE %}
|
||||
{% else %}
|
||||
{% set PROFILE2 ="default" %}
|
||||
{% endif %}
|
||||
|
||||
{% if (([points_x, points_y]|max) > 4) %}
|
||||
{% set algorithm = "bicubic" %}
|
||||
{% set min_points = 4 %}
|
||||
{% else %}
|
||||
{% set algorithm = "lagrange" %}
|
||||
{% set min_points = 3 %}
|
||||
{% endif %}
|
||||
{ action_respond_info( "Algorithm: {}".format(algorithm)) }
|
||||
|
||||
{% set points_x = [points_x, min_points]|max %}
|
||||
{% set points_y = [points_y, min_points]|max %}
|
||||
{ action_respond_info( "Points: x: {}, y: {}".format(points_x, points_y) ) }
|
||||
|
||||
{% if printer.configfile.settings.bed_mesh.relative_reference_index is defined %}
|
||||
{% set ref_index = (points_x * points_y / 2) | int %}
|
||||
{ action_respond_info( "Reference index: {}".format(ref_index) ) }
|
||||
{% else %}
|
||||
{% set ref_index = -1 %}
|
||||
{% endif %}
|
||||
|
||||
{% if probe_dock_enable == True %}
|
||||
{attach_macro} # Attach/deploy a probe if the probe is stored somewhere outside of the print area
|
||||
{% endif %}
|
||||
|
||||
{% if led_enable == True %}
|
||||
{status_macro} # Set status LEDs
|
||||
{% endif %}
|
||||
|
||||
_BED_MESH_CALIBRATE mesh_min={x_min},{y_min} mesh_max={x_max},{y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y} RELATIVE_REFERENCE_INDEX={ref_index} PROFILE={params.PROFILE|default("default")}
|
||||
|
||||
{% if probe_dock_enable == True %}
|
||||
{detach_macro} # Detach/stow a probe if the probe is stored somewhere outside of the print area
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro SETUP_KAMP_MESHING]
|
||||
gcode:
|
||||
SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=display_parameters VALUE={params.DISPLAY_PARAMETERS|default(True)|int}
|
||||
SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=led_enable VALUE={params.LED_ENABLE|default(False)|int}
|
||||
SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=status_macro VALUE='"{params.STATUS_MACRO|default('status_meshing')|string}"'
|
||||
|
||||
SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=fuzz_enable VALUE={params.FUZZ_ENABLE|default(False)|int}
|
||||
SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=fuzz_min VALUE={params.FUZZ_MIN|default(0)|float}
|
||||
SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=fuzz_max VALUE={params.FUZZ_MAX|default(4)|float}
|
||||
|
||||
SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=probe_dock_enable VALUE={params.PROBE_DOCK_ENABLE|default(False)|int}
|
||||
SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=attach_macro VALUE='"{params.ATTACH_MACRO|default('Attach_Probe')|string}"'
|
||||
SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=detach_macro VALUE='"{params.DETACH_MACRO|default('Dock_Probe')|string}"'
|
||||
|
||||
|
||||
|
||||
# # # Klipper Adaptive Purging - Line # # #
|
||||
|
||||
# This macro will parse information from objects in your gcode and create a nearby purge!
|
||||
# For successful purging, you may need to configure:
|
||||
#
|
||||
# [extruder]
|
||||
# ...
|
||||
# max_extrude_cross_section: 5
|
||||
|
||||
[gcode_macro LINE_PURGE]
|
||||
description: A purge macro that adapts to be near your actual printed objects
|
||||
|
||||
variable_adaptive_enable: True # Change to False if you'd like the purge to be in the same spot every print
|
||||
variable_z_height: 0.4 # Height above the bed to purge
|
||||
variable_purge_amount: 40 # Amount of filament in millimeters to purge
|
||||
variable_line_length: 50 # Overall desired length of purge line in millimeters, around 1/5th of X axis length is a good starting value
|
||||
variable_flow_rate: 12 # Desired flow rate in mm3/s (Around 12 for standard flow hotends, around 24 for high flow hotends)
|
||||
variable_x_default: 10 # Default X location to purge. If adaptive_enable is True, this is overwritten
|
||||
variable_y_default: 10 # Default Y location to purge. If adaptive_enable is True, this is overwritten
|
||||
variable_distance_to_object_y: 10 # Y distance in millimeters away from the print area for purging. Must be less than or equal to y_default if adaptive_enable is False
|
||||
|
||||
### This section is for those who are using Moonraker's Update Manager for KAMP, or want a more verbose macro. ###
|
||||
|
||||
variable_display_parameters: True # Display macro paramters in the console, useful for debugging the SETUP_LINE_PURGE call, or more verbosity.
|
||||
|
||||
gcode:
|
||||
|
||||
{% if display_parameters == True %}
|
||||
{ action_respond_info("adaptive_enable : %d" % (adaptive_enable)) }
|
||||
{ action_respond_info("z_height : %f" % (z_height)) }
|
||||
{ action_respond_info("purge_amount : %f" % (purge_amount)) }
|
||||
{ action_respond_info("line_length : %f" % (line_length)) }
|
||||
{ action_respond_info("flow_rate : %f" % (flow_rate)) }
|
||||
{ action_respond_info("x_default : %f" % (x_default)) }
|
||||
{ action_respond_info("y_default : %f" % (y_default)) }
|
||||
{ action_respond_info("distance_to_object_y : %f" % (distance_to_object_y)) }
|
||||
{% endif %}
|
||||
|
||||
{% if adaptive_enable == True %}
|
||||
{% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %}
|
||||
{% set x_origin = (all_points | map(attribute=0) | min | default(x_default)) %}
|
||||
{% set y_origin = (all_points | map(attribute=1) | min | default(y_default)) %}
|
||||
{% set x_origin = ([x_origin, 0] | max) %}
|
||||
{% set y_origin = ([y_origin, 0] | max) %}
|
||||
{% else %}
|
||||
{% set x_origin = x_default | float %}
|
||||
{% set y_origin = y_default | float %}
|
||||
{% endif %}
|
||||
{% set nozzle_dia = printer.configfile.config.extruder.nozzle_diameter | float %}
|
||||
{% set cross_section = nozzle_dia * z_height | float %}
|
||||
{% set purge_move_speed = (cross_section * flow_rate) * 60 | float %}
|
||||
{% set travel_speed = (printer.toolhead.max_velocity) * 30 | float %}
|
||||
|
||||
G92 E0 # Reset extruder
|
||||
G0 F{travel_speed} # Set travel speed
|
||||
G90 # Absolute positioning
|
||||
G0 X{x_origin} Y{y_origin - distance_to_object_y} # Move to purge position
|
||||
G0 Z{z_height} # Move to purge Z height
|
||||
M83 # Relative extrusion mode
|
||||
G1 X{x_origin + line_length} E{purge_amount} F{purge_move_speed} # Purge line
|
||||
G1 E-.5 F2100 # Retract
|
||||
G92 E0 # Reset extruder distance
|
||||
M82 # Absolute extrusion mode
|
||||
G0 Z{z_height * 2} F{travel_speed} # Z hop
|
||||
|
||||
[gcode_macro SETUP_LINE_PURGE]
|
||||
gcode:
|
||||
SET_GCODE_VARIABLE MACRO=LINE_PURGE VARIABLE=display_parameters VALUE={params.DISPLAY_PARAMETERS|default(True)|int}
|
||||
SET_GCODE_VARIABLE MACRO=LINE_PURGE VARIABLE=adaptive_enable VALUE={params.ADAPTIVE_ENABLE|default(True)|int}
|
||||
SET_GCODE_VARIABLE MACRO=LINE_PURGE VARIABLE=z_height VALUE={params.Z_HEIGHT|default(0.4)|float}
|
||||
SET_GCODE_VARIABLE MACRO=LINE_PURGE VARIABLE=purge_amount VALUE={params.PURGE_AMOUNT|default(40)|float}
|
||||
SET_GCODE_VARIABLE MACRO=LINE_PURGE VARIABLE=line_length VALUE={params.LINE_LENGTH|default(50)|float}
|
||||
SET_GCODE_VARIABLE MACRO=LINE_PURGE VARIABLE=flow_rate VALUE={params.FLOW_RATE|default(12)|float}
|
||||
SET_GCODE_VARIABLE MACRO=LINE_PURGE VARIABLE=x_default VALUE={params.X_DEFAULT|default(10)|float}
|
||||
SET_GCODE_VARIABLE MACRO=LINE_PURGE VARIABLE=y_default VALUE={params.Y_DEFAULT|default(10)|float}
|
||||
SET_GCODE_VARIABLE MACRO=LINE_PURGE VARIABLE=distance_to_object_y VALUE={params.DISTANCE_TO_OBJECT_Y|default(10)|float}
|
||||
|
||||
767
config/gcode_macro.cfg
Normal file
767
config/gcode_macro.cfg
Normal file
@@ -0,0 +1,767 @@
|
||||
# Q1_Pro
|
||||
# V4.4.16 2024-3-14
|
||||
# update: variable change M106 & M141 & M107
|
||||
# V4.4.16 2024-3-26
|
||||
# update: variable change [homing_override]->add M204 S10000
|
||||
# v4.4.20 2024-6-17
|
||||
# update: Z_DOUDONG CLEAR_NOZZLE get_zoffset rewrite
|
||||
# move_subzoffset added
|
||||
|
||||
[gcode_macro test_zoffset]
|
||||
gcode:
|
||||
G28
|
||||
get_zoffset
|
||||
G1 X{120 - printer.probe["x_offset"]} Y{120 - printer.probe["y_offset"]} F9000
|
||||
G1 Z10 F600
|
||||
probe
|
||||
M400
|
||||
G4 P5000
|
||||
G1 Z10 F600
|
||||
|
||||
[gcode_macro move_subzoffset]
|
||||
gcode:
|
||||
|
||||
G1 Z{printer.probe.last_z_result} F600
|
||||
|
||||
[gcode_macro get_zoffset]
|
||||
gcode:
|
||||
G1 Z10 F600
|
||||
Z_DOUDONG
|
||||
;G4 P500
|
||||
QIDI_PROBE_PIN_1
|
||||
M204 S30
|
||||
G4 P500
|
||||
probe probe_speed=5 lift_speed=5 samples=5 sample_retract_dist=5
|
||||
move_subzoffset
|
||||
M114
|
||||
SET_KINEMATIC_POSITION Z=-0.07
|
||||
G1 Z30 F600
|
||||
QIDI_PROBE_PIN_2
|
||||
M204 S10000
|
||||
|
||||
[gcode_macro save_zoffset]
|
||||
gcode:
|
||||
{% if printer.gcode_move.homing_origin.z < 0.5 %}
|
||||
SAVE_VARIABLE VARIABLE=z_offset VALUE={printer.gcode_move.homing_origin.z}
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro set_zoffset]
|
||||
gcode:
|
||||
{% set z = printer.save_variables.variables.z_offset %}
|
||||
SET_GCODE_OFFSET Z={z} MOVE=0
|
||||
|
||||
[gcode_macro CLEAR_NOZZLE_PLR]
|
||||
gcode:
|
||||
{% set hotendtemp = params.HOTEND|default(250)|int %}
|
||||
{% if (printer.gcode_move.position.z ) < 35 %}
|
||||
G90
|
||||
G1 Z35 F900
|
||||
{% else %}
|
||||
G91
|
||||
G1 Z5 F900
|
||||
G90
|
||||
{% endif %}
|
||||
G1 X97 F15000
|
||||
G1 Y243 F15000
|
||||
G1 Y254 F800
|
||||
|
||||
M109 S{hotendtemp}
|
||||
|
||||
G92 E0
|
||||
G1 E80 F400
|
||||
M106 S255
|
||||
|
||||
G1 X97 F500
|
||||
G1 X85 F2000
|
||||
G1 X97 F2000
|
||||
G1 X85 F2000
|
||||
G1 X97 F2000
|
||||
G1 X85 F2000
|
||||
G1 X97 F2000
|
||||
G1 X85 F2000
|
||||
G1 X97 F2000
|
||||
G1 X85 F2000
|
||||
G1 X97 F2000
|
||||
G1 X85 F2000
|
||||
G1 X97 F2000
|
||||
G1 Y240 F800
|
||||
|
||||
[gcode_macro CLEAR_NOZZLE]
|
||||
gcode:
|
||||
{% set hotendtemp = params.HOTEND|int %}
|
||||
{% if (printer.gcode_move.position.z ) < 35 %}
|
||||
G1 Z35 F900
|
||||
{% else %}
|
||||
G91
|
||||
G1 Z5 F900
|
||||
G90
|
||||
{% endif %}
|
||||
G1 X97 F15000
|
||||
G1 Y243 F15000
|
||||
G1 Y254 F800
|
||||
|
||||
M109 S{hotendtemp}
|
||||
|
||||
G92 E0
|
||||
G1 E80 F400
|
||||
M106 S255
|
||||
M400
|
||||
M106 P2 S0
|
||||
M104 S0
|
||||
TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={hotendtemp-20}
|
||||
|
||||
G1 X85 F2000
|
||||
G1 X97 F2000
|
||||
G1 X85 F2000
|
||||
G1 X97 F2000
|
||||
G1 X85 F2000
|
||||
G1 X97 F2000
|
||||
G1 X85 F2000
|
||||
G1 X97 F2000
|
||||
G1 X85 F2000
|
||||
|
||||
G1 X65 F500
|
||||
G1 X88 F500
|
||||
G1 X65 F500
|
||||
G1 X88 F500
|
||||
G1 X65 F500
|
||||
G1 X88 F500
|
||||
G1 X65 F500
|
||||
G1 X88 F500
|
||||
G1 X65 F500
|
||||
G1 X97 F500
|
||||
|
||||
G1 X85 F2000
|
||||
G1 X97 F2000
|
||||
G1 X85 F2000
|
||||
G1 X97 F2000
|
||||
G1 X85 F2000
|
||||
G1 X97 F2000
|
||||
G1 X85 F2000
|
||||
G1 X97 F2000
|
||||
G1 X85 F2000
|
||||
G1 X97 F2000
|
||||
|
||||
M400
|
||||
M118 Nozzle cleared
|
||||
G1 Y240 F800
|
||||
G1 Y120 F15000
|
||||
G1 X230 F15000
|
||||
TEMPERATURE_WAIT SENSOR=extruder MAXIMUM=140
|
||||
M107
|
||||
M106 P2 S0
|
||||
M400
|
||||
M118 Nozzle cooled
|
||||
|
||||
[gcode_macro PRINT_START]
|
||||
gcode:
|
||||
AUTOTUNE_SHAPERS
|
||||
|
||||
{% set bedtemp = params.BED|int %}
|
||||
{% set hotendtemp = params.HOTEND|int %}
|
||||
{% set chambertemp = params.CHAMBER|default(0)|int %}
|
||||
set_zoffset
|
||||
M104 S0
|
||||
M140 S{bedtemp}
|
||||
M141 S{chambertemp}
|
||||
G28
|
||||
CLEAR_NOZZLE HOTEND={hotendtemp}
|
||||
|
||||
M190 S{bedtemp}
|
||||
# Z_TILT_ADJUST
|
||||
G29
|
||||
G0 Z50 F600
|
||||
G0 X0 Y0 F6000
|
||||
|
||||
M191 S{chambertemp}
|
||||
M109 S{hotendtemp}
|
||||
M204 S10000
|
||||
|
||||
ENABLE_ALL_SENSOR
|
||||
save_last_file
|
||||
|
||||
[gcode_macro ENABLE_ALL_SENSOR]
|
||||
gcode:
|
||||
ENABLE_FILAMENT_WIDTH_SENSOR
|
||||
RESET_FILAMENT_WIDTH_SENSOR
|
||||
query_filament_width
|
||||
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=1
|
||||
|
||||
[gcode_macro DISABLE_ALL_SENSOR]
|
||||
gcode:
|
||||
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=0
|
||||
DISABLE_FILAMENT_WIDTH_SENSOR
|
||||
|
||||
[gcode_macro AUTOTUNE_SHAPERS]
|
||||
variable_autotune_shapers: 'ei'
|
||||
gcode:
|
||||
|
||||
[gcode_macro M84]
|
||||
rename_existing:M84.1
|
||||
gcode:
|
||||
M84.1
|
||||
SET_STEPPER_ENABLE STEPPER=stepper_x enable=0
|
||||
SET_STEPPER_ENABLE STEPPER=stepper_y enable=0
|
||||
SET_STEPPER_ENABLE STEPPER=stepper_z enable=1
|
||||
SET_STEPPER_ENABLE STEPPER=stepper_z1 enable=1
|
||||
SET_STEPPER_ENABLE STEPPER=extruder enable=0
|
||||
|
||||
[gcode_macro DETECT_INTERRUPTION]
|
||||
gcode:
|
||||
{% set was_interrupted = printer.save_variables.variables.was_interrupted %}
|
||||
{% if was_interrupted %}
|
||||
M118 Detected unexpected interruption during the last print. Do you want to resume printing? (Do not move the extruder before resuming.)
|
||||
M118 Yes: RESUME_INTERRUPTED
|
||||
M118 No: CLEAR_LAST_FILE
|
||||
{% endif %}
|
||||
|
||||
[delayed_gcode PRINTER_INIT]
|
||||
initial_duration:0.2
|
||||
gcode:
|
||||
SET_STEPPER_ENABLE STEPPER=stepper_z enable=1
|
||||
SET_STEPPER_ENABLE STEPPER=stepper_z1 enable=1
|
||||
BED_MESH_CLEAR
|
||||
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=0
|
||||
|
||||
[homing_override]
|
||||
axes:xyz
|
||||
gcode:
|
||||
{% set HOME_CUR = 1 %}
|
||||
{% set driver_config = printer.configfile.settings['tmc2240 stepper_x'] %}
|
||||
{% set RUN_CUR = driver_config.run_current %}
|
||||
{% set HOLD_CUR = driver_config.hold_current %}
|
||||
M204 S10000
|
||||
{% if params.X is defined %}
|
||||
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR * 0.7}
|
||||
G28 X
|
||||
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
|
||||
BEEP I=1 DUR=100
|
||||
G1 X10 F1200
|
||||
{% endif %}
|
||||
|
||||
{% if params.Y is defined %}
|
||||
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR * 0.9}
|
||||
G28 Y
|
||||
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR}
|
||||
BEEP I=1 DUR=100
|
||||
G1 Y10 F1200
|
||||
{% endif %}
|
||||
|
||||
{% if params.Z is defined %}
|
||||
SET_KINEMATIC_POSITION Z={printer.toolhead.axis_maximum.z-5}
|
||||
QIDI_PROBE_PIN_2
|
||||
probe samples=2
|
||||
SET_KINEMATIC_POSITION Z=1.9
|
||||
G1 Z10 F600
|
||||
Z_DOUDONG
|
||||
QIDI_PROBE_PIN_1
|
||||
probe probe_speed=10
|
||||
SET_KINEMATIC_POSITION Z=-0.1
|
||||
G1 Z30 F480
|
||||
{% endif %}
|
||||
|
||||
{% if params.X is undefined %}
|
||||
{% if params.Y is undefined %}
|
||||
{% if params.Z is undefined %}
|
||||
SET_KINEMATIC_POSITION X=0
|
||||
SET_KINEMATIC_POSITION Y=0
|
||||
SET_KINEMATIC_POSITION Z={printer.toolhead.axis_maximum.z-10}
|
||||
G91
|
||||
G1 Z7 F600
|
||||
G1 X10 F2400
|
||||
G1 Y10 F2400
|
||||
G4 P2000
|
||||
|
||||
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR * 0.8}
|
||||
G28 X
|
||||
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
|
||||
BEEP I=1 DUR=100
|
||||
G1 X10 F1200
|
||||
|
||||
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR * 0.9}
|
||||
G28 Y
|
||||
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR}
|
||||
BEEP I=1 DUR=100
|
||||
G1 Y10 F1200
|
||||
|
||||
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR * 0.8}
|
||||
G28 X
|
||||
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
|
||||
BEEP I=1 DUR=100
|
||||
G1 X10 F1200
|
||||
|
||||
SET_KINEMATIC_POSITION Z={printer.toolhead.axis_maximum.z-10}
|
||||
|
||||
G90
|
||||
G1 X120 Y120 F7800
|
||||
G91
|
||||
QIDI_PROBE_PIN_2
|
||||
G28 Z
|
||||
G1 Z30 F600
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR}
|
||||
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CUR}
|
||||
M204 S10000
|
||||
G90
|
||||
QIDI_PROBE_PIN_2
|
||||
|
||||
[gcode_macro SHAPER_CALIBRATE]
|
||||
rename_existing: RESHAPER_CALIBRATE
|
||||
gcode:
|
||||
RESHAPER_CALIBRATE FREQ_START=20 FREQ_END=150
|
||||
|
||||
[gcode_macro PRINT_END]
|
||||
gcode:
|
||||
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
|
||||
CLEAR_PAUSE
|
||||
save_zoffset
|
||||
M106 P2 S0
|
||||
M106 P0 S0
|
||||
M106 P3 S0
|
||||
|
||||
M104 S0
|
||||
M140 S0
|
||||
M141 S0
|
||||
|
||||
M220 S100
|
||||
M221 S100
|
||||
SET_STEPPER_ENABLE STEPPER=stepper_x enable=0
|
||||
SET_STEPPER_ENABLE STEPPER=stepper_y enable=0
|
||||
SET_STEPPER_ENABLE STEPPER=stepper_z enable=1
|
||||
SET_STEPPER_ENABLE STEPPER=stepper_z1 enable=1
|
||||
SET_STEPPER_ENABLE STEPPER=extruder enable=0
|
||||
|
||||
DISABLE_ALL_SENSOR
|
||||
SET_GCODE_OFFSET Z=0 MOVE=0
|
||||
BED_MESH_CLEAR
|
||||
G31
|
||||
CLEAR_LAST_FILE
|
||||
BEEP I=2 DUR=500
|
||||
|
||||
[gcode_macro CANCEL_PRINT]
|
||||
rename_existing: BASE_CANCEL_PRINT
|
||||
gcode:
|
||||
{% if (printer.gcode_move.position.z) < 150 %} ; check that zhop doesn't exceed z max
|
||||
G1 Z150 F480
|
||||
{% endif %}
|
||||
|
||||
G1 X0 Y0 F7800
|
||||
|
||||
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
|
||||
CLEAR_PAUSE
|
||||
save_zoffset
|
||||
M106 P2 S0
|
||||
M106 P0 S0
|
||||
M106 P3 S0
|
||||
|
||||
M104 S0
|
||||
M140 S0
|
||||
M141 S0
|
||||
|
||||
M220 S100
|
||||
M221 S100
|
||||
SET_STEPPER_ENABLE STEPPER=stepper_x enable=0
|
||||
SET_STEPPER_ENABLE STEPPER=stepper_y enable=0
|
||||
SET_STEPPER_ENABLE STEPPER=stepper_z enable=1
|
||||
SET_STEPPER_ENABLE STEPPER=stepper_z1 enable=1
|
||||
SET_STEPPER_ENABLE STEPPER=extruder enable=0
|
||||
|
||||
DISABLE_ALL_SENSOR
|
||||
SET_GCODE_OFFSET Z=0 MOVE=0
|
||||
BED_MESH_CLEAR
|
||||
G31
|
||||
BEEP I=2 DUR=500
|
||||
|
||||
SDCARD_RESET_FILE
|
||||
BASE_CANCEL_PRINT
|
||||
CLEAR_LAST_FILE
|
||||
|
||||
[gcode_macro PAUSE]
|
||||
rename_existing: BASE_PAUSE
|
||||
gcode:
|
||||
{% set z = params.Z|default(35)|int %} ; z hop amount
|
||||
|
||||
{% if printer['pause_resume'].is_paused|int == 0 %}
|
||||
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE={z} ; set z hop variable for reference in resume macro
|
||||
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target} ; set hotend temp variable for reference in resume macro
|
||||
|
||||
DISABLE_FILAMENT_WIDTH_SENSOR
|
||||
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=0 ; disable filament sensor
|
||||
SAVE_GCODE_STATE NAME=PAUSE ; save current print position for resume
|
||||
BASE_PAUSE ; pause print
|
||||
G92 E0
|
||||
G1 E-5 F1800
|
||||
{% if (printer.gcode_move.position.z ) < z %}
|
||||
G91 ; relative positioning
|
||||
G1 Z{z} F900 ; raise Z up by z hop amount
|
||||
{% else %}
|
||||
G91 ; relative positioning
|
||||
G1 Z{5} F900
|
||||
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE=0
|
||||
{% endif %}
|
||||
SAVE_GCODE_STATE NAME=PAUSEPARK2
|
||||
G90 ; absolute positioning
|
||||
G1 X97 F9000
|
||||
G1 Y253 F9000 ; park toolhead at front center
|
||||
SAVE_GCODE_STATE NAME=PAUSEPARK ; save parked position in case toolhead is moved during the pause (otherwise the return zhop can error)
|
||||
M104 S0 ; turn off hotend
|
||||
SET_IDLE_TIMEOUT TIMEOUT=86400 ; set timeout to 24 hours
|
||||
SET_STEPPER_ENABLE STEPPER=extruder enable=0
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro RESUME]
|
||||
rename_existing: BASE_RESUME
|
||||
variable_zhop: 0
|
||||
variable_etemp: 0
|
||||
gcode:
|
||||
{% set e = params.E|default(5)|int %} ; hotend prime amount (in mm)
|
||||
|
||||
{% if printer['pause_resume'].is_paused|int == 1 %}
|
||||
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
|
||||
{% if etemp > 0 %}
|
||||
M109 S{etemp|int} ; wait for hotend to heat back up
|
||||
{% endif %}
|
||||
M83 ; relative extruder positioning
|
||||
G1 X97 F9000
|
||||
G1 Y253 F9000
|
||||
G91
|
||||
G1 E{e} F300 ; prime nozzle by E, lower Z back down
|
||||
G90
|
||||
G1 X85 F3000
|
||||
G1 X98 F3000
|
||||
G1 X85 F3000
|
||||
G1 X98 F3000
|
||||
G1 X85 F3000
|
||||
G1 X98 F3000
|
||||
G1 X85 F3000
|
||||
G1 X98 F3000
|
||||
G1 X85 F3000
|
||||
G1 X98 F3000
|
||||
G1 X85 F3000
|
||||
G1 X98 F3000
|
||||
G1 X65 F500
|
||||
G1 Y200 F3000
|
||||
RESTORE_GCODE_STATE NAME=PAUSEPARK2 MOVE=1 MOVE_SPEED=200
|
||||
RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=10 ; restore position
|
||||
BASE_RESUME
|
||||
ENABLE_FILAMENT_WIDTH_SENSOR
|
||||
RESET_FILAMENT_WIDTH_SENSOR
|
||||
query_filament_width ; resume print
|
||||
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=1 ; enable filament sensor
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro BEEP]
|
||||
gcode:
|
||||
{% set i = params.I|default(1)|int %} ; Iterations (number of times to beep).
|
||||
{% set dur = params.DUR|default(100)|int %} ; Duration/wait of each beep in ms. Default 100ms.
|
||||
|
||||
{% if printer["output_pin sound"].value|int == 1 %}
|
||||
{% for iteration in range(i|int) %}
|
||||
SET_PIN PIN=beeper VALUE=1
|
||||
G4 P{dur}
|
||||
SET_PIN PIN=beeper VALUE=0
|
||||
G4 P{dur}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro M141]
|
||||
gcode:
|
||||
{% if printer["heater_generic chamber"] is defined %}
|
||||
{% set s = params.S|float %}
|
||||
SET_HEATER_TEMPERATURE HEATER=chamber TARGET={([s, 60]|min)}
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro M191]
|
||||
gcode:
|
||||
#Parameters
|
||||
{% if printer["heater_generic chamber"] is defined %}
|
||||
{% set s = params.S|float %}
|
||||
|
||||
M141 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %}
|
||||
{% if s != 0 %}
|
||||
TEMPERATURE_WAIT SENSOR="heater_generic chamber" MINIMUM={([s, 60]|min)-2} #MAXIMUM={s+1}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro M106]
|
||||
gcode:
|
||||
{% set p = params.P|default(0)|int %}
|
||||
|
||||
{% if p == 2 %}
|
||||
{% if params.S is defined %}
|
||||
SET_FAN_SPEED FAN=auxiliary_cooling_fan SPEED={(params.S|float / 255.0)}
|
||||
{% else %}
|
||||
SET_FAN_SPEED FAN=auxiliary_cooling_fan SPEED=1
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if p == 0 %}
|
||||
{% if params.S is defined %}
|
||||
SET_FAN_SPEED FAN=cooling_fan SPEED={(params.S|float / 255.0)}
|
||||
{% else %}
|
||||
SET_FAN_SPEED FAN=cooling_fan SPEED=1
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if p == 3 %}
|
||||
{% if params.S is defined %}
|
||||
SET_FAN_SPEED FAN=chamber_circulation_fan SPEED={(params.S|float / 255.0)}
|
||||
{% else %}
|
||||
SET_FAN_SPEED FAN=chamber_circulation_fan SPEED=1
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro M107]
|
||||
gcode:
|
||||
SET_FAN_SPEED FAN=cooling_fan SPEED=0
|
||||
|
||||
[gcode_macro M303]
|
||||
gcode:
|
||||
{% if params.E is defined %}
|
||||
{% if params.S is defined %}
|
||||
{% if (params.E|int)==-1 %}
|
||||
PID_CALIBRATE HEATER=heater_bed TARGET={params.S|int}
|
||||
{% endif %}
|
||||
{% if (params.E|int)==0 %}
|
||||
PID_CALIBRATE HEATER=extruder TARGET={params.S|int}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro M8029]
|
||||
gcode:
|
||||
{% if params.D is defined %}
|
||||
{% if (params.D|int)==1 %}
|
||||
ENABLE_FILAMENT_WIDTH_SENSOR
|
||||
{% endif %}
|
||||
{% if (params.D|int)==0 %}
|
||||
DISABLE_FILAMENT_WIDTH_SENSOR
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro M900]
|
||||
gcode:
|
||||
{% if params.K is defined %}
|
||||
SET_PRESSURE_ADVANCE ADVANCE={params.K}
|
||||
{% endif %}
|
||||
{% if params.T is defined %}
|
||||
SET_PRESSURE_ADVANCE SMOOTH_TIME={params.T}
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro M290]
|
||||
gcode:
|
||||
SET_GCODE_OFFSET Z_ADJUST={params.Z}
|
||||
|
||||
[gcode_macro M901]
|
||||
gcode:
|
||||
G28
|
||||
SHAPER_CALIBRATE
|
||||
M400
|
||||
M118 Input shaping complete
|
||||
SAVE_CONFIG
|
||||
|
||||
[gcode_macro M0]
|
||||
gcode:
|
||||
PAUSE
|
||||
|
||||
[gcode_macro M25]
|
||||
rename_existing: M9925
|
||||
gcode:
|
||||
PAUSE
|
||||
|
||||
[gcode_macro RESPOND_INFO]
|
||||
variable_S:0
|
||||
gcode:
|
||||
{% if params.S is defined %}
|
||||
{% set s = params.S|int %}
|
||||
{% if s == 0 %}
|
||||
{ action_respond_info("Nozzle cooled") }
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro M4027]
|
||||
gcode:
|
||||
G1 X{120 - printer.probe["x_offset"]} Y{120 - printer.probe["y_offset"]} F9000
|
||||
probe
|
||||
save_meshoffset
|
||||
G1 z10 F600
|
||||
SET_GCODE_OFFSET Z=0 MOVE=1
|
||||
BED_MESH_CALIBRATE
|
||||
set_meshoffset
|
||||
G0 Z50 F600
|
||||
G0 X0 Y0 F9000
|
||||
M400
|
||||
M118 Bed mesh calibrate complete
|
||||
SAVE_CONFIG
|
||||
|
||||
[gcode_macro M4028]
|
||||
gcode:
|
||||
G28
|
||||
get_zoffset
|
||||
M400
|
||||
M118 Position init complete
|
||||
|
||||
[gcode_macro M4029]
|
||||
gcode:
|
||||
M104 S140
|
||||
SAVE_VARIABLE VARIABLE=z_offset VALUE=0
|
||||
G28
|
||||
M400
|
||||
M118 Position init complete
|
||||
|
||||
CLEAR_NOZZLE HOTEND=240
|
||||
|
||||
G28
|
||||
get_zoffset
|
||||
|
||||
[gcode_macro M4030]
|
||||
gcode:
|
||||
BED_MESH_CLEAR
|
||||
SET_GCODE_OFFSET Z=0 MOVE=0
|
||||
G28
|
||||
get_zoffset
|
||||
G1 X120 Y120 F9000
|
||||
G1 Z0 F600
|
||||
|
||||
[gcode_macro M4031]
|
||||
gcode:
|
||||
SET_TMC_CURRENT STEPPER=stepper_z CURRENT={printer.configfile.settings['tmc2209 stepper_z'].run_current * 0.8 }
|
||||
SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT={printer.configfile.settings['tmc2209 stepper_z1'].run_current * 0.8 }
|
||||
REVERSE_HOMING
|
||||
SET_TMC_CURRENT STEPPER=stepper_z CURRENT={printer.configfile.settings['tmc2209 stepper_z'].run_current}
|
||||
SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT={printer.configfile.settings['tmc2209 stepper_z1'].run_current}
|
||||
G91
|
||||
G1 Z-30 F600
|
||||
G90
|
||||
|
||||
SET_TMC_CURRENT STEPPER=stepper_z CURRENT={printer.configfile.settings['tmc2209 stepper_z'].run_current * 0.8 }
|
||||
SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT={printer.configfile.settings['tmc2209 stepper_z1'].run_current * 0.8 }
|
||||
REVERSE_HOMING
|
||||
SET_TMC_CURRENT STEPPER=stepper_z CURRENT={printer.configfile.settings['tmc2209 stepper_z'].run_current}
|
||||
SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT={printer.configfile.settings['tmc2209 stepper_z1'].run_current}
|
||||
G91
|
||||
G1 Z-30 F600
|
||||
G90
|
||||
|
||||
[gcode_macro M603]
|
||||
description: filament unload
|
||||
gcode:
|
||||
M118 Heat up complete
|
||||
G92 E0
|
||||
G0 E15 F400
|
||||
G4 P1000
|
||||
G92 E0
|
||||
G1 E-90 F800
|
||||
M400
|
||||
M118 Unload finish
|
||||
|
||||
[gcode_macro M604]
|
||||
gcode:
|
||||
M118 Heat up complete
|
||||
M83
|
||||
G1 E80 F400
|
||||
M400
|
||||
M118 Load finish
|
||||
|
||||
[output_pin sound]
|
||||
pin: gpio8
|
||||
value:0
|
||||
|
||||
[gcode_macro beep_on]
|
||||
gcode:
|
||||
SET_PIN PIN=sound VALUE=1
|
||||
|
||||
[gcode_macro beep_off]
|
||||
gcode:
|
||||
SET_PIN PIN=sound VALUE=0
|
||||
|
||||
[gcode_arcs]
|
||||
resolution: 1.0
|
||||
|
||||
[gcode_macro M109]
|
||||
rename_existing: M99109
|
||||
gcode:
|
||||
{% set s = params.S|float %}
|
||||
|
||||
M104 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %} ; Set hotend temp
|
||||
{% if s != 0 %}
|
||||
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={s} MAXIMUM={s+1} ; Wait for hotend temp (within 1 degree)
|
||||
{% endif %}
|
||||
|
||||
[exclude_object]
|
||||
|
||||
[gcode_macro G31]
|
||||
gcode:
|
||||
SET_GCODE_VARIABLE MACRO=G29 VARIABLE=k VALUE=1
|
||||
|
||||
[gcode_macro G32]
|
||||
gcode:
|
||||
SET_GCODE_VARIABLE MACRO=G29 VARIABLE=k VALUE=0
|
||||
|
||||
[gcode_macro set_meshoffset]
|
||||
variable_zoffset:0
|
||||
gcode:
|
||||
ADD_Z_OFFSET_TO_BED_MESH ZOFFSET={0 - zoffset}
|
||||
SET_GCODE_VARIABLE MACRO=set_meshoffset VARIABLE=zoffset VALUE=0
|
||||
[gcode_macro save_meshoffset]
|
||||
gcode:
|
||||
SET_GCODE_VARIABLE MACRO=set_meshoffset VARIABLE=zoffset VALUE={printer.probe.last_z_result}
|
||||
|
||||
[gcode_macro G29]
|
||||
variable_k:1
|
||||
gcode:
|
||||
BED_MESH_CLEAR
|
||||
{% if k|int==1 %}
|
||||
G28
|
||||
get_zoffset
|
||||
G1 X{120 - printer.probe["x_offset"]} Y{120 - printer.probe["y_offset"]} F9000
|
||||
G1 Z10 F600
|
||||
probe
|
||||
save_meshoffset
|
||||
G1 z10 F600
|
||||
BED_MESH_CALIBRATE PROFILE=kamp
|
||||
SAVE_VARIABLE VARIABLE=profile_name VALUE='"kamp"'
|
||||
set_meshoffset
|
||||
SAVE_CONFIG_QD
|
||||
{% else %}
|
||||
g28
|
||||
get_zoffset
|
||||
BED_MESH_PROFILE LOAD=default
|
||||
SAVE_VARIABLE VARIABLE=profile_name VALUE='"default"'
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro M204]
|
||||
rename_existing: M99204
|
||||
gcode:
|
||||
{% if params.S is defined %}
|
||||
{% set s = params.S|float %}
|
||||
{% endif %}
|
||||
{% if params.P is defined %}
|
||||
{% if params.T is defined %}
|
||||
{% set s = [params.P|float ,params.T|float] | min %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
SET_VELOCITY_LIMIT ACCEL={s}
|
||||
SET_VELOCITY_LIMIT ACCEL_TO_DECEL={s/2}
|
||||
|
||||
[gcode_macro Z_DOUDONG]
|
||||
gcode:
|
||||
M204 S30
|
||||
G90
|
||||
G0 Z1
|
||||
G91
|
||||
G4 P3000
|
||||
SET_PIN PIN=ctlyd VALUE=1
|
||||
{% for z in range(1,7) %}
|
||||
G1 Z10 F900
|
||||
G1 Z-10 F900
|
||||
{% endfor %}
|
||||
SET_PIN PIN=ctlyd VALUE=0
|
||||
G4 P1000
|
||||
G1 Z4
|
||||
G90
|
||||
# M204 S10000
|
||||
|
||||
54
config/moonraker.conf
Normal file
54
config/moonraker.conf
Normal file
@@ -0,0 +1,54 @@
|
||||
[server]
|
||||
host: 0.0.0.0
|
||||
port: 7125
|
||||
enable_debug_logging: False
|
||||
klippy_uds_address: /tmp/klippy_uds
|
||||
|
||||
[authorization]
|
||||
trusted_clients:
|
||||
10.0.0.0/8
|
||||
127.0.0.0/8
|
||||
169.254.0.0/16
|
||||
172.16.0.0/12
|
||||
192.168.0.0/16
|
||||
FE80::/10
|
||||
::1/128
|
||||
cors_domains:
|
||||
http://*.lan
|
||||
http://*.local
|
||||
https://my.mainsail.xyz
|
||||
http://my.mainsail.xyz
|
||||
https://app.fluidd.xyz
|
||||
http://app.fluidd.xyz
|
||||
|
||||
[database]
|
||||
database_path: /home/mks/.moonraker_database
|
||||
|
||||
[file_manager]
|
||||
config_path: /home/mks/klipper_config
|
||||
log_path: /home/mks/klipper_logs
|
||||
|
||||
[octoprint_compat]
|
||||
|
||||
[history]
|
||||
|
||||
[timelapse]
|
||||
# [update_manager]
|
||||
# channel: dev
|
||||
# refresh_interval: 168
|
||||
# enable_system_updates: False
|
||||
|
||||
# [update_manager fluidd]
|
||||
# type: web
|
||||
# channel: stable
|
||||
# repo: fluidd-core/fluidd
|
||||
# path: ~/fluidd
|
||||
|
||||
# [update_manager KlipperScreen]
|
||||
# type: git_repo
|
||||
# path: /home/mks/KlipperScreen
|
||||
# origin: https://github.com/jordanruthe/KlipperScreen.git
|
||||
# env: /home/mks/.KlipperScreen-env/bin/python
|
||||
# requirements: scripts/KlipperScreen-requirements.txt
|
||||
# install_script: scripts/KlipperScreen-install.sh
|
||||
|
||||
66
config/plr.cfg
Normal file
66
config/plr.cfg
Normal file
@@ -0,0 +1,66 @@
|
||||
[gcode_shell_command POWER_LOSS_RESUME]
|
||||
command: bash /home/mks/scripts/plr/plr.sh
|
||||
timeout: 120
|
||||
|
||||
[gcode_shell_command UPDATE_GCODE_LINES]
|
||||
command: bash /home/mks/scripts/plr/update_gcode_lines.sh
|
||||
|
||||
[gcode_macro save_last_file]
|
||||
gcode:
|
||||
{% set svv = printer.save_variables.variables %}
|
||||
{% set filepath=printer.virtual_sdcard.file_path %}
|
||||
{% set filename=filepath.split('/')%}
|
||||
SAVE_VARIABLE VARIABLE=was_interrupted VALUE=True
|
||||
SAVE_VARIABLE VARIABLE=print_temp VALUE={printer.extruder.target}
|
||||
SAVE_VARIABLE VARIABLE=bed_temp VALUE={printer['heater_bed'].target}
|
||||
{% if printer["heater_generic chamber"] is defined %}
|
||||
SAVE_VARIABLE VARIABLE=hot_temp VALUE={printer['heater_generic chamber'].target}
|
||||
{% else %}
|
||||
SAVE_VARIABLE VARIABLE=hot_temp VALUE=0
|
||||
{% endif %}
|
||||
M118 Last File: { filename[-1] }
|
||||
M117 Last File: { filename[-1] }
|
||||
G4 P2000
|
||||
|
||||
[gcode_macro CLEAR_LAST_FILE]
|
||||
gcode:
|
||||
{% set filename='' %}
|
||||
SAVE_VARIABLE VARIABLE=last_file VALUE='"{ filename }"'
|
||||
SAVE_VARIABLE VARIABLE=was_interrupted VALUE=False
|
||||
|
||||
[gcode_macro LOG_Z]
|
||||
gcode:
|
||||
{% set z_pos = printer.gcode_move.gcode_position.z %}
|
||||
RESPOND MSG="Current Z is {z_pos}"
|
||||
SAVE_VARIABLE VARIABLE=power_resume_z VALUE={z_pos}
|
||||
|
||||
[gcode_macro RESUME_INTERRUPTED]
|
||||
gcode:
|
||||
set_zoffset
|
||||
RUN_SHELL_COMMAND CMD=UPDATE_GCODE_LINES
|
||||
{% set profile_name = params.PROFILE_NAME|default(printer.save_variables.variables.profile_name)|string %}
|
||||
# {% set g_lines = params.GCODE_LINES|default(printer.save_variables.variables.gcode_lines)|string %}
|
||||
# {% set last_file = params.GCODE_FILE|default(printer.save_variables.variables.last_file)|string %}
|
||||
# {% set print_temp = params.PRINT_TEMP|default(printer.save_variables.variables.print_temp)|float %}
|
||||
# {% set bed_temp = params.BED_TEMP|default(printer.save_variables.variables.bed_temp)|float %}
|
||||
# {% set hot_temp = params.HOT_TEMP|default(printer.save_variables.variables.hot_temp)|float %}
|
||||
# {% set filepath = params.FILE_PATH|default(printer.save_variables.variables.file_path)|string %}
|
||||
BED_MESH_PROFILE LOAD={profile_name}
|
||||
RUN_SHELL_COMMAND CMD=POWER_LOSS_RESUME
|
||||
SDCARD_PRINT_FILE FILENAME=/.plr/plr.gcode
|
||||
|
||||
|
||||
# [gcode_macro RESUME_INTERRUPTED]
|
||||
# gcode:
|
||||
# set_zoffset
|
||||
# {% set profile_name = params.PROFILE_NAME|default(printer.save_variables.variables.profile_name)|string %}
|
||||
# {% set z_height = params.Z_HEIGHT|default(printer.save_variables.variables.power_resume_z)|float %}
|
||||
# {% set last_file = params.GCODE_FILE|default(printer.save_variables.variables.last_file)|string %}
|
||||
# {% set print_temp = params.PRINT_TEMP|default(printer.save_variables.variables.print_temp)|float %}
|
||||
# {% set bed_temp = params.BED_TEMP|default(printer.save_variables.variables.bed_temp)|float %}
|
||||
# {% set hot_temp = params.HOT_TEMP|default(printer.save_variables.variables.hot_temp)|float %}
|
||||
# {% set filepath = params.FILE_PATH|default(printer.save_variables.variables.file_path)|string %}
|
||||
# BED_MESH_PROFILE LOAD={profile_name}
|
||||
# RUN_SHELL_COMMAND CMD=POWER_LOSS_RESUME PARAMS="{z_height} {last_file} {print_temp} {bed_temp} {hot_temp} {filepath}"
|
||||
# SDCARD_PRINT_FILE FILENAME=/.plr/plr.gcode
|
||||
|
||||
513
config/printer.cfg
Normal file
513
config/printer.cfg
Normal file
@@ -0,0 +1,513 @@
|
||||
# Q1_Pro
|
||||
# V4.4.14 2024-3-14
|
||||
# update: heater_generic hot -> chamber
|
||||
# out_put_pin fan0 -> fan_generic cooling_fan
|
||||
# out_put_pin fan2 -> fan_generic auxiliary_cooling_fan
|
||||
# out_put_pin fan3 -> fan_generic chamber_circulation_fan
|
||||
# heater_fan hot -> heater_fan chamber
|
||||
# verify_heater hot -> verify_heater chamber
|
||||
# V4.4.17 2024-3-29
|
||||
# update: delete comments
|
||||
# add time_update macro
|
||||
# [bed_mesh] 6,6 ->8,8
|
||||
# V4.4.19 2024-4-16
|
||||
# update: add [chamber_fan chamber_fan]
|
||||
# V4.4.20 2024-6-17
|
||||
# update: [smart_effector]
|
||||
# samples_result: average -> submaxmin
|
||||
# speed: 10 -> 5
|
||||
# sample_retract_dist: 3.0 -> 5.0
|
||||
# [stepper_x]
|
||||
# position_max: 245 -> 246
|
||||
|
||||
[include timelapse.cfg]
|
||||
[include Adaptive_Mesh.cfg]
|
||||
[include gcode_macro.cfg]
|
||||
[include plr.cfg]
|
||||
[include time_update.cfg]
|
||||
|
||||
[mcu]
|
||||
serial: /dev/ttyS2
|
||||
restart_method: command
|
||||
|
||||
[mcu U_1]
|
||||
serial: /dev/ttyS0
|
||||
restart_method: command
|
||||
|
||||
[respond]
|
||||
default_type: echo
|
||||
|
||||
[save_variables]
|
||||
filename =/home/mks/klipper_config/saved_variables.cfg
|
||||
|
||||
[resonance_tester]
|
||||
accel_per_hz: 150
|
||||
max_smoothing:0.5
|
||||
|
||||
[duplicate_pin_override]
|
||||
pins:
|
||||
gpio21 ,U_1:PC3
|
||||
|
||||
[bed_screws]
|
||||
screw1:10,10
|
||||
screw1_name: Front left
|
||||
screw2: 230,10
|
||||
screw2_name: Front right
|
||||
screw3: 125,240
|
||||
screw3_name: Last right
|
||||
|
||||
[screws_tilt_adjust]
|
||||
screw1:-5,5.6
|
||||
screw1_name: Front left
|
||||
screw2: 216,5.6
|
||||
screw2_name: Front right
|
||||
screw3: 103,235.6
|
||||
screw3_name: Last right
|
||||
screw_thread: CW-M4
|
||||
|
||||
[force_move]
|
||||
enable_force_move : false
|
||||
|
||||
[hall_filament_width_sensor]
|
||||
adc1: gpio27
|
||||
adc2: gpio28
|
||||
cal_dia1: 1.50
|
||||
cal_dia2: 2.0
|
||||
raw_dia1: 14397
|
||||
raw_dia2: 15058
|
||||
default_nominal_filament_diameter: 1.75
|
||||
max_difference: 0
|
||||
measurement_delay: 50
|
||||
enable: false
|
||||
measurement_interval: 10
|
||||
logging: False
|
||||
min_diameter: 0.3
|
||||
use_current_dia_while_delay: False
|
||||
pause_on_runout:True
|
||||
runout_gcode:
|
||||
RESET_FILAMENT_WIDTH_SENSOR
|
||||
M118 Filament run out
|
||||
event_delay: 3.0
|
||||
pause_delay: 0.5
|
||||
|
||||
[extruder]
|
||||
step_pin:gpio5
|
||||
dir_pin:gpio4
|
||||
enable_pin:!gpio10
|
||||
rotation_distance: 53.7 #22.6789511 #Bondtech 5mm Drive Gears
|
||||
gear_ratio: 1517:170
|
||||
microsteps: 16
|
||||
full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree
|
||||
nozzle_diameter: 0.400
|
||||
filament_diameter: 1.75
|
||||
min_temp: 0
|
||||
max_temp: 360
|
||||
min_extrude_temp: 175
|
||||
smooth_time: 0.000001
|
||||
heater_pin:gpio24
|
||||
sensor_type:MAX6675
|
||||
sensor_pin:gpio17
|
||||
spi_speed: 100000
|
||||
spi_software_sclk_pin:gpio18
|
||||
spi_software_mosi_pin:gpio19
|
||||
spi_software_miso_pin:gpio16
|
||||
max_power: 1
|
||||
|
||||
control : pid
|
||||
pid_Kp=33.555
|
||||
pid_Ki=4.76
|
||||
pid_Kd=59.141
|
||||
|
||||
pressure_advance: 0.032
|
||||
pressure_advance_smooth_time: 0.03
|
||||
max_extrude_cross_section:500
|
||||
instantaneous_corner_velocity: 10.000
|
||||
max_extrude_only_distance: 1000.0
|
||||
max_extrude_only_velocity:5000
|
||||
max_extrude_only_accel:2000
|
||||
step_pulse_duration:0.000002
|
||||
|
||||
[tmc2209 extruder]
|
||||
uart_pin:gpio6
|
||||
interpolate: True
|
||||
run_current: 0.714
|
||||
stealthchop_threshold: 0
|
||||
|
||||
[adxl345]
|
||||
cs_pin:gpio13
|
||||
spi_software_sclk_pin:gpio14
|
||||
spi_software_mosi_pin:gpio15
|
||||
spi_software_miso_pin:gpio12
|
||||
axes_map: -x, z, -y
|
||||
|
||||
[printer]
|
||||
kinematics:corexy
|
||||
max_velocity: 600
|
||||
max_accel: 20000
|
||||
max_accel_to_decel: 10000
|
||||
max_z_velocity: 10
|
||||
max_z_accel: 500
|
||||
square_corner_velocity: 8
|
||||
|
||||
[stepper_x]
|
||||
step_pin:U_1:PB4
|
||||
dir_pin:!U_1:PB3
|
||||
enable_pin:!U_1:PB5
|
||||
microsteps:16
|
||||
rotation_distance: 39.88
|
||||
full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
|
||||
endstop_pin:tmc2240_stepper_x:virtual_endstop
|
||||
position_min: -5.5
|
||||
position_endstop: -5.5
|
||||
position_max:246
|
||||
homing_speed:50
|
||||
homing_retract_dist:0
|
||||
homing_positive_dir:False
|
||||
step_pulse_duration:0.0000001
|
||||
|
||||
[stepper_y]
|
||||
step_pin:U_1:PC14
|
||||
dir_pin:!U_1:PC13
|
||||
enable_pin:!U_1:PC15
|
||||
microsteps: 16
|
||||
rotation_distance: 39.88
|
||||
full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
|
||||
endstop_pin:tmc2240_stepper_y:virtual_endstop
|
||||
position_min: -4.5
|
||||
position_endstop: -4.5
|
||||
position_max: 258
|
||||
homing_speed:50
|
||||
homing_retract_dist:0
|
||||
homing_positive_dir:False
|
||||
step_pulse_duration:0.0000001
|
||||
|
||||
[stepper_z]
|
||||
step_pin:U_1:PC10
|
||||
dir_pin:U_1:PA15
|
||||
enable_pin:!U_1:PC11
|
||||
microsteps: 128
|
||||
rotation_distance: 4
|
||||
full_steps_per_rotation: 200
|
||||
endstop_pin:probe:z_virtual_endstop #U_1:PC3 for Z-max
|
||||
endstop_pin_reverse:tmc2209_stepper_z:virtual_endstop
|
||||
position_endstop:-0.2
|
||||
position_endstop_reverse:248
|
||||
position_max:248
|
||||
position_min: -4
|
||||
homing_speed: 8
|
||||
homing_speed_reverse: 8
|
||||
second_homing_speed: 10
|
||||
homing_retract_dist: 5.0
|
||||
homing_positive_dir:false
|
||||
homing_positive_dir_reverse:true
|
||||
step_pulse_duration:0.0000001
|
||||
|
||||
[stepper_z1]
|
||||
step_pin:U_1:PB1
|
||||
dir_pin:U_1:PB6
|
||||
enable_pin:!U_1:PB0
|
||||
microsteps: 128
|
||||
rotation_distance: 4
|
||||
full_steps_per_rotation: 200
|
||||
step_pulse_duration:0.0000001
|
||||
endstop_pin_reverse:tmc2209_stepper_z1:virtual_endstop
|
||||
|
||||
[z_tilt]
|
||||
z_positions:
|
||||
-59,125
|
||||
307.5,125
|
||||
|
||||
points:
|
||||
0,125
|
||||
215,125
|
||||
|
||||
speed: 150
|
||||
horizontal_move_z: 5
|
||||
retries: 2
|
||||
retry_tolerance: 0.05
|
||||
|
||||
[tmc2240 stepper_y]
|
||||
cs_pin:U_1:PB9
|
||||
spi_software_sclk_pin:U_1:PA5
|
||||
spi_software_mosi_pin:U_1:PA7
|
||||
spi_software_miso_pin:U_1:PA6
|
||||
spi_speed:200000
|
||||
run_current: 1.07
|
||||
#hold_current: 0.5
|
||||
interpolate:true
|
||||
stealthchop_threshold:0
|
||||
diag0_pin:!U_1:PC0
|
||||
driver_SGT:1
|
||||
|
||||
[tmc2240 stepper_x]
|
||||
cs_pin:U_1:PD2
|
||||
spi_software_sclk_pin:U_1:PA5
|
||||
spi_software_mosi_pin:U_1:PA7
|
||||
spi_software_miso_pin:U_1:PA6
|
||||
spi_speed:200000
|
||||
run_current: 1.07
|
||||
#hold_current: 0.5
|
||||
interpolate:true
|
||||
stealthchop_threshold:0
|
||||
diag0_pin:!U_1:PB8
|
||||
driver_SGT:1
|
||||
|
||||
[tmc2209 stepper_z]
|
||||
uart_pin:U_1: PC5
|
||||
run_current: 0.6
|
||||
#hold_current: 0.17
|
||||
interpolate: True
|
||||
stealthchop_threshold: 9999999999
|
||||
diag_pin:^U_1:PC12
|
||||
driver_SGTHRS:130
|
||||
|
||||
[tmc2209 stepper_z1]
|
||||
uart_pin:U_1: PB7
|
||||
run_current: 0.6
|
||||
#hold_current: 0.17
|
||||
interpolate: True
|
||||
stealthchop_threshold: 9999999999
|
||||
diag_pin:^U_1:PA13
|
||||
driver_SGTHRS:130
|
||||
|
||||
[heater_bed]
|
||||
heater_pin: U_1:PB10
|
||||
sensor_type:NTC 100K MGB18-104F39050L32
|
||||
sensor_pin:U_1: PA0
|
||||
max_power: 1.0
|
||||
control = pid
|
||||
pid_Kp=63.418
|
||||
pid_Ki=1.342
|
||||
pid_Kd=749.125
|
||||
min_temp: -60
|
||||
max_temp: 125
|
||||
|
||||
[heater_generic chamber]
|
||||
heater_pin:U_1:PC8
|
||||
max_power:1.0
|
||||
sensor_type:NTC 100K MGB18-104F39050L32
|
||||
sensor_pin:U_1:PA1
|
||||
|
||||
control = pid#watermark
|
||||
pid_Kp=63.418
|
||||
pid_Ki=1.342
|
||||
pid_Kd=749.125
|
||||
|
||||
min_temp:-100
|
||||
max_temp:65
|
||||
|
||||
[verify_heater chamber]
|
||||
max_error: 300
|
||||
check_gain_time:480
|
||||
hysteresis: 5
|
||||
heating_gain: 1
|
||||
|
||||
[verify_heater extruder]
|
||||
max_error: 120
|
||||
check_gain_time:20
|
||||
hysteresis: 5
|
||||
heating_gain: 1
|
||||
|
||||
[verify_heater heater_bed]
|
||||
max_error: 200
|
||||
check_gain_time:60
|
||||
hysteresis: 5
|
||||
heating_gain: 1
|
||||
|
||||
[fan_generic auxiliary_cooling_fan]
|
||||
pin: U_1:PA8
|
||||
shutdown_speed: 0.0
|
||||
cycle_time: 0.0100
|
||||
hardware_pwm: false
|
||||
kick_start_time: 0.100
|
||||
off_below: 0.0
|
||||
|
||||
[fan_generic chamber_circulation_fan]
|
||||
pin:U_1:PC9
|
||||
shutdown_speed: 0.0
|
||||
cycle_time: 0.100
|
||||
hardware_pwm: false
|
||||
kick_start_time: 0.100
|
||||
off_below: 0.0
|
||||
|
||||
[chamber_fan chamber_fan]
|
||||
pin:U_1:PA4
|
||||
max_power: 1.0
|
||||
shutdown_speed: 0
|
||||
kick_start_time: 0.5
|
||||
heater:chamber
|
||||
fan_speed: 1.0
|
||||
off_below: 0
|
||||
idle_timeout:60
|
||||
idle_speed:1.0
|
||||
|
||||
[heater_fan hotend_fan]
|
||||
pin:gpio25
|
||||
max_power: 1.0
|
||||
shutdown_speed:1.0
|
||||
kick_start_time: 0.5
|
||||
heater: extruder
|
||||
heater_temp: 50.0
|
||||
fan_speed: 1.0
|
||||
off_below: 0
|
||||
|
||||
[heater_fan hotend_fan2]
|
||||
pin:gpio11
|
||||
max_power: 1.0
|
||||
shutdown_speed:1.0
|
||||
kick_start_time: 0.5
|
||||
heater: extruder
|
||||
heater_temp: 50.0
|
||||
fan_speed: 1.0
|
||||
off_below: 0
|
||||
|
||||
[controller_fan board_fan]
|
||||
pin:U_1:PC4
|
||||
max_power:1.0
|
||||
shutdown_speed:1.0
|
||||
cycle_time:0.01
|
||||
fan_speed: 0.6
|
||||
stepper:stepper_z,stepper_z1
|
||||
|
||||
[fan_generic cooling_fan]
|
||||
pin:gpio2
|
||||
max_power: 1.0
|
||||
shutdown_speed: 0
|
||||
cycle_time: 0.0100
|
||||
hardware_pwm: false
|
||||
kick_start_time: 0.100
|
||||
off_below: 0.0
|
||||
|
||||
[output_pin caselight]
|
||||
pin: U_1:PC7
|
||||
pwm: false
|
||||
shutdown_value:1
|
||||
value:1
|
||||
|
||||
[output_pin beeper]
|
||||
pin:U_1: PA2
|
||||
pwm: false
|
||||
shutdown_value:0
|
||||
value:0
|
||||
|
||||
[output_pin ctlyd]
|
||||
pin:U_1: PA14
|
||||
pwm: false
|
||||
shutdown_value:0
|
||||
value:0
|
||||
|
||||
[smart_effector]
|
||||
pin:U_1:PC1
|
||||
recovery_time:0
|
||||
x_offset: 17.6
|
||||
y_offset: 4.4
|
||||
z_offset: 0.000001
|
||||
speed:5
|
||||
lift_speed:5
|
||||
probe_accel:50
|
||||
samples: 2
|
||||
samples_result: submaxmin
|
||||
sample_retract_dist: 5.0
|
||||
samples_tolerance: 0.05
|
||||
samples_tolerance_retries:5
|
||||
|
||||
[qdprobe]
|
||||
pin:!gpio21
|
||||
z_offset:0.000001
|
||||
|
||||
[bed_mesh]
|
||||
speed:150
|
||||
horizontal_move_z:7
|
||||
mesh_min:20,15
|
||||
mesh_max:230,230
|
||||
probe_count:8,8
|
||||
algorithm:bicubic
|
||||
bicubic_tension:0.2
|
||||
mesh_pps: 2, 2
|
||||
vibrate_gcode:
|
||||
Z_DOUDONG
|
||||
|
||||
[filament_switch_sensor fila]
|
||||
pause_on_runout: True
|
||||
runout_gcode:
|
||||
M118 Filament tangle detected
|
||||
event_delay: 3.0
|
||||
pause_delay: 0.5
|
||||
switch_pin:U_1:PC3
|
||||
|
||||
[resonance_tester]
|
||||
accel_chip:adxl345
|
||||
probe_points:
|
||||
120, 120, 10
|
||||
|
||||
[gcode_macro_break]
|
||||
# Used for cancel print in a macro
|
||||
|
||||
[idle_timeout]
|
||||
timeout: 43200
|
||||
|
||||
[pause_resume]
|
||||
|
||||
[display_status]
|
||||
|
||||
[virtual_sdcard]
|
||||
path: ~/gcode_files
|
||||
|
||||
#*# <---------------------- SAVE_CONFIG ---------------------->
|
||||
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
|
||||
#*#
|
||||
#*# [input_shaper]
|
||||
#*# shaper_type_x = ei
|
||||
#*# shaper_freq_x = 81.6
|
||||
#*# shaper_type_y = ei
|
||||
#*# shaper_freq_y = 39.8
|
||||
#*#
|
||||
#*# [adxl345]
|
||||
#*# probe_pin = gpio9
|
||||
#*# int_pin = int1
|
||||
#*# tap_thresh = 3500
|
||||
#*# tap_dur = 0.01
|
||||
#*# speed = 20
|
||||
#*# z_offset = -0.1
|
||||
#*# samples = 3
|
||||
#*# sample_retract_dist = 10.0
|
||||
#*# samples_result = median
|
||||
#*# samples_tolerance = 0.05
|
||||
#*# samples_tolerance_retries = 3
|
||||
#*#
|
||||
#*# [bed_mesh default]
|
||||
#*# version = 1
|
||||
#*# points =
|
||||
#*# 0,0,0,0,0,0
|
||||
#*# 0,0,0,0,0,0
|
||||
#*# 0,0,0,0,0,0
|
||||
#*# 0,0,0,0,0,0
|
||||
#*# 0,0,0,0,0,0
|
||||
#*# 0,0,0,0,0,0
|
||||
#*# tension = 0.2
|
||||
#*# min_x = 20.0
|
||||
#*# algo = lagrange
|
||||
#*# y_count = 6
|
||||
#*# mesh_y_pps = 2
|
||||
#*# min_y = 10.0
|
||||
#*# x_count = 6
|
||||
#*# max_y = 230.0
|
||||
#*# mesh_x_pps = 2
|
||||
#*# max_x = 230.0
|
||||
#*#
|
||||
#*# [bed_mesh kamp]
|
||||
#*# version = 1
|
||||
#*# points =
|
||||
#*# 0, 0, 0
|
||||
#*# 0, 0, 0
|
||||
#*# 0, 0, 0
|
||||
#*# tension = 0.2
|
||||
#*# min_x = 86.05
|
||||
#*# algo = lagrange
|
||||
#*# y_count = 3
|
||||
#*# mesh_y_pps = 2
|
||||
#*# min_y = 86.05
|
||||
#*# x_count = 3
|
||||
#*# max_y = 158.95
|
||||
#*# mesh_x_pps = 2
|
||||
#*# max_x = 158.93
|
||||
11
config/saved_variables.cfg
Normal file
11
config/saved_variables.cfg
Normal file
@@ -0,0 +1,11 @@
|
||||
[Variables]
|
||||
bed_temp = 60.0
|
||||
filepath = ''
|
||||
hot_temp = 0.0
|
||||
last_file = ''
|
||||
power_resume_z = 0.0
|
||||
print_temp = 210.0
|
||||
profile_name = 'kamp'
|
||||
was_interrupted = False
|
||||
z_offset = 0.0
|
||||
|
||||
441
config/time_update.cfg
Normal file
441
config/time_update.cfg
Normal file
@@ -0,0 +1,441 @@
|
||||
[gcode_shell_command UPDATE_SYSTEM_TIME]
|
||||
command: bash /home/mks/scripts/time_update/time_update.sh
|
||||
timeout: 60
|
||||
|
||||
# Usage:
|
||||
# Run the following Gcode macro in fluidd console to update the printer system time
|
||||
#
|
||||
# RUN_SHELL_COMMAND CMD=UPDATE_SYSTEM_TIME PARAMS={TimeZone}
|
||||
#
|
||||
# Example:
|
||||
# RUN_SHELL_COMMAND CMD=UPDATE_SYSTEM_TIME PARAMS=Asia/Shanghai
|
||||
#
|
||||
# Internet connection needed
|
||||
#
|
||||
# Available TimeZones
|
||||
#
|
||||
# Africa/Abidjan
|
||||
# Africa/Accra
|
||||
# Africa/Addis_Ababa
|
||||
# Africa/Algiers
|
||||
# Africa/Asmara
|
||||
# Africa/Bamako
|
||||
# Africa/Bangui
|
||||
# Africa/Banjul
|
||||
# Africa/Bissau
|
||||
# Africa/Blantyre
|
||||
# Africa/Brazzaville
|
||||
# Africa/Bujumbura
|
||||
# Africa/Cairo
|
||||
# Africa/Casablanca
|
||||
# Africa/Ceuta
|
||||
# Africa/Conakry
|
||||
# Africa/Dakar
|
||||
# Africa/Dar_es_Salaam
|
||||
# Africa/Djibouti
|
||||
# Africa/Douala
|
||||
# Africa/El_Aaiun
|
||||
# Africa/Freetown
|
||||
# Africa/Gaborone
|
||||
# Africa/Harare
|
||||
# Africa/Johannesburg
|
||||
# Africa/Juba
|
||||
# Africa/Kampala
|
||||
# Africa/Khartoum
|
||||
# Africa/Kigali
|
||||
# Africa/Kinshasa
|
||||
# Africa/Lagos
|
||||
# Africa/Libreville
|
||||
# Africa/Lome
|
||||
# Africa/Luanda
|
||||
# Africa/Lubumbashi
|
||||
# Africa/Lusaka
|
||||
# Africa/Malabo
|
||||
# Africa/Maputo
|
||||
# Africa/Maseru
|
||||
# Africa/Mbabane
|
||||
# Africa/Mogadishu
|
||||
# Africa/Monrovia
|
||||
# Africa/Nairobi
|
||||
# Africa/Ndjamena
|
||||
# Africa/Niamey
|
||||
# Africa/Nouakchott
|
||||
# Africa/Ouagadougou
|
||||
# Africa/Porto-Novo
|
||||
# Africa/Sao_Tome
|
||||
# Africa/Tripoli
|
||||
# Africa/Tunis
|
||||
# Africa/Windhoek
|
||||
# America/Adak
|
||||
# America/Anchorage
|
||||
# America/Anguilla
|
||||
# America/Antigua
|
||||
# America/Araguaina
|
||||
# America/Argentina/Buenos_Aires
|
||||
# America/Argentina/Catamarca
|
||||
# America/Argentina/Cordoba
|
||||
# America/Argentina/Jujuy
|
||||
# America/Argentina/La_Rioja
|
||||
# America/Argentina/Mendoza
|
||||
# America/Argentina/Rio_Gallegos
|
||||
# America/Argentina/Salta
|
||||
# America/Argentina/San_Juan
|
||||
# America/Argentina/San_Luis
|
||||
# America/Argentina/Tucuman
|
||||
# America/Argentina/Ushuaia
|
||||
# America/Aruba
|
||||
# America/Asuncion
|
||||
# America/Atikokan
|
||||
# America/Bahia
|
||||
# America/Bahia_Banderas
|
||||
# America/Barbados
|
||||
# America/Belem
|
||||
# America/Belize
|
||||
# America/Blanc-Sablon
|
||||
# America/Boa_Vista
|
||||
# America/Bogota
|
||||
# America/Boise
|
||||
# America/Cambridge_Bay
|
||||
# America/Campo_Grande
|
||||
# America/Cancun
|
||||
# America/Caracas
|
||||
# America/Cayenne
|
||||
# America/Cayman
|
||||
# America/Chicago
|
||||
# America/Chihuahua
|
||||
# America/Costa_Rica
|
||||
# America/Creston
|
||||
# America/Cuiaba
|
||||
# America/Curacao
|
||||
# America/Danmarkshavn
|
||||
# America/Dawson
|
||||
# America/Dawson_Creek
|
||||
# America/Denver
|
||||
# America/Detroit
|
||||
# America/Dominica
|
||||
# America/Edmonton
|
||||
# America/Eirunepe
|
||||
# America/El_Salvador
|
||||
# America/Fort_Nelson
|
||||
# America/Fortaleza
|
||||
# America/Glace_Bay
|
||||
# America/Goose_Bay
|
||||
# America/Grand_Turk
|
||||
# America/Grenada
|
||||
# America/Guadeloupe
|
||||
# America/Guatemala
|
||||
# America/Guayaquil
|
||||
# America/Guyana
|
||||
# America/Halifax
|
||||
# America/Havana
|
||||
# America/Hermosillo
|
||||
# America/Indiana/Indianapolis
|
||||
# America/Indiana/Knox
|
||||
# America/Indiana/Marengo
|
||||
# America/Indiana/Petersburg
|
||||
# America/Indiana/Tell_City
|
||||
# America/Indiana/Vevay
|
||||
# America/Indiana/Vincennes
|
||||
# America/Indiana/Winamac
|
||||
# America/Inuvik
|
||||
# America/Iqaluit
|
||||
# America/Jamaica
|
||||
# America/Juneau
|
||||
# America/Kentucky/Louisville
|
||||
# America/Kentucky/Monticello
|
||||
# America/Kralendijk
|
||||
# America/La_Paz
|
||||
# America/Lima
|
||||
# America/Los_Angeles
|
||||
# America/Lower_Princes
|
||||
# America/Maceio
|
||||
# America/Managua
|
||||
# America/Manaus
|
||||
# America/Marigot
|
||||
# America/Martinique
|
||||
# America/Matamoros
|
||||
# America/Mazatlan
|
||||
# America/Menominee
|
||||
# America/Merida
|
||||
# America/Metlakatla
|
||||
# America/Mexico_City
|
||||
# America/Miquelon
|
||||
# America/Moncton
|
||||
# America/Monterrey
|
||||
# America/Montevideo
|
||||
# America/Montserrat
|
||||
# America/Nassau
|
||||
# America/New_York
|
||||
# America/Nipigon
|
||||
# America/Nome
|
||||
# America/Noronha
|
||||
# America/North_Dakota/Beulah
|
||||
# America/North_Dakota/Center
|
||||
# America/North_Dakota/New_Salem
|
||||
# America/Nuuk
|
||||
# America/Ojinaga
|
||||
# America/Panama
|
||||
# America/Pangnirtung
|
||||
# America/Paramaribo
|
||||
# America/Phoenix
|
||||
# America/Port-au-Prince
|
||||
# America/Port_of_Spain
|
||||
# America/Porto_Velho
|
||||
# America/Puerto_Rico
|
||||
# America/Punta_Arenas
|
||||
# America/Rainy_River
|
||||
# America/Rankin_Inlet
|
||||
# America/Recife
|
||||
# America/Regina
|
||||
# America/Resolute
|
||||
# America/Rio_Branco
|
||||
# America/Santarem
|
||||
# America/Santiago
|
||||
# America/Santo_Domingo
|
||||
# America/Sao_Paulo
|
||||
# America/Scoresbysund
|
||||
# America/Sitka
|
||||
# America/St_Barthelemy
|
||||
# America/St_Johns
|
||||
# America/St_Kitts
|
||||
# America/St_Lucia
|
||||
# America/St_Thomas
|
||||
# America/St_Vincent
|
||||
# America/Swift_Current
|
||||
# America/Tegucigalpa
|
||||
# America/Thule
|
||||
# America/Thunder_Bay
|
||||
# America/Tijuana
|
||||
# America/Toronto
|
||||
# America/Tortola
|
||||
# America/Vancouver
|
||||
# America/Whitehorse
|
||||
# America/Winnipeg
|
||||
# America/Yakutat
|
||||
# America/Yellowknife
|
||||
# Antarctica/Casey
|
||||
# Antarctica/Davis
|
||||
# Antarctica/DumontDUrville
|
||||
# Antarctica/Macquarie
|
||||
# Antarctica/Mawson
|
||||
# Antarctica/McMurdo
|
||||
# Antarctica/Palmer
|
||||
# Antarctica/Rothera
|
||||
# Antarctica/Syowa
|
||||
# Antarctica/Troll
|
||||
# Antarctica/Vostok
|
||||
# Arctic/Longyearbyen
|
||||
# Asia/Aden
|
||||
# Asia/Almaty
|
||||
# Asia/Amman
|
||||
# Asia/Anadyr
|
||||
# Asia/Aqtau
|
||||
# Asia/Aqtobe
|
||||
# Asia/Ashgabat
|
||||
# Asia/Atyrau
|
||||
# Asia/Baghdad
|
||||
# Asia/Bahrain
|
||||
# Asia/Baku
|
||||
# Asia/Bangkok
|
||||
# Asia/Barnaul
|
||||
# Asia/Beirut
|
||||
# Asia/Bishkek
|
||||
# Asia/Brunei
|
||||
# Asia/Chita
|
||||
# Asia/Choibalsan
|
||||
# Asia/Colombo
|
||||
# Asia/Damascus
|
||||
# Asia/Dhaka
|
||||
# Asia/Dili
|
||||
# Asia/Dubai
|
||||
# Asia/Dushanbe
|
||||
# Asia/Famagusta
|
||||
# Asia/Gaza
|
||||
# Asia/Hebron
|
||||
# Asia/Ho_Chi_Minh
|
||||
# Asia/Hong_Kong
|
||||
# Asia/Hovd
|
||||
# Asia/Irkutsk
|
||||
# Asia/Jakarta
|
||||
# Asia/Jayapura
|
||||
# Asia/Jerusalem
|
||||
# Asia/Kabul
|
||||
# Asia/Kamchatka
|
||||
# Asia/Karachi
|
||||
# Asia/Kathmandu
|
||||
# Asia/Khandyga
|
||||
# Asia/Kolkata
|
||||
# Asia/Krasnoyarsk
|
||||
# Asia/Kuala_Lumpur
|
||||
# Asia/Kuching
|
||||
# Asia/Kuwait
|
||||
# Asia/Macau
|
||||
# Asia/Magadan
|
||||
# Asia/Makassar
|
||||
# Asia/Manila
|
||||
# Asia/Muscat
|
||||
# Asia/Nicosia
|
||||
# Asia/Novokuznetsk
|
||||
# Asia/Novosibirsk
|
||||
# Asia/Omsk
|
||||
# Asia/Oral
|
||||
# Asia/Phnom_Penh
|
||||
# Asia/Pontianak
|
||||
# Asia/Pyongyang
|
||||
# Asia/Qatar
|
||||
# Asia/Qostanay
|
||||
# Asia/Qyzylorda
|
||||
# Asia/Riyadh
|
||||
# Asia/Sakhalin
|
||||
# Asia/Samarkand
|
||||
# Asia/Seoul
|
||||
# Asia/Shanghai
|
||||
# Asia/Singapore
|
||||
# Asia/Srednekolymsk
|
||||
# Asia/Taipei
|
||||
# Asia/Tashkent
|
||||
# Asia/Tbilisi
|
||||
# Asia/Tehran
|
||||
# Asia/Thimphu
|
||||
# Asia/Tokyo
|
||||
# Asia/Tomsk
|
||||
# Asia/Ulaanbaatar
|
||||
# Asia/Urumqi
|
||||
# Asia/Ust-Nera
|
||||
# Asia/Vientiane
|
||||
# Asia/Vladivostok
|
||||
# Asia/Yakutsk
|
||||
# Asia/Yangon
|
||||
# Asia/Yekaterinburg
|
||||
# Asia/Yerevan
|
||||
# Atlantic/Azores
|
||||
# Atlantic/Bermuda
|
||||
# Atlantic/Canary
|
||||
# Atlantic/Cape_Verde
|
||||
# Atlantic/Faroe
|
||||
# Atlantic/Madeira
|
||||
# Atlantic/Reykjavik
|
||||
# Atlantic/South_Georgia
|
||||
# Atlantic/St_Helena
|
||||
# Atlantic/Stanley
|
||||
# Australia/Adelaide
|
||||
# Australia/Brisbane
|
||||
# Australia/Broken_Hill
|
||||
# Australia/Darwin
|
||||
# Australia/Eucla
|
||||
# Australia/Hobart
|
||||
# Australia/Lindeman
|
||||
# Australia/Lord_Howe
|
||||
# Australia/Melbourne
|
||||
# Australia/Perth
|
||||
# Australia/Sydney
|
||||
# Europe/Amsterdam
|
||||
# Europe/Andorra
|
||||
# Europe/Astrakhan
|
||||
# Europe/Athens
|
||||
# Europe/Belgrade
|
||||
# Europe/Berlin
|
||||
# Europe/Bratislava
|
||||
# Europe/Brussels
|
||||
# Europe/Bucharest
|
||||
# Europe/Budapest
|
||||
# Europe/Busingen
|
||||
# Europe/Chisinau
|
||||
# Europe/Copenhagen
|
||||
# Europe/Dublin
|
||||
# Europe/Gibraltar
|
||||
# Europe/Guernsey
|
||||
# Europe/Helsinki
|
||||
# Europe/Isle_of_Man
|
||||
# Europe/Istanbul
|
||||
# Europe/Jersey
|
||||
# Europe/Kaliningrad
|
||||
# Europe/Kiev
|
||||
# Europe/Kirov
|
||||
# Europe/Lisbon
|
||||
# Europe/Ljubljana
|
||||
# Europe/London
|
||||
# Europe/Luxembourg
|
||||
# Europe/Madrid
|
||||
# Europe/Malta
|
||||
# Europe/Mariehamn
|
||||
# Europe/Minsk
|
||||
# Europe/Monaco
|
||||
# Europe/Moscow
|
||||
# Europe/Oslo
|
||||
# Europe/Paris
|
||||
# Europe/Podgorica
|
||||
# Europe/Prague
|
||||
# Europe/Riga
|
||||
# Europe/Rome
|
||||
# Europe/Samara
|
||||
# Europe/San_Marino
|
||||
# Europe/Sarajevo
|
||||
# Europe/Saratov
|
||||
# Europe/Simferopol
|
||||
# Europe/Skopje
|
||||
# Europe/Sofia
|
||||
# Europe/Stockholm
|
||||
# Europe/Tallinn
|
||||
# Europe/Tirane
|
||||
# Europe/Ulyanovsk
|
||||
# Europe/Uzhgorod
|
||||
# Europe/Vaduz
|
||||
# Europe/Vatican
|
||||
# Europe/Vienna
|
||||
# Europe/Vilnius
|
||||
# Europe/Volgograd
|
||||
# Europe/Warsaw
|
||||
# Europe/Zagreb
|
||||
# Europe/Zaporozhye
|
||||
# Europe/Zurich
|
||||
# Indian/Antananarivo
|
||||
# Indian/Chagos
|
||||
# Indian/Christmas
|
||||
# Indian/Cocos
|
||||
# Indian/Comoro
|
||||
# Indian/Kerguelen
|
||||
# Indian/Mahe
|
||||
# Indian/Maldives
|
||||
# Indian/Mauritius
|
||||
# Indian/Mayotte
|
||||
# Indian/Reunion
|
||||
# Pacific/Apia
|
||||
# Pacific/Auckland
|
||||
# Pacific/Bougainville
|
||||
# Pacific/Chatham
|
||||
# Pacific/Chuuk
|
||||
# Pacific/Easter
|
||||
# Pacific/Efate
|
||||
# Pacific/Enderbury
|
||||
# Pacific/Fakaofo
|
||||
# Pacific/Fiji
|
||||
# Pacific/Funafuti
|
||||
# Pacific/Galapagos
|
||||
# Pacific/Gambier
|
||||
# Pacific/Guadalcanal
|
||||
# Pacific/Guam
|
||||
# Pacific/Honolulu
|
||||
# Pacific/Kiritimati
|
||||
# Pacific/Kosrae
|
||||
# Pacific/Kwajalein
|
||||
# Pacific/Majuro
|
||||
# Pacific/Marquesas
|
||||
# Pacific/Midway
|
||||
# Pacific/Nauru
|
||||
# Pacific/Niue
|
||||
# Pacific/Norfolk
|
||||
# Pacific/Noumea
|
||||
# Pacific/Pago_Pago
|
||||
# Pacific/Palau
|
||||
# Pacific/Pitcairn
|
||||
# Pacific/Pohnpei
|
||||
# Pacific/Port_Moresby
|
||||
# Pacific/Rarotonga
|
||||
# Pacific/Saipan
|
||||
# Pacific/Tahiti
|
||||
# Pacific/Tarawa
|
||||
# Pacific/Tongatapu
|
||||
# Pacific/Wake
|
||||
# Pacific/Wallis
|
||||
# UTC
|
||||
424
config/timelapse.cfg
Normal file
424
config/timelapse.cfg
Normal file
@@ -0,0 +1,424 @@
|
||||
# Timelapse klipper macro definition
|
||||
#
|
||||
# Copyright (C) 2021 Christoph Frei <fryakatkop@gmail.com>
|
||||
# Copyright (C) 2021 Alex Zellner <alexander.zellner@googlemail.com>
|
||||
#
|
||||
# This file may be distributed under the terms of the GNU GPLv3 license
|
||||
#
|
||||
# Macro version 1.14
|
||||
#
|
||||
|
||||
##### DO NOT CHANGE ANY MACRO!!! #####
|
||||
|
||||
##########################################################################
|
||||
# #
|
||||
# GET_TIMELAPSE_SETUP: Print the Timelapse setup to console #
|
||||
# #
|
||||
##########################################################################
|
||||
|
||||
[gcode_macro GET_TIMELAPSE_SETUP]
|
||||
description: Print the Timelapse setup
|
||||
gcode:
|
||||
{% set tl = printer['gcode_macro TIMELAPSE_TAKE_FRAME'] %}
|
||||
{% set output_txt = ["Timelapse Setup:"] %}
|
||||
{% set _dummy = output_txt.append("enable: %s" % tl.enable) %}
|
||||
{% set _dummy = output_txt.append("park: %s" % tl.park.enable) %}
|
||||
{% if tl.park.enable %}
|
||||
{% set _dummy = output_txt.append("park position: %s time: %s s" % (tl.park.pos, tl.park.time)) %}
|
||||
{% set _dummy = output_txt.append("park cord x:%s y:%s dz:%s" % (tl.park.coord.x, tl.park.coord.y, tl.park.coord.dz)) %}
|
||||
{% set _dummy = output_txt.append("travel speed: %s mm/s" % tl.speed.travel) %}
|
||||
{% endif %}
|
||||
{% set _dummy = output_txt.append("fw_retract: %s" % tl.extruder.fw_retract) %}
|
||||
{% if not tl.extruder.fw_retract %}
|
||||
{% set _dummy = output_txt.append("retract: %s mm speed: %s mm/s" % (tl.extruder.retract, tl.speed.retract)) %}
|
||||
{% set _dummy = output_txt.append("extrude: %s mm speed: %s mm/s" % (tl.extruder.extrude, tl.speed.extrude)) %}
|
||||
{% endif %}
|
||||
{% set _dummy = output_txt.append("verbose: %s" % tl.verbose) %}
|
||||
{action_respond_info(output_txt|join("\n"))}
|
||||
|
||||
################################################################################################
|
||||
# #
|
||||
# Use _SET_TIMELAPSE_SETUP [ENABLE=value] [VERBOSE=value] [PARK_ENABLE=value] [PARK_POS=value] #
|
||||
# [PARK_TIME=value] [CUSTOM_POS_X=value] [CUSTOM_POS_Y=value] #
|
||||
# [CUSTOM_POS_DZ=value][TRAVEL_SPEED=value] [RETRACT_SPEED=value] #
|
||||
# [EXTRUDE_SPEED=value] [EXTRUDE_DISTANCE=value] #
|
||||
# [RETRACT_DISTANCE=value] [FW_RETRACT=value] #
|
||||
# #
|
||||
################################################################################################
|
||||
|
||||
[gcode_macro _SET_TIMELAPSE_SETUP]
|
||||
description: Set user parameters for timelapse
|
||||
gcode:
|
||||
{% set tl = printer['gcode_macro TIMELAPSE_TAKE_FRAME'] %}
|
||||
##### get min and max bed size #####
|
||||
{% set min = printer.toolhead.axis_minimum %}
|
||||
{% set max = printer.toolhead.axis_maximum %}
|
||||
{% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
|
||||
else False %}
|
||||
{% set park = {'min' : {'x': (min.x / 1.42)|round(3) if round_bed else min.x|round(3),
|
||||
'y': (min.y / 1.42)|round(3) if round_bed else min.y|round(3)},
|
||||
'max' : {'x': (max.x / 1.42)|round(3) if round_bed else max.x|round(3),
|
||||
'y': (max.y / 1.42)|round(3) if round_bed else max.y|round(3)},
|
||||
'center': {'x': (max.x-(max.x-min.x)/2)|round(3),
|
||||
'y': (max.y-(max.y-min.y)/2)|round(3)}} %}
|
||||
##### set new values #####
|
||||
{% if params.ENABLE %}
|
||||
{% if params.ENABLE|lower is in ['true', 'false'] %}
|
||||
SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=enable VALUE={True if params.ENABLE|lower == 'true' else False}
|
||||
{% else %}
|
||||
{action_raise_error("ENABLE=%s not supported. Allowed values are [True, False]" % params.ENABLE|capitalize)}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if params.VERBOSE %}
|
||||
{% if params.VERBOSE|lower is in ['true', 'false'] %}
|
||||
SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=verbose VALUE={True if params.VERBOSE|lower == 'true' else False}
|
||||
{% else %}
|
||||
{action_raise_error("VERBOSE=%s not supported. Allowed values are [True, False]" % params.VERBOSE|capitalize)}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if params.CUSTOM_POS_X %}
|
||||
{% if params.CUSTOM_POS_X|float >= min.x and params.CUSTOM_POS_X|float <= max.x %}
|
||||
{% set _dummy = tl.park.custom.update({'x':params.CUSTOM_POS_X|float|round(3)}) %}
|
||||
{% else %}
|
||||
{action_raise_error("CUSTOM_POS_X=%s must be within [%s - %s]" % (params.CUSTOM_POS_X, min.x, max.x))}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if params.CUSTOM_POS_Y %}
|
||||
{% if params.CUSTOM_POS_Y|float >= min.y and params.CUSTOM_POS_Y|float <= max.y %}
|
||||
{% set _dummy = tl.park.custom.update({'y':params.CUSTOM_POS_Y|float|round(3)}) %}
|
||||
{% else %}
|
||||
{action_raise_error("CUSTOM_POS_Y=%s must be within [%s - %s]" % (params.CUSTOM_POS_Y, min.y, max.y))}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if params.CUSTOM_POS_DZ %}
|
||||
{% if params.CUSTOM_POS_DZ|float >= min.z and params.CUSTOM_POS_DZ|float <= max.z %}
|
||||
{% set _dummy = tl.park.custom.update({'dz':params.CUSTOM_POS_DZ|float|round(3)}) %}
|
||||
{% else %}
|
||||
{action_raise_error("CUSTOM_POS_DZ=%s must be within [%s - %s]" % (params.CUSTOM_POS_DZ, min.z, max.z))}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if params.PARK_ENABLE %}
|
||||
{% if params.PARK_ENABLE|lower is in ['true', 'false'] %}
|
||||
{% set _dummy = tl.park.update({'enable':True if params.PARK_ENABLE|lower == 'true' else False}) %}
|
||||
{% else %}
|
||||
{action_raise_error("PARK_ENABLE=%s not supported. Allowed values are [True, False]" % params.PARK_ENABLE|capitalize)}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if params.PARK_POS %}
|
||||
{% if params.PARK_POS|lower is in ['center','front_left','front_right','back_left','back_right','custom','x_only','y_only'] %}
|
||||
{% set dic = {'center' : {'x': park.center.x , 'y': park.center.y , 'dz': 1 },
|
||||
'front_left' : {'x': park.min.x , 'y': park.min.y , 'dz': 0 },
|
||||
'front_right' : {'x': park.max.x , 'y': park.min.y , 'dz': 0 },
|
||||
'back_left' : {'x': park.min.x , 'y': park.max.y , 'dz': 0 },
|
||||
'back_right' : {'x': park.max.x , 'y': park.max.y , 'dz': 0 },
|
||||
'custom' : {'x': tl.park.custom.x, 'y': tl.park.custom.y, 'dz': tl.park.custom.dz},
|
||||
'x_only' : {'x': tl.park.custom.x, 'y': 'none' , 'dz': tl.park.custom.dz},
|
||||
'y_only' : {'x': 'none' , 'y': tl.park.custom.y, 'dz': tl.park.custom.dz}} %}
|
||||
{% set _dummy = tl.park.update({'pos':params.PARK_POS|lower}) %}
|
||||
{% set _dummy = tl.park.update({'coord':dic[tl.park.pos]}) %}
|
||||
{% else %}
|
||||
{action_raise_error("PARK_POS=%s not supported. Allowed values are [CENTER, FRONT_LEFT, FRONT_RIGHT, BACK_LEFT, BACK_RIGHT, CUSTOM, X_ONLY, Y_ONLY]"
|
||||
% params.PARK_POS|upper)}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if params.PARK_TIME %}
|
||||
{% if params.PARK_TIME|float >= 0.0 %}
|
||||
{% set _dummy = tl.park.update({'time':params.PARK_TIME|float|round(3)}) %}
|
||||
{% else %}
|
||||
{action_raise_error("PARK_TIME=%s must be a positive number" % params.PARK_TIME)}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=park VALUE="{tl.park}"
|
||||
{% if params.TRAVEL_SPEED %}
|
||||
{% if params.TRAVEL_SPEED|float > 0.0 %}
|
||||
{% set _dummy = tl.speed.update({'travel':params.TRAVEL_SPEED|float|round(3)}) %}
|
||||
{% else %}
|
||||
{action_raise_error("TRAVEL_SPEED=%s must be larger than 0" % params.TRAVEL_SPEED)}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if params.RETRACT_SPEED %}
|
||||
{% if params.RETRACT_SPEED|float > 0.0 %}
|
||||
{% set _dummy = tl.speed.update({'retract':params.RETRACT_SPEED|float|round(3)}) %}
|
||||
{% else %}
|
||||
{action_raise_error("RETRACT_SPEED=%s must be larger than 0" % params.RETRACT_SPEED)}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if params.EXTRUDE_SPEED %}
|
||||
{% if params.EXTRUDE_SPEED|float > 0.0 %}
|
||||
{% set _dummy = tl.speed.update({'extrude':params.EXTRUDE_SPEED|float|round(3)}) %}
|
||||
{% else %}
|
||||
{action_raise_error("EXTRUDE_SPEED=%s must be larger than 0" % params.EXTRUDE_SPEED)}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=speed VALUE="{tl.speed}"
|
||||
{% if params.EXTRUDE_DISTANCE %}
|
||||
{% if params.EXTRUDE_DISTANCE|float >= 0.0 %}
|
||||
{% set _dummy = tl.extruder.update({'extrude':params.EXTRUDE_DISTANCE|float|round(3)}) %}
|
||||
{% else %}
|
||||
{action_raise_error("EXTRUDE_DISTANCE=%s must be specified as positiv number" % params.EXTRUDE_DISTANCE)}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if params.RETRACT_DISTANCE %}
|
||||
{% if params.RETRACT_DISTANCE|float >= 0.0 %}
|
||||
{% set _dummy = tl.extruder.update({'retract':params.RETRACT_DISTANCE|float|round(3)}) %}
|
||||
{% else %}
|
||||
{action_raise_error("RETRACT_DISTANCE=%s must be specified as positiv number" % params.RETRACT_DISTANCE)}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if params.FW_RETRACT %}
|
||||
{% if params.FW_RETRACT|lower is in ['true', 'false'] %}
|
||||
{% if 'firmware_retraction' in printer.configfile.settings %}
|
||||
{% set _dummy = tl.extruder.update({'fw_retract': True if params.FW_RETRACT|lower == 'true' else False}) %}
|
||||
{% else %}
|
||||
{% set _dummy = tl.extruder.update({'fw_retract':False}) %}
|
||||
{% if params.FW_RETRACT|capitalize == 'True' %}
|
||||
{action_raise_error("[firmware_retraction] not defined in printer.cfg. Can not enable fw_retract")}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{action_raise_error("FW_RETRACT=%s not supported. Allowed values are [True, False]" % params.FW_RETRACT|capitalize)}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=extruder VALUE="{tl.extruder}"
|
||||
{% if printer.configfile.settings['gcode_macro pause'] is defined %}
|
||||
{% set _dummy = tl.macro.update({'pause': printer.configfile.settings['gcode_macro pause'].rename_existing}) %}
|
||||
{% endif %}
|
||||
{% if printer.configfile.settings['gcode_macro resume'] is defined %}
|
||||
{% set _dummy = tl.macro.update({'resume': printer.configfile.settings['gcode_macro resume'].rename_existing}) %}
|
||||
{% endif %}
|
||||
SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=macro VALUE="{tl.macro}"
|
||||
|
||||
##########################################################################
|
||||
# #
|
||||
# TIMELAPSE_TAKE_FRAME: take the next picture #
|
||||
# #
|
||||
##########################################################################
|
||||
|
||||
######################### definition #########################
|
||||
## enable: enable or disable the next frame. Valid inputs: [True, False]
|
||||
## takingframe: internal use. Valid inputs: [True, False]
|
||||
##
|
||||
## park.enable: enable or disable to park the head while taking a picture. Valid inputs: [True, False]
|
||||
## park.pos : used position for parking. Valid inputs: [center, front_left, front_right, back_left, back_right, custom, x_only, y_only]
|
||||
## park.time : used for the debug macro. Time in s
|
||||
## park.custom.x, park.custom.y: coordinates of the custom parkposition. Unit [mm]
|
||||
## park.custom.dz : custom z hop for the picture. Unit [mm]
|
||||
## park.coord : internal use
|
||||
##
|
||||
## extruder.fw_retract: enable disable fw retraction [True,False]
|
||||
## extruder.extrude : filament extruded at the end of park. Unit [mm]
|
||||
## extruder.retract : filament retract at the start of park. Unit [mm]
|
||||
##
|
||||
## speed.travel : used speed for travel from and to the park positon. Unit: [mm/min]
|
||||
## speed.retract: used speed for retract [mm/min]
|
||||
## speed.extrude: used speed for extrude [mm/min]
|
||||
##
|
||||
## verbose: Enable mesage output of TIMELAPSE_TAKE_FRAME
|
||||
##
|
||||
## restore.absolute.coordinates: internal use
|
||||
## restore.absolute.extrude : internal use
|
||||
## restore.speed : internal use
|
||||
## restore.e : internal use
|
||||
## restore.factor.speed : internal use
|
||||
## restore.factor.extrude : internal use
|
||||
##
|
||||
## macro.pause : internal use
|
||||
## macro.resume : internal use
|
||||
##
|
||||
## is_paused: internal use
|
||||
###############################################################
|
||||
[gcode_macro TIMELAPSE_TAKE_FRAME]
|
||||
description: Take Timelapse shoot
|
||||
variable_enable: False
|
||||
variable_takingframe: False
|
||||
variable_park: {'enable': False,
|
||||
'pos' : 'center',
|
||||
'time' : 0.1,
|
||||
'custom': {'x': 0, 'y': 0, 'dz': 0},
|
||||
'coord' : {'x': 0, 'y': 0, 'dz': 0}}
|
||||
variable_extruder: {'fw_retract': False,
|
||||
'retract': 1.0,
|
||||
'extrude': 1.0}
|
||||
variable_speed: {'travel': 100,
|
||||
'retract': 15,
|
||||
'extrude': 15}
|
||||
variable_verbose: True
|
||||
variable_restore: {'absolute': {'coordinates': True, 'extrude': True}, 'speed': 1500, 'e':0, 'factor': {'speed': 1.0, 'extrude': 1.0}}
|
||||
variable_macro: {'pause': 'PAUSE', 'resume': 'RESUME'}
|
||||
variable_is_paused: False
|
||||
gcode:
|
||||
{% set hyperlapse = True if params.HYPERLAPSE and params.HYPERLAPSE|lower =='true' else False %}
|
||||
{% if enable %}
|
||||
{% if (hyperlapse and printer['gcode_macro HYPERLAPSE'].run) or
|
||||
(not hyperlapse and not printer['gcode_macro HYPERLAPSE'].run) %}
|
||||
{% if park.enable %}
|
||||
{% set pos = {'x': 'X' + park.coord.x|string if park.pos != 'y_only' else '',
|
||||
'y': 'Y' + park.coord.y|string if park.pos != 'x_only' else '',
|
||||
'z': 'Z'+ [printer.gcode_move.gcode_position.z + park.coord.dz, printer.toolhead.axis_maximum.z]|min|string} %}
|
||||
{% set restore = {'absolute': {'coordinates': printer.gcode_move.absolute_coordinates,
|
||||
'extrude' : printer.gcode_move.absolute_extrude},
|
||||
'speed' : printer.gcode_move.speed,
|
||||
'e' : printer.gcode_move.gcode_position.e,
|
||||
'factor' : {'speed' : printer.gcode_move.speed_factor,
|
||||
'extrude': printer.gcode_move.extrude_factor}} %}
|
||||
SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=restore VALUE="{restore}"
|
||||
{% if not printer[printer.toolhead.extruder].can_extrude %}
|
||||
{% if verbose %}{action_respond_info("Timelapse: Warning, minimum extruder temperature not reached!")}{% endif %}
|
||||
{% else %}
|
||||
{% if extruder.fw_retract %}
|
||||
G10
|
||||
{% else %}
|
||||
M83 ; insure relative extrusion
|
||||
G0 E-{extruder.retract} F{speed.retract * 60}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=is_paused VALUE=True
|
||||
{macro.pause} ; execute the klipper PAUSE command
|
||||
SET_GCODE_OFFSET X=0 Y=0 ; this will insure that the head parks always at the same position in a multi setup
|
||||
G90 ; insure absolute move
|
||||
{% if "xyz" not in printer.toolhead.homed_axes %}
|
||||
{% if verbose %}{action_respond_info("Timelapse: Warning, axis not homed yet!")}{% endif %}
|
||||
{% else %}
|
||||
G0 {pos.x} {pos.y} {pos.z} F{speed.travel * 60}
|
||||
{% endif %}
|
||||
SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=takingframe VALUE=True
|
||||
UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_TAKE_FRAME DURATION=0.5
|
||||
M400
|
||||
{% endif %}
|
||||
_TIMELAPSE_NEW_FRAME HYPERLAPSE={hyperlapse}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if verbose %}{action_respond_info("Timelapse: disabled, take frame ignored")}{% endif %}
|
||||
{% endif %}
|
||||
|
||||
[gcode_macro _TIMELAPSE_NEW_FRAME]
|
||||
description: action call for timelapse shoot. must be a seperate macro
|
||||
gcode:
|
||||
{action_call_remote_method("timelapse_newframe",
|
||||
macropark=printer['gcode_macro TIMELAPSE_TAKE_FRAME'].park,
|
||||
hyperlapse=params.HYPERLAPSE)}
|
||||
|
||||
[delayed_gcode _WAIT_TIMELAPSE_TAKE_FRAME]
|
||||
gcode:
|
||||
{% set tl = printer['gcode_macro TIMELAPSE_TAKE_FRAME'] %}
|
||||
{% set factor = {'speed': printer.gcode_move.speed_factor, 'extrude': printer.gcode_move.extrude_factor} %}
|
||||
{% if tl.takingframe %}
|
||||
UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_TAKE_FRAME DURATION=0.5
|
||||
{% else %}
|
||||
{tl.macro.resume} VELOCITY={tl.speed.travel} ; execute the klipper RESUME command
|
||||
SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=is_paused VALUE=False
|
||||
{% if not printer[printer.toolhead.extruder].can_extrude %}
|
||||
{action_respond_info("Timelapse: Warning minimum extruder temperature not reached!")}
|
||||
{% else %}
|
||||
{% if tl.extruder.fw_retract %}
|
||||
G11
|
||||
{% else %}
|
||||
G0 E{tl.extruder.extrude} F{tl.speed.extrude * 60}
|
||||
G0 F{tl.restore.speed}
|
||||
{% if tl.restore.absolute.extrude %}
|
||||
M82
|
||||
G92 E{tl.restore.e}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if tl.restore.factor.speed != factor.speed %} M220 S{(factor.speed*100)|round(0)} {% endif %}
|
||||
{% if tl.restore.factor.extrude != factor.extrude %} M221 S{(factor.extrude*100)|round(0)} {% endif %}
|
||||
{% if not tl.restore.absolute.coordinates %} G91 {% endif %}
|
||||
{% endif %}
|
||||
|
||||
####################################################################################################
|
||||
# #
|
||||
# HYPERLAPSE: Starts or stops a Hyperlapse video #
|
||||
# Usage: HYPERLAPSE ACTION=START [CYCLE=time] starts a hyperlapse with cycle time (default 30 sec) #
|
||||
# HYPERLAPSE ACTION=STOP stops the hyperlapse recording #
|
||||
# #
|
||||
####################################################################################################
|
||||
|
||||
######################### definition #########################
|
||||
## cycle: cycle time in seconds
|
||||
## run: internal use [True/False]
|
||||
###############################################################
|
||||
[gcode_macro HYPERLAPSE]
|
||||
description: Start/Stop a hyperlapse recording
|
||||
variable_cycle: 0
|
||||
variable_run: False
|
||||
gcode:
|
||||
{% set cycle = params.CYCLE|default(30)|int %}
|
||||
{% if params.ACTION and params.ACTION|lower == 'start' %}
|
||||
{action_respond_info("Hyperlapse: frames started (Cycle %d sec)" % cycle)}
|
||||
SET_GCODE_VARIABLE MACRO=HYPERLAPSE VARIABLE=run VALUE=True
|
||||
SET_GCODE_VARIABLE MACRO=HYPERLAPSE VARIABLE=cycle VALUE={cycle}
|
||||
UPDATE_DELAYED_GCODE ID=_HYPERLAPSE_LOOP DURATION={cycle}
|
||||
TIMELAPSE_TAKE_FRAME HYPERLAPSE=True
|
||||
{% elif params.ACTION and params.ACTION|lower == 'stop' %}
|
||||
{% if run %}{action_respond_info("Hyperlapse: frames stopped")}{% endif %}
|
||||
SET_GCODE_VARIABLE MACRO=HYPERLAPSE VARIABLE=run VALUE=False
|
||||
UPDATE_DELAYED_GCODE ID=_HYPERLAPSE_LOOP DURATION=0
|
||||
{% else %}
|
||||
{action_raise_error("Hyperlapse: No valid input parameter
|
||||
Use:
|
||||
- HYPERLAPSE ACTION=START [CYCLE=time]
|
||||
- HYPERLAPSE ACTION=STOP")}
|
||||
{% endif %}
|
||||
|
||||
[delayed_gcode _HYPERLAPSE_LOOP]
|
||||
gcode:
|
||||
UPDATE_DELAYED_GCODE ID=_HYPERLAPSE_LOOP DURATION={printer["gcode_macro HYPERLAPSE"].cycle}
|
||||
TIMELAPSE_TAKE_FRAME HYPERLAPSE=True
|
||||
|
||||
##########################################################################
|
||||
# #
|
||||
# TIMELAPSE_RENDER: Render the video at print end #
|
||||
# #
|
||||
##########################################################################
|
||||
|
||||
######################### definition #########################
|
||||
## render: internal use. Valid inputs: [True, False]
|
||||
## run_identifier: internal use. Valid input [0 .. 3]
|
||||
###############################################################
|
||||
[gcode_macro TIMELAPSE_RENDER]
|
||||
description: Render Timelapse video and wait for the result
|
||||
variable_render: False
|
||||
variable_run_identifier: 0
|
||||
gcode:
|
||||
{action_respond_info("Timelapse: Rendering started")}
|
||||
{action_call_remote_method("timelapse_render", byrendermacro="True")}
|
||||
SET_GCODE_VARIABLE MACRO=TIMELAPSE_RENDER VARIABLE=render VALUE=True
|
||||
{printer.configfile.settings['gcode_macro pause'].rename_existing} ; execute the klipper PAUSE command
|
||||
UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_RENDER DURATION=0.5
|
||||
|
||||
[delayed_gcode _WAIT_TIMELAPSE_RENDER]
|
||||
gcode:
|
||||
{% set ri = printer['gcode_macro TIMELAPSE_RENDER'].run_identifier % 4 %}
|
||||
SET_GCODE_VARIABLE MACRO=TIMELAPSE_RENDER VARIABLE=run_identifier VALUE={ri + 1}
|
||||
{% if printer['gcode_macro TIMELAPSE_RENDER'].render %}
|
||||
M117 Rendering {['-','\\','|','/'][ri]}
|
||||
UPDATE_DELAYED_GCODE ID=_WAIT_TIMELAPSE_RENDER DURATION=0.5
|
||||
{% else %}
|
||||
{action_respond_info("Timelapse: Rendering finished")}
|
||||
M117
|
||||
{printer.configfile.settings['gcode_macro resume'].rename_existing} ; execute the klipper RESUME command
|
||||
{% endif %}
|
||||
|
||||
##########################################################################
|
||||
# #
|
||||
# TEST_STREAM_DELAY: Helper macro to find stream and park delay #
|
||||
# #
|
||||
##########################################################################
|
||||
|
||||
[gcode_macro TEST_STREAM_DELAY]
|
||||
description: Helper macro to find stream and park delay
|
||||
gcode:
|
||||
{% set min = printer.toolhead.axis_minimum %}
|
||||
{% set max = printer.toolhead.axis_maximum %}
|
||||
{% set act = printer.toolhead.position %}
|
||||
{% set tl = printer['gcode_macro TIMELAPSE_TAKE_FRAME'] %}
|
||||
{% if act.z > 5.0 %}
|
||||
G0 X{min.x + 5.0} F{tl.speed.travel|int * 60}
|
||||
G0 X{(max.x-min.x)/2}
|
||||
G4 P{tl.park.time|float * 1000}
|
||||
_TIMELAPSE_NEW_FRAME HYPERLAPSE=FALSE
|
||||
G0 X{max.x - 5.0}
|
||||
{% else %}
|
||||
{action_raise_error("Toolhead z %.3f to low. Please place head above z = 5.0" % act.z)}
|
||||
{% endif %}
|
||||
@@ -5,5 +5,6 @@
|
||||
#include "./MakerbaseShell.h"
|
||||
|
||||
std::string get_wlan0_ip();
|
||||
std::string get_eth0_ip();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -252,4 +252,11 @@ void *recevice_progress_handle(void *arg);
|
||||
|
||||
void refresh_page_auto_unload();
|
||||
|
||||
int get_mks_ethernet();
|
||||
void set_mks_ethernet(int target);
|
||||
|
||||
std::string hex_to_utf8(const std::string& hex);
|
||||
|
||||
void check_print_interrupted();
|
||||
|
||||
#endif
|
||||
|
||||
14
include/ui.h
14
include/ui.h
@@ -114,7 +114,7 @@
|
||||
#define TJC_PAGE_PRINT_ZOFFSET_SET_001 0x01
|
||||
#define TJC_PAGE_PRINT_ZOFFSET_SET_005 0x02
|
||||
#define TJC_PAGE_PRINT_ZOFFSET_SET_01 0x03
|
||||
#define TJC_PAGE_PRINT_ZOFFSET_SET_1 0x04
|
||||
#define TJC_PAGE_PRINT_ZOFFSET_SET_05 0x04
|
||||
#define TJC_PAGE_PRINT_ZOFFSET_UP 0x05
|
||||
#define TJC_PAGE_PRINT_ZOFFSET_DOWN 0x06
|
||||
#define TJC_PAGE_PRINT_ZOFFSET_PAUSE_RESUME 0x0a
|
||||
@@ -226,7 +226,7 @@
|
||||
#define TJC_PAGE_PRE_BED_CALIBRATION_SET_001 0x00
|
||||
#define TJC_PAGE_PRE_BED_CALIBRATION_SET_005 0x01
|
||||
#define TJC_PAGE_PRE_BED_CALIBRATION_SET_01 0x02
|
||||
#define TJC_PAGE_PRE_BED_CALIBRATION_SET_1 0x03
|
||||
#define TJC_PAGE_PRE_BED_CALIBRATION_SET_05 0x03
|
||||
#define TJC_PAGE_PRE_BED_CALIBRATION_UP 0x04
|
||||
#define TJC_PAGE_PRE_BED_CALIBRATION_DOWN 0x05
|
||||
#define TJC_PAGE_PRE_BED_CALIBRATION_ENTER 0x06
|
||||
@@ -380,6 +380,7 @@
|
||||
#define TJC_PAGE_SHOW_QR_BACK 0x01
|
||||
#define TJC_PAGE_SHOW_QR_WIFI 0x02
|
||||
#define TJC_PAGE_SHOW_QR_SET 0x03
|
||||
#define TJC_PAGE_SHOW_QR_ETHERNET 0x04
|
||||
|
||||
#define TJC_PAGE_SERVER_SET 82
|
||||
#define TJC_PAGE_SERVER_SET_REFRESH 0x00
|
||||
@@ -419,6 +420,15 @@
|
||||
|
||||
#define TJC_PAGE_INSTALLING 90
|
||||
|
||||
#define TJC_PAGE_AUTO_WARNING 91
|
||||
#define TJC_PAGE_AUTO_WARNING_YES 0x00
|
||||
|
||||
#define TJC_PAGE_CALIBRATE_WARNING 92
|
||||
#define TJC_PAGE_CALIBRATE_WARNING_NEXT 0x00
|
||||
#define TJC_PAGE_CALIBRATE_WARNING_BACK 0x01
|
||||
|
||||
#define TJC_PAGE_RE_PRINTING 93
|
||||
|
||||
void parse_cmd_msg_from_tjc_screen(char *cmd);
|
||||
void page_to(int page_id);
|
||||
void tjc_event_clicked_handler(int page_id, int widget_id, int type_id);
|
||||
|
||||
37
main.cpp
37
main.cpp
@@ -1,5 +1,6 @@
|
||||
#include <fstream>
|
||||
|
||||
|
||||
#include <wpa_ctrl.h>
|
||||
|
||||
#include "include/MakerbaseClient.h"
|
||||
@@ -129,6 +130,39 @@ int main(int argc, char** argv) {
|
||||
system("bash /home/mks/gcode_files/sda1/mks-super.sh");
|
||||
}
|
||||
}
|
||||
|
||||
//4.4.15 CCW 添加开机检测c_helper.so文件
|
||||
const char *sourceFile = "/home/mks/klipper/klippy/chelper/c_helper.so";
|
||||
const char *destFile = "/root/etc/c_helper.so";
|
||||
|
||||
std::ifstream file(sourceFile, std::ifstream::binary | std::ifstream::ate);
|
||||
long size = 0;
|
||||
|
||||
if (!file) {
|
||||
std::printf("File does not exist or could not open file: %s\n", sourceFile);
|
||||
size = -1;
|
||||
} else {
|
||||
size = file.tellg();
|
||||
}
|
||||
file.close();
|
||||
|
||||
// 检查c_helper.so文件是否正常
|
||||
if (size < 10240) {
|
||||
std::printf("File %s does not exist or is less than 10KB\n", sourceFile);
|
||||
|
||||
std::ifstream src(destFile, std::ios::binary);
|
||||
std::ofstream dst(sourceFile, std::ios::binary);
|
||||
|
||||
if (!src || !dst) {
|
||||
std::printf("Failed to open source or destination file\n");
|
||||
} else {
|
||||
dst << src.rdbuf(); // Copy file content
|
||||
std::printf("File %s has been replaced with %s\n", sourceFile, destFile);
|
||||
}
|
||||
} else {
|
||||
std::printf("File %s exists and is not less than 10KB, no action taken\n", sourceFile);
|
||||
}
|
||||
|
||||
// pthread_t monitor_thread;
|
||||
// pthread_t monitor_C3_thread;
|
||||
pthread_t wpa_recv_thread;
|
||||
@@ -148,7 +182,6 @@ int main(int argc, char** argv) {
|
||||
std::string host = "localhost";
|
||||
std::string url = "ws://localhost:7125/websocket?";
|
||||
MKSLOG("%s", url.data());
|
||||
MKSLOG_RED("TEST");
|
||||
|
||||
if (argc == 2) {
|
||||
host = argv[1];
|
||||
@@ -207,7 +240,7 @@ int main(int argc, char** argv) {
|
||||
mks_get_version();
|
||||
sleep(3);
|
||||
|
||||
send_cmd_val(tty_fd, "logo.version", "14"); // CLL 检测UI与SOC版本是否匹配4.4.14版本输出标记数字为14
|
||||
send_cmd_val(tty_fd, "logo.version", "19"); // CLL 检测UI与SOC版本是否匹配4.4.19版本输出标记数字为19
|
||||
if (find_screen_tft_file == false) {
|
||||
previous_page_id = TJC_PAGE_LOGO;
|
||||
if (get_mks_oobe_enabled() == true) {
|
||||
|
||||
@@ -7,3 +7,11 @@ std::string get_wlan0_ip() {
|
||||
printf("%s", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string get_eth0_ip() {
|
||||
char result[MAX_FILE_LEN] = {0};
|
||||
std::string cmd = "ifconfig eth0 | awk 'NR==2{print $2}' | tr -d '\n\r'";
|
||||
execute_cmd(cmd.data(), result);
|
||||
printf("%s", result);
|
||||
return result;
|
||||
}
|
||||
@@ -501,9 +501,11 @@ int parse_scan_results(char* scan_results) {
|
||||
level_list.clear();
|
||||
ssid_list.clear();
|
||||
|
||||
char* lines[1024] = {0};
|
||||
char buffer[4096];
|
||||
strcpy(buffer, scan_results);
|
||||
char* lines[128] = {0};
|
||||
int num_lines = 0;
|
||||
char* line = strtok(scan_results, "\n");
|
||||
char* line = strtok(buffer, "\n");
|
||||
while (line != NULL) {
|
||||
lines[num_lines++] = line;
|
||||
line = strtok(NULL, "\n");
|
||||
@@ -513,7 +515,7 @@ int parse_scan_results(char* scan_results) {
|
||||
char* fields[5] = {0};
|
||||
int num_fields = 0;
|
||||
|
||||
char ssid_line[128] = {0};
|
||||
char ssid_line[256] = {0};
|
||||
memset(ssid_line, 0x00, sizeof(ssid_line));
|
||||
strcpy(ssid_line, lines[i]);
|
||||
int ssid_line_index = 0;
|
||||
@@ -533,8 +535,8 @@ int parse_scan_results(char* scan_results) {
|
||||
printf("Invalid scan result: %s\n", lines[i]);
|
||||
continue;
|
||||
} else {
|
||||
unsigned char ssid_name[64];
|
||||
printf_decode(ssid_name, 64, ssid_line + ssid_line_index);
|
||||
unsigned char ssid_name[192];
|
||||
printf_decode(ssid_name, 192, ssid_line + ssid_line_index);
|
||||
if (ssid_name[0] == '\x00') {
|
||||
|
||||
} else {
|
||||
|
||||
306
src/event.cpp
306
src/event.cpp
@@ -38,6 +38,7 @@
|
||||
#include "../include/MakerbasePanel.h"
|
||||
#include "../include/MakerbaseParseIni.h"
|
||||
#include "../include/MakerbaseWiFi.h"
|
||||
#include "../include/MakerbaseNetwork.h"
|
||||
#include "../include/ui.h"
|
||||
#include "../include/send_jpg.h"
|
||||
|
||||
@@ -363,6 +364,8 @@ extern std::string thumbnail_path;
|
||||
|
||||
extern bool cache_clicked;
|
||||
|
||||
int unhomed_move_mode = 0; // CLL 用于保存上次按下的移动按钮,当触发需先归位操作时进行移动, 1(x up),2(x down),3(y up),4(y down),5(z up),6(z down)
|
||||
|
||||
// CLL 以下变量用于修复gcode响应函数和refresh函数之间的冲突(gcode响应函数需设置变量在refresh_page_show中统一改变页面,否则会产生冲突)
|
||||
bool jump_to_move_pop_1 = false;
|
||||
bool jump_to_move_pop_2 = false;
|
||||
@@ -393,6 +396,8 @@ bool open_qr_refreshed = false; // CLL 第一次开机刷新时不使用脚本
|
||||
extern bool qr_refreshed;
|
||||
bool open_reprint_asked = false; // CLL 开机后进入主页面发出检测断电续打指令
|
||||
|
||||
int mks_ethernet;
|
||||
|
||||
/* 更新页面处理 */
|
||||
void refresh_page_show() {
|
||||
// CLL 以下if检测函数为无条件跳转,其在改变为true之前已经经过函数判断(跳转页面前需将对应变量置为false,否则会陷入死循环)
|
||||
@@ -401,6 +406,42 @@ void refresh_page_show() {
|
||||
page_to(TJC_PAGE_MOVE_POP_1);
|
||||
}
|
||||
if (jump_to_move_pop_2 == true) {
|
||||
switch (unhomed_move_mode)
|
||||
{
|
||||
case 1: // X_UP
|
||||
ep->Send(json_run_a_gcode("SET_KINEMATIC_POSITION Z=150\nSET_KINEMATIC_POSITION X=150\nSET_KINEMATIC_POSITION Y=150\n"));
|
||||
ep->Send(json_run_a_gcode("G91\nG1 X10 F3000\nG90\nM84\n"));
|
||||
break;
|
||||
|
||||
case 2: // X_DOWN
|
||||
ep->Send(json_run_a_gcode("SET_KINEMATIC_POSITION Z=150\nSET_KINEMATIC_POSITION X=150\nSET_KINEMATIC_POSITION Y=150\n"));
|
||||
ep->Send(json_run_a_gcode("G91\nG1 X-10 F3000\nG90\nM84\n"));
|
||||
break;
|
||||
|
||||
case 3: // Y_UP
|
||||
ep->Send(json_run_a_gcode("SET_KINEMATIC_POSITION Z=150\nSET_KINEMATIC_POSITION X=150\nSET_KINEMATIC_POSITION Y=150\n"));
|
||||
ep->Send(json_run_a_gcode("G91\nG1 Y10 F3000\nG90\nM84\n"));
|
||||
break;
|
||||
|
||||
case 4: // Y_DOWN
|
||||
ep->Send(json_run_a_gcode("SET_KINEMATIC_POSITION Z=150\nSET_KINEMATIC_POSITION X=150\nSET_KINEMATIC_POSITION Y=150\n"));
|
||||
ep->Send(json_run_a_gcode("G91\nG1 Y-10 F3000\nG90\nM84\n"));
|
||||
break;
|
||||
|
||||
case 5: // Z_UP
|
||||
ep->Send(json_run_a_gcode("SET_KINEMATIC_POSITION Z=150\nSET_KINEMATIC_POSITION X=150\nSET_KINEMATIC_POSITION Y=150\n"));
|
||||
ep->Send(json_run_a_gcode("G91\nG1 Z-10 F600\nG90\nM84\n"));
|
||||
break;
|
||||
|
||||
case 6: // Z_DOWN
|
||||
ep->Send(json_run_a_gcode("SET_KINEMATIC_POSITION Z=150\nSET_KINEMATIC_POSITION X=150\nSET_KINEMATIC_POSITION Y=150\n"));
|
||||
ep->Send(json_run_a_gcode("G91\nG1 Z10 F600\nG90\nM84\n"));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
unhomed_move_mode = 0;
|
||||
jump_to_move_pop_2 = false;
|
||||
page_to(TJC_PAGE_MOVE_POP_2);
|
||||
}
|
||||
@@ -751,7 +792,7 @@ void refresh_page_auto_level() {
|
||||
send_cmd_picc2(tty_fd, "b1", "115");
|
||||
send_cmd_picc2(tty_fd, "b2", "116");
|
||||
send_cmd_picc2(tty_fd, "b3", "115");
|
||||
} else if (auto_level_dist == (float)1) {
|
||||
} else if (auto_level_dist == (float)0.5) {
|
||||
send_cmd_picc(tty_fd, "b0", "114");
|
||||
send_cmd_picc(tty_fd, "b1", "114");
|
||||
send_cmd_picc(tty_fd, "b2", "114");
|
||||
@@ -784,6 +825,7 @@ void refresh_page_syntony_move() {
|
||||
if (step_1 == true) {
|
||||
sleep(15);
|
||||
page_to(TJC_PAGE_SYNTONY_FINISH);
|
||||
step_1 = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -851,6 +893,7 @@ void refresh_page_auto_finish() {
|
||||
}
|
||||
|
||||
void refresh_page_auto_moving() {
|
||||
send_cmd_txt(tty_fd, "t5", "(" + std::to_string(printer_heater_bed_temperature) + "/" + std::to_string(printer_heater_bed_target) + ")");
|
||||
if (step_1 == true) {
|
||||
send_cmd_picc(tty_fd, "q0", "109");
|
||||
send_cmd_pco(tty_fd, "t1", "65535");
|
||||
@@ -948,6 +991,44 @@ void refresh_page_printing_zoffset() {
|
||||
send_cmd_txt(tty_fd, "t1", show_time(get_cal_printing_time((int)(printer_print_stats_print_duration), file_metadata_estimated_time, printer_display_status_progress)));
|
||||
send_cmd_val(tty_fd, "j0", std::to_string(printer_display_status_progress));
|
||||
|
||||
if (printer_set_offset == (float)0.01) {
|
||||
send_cmd_picc(tty_fd, "b1", std::to_string(57));
|
||||
send_cmd_picc2(tty_fd, "b1", std::to_string(60));
|
||||
send_cmd_picc(tty_fd, "b2", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b2", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b3", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b3", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b4", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b4", std::to_string(59));
|
||||
} else if (printer_set_offset == (float)0.05) {
|
||||
send_cmd_picc(tty_fd, "b1", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b1", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b2", std::to_string(57));
|
||||
send_cmd_picc2(tty_fd, "b2", std::to_string(60));
|
||||
send_cmd_picc(tty_fd, "b3", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b3", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b4", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b4", std::to_string(59));
|
||||
} else if (printer_set_offset == (float)0.1) {
|
||||
send_cmd_picc(tty_fd, "b1", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b1", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b2", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b2", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b3", std::to_string(57));
|
||||
send_cmd_picc2(tty_fd, "b3", std::to_string(60));
|
||||
send_cmd_picc(tty_fd, "b4", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b4", std::to_string(59));
|
||||
} else if (printer_set_offset == (float)0.5) {
|
||||
send_cmd_picc(tty_fd, "b1", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b1", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b2", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b2", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b3", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b3", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b4", std::to_string(57));
|
||||
send_cmd_picc2(tty_fd, "b4", std::to_string(60));
|
||||
}
|
||||
|
||||
if (printer_print_stats_state == "printing") {
|
||||
printer_ready = true;
|
||||
}
|
||||
@@ -995,44 +1076,6 @@ void refresh_page_printing_zoffset() {
|
||||
clear_previous_data();
|
||||
send_cmd_txt(tty_fd , "t0", "gcode error:" + error_message);
|
||||
}
|
||||
|
||||
if (printer_set_offset == (float)0.01) {
|
||||
send_cmd_picc(tty_fd, "b1", std::to_string(57));
|
||||
send_cmd_picc2(tty_fd, "b1", std::to_string(60));
|
||||
send_cmd_picc(tty_fd, "b2", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b2", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b3", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b3", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b4", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b4", std::to_string(59));
|
||||
} else if (printer_set_offset == (float)0.05) {
|
||||
send_cmd_picc(tty_fd, "b1", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b1", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b2", std::to_string(57));
|
||||
send_cmd_picc2(tty_fd, "b2", std::to_string(60));
|
||||
send_cmd_picc(tty_fd, "b3", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b3", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b4", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b4", std::to_string(59));
|
||||
} else if (printer_set_offset == (float)0.1) {
|
||||
send_cmd_picc(tty_fd, "b1", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b1", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b2", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b2", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b3", std::to_string(57));
|
||||
send_cmd_picc2(tty_fd, "b3", std::to_string(60));
|
||||
send_cmd_picc(tty_fd, "b4", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b4", std::to_string(59));
|
||||
} else if (printer_set_offset == (float)1) {
|
||||
send_cmd_picc(tty_fd, "b1", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b1", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b2", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b2", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b3", std::to_string(58));
|
||||
send_cmd_picc2(tty_fd, "b3", std::to_string(59));
|
||||
send_cmd_picc(tty_fd, "b4", std::to_string(57));
|
||||
send_cmd_picc2(tty_fd, "b4", std::to_string(60));
|
||||
}
|
||||
}
|
||||
|
||||
void refresh_page_printing() {
|
||||
@@ -1487,7 +1530,7 @@ void refresh_page_main() {
|
||||
|
||||
// CLL 每次开机发送断电续打
|
||||
if (open_reprint_asked == false) {
|
||||
ep->Send(json_run_a_gcode("KINEMATIC_POSITION\n"));
|
||||
check_print_interrupted();
|
||||
open_reprint_asked = true;
|
||||
}
|
||||
}
|
||||
@@ -1630,7 +1673,7 @@ void set_heater_bed_target(int target) {
|
||||
}
|
||||
|
||||
void set_hot_target(int target) {
|
||||
set_target("chamber", target);
|
||||
ep->Send(json_run_a_gcode("M141 S" + std::to_string(target)));
|
||||
}
|
||||
|
||||
void set_fan(int speed) {
|
||||
@@ -1655,6 +1698,13 @@ void set_intern_zoffset(float offset) {
|
||||
}
|
||||
|
||||
void set_zoffset(bool positive) {
|
||||
// std::string command;
|
||||
// if (positive) {
|
||||
// command = "curl -s -X POST http://127.0.0.1:7125/printer/modifybabystep?ADJUST=" + std::to_string(printer_set_offset);
|
||||
// } else {
|
||||
// command = "curl -s -X POST http://127.0.0.1:7125/printer/modifybabystep?ADJUST=-" + std::to_string(printer_set_offset);
|
||||
// }
|
||||
// system(command.c_str());
|
||||
if (positive == true) {
|
||||
ep->Send(json_run_a_gcode("SET_GCODE_OFFSET Z_ADJUST=+" + std::to_string(printer_set_offset) + " MOVE=1"));
|
||||
} else {
|
||||
@@ -1685,26 +1735,32 @@ void move_home() {
|
||||
|
||||
void move_x_decrease() {
|
||||
ep->Send(move(AXIS_X, "-" + std::to_string(printer_move_dist), 130));
|
||||
unhomed_move_mode = 2;
|
||||
}
|
||||
|
||||
void move_x_increase() {
|
||||
ep->Send(move(AXIS_X, "+" + std::to_string(printer_move_dist), 130));
|
||||
unhomed_move_mode = 1;
|
||||
}
|
||||
|
||||
void move_y_decrease() {
|
||||
ep->Send(move(AXIS_Y, "-" + std::to_string(printer_move_dist), 130));
|
||||
unhomed_move_mode = 4;
|
||||
}
|
||||
|
||||
void move_y_increase() {
|
||||
ep->Send(move(AXIS_Y, "+" + std::to_string(printer_move_dist), 130));
|
||||
unhomed_move_mode = 3;
|
||||
}
|
||||
|
||||
void move_z_decrease() {
|
||||
ep->Send(move(AXIS_Z, "-" + std::to_string(printer_move_dist), 10));
|
||||
unhomed_move_mode = 5;
|
||||
}
|
||||
|
||||
void move_z_increase() {
|
||||
ep->Send(move(AXIS_Z, "+" + std::to_string(printer_move_dist), 10));
|
||||
unhomed_move_mode = 6;
|
||||
}
|
||||
|
||||
bool get_filament_detected() {
|
||||
@@ -1737,6 +1793,8 @@ void set_print_resume() {
|
||||
|
||||
void cancel_print() {
|
||||
printer_print_stats_filename = "";
|
||||
system("curl -X POST http://127.0.0.1:7125/printer/breakmacro");
|
||||
system("curl -X POST http://127.0.0.1:7125/printer/breakheater");
|
||||
ep->Send(json_run_a_gcode("CANCEL_PRINT"));
|
||||
int printed_minutes = get_cal_printed_time((int)(printer_print_stats_print_duration));
|
||||
get_mks_total_printed_time();
|
||||
@@ -1827,10 +1885,18 @@ void move_home_tips() {
|
||||
}
|
||||
|
||||
void filament_tips() {
|
||||
if (current_page_id == TJC_PAGE_PRINT_FILAMENT) {
|
||||
switch (current_page_id)
|
||||
{
|
||||
case TJC_PAGE_OPEN_FILAMENTVIDEO_3:
|
||||
break;
|
||||
|
||||
case TJC_PAGE_PRINT_FILAMENT:
|
||||
jump_to_print_low_temp = true;
|
||||
} else {
|
||||
break;
|
||||
|
||||
default:
|
||||
jump_to_filament_pop_1 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2063,7 +2129,19 @@ void go_to_reset() {
|
||||
if (printer_webhooks_state == "shutdown") {
|
||||
page_to(TJC_PAGE_RESET);
|
||||
} else {
|
||||
std::ifstream infile("/dev_info.txt");
|
||||
if (!infile) {
|
||||
std::cerr << "无法打开文件 " << "/dev_info.txt" << std::endl;
|
||||
return;
|
||||
}
|
||||
std::stringstream buffer;
|
||||
buffer << infile.rdbuf();
|
||||
std::string machine_type = buffer.str();
|
||||
infile.close();
|
||||
machine_type = machine_type.substr(machine_type.find("@") + 1);
|
||||
page_to(TJC_PAGE_SYS_OK);
|
||||
std::cout << "machine_type:" << machine_type << std::endl;
|
||||
send_cmd_txt(tty_fd, "t2", machine_type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2082,7 +2160,7 @@ void go_to_network() {
|
||||
scan_ssid_and_show();
|
||||
get_wlan0_status();
|
||||
if (strcmp(status_result.wpa_state, "COMPLETED") == 0) {
|
||||
current_connected_ssid_name = status_result.ssid; // 如果已经连接wifi,获取wifi的名字
|
||||
current_connected_ssid_name = hex_to_utf8(status_result.ssid); // 如果已经连接wifi,获取wifi的名字
|
||||
} else if (strcmp(status_result.wpa_state, "INACTIVE")) {
|
||||
current_connected_ssid_name.clear(); // 如果没连接wifi,清除掉当前已连接wifi的名字
|
||||
}
|
||||
@@ -2092,12 +2170,16 @@ void go_to_network() {
|
||||
}
|
||||
|
||||
void scan_ssid_and_show() {
|
||||
get_wlan0_status();
|
||||
mks_wpa_scan_scanresults();
|
||||
get_ssid_list_pages();
|
||||
page_wifi_current_pages = 0;
|
||||
set_page_wifi_ssid_list(page_wifi_current_pages);
|
||||
refresh_page_wifi_list();
|
||||
if (access("/var/run/wpa_supplicant/wlan0", F_OK) == 0){
|
||||
get_wlan0_status();
|
||||
mks_wpa_scan_scanresults();
|
||||
get_ssid_list_pages();
|
||||
page_wifi_current_pages = 0;
|
||||
set_page_wifi_ssid_list(page_wifi_current_pages);
|
||||
refresh_page_wifi_list();
|
||||
} else {
|
||||
page_to(TJC_PAGE_INTERNET);
|
||||
}
|
||||
}
|
||||
|
||||
void refresh_page_wifi_list() {
|
||||
@@ -2106,7 +2188,7 @@ void refresh_page_wifi_list() {
|
||||
if (0 == page_wifi_current_pages) {
|
||||
if (0 == i) {
|
||||
if (strcmp(status_result.wpa_state, "COMPLETED") == 0) {
|
||||
send_cmd_txt(tty_fd, "t" + std::to_string(i+1), status_result.ssid);
|
||||
send_cmd_txt(tty_fd, "t" + std::to_string(i+1), hex_to_utf8(status_result.ssid));
|
||||
} else {
|
||||
send_cmd_txt(tty_fd, "t" + std::to_string(i+1), page_wifi_ssid_list[i]);
|
||||
}
|
||||
@@ -2284,6 +2366,7 @@ void init_mks_status() {
|
||||
get_mks_total_printed_time();
|
||||
get_mks_babystep();
|
||||
get_mks_connection_method();
|
||||
get_mks_ethernet();
|
||||
// 不再使用xindi获取zoffset
|
||||
// printer_set_babystep();
|
||||
/*
|
||||
@@ -2458,7 +2541,10 @@ void level_mode_printing_print_file() {
|
||||
}
|
||||
|
||||
void update_finished_tips() {
|
||||
page_to(TJC_PAGE_UPDATE_FINISH);
|
||||
// page_to(TJC_PAGE_UPDATE_FINISH);
|
||||
sleep(5);
|
||||
system("sync");
|
||||
system("systemctl restart makerbase-client.service");
|
||||
}
|
||||
|
||||
bool get_mks_oobe_enabled() {
|
||||
@@ -2847,6 +2933,7 @@ void bed_calibrate() {
|
||||
if (manual_count == 4) {
|
||||
bed_offset = 0;
|
||||
printer_idle_timeout_state = "Printing";
|
||||
ep->Send(json_run_a_gcode("ABORT\n"));
|
||||
ep->Send(json_run_a_gcode("M4030"));
|
||||
page_to(TJC_PAGE_BED_MOVING);
|
||||
}else if (manual_count == 3) {
|
||||
@@ -3012,8 +3099,12 @@ void print_log() {
|
||||
page_to(TJC_PAGE_PRINT_LOG_F); // CLL 若U盘未插入,提示导出失败,请客户检查U盘插入
|
||||
} else {
|
||||
system("mkdir /home/mks/gcode_files/sda1/QD_Log");
|
||||
system("cp /home/mks/klipper_logs/klippy.log /home/mks/gcode_files/sda1/QD_Log/klippy.log\n");
|
||||
system("cp /home/mks/klipper_logs/moonraker.log /home/mks/gcode_files/sda1/QD_Log/moonraker.log\n");
|
||||
system("bash -c 'cp /home/mks/klipper_logs/klippy.log* /home/mks/gcode_files/sda1/QD_Log/'");
|
||||
system("bash -c 'cp /home/mks/klipper_logs/moonraker.log* /home/mks/gcode_files/sda1/QD_Log/'");
|
||||
system("bash -c 'cp /home/mks/klipper_logs/auto_update.log* /home/mks/gcode_files/sda1/QD_Log/'");
|
||||
system("bash -c 'cp /root/frp/frpc.log* /home/mks/gcode_files/sda1/QD_Log/'");
|
||||
system("bash -c 'cp /root/frp/frpc.*.log /home/mks/gcode_files/sda1/QD_Log/'");
|
||||
system("cp /root/frp/frpc.toml /home/mks/gcode_files/sda1/QD_Log/server.cfg");
|
||||
page_to(TJC_PAGE_PRINT_LOG_S);
|
||||
}
|
||||
}
|
||||
@@ -3168,19 +3259,38 @@ void set_mks_connection_method(int target) {
|
||||
}
|
||||
|
||||
void refresh_page_show_qr() {
|
||||
send_cmd_txt(tty_fd, "t0", status_result.ip_address);
|
||||
if (mks_ethernet == 0) {
|
||||
send_cmd_txt(tty_fd, "t0", status_result.ip_address);
|
||||
send_cmd_picc(tty_fd, "b4", "268");
|
||||
send_cmd_picc2(tty_fd, "b4", "214");
|
||||
} else {
|
||||
std::string local_ip = get_eth0_ip();
|
||||
send_cmd_txt(tty_fd, "t0", local_ip);
|
||||
send_cmd_picc(tty_fd, "b4", "269");
|
||||
send_cmd_picc2(tty_fd, "b4", "215");
|
||||
}
|
||||
}
|
||||
|
||||
void go_to_showqr() {
|
||||
std::string qrmessage;
|
||||
get_mks_connection_method();
|
||||
page_to(TJC_PAGE_SHOW_QR);
|
||||
if (strcmp(status_result.wpa_state, "COMPLETED") == 0) {
|
||||
if (strcmp(status_result.wpa_state, "COMPLETED") == 0 || mks_ethernet) {
|
||||
if (qr_refreshed == false) {
|
||||
send_cmd_cp_close(tty_fd, "cp0");
|
||||
if (open_qr_refreshed == true || access("/home/mks/qrcode/qrcode.jpg", F_OK) == -1)
|
||||
system("python3 /home/mks/qrcode/qrcode_QD.py 176\n");
|
||||
open_qr_refreshed = true;
|
||||
refresh_files_list_picture("/home/mks/qrcode/qrcode.jpg", 176, 0);
|
||||
qr_refreshed = true;
|
||||
qrmessage = run_python_code("python3 /home/mks/qrcode/qrcode_QD.py 176\n");
|
||||
std::cout << "qrmessage:" << qrmessage << std::endl;
|
||||
if (qrmessage.find("Missing or invalid") != -1) {
|
||||
send_cmd_txt(tty_fd, "t4", qrmessage);
|
||||
send_cmd_vis(tty_fd, "t4", "1");
|
||||
} else if (qrmessage.find("No") != -1) {
|
||||
send_cmd_vis(tty_fd, "t4", "1");
|
||||
} else {
|
||||
open_qr_refreshed = true;
|
||||
refresh_files_list_picture("/home/mks/qrcode/qrcode.jpg", 176, 0);
|
||||
qr_refreshed = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
send_cmd_vis(tty_fd, "t4", "1");
|
||||
@@ -3199,7 +3309,7 @@ void go_to_server_set(int n) {
|
||||
current_server_page = n;
|
||||
total_server_count = 0;
|
||||
serverConfigs.clear();
|
||||
if (connection_method == 1) {
|
||||
if (connection_method == 1 && strcmp(status_result.wpa_state, "COMPLETED") == 0) {
|
||||
page_to(TJC_PAGE_SEARCH_SERVER);
|
||||
update_server(0);
|
||||
get_mks_selected_server();
|
||||
@@ -3233,7 +3343,12 @@ void update_server(int choice)
|
||||
{
|
||||
// CLL 连接服务器获取json文件
|
||||
if (choice == 0) {
|
||||
system("curl -s -S -L -o /root/frp/server_list.json http://www.aws.qidi3dprinter.com:5050/downloads/server_list.json");
|
||||
// system("curl -s -S -L -o /root/frp/server_list.json http://www.aws.qidi3dprinter.com:5050/downloads/server_list.json");
|
||||
get_mks_selected_server();
|
||||
std::string server_for_command = selected_server.empty() ? "aws" : selected_server;
|
||||
std::string command = "curl -s -S -L -o /root/frp/server_list.json http://www." + server_for_command + ".qidi3dprinter.com:5050/downloads/server_list.json";
|
||||
std::cout << "Executing command: " << command << std::endl;
|
||||
system(command.c_str());
|
||||
} else {
|
||||
qr_refreshed = false; // CLL 当choice不为0时,该函数用于切换服务器,需要重新刷新二维码
|
||||
}
|
||||
@@ -3329,12 +3444,23 @@ void update_server(int choice)
|
||||
}
|
||||
|
||||
void refresh_page_server_set() {
|
||||
if (connection_method == 0) {
|
||||
if (connection_method == 0 || strcmp(status_result.wpa_state, "COMPLETED") != 0) {
|
||||
send_cmd_picc(tty_fd, "b2", "217");
|
||||
send_cmd_picc2(tty_fd, "b2", "220");
|
||||
send_cmd_vis(tty_fd, "t3", "1");
|
||||
send_cmd_vis(tty_fd, "t0", "0");
|
||||
send_cmd_vis(tty_fd, "b3", "0");
|
||||
send_cmd_vis(tty_fd, "b4", "0");
|
||||
send_cmd_vis(tty_fd, "b0", "0");
|
||||
} else {
|
||||
send_cmd_picc(tty_fd, "b2", "218");
|
||||
send_cmd_picc2(tty_fd, "b2", "219");
|
||||
send_cmd_vis(tty_fd, "t3", "0");
|
||||
send_cmd_vis(tty_fd, "t0", "1");
|
||||
send_cmd_vis(tty_fd, "b3", "1");
|
||||
send_cmd_vis(tty_fd, "b4", "1");
|
||||
send_cmd_vis(tty_fd, "b0", "1");
|
||||
|
||||
}
|
||||
|
||||
if (current_server_page == 0) {
|
||||
@@ -3395,7 +3521,7 @@ void check_online_version() {
|
||||
page_to(TJC_PAGE_SEARCH_SERVER);
|
||||
if (connection_method == 0)
|
||||
return;
|
||||
target_soc_version = run_python_code("python3 /root/auto_update/version_check_Q1.py");
|
||||
target_soc_version = run_python_code("python3 /root/auto_update/version_check.py");
|
||||
std::cout << "服务器版本:" << target_soc_version << std::endl;
|
||||
if (target_soc_version.find("0") == 0) {
|
||||
page_to(TJC_PAGE_UPDATE_MODE);
|
||||
@@ -3447,7 +3573,7 @@ void online_update() {
|
||||
pthread_t recevice_progress_pthread;
|
||||
pthread_create(&recevice_progress_pthread, NULL, recevice_progress_handle, NULL);
|
||||
system("rm /home/mks/gcode_files/.cache/*\n");
|
||||
system("python3 /root/auto_update/download_update_Q1.py\n");
|
||||
system("python3 /root/auto_update/download_update.py\n");
|
||||
// page_to(TJC_PAGE_UPDATE_FINISH);
|
||||
system("sync\n");
|
||||
system("systemctl restart makerbase-client\n");
|
||||
@@ -3494,3 +3620,53 @@ void refresh_page_auto_unload() {
|
||||
send_cmd_vis(tty_fd, "b1", "1");
|
||||
}
|
||||
}
|
||||
|
||||
int get_mks_ethernet() {
|
||||
mksini_load();
|
||||
mks_ethernet = mksini_getboolean("mks_ethernet", "enable", 0);
|
||||
mksini_free();
|
||||
return mks_ethernet;
|
||||
}
|
||||
|
||||
void set_mks_ethernet(int target) {
|
||||
std::cout << "设置以太网:" << target << std::endl;
|
||||
mksini_load();
|
||||
mksini_set("mks_ethernet", "enable", std::to_string(target));
|
||||
mksini_save();
|
||||
mksini_free();
|
||||
mks_ethernet = target;
|
||||
}
|
||||
|
||||
std::string hex_to_utf8(const std::string& hex) {
|
||||
std::ostringstream utf8;
|
||||
size_t i = 0;
|
||||
while (i < hex.size()) {
|
||||
if (i + 3 < hex.size() && hex[i] == '\\' && hex[i + 1] == 'x') {
|
||||
std::string hex_byte = hex.substr(i + 2, 2);
|
||||
int value;
|
||||
std::istringstream(hex_byte) >> std::hex >> value;
|
||||
utf8 << static_cast<char>(value);
|
||||
i += 4;
|
||||
} else {
|
||||
utf8 << hex[i++];
|
||||
}
|
||||
}
|
||||
return utf8.str();
|
||||
}
|
||||
|
||||
void check_print_interrupted() {
|
||||
std::ifstream infile("/home/mks/klipper_config/saved_variables.cfg");
|
||||
if (!infile) {
|
||||
std::cerr << "无法打开文件 " << "/home/mks/klipper_config/saved_variables.cfg" << std::endl;
|
||||
return;
|
||||
}
|
||||
std::stringstream buffer;
|
||||
buffer << infile.rdbuf();
|
||||
std::string printer_variables = buffer.str();
|
||||
infile.close();
|
||||
std::string print_interrupted_status = printer_variables.substr(printer_variables.find("was_interrupted =") + 18, 5);
|
||||
if (print_interrupted_status != "False") {
|
||||
ep->Send(json_run_a_gcode("DETECT_INTERRUPTION\n"));
|
||||
jump_to_resume_print = true;
|
||||
}
|
||||
}
|
||||
@@ -177,6 +177,8 @@ void parse_gcode_response(nlohmann::json params) {
|
||||
}
|
||||
} else if (params0 == "!! Insufficient disk space, unable to read the file.") {
|
||||
jump_to_memory_warning = true;
|
||||
} else if (params0.find("!! Printer is not ready") != -1) {
|
||||
// CLL 不做处理
|
||||
} else if (params0.substr(0, 2) == "!!") {
|
||||
error_message = params0;
|
||||
detect_error();
|
||||
@@ -232,7 +234,7 @@ void parse_gcode_response(nlohmann::json params) {
|
||||
step_2 = true;
|
||||
}
|
||||
} else if (params0.find("echo: Detected unexpected interruption during the last print.") != -1 || params0.find("echo: Yes: RESUME_INTERRUPTED") != -1 || params0.find("echo: No: CLEAR_LAST_FILE") != -1) {
|
||||
jump_to_resume_print = true;
|
||||
// jump_to_resume_print = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,38 +122,65 @@ bool detect_update()
|
||||
// 4.4.3 CLL 新增deb文件也能更新
|
||||
int fd_soc_deb;
|
||||
|
||||
fd_soc_data = access("/home/mks/gcode_files/sda1/QD_Update/QD_Mates3_SOC", F_OK);
|
||||
if (fd_soc_data == 0)
|
||||
{
|
||||
detected_soc_data = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
detected_soc_data = false;
|
||||
fd_soc_data = access("/home/mks/gcode_files/sda1/QD_Update/QD_Q1_SOC", F_OK);
|
||||
if (fd_soc_data == 0)
|
||||
{
|
||||
detected_q1_soc_data = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
detected_q1_soc_data = false;
|
||||
}
|
||||
}
|
||||
// fd_soc_data = access("/home/mks/gcode_files/sda1/QD_Update/QD_Mates3_SOC", F_OK);
|
||||
// if (fd_soc_data == 0)
|
||||
// {
|
||||
// detected_soc_data = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// detected_soc_data = false;
|
||||
// fd_soc_data = access("/home/mks/gcode_files/sda1/QD_Update/QD_Q1_SOC", F_OK);
|
||||
// if (fd_soc_data == 0)
|
||||
// {
|
||||
// detected_q1_soc_data = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// detected_q1_soc_data = false;
|
||||
// }
|
||||
// }
|
||||
|
||||
if ((dir = opendir(base_path.c_str())) != nullptr)
|
||||
{
|
||||
while ((entry = readdir(dir)) != nullptr)
|
||||
{
|
||||
std::string filename = entry->d_name;
|
||||
// 跳过以 .bak 结尾的文件
|
||||
if (filename.rfind(".bak") == filename.length() - 4) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (filename.find("QD_Q1_PATCH") == 0)
|
||||
{
|
||||
detected_q1_patch_data = true; // 找到 QD_Q1_PATCH 开头文件
|
||||
break;
|
||||
detected_q1_patch_data = true;
|
||||
continue;
|
||||
}
|
||||
if (filename.find("QD_Q1_UI") == 0)
|
||||
{
|
||||
detected_q1_ui_data = true;
|
||||
continue;
|
||||
}
|
||||
if (filename.find("QD_Q1_SOC") == 0)
|
||||
{
|
||||
detected_q1_soc_data = true;
|
||||
continue;
|
||||
}
|
||||
if (filename.find("QD_Mates3_UI") == 0)
|
||||
{
|
||||
detected_ui_data = true;
|
||||
continue;
|
||||
}
|
||||
if (filename.find("QD_Mates3_SOC") == 0)
|
||||
{
|
||||
detected_soc_data = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
closedir(dir);
|
||||
}
|
||||
else
|
||||
printf("Usb device path not found: %s\n", base_path.c_str());
|
||||
|
||||
fd_mcu_data = access("/home/mks/gcode_files/sda1/QD_MCU/MCU", F_OK);
|
||||
if (fd_mcu_data == 0)
|
||||
@@ -165,25 +192,25 @@ bool detect_update()
|
||||
detected_mcu_data = false;
|
||||
}
|
||||
|
||||
fd_ui_data = access("/home/mks/gcode_files/sda1/QD_Update/QD_Mates3_UI", F_OK);
|
||||
// fd_ui_data = access("/home/mks/gcode_files/sda1/QD_Update/QD_Mates3_UI", F_OK);
|
||||
|
||||
if (fd_ui_data == 0)
|
||||
{
|
||||
detected_ui_data = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
detected_ui_data = false;
|
||||
fd_ui_data = access("/home/mks/gcode_files/sda1/QD_Update/QD_Q1_UI", F_OK);
|
||||
if (fd_ui_data == 0)
|
||||
{
|
||||
detected_q1_ui_data = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
detected_q1_ui_data = false;
|
||||
}
|
||||
}
|
||||
// if (fd_ui_data == 0)
|
||||
// {
|
||||
// detected_ui_data = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// detected_ui_data = false;
|
||||
// fd_ui_data = access("/home/mks/gcode_files/sda1/QD_Update/QD_Q1_UI", F_OK);
|
||||
// if (fd_ui_data == 0)
|
||||
// {
|
||||
// detected_q1_ui_data = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// detected_q1_ui_data = false;
|
||||
// }
|
||||
// }
|
||||
|
||||
fd_gcode_cfg = access("/home/mks/gcode_files/sda1/QD_Update/gcode_macro.cfg", F_OK);
|
||||
if (fd_gcode_cfg == 0)
|
||||
@@ -246,6 +273,11 @@ void start_update()
|
||||
{
|
||||
system("rm /home/mks/gcode_files/.cache/*");
|
||||
|
||||
bool factory_mode = (
|
||||
access("/home/mks/gcode_files/sda1/QD_factory_mode.txt", F_OK) != -1 ||
|
||||
access("/home/mks/gcode_files/sda1/QD_Update/QD_factory_mode.txt", F_OK) != -1
|
||||
);
|
||||
|
||||
if (detected_mcu_data == true)
|
||||
{
|
||||
if (access("/home/mks/gcode_files/sda1/QD_factory_mode.txt", F_OK) == 0)
|
||||
@@ -282,42 +314,42 @@ void start_update()
|
||||
}
|
||||
}
|
||||
|
||||
if (detected_ui_data == true)
|
||||
{
|
||||
if (access("/home/mks/gcode_files/sda1/QD_factory_mode.txt", F_OK) == 0)
|
||||
{
|
||||
system("cp /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_UI /root/800_480.tft; sync");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (access("/home/mks/gcode_files/sda1/QD_Update/QD_factory_mode.txt", F_OK) == 0)
|
||||
{
|
||||
system("cp /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_UI /root/800_480.tft; sync");
|
||||
}
|
||||
else
|
||||
{
|
||||
system("cp /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_UI /root/800_480.tft; mv /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_UI /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_UI.bak; sync");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (detected_q1_ui_data == true)
|
||||
{
|
||||
if (access("/home/mks/gcode_files/sda1/QD_factory_mode.txt", F_OK) == 0)
|
||||
{
|
||||
system("cp /home/mks/gcode_files/sda1/QD_Update/QD_Q1_UI /root/800_480.tft; sync");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (access("/home/mks/gcode_files/sda1/QD_Update/QD_factory_mode.txt", F_OK) == 0)
|
||||
{
|
||||
system("cp /home/mks/gcode_files/sda1/QD_Update/QD_Q1_UI /root/800_480.tft; sync");
|
||||
}
|
||||
else
|
||||
{
|
||||
system("cp /home/mks/gcode_files/sda1/QD_Update/QD_Q1_UI /root/800_480.tft; mv /home/mks/gcode_files/sda1/QD_Update/QD_Q1_UI /home/mks/gcode_files/sda1/QD_Update/QD_Q1_UI.bak; sync");
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (detected_ui_data == true)
|
||||
// {
|
||||
// if (access("/home/mks/gcode_files/sda1/QD_factory_mode.txt", F_OK) == 0)
|
||||
// {
|
||||
// system("cp /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_UI /root/800_480.tft; sync");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (access("/home/mks/gcode_files/sda1/QD_Update/QD_factory_mode.txt", F_OK) == 0)
|
||||
// {
|
||||
// system("cp /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_UI /root/800_480.tft; sync");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// system("cp /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_UI /root/800_480.tft; mv /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_UI /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_UI.bak; sync");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else if (detected_q1_ui_data == true)
|
||||
// {
|
||||
// if (access("/home/mks/gcode_files/sda1/QD_factory_mode.txt", F_OK) == 0)
|
||||
// {
|
||||
// system("cp /home/mks/gcode_files/sda1/QD_Update/QD_Q1_UI /root/800_480.tft; sync");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (access("/home/mks/gcode_files/sda1/QD_Update/QD_factory_mode.txt", F_OK) == 0)
|
||||
// {
|
||||
// system("cp /home/mks/gcode_files/sda1/QD_Update/QD_Q1_UI /root/800_480.tft; sync");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// system("cp /home/mks/gcode_files/sda1/QD_Update/QD_Q1_UI /root/800_480.tft; mv /home/mks/gcode_files/sda1/QD_Update/QD_Q1_UI /home/mks/gcode_files/sda1/QD_Update/QD_Q1_UI.bak; sync");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
if (detected_gcode_cfg == true)
|
||||
{
|
||||
@@ -384,19 +416,52 @@ void start_update()
|
||||
system("systemctl stop moonraker.service\n");
|
||||
system("find /home/mks/gcode_files -maxdepth 1 -type d ! -name sd* -a ! -name '.*' | grep gcode_files/ | xargs rm -rf");
|
||||
system("cp /home/mks/gcode_files/sda1/QD_Update/QD_gcode/*.gcode /home/mks/gcode_files; chmod 777 /home/mks/gcode_files/*.gcode; sync");
|
||||
sleep(3);
|
||||
system("systemctl restart moonraker.service\n");
|
||||
}
|
||||
|
||||
// 检测到补丁文件
|
||||
if (detected_q1_patch_data)
|
||||
{
|
||||
bool factory_mode = (access("/home/mks/gcode_files/sda1/QD_factory_mode.txt", F_OK) != -1);
|
||||
// 检测到UI文件
|
||||
if (detected_ui_data || detected_q1_ui_data) {
|
||||
|
||||
if ((dir = opendir(base_path.c_str())) != nullptr)
|
||||
{
|
||||
while ((entry = readdir(dir)) != nullptr)
|
||||
{
|
||||
std::string filename = entry->d_name;
|
||||
if (filename.find("QD_Q1_PATCH") == 0)
|
||||
|
||||
// 模糊匹配UI文件
|
||||
if (filename.find("QD_Q1_UI") == 0 || filename.find("QD_Mates3_UI") == 0)
|
||||
{
|
||||
std::string filePath = base_path + filename;
|
||||
std::string command = "cp " + filePath + " /root/800_480.tft; ";
|
||||
|
||||
if (!factory_mode) {
|
||||
command += "mv " + filePath + " " + filePath + ".bak; ";
|
||||
}
|
||||
command += "sync";
|
||||
system(command.c_str());
|
||||
break; // 每次更新只处理一个UI文件
|
||||
}
|
||||
}
|
||||
closedir(dir);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Directory not found: %s\n", base_path.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
// 检测到SOC或者PATCH文件
|
||||
if (detected_q1_patch_data || detected_q1_soc_data || detected_soc_data)
|
||||
{
|
||||
|
||||
if ((dir = opendir(base_path.c_str())) != nullptr)
|
||||
{
|
||||
while ((entry = readdir(dir)) != nullptr)
|
||||
{
|
||||
std::string filename = entry->d_name;
|
||||
if (filename.rfind(".bak") != std::string::npos) continue;
|
||||
if (filename.find("QD_Q1_PATCH") == 0 || filename.find("QD_Q1_SOC") == 0 || filename.find("QD_Mates3_SOC") == 0)
|
||||
{
|
||||
std::string file_path = base_path + filename;
|
||||
std::string command = "mv " + file_path + " " + base_path + "mks.deb; dpkg -i --force-overwrite " + base_path + "mks.deb;";
|
||||
@@ -408,64 +473,68 @@ void start_update()
|
||||
{
|
||||
new_file_name += ".bak";
|
||||
}
|
||||
|
||||
command = "mv " + base_path + "mks.deb " + new_file_name + "; sync";
|
||||
system(command.c_str());
|
||||
}
|
||||
}
|
||||
closedir(dir);
|
||||
}
|
||||
}
|
||||
|
||||
if (detected_soc_data == true)
|
||||
{
|
||||
if (access("/home/mks/gcode_files/sda1/QD_factory_mode.txt", F_OK) == 0)
|
||||
{
|
||||
std::cout << "检测到qidi文件" << std::endl;
|
||||
system("mv /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_SOC /home/mks/gcode_files/sda1/QD_Update/mks.deb; dpkg -i --force-overwrite /home/mks/gcode_files/sda1/QD_Update/mks.deb; mv /home/mks/gcode_files/sda1/QD_Update/mks.deb /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_SOC; sync;");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (access("/home/mks/gcode_files/sda1/QD_Update/QD_factory_mode.txt", F_OK) == 0)
|
||||
{
|
||||
std::cout << "检测到qidi文件" << std::endl;
|
||||
system("mv /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_SOC /home/mks/gcode_files/sda1/QD_Update/mks.deb; dpkg -i --force-overwrite /home/mks/gcode_files/sda1/QD_Update/mks.deb; mv /home/mks/gcode_files/sda1/QD_Update/mks.deb /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_SOC; sync;");
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "没有检测到qidi文件" << std::endl;
|
||||
system("mv /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_SOC /home/mks/gcode_files/sda1/QD_Update/mks.deb; dpkg -i --force-overwrite /home/mks/gcode_files/sda1/QD_Update/mks.deb; mv /home/mks/gcode_files/sda1/QD_Update/mks.deb /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_SOC.bak; sync;");
|
||||
}
|
||||
printf("Directory not found: %s\n", base_path.c_str());
|
||||
}
|
||||
}
|
||||
else if (detected_soc_deb == true)
|
||||
|
||||
// if (detected_soc_data == true)
|
||||
// {
|
||||
// if (access("/home/mks/gcode_files/sda1/QD_factory_mode.txt", F_OK) == 0)
|
||||
// {
|
||||
// std::cout << "检测到qidi文件" << std::endl;
|
||||
// system("mv /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_SOC /home/mks/gcode_files/sda1/QD_Update/mks.deb; dpkg -i --force-overwrite /home/mks/gcode_files/sda1/QD_Update/mks.deb; mv /home/mks/gcode_files/sda1/QD_Update/mks.deb /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_SOC; sync;");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (access("/home/mks/gcode_files/sda1/QD_Update/QD_factory_mode.txt", F_OK) == 0)
|
||||
// {
|
||||
// std::cout << "检测到qidi文件" << std::endl;
|
||||
// system("mv /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_SOC /home/mks/gcode_files/sda1/QD_Update/mks.deb; dpkg -i --force-overwrite /home/mks/gcode_files/sda1/QD_Update/mks.deb; mv /home/mks/gcode_files/sda1/QD_Update/mks.deb /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_SOC; sync;");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// std::cout << "没有检测到qidi文件" << std::endl;
|
||||
// system("mv /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_SOC /home/mks/gcode_files/sda1/QD_Update/mks.deb; dpkg -i --force-overwrite /home/mks/gcode_files/sda1/QD_Update/mks.deb; mv /home/mks/gcode_files/sda1/QD_Update/mks.deb /home/mks/gcode_files/sda1/QD_Update/QD_Mates3_SOC.bak; sync;");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else if (detected_soc_deb == true)
|
||||
if (detected_soc_deb == true)
|
||||
{ // 4.4.3 CLL 修改deb文件可以更新
|
||||
if (access("/home/mks/gcode_files/sda1/QD_factory_mode.txt", F_OK) == 0)
|
||||
{
|
||||
system("dpkg -i --force-overwrite /home/mks/gcode_files/sda1/QD_Update/mks.deb;sync");
|
||||
}
|
||||
}
|
||||
else if (detected_q1_soc_data == true)
|
||||
{
|
||||
if (access("/home/mks/gcode_files/sda1/QD_factory_mode.txt", F_OK) == 0)
|
||||
{
|
||||
std::cout << "检测到qidi文件" << std::endl;
|
||||
system("mv /home/mks/gcode_files/sda1/QD_Update/QD_Q1_SOC /home/mks/gcode_files/sda1/QD_Update/mks.deb; dpkg -i --force-overwrite /home/mks/gcode_files/sda1/QD_Update/mks.deb; mv /home/mks/gcode_files/sda1/QD_Update/mks.deb /home/mks/gcode_files/sda1/QD_Update/QD_Q1_SOC; sync;");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (access("/home/mks/gcode_files/sda1/QD_Update/QD_factory_mode.txt", F_OK) == 0)
|
||||
{
|
||||
std::cout << "检测到qidi文件" << std::endl;
|
||||
system("mv /home/mks/gcode_files/sda1/QD_Update/QD_Q1_SOC /home/mks/gcode_files/sda1/QD_Update/mks.deb; dpkg -i --force-overwrite /home/mks/gcode_files/sda1/QD_Update/mks.deb; mv /home/mks/gcode_files/sda1/QD_Update/mks.deb /home/mks/gcode_files/sda1/QD_Update/QD_Q1_SOC; sync;");
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "没有检测到qidi文件" << std::endl;
|
||||
system("mv /home/mks/gcode_files/sda1/QD_Update/QD_Q1_SOC /home/mks/gcode_files/sda1/QD_Update/mks.deb; dpkg -i --force-overwrite /home/mks/gcode_files/sda1/QD_Update/mks.deb; mv /home/mks/gcode_files/sda1/QD_Update/mks.deb /home/mks/gcode_files/sda1/QD_Update/QD_Q1_SOC.bak; sync;");
|
||||
}
|
||||
}
|
||||
}
|
||||
// else if (detected_q1_soc_data == true)
|
||||
// {
|
||||
// if (access("/home/mks/gcode_files/sda1/QD_factory_mode.txt", F_OK) == 0)
|
||||
// {
|
||||
// std::cout << "检测到qidi文件" << std::endl;
|
||||
// system("mv /home/mks/gcode_files/sda1/QD_Update/QD_Q1_SOC /home/mks/gcode_files/sda1/QD_Update/mks.deb; dpkg -i --force-overwrite /home/mks/gcode_files/sda1/QD_Update/mks.deb; mv /home/mks/gcode_files/sda1/QD_Update/mks.deb /home/mks/gcode_files/sda1/QD_Update/QD_Q1_SOC; sync;");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (access("/home/mks/gcode_files/sda1/QD_Update/QD_factory_mode.txt", F_OK) == 0)
|
||||
// {
|
||||
// std::cout << "检测到qidi文件" << std::endl;
|
||||
// system("mv /home/mks/gcode_files/sda1/QD_Update/QD_Q1_SOC /home/mks/gcode_files/sda1/QD_Update/mks.deb; dpkg -i --force-overwrite /home/mks/gcode_files/sda1/QD_Update/mks.deb; mv /home/mks/gcode_files/sda1/QD_Update/mks.deb /home/mks/gcode_files/sda1/QD_Update/QD_Q1_SOC; sync;");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// std::cout << "没有检测到qidi文件" << std::endl;
|
||||
// system("mv /home/mks/gcode_files/sda1/QD_Update/QD_Q1_SOC /home/mks/gcode_files/sda1/QD_Update/mks.deb; dpkg -i --force-overwrite /home/mks/gcode_files/sda1/QD_Update/mks.deb; mv /home/mks/gcode_files/sda1/QD_Update/mks.deb /home/mks/gcode_files/sda1/QD_Update/QD_Q1_SOC.bak; sync;");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
update_finished_tips();
|
||||
}
|
||||
|
||||
85
src/ui.cpp
85
src/ui.cpp
@@ -39,6 +39,7 @@ extern std::string str_gimage;
|
||||
// preview
|
||||
|
||||
// wifi start
|
||||
extern struct mks_wifi_status_result_t status_result;
|
||||
extern int page_wifi_ssid_list_pages;
|
||||
extern int page_wifi_current_pages;
|
||||
// wifi end
|
||||
@@ -103,6 +104,8 @@ extern bool mks_file_parse_finished;
|
||||
extern int printer_extruder_temperature;
|
||||
extern int printer_extruder_target;
|
||||
|
||||
extern int printer_heater_bed_target;
|
||||
|
||||
extern std::string printer_webhooks_state;
|
||||
|
||||
extern bool printer_ready;
|
||||
@@ -155,6 +158,8 @@ extern int connection_method;
|
||||
extern int current_server_page;
|
||||
extern int total_server_count;
|
||||
|
||||
extern int mks_ethernet;
|
||||
|
||||
bool qr_refreshed = false; // CLL 此变量用于标记二维码刷新,仅在切换wifi、切换本地/互联网连接、修改服务器后需要重新刷新
|
||||
|
||||
void parse_cmd_msg_from_tjc_screen(char *cmd) {
|
||||
@@ -639,18 +644,30 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) {
|
||||
switch (widget_id)
|
||||
{
|
||||
case TJC_PAGE_ALL_TO_MAIN:
|
||||
page_to(TJC_PAGE_MAIN);
|
||||
if (printer_print_stats_state == "printing" || printer_print_stats_state == "paused") {
|
||||
page_to(TJC_PAGE_PRINTING);
|
||||
jump_to_print = false;
|
||||
} else
|
||||
page_to(TJC_PAGE_MAIN);
|
||||
break;
|
||||
|
||||
case TJC_PAGE_ALL_TO_FILE_LIST:
|
||||
break;
|
||||
|
||||
case TJC_PAGE_ALL_TO_ADJUST:
|
||||
go_to_adjust();
|
||||
if (printer_print_stats_state == "printing" || printer_print_stats_state == "paused") {
|
||||
page_to(TJC_PAGE_PRINTING);
|
||||
jump_to_print = false;
|
||||
} else
|
||||
go_to_adjust();
|
||||
break;
|
||||
|
||||
case TJC_PAGE_ALL_TO_SETTING:
|
||||
go_to_setting();
|
||||
if (printer_print_stats_state == "printing" || printer_print_stats_state == "paused") {
|
||||
page_to(TJC_PAGE_PRINTING);
|
||||
jump_to_print = false;
|
||||
} else
|
||||
go_to_setting();
|
||||
break;
|
||||
|
||||
case TJC_PAGE_PREVIEW_BACK:
|
||||
@@ -696,6 +713,11 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) {
|
||||
break;
|
||||
|
||||
case TJC_PAGE_PREVIEW_BED_LEVELING:
|
||||
if (printer_print_stats_state == "printing" || printer_print_stats_state == "paused") {
|
||||
page_to(TJC_PAGE_PRINTING);
|
||||
jump_to_print = false;
|
||||
break;
|
||||
}
|
||||
if (printer_bed_leveling == true) {
|
||||
printer_bed_leveling = false;
|
||||
}else {
|
||||
@@ -816,8 +838,8 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) {
|
||||
set_intern_zoffset(0.1);
|
||||
break;
|
||||
|
||||
case TJC_PAGE_PRINT_ZOFFSET_SET_1:
|
||||
set_intern_zoffset(1);
|
||||
case TJC_PAGE_PRINT_ZOFFSET_SET_05:
|
||||
set_intern_zoffset(0.5);
|
||||
break;
|
||||
|
||||
case TJC_PAGE_PRINT_ZOFFSET_UP:
|
||||
@@ -1366,8 +1388,7 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) {
|
||||
break;
|
||||
|
||||
case TJC_PAGE_LEVEL_MODE_BED_CALIBRATION:
|
||||
manual_count = 4;
|
||||
bed_calibrate();
|
||||
page_to(TJC_PAGE_CALIBRATE_WARNING);
|
||||
break;
|
||||
|
||||
case TJC_PAGE_LEVEL_MODE_TO_COMMON_SETTING:
|
||||
@@ -1416,6 +1437,10 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) {
|
||||
break;
|
||||
|
||||
case TJC_PAGE_AUTO_HEATERBED_NEXT:
|
||||
if (printer_heater_bed_target < 35) {
|
||||
page_to(TJC_PAGE_AUTO_WARNING);
|
||||
break;
|
||||
}
|
||||
auto_level_button_enabled = true;
|
||||
printer_idle_timeout_state = "Printing";
|
||||
start_auto_level();
|
||||
@@ -1454,8 +1479,8 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) {
|
||||
set_auto_level_dist(0.1);
|
||||
break;
|
||||
|
||||
case TJC_PAGE_PRE_BED_CALIBRATION_SET_1:
|
||||
set_auto_level_dist(1);
|
||||
case TJC_PAGE_PRE_BED_CALIBRATION_SET_05:
|
||||
set_auto_level_dist(0.5);
|
||||
break;
|
||||
|
||||
case TJC_PAGE_PRE_BED_CALIBRATION_UP:
|
||||
@@ -2067,7 +2092,7 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) {
|
||||
case TJC_PAGE_RESUME_PRINT:
|
||||
switch(widget_id) {
|
||||
case TJC_PAGE_RESUME_PRINT_YES:
|
||||
page_to(TJC_PAGE_MAIN);
|
||||
page_to(TJC_PAGE_RE_PRINTING);
|
||||
send_gcode("RESUME_INTERRUPTED\n");
|
||||
break;
|
||||
|
||||
@@ -2120,6 +2145,15 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) {
|
||||
go_to_network();
|
||||
break;
|
||||
|
||||
case TJC_PAGE_SHOW_QR_ETHERNET:
|
||||
if (mks_ethernet == 1)
|
||||
set_mks_ethernet(0);
|
||||
else
|
||||
set_mks_ethernet(1);
|
||||
qr_refreshed = false;
|
||||
go_to_showqr();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -2151,6 +2185,8 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) {
|
||||
break;
|
||||
|
||||
case TJC_PAGE_SERVER_SET_LOCAL:
|
||||
if (strcmp(status_result.wpa_state, "COMPLETED") != 0)
|
||||
break;
|
||||
if (connection_method == 1) {
|
||||
set_mks_connection_method(0);
|
||||
connection_method = 0;
|
||||
@@ -2332,6 +2368,35 @@ void tjc_event_clicked_handler(int page_id, int widget_id, int type_id) {
|
||||
}
|
||||
break;
|
||||
|
||||
case TJC_PAGE_AUTO_WARNING:
|
||||
switch (widget_id)
|
||||
{
|
||||
case TJC_PAGE_AUTO_WARNING_YES:
|
||||
page_to(TJC_PAGE_AUTO_HEATERBED);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case TJC_PAGE_CALIBRATE_WARNING:
|
||||
switch (widget_id)
|
||||
{
|
||||
case TJC_PAGE_CALIBRATE_WARNING_NEXT:
|
||||
manual_count = 4;
|
||||
bed_calibrate();
|
||||
break;
|
||||
|
||||
case TJC_PAGE_CALIBRATE_WARNING_BACK:
|
||||
page_to(TJC_PAGE_LEVEL_MODE);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user