mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-04-25 12:13:13 +00:00
Remove unused private members, replace std::bind by lambdas, apply clang-tidy and clang-format
Fix position_test with default parameters
This commit is contained in:
parent
a7d19789f3
commit
c7866ef385
@ -57,7 +57,10 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition(
|
||||
|
||||
LOG(INFO) << "role " << role;
|
||||
|
||||
if (FLAGS_doppler_max != 0) acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
}
|
||||
doppler_max_ = acq_parameters_.doppler_max;
|
||||
doppler_step_ = acq_parameters_.doppler_step;
|
||||
fs_in_ = acq_parameters_.fs_in;
|
||||
|
@ -170,17 +170,12 @@ private:
|
||||
std::string item_type_;
|
||||
unsigned int vector_length_;
|
||||
unsigned int code_length_;
|
||||
bool bit_transition_flag_;
|
||||
bool use_CFAR_algorithm_flag_;
|
||||
unsigned int channel_;
|
||||
std::weak_ptr<ChannelFsm> channel_fsm_;
|
||||
float threshold_;
|
||||
unsigned int doppler_max_;
|
||||
unsigned int doppler_step_;
|
||||
unsigned int max_dwells_;
|
||||
int64_t fs_in_;
|
||||
bool dump_;
|
||||
bool blocking_;
|
||||
std::string dump_filename_;
|
||||
std::vector<std::complex<float>> code_;
|
||||
Gnss_Synchro* gnss_synchro_;
|
||||
|
@ -55,7 +55,10 @@ BeidouB3iPcpsAcquisition::BeidouB3iPcpsAcquisition(
|
||||
|
||||
LOG(INFO) << "role " << role;
|
||||
|
||||
if (FLAGS_doppler_max != 0) acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
}
|
||||
doppler_max_ = acq_parameters_.doppler_max;
|
||||
doppler_step_ = acq_parameters_.doppler_step;
|
||||
item_type_ = acq_parameters_.item_type;
|
||||
|
@ -169,17 +169,12 @@ private:
|
||||
std::string item_type_;
|
||||
unsigned int vector_length_;
|
||||
unsigned int code_length_;
|
||||
bool bit_transition_flag_;
|
||||
bool use_CFAR_algorithm_flag_;
|
||||
unsigned int channel_;
|
||||
std::weak_ptr<ChannelFsm> channel_fsm_;
|
||||
float threshold_;
|
||||
unsigned int doppler_max_;
|
||||
unsigned int doppler_step_;
|
||||
unsigned int max_dwells_;
|
||||
int64_t fs_in_;
|
||||
bool dump_;
|
||||
bool blocking_;
|
||||
std::string dump_filename_;
|
||||
std::vector<std::complex<float>> code_;
|
||||
Gnss_Synchro* gnss_synchro_;
|
||||
|
@ -54,7 +54,10 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
|
||||
DLOG(INFO) << "role " << role;
|
||||
|
||||
if (FLAGS_doppler_max != 0) acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
}
|
||||
doppler_max_ = acq_parameters_.doppler_max;
|
||||
doppler_step_ = acq_parameters_.doppler_step;
|
||||
item_type_ = acq_parameters_.item_type;
|
||||
|
@ -173,8 +173,6 @@ private:
|
||||
std::string item_type_;
|
||||
unsigned int vector_length_;
|
||||
unsigned int code_length_;
|
||||
bool bit_transition_flag_;
|
||||
bool use_CFAR_algorithm_flag_;
|
||||
bool acquire_pilot_;
|
||||
unsigned int channel_;
|
||||
std::weak_ptr<ChannelFsm> channel_fsm_;
|
||||
@ -183,10 +181,7 @@ private:
|
||||
unsigned int doppler_step_;
|
||||
int doppler_center_;
|
||||
unsigned int sampled_ms_;
|
||||
unsigned int max_dwells_;
|
||||
int64_t fs_in_;
|
||||
bool dump_;
|
||||
bool blocking_;
|
||||
std::string dump_filename_;
|
||||
std::vector<std::complex<float>> code_;
|
||||
Gnss_Synchro* gnss_synchro_;
|
||||
|
@ -53,7 +53,10 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
|
||||
|
||||
DLOG(INFO) << "Role " << role;
|
||||
|
||||
if (FLAGS_doppler_max != 0) acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
}
|
||||
doppler_max_ = acq_parameters_.doppler_max;
|
||||
doppler_step_ = acq_parameters_.doppler_step;
|
||||
item_type_ = acq_parameters_.item_type;
|
||||
|
@ -162,11 +162,7 @@ private:
|
||||
std::string item_type_;
|
||||
std::string dump_filename_;
|
||||
std::string role_;
|
||||
bool bit_transition_flag_;
|
||||
bool dump_;
|
||||
bool acq_pilot_;
|
||||
bool use_CFAR_;
|
||||
bool blocking_;
|
||||
bool acq_iq_;
|
||||
unsigned int vector_length_;
|
||||
unsigned int code_length_;
|
||||
@ -176,7 +172,6 @@ private:
|
||||
unsigned int doppler_step_;
|
||||
int doppler_center_;
|
||||
unsigned int sampled_ms_;
|
||||
unsigned int max_dwells_;
|
||||
unsigned int in_streams_;
|
||||
unsigned int out_streams_;
|
||||
int64_t fs_in_;
|
||||
|
@ -56,7 +56,10 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition(
|
||||
|
||||
DLOG(INFO) << "role " << role;
|
||||
|
||||
if (FLAGS_doppler_max != 0) acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
}
|
||||
doppler_max_ = acq_parameters_.doppler_max;
|
||||
doppler_step_ = acq_parameters_.doppler_step;
|
||||
item_type_ = acq_parameters_.item_type;
|
||||
|
@ -165,18 +165,13 @@ private:
|
||||
std::string item_type_;
|
||||
unsigned int vector_length_;
|
||||
unsigned int code_length_;
|
||||
bool bit_transition_flag_;
|
||||
bool use_CFAR_algorithm_flag_;
|
||||
unsigned int channel_;
|
||||
std::weak_ptr<ChannelFsm> channel_fsm_;
|
||||
float threshold_;
|
||||
unsigned int doppler_max_;
|
||||
unsigned int doppler_step_;
|
||||
unsigned int sampled_ms_;
|
||||
unsigned int max_dwells_;
|
||||
int64_t fs_in_;
|
||||
bool dump_;
|
||||
bool blocking_;
|
||||
std::string dump_filename_;
|
||||
std::vector<std::complex<float>> code_;
|
||||
Gnss_Synchro* gnss_synchro_;
|
||||
|
@ -55,7 +55,10 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition(
|
||||
|
||||
DLOG(INFO) << "role " << role;
|
||||
|
||||
if (FLAGS_doppler_max != 0) acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
}
|
||||
doppler_max_ = acq_parameters_.doppler_max;
|
||||
doppler_step_ = acq_parameters_.doppler_step;
|
||||
item_type_ = acq_parameters_.item_type;
|
||||
|
@ -164,18 +164,13 @@ private:
|
||||
std::string item_type_;
|
||||
unsigned int vector_length_;
|
||||
unsigned int code_length_;
|
||||
bool bit_transition_flag_;
|
||||
bool use_CFAR_algorithm_flag_;
|
||||
unsigned int channel_;
|
||||
std::weak_ptr<ChannelFsm> channel_fsm_;
|
||||
float threshold_;
|
||||
unsigned int doppler_max_;
|
||||
unsigned int doppler_step_;
|
||||
unsigned int sampled_ms_;
|
||||
unsigned int max_dwells_;
|
||||
int64_t fs_in_;
|
||||
bool dump_;
|
||||
bool blocking_;
|
||||
std::string dump_filename_;
|
||||
std::vector<std::complex<float>> code_;
|
||||
Gnss_Synchro* gnss_synchro_;
|
||||
|
@ -59,7 +59,10 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
|
||||
|
||||
DLOG(INFO) << "role " << role;
|
||||
|
||||
if (FLAGS_doppler_max != 0) acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
}
|
||||
|
||||
doppler_max_ = acq_parameters_.doppler_max;
|
||||
doppler_step_ = acq_parameters_.doppler_step;
|
||||
|
@ -177,8 +177,6 @@ private:
|
||||
std::string item_type_;
|
||||
unsigned int vector_length_;
|
||||
unsigned int code_length_;
|
||||
bool bit_transition_flag_;
|
||||
bool use_CFAR_algorithm_flag_;
|
||||
unsigned int channel_;
|
||||
std::weak_ptr<ChannelFsm> channel_fsm_;
|
||||
float threshold_;
|
||||
@ -186,10 +184,6 @@ private:
|
||||
unsigned int doppler_step_;
|
||||
int doppler_center_;
|
||||
unsigned int sampled_ms_;
|
||||
unsigned int max_dwells_;
|
||||
int64_t fs_in_;
|
||||
bool dump_;
|
||||
bool blocking_;
|
||||
std::string dump_filename_;
|
||||
std::vector<std::complex<float>> code_;
|
||||
Gnss_Synchro* gnss_synchro_;
|
||||
|
@ -56,7 +56,10 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
|
||||
|
||||
DLOG(INFO) << "Role " << role;
|
||||
|
||||
if (FLAGS_doppler_max != 0) acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
}
|
||||
doppler_max_ = acq_parameters_.doppler_max;
|
||||
doppler_step_ = acq_parameters_.doppler_step;
|
||||
item_type_ = acq_parameters_.item_type;
|
||||
|
@ -174,18 +174,13 @@ private:
|
||||
std::string item_type_;
|
||||
unsigned int vector_length_;
|
||||
unsigned int code_length_;
|
||||
bool bit_transition_flag_;
|
||||
bool use_CFAR_algorithm_flag_;
|
||||
unsigned int channel_;
|
||||
std::weak_ptr<ChannelFsm> channel_fsm_;
|
||||
float threshold_;
|
||||
unsigned int doppler_max_;
|
||||
unsigned int doppler_step_;
|
||||
int doppler_center_;
|
||||
unsigned int max_dwells_;
|
||||
int64_t fs_in_;
|
||||
bool dump_;
|
||||
bool blocking_;
|
||||
std::string dump_filename_;
|
||||
std::vector<std::complex<float>> code_;
|
||||
Gnss_Synchro* gnss_synchro_;
|
||||
|
@ -56,7 +56,10 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
|
||||
|
||||
DLOG(INFO) << "role " << role;
|
||||
|
||||
if (FLAGS_doppler_max != 0) acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
if (FLAGS_doppler_max != 0)
|
||||
{
|
||||
acq_parameters_.doppler_max = FLAGS_doppler_max;
|
||||
}
|
||||
|
||||
doppler_max_ = acq_parameters_.doppler_max;
|
||||
doppler_step_ = acq_parameters_.doppler_step;
|
||||
|
@ -174,18 +174,13 @@ private:
|
||||
std::string item_type_;
|
||||
unsigned int vector_length_;
|
||||
unsigned int code_length_;
|
||||
bool bit_transition_flag_;
|
||||
bool use_CFAR_algorithm_flag_;
|
||||
unsigned int channel_;
|
||||
std::weak_ptr<ChannelFsm> channel_fsm_;
|
||||
float threshold_;
|
||||
unsigned int doppler_max_;
|
||||
unsigned int doppler_step_;
|
||||
int doppler_center_;
|
||||
unsigned int max_dwells_;
|
||||
int64_t fs_in_;
|
||||
bool dump_;
|
||||
bool blocking_;
|
||||
std::string dump_filename_;
|
||||
std::vector<std::complex<float>> code_;
|
||||
Gnss_Synchro* gnss_synchro_;
|
||||
|
@ -878,7 +878,9 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count)
|
||||
bool was_step_two = d_step_two;
|
||||
d_step_two = false;
|
||||
if (was_step_two)
|
||||
{
|
||||
calculate_threshold();
|
||||
}
|
||||
send_negative_acquisition();
|
||||
}
|
||||
}
|
||||
@ -913,12 +915,15 @@ bool pcps_acquisition::start()
|
||||
return true;
|
||||
}
|
||||
|
||||
void pcps_acquisition::calculate_threshold(void)
|
||||
|
||||
void pcps_acquisition::calculate_threshold()
|
||||
{
|
||||
float pfa = (d_step_two ? acq_parameters.pfa2 : acq_parameters.pfa);
|
||||
|
||||
if (pfa <= 0.0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int effective_fft_size = (acq_parameters.bit_transition_flag ? (d_fft_size / 2) : d_fft_size);
|
||||
int num_doppler_bins = (d_step_two ? d_num_doppler_bins_step2 : d_num_doppler_bins);
|
||||
@ -928,6 +933,7 @@ void pcps_acquisition::calculate_threshold(void)
|
||||
d_threshold = 2.0 * boost::math::gamma_p_inv(2 * acq_parameters.max_dwells, std::pow(1.0 - pfa, 1.0 / static_cast<double>(num_bins)));
|
||||
}
|
||||
|
||||
|
||||
int pcps_acquisition::general_work(int noutput_items __attribute__((unused)),
|
||||
gr_vector_int& ninput_items,
|
||||
gr_vector_const_void_star& input_items,
|
||||
|
@ -46,8 +46,8 @@ Acq_Conf::Acq_Conf()
|
||||
doppler_min = -5000;
|
||||
num_doppler_bins_step2 = 4U;
|
||||
doppler_step2 = 125.0;
|
||||
pfa = 0.0;
|
||||
pfa2 = 0.0;
|
||||
pfa = 0.001;
|
||||
pfa2 = 0.001;
|
||||
fs_in = 4000000;
|
||||
samples_per_ms = 0.0;
|
||||
samples_per_code = 0.0;
|
||||
@ -114,7 +114,9 @@ void Acq_Conf::SetFromConfiguration(ConfigurationInterface *configuration,
|
||||
pfa = configuration->property(role + ".pfa", pfa);
|
||||
pfa2 = configuration->property(role + ".pfa_second_step", pfa2);
|
||||
if (pfa2 <= 0.0)
|
||||
{
|
||||
pfa2 = pfa;
|
||||
}
|
||||
make_2_steps = configuration->property(role + ".make_two_steps", make_2_steps);
|
||||
blocking_on_standby = configuration->property(role + ".blocking_on_standby", blocking_on_standby);
|
||||
|
||||
|
@ -47,6 +47,7 @@ bool item_type_valid(const std::string &item_type)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
size_t item_type_size(const std::string &item_type)
|
||||
{
|
||||
if (item_type == "byte" or item_type == "ibyte")
|
||||
@ -57,7 +58,7 @@ size_t item_type_size(const std::string &item_type)
|
||||
{
|
||||
return 2 * sizeof(int8_t);
|
||||
}
|
||||
else if (item_type == "short" or item_type == "ishort" )
|
||||
else if (item_type == "short" or item_type == "ishort")
|
||||
{
|
||||
return sizeof(int16_t);
|
||||
}
|
||||
@ -79,90 +80,105 @@ size_t item_type_size(const std::string &item_type)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool item_type_is_complex(const std::string &item_type)
|
||||
{
|
||||
return (item_type == "ibyte") or (item_type == "cbyte") or (item_type == "ishort") or (item_type == "cshort") or (item_type == "gr_complex");
|
||||
}
|
||||
|
||||
|
||||
void copy_converter(void *dest, const void *src, unsigned int num_items, size_t item_size)
|
||||
{
|
||||
std::memcpy(dest, src, num_items * item_size);
|
||||
}
|
||||
|
||||
|
||||
void convert_8i_16i(void *dest, const void *src, unsigned int num_items)
|
||||
{
|
||||
volk_8i_convert_16i(reinterpret_cast<int16_t *>(dest),
|
||||
reinterpret_cast<const int8_t *>(src), num_items);
|
||||
}
|
||||
|
||||
|
||||
void convert_8i_32f(void *dest, const void *src, unsigned int num_items)
|
||||
{
|
||||
volk_8i_s32f_convert_32f(reinterpret_cast<float *>(dest),
|
||||
reinterpret_cast<const int8_t *>(src), 1.0f, num_items);
|
||||
reinterpret_cast<const int8_t *>(src), 1.0F, num_items);
|
||||
}
|
||||
|
||||
|
||||
void convert_8ic_16ic(void *dest, const void *src, unsigned int num_items)
|
||||
{
|
||||
volk_8i_convert_16i(reinterpret_cast<int16_t *>(dest),
|
||||
reinterpret_cast<const int8_t *>(src), 2 * num_items);
|
||||
}
|
||||
|
||||
|
||||
void convert_8ic_32fc(void *dest, const void *src, unsigned int num_items)
|
||||
{
|
||||
volk_8i_s32f_convert_32f(reinterpret_cast<float *>(dest),
|
||||
reinterpret_cast<const int8_t *>(src), 1.0f, 2 * num_items);
|
||||
reinterpret_cast<const int8_t *>(src), 1.0F, 2 * num_items);
|
||||
}
|
||||
|
||||
|
||||
void convert_16i_8i(void *dest, const void *src, unsigned int num_items)
|
||||
{
|
||||
volk_16i_convert_8i(reinterpret_cast<int8_t *>(dest),
|
||||
reinterpret_cast<const int16_t *>(src), num_items);
|
||||
}
|
||||
|
||||
|
||||
void convert_16i_32f(void *dest, const void *src, unsigned int num_items)
|
||||
{
|
||||
volk_16i_s32f_convert_32f(reinterpret_cast<float *>(dest),
|
||||
reinterpret_cast<const int16_t *>(src), 1.0f, num_items);
|
||||
reinterpret_cast<const int16_t *>(src), 1.0F, num_items);
|
||||
}
|
||||
|
||||
|
||||
void convert_16ic_8ic(void *dest, const void *src, unsigned int num_items)
|
||||
{
|
||||
volk_16i_convert_8i(reinterpret_cast<int8_t *>(dest),
|
||||
reinterpret_cast<const int16_t *>(src), 2 * num_items);
|
||||
}
|
||||
|
||||
|
||||
void convert_16ic_32fc(void *dest, const void *src, unsigned int num_items)
|
||||
{
|
||||
volk_16i_s32f_convert_32f(reinterpret_cast<float *>(dest),
|
||||
reinterpret_cast<const int16_t *>(src), 1.0f, 2 * num_items);
|
||||
reinterpret_cast<const int16_t *>(src), 1.0F, 2 * num_items);
|
||||
}
|
||||
|
||||
|
||||
void convert_32f_8i(void *dest, const void *src, unsigned int num_items)
|
||||
{
|
||||
volk_32f_s32f_convert_8i(reinterpret_cast<int8_t *>(dest),
|
||||
reinterpret_cast<const float *>(src), 1.0f, num_items);
|
||||
reinterpret_cast<const float *>(src), 1.0F, num_items);
|
||||
}
|
||||
|
||||
|
||||
void convert_32f_16i(void *dest, const void *src, unsigned int num_items)
|
||||
{
|
||||
volk_32f_s32f_convert_16i(reinterpret_cast<int16_t *>(dest),
|
||||
reinterpret_cast<const float *>(src), 1.0f, num_items);
|
||||
reinterpret_cast<const float *>(src), 1.0F, num_items);
|
||||
}
|
||||
|
||||
|
||||
void convert_32fc_8ic(void *dest, const void *src, unsigned int num_items)
|
||||
{
|
||||
volk_32f_s32f_convert_8i(reinterpret_cast<int8_t *>(dest),
|
||||
reinterpret_cast<const float *>(src), 1.0f, 2 * num_items);
|
||||
reinterpret_cast<const float *>(src), 1.0F, 2 * num_items);
|
||||
}
|
||||
|
||||
|
||||
void convert_32fc_16ic(void *dest, const void *src, unsigned int num_items)
|
||||
{
|
||||
volk_32f_s32f_convert_16i(reinterpret_cast<int16_t *>(dest),
|
||||
reinterpret_cast<const float *>(src), 1.0f, 2 * num_items);
|
||||
reinterpret_cast<const float *>(src), 1.0F, 2 * num_items);
|
||||
}
|
||||
|
||||
item_type_converter_t make_vector_converter(std::string input_type,
|
||||
std::string output_type)
|
||||
|
||||
item_type_converter_t make_vector_converter(const std::string &input_type,
|
||||
const std::string &output_type)
|
||||
{
|
||||
if (not item_type_valid(input_type) or not item_type_valid(output_type))
|
||||
{
|
||||
@ -172,136 +188,115 @@ item_type_converter_t make_vector_converter(std::string input_type,
|
||||
if (input_type == output_type)
|
||||
{
|
||||
size_t input_size = item_type_size(input_type);
|
||||
return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2,
|
||||
std::placeholders::_3, input_size);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return copy_converter(arg1, arg2, arg3, input_size); };
|
||||
}
|
||||
|
||||
if (input_type == "byte")
|
||||
{
|
||||
if (output_type == "short")
|
||||
{
|
||||
return std::bind(convert_8i_16i, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_8i_16i(arg1, arg2, arg3); };
|
||||
}
|
||||
else if (output_type == "float")
|
||||
{
|
||||
return std::bind(convert_8i_32f, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_8i_32f(arg1, arg2, arg3); };
|
||||
}
|
||||
}
|
||||
else if (input_type == "cbyte")
|
||||
{
|
||||
if (output_type == "ibyte" )
|
||||
if (output_type == "ibyte")
|
||||
{
|
||||
size_t input_size = item_type_size(input_type);
|
||||
return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2,
|
||||
std::placeholders::_3, input_size);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return copy_converter(arg1, arg2, arg3, input_size); };
|
||||
}
|
||||
if (output_type == "cshort" or output_type == "ishort" )
|
||||
if (output_type == "cshort" or output_type == "ishort")
|
||||
{
|
||||
return std::bind(convert_8ic_16ic, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_8ic_16ic(arg1, arg2, arg3); };
|
||||
}
|
||||
else if (output_type == "gr_complex")
|
||||
{
|
||||
return std::bind(convert_8ic_32fc, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_8ic_32fc(arg1, arg2, arg3); };
|
||||
}
|
||||
}
|
||||
else if (input_type == "ibyte")
|
||||
{
|
||||
if (output_type == "cbyte" )
|
||||
if (output_type == "cbyte")
|
||||
{
|
||||
size_t input_size = item_type_size(input_type);
|
||||
return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2,
|
||||
std::placeholders::_3, input_size);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return copy_converter(arg1, arg2, arg3, input_size); };
|
||||
}
|
||||
else if (output_type == "cshort" or output_type == "ishort")
|
||||
{
|
||||
return std::bind(convert_8i_16i, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_8i_16i(arg1, arg2, arg3); };
|
||||
}
|
||||
else if (output_type == "gr_complex")
|
||||
{
|
||||
return std::bind(convert_8i_32f, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_8i_32f(arg1, arg2, arg3); };
|
||||
}
|
||||
}
|
||||
else if (input_type == "short")
|
||||
{
|
||||
if (output_type == "byte")
|
||||
{
|
||||
return std::bind(convert_16i_8i, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_16i_8i(arg1, arg2, arg3); };
|
||||
}
|
||||
else if (output_type == "float")
|
||||
{
|
||||
return std::bind(convert_16i_32f, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_16i_32f(arg1, arg2, arg3); };
|
||||
}
|
||||
}
|
||||
else if (input_type == "cshort")
|
||||
{
|
||||
if (output_type == "cbyte" or output_type == "ibyte" )
|
||||
if (output_type == "cbyte" or output_type == "ibyte")
|
||||
{
|
||||
return std::bind(convert_16ic_8ic, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_16ic_8ic(arg1, arg2, arg3); };
|
||||
}
|
||||
if (output_type == "ishort")
|
||||
{
|
||||
size_t input_size = item_type_size(input_type);
|
||||
return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2,
|
||||
std::placeholders::_3, input_size);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return copy_converter(arg1, arg2, arg3, input_size); };
|
||||
}
|
||||
else if (output_type == "gr_complex")
|
||||
{
|
||||
return std::bind(convert_16ic_32fc, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_16ic_32fc(arg1, arg2, arg3); };
|
||||
}
|
||||
}
|
||||
else if (input_type == "ishort")
|
||||
{
|
||||
if (output_type == "cbyte" or output_type == "ibyte" )
|
||||
if (output_type == "cbyte" or output_type == "ibyte")
|
||||
{
|
||||
return std::bind(convert_16i_8i, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_16i_8i(arg1, arg2, arg3); };
|
||||
}
|
||||
if (output_type == "cshort")
|
||||
{
|
||||
size_t input_size = item_type_size(input_type);
|
||||
return std::bind(copy_converter, std::placeholders::_1, std::placeholders::_2,
|
||||
std::placeholders::_3, input_size);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return copy_converter(arg1, arg2, arg3, input_size); };
|
||||
}
|
||||
else if (output_type == "gr_complex")
|
||||
{
|
||||
return std::bind(convert_16i_32f, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_16i_32f(arg1, arg2, arg3); };
|
||||
}
|
||||
}
|
||||
else if (input_type == "float")
|
||||
{
|
||||
if (output_type == "byte")
|
||||
{
|
||||
return std::bind(convert_32f_8i, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_32f_8i(arg1, arg2, arg3); };
|
||||
}
|
||||
else if (output_type == "short")
|
||||
{
|
||||
return std::bind(convert_32f_16i, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_32f_16i(arg1, arg2, arg3); };
|
||||
}
|
||||
}
|
||||
else if (input_type == "gr_complex")
|
||||
{
|
||||
if (output_type == "cbyte" or output_type == "ibyte")
|
||||
{
|
||||
return std::bind(convert_32fc_8ic, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_32fc_8ic(arg1, arg2, arg3); };
|
||||
}
|
||||
else if (output_type == "cshort" or output_type == "ishort" )
|
||||
else if (output_type == "cshort" or output_type == "ishort")
|
||||
{
|
||||
return std::bind(convert_32fc_16ic, std::placeholders::_1,
|
||||
std::placeholders::_2, std::placeholders::_3);
|
||||
return [=](auto &&arg1, auto &&arg2, auto &&arg3) { return convert_32fc_16ic(arg1, arg2, arg3); };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,6 @@ size_t item_type_size(const std::string &item_type);
|
||||
*/
|
||||
bool item_type_is_complex(const std::string &item_type);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Create a function to convert an array of input_type to an array of output_type
|
||||
*
|
||||
@ -82,9 +81,8 @@ bool item_type_is_complex(const std::string &item_type);
|
||||
* \returns A function object with the following prototype:
|
||||
* void convert_fun( void *dest, void *src, int num_items );
|
||||
*
|
||||
*
|
||||
*/
|
||||
item_type_converter_t make_vector_converter(std::string input_type,
|
||||
std::string output_type);
|
||||
item_type_converter_t make_vector_converter(const std::string &input_type,
|
||||
const std::string &output_type);
|
||||
|
||||
#endif
|
||||
|
@ -193,7 +193,6 @@ int PositionSystemTest::configure_receiver()
|
||||
const int number_of_channels = 11;
|
||||
const int in_acquisition = 1;
|
||||
|
||||
const float threshold = 2.5;
|
||||
const float doppler_max = 5000.0;
|
||||
const float doppler_step = 250.0;
|
||||
const int max_dwells = 10;
|
||||
@ -278,7 +277,9 @@ int PositionSystemTest::configure_receiver()
|
||||
config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition");
|
||||
config->set_property("Acquisition_1C.item_type", "gr_complex");
|
||||
config->set_property("Acquisition_1C.coherent_integration_time_ms", std::to_string(coherent_integration_time_ms));
|
||||
config->set_property("Acquisition_1C.threshold", std::to_string(threshold));
|
||||
//config->set_property("Acquisition_1C.use_CFAR_algorithm", "false");
|
||||
//config->set_property("Acquisition_1C.pfa", std::to_string(0.001));
|
||||
//config->set_property("Acquisition_1C.pfa2", std::to_string(0.001));
|
||||
config->set_property("Acquisition_1C.doppler_max", std::to_string(doppler_max));
|
||||
config->set_property("Acquisition_1C.doppler_step", std::to_string(doppler_step));
|
||||
config->set_property("Acquisition_1C.bit_transition_flag", "false");
|
||||
|
@ -36,28 +36,24 @@
|
||||
|
||||
class ItemTypeHelpersTest : public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
protected:
|
||||
static constexpr size_t N = 1000;
|
||||
|
||||
public:
|
||||
public:
|
||||
ItemTypeHelpersTest()
|
||||
{
|
||||
std::random_device r;
|
||||
std::default_random_engine e(r());
|
||||
|
||||
std::uniform_int_distribution<int8_t> udist_int8(-100,100);
|
||||
std::uniform_int_distribution<int16_t> udist_int16(-100,100);
|
||||
std::uniform_real_distribution<float> udist_float(-100,100);
|
||||
std::uniform_int_distribution<int8_t> udist_int8(-100, 100);
|
||||
std::uniform_int_distribution<int16_t> udist_int16(-100, 100);
|
||||
std::uniform_real_distribution<float> udist_float(-100, 100);
|
||||
|
||||
std::generate( byte_array_in.begin(), byte_array_in.end(), [&udist_int8, &e](){
|
||||
return udist_int8(e); } );
|
||||
std::generate(byte_array_in.begin(), byte_array_in.end(), [&udist_int8, &e]() { return udist_int8(e); });
|
||||
|
||||
std::generate( short_array_in.begin(), short_array_in.end(), [&udist_int16, &e](){
|
||||
return udist_int16(e); } );
|
||||
|
||||
std::generate( float_array_in.begin(), float_array_in.end(), [&udist_float, &e](){
|
||||
return udist_float(e); } );
|
||||
std::generate(short_array_in.begin(), short_array_in.end(), [&udist_int16, &e]() { return udist_int16(e); });
|
||||
|
||||
std::generate(float_array_in.begin(), float_array_in.end(), [&udist_float, &e]() { return udist_float(e); });
|
||||
}
|
||||
|
||||
std::vector<std::string> valid_item_types = {"byte", "ibyte", "cbyte",
|
||||
@ -66,16 +62,14 @@ class ItemTypeHelpersTest : public ::testing::Test
|
||||
std::vector<std::string> invalid_item_types = {"i8", "tfgs", "cbite",
|
||||
"shirt", "qshort", "csort", "flat", "igr_complex"};
|
||||
|
||||
std::array< int8_t, 2*N > byte_array_in;
|
||||
std::array< int8_t, 2*N > byte_array_out;
|
||||
|
||||
std::array< int16_t, 2*N > short_array_in;
|
||||
std::array< int16_t, 2*N > short_array_out;
|
||||
|
||||
std::array< float, 2*N > float_array_in;
|
||||
std::array< float, 2*N > float_array_out;
|
||||
std::array<int8_t, 2 * N> byte_array_in;
|
||||
std::array<int8_t, 2 * N> byte_array_out;
|
||||
|
||||
std::array<int16_t, 2 * N> short_array_in;
|
||||
std::array<int16_t, 2 * N> short_array_out;
|
||||
|
||||
std::array<float, 2 * N> float_array_in;
|
||||
std::array<float, 2 * N> float_array_out;
|
||||
};
|
||||
|
||||
TEST_F(ItemTypeHelpersTest, CheckValidTypes)
|
||||
@ -93,16 +87,16 @@ TEST_F(ItemTypeHelpersTest, CheckValidTypes)
|
||||
|
||||
TEST_F(ItemTypeHelpersTest, CheckSizes)
|
||||
{
|
||||
EXPECT_EQ( item_type_size( "byte" ), 1 );
|
||||
EXPECT_EQ( item_type_size( "ibyte" ), 1 );
|
||||
EXPECT_EQ( item_type_size( "cbyte" ), 2 );
|
||||
EXPECT_EQ(item_type_size("byte"), 1);
|
||||
EXPECT_EQ(item_type_size("ibyte"), 1);
|
||||
EXPECT_EQ(item_type_size("cbyte"), 2);
|
||||
|
||||
EXPECT_EQ( item_type_size( "short" ), 2 );
|
||||
EXPECT_EQ( item_type_size( "ishort" ), 2 );
|
||||
EXPECT_EQ( item_type_size( "cshort" ), 4 );
|
||||
EXPECT_EQ(item_type_size("short"), 2);
|
||||
EXPECT_EQ(item_type_size("ishort"), 2);
|
||||
EXPECT_EQ(item_type_size("cshort"), 4);
|
||||
|
||||
EXPECT_EQ( item_type_size( "float" ), 4 );
|
||||
EXPECT_EQ( item_type_size( "gr_complex" ), 8 );
|
||||
EXPECT_EQ(item_type_size("float"), 4);
|
||||
EXPECT_EQ(item_type_size("gr_complex"), 8);
|
||||
|
||||
|
||||
for (auto &invalid_type : invalid_item_types)
|
||||
@ -113,22 +107,21 @@ TEST_F(ItemTypeHelpersTest, CheckSizes)
|
||||
|
||||
TEST_F(ItemTypeHelpersTest, CheckMakeConverters)
|
||||
{
|
||||
for( auto & input_type : valid_item_types )
|
||||
for (auto &input_type : valid_item_types)
|
||||
{
|
||||
for( auto &output_type : valid_item_types )
|
||||
for (auto &output_type : valid_item_types)
|
||||
{
|
||||
item_type_converter_t converter = nullptr;
|
||||
|
||||
if( item_type_is_complex(input_type) == item_type_is_complex(output_type) )
|
||||
if (item_type_is_complex(input_type) == item_type_is_complex(output_type))
|
||||
{
|
||||
converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr );
|
||||
converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
EXPECT_THROW( converter = make_vector_converter(input_type, output_type), std::runtime_error );
|
||||
EXPECT_THROW(converter = make_vector_converter(input_type, output_type), std::runtime_error);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -137,130 +130,130 @@ TEST_F(ItemTypeHelpersTest, CheckConversionsReal)
|
||||
{
|
||||
std::string input_type = "byte";
|
||||
std::string output_type = "byte";
|
||||
item_type_converter_t converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( byte_array_out.data(), byte_array_in.data(), N );
|
||||
EXPECT_TRUE( std::equal( byte_array_in.begin(), byte_array_in.begin() + N, byte_array_out.begin() ) );
|
||||
item_type_converter_t converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(byte_array_out.data(), byte_array_in.data(), N);
|
||||
EXPECT_TRUE(std::equal(byte_array_in.begin(), byte_array_in.begin() + N, byte_array_out.begin()));
|
||||
|
||||
input_type = "byte";
|
||||
output_type = "short";
|
||||
converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( short_array_out.data(), byte_array_in.data(), N );
|
||||
converter = make_vector_converter( output_type, input_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( byte_array_out.data(), short_array_out.data(), N );
|
||||
EXPECT_TRUE( std::equal( byte_array_out.begin(), byte_array_out.begin() + N, byte_array_in.begin() ) );
|
||||
converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(short_array_out.data(), byte_array_in.data(), N);
|
||||
converter = make_vector_converter(output_type, input_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(byte_array_out.data(), short_array_out.data(), N);
|
||||
EXPECT_TRUE(std::equal(byte_array_out.begin(), byte_array_out.begin() + N, byte_array_in.begin()));
|
||||
|
||||
input_type = "byte";
|
||||
output_type = "float";
|
||||
converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( float_array_out.data(), byte_array_in.data(), N );
|
||||
converter = make_vector_converter( output_type, input_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( byte_array_out.data(), float_array_out.data(), N );
|
||||
EXPECT_TRUE( std::equal( byte_array_out.begin(), byte_array_out.begin() + N, byte_array_in.begin() ) );
|
||||
converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(float_array_out.data(), byte_array_in.data(), N);
|
||||
converter = make_vector_converter(output_type, input_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(byte_array_out.data(), float_array_out.data(), N);
|
||||
EXPECT_TRUE(std::equal(byte_array_out.begin(), byte_array_out.begin() + N, byte_array_in.begin()));
|
||||
|
||||
input_type = "short";
|
||||
output_type = "short";
|
||||
converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( short_array_out.data(), short_array_in.data(), N );
|
||||
EXPECT_TRUE( std::equal( short_array_in.begin(), short_array_in.begin() + N, short_array_out.begin() ) );
|
||||
converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(short_array_out.data(), short_array_in.data(), N);
|
||||
EXPECT_TRUE(std::equal(short_array_in.begin(), short_array_in.begin() + N, short_array_out.begin()));
|
||||
|
||||
input_type = "short";
|
||||
output_type = "float";
|
||||
converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( float_array_out.data(), short_array_in.data(), N );
|
||||
converter = make_vector_converter( output_type, input_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( short_array_out.data(), float_array_out.data(), N );
|
||||
EXPECT_TRUE( std::equal( short_array_out.begin(), short_array_out.begin() + N, short_array_in.begin() ) );
|
||||
converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(float_array_out.data(), short_array_in.data(), N);
|
||||
converter = make_vector_converter(output_type, input_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(short_array_out.data(), float_array_out.data(), N);
|
||||
EXPECT_TRUE(std::equal(short_array_out.begin(), short_array_out.begin() + N, short_array_in.begin()));
|
||||
|
||||
input_type = "float";
|
||||
output_type = "float";
|
||||
converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( float_array_out.data(), float_array_in.data(), N );
|
||||
EXPECT_TRUE( std::equal( float_array_in.begin(), float_array_in.begin() + N, float_array_out.begin() ) );
|
||||
converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(float_array_out.data(), float_array_in.data(), N);
|
||||
EXPECT_TRUE(std::equal(float_array_in.begin(), float_array_in.begin() + N, float_array_out.begin()));
|
||||
}
|
||||
|
||||
TEST_F(ItemTypeHelpersTest, CheckConversionsComplex)
|
||||
{
|
||||
std::string input_type = "cbyte";
|
||||
std::string output_type = "cbyte";
|
||||
item_type_converter_t converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( byte_array_out.data(), byte_array_in.data(), N );
|
||||
EXPECT_TRUE( std::equal( byte_array_in.begin(), byte_array_in.begin() + N, byte_array_out.begin() ) );
|
||||
item_type_converter_t converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(byte_array_out.data(), byte_array_in.data(), N);
|
||||
EXPECT_TRUE(std::equal(byte_array_in.begin(), byte_array_in.begin() + N, byte_array_out.begin()));
|
||||
|
||||
input_type = "cbyte";
|
||||
output_type = "ibyte";
|
||||
converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( byte_array_out.data(), byte_array_in.data(), N );
|
||||
EXPECT_TRUE( std::equal( byte_array_in.begin(), byte_array_in.begin() + N, byte_array_out.begin() ) );
|
||||
converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(byte_array_out.data(), byte_array_in.data(), N);
|
||||
EXPECT_TRUE(std::equal(byte_array_in.begin(), byte_array_in.begin() + N, byte_array_out.begin()));
|
||||
|
||||
input_type = "cbyte";
|
||||
output_type = "cshort";
|
||||
converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( short_array_out.data(), byte_array_in.data(), N );
|
||||
converter = make_vector_converter( output_type, input_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( byte_array_out.data(), short_array_out.data(), N );
|
||||
EXPECT_TRUE( std::equal( byte_array_out.begin(), byte_array_out.begin() + N, byte_array_in.begin() ) );
|
||||
converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(short_array_out.data(), byte_array_in.data(), N);
|
||||
converter = make_vector_converter(output_type, input_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(byte_array_out.data(), short_array_out.data(), N);
|
||||
EXPECT_TRUE(std::equal(byte_array_out.begin(), byte_array_out.begin() + N, byte_array_in.begin()));
|
||||
|
||||
input_type = "cbyte";
|
||||
output_type = "ishort";
|
||||
converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( short_array_out.data(), byte_array_in.data(), N );
|
||||
converter = make_vector_converter( output_type, input_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( byte_array_out.data(), short_array_out.data(), N );
|
||||
EXPECT_TRUE( std::equal( byte_array_out.begin(), byte_array_out.begin() + N, byte_array_in.begin() ) );
|
||||
converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(short_array_out.data(), byte_array_in.data(), N);
|
||||
converter = make_vector_converter(output_type, input_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(byte_array_out.data(), short_array_out.data(), N);
|
||||
EXPECT_TRUE(std::equal(byte_array_out.begin(), byte_array_out.begin() + N, byte_array_in.begin()));
|
||||
|
||||
input_type = "cbyte";
|
||||
output_type = "gr_complex";
|
||||
converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( float_array_out.data(), byte_array_in.data(), N );
|
||||
converter = make_vector_converter( output_type, input_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( byte_array_out.data(), float_array_out.data(), N );
|
||||
EXPECT_TRUE( std::equal( byte_array_out.begin(), byte_array_out.begin() + N, byte_array_in.begin() ) );
|
||||
converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(float_array_out.data(), byte_array_in.data(), N);
|
||||
converter = make_vector_converter(output_type, input_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(byte_array_out.data(), float_array_out.data(), N);
|
||||
EXPECT_TRUE(std::equal(byte_array_out.begin(), byte_array_out.begin() + N, byte_array_in.begin()));
|
||||
|
||||
input_type = "cshort";
|
||||
output_type = "cshort";
|
||||
converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( short_array_out.data(), short_array_in.data(), N );
|
||||
EXPECT_TRUE( std::equal( short_array_in.begin(), short_array_in.begin() + N, short_array_out.begin() ) );
|
||||
converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(short_array_out.data(), short_array_in.data(), N);
|
||||
EXPECT_TRUE(std::equal(short_array_in.begin(), short_array_in.begin() + N, short_array_out.begin()));
|
||||
|
||||
input_type = "cshort";
|
||||
output_type = "ishort";
|
||||
converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( short_array_out.data(), short_array_in.data(), N );
|
||||
EXPECT_TRUE( std::equal( short_array_in.begin(), short_array_in.begin() + N, short_array_out.begin() ) );
|
||||
converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(short_array_out.data(), short_array_in.data(), N);
|
||||
EXPECT_TRUE(std::equal(short_array_in.begin(), short_array_in.begin() + N, short_array_out.begin()));
|
||||
|
||||
input_type = "cshort";
|
||||
output_type = "gr_complex";
|
||||
converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( float_array_out.data(), short_array_in.data(), N );
|
||||
converter = make_vector_converter( output_type, input_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( short_array_out.data(), float_array_out.data(), N );
|
||||
EXPECT_TRUE( std::equal( short_array_out.begin(), short_array_out.begin() + N, short_array_in.begin() ) );
|
||||
converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(float_array_out.data(), short_array_in.data(), N);
|
||||
converter = make_vector_converter(output_type, input_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(short_array_out.data(), float_array_out.data(), N);
|
||||
EXPECT_TRUE(std::equal(short_array_out.begin(), short_array_out.begin() + N, short_array_in.begin()));
|
||||
|
||||
input_type = "gr_complex";
|
||||
output_type = "gr_complex";
|
||||
converter = make_vector_converter( input_type, output_type );
|
||||
EXPECT_NE( converter, nullptr);
|
||||
converter( float_array_out.data(), float_array_in.data(), N );
|
||||
EXPECT_TRUE( std::equal( float_array_in.begin(), float_array_in.begin() + N, float_array_out.begin() ) );
|
||||
converter = make_vector_converter(input_type, output_type);
|
||||
EXPECT_NE(converter, nullptr);
|
||||
converter(float_array_out.data(), float_array_in.data(), N);
|
||||
EXPECT_TRUE(std::equal(float_array_in.begin(), float_array_in.begin() + N, float_array_out.begin()));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user