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

Function loadSessionTimeSpan

app/src/Sessions/ReportData.cpp:523–535  ·  view source on GitHub ↗

* @brief Returns the session's earliest and latest @c timestamp_ns values. */

Source from the content-addressed store, hash-verified

521 * @brief Returns the session's earliest and latest @c timestamp_ns values.
522 */
523static std::pair<qint64, qint64> loadSessionTimeSpan(QSqlDatabase& db, int sessionId)
524{
525 QSqlQuery q(db);
526 q.prepare("SELECT MIN(timestamp_ns), MAX(timestamp_ns) FROM readings WHERE session_id = ?");
527 q.bindValue(0, sessionId);
528
529 if (!q.exec() || !q.next()) {
530 qWarning() << "[Sessions::ReportData] time-span query failed:" << q.lastError().text();
531 return {0, 0};
532 }
533
534 return {q.value(0).toLongLong(), q.value(1).toLongLong()};
535}
536
537/**
538 * @brief Numeric-sample count per parameter, keyed by @c unique_id.

Callers 1

loadChartSeriesMethod · 0.85

Calls 5

execMethod · 0.80
nextMethod · 0.80
textMethod · 0.45
lastErrorMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected