MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / importData

Method importData

pj_app/tests/msgbox_mock_source.cpp:35–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33 }
34
35 PJ::Status importData() override {
36 // config_ is opaque to this example (no JSON dependency); the marker is
37 // matched by substring — safe because only the test sets this config.
38 if (config_.find("ask_msgbox") != std::string::npos) {
39 // Runs on the import worker thread. The host is contractually required to
40 // marshal the dialog to the GUI thread (data_source_protocol.h:
41 // show_message_box is [main-thread]); building the QWidget here directly
42 // is the bug under test.
43 if (!runtimeHost().askContinue("Regression", "Continue the worker-thread load?")) {
44 return PJ::unexpected("aborted by user");
45 }
46 }
47
48 auto topic = writeHost().ensureTopic("mock/file_data");
49 if (!topic) {
50 return PJ::unexpected(topic.error());
51 }
52 auto status = writeHost().appendRecord(*topic, PJ::Timestamp{100}, {{.name = "value", .value = 1.0}});
53 if (!status) {
54 return PJ::unexpected(status.error());
55 }
56 return PJ::okStatus();
57 }
58
59 private:
60 std::string config_ = "{}";

Callers

nothing calls this directly

Calls 3

ensureTopicMethod · 0.80
appendRecordMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected