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

Method applyProjectAndAutoConnect

app/src/Misc/CLI.cpp:392–419  ·  view source on GitHub ↗

* @brief Applies CLI project/quick-plot mode and schedules runtime auto-connect. */

Source from the content-addressed store, hash-verified

390 * @brief Applies CLI project/quick-plot mode and schedules runtime auto-connect.
391 */
392void 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.

Callers 1

mainFunction · 0.80

Calls 9

isEmptyMethod · 0.80
openJsonFileMethod · 0.80
trialEnabledMethod · 0.80
connectDeviceMethod · 0.80
setEnabledMethod · 0.45
setOperationModeMethod · 0.45
isActivatedMethod · 0.45
configurationOkMethod · 0.45
isConnectedMethod · 0.45

Tested by

no test coverage detected