def connect(self, top_block):
		""
		assert isinstance(top_block, gr_top_block) 
		if self.samples_ > 0:
			if self.enable_throttle_control_:
				top_block.connect(self.file_source_, 0, self.throttle_, 0)
				DLOG.INFO("connected file source to throttle")
				top_block.connect(self.throttle_, 0, self.valve_, 0)
				DLOG.INFO("connected throttle to valve")
				if self.dump_:
					assert False
			else:
				top_block.connect(self.file_source_, 0, self.valve_, 0)
				DLOG.INFO("connected file source to valve")
				if self.dump_:
					assert False
		else:
			if self.enable_throttle_control_:
				top_block.connect(self.file_source_, 0, self.throttle_, 0)
				DLOG.INFO("connected file source to throttle")
				if self.dump_:
					assert False
			else:
				if self.dump_:
					assert False
Exemplo n.º 2
0
 def __init__(self, configuration, role, in_streams, out_streams):
     ""
     # .h
     self.config_ = self.conjugate_cc_ = \
     self.dump_ = self.dump_filename_ = \
     self.file_sink_ = \
     self.gr_interleaved_short_to_complex_ = \
     self.in_streams_ = self.input_item_type_ = None
     self.inverted_spectrum = None  ## BIZARRE, pas de _ final
     self.out_streams_ = self.output_item_type_ = \
     self.role_ = None
     # .cc
     self.config_ = configuration
     self.role_ = role
     self.in_streams_ = in_streams
     self.out_streams_ = out_streams
     default_input_item_type = "short"
     default_output_item_type = "gr_complex"
     default_dump_filename = "../data/input_filter.dat"
     DLOG.INFO("role " + self.role_)
     self.input_item_type_ = self.config_.get(
         self.role_ + ".input_item_type", default_input_item_type)
     self.dump_ = self.config_.get(self.role_ + ".dump", False)
     self.dump_filename_ = self.config_.get(self.role_ + ".dump_filename",
                                            default_dump_filename)
     self.inverted_spectrum = configuration.get(role + ".inverted_spectrum",
                                                False)
     item_size = 8  # sizeof(gr_complex);
     self.gr_interleaved_short_to_complex_ = gr_blocks_interleaved_short_to_complex(
     )
     # DLOG.INFO("data_type_adapter_(" + self.gr_interleaved_short_to_complex_->unique_id() + ")")
     assert self.inverted_spectrum is False
     assert self.dump_ is False
     assert self.in_streams_ <= 1
     assert self.out_streams_ <= 1
Exemplo n.º 3
0
    def connect(self):
        """
		Connects the defined blocks in the flow graph
		Signal Source > Signal conditioner > Channels >> Observables >> PVT > Output filter
		"""
        LOG.INFO("Connecting flowgraph")
        assert not self.connected_
        #ifndef ENABLE_FPGA
        for ss in self.sig_source_:
            if self.configuration_.get(ss.role_ + ".enable_FPGA",
                                       False) == False:
                ss.connect(self.top_block_)
        for sc in self.sig_conditioner_:
            if self.configuration_.get(sc.role_ + ".enable_FPGA",
                                       False) == False:
                sc.connect(self.top_block_)
        #endif
        for ch in self.channels_:
            ch.connect(self.top_block_)
        self.observables_.connect(self.top_block_)
        self.pvt_.connect(self.top_block_)
        DLOG.INFO("blocks connected internally")
        #ifndef ENABLE_FPGA
        RF_Channels = 0
        signal_conditioner_ID = 0
        for i, ss in enumerate(self.sig_source_):
            if ss.implementation() == "Raw_Array_Signal_Source":
                assert False
            else:
                RF_Channels = self.configuration_.get(
                    ss.role_ + ".RF_channels", 1)
                for j in range(RF_Channels):
                    #
                    if ss.get_right_block().output_signature(
                    )[1] > 1 or ss.get_right_block().output_signature(
                    )[1] == -1:
                        if len(self.sig_conditioner_) > signal_conditioner_ID:
                            LOG.INFO("connecting sig_source_ " + str(i) +
                                     " stream " + str(j) + " to conditioner " +
                                     str(j))
                            self.top_block_.connect(
                                ss.get_right_block(), j,
                                self.sig_conditioner_[signal_conditioner_ID].
                                get_left_block(), 0)
                    else:
                        assert False
        _ = 2 + 2
        assert False
Exemplo n.º 4
0
    def connect(self, top_block):
        ""
        if not self.flag_enable_fpga:
            self.acq_.connect(top_block)
        self.trk_.connect(top_block)
        self.nav_.connect(top_block)

        # Synchronous ports
        top_block.connect(self.trk_.get_right_block(), 0,
                          self.nav_.get_left_block(), 0)

        # Message ports
        top_block.msg_connect(self.nav_.get_left_block(), "telemetry_to_trk",
                              self.trk_.get_right_block(), "telemetry_to_trk")
        DLOG.INFO("tracking -> telemetry_decoder")

        # Message ports
        if not self.flag_enable_fpga:
            top_block.msg_connect(self.acq_.get_right_block(), "events",
                                  self.channel_msg_rx, "events")
        top_block.msg_connect(self.trk_.get_right_block(), "events",
                              self.channel_msg_rx, "events")

        self.connected_ = True
Exemplo n.º 5
0
 def __init__(self, configuration, role, in_streams, out_streams):
     ""
     # .h
     self.dump_ = \
     self.dump_filename_ = \
     self.dump_mat_ = \
     self.in_streams_ = \
     self.observables_ = \
     self.out_streams_ = \
     self.role_ = None
     # .cc
     self.role_ = role
     self.in_streams_ = in_streams
     self.out_streams_ = out_streams
     default_dump_filename = "./observables.dat"
     DLOG.INFO("role " + role)
     self.dump_ = configuration.get(role + ".dump", False)
     self.dump_mat_ = configuration.get(role + ".dump_mat", True)
     self.dump_filename_ = configuration.get(role + ".dump_filename",
                                             default_dump_filename)
     self.observables_ = hybrid_observables_gs(self.in_streams_,
                                               self.out_streams_,
                                               self.dump_, self.dump_mat_,
                                               self.dump_filename_)
Exemplo n.º 6
0
 def connect(self, top_block):
     ""
     assert self.dump_ is False
     assert self.inverted_spectrum is False
     DLOG.INFO("Nothing to connect internally")
Exemplo n.º 7
0
    def __init__(self, configuration, queue):
        ""
        # .h
        self.acq_channels_count_ = None
        self.acq_resamplers_ = {}
        self.available_xx_signals_ = [[] for _ in range(10)]
        self.channels_ = []
        self.ch_out_sample_counter = None  # BIZARRE : pas de _ terminal
        self.channels_count_ = None  # int
        self.channels_state_ = []
        self.channels_status_ = None
        self.config_file_ = None  # string
        self.configuration_ = None
        self.connected_ = None
        self.enable_monitor_ = None
        self.GnssSynchroMonitor_ = None
        self.mapStringValues_ = {}
        self.max_acq_channels_ = None
        self.null_sinks_ = []
        self.observables_ = None
        self.pvt_ = None
        self.queue_ = None
        self.running_ = None
        self.sig_conditioner_ = []  # vector GNSSBlockInterface
        self.sig_source_ = []  # vector GNSSBlockInterface
        self.signal_list_mutex = None
        self.sources_count_ = None
        self.top_block_ = None
        # .c
        self.configuration_ = configuration
        self.queue_ = queue
        self.block_factory_ = GNSSBlockFactory()
        self.channels_status_ = channel_status_msg_receiver()
        self.sources_count_ = self.configuration_.get("Receiver.sources_count",
                                                      1)
        RF_Channels = 0
        signal_conditioner_ID = 0
        if self.sources_count_ > 1:
            assert False
        else:
            self.sig_source_.append(
                self.block_factory_.GetSignalSource(self.configuration_,
                                                    self.queue_, -1))
            RF_Channels = self.configuration_.get(
                self.sig_source_[0].role_ + ".RF_channels", 0)
            if RF_Channels != 0:
                assert False
            else:
                self.sig_conditioner_.append(
                    self.block_factory_.GetSignalConditioner(
                        self.configuration_, -1))
        self.observables_ = self.block_factory_.GetObservables(
            self.configuration_)
        default_str = "Default"
        obs_implementation = self.configuration_.get(
            "Observables.implementation", default_str)
        if obs_implementation in ("GPS_L1_CA_Observables",
                                  "GPS_L2C_Observables",
                                  "Galileo_E1B_Observables",
                                  "Galileo_E5A_Observables"):
            assert False
        self.pvt_ = self.block_factory_.GetPVT(self.configuration_)
        pvt_implementation = self.configuration_.get("PVT.implementation",
                                                     default_str)
        if pvt_implementation in ("GPS_L1_CA_PVT", "Galileo_E1_PVT",
                                  "Hybrid_PVT"):
            assert False
        channels = self.block_factory_.GetChannels(self.configuration_,
                                                   self.queue_)
        self.channels_count_ = len(channels)
        self.channels_.extend(channels)

        self.top_block_ = gr_top_block("GNSSFlowgraph")

        #		self.mapStringValues_["1C"] = GNSSFlowgraph.evGPS_1C
        #		self.mapStringValues_["2S"] = GNSSFlowgraph.evGPS_2S
        #		self.mapStringValues_["L5"] = GNSSFlowgraph.evGPS_L5
        #		self.mapStringValues_["1B"] = GNSSFlowgraph.evGAL_1B
        #		self.mapStringValues_["5X"] = GNSSFlowgraph.evGAL_5X
        #		self.mapStringValues_["1G"] = GNSSFlowgraph.evGLO_1G
        #		self.mapStringValues_["2G"] = GNSSFlowgraph.evGLO_2G
        #		self.mapStringValues_["B1"] = GNSSFlowgraph.evBDS_B1
        #		self.mapStringValues_["B3"] = GNSSFlowgraph.evBDS_B3
        self.mapStringValues_ = jld_channels.cid

        # fill the signals queue with the satellites ID's to be searched by the acquisition
        self.set_signals_list()
        self.set_channels_state()
        DLOG.INFO("Blocks instantiated. " + str(self.channels_count_) +
                  " channels.")
        # Instantiate the receiver monitor block, if required
        self.enable_monitor_ = self.configuration_.get(
            "Monitor.enable_monitor", False)
        assert not self.enable_monitor_
        ### JLD
        assert self.sources_count_ == len(self.sig_source_)
        assert self.channels_count_ == len(self.channels_)
Exemplo n.º 8
0
	def connect(self, top_block):
		""
		DLOG.INFO("nothing to connect internally")
    def __init__(self, configuration, role, in_streams, out_streams):
        ""
        # .h
        self.acq_parameters_ = {
            'it_size': 1,
            'resampler_ratio': 1.0
        }  # Acq_Conf
        ### tous les autres a 0/false
        # .cc
        self.role_ = role
        self.in_streams_ = in_streams
        self.out_streams_ = out_streams
        self.configuration_ = configuration
        default_item_type = "gr_complex"
        default_dump_filename = "./acquisition.mat"

        DLOG.INFO("role " + role)

        self.item_type_ = configuration.get(role + ".item_type",
                                            default_item_type)
        fs_in_deprecated = configuration.get("GNSS-SDR.internal_fs_hz",
                                             2048000)  # int64_t
        self.acq_parameters_['fs_in'] = self.fs_in_ = configuration.get(
            "GNSS-SDR.internal_fs_sps", fs_in_deprecated)
        self.acq_parameters_['dump'] = self.dump_ = configuration.get(
            role + ".dump", False)
        self.acq_parameters_['dump_channel'] = configuration.get(
            role + ".dump_channel", 0)
        self.acq_parameters_['blocking'] = self.blocking_ = configuration.get(
            role + ".blocking", True)
        self.acq_parameters_[
            'doppler_max'] = self.doppler_max_ = configuration.get(
                role + ".doppler_max", 5000)
        self.acq_parameters_[
            'sampled_ms'] = self.sampled_ms_ = configuration.get(
                role + ".coherent_integration_time_ms", 1)
        self.acq_parameters_['ms_per_code'] = 1
        self.acq_parameters_[
            'bit_transition_flag'] = self.bit_transition_flag_ = configuration.get(
                role + ".bit_transition_flag", False)
        self.acq_parameters_[
            'use_CFAR_algorithm_flag'] = self.use_CFAR_algorithm_flag_ = configuration.get(
                role + ".use_CFAR_algorithm",
                True)  # will be false in future versions
        self.acq_parameters_[
            'max_dwells'] = self.max_dwells_ = configuration.get(
                role + ".max_dwells", 1)
        self.acq_parameters_[
            'dump_filename'] = self.dump_filename_ = configuration.get(
                role + ".dump_filename", default_dump_filename)
        self.acq_parameters_['num_doppler_bins_step2'] = configuration.get(
            role + ".second_nbins", 4)
        self.acq_parameters_['doppler_step2'] = configuration.get(
            role + ".second_doppler_step", 125.0)
        self.acq_parameters_['make_2_steps'] = configuration.get(
            role + ".make_two_steps", False)
        self.acq_parameters_['use_automatic_resampler'] = configuration.get(
            "GNSS-SDR.use_acquisition_resampler", False)
        if self.acq_parameters_[
                'use_automatic_resampler'] and self.item_type_ != "gr_complex":
            assert False
        if self.acq_parameters_['use_automatic_resampler']:
            if self.acq_parameters_['fs_in'] > GPS.L1.CA.OPT_ACQ_FS_HZ:
                2 + 2
            assert False
        else:
            self.acq_parameters_['resampled_fs'] = self.fs_in_
            #--- Find number of samples per spreading code -------------------------
            self.code_length_ = int(
                math.floor(
                    self.fs_in_ /
                    (GPS.L1.CA.CODE_RATE_HZ / GPS.L1.CA.CODE_LENGTH_CHIPS)))
            self.acq_parameters_['samples_per_ms'] = self.fs_in_ * 0.001
            self.acq_parameters_['samples_per_chip'] = int(
                math.ceil(GPS.L1.CA.CHIP_PERIOD *
                          float(self.acq_parameters_['fs_in'])))
        """
    if (acq_parameters_.use_automatic_resampler == true and item_type_ != "gr_complex")
        {
            LOG(WARNING) << "GPS L1 CA acquisition disabled the automatic resampler feature because its item_type is not set to gr_complex";
            acq_parameters_.use_automatic_resampler = false;
        }
    if (acq_parameters_.use_automatic_resampler)
        {
            if (acq_parameters_.fs_in > GPS_L1_CA_OPT_ACQ_FS_HZ)
                {
                    acq_parameters_.resampler_ratio = floor(static_cast<float>(acq_parameters_.fs_in) / GPS_L1_CA_OPT_ACQ_FS_HZ);
                    uint32_t decimation = acq_parameters_.fs_in / GPS_L1_CA_OPT_ACQ_FS_HZ;
                    while (acq_parameters_.fs_in % decimation > 0)
                        {
                            decimation--;
                        };
                    acq_parameters_.resampler_ratio = decimation;
                    acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast<int>(acq_parameters_.resampler_ratio);
                }
            //--- Find number of samples per spreading code -------------------------
            code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(acq_parameters_.resampled_fs) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)));
            acq_parameters_.samples_per_ms = static_cast<float>(acq_parameters_.resampled_fs) * 0.001;
            acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast<float>(acq_parameters_.resampled_fs)));
        }
    else
        {
            acq_parameters_.resampled_fs = fs_in_;
            //--- Find number of samples per spreading code -------------------------
            code_length_ = static_cast<unsigned int>(std::floor(static_cast<double>(fs_in_) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS)));
            acq_parameters_.samples_per_ms = static_cast<float>(fs_in_) * 0.001;
            acq_parameters_.samples_per_chip = static_cast<unsigned int>(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast<float>(acq_parameters_.fs_in)));
        }
		"""
        self.acq_parameters_['samples_per_code'] = self.acq_parameters_[
            'samples_per_ms'] * float(GPS.L1.CA.CODE_PERIOD * 1000.0)
        tmp = math.floor(
            self.acq_parameters_['sampled_ms'] *
            self.acq_parameters_['samples_per_ms']) * (
                2 if self.acq_parameters_['bit_transition_flag'] else 1)
        self.vector_length_ = int(math.floor(tmp + 0.5))
        assert abs(self.vector_length_ - tmp) < 1e-5
        self.code_ = np.zeros(self.vector_length_, dtype=np.complex64)

        if self.item_type_ == "cshort":
            assert False  # item_size_ = sizeof(lv_16sc_t);
        else:
            self.item_size_ = gr_complex.sizeof

        self.acq_parameters_['it_size'] = self.item_size_
        self.acq_parameters_['blocking_on_standby'] = configuration.get(
            role + ".blocking_on_standby", False)
        self.acquisition_ = pcps_acquisition(self.acq_parameters_)
        DLOG.INFO("acquisition(" + str(self.acquisition_.unique_id()) + ")")
Exemplo n.º 10
0
 def connect(self, top_block):
     ""
     assert self.dump_ is False
     DLOG.INFO("nothing to connect internally")