fixed issue with nod emobility location calculations being forced to use ints
This commit is contained in:
parent
af9915191d
commit
8b7d651d06
3 changed files with 3 additions and 9 deletions
|
@ -488,7 +488,7 @@ class CoreGrpcServer(core_pb2_grpc.CoreApiServicer):
|
||||||
:return: node event that contains node id, name, model, position, and services
|
:return: node event that contains node id, name, model, position, and services
|
||||||
:rtype: core.api.grpc.core_pb2.NodeEvent
|
:rtype: core.api.grpc.core_pb2.NodeEvent
|
||||||
"""
|
"""
|
||||||
position = core_pb2.Position(x=event.x_position, y=event.y_position)
|
position = core_pb2.Position(x=int(event.x_position), y=int(event.y_position))
|
||||||
services = event.services or ""
|
services = event.services or ""
|
||||||
services = services.split("|")
|
services = services.split("|")
|
||||||
node_proto = core_pb2.Node(
|
node_proto = core_pb2.Node(
|
||||||
|
|
|
@ -26,8 +26,8 @@ def convert_node(node_data):
|
||||||
(NodeTlvs.EMULATION_ID, node_data.emulation_id),
|
(NodeTlvs.EMULATION_ID, node_data.emulation_id),
|
||||||
(NodeTlvs.EMULATION_SERVER, node_data.server),
|
(NodeTlvs.EMULATION_SERVER, node_data.server),
|
||||||
(NodeTlvs.SESSION, node_data.session),
|
(NodeTlvs.SESSION, node_data.session),
|
||||||
(NodeTlvs.X_POSITION, node_data.x_position),
|
(NodeTlvs.X_POSITION, int(node_data.x_position)),
|
||||||
(NodeTlvs.Y_POSITION, node_data.y_position),
|
(NodeTlvs.Y_POSITION, int(node_data.y_position)),
|
||||||
(NodeTlvs.CANVAS, node_data.canvas),
|
(NodeTlvs.CANVAS, node_data.canvas),
|
||||||
(NodeTlvs.NETWORK_ID, node_data.network_id),
|
(NodeTlvs.NETWORK_ID, node_data.network_id),
|
||||||
(NodeTlvs.SERVICES, node_data.services),
|
(NodeTlvs.SERVICES, node_data.services),
|
||||||
|
|
|
@ -811,12 +811,6 @@ class WayPointMobility(WirelessModel):
|
||||||
:param z: z position
|
:param z: z position
|
||||||
:return: nothing
|
:return: nothing
|
||||||
"""
|
"""
|
||||||
if x is not None:
|
|
||||||
x = int(x)
|
|
||||||
if y is not None:
|
|
||||||
y = int(y)
|
|
||||||
if z is not None:
|
|
||||||
z = int(z)
|
|
||||||
node.position.set(x, y, z)
|
node.position.set(x, y, z)
|
||||||
node_data = node.data(message_type=0)
|
node_data = node.data(message_type=0)
|
||||||
self.session.broadcast_node(node_data)
|
self.session.broadcast_node(node_data)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue