12 #include <boost/none.hpp>
13 #include <boost/optional.hpp>
20 namespace uhd {
namespace usrp {
namespace cal {
52 using sptr = std::shared_ptr<pwr_cal>;
70 const double min_power,
71 const double max_power,
73 const std::optional<int> temperature = {}) = 0;
77 const double min_power,
78 const double max_power,
80 const int temperature)
82 add_power_table(gain_power_map,
86 std::make_optional<int>(temperature));
89 [[deprecated(
"Prefer std::optional over boost::optional.")]]
void add_power_table(
90 const std::map<double, double>& gain_power_map,
91 const double min_power,
92 const double max_power,
94 const boost::optional<int> temperature)
96 add_power_table(gain_power_map,
100 bool(temperature) ? std::make_optional<int>(*temperature) : std::nullopt);
140 const double freq,
const std::optional<int> temperature = {})
const = 0;
145 return get_power_limits(freq, std::make_optional<int>(temperature));
151 return get_power_limits(freq,
152 bool(temperature) ? std::make_optional<int>(*temperature) : std::nullopt);
168 const std::optional<int> temperature = {})
const = 0;
170 double get_power(
const double gain,
const double freq,
const int temperature)
const
172 return get_power(gain, freq, std::make_optional<int>(temperature));
175 [[deprecated(
"Prefer std::optional over boost::optional.")]]
double get_power(
178 const boost::optional<int> temperature)
const
180 return get_power(gain,
182 bool(temperature) ? std::make_optional<int>(*temperature) : std::nullopt);
202 const std::optional<int> temperature = {})
const = 0;
205 const double power_dbm,
const double freq,
const int temperature)
const
207 return get_gain(power_dbm, freq, std::make_optional<int>(temperature));
210 [[deprecated(
"Prefer std::optional over boost::optional.")]]
double get_gain(
211 const double power_dbm,
213 const boost::optional<int> temperature)
const
215 return get_gain(power_dbm,
217 bool(temperature) ? std::make_optional<int>(*temperature) : std::nullopt);
222 const std::string& name,
const std::string& serial,
const uint64_t timestamp);
Definition: container.hpp:23
Definition: pwr_cal.hpp:50
static sptr make(const std::string &name, const std::string &serial, const uint64_t timestamp)
Factory for new cal data sets.
static sptr make()
Default factory.
virtual void set_ref_gain(const double gain)=0
virtual void set_temperature(const int temperature)=0
double get_power(const double gain, const double freq, const boost::optional< int > temperature) const
Definition: pwr_cal.hpp:175
virtual int get_temperature() const =0
Return the current default temperature.
virtual double get_ref_gain() const =0
double get_gain(const double power_dbm, const double freq, const int temperature) const
Definition: pwr_cal.hpp:204
virtual double get_power(const double gain, const double freq, const std::optional< int > temperature={}) const =0
virtual void add_power_table(const std::map< double, double > &gain_power_map, const double min_power, const double max_power, const double freq, const std::optional< int > temperature={})=0
uhd::meta_range_t get_power_limits(const double freq, const boost::optional< int > temperature) const
Definition: pwr_cal.hpp:149
double get_gain(const double power_dbm, const double freq, const boost::optional< int > temperature) const
Definition: pwr_cal.hpp:210
std::shared_ptr< pwr_cal > sptr
Definition: pwr_cal.hpp:52
void add_power_table(const std::map< double, double > &gain_power_map, const double min_power, const double max_power, const double freq, const int temperature)
Definition: pwr_cal.hpp:76
virtual uhd::meta_range_t get_power_limits(const double freq, const std::optional< int > temperature={}) const =0
uhd::meta_range_t get_power_limits(const double freq, const int temperature) const
Definition: pwr_cal.hpp:143
void add_power_table(const std::map< double, double > &gain_power_map, const double min_power, const double max_power, const double freq, const boost::optional< int > temperature)
Definition: pwr_cal.hpp:89
double get_power(const double gain, const double freq, const int temperature) const
Definition: pwr_cal.hpp:170
virtual double get_gain(const double power_dbm, const double freq, const std::optional< int > temperature={}) const =0
#define UHD_API
Definition: config.h:87
Definition: build_info.hpp:12