mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
CURA-4525 some cleanup and comments
This commit is contained in:
parent
bd8aa8d989
commit
f6c7ffac11
6 changed files with 6 additions and 25 deletions
|
@ -815,7 +815,6 @@ class CuraApplication(QtApplication):
|
|||
qmlRegisterType(QualitySettingsModel, "Cura", 1, 0, "QualitySettingsModel")
|
||||
qmlRegisterType(MachineNameValidator, "Cura", 1, 0, "MachineNameValidator")
|
||||
qmlRegisterType(UserChangesModel, "Cura", 1, 1, "UserChangesModel")
|
||||
# qmlRegisterSingletonType(ObjectManager, "Cura", 1, 0, "ObjectManager", ObjectManager.createObjectManager)
|
||||
|
||||
qmlRegisterSingletonType(ContainerManager, "Cura", 1, 0, "ContainerManager", ContainerManager.createContainerManager)
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
|
|||
class GCodeListDecorator(SceneNodeDecorator):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._gcode_list = {} # []
|
||||
self._gcode_list = []
|
||||
|
||||
def getGCodeList(self):
|
||||
return self._gcode_list
|
||||
|
|
|
@ -11,6 +11,7 @@ from PyQt5.QtWidgets import QApplication
|
|||
from UM.Preferences import Preferences
|
||||
|
||||
|
||||
## Keep track of all objects in the project
|
||||
class ObjectManager(ListModel):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
|
|
@ -3,6 +3,7 @@ from UM.Application import Application
|
|||
from UM.Logger import Logger
|
||||
|
||||
|
||||
## Make a SceneNode build plate aware CuraSceneNode objects all have this decorator.
|
||||
class BuildPlateDecorator(SceneNodeDecorator):
|
||||
def __init__(self, build_plate_number = -1):
|
||||
super().__init__()
|
||||
|
|
|
@ -112,7 +112,6 @@ class CuraEngineBackend(QObject, Backend):
|
|||
self._tool_active = False # If a tool is active, some tasks do not have to do anything
|
||||
self._always_restart = True # Always restart the engine when starting a new slice. Don't keep the process running. TODO: Fix engine statelessness.
|
||||
self._process_layers_job = None # The currently active job to process layers, or None if it is not processing layers.
|
||||
# self._need_slicing = False
|
||||
self._build_plates_to_be_sliced = [] # what needs slicing?
|
||||
self._engine_is_fresh = True # Is the newly started engine used before or not?
|
||||
|
||||
|
@ -446,11 +445,6 @@ class CuraEngineBackend(QObject, Backend):
|
|||
|
||||
self._invokeSlice()
|
||||
|
||||
# #self.needsSlicing()
|
||||
# self.stopSlicing()
|
||||
# #self._onChanged()
|
||||
# self._invokeSlice()
|
||||
|
||||
## Called when an error occurs in the socket connection towards the engine.
|
||||
#
|
||||
# \param error The exception that occurred.
|
||||
|
@ -476,12 +470,9 @@ class CuraEngineBackend(QObject, Backend):
|
|||
node.getParent().removeChild(node)
|
||||
|
||||
def markSliceAll(self):
|
||||
if 0 not in self._build_plates_to_be_sliced:
|
||||
self._build_plates_to_be_sliced.append(0)
|
||||
if 1 not in self._build_plates_to_be_sliced:
|
||||
self._build_plates_to_be_sliced.append(1)
|
||||
if 2 not in self._build_plates_to_be_sliced:
|
||||
self._build_plates_to_be_sliced.append(2)
|
||||
for build_plate_number in range(Application.getInstance().getBuildPlateModel().maxBuildPlate + 1):
|
||||
if build_plate_number not in self._build_plates_to_be_sliced:
|
||||
self._build_plates_to_be_sliced.append(build_plate_number)
|
||||
|
||||
## Convenient function: mark everything to slice, emit state and clear layer data
|
||||
def needsSlicing(self):
|
||||
|
|
|
@ -84,17 +84,6 @@ class ProcessSlicedLayersJob(Job):
|
|||
new_node = SceneNode()
|
||||
new_node.addDecorator(BuildPlateDecorator(self._build_plate_number))
|
||||
|
||||
# ## Remove old layer data (if any)
|
||||
# for node in DepthFirstIterator(self._scene.getRoot()):
|
||||
# if node.callDecoration("getLayerData") and node.callDecoration("getBuildPlateNumber") == self._build_plate_number:
|
||||
# Logger.log("d", " # Removing: %s", node)
|
||||
# node.getParent().removeChild(node)
|
||||
# #break
|
||||
# if self._abort_requested:
|
||||
# if self._progress_message:
|
||||
# self._progress_message.hide()
|
||||
# return
|
||||
|
||||
# Force garbage collection.
|
||||
# For some reason, Python has a tendency to keep the layer data
|
||||
# in memory longer than needed. Forcing the GC to run here makes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue