@@ -4093,19 +4093,19 @@ def user_button_setup(self):
40934093 msg0 = _translate ('HandlerClass' , 'are both required' )
40944094 msg1 = _translate ('HandlerClass' , 'only one has been specified for' )
40954095 STATUS .emit ('error' , linuxcnc .OPERATOR_ERROR , f'{ head } :\n CODE + NAME { msg0 } \n { msg1 } BUTTON_{ bNum } \n ' )
4096- self .w [f'button_{ str ( bNum ) } ' ].setText ('' )
4096+ self .w [f'button_{ bNum } ' ].setText ('' )
40974097 self .iniButtonCodes .append ('' )
40984098 continue
40994099 if not bCode :
4100- self .w [f'button_{ str ( bNum ) } ' ].setText ('' )
4100+ self .w [f'button_{ bNum } ' ].setText ('' )
41014101 self .iniButtonCodes .append ('' )
41024102 continue
41034103 code = bCode .lower ().strip ().split ()[0 ]
41044104 if code in singleCodes and code in iniButtonCodes :
41054105 msg1 = _translate ('HandlerClass' , 'Duplicate code entry for' )
41064106 msg2 = _translate ('HandlerClass' , 'Using first instance only of' )
41074107 STATUS .emit ('error' , linuxcnc .OPERATOR_ERROR , f'{ head } :\n { msg1 } BUTTON_{ iniButtonCodes .index (code )} + BUTTON_{ bNum } \n { msg2 } { bCode .split ()[0 ]} \n ' )
4108- self .w [f'button_{ str ( bNum ) } ' ].setText ('' )
4108+ self .w [f'button_{ bNum } ' ].setText ('' )
41094109 self .iniButtonCodes .append ('' )
41104110 continue
41114111 self .iniButtonCodes .append (bCode )
@@ -4116,7 +4116,7 @@ def user_button_setup(self):
41164116 if len (bNames ) > 1 :
41174117 for name in range (1 , len (bNames )):
41184118 bLabel += f'\n { bNames [name ]} '
4119- self .w [f'button_{ str ( bNum ) } ' ].setText (bLabel )
4119+ self .w [f'button_{ bNum } ' ].setText (bLabel )
41204120 # toggle-laser can be anywhere in the button code
41214121 if 'toggle-laser' in bCode :
41224122 self .tlButton .append (f'button_{ str (bNum )} ' )
@@ -4244,7 +4244,7 @@ def user_button_setup(self):
42444244 STATUS .emit ('error' , linuxcnc .OPERATOR_ERROR , f'{ head } :\n { msg0 } #{ bNum } \n { msg1 } "{ halpin } " { msg2 } \n ' )
42454245 continue
42464246 # halTogglePins format is: button name, run critical flag, button text, alt button text
4247- self .halTogglePins [halpin ] = [f'button_{ str ( bNum ) } ' , critical , bLabel , altLabel ]
4247+ self .halTogglePins [halpin ] = [f'button_{ bNum } ' , critical , bLabel , altLabel ]
42484248 elif code == 'pulse-halpin' :
42494249 if len (bCode .split ()) < 4 :
42504250 try :
@@ -4279,7 +4279,7 @@ def user_button_setup(self):
42794279 continue
42804280 # halPulsePins format is: button name, pulse time, button text, remaining time, button number
42814281 try :
4282- self .halPulsePins [halpin ] = [f'button_{ str ( bNum ) } ' , float (delay ), bLabel , 0.0 , bNum ]
4282+ self .halPulsePins [halpin ] = [f'button_{ bNum } ' , float (delay ), bLabel , 0.0 , bNum ]
42834283 except :
42844284 head = _translate ('HandlerClass' , 'User Button Error' )
42854285 msg1 = _translate ('HandlerClass' , 'Check button code for invalid seconds argument' )
@@ -4324,7 +4324,7 @@ def user_button_setup(self):
43244324 continue
43254325 else :
43264326 if len (data ) == 5 and data [4 ].strip ().lower () == 'true' :
4327- self .w [f'button_{ str ( bNum ) } ' ].setCheckable (True )
4327+ self .w [f'button_{ bNum } ' ].setCheckable (True )
43284328 checked = True
43294329 else :
43304330 checked = True
@@ -4353,7 +4353,7 @@ def user_button_setup(self):
43534353 self .alwaysOnList .append (f'button_{ str (bNum )} ' )
43544354 else :
43554355 head = _translate ('HandlerClass' , 'Code Error' )
4356- msg1 = self .w [f'button_{ str ( bNum ) } ' ].text ().replace ('\n ' , ' ' )
4356+ msg1 = self .w [f'button_{ bNum } ' ].text ().replace ('\n ' , ' ' )
43574357 STATUS .emit ('error' , linuxcnc .OPERATOR_ERROR , f'{ head } :\n { msg0 } #{ bNum } \n { msg1 } : "{ command } "\n ' )
43584358 if f'button_{ str (bNum )} ' in self .idleHomedList :
43594359 self .idleHomedList .remove (f'button_{ str (bNum )} ' )
@@ -4501,7 +4501,7 @@ def user_button_command(self, bNum, command):
45014501 else :
45024502 head = _translate ('HandlerClass' , 'Code Error' )
45034503 msg0 = _translate ('HandlerClass' , 'Value Error in user button' )
4504- msg1 = self .w [f'button_{ str ( bNum ) } ' ].text ().replace ('\n ' , ' ' )
4504+ msg1 = self .w [f'button_{ bNum } ' ].text ().replace ('\n ' , ' ' )
45054505 errorCode = f'{ subCommand .replace (":" , "{" )} ' + '}'
45064506 msg2 = _translate ('HandlerClass' , 'Requires a valid section and option pair' )
45074507 STATUS .emit ('error' , linuxcnc .OPERATOR_ERROR , f'{ head } :\n { msg0 } #{ bNum } ({ msg1 } ):\n "{ errorCode } "\n { msg2 } \n ' )
@@ -4513,7 +4513,7 @@ def user_button_command(self, bNum, command):
45134513 else :
45144514 head = _translate ('HandlerClass' , 'Code Error' )
45154515 msg0 = _translate ('HandlerClass' , 'Invalid code in user button' )
4516- msg1 = self .w [f'button_{ str ( bNum ) } ' ].text ().replace ('\n ' , ' ' )
4516+ msg1 = self .w [f'button_{ bNum } ' ].text ().replace ('\n ' , ' ' )
45174517 errorCode = f'{ subCommand .replace (":" , "{" )} ' + '}'
45184518 msg2 = _translate ('HandlerClass' , 'Provided section option pair does not exist' )
45194519 STATUS .emit ('error' , linuxcnc .OPERATOR_ERROR , f'{ head } :\n { msg0 } #{ bNum } ({ msg1 } ):\n "{ errorCode } "\n { msg2 } \n ' )
@@ -4539,7 +4539,7 @@ def user_button_command(self, bNum, command):
45394539 else :
45404540 head = _translate ('HandlerClass' , 'Code Error' )
45414541 msg0 = _translate ('HandlerClass' , 'Invalid code for user button' )
4542- msg1 = self .w [f'button_{ str ( bNum ) } ' ].text ().replace ('\n ' , ' ' )
4542+ msg1 = self .w [f'button_{ bNum } ' ].text ().replace ('\n ' , ' ' )
45434543 STATUS .emit ('error' , linuxcnc .OPERATOR_ERROR , f'{ head } :\n { msg0 } #{ bNum } \n { msg1 } : "{ command } "\n ' )
45444544
45454545 def user_button_up (self , bNum ):
@@ -5521,8 +5521,8 @@ def laser_pressed(self):
55215521 msg0 = _translate ('HandlerClass' , 'Torch cannot move outside the machine boundary' )
55225522 STATUS .emit ('error' , linuxcnc .OPERATOR_ERROR , f'{ head } :\n { msg0 } \n ' )
55235523 return
5524- hal .set_p ('plasmac.laser-x-offset' , f'{ str ( int (self .laserOffsetX / self .oScale ) )} ' )
5525- hal .set_p ('plasmac.laser-y-offset' , f'{ str ( int (self .laserOffsetY / self .oScale ) )} ' )
5524+ hal .set_p ('plasmac.laser-x-offset' , f'{ int (self .laserOffsetX / self .oScale )} ' )
5525+ hal .set_p ('plasmac.laser-y-offset' , f'{ int (self .laserOffsetY / self .oScale )} ' )
55265526 hal .set_p ('plasmac.laser-recovery-start' , '1' )
55275527 hal .set_p ('plasmac.cut-recovery' , '1' )
55285528 self .laserOnPin .set (1 )
@@ -6051,8 +6051,8 @@ def cutrec_move(self, state, x, y):
60516051 return
60526052 moveX = int (distX / self .oScale )
60536053 moveY = int (distY / self .oScale )
6054- hal .set_p ('plasmac.x-offset' , f'{ str ( hal .get_value ("plasmac.x-offset" ) + moveX ) } ' )
6055- hal .set_p ('plasmac.y-offset' , f'{ str ( hal .get_value ("plasmac.y-offset" ) + moveY ) } ' )
6054+ hal .set_p ('plasmac.x-offset' , f'{ hal .get_value ("plasmac.x-offset" ) + moveX } ' )
6055+ hal .set_p ('plasmac.y-offset' , f'{ hal .get_value ("plasmac.y-offset" ) + moveY } ' )
60566056 hal .set_p ('plasmac.cut-recovery' , '1' )
60576057
60586058 def cutrec_offset_changed (self , xOffset , yOffset ):
0 commit comments