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") catalog = i18nCatalog("cura")
class ProcessSlicedLayersJob(Job): class ProcessSlicedLayersJob(Job):
def __init__(self, layers): def __init__(self, layers):
super().__init__() super().__init__()
@ -48,7 +49,6 @@ class ProcessSlicedLayersJob(Job):
Application.getInstance().getController().activeViewChanged.connect(self._onActiveViewChanged) Application.getInstance().getController().activeViewChanged.connect(self._onActiveViewChanged)
object_id_map = {}
new_node = SceneNode() new_node = SceneNode()
## Remove old layer data (if any) ## Remove old layer data (if any)
@ -124,7 +124,7 @@ class ProcessSlicedLayersJob(Job):
self._progress.hide() self._progress.hide()
return 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 = LayerDataDecorator.LayerDataDecorator()
decorator.setLayerData(layer_data) decorator.setLayerData(layer_data)
new_node.addDecorator(decorator) new_node.addDecorator(decorator)

View file

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