updated grpc node positions to use floats, avoids needing to deal with int conversions

This commit is contained in:
Blake Harnden 2019-12-13 10:47:23 -08:00
parent 9c302e8bc6
commit 819954a695
6 changed files with 12 additions and 33 deletions

View file

@ -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):

View file

@ -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

View file

@ -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