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

Method syncUiDriverToLive

app/src/IO/ConnectionManager.cpp:1098–1118  ·  view source on GitHub ↗

* @brief Mirrors all properties from the active UI-config driver to the live DeviceManager driver; * the live driver is signal-blocked to suppress its fan-out (the UI driver's configurationChanged * still notifies downstream, so nothing is lost). */

Source from the content-addressed store, hash-verified

1096 * still notifies downstream, so nothing is lost).
1097 */
1098void IO::ConnectionManager::syncUiDriverToLive()
1099{
1100 if (m_syncingFromProject)
1101 return;
1102
1103 const auto& srcs = DataModel::ProjectModel::instance().sources();
1104 if (AppState::instance().operationMode() == SerialStudio::ProjectFile && srcs.size() > 1)
1105 return;
1106
1107 HAL_Driver* uiDriver = activeUiDriver();
1108 if (!uiDriver)
1109 return;
1110
1111 HAL_Driver* liveDriver = driver(0);
1112 if (!liveDriver || liveDriver == uiDriver)
1113 return;
1114
1115 QSignalBlocker blocker(liveDriver);
1116 for (const auto& prop : uiDriver->driverProperties())
1117 liveDriver->setDriverProperty(prop.key, prop.value);
1118}
1119
1120/**
1121 * @brief Applies source[0]'s busType and connectionSettings to the matching UI-config driver;

Callers

nothing calls this directly

Calls 4

operationModeMethod · 0.80
sizeMethod · 0.45
driverPropertiesMethod · 0.45
setDriverPropertyMethod · 0.45

Tested by

no test coverage detected