diff --git a/coretk/coretk/coreclient.py b/coretk/coretk/coreclient.py index ec6ca772..a5f407b7 100644 --- a/coretk/coretk/coreclient.py +++ b/coretk/coretk/coreclient.py @@ -183,8 +183,7 @@ class CoreClient: ) def handle_exception_event(self, event): - print(event) - print(event.node_id) + logging.info("exception event: %s", event) self.app.statusbar.core_alarms.append(event) def join_session(self, session_id, query_location=True): diff --git a/coretk/coretk/graph/graph.py b/coretk/coretk/graph/graph.py index 42dbc934..a2d82dc4 100644 --- a/coretk/coretk/graph/graph.py +++ b/coretk/coretk/graph/graph.py @@ -616,10 +616,7 @@ class CanvasGraph(tk.Canvas): if self.selected is None or self.selected in self.shapes: actual_x, actual_y = self.get_actual_coords(x, y) core_node = self.core.create_node( - int(actual_x), - int(actual_y), - self.node_draw.node_type, - self.node_draw.model, + actual_x, actual_y, self.node_draw.node_type, self.node_draw.model ) node = CanvasNode(self.master, x, y, core_node, self.node_draw.image) self.core.canvas_nodes[core_node.id] = node diff --git a/coretk/coretk/graph/node.py b/coretk/coretk/graph/node.py index 11c7eaf5..0d0f8706 100644 --- a/coretk/coretk/graph/node.py +++ b/coretk/coretk/graph/node.py @@ -140,8 +140,8 @@ class CanvasNode: # set actual coords for node and update core is running real_x, real_y = self.canvas.get_actual_coords(x, y) - self.core_node.position.x = int(real_x) - self.core_node.position.y = int(real_y) + self.core_node.position.x = real_x + self.core_node.position.y = real_y if self.app.core.is_runtime() and update: self.app.core.edit_node(self.core_node) @@ -164,11 +164,6 @@ class CanvasNode: else: self.show_config() - def update_coords(self): - x, y = self.canvas.coords(self.id) - self.core_node.position.x = int(x) - self.core_node.position.y = int(y) - def create_context(self): is_wlan = self.core_node.type == NodeType.WIRELESS_LAN is_emane = self.core_node.type == NodeType.EMANE diff --git a/daemon/core/api/grpc/server.py b/daemon/core/api/grpc/server.py index fd1a73c3..4ee32751 100644 --- a/daemon/core/api/grpc/server.py +++ b/daemon/core/api/grpc/server.py @@ -489,13 +489,7 @@ class CoreGrpcServer(core_pb2_grpc.CoreApiServicer): :return: node event that contains node id, name, model, position, and services :rtype: core.api.grpc.core_pb2.NodeEvent """ - x = None - if event.x_position is not None: - x = int(event.x_position) - y = None - if event.y_position is not None: - y = int(event.y_position) - position = core_pb2.Position(x=x, y=y) + position = core_pb2.Position(x=event.x_position, y=event.y_position) services = event.services or "" services = services.split("|") node_proto = core_pb2.Node( diff --git a/daemon/core/xml/corexml.py b/daemon/core/xml/corexml.py index 9ba63395..285b7a3b 100644 --- a/daemon/core/xml/corexml.py +++ b/daemon/core/xml/corexml.py @@ -117,14 +117,8 @@ class NodeElement: def add_position(self): x = self.node.position.x - if x is not None: - x = int(x) y = self.node.position.y - if y is not None: - y = int(y) z = self.node.position.z - if z is not None: - z = int(z) lat, lon, alt = None, None, None if x is not None and y is not None: lat, lon, alt = self.session.location.getgeo(x, y, z) @@ -751,8 +745,8 @@ class CoreXmlReader: position_element = device_element.find("position") if position_element is not None: - x = get_int(position_element, "x") - y = get_int(position_element, "y") + x = get_float(position_element, "x") + y = get_float(position_element, "y") if all([x, y]): options.set_position(x, y) @@ -773,8 +767,8 @@ class CoreXmlReader: position_element = network_element.find("position") if position_element is not None: - x = get_int(position_element, "x") - y = get_int(position_element, "y") + x = get_float(position_element, "x") + y = get_float(position_element, "y") if all([x, y]): options.set_position(x, y) diff --git a/daemon/proto/core/api/grpc/core.proto b/daemon/proto/core/api/grpc/core.proto index 57bbf3f4..253102bf 100644 --- a/daemon/proto/core/api/grpc/core.proto +++ b/daemon/proto/core/api/grpc/core.proto @@ -949,9 +949,9 @@ message SessionLocation { } message Position { - int32 x = 1; - int32 y = 2; - int32 z = 3; + float x = 1; + float y = 2; + float z = 3; float lat = 4; float lon = 5; float alt = 6;