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

Method beginSession

app/src/Benchmark/BenchmarkRunner.cpp:447–468  ·  view source on GitHub ↗

* @brief Snapshots project + consumer state and redirects exports into a throwaway workspace. */

Source from the content-addressed store, hash-verified

445 * @brief Snapshots project + consumer state and redirects exports into a throwaway workspace.
446 */
447void BenchmarkRunner::beginSession()
448{
449 m_savedMode = AppState::instance().operationMode();
450 m_savedProjectPath = AppState::instance().projectFilePath();
451
452 m_savedPlotTimeRange = UI::Dashboard::instance().plotTimeRange();
453 UI::Dashboard::instance().setPlotTimeRange(10.0);
454
455 m_savedCsvExport = CSV::Export::instance().exportEnabled();
456 m_savedApiServer = API::Server::instance().enabled();
457#ifdef BUILD_COMMERCIAL
458 m_savedMdfExport = MDF4::Export::instance().exportEnabled();
459 m_savedSessionExport = Sessions::Export::instance().exportEnabled();
460#endif
461#ifdef ENABLE_GRPC
462 m_savedGrpcServer = API::GRPC::GRPCServer::instance().enabled();
463#endif
464
465 m_tempWorkspace = std::make_unique<QTemporaryDir>();
466 if (m_tempWorkspace->isValid())
467 Misc::WorkspaceManager::instance().setTemporaryPath(m_tempWorkspace->path());
468}
469
470/**
471 * @brief Restores the user's workspace/consumers/project and deletes the benchmark's temp files.

Callers

nothing calls this directly

Calls 8

operationModeMethod · 0.80
setTemporaryPathMethod · 0.80
plotTimeRangeMethod · 0.45
setPlotTimeRangeMethod · 0.45
exportEnabledMethod · 0.45
enabledMethod · 0.45
isValidMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected