Merge branch 'maintenance' into devel
This commit is contained in:
commit
5c7e9e42fb
3 files changed
+27
-3
No files matched your search
@@ -519,6 +519,7 @@ PrintCancelled
|
||||
* ``position.f``: last feedrate for move commands **sent through OctoPrint** (note that if you modified the
|
||||
feedrate outside of OctoPrint, e.g. through the printer controller, or if you are printing from SD, this will
|
||||
NOT be accurate)
|
||||
* ``fileposition``: position in the file in bytes at the time of cancellation
|
||||
|
||||
.. deprecated:: 1.3.0
|
||||
|
||||
@@ -550,6 +551,7 @@ PrintPaused
|
||||
* ``position.f``: last feedrate for move commands **sent through OctoPrint** (note that if you modified the
|
||||
feedrate outside of OctoPrint, e.g. through the printer controller, or if you are printing from SD, this will
|
||||
NOT be accurate)
|
||||
* ``fileposition``: position in the file in bytes at the time of pausing
|
||||
|
||||
.. deprecated:: 1.3.0
|
||||
|
||||
|
||||
@@ -4,10 +4,18 @@
|
||||
* Time: 12:18 PM
|
||||
*/
|
||||
|
||||
// base url to use for API calls; it's the worker location minus the worker.js path
|
||||
var baseUrl = self.location.href.substring(
|
||||
0,
|
||||
self.location.href.length - "/plugin/gcodeviewer/static/js/viewer/worker.js".length
|
||||
);
|
||||
|
||||
// raw path suitable for fetch()
|
||||
var url;
|
||||
|
||||
// path relative to Local
|
||||
var path;
|
||||
|
||||
var firstReport;
|
||||
var toolOffsets = [{x: 0, y: 0}];
|
||||
var g90InfluencesExtruder = false;
|
||||
@@ -455,7 +463,9 @@ var doParse = async function () {
|
||||
// if skipUntil is set, get skipUntilPresent
|
||||
skipUntilPresent = false;
|
||||
if (skipUntil !== undefined && skipUntil !== "") {
|
||||
result = await fetch("/plugin/gcodeviewer/skipuntilcheck/local/" + path);
|
||||
result = await fetch(
|
||||
baseUrl + "/plugin/gcodeviewer/skipuntilcheck/local/" + path
|
||||
);
|
||||
if (result.ok) {
|
||||
response = await result.json();
|
||||
skipUntilPresent = response.present;
|
||||
|
||||
@@ -1687,10 +1687,12 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
|
||||
self._setCurrentZ(None)
|
||||
self._updateProgressData()
|
||||
|
||||
fileposition = self._comm.getFilePosition() if self._comm else None
|
||||
payload = self._payload_for_print_job_event(
|
||||
position=self._comm.cancel_position.as_dict()
|
||||
if self._comm and self._comm.cancel_position
|
||||
else None,
|
||||
fileposition=fileposition["pos"] if fileposition else None,
|
||||
action_user=user,
|
||||
)
|
||||
if payload:
|
||||
@@ -1702,11 +1704,13 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
|
||||
{"type": "cancel", "label": "Cancel"},
|
||||
)
|
||||
self._logger_job.info(
|
||||
"Print job cancelled - origin: {}, path: {}, owner: {}, user: {}".format(
|
||||
"Print job cancelled - origin: {}, path: {}, owner: {}, user: {}, fileposition: {}, position: {}".format(
|
||||
payload.get("origin"),
|
||||
payload.get("path"),
|
||||
payload.get("owner"),
|
||||
payload.get("user"),
|
||||
payload.get("fileposition"),
|
||||
payload.get("position"),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1736,20 +1740,24 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
|
||||
thread.start()
|
||||
|
||||
def on_comm_print_job_paused(self, suppress_script=False, user=None):
|
||||
fileposition = self._comm.getFilePosition() if self._comm else None
|
||||
payload = self._payload_for_print_job_event(
|
||||
position=self._comm.pause_position.as_dict()
|
||||
if self._comm and self._comm.pause_position and not suppress_script
|
||||
else None,
|
||||
fileposition=fileposition["pos"] if fileposition else None,
|
||||
action_user=user,
|
||||
)
|
||||
if payload:
|
||||
eventManager().fire(Events.PRINT_PAUSED, payload)
|
||||
self._logger_job.info(
|
||||
"Print job paused - origin: {}, path: {}, owner: {}, user: {}".format(
|
||||
"Print job paused - origin: {}, path: {}, owner: {}, user: {}, fileposition: {}, position: {}".format(
|
||||
payload.get("origin"),
|
||||
payload.get("path"),
|
||||
payload.get("owner"),
|
||||
payload.get("user"),
|
||||
payload.get("fileposition"),
|
||||
payload.get("position"),
|
||||
)
|
||||
)
|
||||
eventManager().fire(
|
||||
@@ -1865,6 +1873,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
|
||||
print_job_size=None,
|
||||
print_job_user=None,
|
||||
position=None,
|
||||
fileposition=None,
|
||||
action_user=None,
|
||||
):
|
||||
if print_job_file is None:
|
||||
@@ -1907,6 +1916,9 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
|
||||
if position is not None:
|
||||
result["position"] = position
|
||||
|
||||
if fileposition is not None:
|
||||
result["fileposition"] = fileposition
|
||||
|
||||
if print_job_user is not None:
|
||||
result["owner"] = print_job_user
|
||||
|
||||
|
||||
Reference in new issue
Block a user