mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-28 01:52:06 +08:00
Cabana: update detail view on change (#26476)
update on changed old-commit-hash: 4ef941e954198a6ed77b4d1cf9389cd621da6aac
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user