This commit is contained in:
2025-12-29 00:04:15 +01:00
parent b7d4441d56
commit d435ac17a3
5 changed files with 33 additions and 37 deletions

View File

@@ -68,10 +68,10 @@ public:
{
_opacity = opacity;
//qDebug() << " --- opa: " << opacity;
// __fix! unsinn!
emit viewUpdateNeeded();
}
void clearAllHighlights();
public slots:

View File

@@ -30,14 +30,17 @@
***************************************************************************/
#include <_mingw_mac.h>
#include <bcdevicepanel.h>
#include <bcdelegate.h>
BCDevicePanel::BCDevicePanel(QWidget *parent)
: QWidget(parent)
{
setupUi(this);
_valueView->setModel( &_valueModel );
//_valueView->resizeColumnsToContents();
_valueView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
_valueView->setItemDelegate( new BCDelegate( _valueView) );
}
@@ -56,6 +59,7 @@ void BCDevicePanel::setDeviceID( BCDevice::ID deviceID )
{
_devideID = deviceID;
}
BCDevice::ID BCDevicePanel::getDeviceID() const
{
return _devideID;
@@ -64,24 +68,7 @@ BCDevice::ID BCDevicePanel::getDeviceID() const
QTableView* BCDevicePanel::getValueView()
{
//valueModel;
return _valueView;
// Die Daten und auch die Datenmodelle für die Views werden
// vom DataManager verwaltet und an die Views weitergereicht.
//auto model = _dataManager.getModel( BCDevice::ID::Console );
//_consolePanel->getValueView()->setModel( model.v );
/*
if( model)
{
_valueView->setModel( *model );
_valueView->resizeColumnsToContents();
//_valueView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
}
*/
}
const BCValueList& BCDevicePanel::getValueListX()
@@ -104,10 +91,3 @@ void BCDevicePanel::onValueListReady( BCDevice::ID deviceID, BCValueList valueLi
/*
QTableView* BCDevicePanel::setValueView()
{
return _valueView;
}
*/

View File

@@ -13,6 +13,9 @@
<property name="windowTitle">
<string>Form</string>
</property>
<property name="styleSheet">
<string notr="true">background-color:green;</string>
</property>
<property name="headerText" stdset="0">
<string>Fitze!</string>
</property>
@@ -32,6 +35,12 @@
</item>
<item>
<widget class="QTableView" name="_valueView">
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color:#0000ff</string>
</property>
<property name="frameShape">
<enum>QFrame::Shape::NoFrame</enum>
</property>
@@ -53,9 +62,15 @@
<property name="showGrid">
<bool>false</bool>
</property>
<property name="gridStyle">
<enum>Qt::PenStyle::NoPen</enum>
</property>
<attribute name="horizontalHeaderVisible">
<bool>true</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
</widget>
</item>
</layout>

View File

@@ -137,11 +137,8 @@ void BCMainWindow::initMainWindow()
//_delegate->onHighlightRow(2); // 2 Sekunden Fade
BCTransmitter* transmitter = _dataManager.getTransmitter();
// besser: model::emit dataChanged
// also: emit dataChanged(index, index, {Qt::DisplayRole, Qt::EditRole, ValueRole});
connect( &_dataManager, &BCMainWindow::valueTouched, _delegate, &BCDelegate::onHighlightRow );
connect( _connectButton, &QPushButton::clicked, transmitter, &BCTransmitter::onToggleConnectionState );
connect( _syncButton, &QPushButton::clicked, &_dataManager, &BCMainWindow::onSyncFromDevice );
*/
//_delegate->onHighlightRow(2); // 2 Sekunden Fade
@@ -150,6 +147,7 @@ void BCMainWindow::initMainWindow()
//connect( &_dataManager, &BCMainWindow::valueTouched, _delegate, &BCDelegate::onHighlightRow );
connect( _connectButton, &QPushButton::clicked, &_transmitter, &BCTransmitter::onToggleConnectionState );
connect( _syncButton, &QPushButton::clicked, this, &BCMainWindow::onSyncFromDevice );
connect( &_transmitter, &BCTransmitter::valueUpdated, this, &BCMainWindow::onValueUpdated );
// die Daten des eBikes laden
@@ -241,7 +239,7 @@ void BCMainWindow::onRunnerMessage(const QString &msg)
// __fix move this to devicePanel
// __fix move this to devicePanel??
void BCMainWindow::onSyncFromDevice()
{
@@ -262,14 +260,11 @@ void BCMainWindow::onSyncFromDevice()
//_transmitter.enqueueValueCommand( value );
emit sendValueCommand( BC::OpID::ReadValue, &value);
emit valueTouched( value.indexRow );
bc::processEventsFor(500);
//QApplication::processEvents();
// Thread schlafen lassen (Simulation einer blockierenden Operation)
//QThread::msleep(500);
}

View File

@@ -138,8 +138,14 @@
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: hotpink;</string>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="BCDevicePanel" name="_consolePanel"/>
<widget class="BCDevicePanel" name="_motorPanel"/>