|
27 | 27 | try: from extras.AFC_stats import AFCStats |
28 | 28 | except: raise error(ERROR_STR.format(import_lib="AFC_stats", trace=traceback.format_exc())) |
29 | 29 |
|
30 | | -AFC_VERSION="1.0.26" |
| 30 | +AFC_VERSION="1.0.29" |
31 | 31 |
|
32 | 32 | # Class for holding different states so its clear what all valid states are |
33 | 33 | class State: |
@@ -121,10 +121,11 @@ def __init__(self, config): |
121 | 121 | self.common_density_values = config.getlists("common_density_values", |
122 | 122 | ("PLA:1.24", "PETG:1.23", "ABS:1.04", "ASA:1.07")) |
123 | 123 | self.common_density_values = list(self.common_density_values) |
| 124 | + self.test_extrude_amt = config.get('test_extrude_amt', 10) |
124 | 125 |
|
125 | 126 | #LED SETTINGS |
126 | 127 | self.ind_lights = None |
127 | | - # led_name is not used, either use or needs to be removed, removing this would break everyones config as well |
| 128 | + # led_name is not used, either use or needs to be removed, removing this would break everyone's config as well |
128 | 129 | self.led_name = config.get('led_name',None) |
129 | 130 | self.led_off = "0,0,0,0" |
130 | 131 | self.led_fault = config.get('led_fault','1,0,0,0') # LED color to set when faults occur in lane (R,G,B,W) 0 = off, 1 = full brightness. |
@@ -195,6 +196,9 @@ def __init__(self, config): |
195 | 196 | self.enable_assist = config.getboolean("enable_assist", True) |
196 | 197 | # Weight spool has to be below to activate print assist |
197 | 198 | self.enable_assist_weight = config.getfloat("enable_assist_weight", 500.0) |
| 199 | + self.enable_hub_runout = config.getboolean("enable_hub_runout", True) |
| 200 | + self.enable_tool_runout = config.getboolean("enable_tool_runout", True) |
| 201 | + self.debounce_delay = config.getfloat("debounce_delay", 0.) |
198 | 202 |
|
199 | 203 | self.debug = config.getboolean('debug', False) # Setting to True turns on more debugging to show on console |
200 | 204 | self.testing = config.getboolean('testing', False) # Set to true for testing only so that failure states can be tested without stats being reset |
@@ -248,8 +252,8 @@ def _update_trsync(self, config): |
248 | 252 | if update_trsync: |
249 | 253 | try: |
250 | 254 | import mcu |
251 | | - trsync_value = config.getfloat("trsync_timeout", 0.05) # Timeout value to update in klipper mcu. Klippers default value is 0.025 |
252 | | - trsync_single_value = config.getfloat("trsync_single_timeout", 0.5) # Single timeout value to update in klipper mcu. Klippers default value is 0.250 |
| 255 | + trsync_value = config.getfloat("trsync_timeout", 0.05) # Timeout value to update in klipper mcu. Klipper's default value is 0.025 |
| 256 | + trsync_single_value = config.getfloat("trsync_single_timeout", 0.5) # Single timeout value to update in klipper mcu. Klipper's default value is 0.250 |
253 | 257 | self.logger.info("Applying TRSYNC update") |
254 | 258 |
|
255 | 259 | # Making sure value exists as kalico(danger klipper) does not have TRSYNC_TIMEOUT value |
@@ -309,10 +313,10 @@ def handle_connect(self): |
309 | 313 | try: |
310 | 314 | self.bypass = self.printer.lookup_object('filament_switch_sensor bypass').runout_helper |
311 | 315 | except: |
312 | | - self.bypass = add_filament_switch("filament_switch_sensor virtual_bypass", "afc_virtual_bypass:virtual_bypass", self.printer ).runout_helper |
| 316 | + self.bypass = add_filament_switch("virtual_bypass", "afc_virtual_bypass:virtual_bypass", self.printer ).runout_helper |
313 | 317 |
|
314 | 318 | if self.show_quiet_mode: |
315 | | - self.quiet_switch = add_filament_switch("filament_switch_sensor quiet_mode", "afc_quiet_mode:afc_quiet_mode", self.printer ).runout_helper |
| 319 | + self.quiet_switch = add_filament_switch("quiet_mode", "afc_quiet_mode:afc_quiet_mode", self.printer ).runout_helper |
316 | 320 |
|
317 | 321 | # Register G-Code commands for macros we don't want to show up in mainsail/fluidd |
318 | 322 | self.gcode.register_command('TOOL_UNLOAD', self.cmd_TOOL_UNLOAD, desc=self.cmd_TOOL_UNLOAD_help) |
@@ -378,7 +382,7 @@ def _get_default_material_temps(self, cur_lane): |
378 | 382 | in AFC.cfg and sees if a temperature exists for filament material. |
379 | 383 |
|
380 | 384 | :param cur_lane: Current lane object |
381 | | - :return truple : float for temperature to heat extruder to, |
| 385 | + :return tuple : float for temperature to heat extruder to, |
382 | 386 | bool True if user is using min_extruder_temp value |
383 | 387 | """ |
384 | 388 | try: |
@@ -1488,7 +1492,6 @@ def cmd_CHANGE_TOOL(self, gcmd): |
1488 | 1492 | CHANGE_TOOL LANE=lane1 PURGE_LENGTH=100 |
1489 | 1493 | ``` |
1490 | 1494 | """ |
1491 | | - self.afcDeltaTime.set_start_time() |
1492 | 1495 | # Check if the bypass filament sensor detects filament; if so, abort the tool change. |
1493 | 1496 | if self._check_bypass(unload=False): return |
1494 | 1497 |
|
@@ -1530,6 +1533,7 @@ def cmd_CHANGE_TOOL(self, gcmd): |
1530 | 1533 | self.CHANGE_TOOL(self.lanes[self.tool_cmds[Tcmd]], purge_length) |
1531 | 1534 |
|
1532 | 1535 | def CHANGE_TOOL(self, cur_lane, purge_length=None, restore_pos=True): |
| 1536 | + self.afcDeltaTime.set_start_time() |
1533 | 1537 | # Check if the bypass filament sensor detects filament; if so, abort the tool change. |
1534 | 1538 | if self._check_bypass(unload=False): return |
1535 | 1539 |
|
|
0 commit comments