* @brief Resolves the project point-count from JSON or legacy widgetSettings, syncing dashboard. */
| 3004 | * @brief Resolves the project point-count from JSON or legacy widgetSettings, syncing dashboard. |
| 3005 | */ |
| 3006 | void 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. |