Skip to content

Commit

Permalink
Merge pull request #868 from invesalius/FIX-robot-warnings-and-ADD-ro…
Browse files Browse the repository at this point in the history
…bot-and-NDI-IPs

Fix robot warnings and add robot and ndi IPs
  • Loading branch information
rmatsuda authored Dec 10, 2024
2 parents a4b4bba + 888ccc6 commit 78b5f41
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
12 changes: 9 additions & 3 deletions invesalius/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@
DEFAULT_TRACKER = SELECT

NDICOMPORT = b"COM1"
NDI_IP = ["P9-13715.local", "P9-13719.local"]
NDI_IP = ["P9-13715.local", "P9-13719.local", "P9-25026.local"]

TRACKERS = [
_("Claron MicronTracker"),
Expand Down Expand Up @@ -1126,8 +1126,14 @@
PULSE_DURATION_IN_MILLISECONDS = 0.2

# Robot
ROBOT_ElFIN_IP = ["192.168.200.251", "143.107.220.251", "169.254.153.251", "127.0.0.1"]
ROBOT_DOBOT_IP = ["192.168.1.6"]
ROBOT_IPS = [
"192.168.200.251",
"143.107.220.251",
"169.254.153.251",
"127.0.0.1",
"192.168.1.6",
"169.254.128.103",
]

MTMS_RADIUS = 15

Expand Down
2 changes: 1 addition & 1 deletion invesalius/data/viewer_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ def DisableTargetMode(self):
if self.distance_text is not None:
self.ren.RemoveActor(self.distance_text.actor)

# Remove the actor for 'distance' text.
# Remove the actor for 'robot warnings' text.
if self.robot_warnings_text is not None:
self.ren.RemoveActor(self.robot_warnings_text.actor)

Expand Down
2 changes: 1 addition & 1 deletion invesalius/gui/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6510,7 +6510,7 @@ def __init__(self, title: str = _("Set Robot IP")):
def _init_gui(self) -> None:
# ComboBox for spatial tracker device selection
tooltip = _("Choose or type the robot IP")
robot_ip_options = [_("Select robot IP:")] + const.ROBOT_ElFIN_IP
robot_ip_options = [_("Select robot IP:")] + const.ROBOT_IPS
choice_IP = wx.ComboBox(
self, -1, "", choices=robot_ip_options, style=wx.CB_DROPDOWN | wx.TE_PROCESS_ENTER
)
Expand Down
2 changes: 1 addition & 1 deletion invesalius/gui/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ def __init__(self, parent, tracker, robot):

# ComboBox for spatial tracker device selection
tooltip = _("Choose or type the robot IP")
robot_ip_options = [_("Select robot IP:")] + const.ROBOT_ElFIN_IP + const.ROBOT_DOBOT_IP
robot_ip_options = [_("Select robot IP:")] + const.ROBOT_IPS
choice_IP = wx.ComboBox(
self, -1, "", choices=robot_ip_options, style=wx.CB_DROPDOWN | wx.TE_PROCESS_ENTER
)
Expand Down
6 changes: 6 additions & 0 deletions invesalius/gui/task_navigator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,9 @@ def OnRobotTrackTargetButton(self, evt=None, ctrl=None):
# objective set by another button; hence this check.
if self.robot.objective == RobotObjective.TRACK_TARGET:
self.robot.SetObjective(RobotObjective.NONE)
Publisher.sendMessage(
"Robot to Neuronavigation: Update robot warning", robot_warning=""
)

# 'Move away' button
def EnableRobotMoveAwayButton(self, enabled=False):
Expand All @@ -1925,6 +1928,9 @@ def OnRobotMoveAwayButton(self, evt=None, ctrl=None):
# objective set by another button; hence this check.
if self.robot.objective == RobotObjective.MOVE_AWAY_FROM_HEAD:
self.robot.SetObjective(RobotObjective.NONE)
Publisher.sendMessage(
"Robot to Neuronavigation: Update robot warning", robot_warning=""
)

# 'Free drive' button
def EnableRobotFreeDriveButton(self, enabled=False):
Expand Down

0 comments on commit 78b5f41

Please sign in to comment.