Commit 01cc68f0039c8582110efea6ee8680325e6df339

Authored by Renan
1 parent 430847f0
Exists in master

ADD: reset robot processing

invesalius/gui/task_navigator.py
@@ -1489,6 +1489,7 @@ class MarkersPanel(wx.Panel): @@ -1489,6 +1489,7 @@ class MarkersPanel(wx.Panel):
1489 1489
1490 m_target_robot = self.robot_markers[self.lc.GetFocusedItem()].robot_target_matrix 1490 m_target_robot = self.robot_markers[self.lc.GetFocusedItem()].robot_target_matrix
1491 1491
  1492 + Publisher.sendMessage('Reset robot process')
1492 Publisher.sendMessage('Robot target matrix', robot_tracker_flag=True, m_change_robot_to_head=m_target_robot) 1493 Publisher.sendMessage('Robot target matrix', robot_tracker_flag=True, m_change_robot_to_head=m_target_robot)
1493 1494
1494 def OnDeleteAllMarkers(self, evt=None): 1495 def OnDeleteAllMarkers(self, evt=None):
invesalius/navigation/robot.py
@@ -51,6 +51,7 @@ class Robot(): @@ -51,6 +51,7 @@ class Robot():
51 Publisher.subscribe(self.OnSendCoordinates, 'Send coord to robot') 51 Publisher.subscribe(self.OnSendCoordinates, 'Send coord to robot')
52 Publisher.subscribe(self.OnUpdateRobotTargetMatrix, 'Robot target matrix') 52 Publisher.subscribe(self.OnUpdateRobotTargetMatrix, 'Robot target matrix')
53 Publisher.subscribe(self.OnObjectTarget, 'Coil at target') 53 Publisher.subscribe(self.OnObjectTarget, 'Coil at target')
  54 + Publisher.subscribe(self.OnResetProcessTracker, 'Reset robot process')
54 55
55 def OnRobotConnection(self): 56 def OnRobotConnection(self):
56 if not self.tracker.trk_init[0][0] or not self.tracker.trk_init[1][0]: 57 if not self.tracker.trk_init[0][0] or not self.tracker.trk_init[1][0]:
@@ -82,7 +83,9 @@ class Robot(): @@ -82,7 +83,9 @@ class Robot():
82 83
83 def StopRobotThreadNavigation(self): 84 def StopRobotThreadNavigation(self):
84 self.thread_robot.join() 85 self.thread_robot.join()
85 - #TODO: initialize process_tracker every time a "send coordinates to robot" is requested 86 + self.OnResetProcessTracker()
  87 +
  88 + def OnResetProcessTracker(self):
86 self.process_tracker.__init__() 89 self.process_tracker.__init__()
87 90
88 def OnSendCoordinates(self, coord): 91 def OnSendCoordinates(self, coord):