21 #include <boost/algorithm/string/join.hpp>
25 #include <libsigrokcxx/libsigrokcxx.hpp>
31 using std::dynamic_pointer_cast;
32 using std::shared_ptr;
33 using std::static_pointer_cast;
37 using boost::algorithm::join;
39 using sigrok::HardwareDevice;
45 std::shared_ptr<sigrok::HardwareDevice> device) :
61 if (
device_->connection_id().length() > 0)
62 parts.push_back(
"(" +
device_->connection_id() +
")");
63 return join(parts,
" ");
68 return static_pointer_cast<sigrok::HardwareDevice>(
device_);
78 const auto &devices = device_manager.
devices();
79 const bool multiple_dev = hw_dev && any_of(
80 devices.begin(), devices.end(),
81 [&](shared_ptr<devices::HardwareDevice> dev) {
82 return dev->hardware_device()->vendor() ==
84 dev->hardware_device()->model() ==
92 parts.push_back(
device_->version());
93 parts.push_back(
device_->serial_number());
95 if ((
device_->serial_number().length() == 0) &&
96 (
device_->connection_id().length() > 0))
97 parts.push_back(
"(" +
device_->connection_id() +
")");
100 return join(parts,
" ");
110 }
catch (
const sigrok::Error &e) {
111 throw QString(e.what());
const std::list< std::shared_ptr< devices::HardwareDevice > > & devices() const
std::shared_ptr< sigrok::Device > device() const
std::shared_ptr< sigrok::Session > session_
std::string full_name() const
std::shared_ptr< sigrok::HardwareDevice > hardware_device() const
HardwareDevice(const std::shared_ptr< sigrok::Context > &context, std::shared_ptr< sigrok::HardwareDevice > device)
std::string display_name(const DeviceManager &device_manager) const
const std::shared_ptr< sigrok::Context > context_
std::shared_ptr< sigrok::Device > device_