IDS peak AFL v1.8.0
Loading...
Searching...
No Matches

Hysteresis feature implementation for auto controllers. More...

#include <peak_afl/pipeline/modules/controllers/features/peak_afl_hysteresis.hpp>

Inheritance diagram for Hysteresis:
IRangeFeature< uint8_t > IFeature< uint8_t > ISerializable

Public Member Functions

 Hysteresis (std::shared_ptr< peak::afl::Controller > controller)
 Constructs a Hysteresis feature with the specified controller.
 
void Set (const uint8_t &value) override
 Sets the hysteresis value.
 
PEAK_COMMON_NO_DISCARD uint8_t Get () const override
 Gets the current hysteresis value.
 
PEAK_COMMON_NO_DISCARD peak::common::RangeU8 GetRange () const override
 Gets the valid range for hysteresis values.
 
void Serialize (peak::common::serialization::IArchive &archive) const override
 Serializes the current hysteresis value to an archive.
 
void Deserialize (const peak::common::serialization::IArchive &archive) override
 Deserializes the hysteresis value from an archive.
 
- Public Member Functions inherited from IFeature< uint8_t >
virtual ~IFeature ()=default
 Virtual destructor for proper cleanup of derived classes.
 

Detailed Description

Hysteresis feature implementation for auto controllers.

The Hysteresis class provides a feature interface for managing the hysteresis parameter of auto controllers. Hysteresis prevents oscillation in automatic control systems by introducing a dead zone around the target value where no adjustments are made.

Hysteresis is particularly important in automatic exposure and focus systems to prevent continuous small adjustments that can cause visible flickering or hunting behavior. The hysteresis value defines how far from the target the measured value must move before the controller will make an adjustment.

This class inherits from IRangeFeature<uint8_t> and provides serialization support for configuration persistence.

Note
The actual range and increment values are determined by the underlying controller implementation and may vary based on the controller type and system characteristics.
See also
IRangeFeature
peak::afl::Controller::SetHysteresis()
peak::afl::Controller::GetHysteresis()
AutoTarget
AutoTolerance
Since
1.8

Constructor & Destructor Documentation

◆ Hysteresis()

Hysteresis ( std::shared_ptr< peak::afl::Controller > controller)
inlineexplicit

Constructs a Hysteresis feature with the specified controller.

Parameters
[in]controllerShared pointer to the auto controller that will be used to manage the hysteresis parameter. The controller must support hysteresis operations.
Precondition
controller must not be null
controller must support hysteresis functionality
Since
1.8

Member Function Documentation

◆ Deserialize()

void Deserialize ( const peak::common::serialization::IArchive & archive)
inlineoverridevirtual

Deserializes the hysteresis value from an archive.

Loads the hysteresis value from the provided archive and applies it to the controller. The value is expected to be stored with the key "Hysteresis".

Parameters
[in]archiveThe archive to read the hysteresis value from
Exceptions
Maythrow serialization exceptions if the archive operation fails
Maythrow controller exceptions if the deserialized value is invalid
See also
Serialize()
Since
1.8

Implements ISerializable.

◆ Get()

PEAK_COMMON_NO_DISCARD uint8_t Get ( ) const
inlineoverridevirtual

Gets the current hysteresis value.

Retrieves the currently configured hysteresis value that defines the dead zone around the target for automatic adjustments.

Returns
The current hysteresis value as a uint8_t
Exceptions
Maythrow exceptions based on the underlying controller implementation if the controller is in an invalid state.
See also
Set()
GetRange()
Since
1.8

Implements IFeature< uint8_t >.

◆ GetRange()

PEAK_COMMON_NO_DISCARD peak::common::RangeU8 GetRange ( ) const
inlineoverridevirtual

Gets the valid range for hysteresis values.

Retrieves the minimum, maximum, and increment values that are valid for the hysteresis parameter. This information can be used to validate input values or to populate user interface controls.

Returns
A RangeU8 structure containing:
  • min: Minimum valid hysteresis value
  • max: Maximum valid hysteresis value
  • inc: Increment/step size for hysteresis values
Exceptions
Maythrow exceptions based on the underlying controller implementation if the controller is in an invalid state.
See also
Set()
Get()
Since
1.8

Implements IRangeFeature< uint8_t >.

◆ Serialize()

void Serialize ( peak::common::serialization::IArchive & archive) const
inlineoverridevirtual

Serializes the current hysteresis value to an archive.

Stores the current hysteresis value in the provided archive for configuration persistence. The value is stored with the key "Hysteresis".

Parameters
[in,out]archiveThe archive to write the hysteresis value to
Exceptions
Maythrow serialization exceptions if the archive operation fails
See also
Deserialize()
Since
1.8

Implements ISerializable.

◆ Set()

void Set ( const uint8_t & value)
inlineoverridevirtual

Sets the hysteresis value.

Sets the hysteresis value that defines the dead zone around the target where no automatic adjustments will be made. This prevents oscillation and hunting behavior in automatic control systems.

Parameters
[in]valueThe hysteresis value to set. Higher values create a larger dead zone, reducing sensitivity but improving stability. The exact valid range can be obtained using GetRange().
Exceptions
Maythrow exceptions based on the underlying controller implementation if the value is outside the valid range or if the controller is in an invalid state.
See also
Get()
GetRange()
Since
1.8

Implements IFeature< uint8_t >.


The documentation for this class was generated from the following file: