MCPcopy Create free account
hub / github.com/SatDump/SatDump / drawUI

Method drawUI

plugins/inmarsat_support/stdc/module_stdc_parser.cpp:259–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257 }
258
259 void STDCParserModule::drawUI(bool window)
260 {
261 is_gui = true;
262
263 ImGui::Begin("Inmarsat STD-C Parser", NULL, window ? 0 : NOWINDOW_FLAGS);
264
265 ImGui::Text("Decoded packets can be seen in a floating window.");
266 ImGui::Text("Do remember you should not read nor keep messages that\nare not intended for you.");
267
268 ImGui::Spacing();
269 ImGui::Text("Last packet count : ");
270 ImGui::SameLine();
271 ImGui::TextColored(style::theme.green, "%d", last_pkt_count);
272
273 if (input_data_type == DATA_FILE)
274 ImGui::ProgressBar((double)progress / (double)filesize, ImVec2(ImGui::GetContentRegionAvail().x, 20 * ui_scale));
275
276 ImGui::End();
277
278 if (input_data_type != DATA_FILE)
279 {
280 ImGui::Begin("STD-C Packets", NULL, ImGuiWindowFlags_HorizontalScrollbar);
281
282 pkt_history_mtx.lock();
283 ImGui::BeginTabBar("##sdtmessagestabbar");
284 if (ImGui::BeginTabItem("Messages"))
285 {
286 float wrap_pos = ImGui::GetContentRegionMax().x;
287 ImGui::BeginTable("##stdmessagetable", 3, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingFixedFit);
288 ImGui::TableSetupColumn("Type", ImGuiTableColumnFlags_NoResize, 150 * ui_scale);
289 ImGui::TableSetupColumn("Timestamp", ImGuiTableColumnFlags_NoResize, 75 * ui_scale);
290 ImGui::TableSetupColumn("Contents", 0, -1);
291 ImGui::TableHeadersRow();
292
293 for (int i = pkt_history_msg.size() - 1; i >= 0; i--)
294 {
295 auto &msg = pkt_history_msg[i];
296 try
297 {
298 int id = get_packet_frm_id(msg);
299 ImGui::TableNextRow();
300 ImGui::TableSetColumnIndex(0);
301 ImGui::TextColored(style::theme.lavender, "%s", get_id_name(id).c_str());
302 ImGui::TableSetColumnIndex(1);
303 ImGui::TextColored(style::theme.yellow, "%s", timestampToTod(msg["timestamp"].get<double>()).c_str());
304 ImGui::TableSetColumnIndex(2);
305 ImGui::PushTextWrapPos(wrap_pos);
306 ImGui::TextColored(style::theme.green, "%s", msg["message"].get<std::string>().c_str());
307 ImGui::PopTextWrapPos();
308 }
309 catch (std::exception &)
310 {
311 }
312 }
313 ImGui::EndTable();
314 ImGui::EndTabItem();
315 }
316 if (ImGui::BeginTabItem("EGC Messages"))

Callers

nothing calls this directly

Calls 14

TextColoredFunction · 0.85
ImVec2Function · 0.85
BeginTableFunction · 0.85
get_packet_frm_idFunction · 0.85
TableNextRowFunction · 0.85
TableSetColumnIndexFunction · 0.85
get_id_nameFunction · 0.85
EndTableFunction · 0.85
c_strMethod · 0.80
timestampToTodFunction · 0.70
TextFunction · 0.50
SameLineFunction · 0.50

Tested by

no test coverage detected