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

Method loadPointCount

app/src/DataModel/ProjectModel.cpp:3006–3023  ·  view source on GitHub ↗

* @brief Resolves the project point-count from JSON or legacy widgetSettings, syncing dashboard. */

Source from the content-addressed store, hash-verified

3004 * @brief Resolves the project point-count from JSON or legacy widgetSettings, syncing dashboard.
3005 */
3006void DataModel::ProjectModel::loadPointCount(const QJsonObject& json)
3007{
3008 m_pointCount = UI::Dashboard::instance().points();
3009 if (json.contains(Keys::PointCount)) {
3010 const int pts = json.value(Keys::PointCount).toInt();
3011 if (pts > 0)
3012 m_pointCount = pts;
3013 } else if (m_widgetSettings.contains(QStringLiteral("__pointCount__"))) {
3014 const int pts = m_widgetSettings.value(QStringLiteral("__pointCount__")).toInt();
3015 if (pts > 0)
3016 m_pointCount = pts;
3017
3018 m_widgetSettings.remove(QStringLiteral("__pointCount__"));
3019 }
3020
3021 if (AppState::instance().operationMode() == SerialStudio::ProjectFile)
3022 UI::Dashboard::instance().setPoints(m_pointCount);
3023}
3024
3025/**
3026 * @brief Resolves the project plot time range (seconds) from JSON, syncing the dashboard.

Callers

nothing calls this directly

Calls 6

operationModeMethod · 0.80
setPointsMethod · 0.80
pointsMethod · 0.45
containsMethod · 0.45
valueMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected