Added device filter.

This commit is contained in:
2025-12-27 19:49:41 +01:00
parent 139397f045
commit 84e79c8c17
4 changed files with 27 additions and 16 deletions

View File

@@ -46,11 +46,21 @@ void BCDevicePanel::setHeaderText( const QString& headerText)
_headerLabel->setText( headerText );
}
QString BCDevicePanel::getHeaderText()
QString BCDevicePanel::getHeaderText() const
{
return _headerLabel->text();
}
void BCDevicePanel::setDeviceID( BCDevice::ID deviceID )
{
_devideID = deviceID;
}
BCDevice::ID BCDevicePanel::getDeviceID() const
{
return _devideID;
}
QTableView* BCDevicePanel::getValueView()
{
//valueModel;
@@ -73,15 +83,11 @@ QTableView* BCDevicePanel::getValueView()
}
BCValueList& BCDevicePanel::exposeValueList()
{
return _myTmpList;
}
void BCDevicePanel::onValueListReady( BCDevice::ID deviceID, BCValueList valueList )
{
qDebug() << " --- onValueListReady: " << getHeaderText() <<" : " << deviceID << ": " << valueList.size();
_valueModel.setValueList( valueList );
if(_devideID == deviceID)
_valueModel.setValueList( valueList );
}
/*

View File

@@ -46,7 +46,10 @@ public:
explicit BCDevicePanel(QWidget *parent = nullptr);
void setHeaderText( const QString& headerText);
QString getHeaderText();
QString getHeaderText() const;
void setDeviceID( BCDevice::ID deviceID );
BCDevice::ID getDeviceID() const;
BCValueList& exposeValueList();
@@ -58,8 +61,9 @@ public slots:
protected:
BCDevice::ID _devideID{BCDevice::ID::Invalid};
BCValueModel _valueModel;
BCValueList _myTmpList;
};

View File

@@ -97,7 +97,8 @@ void BCMainWindow::initData()
BCDevicePanel* currentPanel = _devicePanels[deviceID];
// den Panels ihren title geben
currentPanel->setHeaderText( panelTitle );
// ... und ihre device ID
currentPanel->setDeviceID( deviceID );
// Wenn ein Device (entspricht einem Datenmodel) fertig eingelesen wurde,
// wird es weitergereicht.
// Problem: alle Panels bekommen alle Datenmodelle angeboten.

View File

@@ -21,7 +21,7 @@
<string notr="true">background-color: grey;</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<item alignment="Qt::AlignmentFlag::AlignHCenter">
<widget class="BCToolButton" name="_motorButton">
<property name="minimumSize">
<size>
@@ -40,7 +40,7 @@
</property>
</widget>
</item>
<item>
<item alignment="Qt::AlignmentFlag::AlignHCenter">
<widget class="BCToolButton" name="_batteryButton">
<property name="minimumSize">
<size>
@@ -59,7 +59,7 @@
</property>
</widget>
</item>
<item>
<item alignment="Qt::AlignmentFlag::AlignHCenter">
<widget class="BCToolButton" name="_consoleButton">
<property name="minimumSize">
<size>
@@ -78,7 +78,7 @@
</property>
</widget>
</item>
<item>
<item alignment="Qt::AlignmentFlag::AlignHCenter">
<widget class="BCToolButton" name="_pimpButton">
<property name="minimumSize">
<size>
@@ -110,14 +110,14 @@
</property>
</spacer>
</item>
<item>
<item alignment="Qt::AlignmentFlag::AlignHCenter">
<widget class="QPushButton" name="_syncButton">
<property name="text">
<string>Sync</string>
</property>
</widget>
</item>
<item>
<item alignment="Qt::AlignmentFlag::AlignHCenter">
<widget class="QPushButton" name="_connectButton">
<property name="text">
<string>Connect</string>