def __init__(self, app, conf): BaseHw.__init__(self, app, conf) self.GUI = None self.vfo_frequency = 0 # current vfo frequency self.v2filter = None # Other hardware self.anttuner = station_hardware.AntennaTuner( app, conf) # Control the antenna tuner self.controlbox = station_hardware.ControlBox( app, conf) # Control my Station Control Box
def ChangeBand(self, band): # band is a string: "60", "40", "WWV", etc. ret = BaseHw.ChangeBand(self, band) self.anttuner.ChangeBand(band) #self.lpfilter.ChangeBand(band) #self.hpfilter.ChangeBand(band) self.CorrectSmeter() return ret
def open(self): if False: from n2adr.station_hardware import StationControlGUI self.GUI = StationControlGUI(self.application.main_frame, self, self.application, self.conf) self.GUI.Show() self.anttuner.open() return BaseHw.open(self)
def ChangeBand(self, band): # band is a string: "60", "40", "WWV", etc. # The call to BaseHardware will set C2 according to the Hermes_BandDict{} ret = BaseHardware.ChangeBand(self, band) if self.usingSpot: byte = self.GetControlByte(0, 2) # C0 index == 0, C2: user output byte |= 0b10000000 self.SetControlByte(0, 2, byte) return ret
def ChangeFrequency(self, tx_freq, vfo_freq, source='', band='', event=None): self.ChangeFilterFrequency(tx_freq) return BaseHw.ChangeFrequency(self, tx_freq, vfo_freq, source, band, event)
def OnSpot(self, level): # level is -1 for Spot button Off; else the Spot level 0 to 1000. ret = BaseHardware.OnSpot(self, level) if level >= 0 and not self.usingSpot: # Spot was turned on byte = self.GetControlByte(0, 2) byte |= 0b10000000 self.SetControlByte(0, 2, byte) self.usingSpot = True elif level < 0 and self.usingSpot: # Spot was turned off byte = self.GetControlByte(0, 2) byte &= 0b01111111 self.SetControlByte(0, 2, byte) self.usingSpot = False return ret
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.usingSpot = False # Use bit C2[7] as the Spot indicator
def OnButtonPTT(self, event): self.controlbox.OnButtonPTT(event) return BaseHw.OnButtonPTT(self, event)
def OnSpot(self, level): # level is -1 for Spot button Off; else the Spot level 0 to 1000. self.anttuner.OnSpot(level) return BaseHw.OnSpot(self, level)
def HeartBeat(self): # Called at about 10 Hz by the main self.anttuner.HeartBeat() self.controlbox.HeartBeat() return BaseHw.HeartBeat(self)
def close(self): self.anttuner.close() self.controlbox.close() return BaseHw.close(self)