示例#1
0
 def close(self):
     BaseHardware.close(self)
     if self.serial:
         self.serial.write('EX\r')
         time.sleep(1)  # wait for output to drain, but don't block
         self.serial.close()
         self.serial = None
示例#2
0
 def close(self):
   BaseHardware.close(self)
   if self.serial:
     self.serial.write('EX\r')
     time.sleep(1)			# wait for output to drain, but don't block
     self.serial.close()
     self.serial = None
示例#3
0
 def __init__(self, app, conf):
   BaseHw.__init__(self, app, conf)
   self.use_sidetone = 1
   self.vfo_frequency = 0		# current vfo frequency
   self.rf_gain_labels = ('RF 0 dB', 'RF +16', 'RF -20', 'RF -10')
   # Other hardware
   self.anttuner = station_hardware.AntennaTuner(app, conf)	# Control the antenna tuner
   self.lpfilter = station_hardware.LowPassFilter(app, conf)	# Control LP filter box
   self.hpfilter = station_hardware.HighPassFilter(app, conf)	# Control HP filter box
示例#4
0
 def __init__(self, app, conf):
   BaseHw.__init__(self, app, conf)
   self.vfo_frequency = 0		# current vfo frequency
   self.rf_gain_labels = ('RF 0 dB', 'RF +16', 'RF -20', 'RF -10')
   self.rf_gain = 0	# Preamp or attenuation in dB; changed via app.Hardware
   # Other hardware
   self.anttuner = station_hardware.AntennaTuner(app, conf)	# Control the antenna tuner
   self.lpfilter = station_hardware.LowPassFilter(app, conf)	# Control LP filter box
   self.hpfilter = station_hardware.HighPassFilter(app, conf)	# Control HP filter box
   self.controlbox = station_hardware.ControlBox(app, conf)	# Control my Station Control Box
示例#5
0
 def __init__(self, app, conf):
   BaseHw.__init__(self, app, conf)
   self.GUI = None
   self.vfo_frequency = 0		# current vfo frequency
   self.rf_gain_labels = ('RF 0 dB', 'RF +16')
   self.rf_gain = 0	# Preamp or attenuation in dB; changed via app.Hardware
   # Other hardware
   self.anttuner = station_hardware.AntennaTuner(app, conf)	# Control the antenna tuner
   #self.lpfilter = station_hardware.LowPassFilter(app, conf)	# Control LP filter box
   #self.hpfilter = station_hardware.HighPassFilter(app, conf)	# Control HP filter box
   self.controlbox = station_hardware.ControlBox(app, conf)	# Control my Station Control Box
   self.v2filter = station_hardware.FilterBoxV2(app, conf)	# Control V2 filter box
示例#6
0
 def __init__(self, app, conf):
     BaseHw.__init__(self, app, conf)
     self.use_sidetone = 1
     self.vfo_frequency = 0  # current vfo frequency
     self.rf_gain_labels = ('RF 0 dB', 'RF +16', 'RF -20', 'RF -10')
     # Other hardware
     self.anttuner = station_hardware.AntennaTuner(
         app, conf)  # Control the antenna tuner
     self.lpfilter = station_hardware.LowPassFilter(
         app, conf)  # Control LP filter box
     self.hpfilter = station_hardware.HighPassFilter(
         app, conf)  # Control HP filter box
示例#7
0
 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)
示例#8
0
 def HeartBeat(self):  # Called at about 10 Hz by the main
     self.anttuner.HeartBeat()
     self.lpfilter.HeartBeat()
     self.hpfilter.HeartBeat()
     self.v2filter.HeartBeat()
     self.controlbox.HeartBeat()
     return BaseHw.HeartBeat(self)
示例#9
0
 def ChangeFrequency(self,
                     tx_freq,
                     vfo_freq,
                     source='',
                     band='',
                     event=None):
     self.tx_freq = tx_freq
     try:
         rpt = self.repeaters[tx_freq]
     except KeyError:
         self.application.bottom_widgets.UpdateText('')
     else:
         self.application.bottom_widgets.UpdateText(rpt)
     if vfo_freq != self.vfo_frequency and vfo_freq >= 10000:
         self.vfo_frequency = vfo_freq
         # Calculate new AR8600 and hardware frequencies
         ar8600 = (vfo_freq + 50000) // 100000 * 100000 - 200000
         if self.ar8600_frequency != ar8600:
             self.ar8600_frequency = ar8600
             self.SendAR8600('RF%010d\r' % ar8600)
             if ar8600 < 1040000000:
                 self.invert = 1
             else:
                 self.invert = 0
             QS.invert_spectrum(self.invert)
         if self.invert:
             hware = self.offset - vfo_freq + self.ar8600_frequency
         else:
             hware = self.offset + vfo_freq - self.ar8600_frequency
         if self.hware_frequency != hware:
             self.hware_frequency = hware
             BaseHardware.ChangeFrequency(self, 0, hware)
         #print 'AR8600 Hware', self.ar8600_frequency, self.hware_frequency
     return tx_freq, vfo_freq
示例#10
0
 def ChangeBand(self, band):
     # band is a string: "60", "40", "WWV", etc.
     self.anttuner.ChangeBand(band)
     self.lpfilter.ChangeBand(band)
     self.hpfilter.ChangeBand(band)
     self.v2filter.ChangeBand(band)
     ret = BaseHw.ChangeBand(self, band)
     self.CorrectSmeter()
     return ret
示例#11
0
 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)
示例#12
0
 def HeartBeat(self):  # Called at about 10 Hz by the main
     BaseHardware.HeartBeat(self)
     if self.serial:
         chars = self.serial.read(1024)
         #if chars:
         #  print chars
         if self.serial_out and time.time() - self.time0 > self.timer:
             self.serial.write(self.serial_out[0])
             self.time0 = time.time()
             del self.serial_out[0]
示例#13
0
 def ChangeBand(self, band):
     # band is a string: "60", "40", "WWV", etc.
     self.anttuner.ChangeBand(band)
     self.lpfilter.ChangeBand(band)
     self.hpfilter.ChangeBand(band)
     if band == '40':
         self.correct_smeter = 20.5
     else:
         self.correct_smeter = 20.5
     return BaseHw.ChangeBand(self, band)
示例#14
0
 def __init__(self, app, conf):
     BaseHw.__init__(self, app, conf)
     if hasattr(app, 'is_vna_program'):
         self.is_vna = True
     else:
         self.is_vna = False
     self.vfo_frequency = 0  # current vfo frequency
     self.rf_gain_labels = ('RF 0 dB', 'RF +16', 'RF -20', 'RF -10')
     self.rf_gain = 0  # Preamp or attenuation in dB; changed via app.Hardware
     # Other hardware
     self.anttuner = station_hardware.AntennaTuner(
         app, conf)  # Control the antenna tuner
     self.lpfilter = station_hardware.LowPassFilter(
         app, conf)  # Control LP filter box
     self.hpfilter = station_hardware.HighPassFilter(
         app, conf)  # Control HP filter box
     self.controlbox = station_hardware.ControlBox(
         app, conf)  # Control my Station Control Box
     self.v2filter = station_hardware.FilterBoxV2(
         app, conf)  # Control V2 filter box
示例#15
0
 def ChangeFrequency(self,
                     tx_freq,
                     vfo_freq,
                     source='',
                     band='',
                     event=None):
     if source == 'MouseBtn1' and self.application.mode in (
             'LSB', 'USB', 'AM', 'FM', 'FDV-U', 'FDV-L'):
         tx_freq = (tx_freq + 500) // 1000 * 1000
     self.ChangeFilterFrequency(tx_freq)
     return BaseHw.ChangeFrequency(self, tx_freq, vfo_freq, source, band,
                                   event)
示例#16
0
 def open(self):
   self.OpenPort()
   QS.invert_spectrum(self.invert)
   t = BaseHardware.open(self)		# save the message
   return t
示例#17
0
 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)
示例#18
0
 def close(self):
     self.anttuner.close()
     return BaseHw.close(self)
示例#19
0
 def __init__(self, app, conf):
   BaseHardware.__init__(self, app, conf)
   self.ar8600_frequency = 0	# current AR8600 tuning  frequency
   self.hware_frequency = 0	# current hardware VFO frequency
   self.vfo_frequency = 0		# current Quisk VFO frequency
   self.invert = 1				# The frequency spectrum is backwards
   self.serial = None			# the open serial port
   self.timer = 0.02			# time between AR8600 commands in seconds
   self.time0 = 0				# time of last AR8600 command
   self.serial_out = []		# send commands slowly
   self.offset = 10700000		# frequency offset from AR8600 tuning freq to IF output
   self.tx_freq = 0			# current frequency
   conf.BandEdge['220'] = (222000000, 225000000)
   conf.BandEdge['440'] = (420000000, 450000000)
   conf.BandEdge['900'] = (902000000, 928000000)
   conf.BandEdge['1240'] = (1240000000, 1300000000)
   rpt_file = os.path.normpath(os.path.join(os.getcwd(), '..'))
   rpt_file = os.path.join(rpt_file, 'MetroCor.txt')
   fp = open(rpt_file, 'r')
   self.repeaters = {}
   for line in fp:
     line = line.strip()
     if line and line[0] != '#':
       line = line.split('\t')
       fout = int(float(line[0]) * 1000000 + 0.1)
       text = "%s  %s, %s" % (line[2], line[3], line[5])
       if fout in self.repeaters:
         self.repeaters[fout] = "%s ; %s" % (self.repeaters[fout], text)
       else:
         self.repeaters[fout] = text
   fp.close()
   rpt_file = os.path.normpath(os.path.join(os.getcwd(), '..'))
   rpt_file = os.path.join(rpt_file, 'ARCC.csv')
   fp = open(rpt_file, 'r')
   for line in fp:
     line = line.strip()
     if line and line[0] != '#':
       line = line.split(',')
       fout = float(line[3])
       if fout >= 2000.0:
         continue
       fout = int(fout * 1000000 + 0.1)
       text = "%s  %s, %s" % (line[5], line[2], line[0])
       if fout in self.repeaters:
         self.repeaters[fout] = "%s ; %s" % (self.repeaters[fout], text)
       else:
         self.repeaters[fout] = text
   fp.close()
   rpt_file = os.path.normpath(os.path.join(os.getcwd(), '..'))
   rpt_file = os.path.join(rpt_file, 'Repeaters.csv')
   fp = open(rpt_file, 'r')
   for line in fp:
     line = line.strip()
     if line and line[0] != '#':
       line = line.split(',')
       fout = float(line[3])
       if fout >= 2000.0:
         continue
       fout = int(fout * 1000000 + 0.1)
       if line[0]:
         text = "%s  %s, %s" % (line[5], line[2], line[0])
       else:
         text = line[5]
       if fout in self.repeaters:
         self.repeaters[fout] = "%s ; %s" % (self.repeaters[fout], text)
       else:
         self.repeaters[fout] = text
   fp.close()
   for freq, text in self.repeaters.items():
     if len(text) > 80:
       t =''
       stations = text.split(';')
       for s in stations:
         s = s.strip()
         t = t + s.split()[0] + ' ' + s.split(',')[1] + '; '
       self.repeaters[freq] = t
   self.rpt_freq_list = self.repeaters.keys()
   self.rpt_freq_list.sort()
示例#20
0
 def OnSpot(self, level):
     self.anttuner.OnSpot(level)
     return BaseHw.OnSpot(self, level)
示例#21
0
 def close(self):
   self.anttuner.close()
   self.controlbox.close()
   return BaseHw.close(self)
示例#22
0
 def open(self):
   self.anttuner.open()
   return BaseHw.open(self)
示例#23
0
 def open(self):
     self.OpenPort()
     QS.invert_spectrum(self.invert)
     t = BaseHardware.open(self)  # save the message
     return t
示例#24
0
 def OnButtonPTT(self, event):
     self.controlbox.OnButtonPTT(event)
     return BaseHw.OnButtonPTT(self, event)
示例#25
0
 def open(self):
     self.anttuner.open()
     return BaseHw.open(self)
示例#26
0
 def close(self):
     self.anttuner.close()
     self.controlbox.close()
     return BaseHw.close(self)
示例#27
0
 def __init__(self, app, conf):
     BaseHardware.__init__(self, app, conf)
     self.ar8600_frequency = 0  # current AR8600 tuning  frequency
     self.hware_frequency = 0  # current hardware VFO frequency
     self.vfo_frequency = 0  # current Quisk VFO frequency
     self.invert = 1  # The frequency spectrum is backwards
     self.serial = None  # the open serial port
     self.timer = 0.02  # time between AR8600 commands in seconds
     self.time0 = 0  # time of last AR8600 command
     self.serial_out = []  # send commands slowly
     self.offset = 10700000  # frequency offset from AR8600 tuning freq to IF output
     self.tx_freq = 0  # current frequency
     conf.BandEdge['220'] = (222000000, 225000000)
     conf.BandEdge['440'] = (420000000, 450000000)
     conf.BandEdge['900'] = (902000000, 928000000)
     conf.BandEdge['1240'] = (1240000000, 1300000000)
     rpt_file = os.path.normpath(os.path.join(os.getcwd(), '..'))
     rpt_file = os.path.join(rpt_file, 'MetroCor.txt')
     fp = open(rpt_file, 'r')
     self.repeaters = {}
     for line in fp:
         line = line.strip()
         if line and line[0] != '#':
             line = line.split('\t')
             fout = int(float(line[0]) * 1000000 + 0.1)
             text = "%s  %s, %s" % (line[2], line[3], line[5])
             if fout in self.repeaters:
                 self.repeaters[fout] = "%s ; %s" % (self.repeaters[fout],
                                                     text)
             else:
                 self.repeaters[fout] = text
     fp.close()
     rpt_file = os.path.normpath(os.path.join(os.getcwd(), '..'))
     rpt_file = os.path.join(rpt_file, 'ARCC.csv')
     fp = open(rpt_file, 'r')
     for line in fp:
         line = line.strip()
         if line and line[0] != '#':
             line = line.split(',')
             fout = float(line[3])
             if fout >= 2000.0:
                 continue
             fout = int(fout * 1000000 + 0.1)
             text = "%s  %s, %s" % (line[5], line[2], line[0])
             if fout in self.repeaters:
                 self.repeaters[fout] = "%s ; %s" % (self.repeaters[fout],
                                                     text)
             else:
                 self.repeaters[fout] = text
     fp.close()
     rpt_file = os.path.normpath(os.path.join(os.getcwd(), '..'))
     rpt_file = os.path.join(rpt_file, 'Repeaters.csv')
     fp = open(rpt_file, 'r')
     for line in fp:
         line = line.strip()
         if line and line[0] != '#':
             line = line.split(',')
             fout = float(line[3])
             if fout >= 2000.0:
                 continue
             fout = int(fout * 1000000 + 0.1)
             if line[0]:
                 text = "%s  %s, %s" % (line[5], line[2], line[0])
             else:
                 text = line[5]
             if fout in self.repeaters:
                 self.repeaters[fout] = "%s ; %s" % (self.repeaters[fout],
                                                     text)
             else:
                 self.repeaters[fout] = text
     fp.close()
     for freq, text in list(self.repeaters.items()):
         if len(text) > 80:
             t = ''
             stations = text.split(';')
             for s in stations:
                 s = s.strip()
                 t = t + s.split()[0] + ' ' + s.split(',')[1] + '; '
             self.repeaters[freq] = t
     self.rpt_freq_list = list(self.repeaters)
     self.rpt_freq_list.sort()
示例#28
0
 def close(self):
   self.anttuner.close()
   return BaseHw.close(self)