Commit 5dc2aeadcdf3b4f18bced3f05a1b17221ff53c1c
Committed by
Thiago Franco de Moraes
1 parent
82be8627
Exists in
master
Fixed pubsub for neuronavigation (#144)
* Fix pubsub for navigation * Fix pubsub for navigation PATRIOT trigger * Fix pubsub for navigation delete marker
Showing
2 changed files
with
17 additions
and
15 deletions
Show diff stats
invesalius/data/trigger.py
invesalius/gui/task_navigator.py
... | ... | @@ -239,21 +239,23 @@ class InnerFoldPanel(wx.Panel): |
239 | 239 | Publisher.sendMessage('Update trigger state', trigger_state=ctrl.GetValue()) |
240 | 240 | |
241 | 241 | def OnShowObject(self, evt=None, flag=None, obj_name=None): |
242 | - if flag: | |
243 | - self.checkobj.Enable(True) | |
244 | - self.track_obj = True | |
245 | - Publisher.sendMessage('Status target button', status=True) | |
246 | - else: | |
247 | - self.checkobj.Enable(False) | |
248 | - self.checkobj.SetValue(False) | |
249 | - self.track_obj = False | |
250 | - Publisher.sendMessage('Status target button', status=False) | |
242 | + if not evt: | |
243 | + if flag: | |
244 | + self.checkobj.Enable(True) | |
245 | + self.track_obj = True | |
246 | + Publisher.sendMessage('Status target button', status=True) | |
247 | + else: | |
248 | + self.checkobj.Enable(False) | |
249 | + self.checkobj.SetValue(False) | |
250 | + self.track_obj = False | |
251 | + Publisher.sendMessage('Status target button', status=False) | |
251 | 252 | |
252 | 253 | Publisher.sendMessage('Update show object state', state=self.checkobj.GetValue()) |
253 | 254 | |
254 | 255 | def OnVolumeCamera(self, evt=None, target_mode=None): |
255 | - if target_mode is True: | |
256 | - self.checkcamera.SetValue(0) | |
256 | + if not evt: | |
257 | + if target_mode is True: | |
258 | + self.checkcamera.SetValue(0) | |
257 | 259 | Publisher.sendMessage('Update volume camera state', camera_state=self.checkcamera.GetValue()) |
258 | 260 | |
259 | 261 | |
... | ... | @@ -860,7 +862,7 @@ class ObjectRegistrationPanel(wx.Panel): |
860 | 862 | self.btn_load.Enable(1) |
861 | 863 | if self.obj_fiducials is not None: |
862 | 864 | self.checktrack.Enable(1) |
863 | - Publisher.sendMessage('Enable target button', True) | |
865 | + #Publisher.sendMessage('Enable target button', True) | |
864 | 866 | |
865 | 867 | def OnSelectAngleThreshold(self, evt, ctrl): |
866 | 868 | Publisher.sendMessage('Update angle threshold', angle=ctrl.GetValue()) |
... | ... | @@ -1121,7 +1123,7 @@ class MarkersPanel(wx.Panel): |
1121 | 1123 | self.tgt_index = self.lc.GetFocusedItem() |
1122 | 1124 | self.lc.SetItemBackgroundColour(self.tgt_index, 'RED') |
1123 | 1125 | |
1124 | - Publisher.sendMessage('Update target', coord=self.list_coord[self.tgt_index]) | |
1126 | + Publisher.sendMessage('Update target', coord=self.list_coord[self.tgt_index][:6]) | |
1125 | 1127 | Publisher.sendMessage('Set target transparency', status=True, index=self.tgt_index) |
1126 | 1128 | Publisher.sendMessage('Disable or enable coil tracker', status=True) |
1127 | 1129 | self.OnMenuEditMarkerId('TARGET') |
... | ... | @@ -1152,7 +1154,7 @@ class MarkersPanel(wx.Panel): |
1152 | 1154 | # OnDeleteSingleMarker is used for both pubsub and button click events |
1153 | 1155 | # Pubsub is used for fiducial handle and button click for all others |
1154 | 1156 | |
1155 | - if marker_id is not None: | |
1157 | + if not evt: | |
1156 | 1158 | if self.lc.GetItemCount(): |
1157 | 1159 | for id_n in range(self.lc.GetItemCount()): |
1158 | 1160 | item = self.lc.GetItem(id_n, 4) | ... | ... |