Add the ability to limit-rate the dashboard updating (#3527)

Co-authored-by: Emma Broman <emma.broman@liu.se>
This commit is contained in:
Alexander Bock
2025-02-18 16:49:47 +01:00
committed by GitHub
parent a9beb476af
commit 8cb3ce8b94
35 changed files with 206 additions and 280 deletions

View File

@@ -28,6 +28,7 @@
#include <openspace/properties/propertyowner.h>
#include <openspace/properties/scalar/boolproperty.h>
#include <openspace/properties/scalar/intproperty.h>
#include <openspace/properties/vector/ivec2property.h>
#include <openspace/rendering/dashboarditem.h>
#include <ghoul/glm.h>
@@ -43,6 +44,14 @@ public:
Dashboard();
virtual ~Dashboard() override = default;
/**
* Renders all of the items of this Dashboard at the provided \p penPosition. The
* position is provided in pixels with the top-left corner being located at (0,0). The
* rendering of the DashboardItems will update the \p penPosition according to where
* the next item should be placed.
*
* \param penPosition The location at which we want to render the dashboard items
*/
void render(glm::vec2& penPosition);
void addDashboardItem(std::unique_ptr<DashboardItem> item);
@@ -63,8 +72,10 @@ public:
private:
properties::BoolProperty _isEnabled;
properties::IVec2Property _startPositionOffset;
properties::IntProperty _refreshRate;
std::vector<std::unique_ptr<DashboardItem>> _items;
std::chrono::steady_clock::time_point _lastRefresh;
};
} // openspace