From df5a6e42d73de92a63cbc052bcbd71bfb7f9b27d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 28 Jun 2016 12:58:31 +0200 Subject: [PATCH] Docs for additions to slicing event payload --- docs/events/index.rst | 8 ++++++++ src/octoprint/filemanager/__init__.py | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/events/index.rst b/docs/events/index.rst index fb2ad097..483ee2d1 100644 --- a/docs/events/index.rst +++ b/docs/events/index.rst @@ -352,7 +352,9 @@ SlicingStarted Payload: * ``stl``: the STL's filename + * ``stl_location``: the STL's location * ``gcode``: the sliced GCODE's filename + * ``gcode_location``: the sliced GCODE's location * ``progressAvailable``: true if progress information via the ``slicingProgress`` push update will be available, false if not SlicingDone @@ -361,7 +363,9 @@ SlicingDone Payload: * ``stl``: the STL's filename + * ``stl_location``: the STL's location * ``gcode``: the sliced GCODE's filename + * ``gcode_location``: the sliced GCODE's location * ``time``: the time needed for slicing, in seconds (float) SlicingCancelled @@ -371,7 +375,9 @@ SlicingCancelled Payload: * ``stl``: the STL's filename + * ``stl_location``: the STL's location * ``gcode``: the sliced GCODE's filename + * ``gcode_location``: the sliced GCODE's location SlicingFailed The slicing of a file has failed. @@ -379,7 +385,9 @@ SlicingFailed Payload: * ``stl``: the STL's filename + * ``stl_location``: the STL's location * ``gcode``: the sliced GCODE's filename + * ``gcode_location``: the sliced GCODE's location * ``reason``: the reason for the slicing having failed SlicingProfileAdded diff --git a/src/octoprint/filemanager/__init__.py b/src/octoprint/filemanager/__init__.py index d70aad46..14f2b99a 100644 --- a/src/octoprint/filemanager/__init__.py +++ b/src/octoprint/filemanager/__init__.py @@ -295,7 +295,11 @@ class FileManager(object): import time start_time = time.time() - eventManager().fire(Events.SLICING_STARTED, {"stl": source_path, "gcode": dest_path, "progressAvailable": slicer.get_slicer_properties()["progress_report"] if slicer else False}) + eventManager().fire(Events.SLICING_STARTED, {"stl": source_path, + "stl_location": source_location, + "gcode": dest_path, + "gcode_location": dest_location, + "progressAvailable": slicer.get_slicer_properties()["progress_report"] if slicer else False}) import tempfile f = tempfile.NamedTemporaryFile(suffix=".gco", delete=False)