mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 18:36:02 +08:00
Add a job to handle processing of GCode from the backend
This commit is contained in:
parent
143bdf3880
commit
78fa145bca
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…
x
Reference in New Issue
Block a user