HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
HF::Interfaces::ColourControl::ITransition Struct Referenceabstract

Interface API for the Transitions. More...

#include <colour_control.h>

+ Inheritance diagram for HF::Interfaces::ColourControl::ITransition:
+ Collaboration diagram for HF::Interfaces::ColourControl::ITransition:

Public Member Functions

 ITransition (IServer &_server, uint16_t period)
 Constructor. More...
 
virtual bool run (uint16_t time)
 Run the transition. More...
 
virtual bool next ()=0
 Check if the transition should continue. More...
 

Data Fields

IServerserver
 The server instance.
 
uint16_t period
 Time period for the transition (in 100 msec units). More...
 
uint16_t remaining_time
 Remaining time until the transition is ran. More...
 

Detailed Description

Interface API for the Transitions.

A Transition is a class that knows how to update the colour attributes of the Colour Control interface in order to implement the known commands for the interface.

Definition at line 889 of file colour_control.h.

Constructor & Destructor Documentation

◆ ITransition()

HF::Interfaces::ColourControl::ITransition::ITransition ( IServer _server,
uint16_t  period 
)
inline

Constructor.

Parameters
[in]_serverserver instance.
[in]periodthe transition period.

Definition at line 902 of file colour_control.h.

902  :
904  {}
uint16_t period
Time period for the transition (in 100 msec units).
uint16_t remaining_time
Remaining time until the transition is ran.
IServer & server
The server instance.

Member Function Documentation

◆ next()

virtual bool HF::Interfaces::ColourControl::ITransition::next ( )
pure virtual

◆ run()

virtual bool HF::Interfaces::ColourControl::ITransition::run ( uint16_t  time)
inlinevirtual

Run the transition.

This will update the remaining time and check if the transition should run.

Parameters
[in]timetime elapsed time since the last call.
Return values
truerun the transition specialization.
falsedon't run the transition specialization.

Reimplemented in HF::Interfaces::ColourControl::Temperature_Transition, HF::Interfaces::ColourControl::XY_Transition_Continuous, HF::Interfaces::ColourControl::XY_Transition, HF::Interfaces::ColourControl::HS_Transition, HF::Interfaces::ColourControl::Saturation_Transition, and HF::Interfaces::ColourControl::Hue_Transition.

Definition at line 919 of file colour_control.h.

References period, and remaining_time.

920  {
921  remaining_time -= time;
922 
923  if (remaining_time == 0)
924  {
925  remaining_time = this->period;
926  return true;
927  }
928 
929  return false;
930  }
uint16_t period
Time period for the transition (in 100 msec units).
uint16_t remaining_time
Remaining time until the transition is ran.

Field Documentation

◆ period

◆ remaining_time

uint16_t HF::Interfaces::ColourControl::ITransition::remaining_time

Remaining time until the transition is ran.

Definition at line 894 of file colour_control.h.

Referenced by run().


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