Replay: remove wrong text in TIME (#26692)

remove wrong time string
old-commit-hash: b513b83221
taco
Dean Lee 2 years ago committed by GitHub
parent 93b43cad3e
commit 09a84a3604
  1. 9
      tools/replay/consoleui.cc

@ -156,13 +156,13 @@ void ConsoleUI::timerEvent(QTimerEvent *ev) {
} }
void ConsoleUI::updateStatus() { void ConsoleUI::updateStatus() {
auto write_item = [this](int y, int x, const char *key, const std::string &value, const char *unit, auto write_item = [this](int y, int x, const char *key, const std::string &value, const std::string &unit,
bool bold = false, Color color = Color::BrightWhite) { bool bold = false, Color color = Color::BrightWhite) {
auto win = w[Win::CarState]; auto win = w[Win::CarState];
wmove(win, y, x); wmove(win, y, x);
add_str(win, key); add_str(win, key);
add_str(win, value.c_str(), color, bold); add_str(win, value.c_str(), color, bold);
add_str(win, unit); add_str(win, unit.c_str());
}; };
static const std::pair<const char *, Color> status_text[] = { static const std::pair<const char *, Color> status_text[] = {
{"loading...", Color::Red}, {"loading...", Color::Red},
@ -177,9 +177,8 @@ void ConsoleUI::updateStatus() {
} }
auto [status_str, status_color] = status_text[status]; auto [status_str, status_color] = status_text[status];
write_item(0, 0, "STATUS: ", status_str, " ", false, status_color); write_item(0, 0, "STATUS: ", status_str, " ", false, status_color);
std::string suffix = util::string_format(" / %s [%d/%d] ", format_seconds(replay->totalSeconds()).c_str(), std::string suffix = " / " + format_seconds(replay->totalSeconds());
replay->currentSeconds() / 60, replay->route()->segments().size()); write_item(0, 25, "TIME: ", format_seconds(replay->currentSeconds()), suffix, true);
write_item(0, 25, "TIME: ", format_seconds(replay->currentSeconds()), suffix.c_str(), true);
auto p = sm["liveParameters"].getLiveParameters(); auto p = sm["liveParameters"].getLiveParameters();
write_item(1, 0, "STIFFNESS: ", util::string_format("%.2f %%", p.getStiffnessFactor() * 100), " "); write_item(1, 0, "STIFFNESS: ", util::string_format("%.2f %%", p.getStiffnessFactor() * 100), " ");

Loading…
Cancel
Save