Commit e236e64926e6280b99e6ae491bbf474d97e75822
1 parent
d450b91b
Exists in
master
FIX: minor coordinates and markers bugs
Showing
3 changed files
with
11 additions
and
7 deletions
Show diff stats
invesalius/data/coordinates.py
| ... | ... | @@ -19,7 +19,6 @@ |
| 19 | 19 | |
| 20 | 20 | from math import sin, cos |
| 21 | 21 | import numpy as np |
| 22 | -import queue | |
| 23 | 22 | import threading |
| 24 | 23 | import wx |
| 25 | 24 | |
| ... | ... | @@ -35,11 +34,14 @@ class TrackerCoordinates(): |
| 35 | 34 | def __init__(self): |
| 36 | 35 | self.coord = None |
| 37 | 36 | self.markers_flag = [False, False, False] |
| 37 | + self.previous_markers_flag = self.markers_flag | |
| 38 | 38 | |
| 39 | 39 | def SetCoordinates(self, coord, markers_flag): |
| 40 | 40 | self.coord = coord |
| 41 | 41 | self.markers_flag = markers_flag |
| 42 | - wx.CallAfter(Publisher.sendMessage, 'Sensors ID', markers_flag=self.markers_flag) | |
| 42 | + if self.previous_markers_flag != self.markers_flag: | |
| 43 | + wx.CallAfter(Publisher.sendMessage, 'Sensors ID', markers_flag=self.markers_flag) | |
| 44 | + self.previous_markers_flag = self.markers_flag | |
| 43 | 45 | |
| 44 | 46 | def GetCoordinates(self): |
| 45 | 47 | return self.coord, self.markers_flag |
| ... | ... | @@ -232,7 +234,7 @@ def PolhemusCoord(trck, trck_id, ref_mode): |
| 232 | 234 | elif trck[1] == 'wrapper': |
| 233 | 235 | coord = PolhemusWrapperCoord(trck[0], trck_id, ref_mode) |
| 234 | 236 | |
| 235 | - return coord, None | |
| 237 | + return coord, [False, False, False] | |
| 236 | 238 | |
| 237 | 239 | |
| 238 | 240 | def PolhemusWrapperCoord(trck, trck_id, ref_mode): | ... | ... |
invesalius/gui/dialogs.py
| ... | ... | @@ -4691,7 +4691,8 @@ class SetNDIconfigs(wx.Dialog): |
| 4691 | 4691 | btn_ok = wx.Button(self, wx.ID_OK) |
| 4692 | 4692 | btn_ok.SetHelpText("") |
| 4693 | 4693 | btn_ok.SetDefault() |
| 4694 | - btn_ok.Enable(False) | |
| 4694 | + if not port_selec: | |
| 4695 | + btn_ok.Enable(False) | |
| 4695 | 4696 | self.btn_ok = btn_ok |
| 4696 | 4697 | |
| 4697 | 4698 | btn_cancel = wx.Button(self, wx.ID_CANCEL) | ... | ... |
invesalius/gui/task_navigator.py
| ... | ... | @@ -1379,7 +1379,7 @@ class MarkersPanel(wx.Panel): |
| 1379 | 1379 | |
| 1380 | 1380 | next = self.lc.GetFirstSelected() |
| 1381 | 1381 | |
| 1382 | - while next is not None: | |
| 1382 | + while next is not -1: | |
| 1383 | 1383 | selection.append(next) |
| 1384 | 1384 | next = self.lc.GetNextSelected(next) |
| 1385 | 1385 | |
| ... | ... | @@ -1566,8 +1566,9 @@ class MarkersPanel(wx.Panel): |
| 1566 | 1566 | if index: |
| 1567 | 1567 | if self.__find_target_marker() in index: |
| 1568 | 1568 | Publisher.sendMessage('Disable or enable coil tracker', status=False) |
| 1569 | - Publisher.sendMessage('Robot target matrix', robot_tracker_flag=False, | |
| 1570 | - m_change_robot_to_head=None) | |
| 1569 | + if self.tracker.tracker_id == const.ROBOT: | |
| 1570 | + Publisher.sendMessage('Robot target matrix', robot_tracker_flag=False, | |
| 1571 | + m_change_robot_to_head=[]) | |
| 1571 | 1572 | wx.MessageBox(_("Target deleted."), _("InVesalius 3")) |
| 1572 | 1573 | |
| 1573 | 1574 | self.__delete_multiple_markers(index) | ... | ... |