mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Update DisplayFilenameAndLayerOnLCD.py
changed so that actual filename is displayed (or alternatively user can enter text to display) to LCD during print
This commit is contained in:
parent
a5baa90086
commit
f7fbc685d8
1 changed files with 11 additions and 8 deletions
|
@ -3,11 +3,11 @@
|
||||||
# Date: August 28, 2018
|
# Date: August 28, 2018
|
||||||
|
|
||||||
# Description: This plugin inserts a line at the start of each layer,
|
# Description: This plugin inserts a line at the start of each layer,
|
||||||
# M117 displays the filename and layer height to the LCD
|
# M117 - displays the filename and layer height to the LCD
|
||||||
# ** user must enter 'filename'
|
# Alternatively, user can override the filename to display alt text + layer height
|
||||||
# ** future update: include actual filename
|
|
||||||
|
|
||||||
from ..Script import Script
|
..Script import Script
|
||||||
|
from UM.Application import Application
|
||||||
|
|
||||||
class DisplayFilenameAndLayerOnLCD(Script):
|
class DisplayFilenameAndLayerOnLCD(Script):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -23,16 +23,19 @@ class DisplayFilenameAndLayerOnLCD(Script):
|
||||||
{
|
{
|
||||||
"name":
|
"name":
|
||||||
{
|
{
|
||||||
"label": "filename",
|
"label": "text to display:",
|
||||||
"description": "Enter filename",
|
"description": "By default the current filename will be displayed on the LCD. Enter text here to override the filename and display something else.",
|
||||||
"type": "str",
|
"type": "str",
|
||||||
"default_value": "default"
|
"default_value": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}"""
|
}"""
|
||||||
|
|
||||||
def execute(self, data):
|
def execute(self, data):
|
||||||
name = self.getSettingValueByKey("name")
|
if self.getSettingValueByKey("name") != "":
|
||||||
|
name = self.getSettingValueByKey("name")
|
||||||
|
else:
|
||||||
|
name = Application.getInstance().getPrintInformation().jobName
|
||||||
lcd_text = "M117 " + name + " layer: "
|
lcd_text = "M117 " + name + " layer: "
|
||||||
i = 0
|
i = 0
|
||||||
for layer in data:
|
for layer in data:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue