20 DBFUNCCALLln(
"HoistCtrl::loop()");
25 DBFUNCCALLln(
"HoistCtrl::loop(Event)");
35 DBFUNCCALL(
"HoistCtrl::process ")
111 DBSTATUSln(
"Hoist Entering State: low");
118 DBINFO1ln(
"Hoist State: low");
124 DBSTATUSln(
"Hoist Leaving State: low");
129 DBSTATUSln(
"Hoist Entering State: raising");
137 DBINFO1ln(
"Hoist State: raising");
146 DBSTATUSln(
"Hoist Leaving State: raising");
152 DBSTATUSln(
"Hoist Entering State: high");
159 DBINFO1ln(
"Hoist State: high");
165 DBSTATUSln(
"Hoist Leaving State: high");
170 DBSTATUSln(
"Hoist Entering State: lowering");
178 DBINFO1ln(
"Hoist State: lowering");
187 DBSTATUSln(
"Hoist Leaving State: lowering");
193 DBSTATUSln(
"Hoist Entering State: errorState");
201 DBINFO1ln(
"Hoist State: errorState");
207 DBSTATUSln(
"Hoist Leaving State: errorState");
212 DBERROR(
"Entering State: resetState");
219 DBINFO1ln(
"State: resetState");
228 DBSTATUSln(
"Leaving State: resetState");
239 return "State::raising";
241 return "State::high";
244 return "State::lowering";
247 return "State::errorState";
250 return "State::resetState";
253 return "ERROR: No matching state";
261 return "Event::Raise";
264 return "Event::Lower";
267 return "Event::PosReached";
270 return "Event::Error";
273 return "Event::Resume";
276 return "Event::Reset";
279 return "Event::NoEvent";
282 return "ERROR: No matching event";
void exitAction_errorState()
exit action of the errorState state.
HoistCtrl::Event doAction_resetState()
main action of the resetState
void process(Event e)
changes the state of the FSM based on the event
void entryAction_high()
executes the entry action of the high state.
void detach()
detach servo from servopin
Event currentEvent
holds the current event of the FSM
HoistCtrl::Event doAction_lowering()
executes the main action of the lowering state.
Contains the FSM for the Hoist.
String decodeEvent(Event event)
Decodes the Event-Enum and returns a description.
HoistCtrl()
Construct a new Hoist Ctrl object and initailize the currentState with low state.
void exitAction_high()
executes the exit action of the high state.
HoistCtrl::Event doAction_high()
executes the main action of the high state.
const State getcurrentState()
Get the current State.
bool lower()
Lower the Hoist 1° per servodelay/call until it's at positionMin.
void entryAction_lowering()
executes the entry action of the lowering state.
Ext.: Reset after Error occured.
Signal: Position reached.
void entryAction_raising()
executes the entry action of the raising state.
State currentState
holds the current state of the FSM
HoistCtrl::Event doAction_errorState()
main action of the errorState state.
void entryAction_errorState()
entry action of the errorState state.
Ext.: Resume after Error occured.
HoistCtrl::Event doAction_raising()
executes the main action of the raising state.
void exitAction_raising()
executes the exit action of the raising state.
String decodeState(State state)
Decodes the State-Enum and returns a description.
State lastStateBevorError
holds the last state of the FSM so it's possible to resume after error
Event
Enum holds all possible events.
void exitAction_resetState()
exit action of the resetState
bool raise()
Raise the Hoist 1° per servodelay/call until it's at positionMax.
The Hoist-Controll class contains the FSM for the Hoist.
State
Enum holds all possible states for the Hoist.
Hoist pHoist
Hoist Object.
void loop()
Calls the do-function of the active state and hence generates Events.
Event(HoistCtrl::* doActionFPtr)(void)
Functionpointer to call the current states do-function.
void exitAction_lowering()
executes the exit action of the lowering state.
void entryAction_low()
executes the entry action of the low state.
void attach()
attache servo to servopin
void exitAction_low()
executes the exit action of the low state.
HoistCtrl::Event doAction_low()
executes the main action of the low state.
void entryAction_resetState()
entry action of the resetState