Commit 1fa41d6d2c237d40fe2efcdd8239e317f8185dc9

Authored by Renan
Committed by Thiago Franco de Moraes
1 parent cd0cef09
Exists in master

Minor enh nav (#200)

* Trigger improves

* better errors messages for polhemus
invesalius/data/trackers.py
... ... @@ -152,7 +152,7 @@ def PolhemusTracker(tracker_id):
152 152 except:
153 153 trck_init = None
154 154 lib_mode = 'error'
155   - print('Could not connect to Polhemus.')
  155 + print('Could not connect to Polhemus by any method.')
156 156  
157 157 return trck_init, lib_mode
158 158  
... ... @@ -182,10 +182,10 @@ def PlhWrapperConnection(tracker_id):
182 182 sleep(0.175)
183 183 else:
184 184 trck_init = None
185   - print('Could not connect to Polhemus via wrapper without error.')
  185 + print('Could not connect to Polhemus via wrapper without error: Initialize is False.')
186 186 except:
187 187 trck_init = None
188   - print('Could not connect to Polhemus via wrapper with error.')
  188 + print('Could not connect to Polhemus via wrapper without error: Import failed.')
189 189  
190 190 return trck_init
191 191  
... ...
invesalius/data/trigger.py
... ... @@ -43,7 +43,8 @@ class Trigger(threading.Thread):
43 43 self.COM = True
44 44  
45 45 except:
46   - wx.MessageBox(_('Connection with port COM1 failed'), _('Communication error'), wx.OK | wx.ICON_ERROR)
  46 + #wx.MessageBox(_('Connection with port COM1 failed'), _('Communication error'), wx.OK | wx.ICON_ERROR)
  47 + print("Trigger init error: Connection with port COM1 failed")
47 48 self.COM = False
48 49  
49 50 self._pause_ = False
... ... @@ -61,7 +62,7 @@ class Trigger(threading.Thread):
61 62 def run(self):
62 63 while self.nav_id:
63 64 if self.COM:
64   - self.trigger_init.write('0')
  65 + self.trigger_init.write(b'0')
65 66 sleep(0.3)
66 67 lines = self.trigger_init.readlines()
67 68 # Following lines can simulate a trigger in 3 sec repetitions
... ...