Skip to content

Commit

Permalink
RUFF
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcioCamposJr committed Feb 3, 2025
1 parent 52e0324 commit 2437e61
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions invesalius/gui/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,6 @@ def ShowParent(self): # show preferences dialog box

def verifyFormatIP(self, robot_ip):
robot_ip_strip = robot_ip.strip()

full_ip_pattern = re.compile(
r"^(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)"
r"\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)"
Expand All @@ -1768,20 +1767,16 @@ def verifyFormatIP(self, robot_ip):

def OnTxt_Ent(self, evt, ctrl):
robot_ip_input = ctrl.GetValue()

robot_ip_input = re.sub(r"[^0-9.]", "", robot_ip_input)

ctrl.ChangeValue(robot_ip_input)

msg_box = _("Select or type robot IP:")

if robot_ip_input == "":
ctrl.ChangeValue(msg_box)

else:
self.btn_rob_con.Hide()
self.robot_ip = robot_ip_input

if self.verifyFormatIP(self.robot_ip):
self.status_text.SetLabelText(_("Robot is not connected!"))

Expand All @@ -1795,9 +1790,7 @@ def OnAddIP(self, evt):
if new_ip is not None and self.verifyFormatIP(new_ip):
if new_ip not in self.robot.robot_ip_options:
self.choice_IP.Append(new_ip)

self.robot.robot_ip_options.append(new_ip)

self.robot.SaveConfig("robot_ip_options", self.robot.robot_ip_options)
else:
self.choice_IP.SetSelection(self.robot.robot_ip_options.index(new_ip))
Expand Down Expand Up @@ -1846,7 +1839,6 @@ def OnRobotConnect(self, evt):
Publisher.sendMessage(
"Neuronavigation to Robot: Connect to robot", robot_IP=self.robot_ip
)

else:
self.status_text.SetLabelText(_("Please select or enter valid IP before connecting!"))

Expand All @@ -1864,7 +1856,6 @@ def OnRobotRegister(self, evt):
def OnRobotStatus(self, data):
if data == "Connected":
self.robot.is_robot_connected = True

self.status_text.SetLabelText(_("Setup robot transformation matrix:"))
self.btn_rob_con.Show()
self.Layout()
Expand Down

0 comments on commit 2437e61

Please sign in to comment.