Rename printer.gcode.action_emergency_stop() to
action_emergency_stop(), printer.gcode.action_respond_info() to
action_respond_info(), and printer.gcode.action_respond_error() to
action_raise_error() in command templates.
This simplifies the get_status() interface, as returning callable
functions from that interface was confusing.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a helper function for submitting relative movements. This
function will also automatically ensure gcode.reset_last_position() is
called.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Generate a "toolhead:set_position" event on a call to
toolhead.set_position() and use that event to automatically call
gcode.reset_last_position().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a request_redraw() method and call it when a key menu event
occurs. Limit these proactive screen redraws to no more than 4 per
second.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
After reading the first item of self.filament_array, filament_width is updated back to self.nominal_filament_dia or self.diameter instead of retaining the value until next pending_position.
Updated Filament Menu Template.
Signed-off-by: Nicola Falciani <nicola.fal@gmail.com>
- don't populate all items at once
- populate items when container is pushed to stack
- precreate List back item, don't create it during populate.
- don't update items during populate
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
Clients can now subscribe to the webhooks get_status() info to
determine if the printer state changes. It is no longer needed to
send a message to all clients on a shutdown transition.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Implement a new subscription system for get_status() updates.
Subscriptions are per-client. After an initial update, only changes
will be transmitted. Responses are only transmitted to the client
that issued the subscription.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a new "gcode/subscribe_output" webhook endpoint to subscribe to
gcode output. Only client connections that subscribe to the gcode
output will receive that output.
This also moves all the gcode webhooks from gcode.py to webhooks.py
and arranges for gcode.py to be initialized prior to webhooks.py.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use the "info" webhook to pass critical process information back to
the caller. The remaining users of register_static_path() can get the
required information via get_status() calls.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't default to "/tmp/klippy_uds" for the webhooks unix domain socket
filename. Instead, require the filename to be specified on the
command-line (via a new "-a" parameter).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
In case of an overwriting existing menu item,
the new item was added additionally to the end of the items list.
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
This prevents ClientConnection.send() from blocking, removing the possibility that callers become reentrant.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
menu.cfg:
- jinja2 template scripting
- new Setup menu
- new Calibration menu
menu:
- redesigned menu code
- jinja2 support
- option to reverse menu up and down directions
- functionality set to support menu injection from other modules
- a new way of defining menu hierarchy
- other adjustments
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
Use a more strict check for determining if the iterative solver has
correctly found a step - the guess must be within 1 picometer of the
target or correct to within 1 nanosecond.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This prevents some cases where the iterative solver fails to converge
in a reasonable time, causing "no next step" errors.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Arc travel was working but extrusion in absolute mode seemed not to be happening at all. This was because the E coord being sent with each G1 segment of the arc was not incrementing, effectively the same value was being sent over and over so the total extrusion for the whole arc was the amount for just one segment which is an extremely tiny amount.
My change increments e_base by e_per_move for each subsequent coord when in absolute extrude mode which results in the correct absolute E value being sent for each segment.
Signed-off-by: Toby Harper <toby@fuith.org>
This class provides endpoints that allow connected hosts to fetch the state of printer objects and subscribe to state "pushed" over the connection.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Move the pseudo-tty IO handling from the main gcode class to a new
gcode_io class. This simplifies the main gcode class.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
If there isn't a reader of the output pipe it can lead to the
generation of a large number of errors. Only attempt to write if it
appears the pipe is active.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
SDCARD_PRINT_FILE allows Klipper to load and start the print for any
gcode file within the virtual_sdcard path, including subdirectories.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>