* @brief Applies CLI project/quick-plot mode and schedules runtime auto-connect. */
| 390 | * @brief Applies CLI project/quick-plot mode and schedules runtime auto-connect. |
| 391 | */ |
| 392 | void CLI::applyProjectAndAutoConnect(QApplication& app) |
| 393 | { |
| 394 | if (apiServerEnabled()) |
| 395 | API::Server::instance().setEnabled(true); |
| 396 | |
| 397 | const QString project = projectPath(); |
| 398 | if (!project.isEmpty()) { |
| 399 | AppState::instance().setOperationMode(SerialStudio::ProjectFile); |
| 400 | DataModel::ProjectModel::instance().openJsonFile(project); |
| 401 | } |
| 402 | |
| 403 | else if (quickPlot()) |
| 404 | AppState::instance().setOperationMode(SerialStudio::QuickPlot); |
| 405 | |
| 406 | if (!runtimeMode()) |
| 407 | return; |
| 408 | |
| 409 | QTimer::singleShot(0, &app, []() { |
| 410 | #ifdef BUILD_COMMERCIAL |
| 411 | if (!Licensing::LemonSqueezy::instance().isActivated() |
| 412 | && !Licensing::Trial::instance().trialEnabled()) |
| 413 | return; |
| 414 | #endif |
| 415 | auto& cm = IO::ConnectionManager::instance(); |
| 416 | if (cm.configurationOk() && !cm.isConnected()) |
| 417 | cm.connectDevice(); |
| 418 | }); |
| 419 | } |
| 420 | |
| 421 | /** |
| 422 | * @brief Applies CLI dashboard FPS and point-count options if set. |
no test coverage detected