-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Pre-process files for OctoPrint to determine layers during print * Download file when print is started to parse layers * Add comment * Fix random submodule * Let OctoPrint plugin parse files to determine layers * Fix custom notifications * Do not send custom notification to activity * Test and fix on Moonraker * Bump version to 2.1.0 * Fix snapshot logic * Fix some small things
- Loading branch information
Showing
12 changed files
with
458 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
class LayerUtils: | ||
|
||
LayerChangeCommand = "OCTOAPP_LAYER_CHANGE" | ||
DisableLegacyLayerCommand = "OCTOAPP_DISABLE_LAYER_MAGIC" | ||
|
||
@staticmethod | ||
def CreateLayerChangeCommand(layer): | ||
return LayerUtils.LayerChangeCommand + " LAYER=" + str(layer) | ||
|
||
@staticmethod | ||
def IsLayerChange(line, context): | ||
if line.startswith("; generated by PrusaSlicer") or line.startswith("; generated by OrcaSlicer") or line.startswith("; generated by SuperSlicer"): | ||
context["slicer"] = "prusa" | ||
|
||
if line.startswith(";Generated with Cura"): | ||
context["slicer"] = "cura" | ||
|
||
if line.startswith("; generated by Slic3r"): | ||
context["slicer"] = "slic3r" # Doesn't mark layer changes | ||
|
||
if line.startswith("; Generated by Kiri:Moto"): | ||
context["slicer"] = "kirimoto" | ||
|
||
if line.startswith("; G-Code generated by Simplify3D"): | ||
context["slicer"] = "simplify" | ||
|
||
slicer = context.get("slicer", None) | ||
|
||
if slicer == "prusa": | ||
return line.startswith(";LAYER_CHANGE") | ||
|
||
if slicer == "cura": | ||
return line.startswith(";LAYER:") | ||
|
||
if slicer == "kirimoto": | ||
return line.startswith(";; --- layer") | ||
|
||
if slicer == "simplify": | ||
return line.startswith("; layer ") | ||
|
||
return line.startswith("; OCTOAPP_LAYER_CHANGE") |
Oops, something went wrong.