X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdevices%2Fhardwaredevice.cpp;h=50cab7b09b7c6f2c63c63549c57f5491297baceb;hb=ab89256886a313bef5172191d3f8864415913012;hp=318ce1cab26fa61330563fbdd075a5ab510193be;hpb=2ad82c2e40b6865481733913a2c32735602f63c4;p=pulseview.git diff --git a/pv/devices/hardwaredevice.cpp b/pv/devices/hardwaredevice.cpp index 318ce1c..50cab7b 100644 --- a/pv/devices/hardwaredevice.cpp +++ b/pv/devices/hardwaredevice.cpp @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ #include @@ -28,7 +27,6 @@ #include "hardwaredevice.hpp" -using std::dynamic_pointer_cast; using std::shared_ptr; using std::static_pointer_cast; using std::string; @@ -41,8 +39,8 @@ using sigrok::HardwareDevice; namespace pv { namespace devices { -HardwareDevice::HardwareDevice(const std::shared_ptr &context, - std::shared_ptr device) : +HardwareDevice::HardwareDevice(const shared_ptr &context, + shared_ptr device) : context_(context), device_open_(false) { @@ -57,7 +55,9 @@ HardwareDevice::~HardwareDevice() string HardwareDevice::full_name() const { vector parts = {device_->vendor(), device_->model(), - device_->version(), device_->serial_number()}; + device_->version()}; + if (device_->serial_number().length() > 0) + parts.push_back("[S/N: " + device_->serial_number() + "]"); if (device_->connection_id().length() > 0) parts.push_back("(" + device_->connection_id() + ")"); return join(parts, " "); @@ -90,7 +90,7 @@ string HardwareDevice::display_name( if (multiple_dev) { parts.push_back(device_->version()); - parts.push_back(device_->serial_number()); + parts.push_back("[S/N: " + device_->serial_number() + "]"); if ((device_->serial_number().length() == 0) && (device_->connection_id().length() > 0))