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

Method handleSourcePropertyChange

app/src/DataModel/ProjectEditor.cpp:3070–3087  ·  view source on GitHub ↗

* @brief Applies a live-driver property edit and rebuilds the form on transport mode changes. */

Source from the content-addressed store, hash-verified

3068 * @brief Applies a live-driver property edit and rebuilds the form on transport mode changes.
3069 */
3070void DataModel::ProjectEditor::handleSourcePropertyChange(QStandardItem* item)
3071{
3072 const QString key = item->data(ParameterKey).toString();
3073 const QVariant val = item->data(EditableValue);
3074 IO::HAL_Driver* drv =
3075 IO::ConnectionManager::instance().driverForEditing(m_selectedSource.sourceId);
3076 if (drv)
3077 drv->setDriverProperty(key, val);
3078
3079 DataModel::ProjectModel::instance().captureSourceSettings(m_selectedSource.sourceId);
3080
3081 static const QStringList kModeKeys = {
3082 QStringLiteral("socketTypeIndex"),
3083 QStringLiteral("protocolIndex"),
3084 };
3085 if (kModeKeys.contains(key))
3086 buildSourceModel(m_selectedSource);
3087}
3088
3089/**
3090 * @brief Dispatches source form edits to ProjectModel or the live driver.

Callers

nothing calls this directly

Calls 5

driverForEditingMethod · 0.80
captureSourceSettingsMethod · 0.80
dataMethod · 0.45
setDriverPropertyMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected