#include "AccessoryGroup.hpp"
Public Member Functions | |
void | begin () |
void | AddState (GroupState *inpState) |
void | AddState (unsigned long inId, bool inSynchronous = true) |
void | AddStateItem (unsigned long inId, Accessory &inAccessory, ACC_STATE inState, unsigned int inDelay = 0) |
void | AddRange (const AccessoryGroup &inGroup) |
GroupState * | GetByID (unsigned long inId) const |
ACCSCHAINEDLISTITEM< GroupState > * | GetItemByID (unsigned long inId) const |
void | Event (unsigned long inId, ACCESSORIES_EVENT_TYPE inEvent = ACCESSORIES_EVENT_MOVEPOSITIONID, int inData = 0) |
void | StartAction (GroupState *inpState) |
void | ResetAction () |
bool | IsActionItemPending () |
bool | loop () |
bool | Toggle (unsigned long inId) |
int | EEPROMSave (int inPos, bool inSimulate = false) |
int | EEPROMLoad (int inPos) |
Static Public Member Functions | |
static void | EventAll (unsigned long inId, ACCESSORIES_EVENT_TYPE inEvent = ACCESSORIES_EVENT_MOVEPOSITIONID, int inData = 0) |
static bool | loops () |
static uint8_t | GetCount () |
static int | EEPROMSaveAll (int inPos, bool inSimulate = false) |
static int | EEPROMLoadAll (int inPos) |
This class describes a group of accessories. Each group defines some GroupState to set multiple accessories states with only one Id.
Definition at line 120 of file AccessoryGroup.hpp.
void AccessoryGroup::AddRange | ( | const AccessoryGroup & | inGroup | ) |
Insert a full group into this one.
inGroup | group to insert. All states of inGroup will be added to this group. |
Definition at line 204 of file AccessoryGroup.cpp.
|
inline |
Add a new state.
inpState | Address of the GroupState to add. |
Definition at line 140 of file AccessoryGroup.hpp.
|
inline |
Add a new state.
inId | id of this state. |
inSynchronous |
Definition at line 146 of file AccessoryGroup.hpp.
void AccessoryGroup::AddStateItem | ( | unsigned long | inId, |
Accessory & | inAccessory, | ||
ACC_STATE | inState, | ||
unsigned int | inDelay = 0 |
||
) |
Add a new state item, into the state of the given id.
inId | id of the state to complete. |
inAccessory | Accessory. |
inState | state to reach. |
inDelay | The 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 171 of file AccessoryGroup.cpp.
void AccessoryGroup::begin | ( | ) |
Initialize the instance.
Definition at line 164 of file AccessoryGroup.cpp.
int AccessoryGroup::EEPROMLoad | ( | int | inPos | ) |
Reload the data of the group from the EEPROM.
|
static |
Reload the data of all the groups from the EEPROM.
int AccessoryGroup::EEPROMSave | ( | int | inPos, |
bool | inSimulate = false |
||
) |
Save the data of this group in the EEPROM.
|
static |
Save the data of all the groups in the EEPROM.
void AccessoryGroup::Event | ( | unsigned long | inId, |
ACCESSORIES_EVENT_TYPE | inEvent = ACCESSORIES_EVENT_MOVEPOSITIONID , |
||
int | inData = 0 |
||
) |
Execute a new event. Nothing appends if the Id is not in this group.
inId | Id of an accessory or an accessory item. |
inEvent | Type of the new event. Default is ACCESSORIES_EVENT_MOVEPOSITIONID. |
inData | Associated data to the event type. Default is 0. |
Definition at line 339 of file AccessoryGroup.cpp.
|
static |
Loop through all AccessoryGroup and execute a new event.
inId | Id of an accessory or an accessory item. |
inEvent | Type of the new event. Default is ACCESSORIES_EVENT_MOVEPOSITIONID. |
inData | Associated data to the event type. Default is 0. |
Definition at line 314 of file AccessoryGroup.cpp.
GroupState * AccessoryGroup::GetByID | ( | unsigned long | inId | ) | const |
Gets a state by seraching an id.
inId | Id to found. |
Definition at line 228 of file AccessoryGroup.cpp.
|
static |
Get the total number of groups.
Definition at line 215 of file AccessoryGroup.cpp.
ACCSCHAINEDLISTITEM< GroupState > * AccessoryGroup::GetItemByID | ( | unsigned long | inId | ) | const |
Gets the item list from a given GroupState idenitifed by its id.
inId | Id to found. |
Definition at line 238 of file AccessoryGroup.cpp.
bool AccessoryGroup::IsActionItemPending | ( | ) |
Checks if a state item has not been executed.
Definition at line 252 of file AccessoryGroup.cpp.
bool AccessoryGroup::loop | ( | ) |
Main loop function.
Definition at line 281 of file AccessoryGroup.cpp.
|
static |
Do movements of all the groups.
Definition at line 294 of file AccessoryGroup.cpp.
|
inline |
Prepare for a future action
Definition at line 195 of file AccessoryGroup.hpp.
void AccessoryGroup::StartAction | ( | GroupState * | inpState | ) |
Starts a new action.
inpState | address of the starting state. |
Definition at line 257 of file AccessoryGroup.cpp.
bool AccessoryGroup::Toggle | ( | unsigned long | inId | ) |
Move to the next GroupState.
Definition at line 344 of file AccessoryGroup.cpp.