Skip to content

Commit

Permalink
- #117 hint about "Layer indicator not found in file" and fixing the …
Browse files Browse the repository at this point in the history
…Python3 bug

- #115 optimize the first output of the filamentchangetime
  • Loading branch information
OllisGit committed Feb 17, 2020
1 parent be372d8 commit 966df5a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ Simplify3D: ```; layer 10, Z = 1.640```

The implementation is based on four steps:

1. PreProcessing the selected G-Code (replace layer-comment with M117 indicator G-Code)
1. PreProcessing the selected G-Code during upload (replace layer-comment with M117 indicator G-Code)
2. Read total layer and height count from G-Code before start (used last layer-comment)
3. G-Code-hook to collect the current layer information (M117-command from step 1)
4. Progress-Hook to write all information to the printer/navbar/browserTitle

If you receive a popup message: "Layer indicator not found in file!", then check Layer-Indicator comments in the layer-settings section against your g-code.
If you adjust the layer expression, then you need to reupload your g-code file again.

![browserTitle](screenshots/browser-title-tab.png "Progress in Browser Tab")
![navbar](screenshots/navbar.jpg "Progress in NavBar")
Expand Down
10 changes: 5 additions & 5 deletions octoprint_DisplayLayerProgress/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,10 @@ def process_line(self, origLine):
if not len(origLine):
return None

origStripedLine = origLine.lstrip()
line = origStripedLine
line = origLine.decode('utf-8')
line = line.lstrip()

if (len(line) != 0 and line[0] == ";"):
line = line.decode('utf-8')
for layerExpression in self._allLayerExpressions:
inputLine = line
line = self._modifyLineIfLayerComment(inputLine, layerExpression)
Expand Down Expand Up @@ -555,9 +554,10 @@ def _updateDisplay(self, updateReason):
self._nextM600Layer = 0

layerDiff = self._nextM600Layer - currenLayerNumber
if (layerDiff >= 0):
# Only calculate the M600 time if the layer one is already printed
if (layerDiff >= 0 and self._lastLayerDurationInSeconds > 0 and currenLayerNumber > 1):
layerDuration = self._lastLayerDurationInSeconds
# for a better precision, tkat avarage layerDuration and not the last one
# for a better precision, take avarage layerDuration and not the last one
if (type(self._averageLayerDurationInSeconds) == int and int(self._averageLayerDurationInSeconds) > 0):
layerDuration = self._averageLayerDurationInSeconds

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "DisplayLayerProgress"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "1.18.0dev"
plugin_version = "1.18.0"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit 966df5a

Please sign in to comment.