* @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. */
| 619 | * matching the Lua bridge's nil handling. |
| 620 | */ |
| 621 | void 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. |
no test coverage detected