LimitRange

template<fgc4::utils::NumericScalar T>
class LimitRange : public vslib::Component

Public Functions

inline LimitRange(std::string_view name, Component &parent)

Constructor of LimitRange Component, initializes min, max, and dead_zone Parameters.

Parameters:
inline T limit(const T input) noexcept

Checks minimum and maximum thresholds as well as the dead zone and returns the processed value.

Parameters:

input – Numerical input to be checked

Returns:

Either original input if no issues were found or nearest edge of allowed zone, minimum representable value if NaN was provided

inline virtual std::optional<fgc4::utils::Warning> verifyParameters() override

Verifies parameters after any Parameter has been modified.

Returns:

Optionally returns a warning if any issues have been found

Public Members

Parameter<T> min

Minimum allowed value.

Parameter<T> max

Maximum allowed value.

Parameter<std::array<T, 2>> dead_zone

Two edges (min, max) of the dead zone.