user event flagging (#25517)
* setup home_btn in sidebar * create UserFlag msg * replay: show and skip to user flags * update translations * bump to cereal master * remove comment Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> old-commit-hash: b3cfe962cf346e70cce1389fe3c9bf23344a5512
This commit is contained in:
2
cereal
2
cereal
Submodule cereal updated: ecff0a284a...589ef049a7
@@ -33,7 +33,7 @@ void Sidebar::drawMetric(QPainter &p, const QPair<QString, QString> &label, QCol
|
||||
}
|
||||
|
||||
Sidebar::Sidebar(QWidget *parent) : QFrame(parent) {
|
||||
home_img = loadPixmap("../assets/images/button_home.png", {180, 180});
|
||||
home_img = loadPixmap("../assets/images/button_home.png", home_btn.size());
|
||||
settings_img = loadPixmap("../assets/images/button_settings.png", settings_btn.size(), Qt::IgnoreAspectRatio);
|
||||
|
||||
connect(this, &Sidebar::valueChanged, [=] { update(); });
|
||||
@@ -43,9 +43,16 @@ Sidebar::Sidebar(QWidget *parent) : QFrame(parent) {
|
||||
setFixedWidth(300);
|
||||
|
||||
QObject::connect(uiState(), &UIState::uiUpdate, this, &Sidebar::updateState);
|
||||
|
||||
pm = std::make_unique<PubMaster, const std::initializer_list<const char *>>({"userFlag"});
|
||||
}
|
||||
|
||||
void Sidebar::mouseReleaseEvent(QMouseEvent *event) {
|
||||
if (home_btn.contains(event->pos())) {
|
||||
MessageBuilder msg;
|
||||
msg.initEvent().initUserFlag();
|
||||
pm->send("userFlag", msg);
|
||||
}
|
||||
if (settings_btn.contains(event->pos())) {
|
||||
emit openSettings();
|
||||
}
|
||||
@@ -99,7 +106,7 @@ void Sidebar::paintEvent(QPaintEvent *event) {
|
||||
p.setOpacity(0.65);
|
||||
p.drawPixmap(settings_btn.x(), settings_btn.y(), settings_img);
|
||||
p.setOpacity(1.0);
|
||||
p.drawPixmap(60, 1080 - 180 - 40, home_img);
|
||||
p.drawPixmap(home_btn.x(), home_btn.y(), home_img);
|
||||
|
||||
// network
|
||||
int x = 58;
|
||||
|
||||
@@ -43,6 +43,7 @@ protected:
|
||||
{cereal::DeviceState::NetworkType::CELL5_G, tr("5G")}
|
||||
};
|
||||
|
||||
const QRect home_btn = QRect(60, 860, 180, 180);
|
||||
const QRect settings_btn = QRect(50, 35, 200, 117);
|
||||
const QColor good_color = QColor(255, 255, 255);
|
||||
const QColor warning_color = QColor(218, 202, 37);
|
||||
@@ -52,4 +53,7 @@ protected:
|
||||
ItemStatus connect_status, panda_status, temp_status;
|
||||
QString net_type;
|
||||
int net_strength = 0;
|
||||
|
||||
private:
|
||||
std::unique_ptr<PubMaster> pm;
|
||||
};
|
||||
|
||||
@@ -876,71 +876,71 @@ location set</source>
|
||||
<context>
|
||||
<name>Sidebar</name>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="67"/>
|
||||
<location filename="../qt/sidebar.cc" line="69"/>
|
||||
<location filename="../qt/sidebar.cc" line="75"/>
|
||||
<location filename="../qt/sidebar.cc" line="77"/>
|
||||
<source>CONNECT</source>
|
||||
<translation>接続</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="67"/>
|
||||
<location filename="../qt/sidebar.cc" line="75"/>
|
||||
<source>OFFLINE</source>
|
||||
<translation>オフライン</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="69"/>
|
||||
<location filename="../qt/sidebar.cc" line="82"/>
|
||||
<location filename="../qt/sidebar.cc" line="77"/>
|
||||
<location filename="../qt/sidebar.cc" line="90"/>
|
||||
<source>ONLINE</source>
|
||||
<translation>オンライン</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="69"/>
|
||||
<location filename="../qt/sidebar.cc" line="77"/>
|
||||
<source>ERROR</source>
|
||||
<translation>エラー</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="73"/>
|
||||
<location filename="../qt/sidebar.cc" line="76"/>
|
||||
<location filename="../qt/sidebar.cc" line="78"/>
|
||||
<location filename="../qt/sidebar.cc" line="81"/>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<source>TEMP</source>
|
||||
<translation>温度</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="73"/>
|
||||
<location filename="../qt/sidebar.cc" line="81"/>
|
||||
<source>HIGH</source>
|
||||
<translation>高温</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="76"/>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<source>GOOD</source>
|
||||
<translation>最適</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="78"/>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<source>OK</source>
|
||||
<translation>OK</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="82"/>
|
||||
<location filename="../qt/sidebar.cc" line="90"/>
|
||||
<source>VEHICLE</source>
|
||||
<translation>車両</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<location filename="../qt/sidebar.cc" line="92"/>
|
||||
<source>NO</source>
|
||||
<translation>NO</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<location filename="../qt/sidebar.cc" line="92"/>
|
||||
<source>PANDA</source>
|
||||
<translation>PANDA</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<location filename="../qt/sidebar.cc" line="94"/>
|
||||
<source>GPS</source>
|
||||
<translation>GPS</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<location filename="../qt/sidebar.cc" line="94"/>
|
||||
<source>SEARCH</source>
|
||||
<translation>検索</translation>
|
||||
</message>
|
||||
|
||||
@@ -876,71 +876,71 @@ location set</source>
|
||||
<context>
|
||||
<name>Sidebar</name>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="67"/>
|
||||
<location filename="../qt/sidebar.cc" line="69"/>
|
||||
<location filename="../qt/sidebar.cc" line="75"/>
|
||||
<location filename="../qt/sidebar.cc" line="77"/>
|
||||
<source>CONNECT</source>
|
||||
<translation>연결</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="67"/>
|
||||
<location filename="../qt/sidebar.cc" line="75"/>
|
||||
<source>OFFLINE</source>
|
||||
<translation>오프라인</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="69"/>
|
||||
<location filename="../qt/sidebar.cc" line="82"/>
|
||||
<location filename="../qt/sidebar.cc" line="77"/>
|
||||
<location filename="../qt/sidebar.cc" line="90"/>
|
||||
<source>ONLINE</source>
|
||||
<translation>온라인</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="69"/>
|
||||
<location filename="../qt/sidebar.cc" line="77"/>
|
||||
<source>ERROR</source>
|
||||
<translation>오류</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="73"/>
|
||||
<location filename="../qt/sidebar.cc" line="76"/>
|
||||
<location filename="../qt/sidebar.cc" line="78"/>
|
||||
<location filename="../qt/sidebar.cc" line="81"/>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<source>TEMP</source>
|
||||
<translation>온도</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="73"/>
|
||||
<location filename="../qt/sidebar.cc" line="81"/>
|
||||
<source>HIGH</source>
|
||||
<translation>높음</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="76"/>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<source>GOOD</source>
|
||||
<translation>좋음</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="78"/>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<source>OK</source>
|
||||
<translation>경고</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="82"/>
|
||||
<location filename="../qt/sidebar.cc" line="90"/>
|
||||
<source>VEHICLE</source>
|
||||
<translation>차량</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<location filename="../qt/sidebar.cc" line="92"/>
|
||||
<source>NO</source>
|
||||
<translation>NO</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<location filename="../qt/sidebar.cc" line="92"/>
|
||||
<source>PANDA</source>
|
||||
<translation>PANDA</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<location filename="../qt/sidebar.cc" line="94"/>
|
||||
<source>GPS</source>
|
||||
<translation>GPS</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<location filename="../qt/sidebar.cc" line="94"/>
|
||||
<source>SEARCH</source>
|
||||
<translation>검색중</translation>
|
||||
</message>
|
||||
|
||||
@@ -880,71 +880,71 @@ trabalho definido</translation>
|
||||
<context>
|
||||
<name>Sidebar</name>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="67"/>
|
||||
<location filename="../qt/sidebar.cc" line="69"/>
|
||||
<location filename="../qt/sidebar.cc" line="75"/>
|
||||
<location filename="../qt/sidebar.cc" line="77"/>
|
||||
<source>CONNECT</source>
|
||||
<translation>CONEXÃO</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="67"/>
|
||||
<location filename="../qt/sidebar.cc" line="75"/>
|
||||
<source>OFFLINE</source>
|
||||
<translation>DESCONEC</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="69"/>
|
||||
<location filename="../qt/sidebar.cc" line="82"/>
|
||||
<location filename="../qt/sidebar.cc" line="77"/>
|
||||
<location filename="../qt/sidebar.cc" line="90"/>
|
||||
<source>ONLINE</source>
|
||||
<translation>CONECTADO</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="69"/>
|
||||
<location filename="../qt/sidebar.cc" line="77"/>
|
||||
<source>ERROR</source>
|
||||
<translation>ERRO</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="73"/>
|
||||
<location filename="../qt/sidebar.cc" line="76"/>
|
||||
<location filename="../qt/sidebar.cc" line="78"/>
|
||||
<location filename="../qt/sidebar.cc" line="81"/>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<source>TEMP</source>
|
||||
<translation>TEMP</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="73"/>
|
||||
<location filename="../qt/sidebar.cc" line="81"/>
|
||||
<source>HIGH</source>
|
||||
<translation>ALTA</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="76"/>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<source>GOOD</source>
|
||||
<translation>BOA</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="78"/>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<source>OK</source>
|
||||
<translation>OK</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="82"/>
|
||||
<location filename="../qt/sidebar.cc" line="90"/>
|
||||
<source>VEHICLE</source>
|
||||
<translation>VEÍCULO</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<location filename="../qt/sidebar.cc" line="92"/>
|
||||
<source>NO</source>
|
||||
<translation>SEM</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<location filename="../qt/sidebar.cc" line="92"/>
|
||||
<source>PANDA</source>
|
||||
<translation>PANDA</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<location filename="../qt/sidebar.cc" line="94"/>
|
||||
<source>GPS</source>
|
||||
<translation>GPS</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<location filename="../qt/sidebar.cc" line="94"/>
|
||||
<source>SEARCH</source>
|
||||
<translation>PROCURA</translation>
|
||||
</message>
|
||||
|
||||
@@ -874,71 +874,71 @@ location set</source>
|
||||
<context>
|
||||
<name>Sidebar</name>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="67"/>
|
||||
<location filename="../qt/sidebar.cc" line="69"/>
|
||||
<location filename="../qt/sidebar.cc" line="75"/>
|
||||
<location filename="../qt/sidebar.cc" line="77"/>
|
||||
<source>CONNECT</source>
|
||||
<translation>CONNECT</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="67"/>
|
||||
<location filename="../qt/sidebar.cc" line="75"/>
|
||||
<source>OFFLINE</source>
|
||||
<translation>离线</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="69"/>
|
||||
<location filename="../qt/sidebar.cc" line="82"/>
|
||||
<location filename="../qt/sidebar.cc" line="77"/>
|
||||
<location filename="../qt/sidebar.cc" line="90"/>
|
||||
<source>ONLINE</source>
|
||||
<translation>在线</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="69"/>
|
||||
<location filename="../qt/sidebar.cc" line="77"/>
|
||||
<source>ERROR</source>
|
||||
<translation>连接出错</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="73"/>
|
||||
<location filename="../qt/sidebar.cc" line="76"/>
|
||||
<location filename="../qt/sidebar.cc" line="78"/>
|
||||
<location filename="../qt/sidebar.cc" line="81"/>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<source>TEMP</source>
|
||||
<translation>设备温度</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="73"/>
|
||||
<location filename="../qt/sidebar.cc" line="81"/>
|
||||
<source>HIGH</source>
|
||||
<translation>过热</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="76"/>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<source>GOOD</source>
|
||||
<translation>良好</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="78"/>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<source>OK</source>
|
||||
<translation>一般</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="82"/>
|
||||
<location filename="../qt/sidebar.cc" line="90"/>
|
||||
<source>VEHICLE</source>
|
||||
<translation>车辆连接</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<location filename="../qt/sidebar.cc" line="92"/>
|
||||
<source>NO</source>
|
||||
<translation>无</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<location filename="../qt/sidebar.cc" line="92"/>
|
||||
<source>PANDA</source>
|
||||
<translation>PANDA</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<location filename="../qt/sidebar.cc" line="94"/>
|
||||
<source>GPS</source>
|
||||
<translation>GPS</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<location filename="../qt/sidebar.cc" line="94"/>
|
||||
<source>SEARCH</source>
|
||||
<translation>搜索中</translation>
|
||||
</message>
|
||||
|
||||
@@ -876,71 +876,71 @@ location set</source>
|
||||
<context>
|
||||
<name>Sidebar</name>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="67"/>
|
||||
<location filename="../qt/sidebar.cc" line="69"/>
|
||||
<location filename="../qt/sidebar.cc" line="75"/>
|
||||
<location filename="../qt/sidebar.cc" line="77"/>
|
||||
<source>CONNECT</source>
|
||||
<translation>雲端服務</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="67"/>
|
||||
<location filename="../qt/sidebar.cc" line="75"/>
|
||||
<source>OFFLINE</source>
|
||||
<translation>已離線</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="69"/>
|
||||
<location filename="../qt/sidebar.cc" line="82"/>
|
||||
<location filename="../qt/sidebar.cc" line="77"/>
|
||||
<location filename="../qt/sidebar.cc" line="90"/>
|
||||
<source>ONLINE</source>
|
||||
<translation>已連線</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="69"/>
|
||||
<location filename="../qt/sidebar.cc" line="77"/>
|
||||
<source>ERROR</source>
|
||||
<translation>錯誤</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="73"/>
|
||||
<location filename="../qt/sidebar.cc" line="76"/>
|
||||
<location filename="../qt/sidebar.cc" line="78"/>
|
||||
<location filename="../qt/sidebar.cc" line="81"/>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<source>TEMP</source>
|
||||
<translation>溫度</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="73"/>
|
||||
<location filename="../qt/sidebar.cc" line="81"/>
|
||||
<source>HIGH</source>
|
||||
<translation>偏高</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="76"/>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<source>GOOD</source>
|
||||
<translation>正常</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="78"/>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<source>OK</source>
|
||||
<translation>一般</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="82"/>
|
||||
<location filename="../qt/sidebar.cc" line="90"/>
|
||||
<source>VEHICLE</source>
|
||||
<translation>車輛通訊</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<location filename="../qt/sidebar.cc" line="92"/>
|
||||
<source>NO</source>
|
||||
<translation>未連線</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="84"/>
|
||||
<location filename="../qt/sidebar.cc" line="92"/>
|
||||
<source>PANDA</source>
|
||||
<translation>車輛通訊</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<location filename="../qt/sidebar.cc" line="94"/>
|
||||
<source>GPS</source>
|
||||
<translation>GPS</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qt/sidebar.cc" line="86"/>
|
||||
<location filename="../qt/sidebar.cc" line="94"/>
|
||||
<source>SEARCH</source>
|
||||
<translation>車輛通訊</translation>
|
||||
</message>
|
||||
|
||||
@@ -18,6 +18,7 @@ const std::initializer_list<std::pair<std::string, std::string>> keyboard_shortc
|
||||
{"space", "Pause/Resume"},
|
||||
{"e", "Next Engagement"},
|
||||
{"d", "Next Disengagement"},
|
||||
{"t", "Next User Tag"}
|
||||
},
|
||||
{
|
||||
{"enter", "Enter seek request"},
|
||||
@@ -32,6 +33,7 @@ enum Color {
|
||||
Yellow,
|
||||
Green,
|
||||
Red,
|
||||
Cyan,
|
||||
BrightWhite,
|
||||
Engaged,
|
||||
Disengaged,
|
||||
@@ -70,6 +72,7 @@ ConsoleUI::ConsoleUI(Replay *replay, QObject *parent) : replay(replay), sm({"car
|
||||
init_pair(Color::Debug, 246, COLOR_BLACK); // #949494
|
||||
init_pair(Color::Yellow, 184, COLOR_BLACK);
|
||||
init_pair(Color::Red, COLOR_RED, COLOR_BLACK);
|
||||
init_pair(Color::Cyan, COLOR_CYAN, COLOR_BLACK);
|
||||
init_pair(Color::BrightWhite, 15, COLOR_BLACK);
|
||||
init_pair(Color::Disengaged, COLOR_BLUE, COLOR_BLUE);
|
||||
init_pair(Color::Engaged, 28, 28);
|
||||
@@ -205,6 +208,7 @@ void ConsoleUI::displayTimelineDesc() {
|
||||
{Color::Green, " Info ", true},
|
||||
{Color::Yellow, " Warning ", true},
|
||||
{Color::Red, " Critical ", true},
|
||||
{Color::Cyan, " User Tag ", true},
|
||||
};
|
||||
for (auto [color, name, bold] : indicators) {
|
||||
add_str(w[Win::TimelineDesc], "__", color, bold);
|
||||
@@ -263,6 +267,8 @@ void ConsoleUI::updateTimeline() {
|
||||
if (type == TimelineType::Engaged) {
|
||||
mvwchgat(win, 1, start_pos, end_pos - start_pos + 1, A_COLOR, Color::Engaged, NULL);
|
||||
mvwchgat(win, 2, start_pos, end_pos - start_pos + 1, A_COLOR, Color::Engaged, NULL);
|
||||
} else if (type == TimelineType::UserFlag) {
|
||||
mvwchgat(win, 3, start_pos, end_pos - start_pos + 1, ACS_S3, Color::Cyan, NULL);
|
||||
} else {
|
||||
auto color_id = Color::Green;
|
||||
if (type != TimelineType::AlertInfo) {
|
||||
@@ -336,6 +342,8 @@ void ConsoleUI::handleKey(char c) {
|
||||
replay->seekToFlag(FindFlag::nextEngagement);
|
||||
} else if (c == 'd') {
|
||||
replay->seekToFlag(FindFlag::nextDisEngagement);
|
||||
} else if (c == 't') {
|
||||
replay->seekToFlag(FindFlag::nextUserFlag);
|
||||
} else if (c == 'm') {
|
||||
replay->seekTo(+60, true);
|
||||
} else if (c == 'M') {
|
||||
|
||||
@@ -149,6 +149,9 @@ void Replay::buildTimeline() {
|
||||
timeline.push_back({toSeconds(alert_begin), toSeconds(e->mono_time), alert_type});
|
||||
alert_begin = 0;
|
||||
}
|
||||
} else if (e->which == cereal::Event::Which::USER_FLAG) {
|
||||
std::lock_guard lk(timeline_lock);
|
||||
timeline.push_back({toSeconds(e->mono_time), toSeconds(e->mono_time), TimelineType::UserFlag});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -163,6 +166,10 @@ std::optional<uint64_t> Replay::find(FindFlag flag) {
|
||||
} else if (flag == FindFlag::nextDisEngagement && end_ts > cur_ts) {
|
||||
return end_ts;
|
||||
}
|
||||
} else if (type == TimelineType::UserFlag) {
|
||||
if (flag == FindFlag::nextUserFlag && start_ts > cur_ts) {
|
||||
return start_ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
return std::nullopt;
|
||||
@@ -360,7 +367,7 @@ void Replay::stream() {
|
||||
setCurrentSegment(toSeconds(cur_mono_time_) / 60);
|
||||
|
||||
// migration for pandaState -> pandaStates to keep UI working for old segments
|
||||
if (cur_which == cereal::Event::Which::PANDA_STATE_D_E_P_R_E_C_A_T_E_D &&
|
||||
if (cur_which == cereal::Event::Which::PANDA_STATE_D_E_P_R_E_C_A_T_E_D &&
|
||||
sockets_[cereal::Event::Which::PANDA_STATES] != nullptr) {
|
||||
MessageBuilder msg;
|
||||
auto ps = msg.initEvent().initPandaStates(1);
|
||||
|
||||
@@ -24,10 +24,11 @@ enum REPLAY_FLAGS {
|
||||
|
||||
enum class FindFlag {
|
||||
nextEngagement,
|
||||
nextDisEngagement
|
||||
nextDisEngagement,
|
||||
nextUserFlag,
|
||||
};
|
||||
|
||||
enum class TimelineType { None, Engaged, AlertInfo, AlertWarning, AlertCritical };
|
||||
enum class TimelineType { None, Engaged, AlertInfo, AlertWarning, AlertCritical, UserFlag };
|
||||
|
||||
class Replay : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
Reference in New Issue
Block a user