示例#1
0
 def __init__(self, 
              verbose_mode=True, 
              radio_host_name="ndr651", 
              radio_host_port=8617, 
              tengig_iface_list=['eth10', 'eth11'], 
              num_tuners=1,
              tuner1_param_list=[False, 900e6, 0],
              tuner2_param_list=[False, 900e6, 0],
              num_wbddcs=1, 
              wbddc1_param_list=["eth10", 40001, 0, 0, False],
              wbddc2_param_list=["eth10", 40002, 0, 0, False],
              num_nbddcs=1, 
              nbddc1_param_list=["eth10", 41001, 0, 0, False, 0.0],
              nbddc2_param_list=["eth10", 41002, 0, 0, False, 0.0],
              nbddc3_param_list=["eth10", 41003, 0, 0, False, 0.0],
              nbddc4_param_list=["eth10", 41004, 0, 0, False, 0.0],
              nbddc5_param_list=["eth10", 41005, 0, 0, False, 0.0],
              nbddc6_param_list=["eth10", 41006, 0, 0, False, 0.0],
              nbddc7_param_list=["eth10", 41007, 0, 0, False, 0.0],
              nbddc8_param_list=["eth10", 41008, 0, 0, False, 0.0],
              nbddc9_param_list=["eth10", 41009, 0, 0, False, 0.0],
              nbddc10_param_list=["eth10", 41010, 0, 0, False, 0.0],
              nbddc11_param_list=["eth10", 41011, 0, 0, False, 0.0],
              nbddc12_param_list=["eth10", 41012, 0, 0, False, 0.0],
              nbddc13_param_list=["eth10", 41013, 0, 0, False, 0.0],
              nbddc14_param_list=["eth10", 41014, 0, 0, False, 0.0],
              nbddc15_param_list=["eth10", 41015, 0, 0, False, 0.0],
              nbddc16_param_list=["eth10", 41016, 0, 0, False, 0.0],
              tagged=False,
              debug=False,
              ):
     gr.hier_block2.__init__(
         self, "[CyberRadio] NDR651 Source",
         gr.io_signature(0, 0, 0),
         gr.io_signaturev(num_wbddcs + num_nbddcs + 1, 
                          num_wbddcs + num_nbddcs + 1, 
                          [gr.sizeof_char*1] +
                             num_wbddcs * [gr.sizeof_gr_complex*1] + \
                             num_nbddcs * [gr.sizeof_gr_complex*1]),
     )
     self.logger = gr.logger("CyberRadio")
     self.logger.set_level("INFO")
     self.tuner_param_lists = {}
     self.wbddc_sources = {}
     self.wbddc_param_lists = {}
     self.nbddc_sources = {}
     self.nbddc_param_lists = {}
     self.verbose_mode = verbose_mode
     self.radio_host_name = radio_host_name
     self.radio_host_port = radio_host_port
     self.tengig_iface_list = tengig_iface_list
     self.num_tuners = num_tuners
     self.tuner_param_lists[1] = tuner1_param_list
     self.tuner_param_lists[2] = tuner2_param_list
     self.num_wbddcs = num_wbddcs
     self.wbddc_param_lists[1] = wbddc1_param_list
     self.wbddc_param_lists[2] = wbddc2_param_list
     self.num_nbddcs = num_nbddcs
     self.nbddc_param_lists[1] = nbddc1_param_list
     self.nbddc_param_lists[2] = nbddc2_param_list
     self.nbddc_param_lists[3] = nbddc3_param_list
     self.nbddc_param_lists[4] = nbddc4_param_list
     self.nbddc_param_lists[5] = nbddc5_param_list
     self.nbddc_param_lists[6] = nbddc6_param_list
     self.nbddc_param_lists[7] = nbddc7_param_list
     self.nbddc_param_lists[8] = nbddc8_param_list
     self.nbddc_param_lists[9] = nbddc9_param_list
     self.nbddc_param_lists[10] = nbddc10_param_list
     self.nbddc_param_lists[11] = nbddc11_param_list
     self.nbddc_param_lists[12] = nbddc12_param_list
     self.nbddc_param_lists[13] = nbddc13_param_list
     self.nbddc_param_lists[14] = nbddc14_param_list
     self.nbddc_param_lists[15] = nbddc15_param_list
     self.nbddc_param_lists[16] = nbddc16_param_list
     self.tagged = tagged
     self.debug = debug
     self.CyberRadio_file_like_object_source_0 = CyberRadio.file_like_object_source()
     self.connect((self.CyberRadio_file_like_object_source_0, 0), (self, 0))
     self.CyberRadio_NDR_driver_interface_0 = CyberRadio.NDR_driver_interface(
         radio_type="ndr651",
         verbose=verbose_mode,
         log_file=self.CyberRadio_file_like_object_source_0,
         connect_mode="tcp",
         host_name=radio_host_name,
         host_port=radio_host_port,
     )
     self.vita_tail_size = self.CyberRadio_NDR_driver_interface_0.getVitaTailSize()
     self.vita_payload_size = self.CyberRadio_NDR_driver_interface_0.getVitaPayloadSize()
     self.vita_header_size = self.CyberRadio_NDR_driver_interface_0.getVitaHeaderSize()
     self.iq_swapped = self.CyberRadio_NDR_driver_interface_0.isIqSwapped()
     self.byte_swapped = self.CyberRadio_NDR_driver_interface_0.isByteswapped()
     # tengig_iface_info = Nested dictionary caching info for our 10GigE 
     # interfaces.  Keyed by interface name and datum keyword ("index", 
     # , "destMAC", "sourceIP", or "destIP").
     self.tengig_iface_info = {}
     self._get_tengig_iface_info()
     # UDP destination info needs to be tracked dynamically, since
     # DDCs can be freely assigned to any 10GigE port but there are
     # not enough DIP table entries to hard-code any assignments.
     self.udp_dest_dip_entries = {}
     self.udp_dest_dip_entry_range = self.CyberRadio_NDR_driver_interface_0.getGigEDipEntryIndexRange()
     self._set_udp_dest_info()
     for tuner_index in xrange(1, self.num_tuners + 1, 1):
         self._set_tuner_param_list(tuner_index, self.tuner_param_lists[tuner_index])
     for wbddc_index in xrange(1, self.num_wbddcs + 1, 1):
         self.wbddc_sources[wbddc_index] = self._get_configured_wbddc(
                                                 wbddc_index, 
                                                 self.wbddc_param_lists[wbddc_index])
         self.connect((self.wbddc_sources[wbddc_index], 0), (self, wbddc_index))
     for nbddc_index in xrange(1, self.num_nbddcs + 1, 1):
         self.nbddc_sources[nbddc_index] = self._get_configured_nbddc(
                                                 nbddc_index, 
                                                 self.nbddc_param_lists[nbddc_index])
         self.connect((self.nbddc_sources[nbddc_index], 0), (self, self.num_wbddcs + nbddc_index))
示例#2
0
 def __init__(self, 
              verbose_mode=True, 
              radio_device_name="/dev/ndr47x", 
              radio_baud_rate=921600, 
              gig_iface_to_use="eth0",
              coherent_mode=0,
              num_tuners=1,
              tuner1_param_list=[False, 900e6, 0],
              tuner2_param_list=[False, 900e6, 0],
              tuner3_param_list=[False, 900e6, 0],
              tuner4_param_list=[False, 900e6, 0],
              tuner5_param_list=[False, 900e6, 0],
              tuner6_param_list=[False, 900e6, 0],
              num_wbddcs=1,
              wbddc1_param_list=[40001, 0, 0, False, 0e6],
              wbddc2_param_list=[40002, 0, 0, False, 0e6],
              wbddc3_param_list=[40003, 0, 0, False, 0e6],
              wbddc4_param_list=[40004, 0, 0, False, 0e6],
              wbddc5_param_list=[40005, 0, 0, False, 0e6],
              wbddc6_param_list=[40006, 0, 0, False, 0e6],
              tagged=False,
              ):
     gr.hier_block2.__init__(
         self, "[CyberRadio] NDR304 Source",
         gr.io_signature(0, 0, 0),
         gr.io_signaturev((6 if coherent_mode & 0x02 > 0 else num_wbddcs) + 1, 
                          (6 if coherent_mode & 0x02 > 0 else num_wbddcs) + 1, 
                          [gr.sizeof_char*1] +
                          (6 if coherent_mode & 0x02 > 0 else num_wbddcs) * [gr.sizeof_gr_complex*1]), 
     )
     self.verbose_mode = verbose_mode
     self.radio_device_name = radio_device_name
     self.radio_baud_rate = radio_baud_rate
     self.gig_iface_to_use = gig_iface_to_use
     self.coherent_mode = coherent_mode
     self.tuners_coherent = (self.coherent_mode & 0x01 > 0)
     self.ddcs_coherent = (self.coherent_mode & 0x02 > 0)
     self.udp_host_name = CyberRadioDriver.getInterfaceAddresses(self.gig_iface_to_use)[1]
     self.num_tuners = num_tuners
     self.tuner1_param_list = tuner1_param_list
     if not self.tuners_coherent:
         self.tuner2_param_list = tuner2_param_list
         self.tuner3_param_list = tuner3_param_list
         self.tuner4_param_list = tuner4_param_list
         self.tuner5_param_list = tuner5_param_list
         self.tuner6_param_list = tuner6_param_list
     self.num_wbddcs = num_wbddcs
     self.wbddc1_param_list = wbddc1_param_list
     if not self.ddcs_coherent:
         self.wbddc2_param_list = wbddc2_param_list
         self.wbddc3_param_list = wbddc3_param_list
         self.wbddc4_param_list = wbddc4_param_list
         self.wbddc5_param_list = wbddc5_param_list
         self.wbddc6_param_list = wbddc6_param_list
     self.tagged = tagged
     self.CyberRadio_file_like_object_source_0 = CyberRadio.file_like_object_source()
     self.connect((self.CyberRadio_file_like_object_source_0, 0), (self, 0))
     self.CyberRadio_NDR_driver_interface_0 = CyberRadio.NDR_driver_interface(
         radio_type="ndr304",
         verbose=verbose_mode,
         log_file=self.CyberRadio_file_like_object_source_0,
         connect_mode="tty",
         dev_name=radio_device_name,
         baud_rate=radio_baud_rate,
     )
     self.vita_tail_size = self.CyberRadio_NDR_driver_interface_0.getVitaTailSize()
     self.vita_payload_size = self.CyberRadio_NDR_driver_interface_0.getVitaPayloadSize()
     self.vita_header_size = self.CyberRadio_NDR_driver_interface_0.getVitaHeaderSize()
     self.iq_swapped = self.CyberRadio_NDR_driver_interface_0.isIqSwapped()
     self.byte_swapped = self.CyberRadio_NDR_driver_interface_0.isByteswapped()
     self._set_coherent_mode(self.coherent_mode)
     self._set_udp_dest_info()
     if self.num_tuners >= 1:
         self._set_tuner_param_list(1, tuner1_param_list)
     if not self.tuners_coherent:
         if self.num_tuners >= 2:
             self._set_tuner_param_list(2, tuner2_param_list)
         if self.num_tuners >= 3:
             self._set_tuner_param_list(3, tuner3_param_list)
         if self.num_tuners >= 4:
             self._set_tuner_param_list(4, tuner4_param_list)
         if self.num_tuners >= 5:
             self._set_tuner_param_list(5, tuner5_param_list)
         if self.num_tuners >= 6:
             self._set_tuner_param_list(6, tuner6_param_list)
     self.wbddc_sources = {}
     if self.num_wbddcs >= 1:
         self.CyberRadio_vita_iq_source_wbddc_1 = self._get_configured_wbddc(1, wbddc1_param_list)
         if self.ddcs_coherent:
             self.connect((self.CyberRadio_vita_iq_source_wbddc_1, 0), (self, 1))
             self.connect((self.CyberRadio_vita_iq_source_wbddc_1, 1), (self, 2))
             self.connect((self.CyberRadio_vita_iq_source_wbddc_1, 2), (self, 3))
             self.connect((self.CyberRadio_vita_iq_source_wbddc_1, 3), (self, 4))
             self.connect((self.CyberRadio_vita_iq_source_wbddc_1, 4), (self, 5))
             self.connect((self.CyberRadio_vita_iq_source_wbddc_1, 5), (self, 6))
         else:
             self.connect((self.CyberRadio_vita_iq_source_wbddc_1, 0), (self, 1))
         self.wbddc_sources[1] = self.CyberRadio_vita_iq_source_wbddc_1
     if not self.ddcs_coherent:
         if self.num_wbddcs >= 2:
             self.CyberRadio_vita_iq_source_wbddc_2 = self._get_configured_wbddc(2, wbddc2_param_list)
             self.connect((self.CyberRadio_vita_iq_source_wbddc_2, 0), (self, 2))
             self.wbddc_sources[2] = self.CyberRadio_vita_iq_source_wbddc_2
         if self.num_wbddcs >= 3:
             self.CyberRadio_vita_iq_source_wbddc_3 = self._get_configured_wbddc(3, wbddc3_param_list)
             self.connect((self.CyberRadio_vita_iq_source_wbddc_3, 0), (self, 3))
             self.wbddc_sources[3] = self.CyberRadio_vita_iq_source_wbddc_3
         if self.num_wbddcs >= 4:
             self.CyberRadio_vita_iq_source_wbddc_4 = self._get_configured_wbddc(4, wbddc4_param_list)
             self.connect((self.CyberRadio_vita_iq_source_wbddc_4, 0), (self, 4))
             self.wbddc_sources[4] = self.CyberRadio_vita_iq_source_wbddc_4
         if self.num_wbddcs >= 5:
             self.CyberRadio_vita_iq_source_wbddc_5 = self._get_configured_wbddc(5, wbddc5_param_list)
             self.connect((self.CyberRadio_vita_iq_source_wbddc_5, 0), (self, 5))
             self.wbddc_sources[5] = self.CyberRadio_vita_iq_source_wbddc_5
         if self.num_wbddcs >= 6:
             self.CyberRadio_vita_iq_source_wbddc_6 = self._get_configured_wbddc(6, wbddc6_param_list)
             self.connect((self.CyberRadio_vita_iq_source_wbddc_6, 0), (self, 6))
             self.wbddc_sources[6] = self.CyberRadio_vita_iq_source_wbddc_6
示例#3
0
 def __init__(
     self,
     verbose_mode=True,
     radio_device_name="/dev/ndr47x",
     radio_baud_rate=921600,
     gig_iface_to_use="eth0",
     num_tuners=1,
     tuner1_param_list=[False, 900e6, 0],
     tuner2_param_list=[False, 900e6, 0],
     num_wbddcs=1,
     wbddc1_param_list=[40001, 0, 0, False, 0e6],
     wbddc2_param_list=[40002, 0, 0, False, 0e6],
     tagged=False,
 ):
     gr.hier_block2.__init__(
         self,
         "[CyberRadio] NDR472 Source",
         gr.io_signature(0, 0, 0),
         gr.io_signaturev(num_wbddcs + 1, num_wbddcs + 1,
                          [gr.sizeof_char * 1] +
                          num_wbddcs * [gr.sizeof_gr_complex * 1]),
     )
     self.verbose_mode = verbose_mode
     self.radio_device_name = radio_device_name
     self.radio_baud_rate = radio_baud_rate
     self.gig_iface_to_use = gig_iface_to_use
     self.udp_host_name = CyberRadioDriver.getInterfaceAddresses(
         self.gig_iface_to_use)[1]
     self.num_tuners = num_tuners
     self.tuner1_param_list = tuner1_param_list
     self.tuner2_param_list = tuner2_param_list
     self.num_wbddcs = num_wbddcs
     self.wbddc1_param_list = wbddc1_param_list
     self.wbddc2_param_list = wbddc2_param_list
     self.tagged = tagged
     self.CyberRadio_file_like_object_source_0 = CyberRadio.file_like_object_source(
     )
     self.connect((self.CyberRadio_file_like_object_source_0, 0), (self, 0))
     self.CyberRadio_NDR_driver_interface_0 = CyberRadio.NDR_driver_interface(
         radio_type="ndr472",
         verbose=verbose_mode,
         log_file=self.CyberRadio_file_like_object_source_0,
         connect_mode="tty",
         dev_name=radio_device_name,
         baud_rate=radio_baud_rate,
     )
     self.vita_tail_size = self.CyberRadio_NDR_driver_interface_0.getVitaTailSize(
     )
     self.vita_payload_size = self.CyberRadio_NDR_driver_interface_0.getVitaPayloadSize(
     )
     self.vita_header_size = self.CyberRadio_NDR_driver_interface_0.getVitaHeaderSize(
     )
     self.iq_swapped = self.CyberRadio_NDR_driver_interface_0.isIqSwapped()
     self.byte_swapped = self.CyberRadio_NDR_driver_interface_0.isByteswapped(
     )
     self._set_udp_dest_info()
     if self.num_tuners >= 1:
         self._set_tuner_param_list(1, tuner1_param_list)
     if self.num_tuners >= 2:
         self._set_tuner_param_list(2, tuner2_param_list)
     self.wbddc_sources = {}
     if self.num_wbddcs >= 1:
         self.CyberRadio_vita_iq_source_wbddc_1 = self._get_configured_wbddc(
             1, wbddc1_param_list)
         self.connect((self.CyberRadio_vita_iq_source_wbddc_1, 0),
                      (self, 1))
         self.wbddc_sources[1] = self.CyberRadio_vita_iq_source_wbddc_1
     if self.num_wbddcs >= 2:
         self.CyberRadio_vita_iq_source_wbddc_2 = self._get_configured_wbddc(
             2, wbddc2_param_list)
         self.connect((self.CyberRadio_vita_iq_source_wbddc_2, 0),
                      (self, 2))
         self.wbddc_sources[2] = self.CyberRadio_vita_iq_source_wbddc_2