|
|
@ -59,12 +59,19 @@ FindSimilarBitsDlg::FindSimilarBitsDlg(QWidget *parent) : QDialog(parent) { |
|
|
|
main_layout->addLayout(form_layout); |
|
|
|
main_layout->addLayout(form_layout); |
|
|
|
|
|
|
|
|
|
|
|
table = new QTableWidget(this); |
|
|
|
table = new QTableWidget(this); |
|
|
|
|
|
|
|
table->setSelectionBehavior(QAbstractItemView::SelectRows); |
|
|
|
|
|
|
|
table->setSelectionMode(QAbstractItemView::SingleSelection); |
|
|
|
table->setEditTriggers(QAbstractItemView::NoEditTriggers); |
|
|
|
table->setEditTriggers(QAbstractItemView::NoEditTriggers); |
|
|
|
table->horizontalHeader()->setStretchLastSection(true); |
|
|
|
table->horizontalHeader()->setStretchLastSection(true); |
|
|
|
main_layout->addWidget(table); |
|
|
|
main_layout->addWidget(table); |
|
|
|
|
|
|
|
|
|
|
|
setMinimumSize({700, 500}); |
|
|
|
setMinimumSize({700, 500}); |
|
|
|
QObject::connect(search_btn, &QPushButton::clicked, this, &FindSimilarBitsDlg::find); |
|
|
|
QObject::connect(search_btn, &QPushButton::clicked, this, &FindSimilarBitsDlg::find); |
|
|
|
|
|
|
|
QObject::connect(table, &QTableWidget::doubleClicked, [this](const QModelIndex &index) { |
|
|
|
|
|
|
|
if (index.isValid()) { |
|
|
|
|
|
|
|
emit openMessage(bus_combo->currentText() + ":" + table->item(index.row(), 0)->text()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void FindSimilarBitsDlg::find() { |
|
|
|
void FindSimilarBitsDlg::find() { |
|
|
@ -91,7 +98,6 @@ QList<FindSimilarBitsDlg::mismatched_struct> FindSimilarBitsDlg::calcBits(uint8_ |
|
|
|
QHash<uint32_t, QVector<uint32_t>> mismatches; |
|
|
|
QHash<uint32_t, QVector<uint32_t>> mismatches; |
|
|
|
QHash<uint32_t, uint32_t> msg_count; |
|
|
|
QHash<uint32_t, uint32_t> msg_count; |
|
|
|
auto events = can->events(); |
|
|
|
auto events = can->events(); |
|
|
|
qDebug() << bus << selected_address << byte_idx << bit_idx; |
|
|
|
|
|
|
|
int bit_to_find = -1; |
|
|
|
int bit_to_find = -1; |
|
|
|
for (auto e : *events) { |
|
|
|
for (auto e : *events) { |
|
|
|
if (e->which == cereal::Event::Which::CAN) { |
|
|
|
if (e->which == cereal::Event::Which::CAN) { |
|
|
|