chiark / gitweb /
Fix multiple dual-extrusion prints on a platform printed all-at-once.
authordaid <daid303@gmail.com>
Fri, 6 Dec 2013 10:32:59 +0000 (11:32 +0100)
committerdaid <daid303@gmail.com>
Fri, 6 Dec 2013 10:32:59 +0000 (11:32 +0100)
Cura/gui/printWindow2.py
Cura/util/printerConnection/doodle3dConnect.py
Cura/util/sliceEngine.py

index 0c304ace2334aae25542aa1db8af5c78c5c698d4..8c1ee2701567a9e71c4e23668269367284d64c46 100644 (file)
@@ -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:
index 8b7e59b9d0634fbb73f61c144d7d939bbe6ecab9..7137c1f0c6e4e6f3768ca4332f3f6676b5e4e444 100644 (file)
@@ -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':
index 60e0aba4b695c6a54424e7269ed86edeee951d11..c3526486c5ea097a18f38f54aa070607363e44fa 100644 (file)
@@ -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: