aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
Commit message (Collapse)AuthorAgeFilesLines
* adc_temperature: Calculate PT1000 temperature/resistance pairs from formulaKevin O'Connor2020-08-221-4/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_move: Move GCodeMove class from gcode.py to new extras moduleKevin O'Connor2020-08-2010-278/+289
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Split G0/G1 command handling to new gcode_move classKevin O'Connor2020-08-2012-189/+209
| | | | | | | | Split up the main GCodeParser class into GCodeDispatch and GCodeMove classes. The GCodeMove class is now available using the "gcode_move" printer object name. This split simplifies the gcode.py code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Move G4 and M400 commands from gcode.py to toolhead.pyKevin O'Connor2020-08-202-9/+11
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Convert get_status() last_xpos to use a namedtupleKevin O'Connor2020-08-202-6/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Remove unneeded base_xpos variables from get_status()Kevin O'Connor2020-08-202-8/+6
| | | | | | Convert the only user of base_zpos to use gcode_position. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Convert get_status() homing_xpos to use a namedtupleKevin O'Connor2020-08-202-4/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Remove unused move_xpos get_status() variablesKevin O'Connor2020-08-201-4/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Remove unused get_stats() dataKevin O'Connor2020-08-201-10/+2
| | | | | | | The "status" and "printing_time" are now available in the "idle_timeout" module, so no need to report them from toolhead. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Remove "action_" commands from get_status() callsKevin O'Connor2020-08-207-36/+36
| | | | | | | | | | | | 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>
* toolhead: Add a manual_move() helper functionKevin O'Connor2020-08-206-55/+34
| | | | | | | | 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>
* skew_correction: Make sure to call reset_last_position() on a skew updateKevin O'Connor2020-08-201-7/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Automatically call reset_last_position() on a toolhead set_position()Kevin O'Connor2020-08-208-9/+3
| | | | | | | | 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>
* menu: reduce timeout timer period to 1sJanar Sööt2020-08-201-7/+2
| | | | Signed-off-by: Janar Sööt <janar.soot@gmail.com>
* display: Support requesting a screen redraw on a menu key pressKevin O'Connor2020-08-202-12/+23
| | | | | | | | 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>
* hall_filament_width_sensor: Fix Flow update before next pending_position ↵alocin732020-08-191-7/+14
| | | | | | | | | #3184 (#3198) 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>
* menu: remove surplus self.running=FalseJanar Sööt2020-08-181-2/+0
| | | | Signed-off-by: Janar Sööt <janar.soot@gmail.com>
* menu: optimize container populateJanar Sööt2020-08-181-13/+8
| | | | | | | | | - 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>
* klippy: Report "shutdown" category from get_state_message()Kevin O'Connor2020-08-161-0/+2
| | | | | | Reported by @Arksine. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* webhooks: Improve type checking of api requestsKevin O'Connor2020-08-161-29/+31
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* webhooks: Convert to a json-rpc inspired message formatKevin O'Connor2020-08-161-21/+26
| | | | | | | | | | | | Convert to a new json message format. Requests look like: {"id":14, "method": "info", "params": {}} and responses look like: {"id": 14, "result": {}} Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* webhooks: Remove call_remote_method()Kevin O'Connor2020-08-161-13/+1
| | | | | | Clients will now only receive messages that they've subscribed to. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* webhooks: Add klippy state to webhooks get_status() methodKevin O'Connor2020-08-161-11/+4
| | | | | | | | 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>
* webhooks: Rework get_status() subscriptionsKevin O'Connor2020-08-161-116/+89
| | | | | | | | | 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>
* webhooks: Require a subscription to receive gcode outputKevin O'Connor2020-08-163-32/+53
| | | | | | | | | | | 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>
* webhooks: Remove "method" parameter from webhook requestsKevin O'Connor2020-08-164-67/+31
| | | | | | | Don't require or use the "method" parameter of requests. This simplifies the interface. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* webhooks: Create StatusHandler class in add_early_printer_objects()Kevin O'Connor2020-08-161-4/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* webhooks: Remove register_static_path()Kevin O'Connor2020-08-162-32/+10
| | | | | | | | 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>
* webhooks: Specify server_address on klippy command-lineKevin O'Connor2020-08-162-9/+11
| | | | | | | | 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>
* display: Remove reference to printer.gcode.busy from display.cfgKevin O'Connor2020-08-151-1/+1
| | | | | | The "busy" variable was removed and using it isn't necessary. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* menu: fix for overwriting existing menu item (#3189)Janar Sööt2020-08-141-1/+3
| | | | | | 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>
* hall_filament_width_sensor: fix errorJanar Sööt2020-08-131-0/+1
| | | | | | Fix no attribute error in in get_status Signed-off-by: Janar Sööt <janar.soot@gmail.com>
* virtual_sdcard: register sd static pathArksine2020-08-111-0/+3
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* webhooks: register gcode output handler and additional static pathsArksine2020-08-111-0/+24
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* webhooks: Implement a send buffer for socket writesArksine2020-08-111-25/+29
| | | | | | This prevents ClientConnection.send() from blocking, removing the possibility that callers become reentrant. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* webhooks: Implement unix domain socket serverArksine2020-08-111-38/+77
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* adc_temperature: add support for AD597 (#3164)Bryan Boettcher2020-08-091-0/+9
| | | | | | The AD597 thermocouple amplifier is used in the Raise3D N2+ (and possibly others). Signed-off-by: Bryan Boettcher <bryan.boettcher@gmail.com>
* menu: Replace menu with new Jinja2 template system (#2344)Janar Sööt2020-08-093-1425/+1143
| | | | | | | | | | | | | | | 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>
* tmc5160: diag0 support (#3159)Trevor Jones2020-08-094-10/+16
| | | | | Allow for diag0 only hardware to use sensorless homing. Signed-off-by: Trevor Jones <trevorjones141@gmail.com>
* itersolve: Use stricter completion check in itersolve_find_step()Kevin O'Connor2020-08-081-2/+4
| | | | | | | | 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>
* itersolve: Enhance "false position" method with "illinois algorithm"Kevin O'Connor2020-08-081-1/+8
| | | | | | | 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>
* gcode: Fix error causing _dump_debug() to failKevin O'Connor2020-08-081-7/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_arcs: increment absolute e coord for each arc segment (#3162)Toby Harper2020-08-071-0/+2
| | | | | | | 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>
* fan_generic: Add support for named fans and gcode to control them (#3054)bondus2020-08-071-0/+28
| | | Signed-off-by: Pontus Borg <liquidpontus@yahoo.se>
* polar: fix limit_z default valueArksine2020-08-061-2/+2
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* webhooks: Implement StatusHandler classArksine2020-08-061-1/+134
| | | | | | 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>
* webhooks: Add call_remote_method helper functionArksine2020-08-061-0/+12
| | | | | | This may be used to execute formatted RPC calls. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* gcode: Separate IO handling to its own classKevin O'Connor2020-08-061-111/+127
| | | | | | | 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>
* webhooks: Directly invoke printer.invoke_shutdown()Kevin O'Connor2020-08-061-2/+1
| | | | | | | No need to indirectly shutdown via the gcode class - just call printer.invoke_shutdown() directly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* webhooks: Introduce add_early_printer_objects()Kevin O'Connor2020-08-062-2/+6
| | | | | | | Create the initial gcode class via new module level add_early_printer_objects() function. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>