From f58028a8a94577cee105f544ed0192f1eb7c07d5 Mon Sep 17 00:00:00 2001 From: Sander Speetjens Date: Sat, 18 Oct 2025 09:58:02 +0200 Subject: [PATCH] Adds unit property to dial. Adds the ability to store and retrieve a unit string associated with the dial, allowing for more context-aware representation of values. --- UI/ui_dial.cpp | 5 +++++ UI/ui_dial.hpp | 1 + 2 files changed, 6 insertions(+) diff --git a/UI/ui_dial.cpp b/UI/ui_dial.cpp index 1aa214d..d2af6c4 100644 --- a/UI/ui_dial.cpp +++ b/UI/ui_dial.cpp @@ -53,6 +53,11 @@ double UI_dial::max() const return m_max; } +std::string UI_dial::unit() const +{ + return m_unit; +} + void UI_dial::from_json(const json &j) { UI_item::from_json(j); diff --git a/UI/ui_dial.hpp b/UI/ui_dial.hpp index 2eea9cd..fb77a7c 100644 --- a/UI/ui_dial.hpp +++ b/UI/ui_dial.hpp @@ -20,6 +20,7 @@ class UI_dial : public UI_item double min() const; double max() const; + std::string unit() const; void from_json(const json &j) override; json to_json(size_t id) const override;