Skip to content

Commit 9abe09d

Browse files
committed
PR feedback
1 parent fcb6f19 commit 9abe09d

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

Python/robodk/robolink.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ def _moveX(self, target: Union['Item', List[float], robomath.Mat], itemrobot: 'I
11091109
self._check_status()
11101110
if blocking:
11111111
#itemrobot.WaitMove()
1112-
self.COM.settimeout(max(360000,self.TIMEOUT))
1112+
self.COM.settimeout(max(360000, self.TIMEOUT))
11131113
self._check_status() #will wait here
11141114
self.COM.settimeout(self.TIMEOUT)
11151115

@@ -1163,7 +1163,7 @@ def MoveC(self, target1: Union['Item', List[float], robomath.Mat], target2: Unio
11631163
self._check_status()
11641164
if blocking:
11651165
#itemrobot.WaitMove()
1166-
self.COM.settimeout(max(360000,self.TIMEOUT))
1166+
self.COM.settimeout(max(360000, self.TIMEOUT))
11671167
self._check_status() #will wait here
11681168
self.COM.settimeout(self.TIMEOUT)
11691169

@@ -1450,7 +1450,7 @@ def output_reader(proc):
14501450
if self.NODELAY:
14511451
self.COM.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
14521452

1453-
self.COM.settimeout(1) # Intentionally low tiemout
1453+
self.COM.settimeout(1) # Intentionally low timeout
14541454
try:
14551455
self.COM.connect((self.IP, port))
14561456
connected = self._is_connected()
@@ -1633,7 +1633,7 @@ def ItemUserPick(self, message: str = "Pick one item", itemtype_or_list: Union[i
16331633
for itm in itemtype_or_list:
16341634
self._send_item(itm)
16351635

1636-
self.COM.settimeout(max(3600,self.TIMEOUT)) # wait up to 1 hour for user input
1636+
self.COM.settimeout(max(3600, self.TIMEOUT)) # wait up to 1 hour for user input
16371637
item = self._rec_item()
16381638
self.COM.settimeout(self.TIMEOUT)
16391639
self._check_status()
@@ -1805,7 +1805,7 @@ def ShowMessage(self, message: str, popup: bool = True):
18051805
command = 'ShowMessage'
18061806
self._send_line(command)
18071807
self._send_line(message)
1808-
self.COM.settimeout(max(3600,self.TIMEOUT)) # wait up to 1 hour user to hit OK
1808+
self.COM.settimeout(max(3600, self.TIMEOUT)) # wait up to 1 hour user to hit OK
18091809
self._check_status()
18101810
self.COM.settimeout(self.TIMEOUT)
18111811
else:
@@ -2173,7 +2173,7 @@ def ProjectPoints(self, points: Union[List[float], robomath.Mat], object_project
21732173
self._send_matrix(points)
21742174
self._send_item(object_project)
21752175
self._send_int(projection_type)
2176-
self.COM.settimeout(max(timeout,self.TIMEOUT)) # 30 seconds timeout
2176+
self.COM.settimeout(max(timeout, self.TIMEOUT))
21772177
projected_points = self._rec_matrix() # will wait here
21782178
self.COM.settimeout(self.TIMEOUT)
21792179
self._check_status()
@@ -2229,7 +2229,7 @@ def Save(self, filename: str, itemsave: 'Item' = 0):
22292229
self._send_line(command)
22302230
self._send_line(filename)
22312231
self._send_item(itemsave)
2232-
self.COM.settimeout(max(60,self.TIMEOUT))
2232+
self.COM.settimeout(max(60, self.TIMEOUT))
22332233
self._check_status()
22342234
self.COM.settimeout(self.TIMEOUT)
22352235

@@ -2984,7 +2984,7 @@ def Command(self, cmd: str, value: Union[str, Dict, robomath.Mat, 'Item'] = '',
29842984
self._send_item(None)
29852985
self._send_line(str(cmd))
29862986
self._send_matrix(value)
2987-
self.COM.settimeout(max(3600,self.TIMEOUT))
2987+
self.COM.settimeout(max(3600, self.TIMEOUT))
29882988
nmats = self._rec_int()
29892989
self.COM.settimeout(self.TIMEOUT)
29902990
mat2d_list = []
@@ -3290,7 +3290,7 @@ def CalibrateTool(self, poses_xyzwpr: Union[List[robomath.Mat], List[List[float]
32903290
self._send_array(algorithm)
32913291
self._send_item(robot)
32923292
self._send_item(tool)
3293-
self.COM.settimeout(max(3600,self.TIMEOUT))
3293+
self.COM.settimeout(max(3600, self.TIMEOUT))
32943294
TCPxyz = self._rec_array()
32953295
self.COM.settimeout(self.TIMEOUT)
32963296
errorstats = self._rec_array()
@@ -3670,7 +3670,7 @@ def Cam2D_Snapshot(self, file_save_img: str = "", cam_handle: 'Item' = 0, params
36703670
self._send_item(cam_handle)
36713671
self._send_line(file_save_img)
36723672
self._send_line(params)
3673-
self.COM.settimeout(max(3600,self.TIMEOUT))
3673+
self.COM.settimeout(max(3600, self.TIMEOUT))
36743674
if len(file_save_img) == 0:
36753675
# If the file name is empty we are expecting a byte array as PNG file
36763676
success = self._rec_bytes()
@@ -3959,7 +3959,7 @@ def Popup_ISO9283_CubeProgram(self, robot: 'Item' = 0) -> 'Item':
39593959
command = 'Popup_ProgISO9283'
39603960
self._send_line(command)
39613961
self._send_item(robot)
3962-
self.COM.settimeout(max(3600,self.TIMEOUT))
3962+
self.COM.settimeout(max(3600, self.TIMEOUT))
39633963
iso_program = self._rec_item()
39643964
self.COM.settimeout(self.TIMEOUT)
39653965
self._check_status()
@@ -4139,7 +4139,7 @@ def PluginCommand(self, plugin_name: str, plugin_command: str = "", value: str =
41394139
self._send_line(plugin_name)
41404140
self._send_line(plugin_command)
41414141
self._send_line(str(value))
4142-
self.COM.settimeout(max(3600 * 24 * 7,self.TIMEOUT))
4142+
self.COM.settimeout(max(3600 * 24 * 7, self.TIMEOUT))
41434143
result = self._rec_line()
41444144
self.COM.settimeout(self.TIMEOUT)
41454145
self._check_status()
@@ -5196,7 +5196,7 @@ def setMachiningParameters(self, ncfile: str = '', part: 'Item' = 0, params: str
51965196
self.link._send_line(ncfile)
51975197
self.link._send_item(part)
51985198
self.link._send_line(params)
5199-
self.link.COM.settimeout(max(3600,self.TIMEOUT))
5199+
self.link.COM.settimeout(max(3600, self.TIMEOUT))
52005200
newprog = self.link._rec_item()
52015201
self.link.COM.settimeout(self.link.TIMEOUT)
52025202
status = self.link._rec_int() / 1000.0
@@ -6177,7 +6177,7 @@ def MoveJ_Test(self, j1: Union[List[float], robomath.Mat], j2: Union[List[float]
61776177
self.link._send_array(j1)
61786178
self.link._send_array(j2)
61796179
self.link._send_int(minstep_deg * 1000)
6180-
self.link.COM.settimeout(max(3600,self.TIMEOUT)) # wait up to 1 hour
6180+
self.link.COM.settimeout(max(3600, self.TIMEOUT))
61816181
collision = self.link._rec_int()
61826182
self.link.COM.settimeout(self.link.TIMEOUT)
61836183
self.link._check_status()
@@ -6211,7 +6211,7 @@ def MoveJ_Test_Blend(self, j1: Union[List[float], robomath.Mat], j2: Union[List[
62116211
self.link._send_array(j3)
62126212
self.link._send_int(minstep_deg * 1000.0)
62136213
self.link._send_int(blend_deg * 1000.0)
6214-
self.link.COM.settimeout(max(3600,self.TIMEOUT))
6214+
self.link.COM.settimeout(max(3600, self.TIMEOUT))
62156215
collision = self.link._rec_int()
62166216
self.link.COM.settimeout(self.link.TIMEOUT)
62176217
self.link._check_status()
@@ -6241,7 +6241,7 @@ def MoveL_Test(self, j1: Union[List[float], robomath.Mat], pose: robomath.Mat, m
62416241
self.link._send_array(j1)
62426242
self.link._send_pose(pose)
62436243
self.link._send_int(minstep_mm * 1000)
6244-
self.link.COM.settimeout(max(3600,self.TIMEOUT)) # wait up to 1 hour
6244+
self.link.COM.settimeout(max(3600, self.TIMEOUT))
62456245
collision = self.link._rec_int()
62466246
self.link.COM.settimeout(self.link.TIMEOUT)
62476247
self.link._check_status()
@@ -6589,7 +6589,7 @@ def MakeProgram(self, folder_path: str = '', run_mode: int = RUNMODE_MAKE_ROBOTP
65896589
self.link._send_item(self)
65906590
self.link._send_line(folder_path)
65916591
self.link._send_int(run_mode)
6592-
self.link.COM.settimeout(max(300,self.TIMEOUT)) # wait up to 5 minutes for the program to generate
6592+
self.link.COM.settimeout(max(300, self.TIMEOUT)) # wait at least 5 minutes for the program to generate
65936593
prog_status = self.link._rec_int()
65946594
self.link.COM.settimeout(self.link.TIMEOUT)
65956595
prog_log_str = self.link._rec_line()
@@ -6838,7 +6838,7 @@ def waitDI(self, io_var: Union[int, str], io_value: Union[int, float, str], time
68386838
self.link._send_line(str(io_var))
68396839
self.link._send_line(str(io_value))
68406840
self.link._send_int(timeout_ms * 1000)
6841-
self.link.COM.settimeout(max(3600 * 24 * 7,self.TIMEOUT)) # wait up to 1 week
6841+
self.link.COM.settimeout(max(3600 * 24 * 7, self.TIMEOUT))
68426842
self.link._check_status()
68436843
self.link.COM.settimeout(self.link.TIMEOUT)
68446844

@@ -7138,7 +7138,7 @@ def Update(self, check_collisions: int = COLLISION_OFF, timeout_sec: float = 360
71387138
self.link._send_line(command)
71397139
self.link._send_item(self)
71407140
self.link._send_array([check_collisions, mm_step, deg_step])
7141-
self.link.COM.settimeout(max(timeout_sec,self.TIMEOUT)) # wait up to 1 hour user to hit OK
7141+
self.link.COM.settimeout(max(timeout_sec, self.TIMEOUT)) # wait at least up to 1 hour user to hit OK
71427142
values = self.link._rec_array().tolist()
71437143
self.link.COM.settimeout(self.link.TIMEOUT)
71447144
readable_msg = self.link._rec_line()
@@ -7215,7 +7215,7 @@ def InstructionListJoints(self, mm_step: float = 10, deg_step: float = 5, save_t
72157215
self.link._send_item(self)
72167216
self.link._send_array([mm_step, deg_step, float(collision_check), float(flags), float(time_step)])
72177217
joint_list = save_to_file
7218-
self.link.COM.settimeout(max(3600,self.TIMEOUT))
7218+
self.link.COM.settimeout(max(3600, self.TIMEOUT))
72197219
if save_to_file is None:
72207220
self.link._send_line('')
72217221
joint_list = self.link._rec_matrix()
@@ -7339,7 +7339,7 @@ def setParam(self, param: str, value: Union[str, Dict, bytes, 'Item', bool, robo
73397339
self.link._send_item(self)
73407340
self.link._send_line(str(param))
73417341
self.link._send_matrix(value)
7342-
self.link.COM.settimeout(max(3600,self.TIMEOUT))
7342+
self.link.COM.settimeout(max(3600, self.TIMEOUT))
73437343
nmats = self.link._rec_int()
73447344
self.link.COM.settimeout(self.link.TIMEOUT)
73457345
mat2d_list = []
@@ -7378,7 +7378,7 @@ def setParam(self, param: str, value: Union[str, Dict, bytes, 'Item', bool, robo
73787378
self.link._send_line(str(param))
73797379
self.link._send_line(value)
73807380

7381-
self.link.COM.settimeout(max(3600,self.TIMEOUT))
7381+
self.link.COM.settimeout(max(3600, self.TIMEOUT))
73827382
line = self.link._rec_line()
73837383
self.link.COM.settimeout(self.link.TIMEOUT)
73847384

0 commit comments

Comments
 (0)