mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-25 07:52:03 +08:00
100f89a161
* openpilot v0.9.9 release date: 2025-06-05T19:54:08 master commit: 8aadf02b2fd91f4e1285e18c2c7feb32d93b66f5 * AGNOS 12.4 (#35558) agnos12.4 --------- Co-authored-by: Vehicle Researcher <user@comma.ai> Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
44 lines
1.0 KiB
C++
44 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include <array>
|
|
#include <mutex>
|
|
#include <vector>
|
|
|
|
#include "tools/replay/replay.h"
|
|
#include <ncurses.h>
|
|
|
|
class ConsoleUI {
|
|
public:
|
|
ConsoleUI(Replay *replay);
|
|
~ConsoleUI();
|
|
int exec();
|
|
inline static const std::array speed_array = {0.2f, 0.5f, 1.0f, 2.0f, 4.0f, 8.0f};
|
|
|
|
private:
|
|
void initWindows();
|
|
void handleKey(char c);
|
|
void displayHelp();
|
|
void displayTimelineDesc();
|
|
void updateTimeline();
|
|
void updateSummary();
|
|
void updateStatus();
|
|
void pauseReplay(bool pause);
|
|
void updateSize();
|
|
void updateProgressBar();
|
|
void logMessage(ReplyMsgType type, const std::string &msg);
|
|
|
|
enum Status { Playing, Paused };
|
|
enum Win { Title, Stats, Log, LogBorder, DownloadBar, Timeline, TimelineDesc, Help, CarState, Max};
|
|
std::array<WINDOW*, Win::Max> w{};
|
|
SubMaster sm;
|
|
Replay *replay;
|
|
int max_width, max_height;
|
|
Status status = Status::Playing;
|
|
|
|
std::mutex mutex;
|
|
std::vector<std::pair<ReplyMsgType, std::string>> logs;
|
|
uint64_t progress_cur = 0;
|
|
uint64_t progress_total = 0;
|
|
bool download_success = false;
|
|
};
|