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

Method setupProject

app/src/Benchmark/HotpathBenchmark.cpp:401–426  ·  view source on GitHub ↗

* @brief Loads the synthetic project and activates the parse pipeline for the given language. */

Source from the content-addressed store, hash-verified

399 * @brief Loads the synthetic project and activates the parse pipeline for the given language.
400 */
401void HotpathBenchmark::setupProject(int language, int channels, bool withStrings, bool dashboard)
402{
403 Q_ASSERT(channels > 0);
404
405 auto& project = DataModel::ProjectModel::instance();
406 project.setSuppressMessageBoxes(true);
407
408 AppState::instance().setOperationMode(SerialStudio::ProjectFile);
409
410 const QJsonObject root = dashboard ? buildDashboardProjectJson(language, withStrings)
411 : buildProjectJson(language, channels, withStrings);
412 const bool loaded = project.loadFromJsonDocument(QJsonDocument(root));
413 Q_ASSERT(loaded);
414 Q_UNUSED(loaded);
415
416 auto& parser = DataModel::FrameParser::instance();
417 parser.setSuppressMessageBoxes(true);
418 parser.readCode();
419
420 DataModel::FrameBuilder::instance().syncFromProjectModel();
421
422 if (dashboard) {
423 project.setCustomizeWorkspaces(true);
424 project.setCustomizeWorkspaces(false);
425 }
426}
427
428/**
429 * @brief Enables every local export/output consumer (CSV/MDF4/Sessions/API/gRPC).

Callers

nothing calls this directly

Calls 6

loadFromJsonDocumentMethod · 0.80
syncFromProjectModelMethod · 0.80
setOperationModeMethod · 0.45
readCodeMethod · 0.45

Tested by

no test coverage detected