* @brief Snapshots project + consumer state and redirects exports into a throwaway workspace. */
| 445 | * @brief Snapshots project + consumer state and redirects exports into a throwaway workspace. |
| 446 | */ |
| 447 | void 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. |
nothing calls this directly
no test coverage detected