12 #include "Utilities.h" 34 constexpr
inline auto indexValue(
const GaugeIndex &g) {
35 using IntType =
typename std::underlying_type<GaugeIndex>::type;
36 return static_cast<IntType
>(g);
46 using IntType =
typename std::underlying_type<GaugeIndex>::type;
48 throw std::domain_error(
"Incrementing GaugeIndex beyond UpperBound.");
49 gaugeIndex =
static_cast<GaugeIndex>(
static_cast<IntType
>(gaugeIndex) + 1 );
61 using IntType =
typename std::underlying_type<GaugeIndex>::type;
63 throw std::domain_error(
"Incrementing GaugeIndex beyond UpperBound.");
64 return static_cast<GaugeIndex>(
static_cast<IntType
>(gaugeIndex) + increment);
83 bool mTextureValid{
false};
148 ~
Gauge()
override =
default;
177 void initializeComposite()
override;
195 void setValue(
float value);
197 void setOrientation(
Orientation orientation)
override;
Manages the interior of the Gauge.
Definition: Gauge.h:80
GaugeIndex & operator++(GaugeIndex &gaugeIndex)
GaugeIndex pre-increment operator.
Definition: Gauge.h:45
Invalid image ID.
Definition: Constants.h:172
The top of the warning band value and HighEmergency color.
The top of the normal band value and HighWarning color.
std::array< uint32_t, 5 > GaugeValueHues
Type of Gauge colors.
Definition: Gauge.h:68
Not set to a valid value.
GaugeIndex
Definition: Gauge.h:25
Index to the maximum displayable value.
void setOrientation(Orientation orientation) override
See Widget::setOrientation();.
Definition: Gauge.h:107
Index to the minimum displayable value and LowEmergency color.
An encapsulation of the SDL_Texture structure.
Definition: Texture.h:40
std::shared_ptr< Slot< float > > valueRx
A Slot to receive values on.
Definition: Gauge.h:189
std::array< float, 6 > GaugeValueLimits
Type of Gauge values.
Definition: Gauge.h:67
GaugeValueHues mValueHues
The colors for the five possible value bands.
Definition: Gauge.h:143
Display a numeric value as a graphic indicator.
Definition: Gauge.h:74
The bottom of the normal band value and Normal color.
Orientation
Possible values for Widget orientation.
Definition: Types.h:41
The bottom of the warning band value and and LowWarning color.
A composite of a Position and a Size.
Definition: Types.h:307
GaugeIndex operator+(const GaugeIndex &gaugeIndex, unsigned long increment)
Add an unsigned integer to a GaugeIndex.
Definition: Gauge.h:60
Written as a workaround for an issue in the SDL2 Library.
Definition: Renderer.h:64
ToDo: There is an issue that the initial scroll interaction is lost if the click/press lands on a Wid...
Definition: CelestialOverlay.cpp:13
GaugeValueLimits mValueLimits
The limits and color areas of the Gauge.
Definition: Gauge.h:137
Establish an intra-application signaling protocol.