Codestyle & Documentation

CURA 537
This commit is contained in:
Jaime van Kessel 2016-04-28 15:56:25 +02:00
parent 4e722d61ce
commit efd14421cc
2 changed files with 11 additions and 8 deletions

View file

@ -19,6 +19,7 @@ import numpy
catalog = i18nCatalog("cura")
class ProcessSlicedLayersJob(Job):
def __init__(self, layers):
super().__init__()
@ -48,7 +49,6 @@ class ProcessSlicedLayersJob(Job):
Application.getInstance().getController().activeViewChanged.connect(self._onActiveViewChanged)
object_id_map = {}
new_node = SceneNode()
## Remove old layer data (if any)
@ -124,13 +124,13 @@ class ProcessSlicedLayersJob(Job):
self._progress.hide()
return
#Add layerdata decorator to scene node to indicate that the node has layerdata
# Add LayerDataDecorator to scene node to indicate that the node has layer data
decorator = LayerDataDecorator.LayerDataDecorator()
decorator.setLayerData(layer_data)
new_node.addDecorator(decorator)
new_node.setMeshData(mesh)
new_node.setParent(self._scene.getRoot()) #Note: After this we can no longer abort!
new_node.setParent(self._scene.getRoot()) # Note: After this we can no longer abort!
if not settings.getSettingValue("machine_center_is_zero"):
new_node.setPosition(Vector(-settings.getSettingValue("machine_width") / 2, 0.0, settings.getSettingValue("machine_depth") / 2))

View file

@ -14,6 +14,7 @@ from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from cura.OneAtATimeIterator import OneAtATimeIterator
## Formatter class that handles token expansion in start/end gcod
class GcodeStartEndFormatter(Formatter):
def get_value(self, key, args, kwargs): # [CodeStyle: get_value is an overridden function from the Formatter class]
@ -27,7 +28,8 @@ class GcodeStartEndFormatter(Formatter):
Logger.log("w", "Incorrectly formatted placeholder '%s' in start/end gcode", key)
return "{" + str(key) + "}"
## Job class that handles sending the current scene data to CuraEngine
## Job that handles sending the current scene data to CuraEngine
class StartSliceJob(Job):
def __init__(self, profile, socket):
super().__init__()
@ -49,6 +51,7 @@ class StartSliceJob(Job):
for node in OneAtATimeIterator(self._scene.getRoot()):
temp_list = []
## Node can't be printed, so don't bother sending it.
if getattr(node, "_outside_buildarea", False):
continue
@ -118,7 +121,7 @@ class StartSliceJob(Job):
return str(value).encode("utf-8")
def _sendSettings(self, profile):
msg = self._socket.createMessage("cura.proto.SettingList");
msg = self._socket.createMessage("cura.proto.SettingList")
settings = profile.getAllSettingValues(include_machine = True)
start_gcode = settings["machine_start_gcode"]
settings["material_bed_temp_prepend"] = "{material_bed_temperature}" not in start_gcode