Skip to content

Commit 593a35e

Browse files
committed
data_monitor: printout polish
1 parent cbfd082 commit 593a35e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gui/src/tty_scroll.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ const wxString kUtfRightArrow = wxString::FromUTF8(u8"\u2192");
5353
/** Draw a single line in the log window. */
5454
static void DrawLine(wxDC& dc, Logline ll, int data_pos, int y) {
5555
wxString ws;
56+
std::string msg_text = ll.navmsg ? ll.navmsg->to_string() : "";
5657
#ifndef __WXQT__ // Date/Time on Qt are broken, at least for android
57-
ws << wxDateTime::Now().FormatISOTime() << " ";
58+
if (!msg_text.empty()) ws << wxDateTime::Now().FormatISOTime() << " ";
5859
#endif
5960
if (ll.state.direction == NavmsgStatus::Direction::kOutput)
6061
ws << " " << kUtfRightArrow << " ";
@@ -83,12 +84,13 @@ static void DrawLine(wxDC& dc, Logline ll, int data_pos, int y) {
8384
<< (ll.error_msg.size() > 0 ? ll.error_msg : "Unknown errror");
8485
}
8586
std::string stream(ll.stream_name);
87+
if (stream.empty() && ll.navmsg) stream = ll.navmsg->source->iface;
8688
if (stream.size() > 20) stream = stream.substr(0, 17) + "...";
8789
ws << stream;
8890
dc.DrawText(ws, 0, y);
8991
ws = "";
9092

91-
ws << (ll.navmsg ? ll.navmsg->to_string() : "") << error_msg.str();
93+
ws << msg_text << error_msg.str();
9294
dc.DrawText(ws, data_pos, y);
9395
}
9496

0 commit comments

Comments
 (0)