From: daid Date: Fri, 6 Dec 2013 10:32:59 +0000 (+0100) Subject: Fix multiple dual-extrusion prints on a platform printed all-at-once. X-Git-Tag: 14.01~34 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=805578939637f96d680fa3b0fbfdf1f723282fb2;p=cura.git Fix multiple dual-extrusion prints on a platform printed all-at-once. --- diff --git a/Cura/gui/printWindow2.py b/Cura/gui/printWindow2.py index 0c304ace..8c1ee270 100644 --- a/Cura/gui/printWindow2.py +++ b/Cura/gui/printWindow2.py @@ -490,7 +490,7 @@ class TemperatureGraph(wx.Panel): self._points.pop(0) def addPoint(self, temp, tempSP, bedTemp, bedTempSP): - if time.time() - self._points[-1][4] < 0.5: + if len(self._points) > 0 and time.time() - self._points[-1][4] < 0.5: return for n in xrange(0, len(temp)): if temp[n] is None: diff --git a/Cura/util/printerConnection/doodle3dConnect.py b/Cura/util/printerConnection/doodle3dConnect.py index 8b7e59b9..7137c1f0 100644 --- a/Cura/util/printerConnection/doodle3dConnect.py +++ b/Cura/util/printerConnection/doodle3dConnect.py @@ -109,8 +109,9 @@ class doodle3dConnect(printerConnectionBase.printerConnectionBase): return "Doodle3D box not found" if self._printing: if self._blockIndex < len(self._fileBlocks): - return "Sending GCode: %.1f" % (float(self._blockIndex) / float(len(self._fileBlocks))) - return "TODO" + return "Sending GCode: %.1f%%" % (float(self._blockIndex) * 100.0 / float(len(self._fileBlocks))) + return "Print progress: %.1f%%" % (self.getPrintProgress() * 100.0) + return "Printing found, waiting for print." #Get the temperature of an extruder, returns None is no temperature is known for this extruder def getTemperature(self, extruder): @@ -191,6 +192,8 @@ class doodle3dConnect(printerConnectionBase.printerConnectionBase): if len(self._commandList) > 0: if self._request('POST', '/d3dapi/printer/print', {'gcode': self._commandList[0], 'start': 'True', 'first': 'True'}): self._commandList.pop(0) + else: + time.sleep(1) else: time.sleep(5) elif stateReply['data']['state'] == 'printing': diff --git a/Cura/util/sliceEngine.py b/Cura/util/sliceEngine.py index 60e0aba4..c3526486 100644 --- a/Cura/util/sliceEngine.py +++ b/Cura/util/sliceEngine.py @@ -150,23 +150,26 @@ class Slicer(object): pos += (objMin + objMax) / 2.0 * 1000 commandList += ['-s', 'posx=%d' % int(pos[0]), '-s', 'posy=%d' % int(pos[1])] - vertexTotal = 0 + vertexTotal = [0] * 4 + meshMax = 1 for obj in scene.objects(): if scene.checkPlatform(obj): - for mesh in obj._meshList: - vertexTotal += mesh.vertexCount + meshMax = max(meshMax, len(obj._meshList)) + for n in xrange(0, len(obj._meshList)): + vertexTotal[n] += obj._meshList[n].vertexCount - f.write(numpy.array([vertexTotal], numpy.int32).tostring()) - for obj in scene.objects(): - if scene.checkPlatform(obj): - for mesh in obj._meshList: - vertexes = (numpy.matrix(mesh.vertexes, copy = False) * numpy.matrix(obj._matrix, numpy.float32)).getA() - vertexes -= obj._drawOffset - vertexes += numpy.array([obj.getPosition()[0], obj.getPosition()[1], 0.0]) - f.write(vertexes.tostring()) - hash.update(mesh.vertexes.tostring()) + for n in xrange(0, meshMax): + f.write(numpy.array([vertexTotal[n]], numpy.int32).tostring()) + for obj in scene.objects(): + if scene.checkPlatform(obj): + if n < len(obj._meshList): + vertexes = (numpy.matrix(obj._meshList[n].vertexes, copy = False) * numpy.matrix(obj._matrix, numpy.float32)).getA() + vertexes -= obj._drawOffset + vertexes += numpy.array([obj.getPosition()[0], obj.getPosition()[1], 0.0]) + f.write(vertexes.tostring()) + hash.update(obj._meshList[n].vertexes.tostring()) - commandList += ['#'] + commandList += ['#' * meshMax] self._objCount = 1 else: for n in order: