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

Method bindAndInsertReading

app/src/Sessions/Export.cpp:165–181  ·  view source on GitHub ↗

* @brief Binds dataset values into the reading insert query and executes it. */

Source from the content-addressed store, hash-verified

163 * @brief Binds dataset values into the reading insert query and executes it.
164 */
165void 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.

Callers

nothing calls this directly

Calls 3

execMethod · 0.80
textMethod · 0.45
lastErrorMethod · 0.45

Tested by

no test coverage detected