Cura/Commands/TransferMeshesCommand.py
2014-12-15 11:24:43 +01:00

19 lines
718 B
Python

from UM.Backend.Command import Command
from UM.plugins.UMBackendEngine.Commands.TransferMeshCommand import TransferMeshCommand
class TransferMeshesCommand(Command):
def __init__(self):
super(TransferMeshesCommand,self).__init__()
def send(self, meshes):
self._socket.sendCommand(0x00200000,len(meshes)) # Tell other side that n meshes are going to be sent.
command = TransferMeshCommand(self._socket)
for mesh in meshes:
command.send(mesh)
def recieve(self, num_meshes):
meshes = []
command = TransferMeshCommand(self._socket)
for x in range(0,num_meshes):
meshes.append(command.recieve())
return meshes