mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 15:37:27 -06:00
Add a job to handle processing of GCode from the backend
This commit is contained in:
parent
143bdf3880
commit
78fa145bca
1 changed files with 17 additions and 0 deletions
17
ProcessGCodeJob.py
Normal file
17
ProcessGCodeJob.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
from UM.Job import Job
|
||||
from UM.Application import Application
|
||||
|
||||
import os
|
||||
|
||||
class ProcessGCodeJob(Job):
|
||||
def __init__(self, message):
|
||||
super().__init__()
|
||||
|
||||
self._message = message
|
||||
|
||||
def run(self):
|
||||
with open(self._message.filename) as f:
|
||||
data = f.read(None)
|
||||
Application.getInstance().getController().getScene().gcode = data
|
||||
|
||||
os.remove(self._message.filename)
|
Loading…
Add table
Add a link
Reference in a new issue