Loading [MathJax]/extensions/tex2jax.js
ProtoTracer  1.0
Real-time 3D rendering and animation engine
All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Pages
Controller Class Referenceabstract

Base class for managing brightness and display operations of lighting controllers. More...

#include <Controller.h>

Inheritance diagram for Controller:
Collaboration diagram for Controller:

Public Member Functions

virtual void Initialize ()=0
 Initializes the controller.
 
virtual void Display ()=0
 Updates and displays content on the lighting system.
 
uint8_t GetBrightness ()
 Retrieves the current brightness level.
 
uint8_t GetAccentBrightness ()
 Retrieves the current accent brightness level.
 
virtual void SetBrightness (uint8_t maxBrightness)=0
 Sets the maximum brightness for the controller.
 
virtual void SetAccentBrightness (uint8_t maxAccentBrightness)=0
 Sets the maximum accent brightness for the controller.
 

Protected Member Functions

 Controller (CameraManager *cameras, uint8_t maxBrightness, uint8_t maxAccentBrightness)
 Constructs a Controller with specified parameters.
 
void UpdateBrightness ()
 Updates the brightness based on internal logic.
 

Protected Attributes

CameraManagercameras
 Pointer to the CameraManager for managing camera data.
 
uint8_t brightness
 Current brightness level.
 
uint8_t accentBrightness
 Current accent brightness level.
 
uint8_t maxBrightness
 Maximum allowed brightness level.
 
uint8_t maxAccentBrightness
 Maximum allowed accent brightness level.
 
bool isOn = false
 Indicates if the controller is active.
 
bool startTime = false
 Indicates if the start time has been recorded.
 

Private Attributes

const uint32_t softStart = 5000000
 Duration for soft start in microseconds.
 
uint32_t previousTime
 Tracks the last update time.
 

Detailed Description

Base class for managing brightness and display operations of lighting controllers.

The Controller class provides an abstract interface and shared functionality for managing lighting systems, including brightness adjustment and display updates.

Definition at line 25 of file Controller.h.

Constructor & Destructor Documentation

◆ Controller()

Controller ( CameraManager cameras,
uint8_t  maxBrightness,
uint8_t  maxAccentBrightness 
)
protected

Constructs a Controller with specified parameters.

Parameters
camerasPointer to the CameraManager.
maxBrightnessMaximum brightness for the controller.
maxAccentBrightnessMaximum accent brightness for the controller.

Definition at line 3 of file Controller.cpp.

References cameras, maxAccentBrightness, and maxBrightness.

Member Function Documentation

◆ Display()

◆ GetAccentBrightness()

uint8_t GetAccentBrightness ( )

Retrieves the current accent brightness level.

Returns
The current accent brightness as an 8-bit value.

Definition at line 29 of file Controller.cpp.

References accentBrightness.

◆ GetBrightness()

uint8_t GetBrightness ( )

Retrieves the current brightness level.

Returns
The current brightness as an 8-bit value.

Definition at line 25 of file Controller.cpp.

References brightness.

◆ Initialize()

◆ SetAccentBrightness()

virtual void SetAccentBrightness ( uint8_t  maxAccentBrightness)
pure virtual

Sets the maximum accent brightness for the controller.

Parameters
maxAccentBrightnessThe maximum accent brightness value (0-255). This is the secondary display if available.

Implemented in HUB75ControllerSplit, APA102Controller, HUB75Controller, HUB75ControllerSquare, WS35BetaController, and WS35Controller.

◆ SetBrightness()

virtual void SetBrightness ( uint8_t  maxBrightness)
pure virtual

Sets the maximum brightness for the controller.

Parameters
maxBrightnessThe maximum brightness value (0-255).

Implemented in HUB75ControllerSplit, APA102Controller, HUB75Controller, HUB75ControllerSquare, WS35BetaController, and WS35Controller.

◆ UpdateBrightness()

Member Data Documentation

◆ accentBrightness

◆ brightness

◆ cameras

◆ isOn

◆ maxAccentBrightness

◆ maxBrightness

◆ previousTime

uint32_t previousTime
private

Tracks the last update time.

Definition at line 28 of file Controller.h.

Referenced by UpdateBrightness().

◆ softStart

const uint32_t softStart = 5000000
private

Duration for soft start in microseconds.

Definition at line 27 of file Controller.h.

Referenced by UpdateBrightness().

◆ startTime

bool startTime = false
protected

Indicates if the start time has been recorded.

Definition at line 37 of file Controller.h.

Referenced by UpdateBrightness().


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