diff --git a/bcdevicepanel.cpp b/bcdevicepanel.cpp index 55c9c4d..b969cf9 100644 --- a/bcdevicepanel.cpp +++ b/bcdevicepanel.cpp @@ -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 ); } /* diff --git a/bcdevicepanel.h b/bcdevicepanel.h index 78a7942..7ddfb97 100644 --- a/bcdevicepanel.h +++ b/bcdevicepanel.h @@ -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; + }; diff --git a/bcmainwindow.cpp b/bcmainwindow.cpp index 949639e..2f70b2a 100644 --- a/bcmainwindow.cpp +++ b/bcmainwindow.cpp @@ -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. diff --git a/bcmainwindow.ui b/bcmainwindow.ui index 9a09512..a6cb7ad 100644 --- a/bcmainwindow.ui +++ b/bcmainwindow.ui @@ -21,7 +21,7 @@ background-color: grey; - + @@ -40,7 +40,7 @@ - + @@ -59,7 +59,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -110,14 +110,14 @@ - + Sync - + Connect