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

Method processItems

app/src/Sessions/Export.cpp:186–209  ·  view source on GitHub ↗

* @brief Processes a batch of timestamped frames into the SQLite database. */

Source from the content-addressed store, hash-verified

184 * @brief Processes a batch of timestamped frames into the SQLite database.
185 */
186void Sessions::ExportWorker::processItems(const std::vector<DataModel::TimestampedFramePtr>& items)
187{
188 if (items.empty())
189 return;
190
191 if (!m_dbOpen) {
192 createDatabase(items.front()->data);
193
194 if (!m_dbOpen)
195 return;
196
197 m_steadyBaseline = items.front()->timestamp;
198 resetMonotonicClock();
199 }
200
201 m_db->transaction();
202 for (const auto& frame : items)
203 writeFrameReadings(frame);
204
205 if (!m_db->commit()) [[unlikely]] {
206 qWarning() << "[Sessions::Export] commit() failed:" << m_db->lastError().text();
207 m_db->rollback();
208 }
209}
210
211/**
212 * @brief Creates the SQLite database file and writes the schema and session.

Callers

nothing calls this directly

Calls 4

emptyMethod · 0.80
commitMethod · 0.80
textMethod · 0.45
lastErrorMethod · 0.45

Tested by

no test coverage detected