mirror of https://github.com/commaai/openpilot.git
Cabana: update detail view on change (#26476)
update on changed
old-commit-hash: 4ef941e954
This commit is contained in:
parent
69d3a5f4ba
commit
27e79880ab
|
@ -89,7 +89,7 @@ DetailWidget::DetailWidget(ChartsWidget *charts, QWidget *parent) : charts(chart
|
|||
|
||||
QObject::connect(binary_view, &BinaryView::resizeSignal, this, &DetailWidget::resizeSignal);
|
||||
QObject::connect(binary_view, &BinaryView::addSignal, this, &DetailWidget::addSignal);
|
||||
QObject::connect(can, &CANMessages::updated, this, &DetailWidget::updateState);
|
||||
QObject::connect(can, &CANMessages::msgsReceived, this, &DetailWidget::updateState);
|
||||
QObject::connect(dbc(), &DBCManager::DBCFileChanged, [this]() { dbcMsgChanged(); });
|
||||
QObject::connect(tabbar, &QTabBar::customContextMenuRequested, this, &DetailWidget::showTabBarContextMenu);
|
||||
QObject::connect(tabbar, &QTabBar::currentChanged, [this](int index) {
|
||||
|
@ -179,9 +179,10 @@ void DetailWidget::dbcMsgChanged(int show_form_idx) {
|
|||
QTimer::singleShot(1, [this]() { setUpdatesEnabled(true); });
|
||||
}
|
||||
|
||||
void DetailWidget::updateState() {
|
||||
void DetailWidget::updateState(const QHash<QString, CanData> * msgs) {
|
||||
time_label->setText(QString::number(can->currentSec(), 'f', 3));
|
||||
if (msg_id.isEmpty()) return;
|
||||
if (!msgs->contains(msg_id))
|
||||
return;
|
||||
|
||||
binary_view->updateState();
|
||||
history_log->updateState();
|
||||
|
|
|
@ -36,7 +36,7 @@ private:
|
|||
void removeSignal(const Signal *sig);
|
||||
void editMsg();
|
||||
void removeMsg();
|
||||
void updateState();
|
||||
void updateState(const QHash<QString, CanData> * msgs);
|
||||
|
||||
QString msg_id;
|
||||
QLabel *name_label, *time_label, *warning_label;
|
||||
|
|
Loading…
Reference in New Issue