Accessories
Arduino for motors and lights library.
GroupState Class Reference

#include "AccessoryGroup.hpp"

Public Member Functions

 GroupState ()
 
 GroupState (unsigned long inId, bool inSynchronous = true)
 
void begin ()
 
void StartAction ()
 
void ResetAction ()
 
bool IsActionItemPending ()
 
unsigned long GetId () const
 
void loop ()
 
void Add (Accessory *inpAccessory, ACC_STATE inState, unsigned int inDelay = 0)
 

Detailed Description

This class describes a list of accessories, with an associated state, under one and only one Id.

Definition at line 48 of file AccessoryGroup.hpp.

Constructor & Destructor Documentation

GroupState::GroupState ( )
inline

Default constructor.

Definition at line 65 of file AccessoryGroup.hpp.

GroupState::GroupState ( unsigned long  inId,
bool  inSynchronous = true 
)

Full constructor.

Parameters
inIdId of this state.
inSynchronousIf true, the movements of all accessories of the group will be done together. If false, each accessory will wait the end of the previous accessory movement (plus its delay) to start moving. Default is true.

Definition at line 47 of file AccessoryGroup.cpp.

Member Function Documentation

void GroupState::Add ( Accessory inpAccessory,
ACC_STATE  inState,
unsigned int  inDelay = 0 
)

Add a new state item.

Parameters
inpAccessoryAddress of the accessory.
inStatestate to reach.
inDelayThe delay gives a duration of the movement, to ensure that this movement is finished before starting the next one.Only used in asynchronous group state. Default is 0.

Definition at line 76 of file AccessoryGroup.cpp.

void GroupState::begin ( )

Initialize the instance.

Definition at line 54 of file AccessoryGroup.cpp.

unsigned long GroupState::GetId ( ) const
inline

Gets the id of this state.

Returns
id of this state.

Definition at line 95 of file AccessoryGroup.hpp.

bool GroupState::IsActionItemPending ( )
inline

Checks if a state item has not been executed.

Returns
true if at least one accessory should still move.

Definition at line 90 of file AccessoryGroup.hpp.

void GroupState::loop ( )

Main loop function.

Returns
true if something has been done.

Definition at line 112 of file AccessoryGroup.cpp.

void GroupState::ResetAction ( )
inline

Prepare for a future action

Remarks
Only for internal usage.

Definition at line 85 of file AccessoryGroup.hpp.

void GroupState::StartAction ( )

Starts a new action.

Remarks
Only for internal usage.

Definition at line 81 of file AccessoryGroup.cpp.


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