def channelButtonClicked(self): print "channelButtonClicked" if self.tryInitActivityObject() == False: print "init failed" return engineName = self.ui.engineName.text() componentName = self.ui.componentName.text() config = RadioConfig(engineName, componentName) if self.ui.ch1Button.isChecked(): print "channel 1 cliked" index = 0 elif self.ui.ch2Button.isChecked(): print "channel 2 cliked" index = 1 elif self.ui.ch3Button.isChecked(): print "channel 3 cliked" index = 2 # hack to get key for specific value for key, value in self.displaychannellist.items(): if value == index: print "freq is: %s" % key config.tuneRadio(key)
def __init__(self, channels, propabilities, avgHoldTime, minHoldTime, engineName=None, componentName=None): threading.Thread.__init__(self) self.channels = channels self.props = propabilities self.avgHoldTime = avgHoldTime self.minHoldTime = minHoldTime if engineName is None: self.engineName = "phyengine1" else: self.engineName = engineName if componentName is None: self.componentName = "usrptx1" else: self.componentName = componentName print "Engine name %s" % self.engineName print "Component name %s" % self.componentName self.radioconfig = RadioConfig(engineName, componentName) _stop = threading.Event() _pause = threading.Event()