mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 08:16:06 +08:00
replay: add shortcuts for seeking to the next info, warning, and critical alerts (#25576)
This commit is contained in:
@@ -18,7 +18,10 @@ 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"}
|
||||
{"t", "Next User Tag"},
|
||||
{"i", "Next Info"},
|
||||
{"w", "Next Warning"},
|
||||
{"c", "Next Critical"},
|
||||
},
|
||||
{
|
||||
{"enter", "Enter seek request"},
|
||||
@@ -344,6 +347,12 @@ void ConsoleUI::handleKey(char c) {
|
||||
replay->seekToFlag(FindFlag::nextDisEngagement);
|
||||
} else if (c == 't') {
|
||||
replay->seekToFlag(FindFlag::nextUserFlag);
|
||||
} else if (c == 'i') {
|
||||
replay->seekToFlag(FindFlag::nextInfo);
|
||||
} else if (c == 'w') {
|
||||
replay->seekToFlag(FindFlag::nextWarning);
|
||||
} else if (c == 'c') {
|
||||
replay->seekToFlag(FindFlag::nextCritical);
|
||||
} else if (c == 'm') {
|
||||
replay->seekTo(+60, true);
|
||||
} else if (c == 'M') {
|
||||
|
||||
@@ -166,8 +166,11 @@ 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) {
|
||||
} else if (start_ts > cur_ts) {
|
||||
if ((flag == FindFlag::nextUserFlag && type == TimelineType::UserFlag) ||
|
||||
(flag == FindFlag::nextInfo && type == TimelineType::AlertInfo) ||
|
||||
(flag == FindFlag::nextWarning && type == TimelineType::AlertWarning) ||
|
||||
(flag == FindFlag::nextCritical && type == TimelineType::AlertCritical)) {
|
||||
return start_ts;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@ enum class FindFlag {
|
||||
nextEngagement,
|
||||
nextDisEngagement,
|
||||
nextUserFlag,
|
||||
nextInfo,
|
||||
nextWarning,
|
||||
nextCritical
|
||||
};
|
||||
|
||||
enum class TimelineType { None, Engaged, AlertInfo, AlertWarning, AlertCritical, UserFlag };
|
||||
|
||||
Reference in New Issue
Block a user