diff options
author | Arksine <arksine.code@gmail.com> | 2019-09-07 08:33:44 -0400 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2019-09-08 20:42:43 -0400 |
commit | 49779f13a23be766b3a131a285f7fb5447488c74 (patch) | |
tree | fb23c2416a1494c0a7176f8b7b35048d9dc2a547 | |
parent | a78329d0b24aca97532b8d33355a5cc82d54575d (diff) | |
download | kutter-49779f13a23be766b3a131a285f7fb5447488c74.tar.gz kutter-49779f13a23be766b3a131a285f7fb5447488c74.tar.xz kutter-49779f13a23be766b3a131a285f7fb5447488c74.zip |
filament_switch_sensor: Add a delay between dispatch of pause and execution of pause gcode
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
-rw-r--r-- | config/example-extras.cfg | 5 | ||||
-rw-r--r-- | klippy/extras/filament_switch_sensor.py | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/config/example-extras.cfg b/config/example-extras.cfg index 4f220502..bf91e113 100644 --- a/config/example-extras.cfg +++ b/config/example-extras.cfg @@ -1683,6 +1683,11 @@ # The minimum amount of time in seconds to delay between events. # Events triggered during this time period will be silently # ignored. The default is 3 seconds. +#pause_delay: 0.5 +# The amount of time to delay, in seconds, between the pause command +# dispatch and execution of the runout_gcode. It may be useful to +# increase this delay if Octoprint exhibits strange pause behavior. +# Default is 0.5 seconds. #switch_pin: # The pin on which the switch is connected. This parameter must be # provided. diff --git a/klippy/extras/filament_switch_sensor.py b/klippy/extras/filament_switch_sensor.py index a5b189df..257980a8 100644 --- a/klippy/extras/filament_switch_sensor.py +++ b/klippy/extras/filament_switch_sensor.py @@ -21,6 +21,7 @@ class BaseSensor(object): if config.get('insert_gcode', None) is not None: self.insert_gcode = gcode_macro.load_template( config, 'insert_gcode') + self.pause_delay = config.getfloat('pause_delay', .5, above=.0) self.runout_enabled = False self.insert_enabled = self.insert_gcode is not None self.event_running = False @@ -52,6 +53,7 @@ class BaseSensor(object): pause_resume = self.printer.lookup_object('pause_resume') pause_resume.send_pause_command() pause_prefix = "PAUSE\n" + self.printer.get_reactor().pause(eventtime + self.pause_delay) self._exec_gcode(pause_prefix, self.runout_gcode) self.event_running = False def _insert_event_handler(self, eventtime): |