def do_scan(self): self.stopper = False f_start = int(float(self.startFreq.get()) * 10) f_stop = int(float(self.stopFreq.get()) * 10) f_inc = int(float(self.incFreq.get()) * 10) w_time = float(self.waitTime.get()) print "Starting Scanning from %.01f kHz to %.01f kHz with %.01f" % ( float(f_start / 10.0), float(f_stop / 10.0), float(f_inc / 10.0)) # Get all the frequencies to scan freqs = range(f_start, f_stop, f_inc) if not freqs[-1] == f_stop: freqs += [f_stop] print "Scanning will take %.01f" % (w_time * len(freqs)) # Scan through all the frequencies if not radio.is_remote(): radio.start_radio() radio.remote(True) for freq in freqs: if self.stopper: break resp = radio.setFrequency(freq) time.sleep(w_time) # Turn off remote #radio.remote(False) #radio.close() self.startFreq.set("%.1f" % (float(freq) / 10.0)) return None
def disconnect(self): if not self.fax: return None self.fax.quit() self.fax.close() radio.remote(False) self.fax = None self.buttons_update()
def start_radio(self, frequency=0): radio.start_radio() if frequency: radio.remote(True) radio.setFrequency(int(frequency * 10)) return None
def stop_radio(self): radio.remote(False) radio.close() return None
def toggle_remote(self): if radio.is_remote(): radio.remote(False) else: radio.remote(True)