mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-09-10 18:23:42 +08:00
cabana: move RoutesDialog out of streams/ (#38716)
This commit is contained in:
@@ -99,7 +99,7 @@ cabana_env.Command(assets, "assets/assets.qrc", f"rcc $SOURCES -o $TARGET")
|
||||
cabana_env.Depends(assets, Glob('/assets/*', exclude=[assets, "assets/assets.o"]))
|
||||
|
||||
cabana_srcs = ['mainwin.cc', 'streams/pandastream.cc', 'streams/devicestream.cc', 'streams/livestream.cc', 'streams/abstractstream.cc', 'streams/replaystream.cc', 'binaryview.cc', 'historylog.cc', 'videowidget.cc', 'signalview.cc',
|
||||
'streams/routes.cc', 'dbc/dbc.cc', 'dbc/dbcfile.cc', 'dbc/dbcmanager.cc',
|
||||
'routesdialog.cc', 'dbc/dbc.cc', 'dbc/dbcfile.cc', 'dbc/dbcmanager.cc',
|
||||
'utils/export.cc', 'utils/util.cc', 'utils/elidedlabel.cc',
|
||||
'chart/chartswidget.cc', 'chart/chart.cc', 'chart/signalselector.cc', 'chart/tiplabel.cc', 'chart/sparkline.cc',
|
||||
'commands.cc', 'messageswidget.cc', 'streamselector.cc', 'settings.cc', 'panda.cc',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "tools/cabana/streams/routes.h"
|
||||
#include "tools/cabana/routesdialog.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <ctime>
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <thread>
|
||||
#include <utility>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QFormLayout>
|
||||
#include <QListWidget>
|
||||
@@ -14,6 +13,7 @@
|
||||
#include <QPainter>
|
||||
|
||||
#include "json11/json11.hpp"
|
||||
#include "tools/cabana/utils/util.h"
|
||||
#include "tools/replay/py_downloader.h"
|
||||
|
||||
namespace {
|
||||
@@ -113,9 +113,9 @@ RoutesDialog::RoutesDialog(QWidget *parent) : QDialog(parent) {
|
||||
// Fetch devices
|
||||
std::thread([this, alive = std::weak_ptr<bool>(alive_)]() {
|
||||
std::string result = PyDownloader::getDevices();
|
||||
QMetaObject::invokeMethod(qApp, [this, alive, r = QString::fromStdString(result), response = checkApiResponse(result)]() {
|
||||
utils::runOnMainThread([this, alive, r = QString::fromStdString(result), response = checkApiResponse(result)]() {
|
||||
if (!alive.expired()) parseDeviceList(r, response.first, response.second);
|
||||
}, Qt::QueuedConnection);
|
||||
});
|
||||
}).detach();
|
||||
}
|
||||
|
||||
@@ -156,9 +156,9 @@ void RoutesDialog::fetchRoutes() {
|
||||
int request_id = ++fetch_id_;
|
||||
std::thread([this, alive = std::weak_ptr<bool>(alive_), did, start_ms, end_ms, preserved, request_id]() {
|
||||
std::string result = PyDownloader::getDeviceRoutes(did, start_ms, end_ms, preserved);
|
||||
QMetaObject::invokeMethod(qApp, [this, alive, r = QString::fromStdString(result), response = checkApiResponse(result), request_id]() {
|
||||
utils::runOnMainThread([this, alive, r = QString::fromStdString(result), response = checkApiResponse(result), request_id]() {
|
||||
if (!alive.expired() && fetch_id_ == request_id) parseRouteList(r, response.first, response.second);
|
||||
}, Qt::QueuedConnection);
|
||||
});
|
||||
}).detach();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "common/timing.h"
|
||||
#include "common/util.h"
|
||||
#include "tools/cabana/streams/routes.h"
|
||||
#include "tools/cabana/routesdialog.h"
|
||||
|
||||
ReplayStream::ReplayStream() {
|
||||
unsetenv("ZMQ");
|
||||
|
||||
Reference in New Issue
Block a user