projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
HardwareDevice: Make serial number display a bit clearer.
[pulseview.git]
/
pv
/
devices
/
hardwaredevice.cpp
diff --git
a/pv/devices/hardwaredevice.cpp
b/pv/devices/hardwaredevice.cpp
index 318ce1cab26fa61330563fbdd075a5ab510193be..50cab7b09b7c6f2c63c63549c57f5491297baceb 100644
(file)
--- 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
* 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 <http://www.gnu.org/licenses/>.
*/
#include <boost/algorithm/string/join.hpp>
*/
#include <boost/algorithm/string/join.hpp>
@@
-28,7
+27,6
@@
#include "hardwaredevice.hpp"
#include "hardwaredevice.hpp"
-using std::dynamic_pointer_cast;
using std::shared_ptr;
using std::static_pointer_cast;
using std::string;
using std::shared_ptr;
using std::static_pointer_cast;
using std::string;
@@
-41,8
+39,8
@@
using sigrok::HardwareDevice;
namespace pv {
namespace devices {
namespace pv {
namespace devices {
-HardwareDevice::HardwareDevice(const s
td::s
hared_ptr<sigrok::Context> &context,
- s
td::s
hared_ptr<sigrok::HardwareDevice> device) :
+HardwareDevice::HardwareDevice(const shared_ptr<sigrok::Context> &context,
+ shared_ptr<sigrok::HardwareDevice> device) :
context_(context),
device_open_(false)
{
context_(context),
device_open_(false)
{
@@
-57,7
+55,9
@@
HardwareDevice::~HardwareDevice()
string HardwareDevice::full_name() const
{
vector<string> parts = {device_->vendor(), device_->model(),
string HardwareDevice::full_name() const
{
vector<string> 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, " ");
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());
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))
if ((device_->serial_number().length() == 0) &&
(device_->connection_id().length() > 0))