Skip to content

Commit

Permalink
filafeeder: 增加feed_setting命令的参数
Browse files Browse the repository at this point in the history
  • Loading branch information
G authored and G committed Oct 28, 2024
1 parent be31816 commit 0cff263
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion klippy/extras/filafeeders.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def __init__(self, config, sensor, bVirtualFeeder=False):
self.runout_length = config.getfloat('runout_length', 100, above=1)
self.runout_pos = 0.0 # runout position, the extruder's position when the runout happened.

self.switch_feed_len = 5.0 # feed length when switch is pressed.
self.feed_delay = config.getfloat('feed_delay', 0.5, minval=0.1) # check switch per delay time or check virtual feeder position.

self.bVirtualFeeder = bVirtualFeeder
Expand Down Expand Up @@ -549,9 +550,17 @@ def cmd_FEED_STATUS(self, gcmd):
def cmd_FEED_SETTING(self, gcmd):
self.runout_length = gcmd.get_float('RUNOUT_LENGTH', self.runout_length, minval=1.0)
self.feed_delay = gcmd.get_float('FEED_DELAY', self.feed_delay, minval=0.1) # check switch per delay time or check virtual feeder position.
msg = "feeder %s setting: runout_len:%.1f, feed_delay:%.1f" % (self.name, self.runout_length, self.feed_delay)
self.feed_speed = gcmd.get_float('SPEED', self.feed_speed, minval=1.0)
msg = "feeder %s setting: runout_length:%.1f, feed_delay:%.1f, feed_speed:%.1f" % (self.name, self.runout_length, self.feed_delay, self.feed_speed)
self.max_feed_len = gcmd.get_float('MAX_LEN', self.max_feed_len, minval=1.0)
self.init_feed_len = gcmd.get_float('INIT_LEN', self.init_feed_len, minval=1.0)
self.switch_feed_len = gcmd.get_float('FEED_LEN', self.switch_feed_len)
msg += "\nfeeder %s setting: max_len:%.1f, init_len:%.1f, feed_len:%.1f" % (self.name, self.max_feed_len, self.init_feed_len, self.switch_feed_len)
self._loginfo(msg, 1) #only response at command line.

#update the runout pos when the setting is changed.
self._update_runout_pos(self.reactor.monotonic())

######################################################################
# Bang-bang control algo
######################################################################
Expand Down

0 comments on commit 0cff263

Please sign in to comment.