mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-14 19:41:46 +08:00
Changes to CuraEngineBackend plugin. The plugin does not work correctly, will visit later
This commit is contained in:
parent
2edd4da861
commit
ad33effbbe
@ -6,7 +6,16 @@ class TransferMeshCommand(Command):
|
|||||||
super(TransferMeshCommand,self).__init__()
|
super(TransferMeshCommand,self).__init__()
|
||||||
|
|
||||||
def send(self, mesh_data):
|
def send(self, mesh_data):
|
||||||
vertices = mesh_data.getVertices()
|
vertices = mesh_data.getVerticesList()
|
||||||
|
self._socket.sendCommand(0x00200001, len(vertices)) # Tell other side that mesh with num vertices is going to be sent.
|
||||||
|
|
||||||
command = TransferVertCommand(self._socket)
|
command = TransferVertCommand(self._socket)
|
||||||
for vertex in vertices:
|
command.send(vertices)
|
||||||
command.send(vertex)
|
|
||||||
|
|
||||||
|
def recieve(self):
|
||||||
|
command_id, data = self._socket.getNextCommand()
|
||||||
|
if(command_id is not 0x00200001):
|
||||||
|
print("Wrong command!")
|
||||||
|
return None
|
||||||
|
unpacked_data = struct('
|
@ -6,7 +6,14 @@ class TransferMeshesCommand(Command):
|
|||||||
super(TransferMeshesCommand,self).__init__()
|
super(TransferMeshesCommand,self).__init__()
|
||||||
|
|
||||||
def send(self, meshes):
|
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)
|
command = TransferMeshCommand(self._socket)
|
||||||
for mesh in meshes:
|
for mesh in meshes:
|
||||||
command.send(mesh)
|
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
|
@ -1,8 +0,0 @@
|
|||||||
from Cura.Backend.Command import Command
|
|
||||||
|
|
||||||
class TransferVertCommand(Command):
|
|
||||||
def __init__(self):
|
|
||||||
super(TransferVertCommand,self).__init__()
|
|
||||||
|
|
||||||
def send(self, vertex):
|
|
||||||
self._socket.sendData(self._id, vertex.toString())
|
|
8
Commands/TransferVerticeListCommand.py
Normal file
8
Commands/TransferVerticeListCommand.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
from Cura.Backend.Command import Command
|
||||||
|
|
||||||
|
class TransferVerticeListCommand(Command):
|
||||||
|
def __init__(self):
|
||||||
|
super(TransferVertCommand,self).__init__()
|
||||||
|
|
||||||
|
def send(self, vertices):
|
||||||
|
self._socet.sendCommandPacked(0x00200002, vertices.toString()) # Send vertex list
|
Loading…
x
Reference in New Issue
Block a user