Commit d8847e71117868ca6140ac7aead7d8b292f6f44f
1 parent
eb4d4519
Exists in
master
FIX: NDI USB port selection error and better allignment to Distance text
Showing
4 changed files
with
9 additions
and
7 deletions
Show diff stats
invesalius/data/trackers.py
... | ... | @@ -20,6 +20,7 @@ import invesalius.constants as const |
20 | 20 | import invesalius.gui.dialogs as dlg |
21 | 21 | # TODO: Disconnect tracker when a new one is connected |
22 | 22 | # TODO: Test if there are too many prints when connection fails |
23 | +# TODO: Redesign error messages. No point in having "Could not connect to default tracker" in all trackers | |
23 | 24 | |
24 | 25 | |
25 | 26 | def TrackerConnection(tracker_id, trck_init, action): | ... | ... |
invesalius/data/viewer_volume.py
... | ... | @@ -958,8 +958,8 @@ class Viewer(wx.Panel): |
958 | 958 | def CreateTextDistance(self): |
959 | 959 | tdist = vtku.Text() |
960 | 960 | tdist.SetSize(const.TEXT_SIZE_DIST_NAV) |
961 | - tdist.SetPosition((const.X, 1.03-const.Y)) | |
962 | - #tdist.ShadowOff() | |
961 | + tdist.SetPosition((const.X, 1.-const.Y)) | |
962 | + tdist.SetVerticalJustificationToBottom() | |
963 | 963 | tdist.BoldOn() |
964 | 964 | |
965 | 965 | self.ren.AddActor(tdist.actor) | ... | ... |
invesalius/data/vtk_utils.py
... | ... | @@ -149,6 +149,7 @@ class Text(object): |
149 | 149 | self.mapper.SetInput(value.encode("utf-8", errors='replace')) |
150 | 150 | |
151 | 151 | def SetCoilDistanceValue(self, value): |
152 | + #TODO: Not being used anymore. Can be deleted. | |
152 | 153 | if isinstance(value, int) or isinstance(value, float): |
153 | 154 | value = 'Dist: ' + str("{:06.2f}".format(value)) + ' mm' |
154 | 155 | if sys.platform == 'win32': | ... | ... |
invesalius/gui/dialogs.py
... | ... | @@ -3807,12 +3807,11 @@ class SetNDIconfigs(wx.Dialog): |
3807 | 3807 | ports = serial.tools.list_ports.comports() |
3808 | 3808 | if sys.platform.startswith('win'): |
3809 | 3809 | port_list = [] |
3810 | - count = 0 | |
3810 | + desc_list = [] | |
3811 | 3811 | for port, desc, hwid in sorted(ports): |
3812 | 3812 | port_list.append(port) |
3813 | - if 'NDI' in desc: | |
3814 | - port_selec = port, count | |
3815 | - count += 1 | |
3813 | + desc_list.append(desc) | |
3814 | + port_selec = [i for i, e in enumerate(desc_list) if 'NDI' in e] | |
3816 | 3815 | else: |
3817 | 3816 | raise EnvironmentError('Unsupported platform') |
3818 | 3817 | |
... | ... | @@ -3829,7 +3828,8 @@ class SetNDIconfigs(wx.Dialog): |
3829 | 3828 | port_list, port_selec = self.serial_ports() |
3830 | 3829 | |
3831 | 3830 | self.com_ports.Append(port_list) |
3832 | - self.com_ports.SetSelection(port_selec[1]) | |
3831 | + if port_selec: | |
3832 | + self.com_ports.SetSelection(port_selec[0]) | |
3833 | 3833 | |
3834 | 3834 | session = ses.Session() |
3835 | 3835 | last_ndi_probe_marker = session.get('paths', 'last_ndi_probe_marker', '') | ... | ... |