You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding filament density to SET_MATERIAL macro/pulling density from spoolman data (#440)
- Added pulling density, diameter, and empty spool weight from spoolman data
- Added density, diameter, and empty spool weight optional values to SET_MATERIAL macro. If density is not supplied AFC tries to look up density from default values based on material passed in
- Removed upper bounds for fwd/rwd values when calling SET_SPEED_MULTIPLIER macro
- Removed slashes in macro help as this causes the character afterwards to be escaped leading to help being displayed weird in gui's
self.default_material_temps=config.getlists("default_material_temps", None)# Default temperature to set extruder when loading/unloading lanes. Material needs to be either manually set or uses material from spoolman if extruder temp is not set in spoolman.
("default: 235", "PLA:210", "PETG:235", "ABS:235", "ASA:235"))# Default temperature to set extruder when loading/unloading lanes. Material needs to be either manually set or uses material from spoolman if extruder temp is not set in spoolman.
Copy file name to clipboardExpand all lines: extras/AFC_lane.py
+52-24Lines changed: 52 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -67,18 +67,17 @@ def __init__(self, config):
67
67
self.tool_loaded=False
68
68
self.loaded_to_hub=False
69
69
self.spool_id=None
70
-
self.material=None
71
70
self.color=None
72
71
self.weight=0
73
-
self.material=None
72
+
self._material=None
74
73
self.extruder_temp=None
75
74
self.runout_lane='NONE'
76
75
self.status=AFCLaneState.NONE
77
76
self.multi_hubs_found=False
78
77
self.drive_stepper=None
79
78
unit=config.get('unit') # Unit name(AFC_BoxTurtle/NightOwl/etc) that belongs to this stepper.
80
79
# Overrides buffers set at the unit level
81
-
self.hub=config.get('hub',None) # Hub name(AFC_hub) that belongs to this stepper, overrides hub that is set in unit(AFC_BoxTurtle/NightOwl/etc) section.
80
+
self.hub=config.get('hub',None) # Hub name(AFC_hub) that belongs to this stepper, overrides hub that is set in unit(AFC_BoxTurtle/NightOwl/etc) section.
82
81
# Overrides buffers set at the unit and extruder level
83
82
self.buffer_name=config.get("buffer", None) # Buffer name(AFC_buffer) that belongs to this stepper, overrides buffer that is set in extruder(AFC_extruder) or unit(AFC_BoxTurtle/NightOwl/etc) sections.
84
83
self.unit=unit.split(':')[0]
@@ -90,26 +89,26 @@ def __init__(self, config):
90
89
91
90
self.extruder_name=config.get('extruder', None) # Extruder name(AFC_extruder) that belongs to this stepper, overrides extruder that is set in unit(AFC_BoxTurtle/NightOwl/etc) section.
92
91
self.map=config.get('cmd','NONE')
93
-
self.led_index=config.get('led_index', None) # LED index of lane in chain of lane LEDs
94
-
self.led_fault=config.get('led_fault',None) # LED color to set when faults occur in lane (R,G,B,W) 0 = off, 1 = full brightness. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
95
-
self.led_ready=config.get('led_ready',None) # LED color to set when lane is ready (R,G,B,W) 0 = off, 1 = full brightness. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
96
-
self.led_not_ready=config.get('led_not_ready',None) # LED color to set when lane not ready (R,G,B,W) 0 = off, 1 = full brightness. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
97
-
self.led_loading=config.get('led_loading',None) # LED color to set when lane is loading (R,G,B,W) 0 = off, 1 = full brightness. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
98
-
self.led_prep_loaded=config.get('led_loading',None) # LED color to set when lane is loaded (R,G,B,W) 0 = off, 1 = full brightness. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
99
-
self.led_unloading=config.get('led_unloading',None) # LED color to set when lane is unloading (R,G,B,W) 0 = off, 1 = full brightness. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
100
-
self.led_tool_loaded=config.get('led_tool_loaded',None) # LED color to set when lane is loaded into tool (R,G,B,W) 0 = off, 1 = full brightness. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
92
+
self.led_index=config.get('led_index', None) # LED index of lane in chain of lane LEDs
93
+
self.led_fault=config.get('led_fault',None) # LED color to set when faults occur in lane (R,G,B,W) 0 = off, 1 = full brightness. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
94
+
self.led_ready=config.get('led_ready',None) # LED color to set when lane is ready (R,G,B,W) 0 = off, 1 = full brightness. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
95
+
self.led_not_ready=config.get('led_not_ready',None) # LED color to set when lane not ready (R,G,B,W) 0 = off, 1 = full brightness. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
96
+
self.led_loading=config.get('led_loading',None) # LED color to set when lane is loading (R,G,B,W) 0 = off, 1 = full brightness. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
97
+
self.led_prep_loaded=config.get('led_loading',None) # LED color to set when lane is loaded (R,G,B,W) 0 = off, 1 = full brightness. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
98
+
self.led_unloading=config.get('led_unloading',None) # LED color to set when lane is unloading (R,G,B,W) 0 = off, 1 = full brightness. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
99
+
self.led_tool_loaded=config.get('led_tool_loaded',None) # LED color to set when lane is loaded into tool (R,G,B,W) 0 = off, 1 = full brightness. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
101
100
self.led_spool_index=config.get('led_spool_index', None) # LED index to illuminate under spool
102
101
self.led_spool_illum=config.get('led_spool_illuminate', None) # LED color to illuminate under spool
103
102
104
-
self.long_moves_speed=config.getfloat("long_moves_speed", None) # Speed in mm/s to move filament when doing long moves. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
105
-
self.long_moves_accel=config.getfloat("long_moves_accel", None) # Acceleration in mm/s squared when doing long moves. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
106
-
self.short_moves_speed=config.getfloat("short_moves_speed", None) # Speed in mm/s to move filament when doing short moves. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
107
-
self.short_moves_accel=config.getfloat("short_moves_accel", None) # Acceleration in mm/s squared when doing short moves. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
108
-
self.short_move_dis=config.getfloat("short_move_dis", None) # Move distance in mm for failsafe moves. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
103
+
self.long_moves_speed=config.getfloat("long_moves_speed", None) # Speed in mm/s to move filament when doing long moves. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
104
+
self.long_moves_accel=config.getfloat("long_moves_accel", None) # Acceleration in mm/s squared when doing long moves. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
105
+
self.short_moves_speed=config.getfloat("short_moves_speed", None) # Speed in mm/s to move filament when doing short moves. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
106
+
self.short_moves_accel=config.getfloat("short_moves_accel", None) # Acceleration in mm/s squared when doing short moves. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
107
+
self.short_move_dis=config.getfloat("short_move_dis", None) # Move distance in mm for failsafe moves. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
109
108
self.max_move_dis=config.getfloat("max_move_dis", None) # Maximum distance to move filament. AFC breaks filament moves over this number into multiple moves. Useful to lower this number if running into timer too close errors when doing long filament moves. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
110
109
self.n20_break_delay_time=config.getfloat("n20_break_delay_time", None) # Time to wait between breaking n20 motors(nSleep/FWD/RWD all 1) and then releasing the break to allow coasting. Setting value here overrides values set in unit(AFC_BoxTurtle/NightOwl/etc) section
111
110
112
-
self.rev_long_moves_speed_factor=config.getfloat("rev_long_moves_speed_factor", None) # scalar speed factor when reversing filamentalist
111
+
self.rev_long_moves_speed_factor=config.getfloat("rev_long_moves_speed_factor", None) # scalar speed factor when reversing filamentalist
113
112
114
113
self.dist_hub=config.getfloat('dist_hub', 60) # Bowden distance between Box Turtle extruder and hub
115
114
self.park_dist=config.getfloat('park_dist', 10) # Currently unused
@@ -176,6 +175,30 @@ def __init__(self, config):
176
175
def__str__(self):
177
176
returnself.name
178
177
178
+
@property
179
+
defmaterial(self):
180
+
"""
181
+
Returns lanes filament material type
182
+
"""
183
+
returnself._material
184
+
185
+
@material.setter
186
+
defmaterial(self, value):
187
+
"""
188
+
Sets filament material type and sets filament density based off material type.
189
+
To use custom density, set density after setting material
190
+
"""
191
+
self._material=value
192
+
ifnotvalue:
193
+
self.filament_density=1.24# Setting to a default value
194
+
return
195
+
196
+
fordensityinself.afc.common_density_values:
197
+
v=density.split(":")
198
+
ifv[0] invalue:
199
+
self.filament_density=float(v[1])
200
+
break
201
+
179
202
def_handle_ready(self):
180
203
"""
181
204
Handles klippy:ready callback and verifies that steppers have units defined in their config
Macro call to update fwd_speed_multiplier or rwd_speed_multiplier values without having to set in config and restart klipper. This macro allows adjusting
897
-
these values while printing. Multiplier values must be between 0.0 - 1.0
920
+
these values while printing.
898
921
899
922
Use `FWD` variable to set forward multiplier, use `RWD` to set reverse multiplier
0 commit comments