aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/virtual_sdcard.py
Commit message (Collapse)AuthorAgeFilesLines
* virtual_sdcard: add `file_path` and `file_size` to `status`Kamil Trzcinski2021-06-221-5/+15
| | | | | | | This provides a comprehensive information if currently we have a file loaded. Signed-off-by: Kamil Trzcinski <ayufan@ayufan.eu>
* print_stats: add `cancelled` when `CANCEL_PRINT` used (#4366)Kamil TrzciƄski2021-06-141-2/+12
| | | | | | | | | | | Before this change, a `CANCEL_PRINT` set a `print_stats` to `paused` that would later be workaround-ed with `fluidd`/`mainsail` to re-define `CANCEL_PRINT`. This sets a proper canceled state, but additionally closes a file from a `virtual_sdcard` context for `canceled`/`error`, as this is no longer resumable from this point. Signed-off-by: Kamil Trzcinski <ayufan@ayufan.eu>
* loop_sdcard: Add loopable SD card file sectionsJason S. McMullan2021-05-261-3/+23
| | | | | | | | | | | | | | | | | | | | | To support continuous belt printing, add nestable repeat loop support via an `[sdcard_loop]` module. Supported G-Code: - SDCARD_LOOP_BEGIN COUNT=n ; Loop for N times, or infinitely if N is 0 - SDCARD_LOOP_END ; End of loop - SDCARD_LOOP_DESIST ; Complete all loops without iterating Marlin M808 compatibility example in `config/sample-macros.cfg`: - M808 Ln ; Loop for N times, or infinitely if N is 0 - M808 ; End of loop - M808 K ; Complete all loops without iterating Added unit tests in test/klippy/sdcard_loop.test See https://reprap.org/wiki/G-code#M808:_Set_or_Goto_Repeat_Marker Signed-off-by: Jason S. McMullan <jason.mcmullan@gmail.com>
* virtual_sdcard: fix check for case sensitive filesArksine2021-05-111-1/+2
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* palette2: Add support for P2 devices (#4057)Clifford Roche2021-03-261-5/+7
| | | | | Module which bring support for P2 devices running in connected mode. This enables using a Palette2 directly with Klippy without Octoprint, or without Palette2 plugins for Octoprint which are not functional out of the box with Klipper. Signed-off-by: Clifford Roche <clifford.roche@gmail.com>
* virtual_sdcard: exact filename match before case insensitive oneAndre LeBlanc2021-02-261-1/+3
| | | | | | | | | currently, if there are 2 files on the virtual sd card whose names differ only in case (eg. MyFile.gcode vs myfile.gcode) the actual file that gets loaded is at best unpredictable. this patch checks for an exact match before attempting a case-insensitive one. Signed-off-by: Andre LeBlanc <andrepleblanc@gmail.com>
* gcode: Split G0/G1 command handling to new gcode_move classKevin O'Connor2020-08-201-1/+0
| | | | | | | | 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>
* webhooks: Remove register_static_path()Kevin O'Connor2020-08-161-3/+0
| | | | | | | | 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>
* virtual_sdcard: register sd static pathArksine2020-08-111-0/+3
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* print_stats: Add virtual_sdcard state trackingArksine2020-08-051-1/+2
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* print_stats: stat tracking for virtual sdcard prints in progressArksine2020-08-051-0/+9
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* virtual_sdcard: update get_status methodArksine2020-08-051-2/+4
| | | | | | Do not reset progress to zero while paused. Report 'is_active' and 'file_position'. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* virtual_sdcard: add SDCARD_PRINT_FILE gcodeArksine2020-08-051-16/+45
| | | | | | | 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>
* virtual_sdcard: add SDCARD_RESET_FILE gcodeArksine2020-08-051-0/+16
| | | | | | This allows the user to close a currently loaded file and reset the virtual_sdcard's state. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* virtual_sdcard: Use new GCodeCommand wrappersKevin O'Connor2020-05-051-25/+25
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Rename respond() to respond_raw()Kevin O'Connor2020-04-241-9/+9
| | | | | | | | | | | Rename the method to make it more clear that it is a low-level call that should be rarely used. Also, change gcode_button.py, hall_filament_width_sensor.py, and tsl1401cl_filament_width_sensor.py to use respond_info() instead of respond_raw(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: No need to call gcode.respond_error() on disk errorKevin O'Connor2020-04-241-2/+0
| | | | | | | Report low-level disk errors via the log and use the normal sdcard mechanism to report end of sdcard print to gcode users. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: Don't wait for M25 in an SD gcode fileKevin O'Connor2019-11-241-2/+5
| | | | | | | | If an M25 is in a gcode file that is being printed from virtual SD, it would cause a permanent hang. Detect that case and don't wait for those M25 commands. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: Only return from M25 after print confirmed pausedKevin O'Connor2019-10-311-1/+2
| | | | | | | | | | Wait in the M25 command handler until the work_handler() background timer fully exits. This ensures that subsequent g-code commands (such as M27 or M24) will correctly report a paused state. Reported by @foosel. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Eliminate the process_batch() methodKevin O'Connor2019-06-091-4/+6
| | | | | | | Allow the callers of process_batch() to directly inspect the gcode mutex. Those callers can then directly invoke run_script(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: consistent sorting (#1387)Trevor Jones2019-04-141-2/+4
| | | Signed-off-by: Trevor Jones <trevorjones141@gmail.com>
* pause_resume: Implement send_pause_command()Arksine2019-03-011-2/+4
| | | | | | This allows for pausing from inside a reactor callback. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* virtual_sdcard: Don't list files starting with a '.'Kevin O'Connor2019-02-081-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: prepare for pause_resume implementationArksine2019-01-281-1/+3
| | | | | | | - Add is_active() member function to return the active printing status of the virtual sdcard - M27 now reports current file position when file has been opened. See http://marlinfw.org/docs/gcode/M027.html Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* klippy: Convert printer_state("shutdown") to an event handlerKevin O'Connor2019-01-081-2/+3
| | | | | | | Convert all users of the printer_state("shutdown") handler to register a "klippy:shutdown" event handler instead. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: process_batch() should execute commands atomicallyKevin O'Connor2018-10-281-1/+1
| | | | | | | Update the process_batch() method so that it will not interleave commands read from the input fd with the batched commands. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: Check if other events need to run after each file readKevin O'Connor2018-08-021-0/+1
| | | | | | | Periodically check if other events need to run - this prevents the virtual_sdcard processing from starving other events. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Raise an error if a duplicate command is registeredKevin O'Connor2018-05-201-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: Add logging on start, stop, stats, and shutdownKevin O'Connor2018-04-231-0/+18
| | | | | | Add additional logging to the virtual_sdcard support. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Add minval/maxval/above/below options to get_X parsersKevin O'Connor2018-04-201-1/+1
| | | | | | Add value checking to gcode parameter parsing code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: Fix typo in seek error handlingKevin O'Connor2018-03-121-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* display: Add initial support for LCD screens attached to an MCUKevin O'Connor2018-03-061-0/+5
| | | | | | | | Add support for displaying basic status information on ST7920 and HD44780 based LCDs that are attached directly to a micro-controller. Signed-off-by: Marcio Teixeira <marcio@alephobjects.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: Remove trailing '*' checksum indicator from M23 commandKevin O'Connor2018-03-021-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: Initial support for virtual sdcardKevin O'Connor2018-02-111-0/+155
Add support for directly printing from a local file on the host. This may be useful if the host cpu is not fast enough to run OctoPrint well. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>