summaryrefslogtreecommitdiffstats
path: root/examples/serialbus
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2017-10-26 22:28:50 +0200
committerAndré Hartmann <aha_1980@gmx.de>2018-01-12 06:56:45 +0000
commit44a449ff8f0b7cdb71e67385e1bd9a098209045e (patch)
tree3860802a1afff79563970166f4739a6b187f265e /examples/serialbus
parentdf9735fc1660dd40730693f08f6e046a5e01deb3 (diff)
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 <eb@emlix.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples/serialbus')
-rw-r--r--examples/serialbus/can/connectdialog.cpp6
-rw-r--r--examples/serialbus/can/connectdialog.ui25
2 files changed, 29 insertions, 2 deletions
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;
diff --git a/examples/serialbus/can/connectdialog.ui b/examples/serialbus/can/connectdialog.ui
index def6e59..6d4f261 100644
--- a/examples/serialbus/can/connectdialog.ui
+++ b/examples/serialbus/can/connectdialog.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>441</width>
- <height>341</height>
+ <width>446</width>
+ <height>395</height>
</rect>
</property>
<property name="windowTitle">
@@ -192,6 +192,27 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
+ <widget class="QLabel" name="descriptionLabel">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="serialNumberLabel">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="channelLabel">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QCheckBox" name="isFlexibleDataRateCapable">
<property name="text">
<string>Flexible Data Rate</string>