* @brief Binds dataset values into the reading insert query and executes it. */
| 163 | * @brief Binds dataset values into the reading insert query and executes it. |
| 164 | */ |
| 165 | void Sessions::ExportWorker::bindAndInsertReading(qint64 ns, const DataModel::Dataset& dataset) |
| 166 | { |
| 167 | if (!m_readingQuery) [[unlikely]] |
| 168 | return; |
| 169 | |
| 170 | m_readingQuery->bindValue(0, m_sessionId); |
| 171 | m_readingQuery->bindValue(1, ns); |
| 172 | m_readingQuery->bindValue(2, dataset.uniqueId); |
| 173 | m_readingQuery->bindValue(3, dataset.rawNumericValue); |
| 174 | m_readingQuery->bindValue(4, dataset.rawValue); |
| 175 | m_readingQuery->bindValue(5, dataset.numericValue); |
| 176 | m_readingQuery->bindValue(6, dataset.value); |
| 177 | m_readingQuery->bindValue(7, dataset.isNumeric ? 1 : 0); |
| 178 | |
| 179 | if (!m_readingQuery->exec()) [[unlikely]] |
| 180 | qWarning() << "[SQLite] Insert reading failed:" << m_readingQuery->lastError().text(); |
| 181 | } |
| 182 | |
| 183 | /** |
| 184 | * @brief Processes a batch of timestamped frames into the SQLite database. |