Merge branch 'master' of github.com:ultimaker/Cura into feature_material_editing

* 'master' of github.com:ultimaker/Cura: (38 commits)
  Fixed profile file case-sensitivity.
  Fix UMO Checkup button size
  Remove debug statement and commented-out code CURA-1385
  Show "ready" state when a printer is connected but jobstate is not yet set
  Added deepcopy function
  Made exception handling of slice info plugin way more robust
  Restart timer after slicing is performed when not enabled.
  Update GUID for PLA to match the GUID in the official repository
  Set default extruder index to -1 (so global is default)
  Ensure that the display matches with the backend active extruder data
  Update UM2 Extended build volume height to value published in marketing materials
  Fixed firmware upgrade for um2+
  Capitalise setting label
  CHeckup action now correctly resets every time you start it
  Remove unused name/id when importing a profile from a gcode file
  Just a little typo
  BQ Hephestos2: Heat up nozzle while leveling
  Saving g-code no longer crashes
  Removed update firmware from extensions; This is now handled by machine actions
  Changing active extruder no longer trigger re-slice
  ...
This commit is contained in:
Arjen Hiemstra 2016-07-07 11:29:18 +02:00
commit d8555fe57d
25 changed files with 311 additions and 175 deletions

View file

@ -79,7 +79,8 @@ class CuraEngineBackend(Backend):
self._message_handlers["cura.proto.Progress"] = self._onProgressMessage
self._message_handlers["cura.proto.GCodeLayer"] = self._onGCodeLayerMessage
self._message_handlers["cura.proto.GCodePrefix"] = self._onGCodePrefixMessage
self._message_handlers["cura.proto.ObjectPrintTime"] = self._onObjectPrintTimeMessage
self._message_handlers["cura.proto.PrintTimeMaterialEstimates"] = self._onPrintTimeMaterialEstimates
#self._message_handlers["cura.proto.ObjectPrintTime"] = self._onObjectPrintTimeMessage
self._message_handlers["cura.proto.SlicingFinished"] = self._onSlicingFinishedMessage
self._start_slice_job = None
@ -126,11 +127,15 @@ class CuraEngineBackend(Backend):
## Perform a slice of the scene.
def slice(self):
self._stored_layer_data = []
if not self._enabled or not self._global_container_stack: #We shouldn't be slicing.
# try again in a short time
self._change_timer.start()
return
self.printDurationMessage.emit(0, [0])
self._stored_layer_data = []
if self._slicing: #We were already slicing. Stop the old job.
self._terminate()
@ -294,9 +299,12 @@ class CuraEngineBackend(Backend):
## Called when a print time message is received from the engine.
#
# \param message The protobuf message containing the print time and
# material amount.
def _onObjectPrintTimeMessage(self, message):
self.printDurationMessage.emit(message.time, message.material_amount)
# material amount per extruder
def _onPrintTimeMaterialEstimates(self, message):
material_amounts = []
for index in range(message.repeatedMessageCount("materialEstimates")):
material_amounts.append(message.getRepeatedMessage("materialEstimates", index).material_amount)
self.printDurationMessage.emit(message.time, material_amounts)
## Creates a new socket connection.
def _createSocket(self):
@ -383,4 +391,4 @@ class CuraEngineBackend(Backend):
if self._active_extruder_stack:
self._active_extruder_stack.propertyChanged.connect(self._onSettingChanged) # Note: Only starts slicing when the value changed.
self._active_extruder_stack.containersChanged.connect(self._onChanged)
self._onChanged()