Skip to content

Commit

Permalink
implement interfaceDetails label
Browse files Browse the repository at this point in the history
  • Loading branch information
HubertD committed May 17, 2016
1 parent cffbd0c commit 6ad02a9
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
7 changes: 6 additions & 1 deletion src/driver/CanInterface.cpp
Expand Up @@ -35,6 +35,11 @@ CanDriver* CanInterface::getDriver() {
return _driver;
}

QString CanInterface::getDetailsStr() const
{
return "";
}

uint32_t CanInterface::getCapabilities()
{
return 0;
Expand Down Expand Up @@ -80,7 +85,7 @@ QString CanInterface::getStateText()
}
}

CanInterfaceId CanInterface::getId()
CanInterfaceId CanInterface::getId() const
{
return _id;
}
Expand Down
3 changes: 2 additions & 1 deletion src/driver/CanInterface.h
Expand Up @@ -54,6 +54,7 @@ class CanInterface {
virtual ~CanInterface();
virtual CanDriver *getDriver();
virtual QString getName() const = 0;
virtual QString getDetailsStr() const;

virtual void applyConfig(const MeasurementInterface &mi) = 0;

Expand All @@ -79,7 +80,7 @@ class CanInterface {

QString getStateText();

CanInterfaceId getId();
CanInterfaceId getId() const;
void setId(CanInterfaceId id);

private:
Expand Down
9 changes: 7 additions & 2 deletions src/driver/CandleApiDriver/CandleApiInterface.cpp
Expand Up @@ -122,7 +122,12 @@ CandleApiInterface::~CandleApiInterface()

QString CandleApiInterface::getName() const
{
return "candle";
return "candle" + QString::number(getId() & 0xFF);
}

QString CandleApiInterface::getDetailsStr() const
{
return QString::fromStdWString(getPath());
}

void CandleApiInterface::applyConfig(const MeasurementInterface &mi)
Expand Down Expand Up @@ -386,7 +391,7 @@ int CandleApiInterface::getNumTxDropped()
return 0;
}

wstring CandleApiInterface::getPath()
wstring CandleApiInterface::getPath() const
{
return wstring(candle_dev_get_path(_handle));
}
Expand Down
5 changes: 4 additions & 1 deletion src/driver/CandleApiDriver/CandleApiInterface.h
Expand Up @@ -17,7 +17,10 @@ class CandleApiInterface : public CanInterface
public:
CandleApiInterface(CandleApiDriver *driver, candle_handle handle);
virtual ~CandleApiInterface();

virtual QString getName() const;
virtual QString getDetailsStr() const;

virtual void applyConfig(const MeasurementInterface &mi);

virtual int getBitrate();
Expand All @@ -40,7 +43,7 @@ class CandleApiInterface : public CanInterface
virtual int getNumRxOverruns();
virtual int getNumTxDropped();

wstring getPath();
wstring getPath() const;

void update(candle_handle dev);

Expand Down
1 change: 1 addition & 0 deletions src/driver/GenericCanSetupPage.cpp
Expand Up @@ -47,6 +47,7 @@ void GenericCanSetupPage::onShowInterfacePage(SetupDialog &dlg, MeasurementInter

ui->laDriver->setText(intf->getDriver()->getName());
ui->laInterface->setText(intf->getName());
ui->laInterfaceDetails->setText(intf->getDetailsStr());

fillBitratesList(intf, _mi->bitrate());
fillSamplePointsForBitrate(intf, _mi->bitrate(), _mi->samplePoint());
Expand Down
6 changes: 3 additions & 3 deletions src/driver/GenericCanSetupPage.ui
Expand Up @@ -31,7 +31,7 @@
<rect>
<x>120</x>
<y>9</y>
<width>47</width>
<width>490</width>
<height>16</height>
</rect>
</property>
Expand All @@ -57,7 +57,7 @@
<rect>
<x>120</x>
<y>28</y>
<width>47</width>
<width>490</width>
<height>16</height>
</rect>
</property>
Expand All @@ -83,7 +83,7 @@
<rect>
<x>120</x>
<y>47</y>
<width>47</width>
<width>490</width>
<height>16</height>
</rect>
</property>
Expand Down

0 comments on commit 6ad02a9

Please sign in to comment.