From 3e6c1aa398d29c67f3c4bd4e055af6bedaa2a8e4 Mon Sep 17 00:00:00 2001 From: weemantella <161925311+weemantella@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:54:43 -0600 Subject: [PATCH 1/2] Add CHANGE_BOWDEN_LENGTH --- extras/AFC.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/extras/AFC.py b/extras/AFC.py index 60a3daa..6124a64 100644 --- a/extras/AFC.py +++ b/extras/AFC.py @@ -64,6 +64,7 @@ def __init__(self, config): self.tool_stn = config.getfloat("tool_stn", 120) self.tool_stn_unload = config.getfloat("tool_stn_unload", self.tool_stn) self.afc_bowden_length = config.getfloat("afc_bowden_length", 900) + self.config_bowden_length = self.afc_bowden_length # MOVE SETTINGS self.tool_sensor_after_extruder = config.getfloat("tool_sensor_after_extruder", 0) @@ -90,11 +91,32 @@ def __init__(self, config): self.gcode.register_command('TEST', self.cmd_TEST, desc=self.cmd_TEST_help) self.gcode.register_command('HUB_CUT_TEST', self.cmd_HUB_CUT_TEST, desc=self.cmd_HUB_CUT_TEST_help) self.gcode.register_command('RESET_FAILURE', self.cmd_CLEAR_ERROR, desc=self.cmd_CLEAR_ERROR_help) + self.gcode.register_mux_command('SET_BOWDEN_LENGTH', 'AFC', None, self.cmd_SET_BOWDEN_LENGTH, desc=self.cmd_SET_BOWDEN_LENGTH_help) self.VarFile = config.get('VarFile') # Get debug and cast to boolean #self.debug = True == config.get('debug', 0) self.debug = False + cmd_SET_BOWDEN_LENGTH_help = "Set length of bowden, hub to toolhead" + def cmd_SET_BOWDEN_LENGTH(self, gcmd): + config_bowden = self.afc_bowden_length + length_param = gcmd.get('LENGTH', None) + if length_param is None or length_param.strip() == '': + bowden_length = self.config_bowden_length + else: + if length_param[0] in ('+', '-'): + bowden_value = float(length_param) + bowden_length = config_bowden + bowden_value + else: + bowden_length = float(length_param) + self.afc_bowden_length = bowden_length + msg = ("Config Bowden Length: {}\n".format(self.config_bowden_length) + + "Previous Bowden Length: {}\n".format(config_bowden) + + "New Bowden Length: {}".format(bowden_length) + + "TO SAVE BOWDEN LENGTH afc_bowden_length MUST BE UNPDATED IN AFC.cfg") + self.respond_info(msg) + self.gcode.respond_info(msg) + cmd_LANE_MOVE_help = "Lane Manual Movements" def cmd_LANE_MOVE(self, gcmd): lane = gcmd.get('LANE', None) From 9b64d7bf4432ae73c742ed7913c25402345352a0 Mon Sep 17 00:00:00 2001 From: weemantella <161925311+weemantella@users.noreply.github.com> Date: Tue, 22 Oct 2024 14:12:20 -0600 Subject: [PATCH 2/2] remove whitespace --- extras/AFC.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/AFC.py b/extras/AFC.py index 6124a64..c700c29 100644 --- a/extras/AFC.py +++ b/extras/AFC.py @@ -706,7 +706,7 @@ def get_status(self, eventtime): str["system"]['num_units'] = len(self.lanes) str["system"]['num_lanes'] = numoflanes return str - + def is_homed(self): curtime = self.reactor.monotonic() kin_status = self.toolhead.get_kinematics().get_status(curtime)