mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	Make use of cstdint type names
This commit is contained in:
		| @@ -55,6 +55,7 @@ | ||||
| #include <gnuradio/block.h> | ||||
| #include <gnuradio/fft/fft.h> | ||||
| #include <gnuradio/gr_complex.h> | ||||
| #include <cstdint> | ||||
| #include <fstream> | ||||
| #include <string> | ||||
|  | ||||
| @@ -86,7 +87,7 @@ private: | ||||
|     bool start(); | ||||
|  | ||||
|     Acq_Conf acq_parameters; | ||||
|     long d_fs_in; | ||||
|     int64_t d_fs_in; | ||||
|     int d_samples_per_ms; | ||||
|     int d_max_dwells; | ||||
|     int d_gnuradio_forecast_samples; | ||||
|   | ||||
| @@ -67,7 +67,7 @@ BeamformerFilter::BeamformerFilter( | ||||
|             file_sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str()); | ||||
|             DLOG(INFO) << "file_sink(" << file_sink_->unique_id() << ")"; | ||||
|         } | ||||
|     samples_ = 0; | ||||
|     samples_ = 0ULL; | ||||
|     if (in_stream_ > 8) | ||||
|         { | ||||
|             LOG(ERROR) << "This implementation only supports eight input streams"; | ||||
|   | ||||
| @@ -34,6 +34,7 @@ | ||||
|  | ||||
| #include "gnss_block_interface.h" | ||||
| #include <gnuradio/hier_block2.h> | ||||
| #include <cstdint> | ||||
| #include <string> | ||||
|  | ||||
| class ConfigurationInterface; | ||||
| @@ -78,7 +79,7 @@ private: | ||||
|     unsigned int out_stream_; | ||||
|     std::string item_type_; | ||||
|     size_t item_size_; | ||||
|     unsigned long long samples_; | ||||
|     uint64_t samples_; | ||||
|     bool dump_; | ||||
|     std::string dump_filename_; | ||||
|     gr::block_sptr beamformer_; | ||||
|   | ||||
| @@ -50,7 +50,7 @@ LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration, | ||||
|     int channel_selector = configuration->property(role + ".selected_channel", 1); | ||||
|     std::string default_filename = "./example_capture.LS3"; | ||||
|  | ||||
|     samples_ = configuration->property(role + ".samples", 0); | ||||
|     samples_ = configuration->property(role + ".samples", 0ULL); | ||||
|     filename_ = configuration->property(role + ".filename", default_filename); | ||||
|  | ||||
|     if (item_type_ == "gr_complex") | ||||
|   | ||||
| @@ -81,7 +81,7 @@ private: | ||||
|     unsigned int out_stream_; | ||||
|     std::string item_type_; | ||||
|     size_t item_size_; | ||||
|     long samples_; | ||||
|     uint64_t samples_; | ||||
|     std::string filename_; | ||||
|     bool dump_; | ||||
|     std::string dump_filename_; | ||||
|   | ||||
| @@ -53,8 +53,8 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration, | ||||
|     std::string default_item_type = "byte"; | ||||
|     std::string default_dump_filename = "../data/my_capture_dump.dat"; | ||||
|  | ||||
|     samples_ = configuration->property(role + ".samples", 0); | ||||
|     sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0); | ||||
|     samples_ = configuration->property(role + ".samples", 0ULL); | ||||
|     sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL); | ||||
|     filename_ = configuration->property(role + ".filename", default_filename); | ||||
|  | ||||
|     // override value with commandline flag, if present | ||||
|   | ||||
| @@ -96,27 +96,27 @@ public: | ||||
|         return repeat_; | ||||
|     } | ||||
|  | ||||
|     inline long sampling_frequency() const | ||||
|     inline int64_t sampling_frequency() const | ||||
|     { | ||||
|         return sampling_frequency_; | ||||
|     } | ||||
|  | ||||
|     inline long samples() const | ||||
|     inline uint64_t samples() const | ||||
|     { | ||||
|         return samples_; | ||||
|     } | ||||
|  | ||||
| private: | ||||
|     unsigned long long samples_; | ||||
|     long sampling_frequency_; | ||||
|     uint64_t samples_; | ||||
|     int64_t sampling_frequency_; | ||||
|     std::string filename_; | ||||
|     std::string item_type_; | ||||
|     bool repeat_; | ||||
|     bool dump_; | ||||
|     std::string dump_filename_; | ||||
|     std::string role_; | ||||
|     unsigned int in_streams_; | ||||
|     unsigned int out_streams_; | ||||
|     uint32_t in_streams_; | ||||
|     uint32_t out_streams_; | ||||
|     gr::blocks::file_source::sptr file_source_; | ||||
|     unpack_byte_2bit_samples_sptr unpack_byte_; | ||||
|     boost::shared_ptr<gr::block> valve_; | ||||
|   | ||||
| @@ -57,7 +57,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration, | ||||
|     std::string empty = ""; | ||||
|     std::string default_dump_file = "./data/signal_source.dat"; | ||||
|     std::string default_item_type = "gr_complex"; | ||||
|     samples_ = configuration->property(role + ".samples", 0); | ||||
|     samples_ = configuration->property(role + ".samples", 0ULL); | ||||
|     dump_ = configuration->property(role + ".dump", false); | ||||
|     dump_filename_ = configuration->property(role + ".dump_filename", | ||||
|         default_dump_file); | ||||
| @@ -122,7 +122,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration, | ||||
|             item_size_ = sizeof(int16_t); | ||||
|         } | ||||
|  | ||||
|     if (samples_ != 0) | ||||
|     if (samples_ != 0ULL) | ||||
|         { | ||||
|             DLOG(INFO) << "Send STOP signal after " << samples_ << " samples"; | ||||
|             valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_); | ||||
| @@ -167,7 +167,7 @@ void RtlTcpSignalSource::MakeBlock() | ||||
|  | ||||
| void RtlTcpSignalSource::connect(gr::top_block_sptr top_block) | ||||
| { | ||||
|     if (samples_) | ||||
|     if (samples_ != 0ULL) | ||||
|         { | ||||
|             top_block->connect(signal_source_, 0, valve_, 0); | ||||
|             DLOG(INFO) << "connected rtl tcp source to valve"; | ||||
| @@ -187,7 +187,7 @@ void RtlTcpSignalSource::connect(gr::top_block_sptr top_block) | ||||
|  | ||||
| void RtlTcpSignalSource::disconnect(gr::top_block_sptr top_block) | ||||
| { | ||||
|     if (samples_) | ||||
|     if (samples_ != 0ULL) | ||||
|         { | ||||
|             top_block->disconnect(signal_source_, 0, valve_, 0); | ||||
|             if (dump_) | ||||
| @@ -211,7 +211,7 @@ gr::basic_block_sptr RtlTcpSignalSource::get_left_block() | ||||
|  | ||||
| gr::basic_block_sptr RtlTcpSignalSource::get_right_block() | ||||
| { | ||||
|     if (samples_ != 0) | ||||
|     if (samples_ != 0ULL) | ||||
|         { | ||||
|             return valve_; | ||||
|         } | ||||
|   | ||||
| @@ -105,7 +105,7 @@ private: | ||||
|  | ||||
|     std::string item_type_; | ||||
|     size_t item_size_; | ||||
|     long samples_; | ||||
|     uint64_t samples_; | ||||
|     bool dump_; | ||||
|     std::string dump_filename_; | ||||
|  | ||||
|   | ||||
| @@ -52,8 +52,8 @@ SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration | ||||
|     std::string default_item_type = "int"; | ||||
|     std::string default_dump_filename = "../data/my_capture_dump.dat"; | ||||
|  | ||||
|     samples_ = configuration->property(role + ".samples", 0); | ||||
|     sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0); | ||||
|     samples_ = configuration->property(role + ".samples", 0ULL); | ||||
|     sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL); | ||||
|     filename_ = configuration->property(role + ".filename", default_filename); | ||||
|  | ||||
|     // override value with commandline flag, if present | ||||
|   | ||||
| @@ -39,6 +39,7 @@ | ||||
| #include <gnuradio/blocks/throttle.h> | ||||
| #include <gnuradio/hier_block2.h> | ||||
| #include <gnuradio/msg_queue.h> | ||||
| #include <cstdint> | ||||
| #include <string> | ||||
|  | ||||
| class ConfigurationInterface; | ||||
| @@ -93,19 +94,19 @@ public: | ||||
|         return repeat_; | ||||
|     } | ||||
|  | ||||
|     inline long sampling_frequency() const | ||||
|     inline int64_t sampling_frequency() const | ||||
|     { | ||||
|         return sampling_frequency_; | ||||
|     } | ||||
|  | ||||
|     inline long samples() const | ||||
|     inline uint64_t samples() const | ||||
|     { | ||||
|         return samples_; | ||||
|     } | ||||
|  | ||||
| private: | ||||
|     unsigned long long samples_; | ||||
|     long sampling_frequency_; | ||||
|     uint64_t samples_; | ||||
|     int64_t sampling_frequency_; | ||||
|     std::string filename_; | ||||
|     std::string item_type_; | ||||
|     bool repeat_; | ||||
|   | ||||
| @@ -49,8 +49,8 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* | ||||
|     std::string default_dump_filename = "../data/my_capture_dump.dat"; | ||||
|     item_type_ = "int"; | ||||
|  | ||||
|     samples_ = configuration->property(role + ".samples", 0); | ||||
|     sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0.0); | ||||
|     samples_ = configuration->property(role + ".samples", 0ULL); | ||||
|     sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL); | ||||
|     filename_ = configuration->property(role + ".filename", default_filename); | ||||
|     repeat_ = configuration->property(role + ".repeat", false); | ||||
|     dump_ = configuration->property(role + ".dump", false); | ||||
|   | ||||
| @@ -97,19 +97,19 @@ public: | ||||
|         return repeat_; | ||||
|     } | ||||
|  | ||||
|     inline long sampling_frequency() const | ||||
|     inline int64_t sampling_frequency() const | ||||
|     { | ||||
|         return sampling_frequency_; | ||||
|     } | ||||
|  | ||||
|     inline long samples() const | ||||
|     inline uint64_t samples() const | ||||
|     { | ||||
|         return samples_; | ||||
|     } | ||||
|  | ||||
| private: | ||||
|     uint64_t samples_; | ||||
|     double sampling_frequency_; | ||||
|     int64_t sampling_frequency_; | ||||
|     std::string filename_; | ||||
|     bool repeat_; | ||||
|     bool dump_;  //Enables dumping the gr_complex sample output | ||||
|   | ||||
| @@ -77,7 +77,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration, | ||||
|     if (RF_channels_ == 1) | ||||
|         { | ||||
|             // Single RF channel UHD operation (backward compatible config file format) | ||||
|             samples_.push_back(configuration->property(role + ".samples", 0)); | ||||
|             samples_.push_back(configuration->property(role + ".samples", 0ULL)); | ||||
|             dump_.push_back(configuration->property(role + ".dump", false)); | ||||
|             dump_filename_.push_back(configuration->property(role + ".dump_filename", default_dump_file)); | ||||
|  | ||||
| @@ -92,7 +92,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration, | ||||
|             for (int i = 0; i < RF_channels_; i++) | ||||
|                 { | ||||
|                     // Single RF channel UHD operation (backward compatible config file format) | ||||
|                     samples_.push_back(configuration->property(role + ".samples" + std::to_string(i), 0)); | ||||
|                     samples_.push_back(configuration->property(role + ".samples" + std::to_string(i), 0ULL)); | ||||
|                     dump_.push_back(configuration->property(role + ".dump" + std::to_string(i), false)); | ||||
|                     dump_filename_.push_back(configuration->property(role + ".dump_filename" + std::to_string(i), default_dump_file)); | ||||
|  | ||||
| @@ -215,7 +215,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration, | ||||
|  | ||||
|     for (int i = 0; i < RF_channels_; i++) | ||||
|         { | ||||
|             if (samples_.at(i) != 0) | ||||
|             if (samples_.at(i) != 0ULL) | ||||
|                 { | ||||
|                     LOG(INFO) << "RF_channel " << i << " Send STOP signal after " << samples_.at(i) << " samples"; | ||||
|                     valve_.push_back(gnss_sdr_make_valve(item_size_, samples_.at(i), queue_)); | ||||
| @@ -247,7 +247,7 @@ void UhdSignalSource::connect(gr::top_block_sptr top_block) | ||||
| { | ||||
|     for (int i = 0; i < RF_channels_; i++) | ||||
|         { | ||||
|             if (samples_.at(i) != 0) | ||||
|             if (samples_.at(i) != 0ULL) | ||||
|                 { | ||||
|                     top_block->connect(uhd_source_, i, valve_.at(i), 0); | ||||
|                     DLOG(INFO) << "connected usrp source to valve RF Channel " << i; | ||||
| @@ -273,7 +273,7 @@ void UhdSignalSource::disconnect(gr::top_block_sptr top_block) | ||||
| { | ||||
|     for (int i = 0; i < RF_channels_; i++) | ||||
|         { | ||||
|             if (samples_.at(i) != 0) | ||||
|             if (samples_.at(i) != 0ULL) | ||||
|                 { | ||||
|                     top_block->disconnect(uhd_source_, i, valve_.at(i), 0); | ||||
|                     LOG(INFO) << "UHD source disconnected"; | ||||
| @@ -310,7 +310,7 @@ gr::basic_block_sptr UhdSignalSource::get_right_block() | ||||
| gr::basic_block_sptr UhdSignalSource::get_right_block(int RF_channel) | ||||
| { | ||||
|     //TODO: There is a incoherence here: Multichannel UHD is a single block with multiple outputs, but if the sample limit is enabled, the output is a multiple block! | ||||
|     if (samples_.at(RF_channel) != 0) | ||||
|     if (samples_.at(RF_channel) != 0ULL) | ||||
|         { | ||||
|             return valve_.at(RF_channel); | ||||
|         } | ||||
|   | ||||
| @@ -37,6 +37,7 @@ | ||||
| #include <gnuradio/hier_block2.h> | ||||
| #include <gnuradio/msg_queue.h> | ||||
| #include <gnuradio/uhd/usrp_source.h> | ||||
| #include <cstdint> | ||||
| #include <string> | ||||
| #include <vector> | ||||
|  | ||||
| @@ -99,7 +100,7 @@ private: | ||||
|     std::vector<double> freq_; | ||||
|     std::vector<double> gain_; | ||||
|     std::vector<double> IF_bandwidth_hz_; | ||||
|     std::vector<long> samples_; | ||||
|     std::vector<uint64_t> samples_; | ||||
|     std::vector<bool> dump_; | ||||
|     std::vector<std::string> dump_filename_; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez