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

Method tableSet

app/src/DataModel/DataTable.cpp:621–634  ·  view source on GitHub ↗

* @brief Writes a value to a computed register. An undefined or null value is a safe no-op, * matching the Lua bridge's nil handling. */

Source from the content-addressed store, hash-verified

619 * matching the Lua bridge's nil handling.
620 */
621void DataModel::TableApiBridge::tableSet(const QString& t, const QString& r, const QVariant& v)
622{
623 Q_ASSERT(store);
624
625 if (!v.isValid() || v.typeId() == QMetaType::Nullptr)
626 return;
627
628 DataModel::RegisterValue rv;
629 rv.numericValue = SerialStudio::toDouble(v, &rv.isNumeric);
630 if (!rv.isNumeric)
631 rv.stringValue = v.toString();
632
633 store->set(t, r, rv);
634}
635
636/**
637 * @brief Resolves a (table, register) pair to a reusable handle for the fast read/write path.

Callers 2

prelude.jsFile · 0.80
SerialStudio.jsFile · 0.80

Calls 2

isValidMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected