Commit Graph

139 Commits

Author SHA1 Message Date
Kevin O'Connor 787ed452c2 klippy: Rename try_load_module() to load_object()
Rename try_load_module() so that it uses consistent naming for
"printer objects".  Change the function to raise an error by default
if the specified module does not exist.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-08 11:05:14 -04:00
Kevin O'Connor a68bb935df menu: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:12 -04:00
Kevin O'Connor d3a7d992aa display: Remove unused self.lcd_type variable
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-21 12:12:29 -04:00
Kevin O'Connor 5e39d346ed display: Use the active extruder in the default 16x4 screen layout
Change the default layout to show the active extruder (not always the
first extruder).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-13 21:50:38 -04:00
Kevin O'Connor f2dd4b001d display: Use a separate display group for 16x4 multiple extruders
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-13 21:46:36 -04:00
Kevin O'Connor 986e9c884a display: Fix percent progress rendering on 16x4 multi-extruder layout
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-08 17:55:53 -04:00
Arksine aa7d24b0af display: add support for multiple displays
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-03-08 17:38:24 -04:00
Kevin O'Connor 6d5ce309a5 menu: Remove the "test" menu from the default menu
It is likely only developers will be interested in testing the menu
system, so no need to have it in the default menu.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-08 17:38:24 -04:00
Kevin O'Connor d39c4fe628 menu: Disable support for "deck" and "card" menu items
Disable support for customizing the main lcd display content via the
menu system.  Advise users to use the new display_data config sections
as a replacement.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-08 17:38:24 -04:00
Kevin O'Connor 2cf03ffa23 display: Replace hard-coded display with new config based display
Introduce a new config based system for specifying the on-screen
contents of an lcd screen.  The default screen configuration (found in
klippy/extras/display/display.cfg) is the same as the previous
hard-coded display, so this should not change behavior for existing
users.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-08 17:38:21 -04:00
Kevin O'Connor 5acc181624 display_status: Separate out M73 and M117 handling to new module
Move M73 and M117 handling from display.py to a new display_status.py
module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-03-08 17:36:14 -04:00
Christian S aa0a889b04
menu: Set speed for move actions (#2520)
Signed-off-by: Christian Schnellrieder <schnellrieder.cs@gmail.com>
2020-02-17 20:52:54 -05:00
Kevin O'Connor ef4710c6e0 hd44780: Increase timeout to 40us
There have been several reports that increasing the delay from 37us to
40us eliminates screen corruption on some clone hd44780 displays.
Increase the timeout value so that the standard code works on these
displays.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-24 00:04:31 -05:00
Kevin O'Connor 0a86190bae display: Revert "display: Add ST7567 display support (#1540)"
This reverts commit 1b92af6078.

The standard "uc1701" lcd_type can now be used in place of the custom
"st7567" lcd_type.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-18 12:30:20 -05:00
Kevin O'Connor e310e5f0e8 uc1701: Add a delay after reset toggle (for displays using ResetHelper)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-03 11:13:54 -05:00
Kevin O'Connor 2d97e0e218 uc1701: Add support for rst_pin
Add support for an optional uc1701 rst_pin.  Use the same reset pin
code handling with the SSD1306 code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-02 10:25:30 -05:00
Kevin O'Connor 2e7f38eadd hd44780: Use two separate text framebuffers
There is concern that some lcd boards that emulate the hd44780 don't
support text updates that wrap the two text framebuffers.  Update the
code to treat the two text areas as two separate framebuffers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-01 19:18:52 -05:00
Matt Baker 8d93d1a8ef uc1701: add config option for sh1106 type with up to 132 columns.
Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
2019-11-26 19:40:39 -05:00
Kevin O'Connor d40f951d6f buttons: Remove MCU_ADC_buttons debug capability
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 18:32:26 -05:00
Kevin O'Connor ed610a6600 extruder: Consistently use "extruder" for the primary extruder
No longer allow the primary extruder to be named "extruder0".  This
avoids internal and external confusion between the printer objects and
config section names.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 16:28:47 -05:00
Kevin O'Connor 96fdb6ef36 uc1701: Add support for a reset line on SSD1306 displays
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-17 22:14:02 -04:00
Kevin O'Connor 05bb5484b4 bus: Add MCU_bus_digital_out helper class
Add a helper class for tracking gpio outputs that are synchronized to
bus updates on a particular command queue.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-17 22:14:02 -04:00
fess 79cec9ba5c menu: use MOVE=1 for offset_z menu
use SET_GCODE_OFFSET's MOVE=1 parameter in the z offset menu.
Less confusing for people who think nothing happened.

Signed-off-by: John "Fess" Fessenden <fess@fess.org>
2019-07-31 11:17:31 -04:00
Kevin O'Connor 0bb714edd7 menu: Remove customized get_status overrides
Now that the extruder, display, heater_fan, output_pin, and servo
classes have get_status() methods, it is no longer necessary to
override them in the menu code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 11:55:40 -04:00
Janar Sööt df765b33dc display: add get_status method
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 11:51:46 -04:00
alfsoft 777013da4f menu: Changed Menu item "Feed Filament" name (#1609)
"Feed Filament" menu item value was off-screen that made this item useless. So I changed its name to just "Feed". Users shall easily guess that this item is for filament feeding because this item is located in "Filament" menu.

Signed-off-by: Alexander Fadeev <alfsoft@gmail.com>
2019-05-09 14:41:37 -04:00
Dmitry 1b92af6078 display: Add ST7567 display support (#1540)
Signed-off-by: Dmitry Budaev <condemil@gmail.com>
2019-04-15 21:07:29 -04:00
Janar Sööt 0a392b6543 menu: initial support for analog buttons (#977)
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-04-14 11:18:52 -04:00
Arksine 2e16be224e uc1701: make contrast configurable
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2019-04-02 15:53:16 -04:00
Robert Konklewski 6f91574cd9 menu: Show current positions based on gcode positions (#1389)
menu: Show current positions based on gcode positions

Added "move_[xyze]pos" properties to the "gcode" object for use in menus.
The new properties track the toolhead's position in gcode coordinates,
taking gcode and bed leveling offsets into account.
This position is equal to the value returned by M114 gcode.

Changes the move menus to show current position based on gcode
position. This allows gcode offsets and bed leveling offsets
to be taken into account, and prevents unexpected toolhead
movements when moving it using the menu.

Signed-off-by: Robert Konklewski <nythil@gmail.com>
2019-03-21 10:37:28 -04:00
amblidex e2af1c1f2a menu: Set input_max for moving toolhead in menu to same value for all move increments (#1372)
Signed-off-by: Frank Kang <amblidex@outlook.com>
2019-03-08 14:11:47 -05:00
Kevin O'Connor 1731fbbca4 gcode: Change respond_info() to log by default
It makes sense to log most respond_info() content, so do that by
default.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-04 13:04:18 -05:00
Kevin O'Connor ef1bf60ab7 hd44780: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:31:47 -05:00
Kevin O'Connor 51051478af st7920: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:31:31 -05:00
Kevin O'Connor e504147285 font8x14: Store font as strings instead of as bytearray
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:26:59 -05:00
Kevin O'Connor b260eb9168 gcode: Raise a config error on invalid register_command()
Raise a printer.config_error() on an invalid register_command() call.
This error is easier to handle for the vast majority of callers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-18 18:04:42 -05:00
Kevin O'Connor bf647749dd menu: Don't peek into printer.objects member variable
Use the printer.lookup_objects() method to get the list of available
printer objects.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-08 12:03:46 -05:00
Kevin O'Connor 797367b9f5 klippy: Convert printer_state("ready") to an event handler
Convert all users of the printer_state("ready") handler to register a
"klippy:ready" event handler instead.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-08 10:59:43 -05:00
Janar Sööt 3a4a1d678e menu: allow empty command gcode if action is present
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-01-07 21:39:50 -05:00
Janar Sööt 0cbe851777 menu: enhancements
- changes that make easier to use menu as module UI
- new helper method for delayed callbacks
- method for getting the menu instance from display
- new action for sending menu:action events
- allow_without_selection option for cards

Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-01-07 21:39:50 -05:00
Janar Sööt 005cbe157a menu: allow names in card content and simplify define single card decks
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-01-07 21:38:53 -05:00
Janar Sööt b9cccc5959 menu: support for click button long press
- long press with timer (button release is not needed anymore)
- initial support for edit mode long press gcode

Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-01-07 21:38:45 -05:00
Kevin O'Connor e26d1a3567 i2ccmds: Pass the i2c address as a 7-bit number (0-127)
The sam3 i2c code and the linux code use a 7-bit i2c address, while
the avr, lpc176x, and samd21 i2c code uses an 8-bit address with the
least significant bit always zero.  A similar issue occurred in the
host code (sx1509.py and replicape.py use 7-bit addresses while
uc1701.py and mcp4451.py use 8-bit addresses).

Consistently use 7-bit addresses in all the code.  This breaks
compatibility between host and mcu software, so make a change to the
config_i2c command to force users to synchronize software updates.
This also breaks common Smoothieboard configs, so update the mcp4451
code to validate the i2c_address.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-07 20:00:44 -05:00
Master92 6ccc0732c1 menu: Fix filament loading and unloading feature (#1082)
As discussed in #1057, the default loading- and unloading procedure does
not behave as expected. Setting the extruder to relative mode fixes this.

Signed-off-by: Nils Friedchen <Nils.Friedchen@googlemail.com>
2019-01-07 10:25:19 -05:00
Paulo Drugos ffbb4198c1 menu: Correction for the resume option appears when the toolhead is not printing (#1077)
Signed-off-by: Paulo Drugos paulodrugos@gmail.com
2019-01-05 19:11:03 -05:00
Kevin O'Connor 68ebde0d86 display: Fix handling of M117 command if lowercase 'm' is used
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-02 17:34:56 -05:00
Kevin O'Connor e5150fe187 uc1701: Add support for SSD1306 in i2c mode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-23 22:04:06 -05:00
Kevin O'Connor d2aa78c16a uc1701: Cache icons and fonts in byte display order
This reduces the amount of bit manipulaton needed during screen
updates.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor 065a8eb826 uc1701: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor a79d87ca8e uc1701: Add all_framebuffers to reduce vram indexing in the code
Add a self.all_framebuffers variable and change self.vram to only
contain the new display data.  This allows the main code to access the
self.vram member variable without the need to index for current/old
data.  (It also updates the code to match the latest st7920 and
hd44780 code.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor e231ac7422 uc1701: Add support for SSD1306 displays
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor a00d7b418f display: Add a get_dimensions() method to lcd chip classes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor 1c71ea27e0 uc1701: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
James b45ccfea97 display: FR icon changed to "Feed Rate" (#860)
Signed-off-by: James Wood <j@j-w.co>
2018-11-13 10:14:01 -05:00
Kevin O'Connor 29e0996858 display: Check for M117 inside of draw_status()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-18 20:43:43 -04:00
alfsoft 909eef3978 display: Corrected Fan icon graphics (#753)
Added new Copyright string, corrected Fan icon graphics

Signed-off-by: Alexander Fadeev <alfsoft@gmail.com>
2018-10-07 13:38:11 -04:00
Kevin O'Connor 97927172f1 st7920: Use display xor capability when animating glyphs
Use the xor capability of the display to animate the glyphs, which
reduces the number of glyphs needed from 4 to 2.  This should make it
easier to add future animations if desired.

Suggested by @marcio-ao.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-04 13:49:00 -04:00
alfsoft 630989c0fe display: Change Extruder, Bed and Fan icons design (#740)
Based on replies from Issue 652 (https://github.com/KevinOConnor/klipper/issues/652) only Extruder, Bed and Fan icons are changed. Feedrate icon stays untouched.

Signed-off-by: Alexander Fadeev <alfsoft@gmail.com>
2018-10-04 13:25:29 -04:00
Janar Sööt 50d1ad9019 menu.cfg: add fan glyph to __screen2004_static & __screen2004_input
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-10-02 12:49:12 -04:00
Janar Sööt b2691d4730 hd44780: new text glyph - fan
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-10-02 12:49:12 -04:00
Kevin O'Connor 820dd0b5e3 display: Don't error if M73 is missing a P parameter
Try to avoid raising an error on an M73 command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 12:31:31 -04:00
Kevin O'Connor 170b9678fb display: Don't error on an out of range M73 request
No need to report an error if the M73 is not between 0 and 100 - just
display the nearest valid value.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-25 20:51:51 -04:00
Janar Sööt 18b56c3cda menu: vsdcard - scroll long filenames (#694)
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-09-25 14:52:23 -04:00
Kevin O'Connor f80456a698 configfile: Move config file code from klippy.py to new file
Add a klippy/configfile.py file with the code needed to read the main
printer config file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-25 13:48:46 -04:00
Janar Sööt 5144c5f01e menu: new fast step rate feature
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-09-21 19:29:30 -04:00
Kevin O'Connor 1379a59085 st7920: No need to clear glyph framebuffer before programming glyphs
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor 7cca8d970a hd44780: Simplify framebuffer access
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor 742d6481a9 st7920: Simplify framebuffer access
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor 05ba62600c st7920: Support writing degrees symbol
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor a4e2540f14 uc1701: Support writing degrees symbol
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor 30a49d3186 display: Use write_glyph() when writing special characters
Always use the write_glyph() method when writing special characters
during status screen updates.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor c8d9d575a1 display: Support writing single character glyphs using write_glyph()
Add write_glyph() support to hd44780.py.  Update uc1701.py and
st7920.py to support writing single character glyphs via
write_glyph().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor 2a5778be3a display: Move icon drawing from display.py to lcd_chip code
Move the st7920 icon rendering optimizations from display.py to
st7920.py.  This simplifies the code for other displays.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor 2857255ef1 icons: Add the bed to the bed heating animations
It isn't necessary to use the st7920's xor capabilities when drawing
the bed heating animations.  This makes it easier to use the icons for
other displays.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Janar Sööt 7b6a44e8f9 menu: New Tune submenu (#653)
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-09-17 08:26:59 -04:00
Kevin O'Connor 30013a1fb8 mcu: Rename add_config_object() to register_config_callback()
Change the name of the config registration method and pass an explicit
reference to the callback to the new method.  This makes the
relationship between mcu registration and build_config() more clear in
the calling code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-03 11:48:22 -04:00
Kevin O'Connor ce79b6ca00 menu: Queue g-code commands to avoid command reordering
The gcode.run_script() code can pause which can result in the menu
code being called reentrant - avoid that by queuing the gcode commands
within the menu code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 12:14:27 -04:00
Janar Sööt 65f0fd6238 display menu module for klipper
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-08-20 22:33:05 -04:00
Kevin O'Connor 273a98d39a pins: Explicitly pass can_invert and can_pullup to lookup_pin()
Don't pass pin_type to lookup_pin() - instead, if a pin can be
inverted or can have a pullup, then the caller must explicitly specify
that when calling lookup_pin().  This simplifies the code for the
cases where it is not valid to invert or pullup.

Explicitly pass the pin_type to setup_pin() and have ppins.setup_pin()
apply default pullup and invert flags.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 09:44:45 -04:00
Kevin O'Connor b4f03e8363 docs: Add display g-code commands to docs/G-Codes.md
Add M117 and M73 to the list of supported G-Codes.

Also, remove M117 from the list of commands reported by the HELP
command as that command is typically only used to list "extended
g-code" commands.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-08 10:12:23 -04:00
Arksine 640169310f display: fix for 128 x 64 pixel displays
Right justify fan speed and feed rate, keep progress centered.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-06-28 13:11:44 -04:00
Kevin O'Connor efb27f095c build: Cleanup whitespace errors
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-28 13:00:20 -04:00
Arksine e11851276d display: uc1701 spi fix
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-06-28 10:01:57 -04:00
Arksine 593b4d2656 display: add UC1701 graphics controller support
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-06-27 19:46:38 -04:00
Arksine 19d6205492 display: add VGA font
Font from fntcol16.zip package:
ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip
(c) Joseph Gil
Font is public domain

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-06-27 19:46:38 -04:00
Kevin O'Connor 483c51e864 display: Move icons to their own module
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-27 13:18:03 -04:00
Kevin O'Connor e907253dba display: Move st7920 code to its own module
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-27 13:18:03 -04:00
Kevin O'Connor f85b43a789 display: Move hd44780 code to its own module
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-27 13:18:03 -04:00
Kevin O'Connor 373c7ff301 display: Move klippy/extras/display.py to klippy/extras/display/display.py
Move the display code into its own directory.  This is in preparation
for splitting it up into its own modules.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-27 13:18:03 -04:00