cabana: fix missing opendbc files (#30555)

* fix missing dbc files

* remove suffix
old-commit-hash: d87191c1c1982e5c044e5654d7a69c5cc222986c
This commit is contained in:
Dean Lee
2023-12-01 12:46:31 +08:00
committed by GitHub
parent cf9ed48dfb
commit b01e3fe986
2 changed files with 5 additions and 4 deletions

View File

@@ -77,9 +77,10 @@ void MainWindow::loadFingerprints() {
QFile json_file(QApplication::applicationDirPath() + "/dbc/car_fingerprint_to_dbc.json");
if (json_file.open(QIODevice::ReadOnly)) {
fingerprint_to_dbc = QJsonDocument::fromJson(json_file.readAll());
auto dbc_names = fingerprint_to_dbc.object().toVariantMap().values();
std::transform(dbc_names.begin(), dbc_names.end(), std::inserter(opendbc_names, opendbc_names.begin()),
[](const auto &name) { return name.toString(); });
}
// get opendbc names
for (auto fn : QDir(OPENDBC_FILE_PATH).entryList({"*.dbc"}, QDir::Files, QDir::Name)) {
opendbc_names << QFileInfo(fn).baseName();
}
}

View File

@@ -86,7 +86,7 @@ protected:
QProgressBar *progress_bar;
QLabel *status_label;
QJsonDocument fingerprint_to_dbc;
std::set<QString> opendbc_names;
QStringList opendbc_names;
QSplitter *video_splitter = nullptr;
enum { MAX_RECENT_FILES = 15 };
QAction *recent_files_acts[MAX_RECENT_FILES] = {};