MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / RedrawHistoryView

Method RedrawHistoryView

lib/mdflib/mdfviewer/src/childframe.cpp:1161–1201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1159}
1160
1161void ChildFrame::RedrawHistoryView() {
1162 history_view_->DeleteAllItems();
1163
1164 if (splitter_->GetWindow2() != history_view_) {
1165 return;
1166 }
1167
1168 auto* doc = GetDoc();
1169 if (doc == nullptr) {
1170 return;
1171 }
1172 const auto* mdf_file = doc->GetFile();
1173 if (mdf_file == nullptr) {
1174 return;
1175 }
1176
1177 const auto* header = mdf_file->Header();
1178 if (header == nullptr) {
1179 return;
1180 }
1181
1182 const auto history_list = header->FileHistories();
1183
1184
1185 long line = 0;
1186 for (const auto* history : history_list) {
1187 if (history == nullptr) {
1188 continue;
1189 }
1190 std::ostringstream date_time;
1191 date_time << util::time::NsToLocalDate(history->Time()) << " "
1192 << util::time::NsToLocalTime(history->Time(), 0);
1193 const auto index = history_view_->InsertItem(line, wxString::FromUTF8(date_time.str()));
1194 history_view_->SetItem(index, 1, wxString::FromUTF8(history->UserName()));
1195 history_view_->SetItem(index, 2, wxString::FromUTF8(history->Description()));
1196 history_view_->SetItem(index, 3, wxString::FromUTF8(history->ToolName()));
1197 history_view_->SetItem(index, 4, wxString::FromUTF8(history->ToolVendor()));
1198 history_view_->SetItem(index, 5, wxString::FromUTF8(history->ToolVersion()));
1199 ++line;
1200 }
1201}
1202
1203void ChildFrame::RedrawMeasurementView() {
1204 measurement_view_->DeleteAllItems();

Callers

nothing calls this directly

Calls 11

NsToLocalDateFunction · 0.85
NsToLocalTimeFunction · 0.85
TimeMethod · 0.80
ToolNameMethod · 0.80
GetFileMethod · 0.45
HeaderMethod · 0.45
FileHistoriesMethod · 0.45
UserNameMethod · 0.45
DescriptionMethod · 0.45
ToolVendorMethod · 0.45
ToolVersionMethod · 0.45

Tested by

no test coverage detected