From 44a449ff8f0b7cdb71e67385e1bd9a098209045e Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Thu, 26 Oct 2017 22:28:50 +0200 Subject: Add more info to QCanBusDeviceInfo Added description, serial number and channel for SocketCAN, PeakCAN, SystecCAN, and VectorCAN plugins. For now, not all plugins do support all kind of information: SocketCAN: description and channel PeakCAN: description and channel (Windows PCANBasic >= 4.2.0) SystecCAN: description, serial number, and channel VectorCAN: description, serial number, and channel [ChangeLog][QCanBusDeviceInfo] Added description, serial number and channel to QCanBusDeviceInfo, as far as supported by the various plugins. Change-Id: Ib2292e06065eb91848f682ebf69a4cc968f4d4ba Reviewed-by: Rolf Eike Beer Reviewed-by: Alex Blasche --- examples/serialbus/can/connectdialog.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'examples/serialbus/can/connectdialog.cpp') diff --git a/examples/serialbus/can/connectdialog.cpp b/examples/serialbus/can/connectdialog.cpp index 5a12592..601ef2c 100644 --- a/examples/serialbus/can/connectdialog.cpp +++ b/examples/serialbus/can/connectdialog.cpp @@ -115,6 +115,12 @@ void ConnectDialog::interfaceChanged(const QString &interface) for (const QCanBusDeviceInfo &info : qAsConst(m_interfaces)) { if (info.name() == interface) { + m_ui->descriptionLabel->setText(info.description()); + QString serialNumber = info.serialNumber(); + if (serialNumber.isEmpty()) + serialNumber = tr("n/a"); + m_ui->serialNumberLabel->setText(tr("Serial: %1").arg(serialNumber)); + m_ui->channelLabel->setText(tr("Channel: %1").arg(info.channel())); m_ui->isVirtual->setChecked(info.isVirtual()); m_ui->isFlexibleDataRateCapable->setChecked(info.hasFlexibleDataRate()); break; -- cgit v1.2.3