* @brief Writes a value to a computed register by handle. An undefined or null value is a safe * no-op, matching the Lua bridge's nil handling. */
| 676 | * no-op, matching the Lua bridge's nil handling. |
| 677 | */ |
| 678 | void DataModel::TableApiBridge::tableSetH(qint64 h, const QVariant& v) |
| 679 | { |
| 680 | Q_ASSERT(store); |
| 681 | |
| 682 | if (!v.isValid() || v.typeId() == QMetaType::Nullptr) |
| 683 | return; |
| 684 | |
| 685 | DataModel::RegisterValue rv; |
| 686 | rv.numericValue = SerialStudio::toDouble(v, &rv.isNumeric); |
| 687 | if (!rv.isNumeric) |
| 688 | rv.stringValue = v.toString(); |
| 689 | |
| 690 | store->setByHandle(h, rv); |
| 691 | } |
| 692 | |
| 693 | /** |
| 694 | * @brief Returns the raw (pre-transform) value of a dataset. |
no test coverage detected