LCC Fusion Project 1.0
LCC Automation
Loading...
Searching...
No Matches
FunctionsState Class Reference

#include <DCCpp.hpp>

Public Member Functions

 FunctionsState ()
 
void clear ()
 
void activate (byte inFunctionNumber)
 
void inactivate (byte inFunctionNumber)
 
bool isActivated (byte inFunctionNumber)
 
void statesSent ()
 
bool isActivationChanged (byte inFunctionNumber)
 

Private Attributes

byte activeFlags [4]
 
byte activeFlagsSent [4]
 

Detailed Description

This is a class to handle decoder functions. An instance of this class handle the status of the functions of one decoder. A function can be active or not.

Definition at line 16 of file DCCpp.hpp.

Constructor & Destructor Documentation

◆ FunctionsState()

FunctionsState::FunctionsState ( )

Initialize the instance.

Definition at line 46 of file DCCpp.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ activate()

void FunctionsState::activate ( byte  inFunctionNumber)

Activate one function. The allowed number goes from 0 to 28, maximum for DCC.

Parameters
inFunctionNumberNumber of the function to activate.

Definition at line 60 of file DCCpp.cpp.

◆ clear()

void FunctionsState::clear ( )

Reset all functions to inactive.

Definition at line 50 of file DCCpp.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ inactivate()

void FunctionsState::inactivate ( byte  inFunctionNumber)

Inactivate one function. The allowed number goes from 0 to 28, maximum for DCC.

Parameters
inFunctionNumberNumber of the function to inactivate.

Definition at line 64 of file DCCpp.cpp.

◆ isActivated()

bool FunctionsState::isActivated ( byte  inFunctionNumber)

Check if the given function is activated. The allowed number goes from 0 to 28, maximum for DCC.

Parameters
inFunctionNumberNumber of the function to activate.
Returns
True if the given function is activated.

Definition at line 68 of file DCCpp.cpp.

Here is the caller graph for this function:

◆ isActivationChanged()

bool FunctionsState::isActivationChanged ( byte  inFunctionNumber)

Check if the given function had its activation flag changed when sent to the decoder last time. The allowed number goes from 0 to 28, maximum for DCC.

Parameters
inFunctionNumberNumber of the function to check.
Returns
True if the given function activation flag is different between activFlags and sentActiveFlags.

Definition at line 72 of file DCCpp.cpp.

Here is the call graph for this function:

◆ statesSent()

void FunctionsState::statesSent ( )

Copy the current active flags into 'sent' active flags.

Definition at line 76 of file DCCpp.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ activeFlags

byte FunctionsState::activeFlags[4]
private

Four bytes : 32 bits : from function 0 to 28, maximum for DCC. A bit at true is an activated function.

Definition at line 21 of file DCCpp.hpp.

◆ activeFlagsSent

byte FunctionsState::activeFlagsSent[4]
private

This is the last states sent to the decoder by DCC. Used to be sure to send only changed states.

Definition at line 26 of file DCCpp.hpp.


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