ConfigTreeNode.py
changeset 1758 845ca626db09
parent 1747 6046ffa2280f
child 1760 ed2e2afb9573
equal deleted inserted replaced
1757:0de89da92ee0 1758:845ca626db09
   450 
   450 
   451         # Now, try to guess the nearest available channel
   451         # Now, try to guess the nearest available channel
   452         res = DesiredChannel
   452         res = DesiredChannel
   453         while res in AllChannels:  # While channel not free
   453         while res in AllChannels:  # While channel not free
   454             if res < CurrentChannel:  # Want to go down ?
   454             if res < CurrentChannel:  # Want to go down ?
   455                 res -=  1  # Test for n-1
   455                 res -= 1  # Test for n-1
   456                 if res < 0:
   456                 if res < 0:
   457                     self.GetCTRoot().logger.write_warning(_("Cannot find lower free IEC channel than %d\n") % CurrentChannel)
   457                     self.GetCTRoot().logger.write_warning(_("Cannot find lower free IEC channel than %d\n") % CurrentChannel)
   458                     return CurrentChannel  # Can't go bellow 0, do nothing
   458                     return CurrentChannel  # Can't go bellow 0, do nothing
   459             else:  # Want to go up ?
   459             else:  # Want to go up ?
   460                 res +=  1  # Test for n-1
   460                 res += 1  # Test for n-1
   461         # Finally set IEC Channel
   461         # Finally set IEC Channel
   462         self.BaseParams.setIEC_Channel(res)
   462         self.BaseParams.setIEC_Channel(res)
   463         return res
   463         return res
   464 
   464 
   465     def GetContextualMenuItems(self):
   465     def GetContextualMenuItems(self):