init

Dependencies:   MPU6050 PinDetect circular_buffer

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Fsm.cpp Source File

Fsm.cpp

00001 #include <Moving.h>
00002 #include <Stacionary.h>
00003 #include <Fsm.h>
00004 
00005 FsmStates::FsmStates() : movingState_(new Moving(*this,timer)),
00006     stacionaryState_(new Stacionary(*this,timer))
00007 {
00008     currentState(stacionaryState());
00009 }
00010 
00011 
00012 
00013 State* FsmStates::stacionaryState()
00014 {
00015     return stacionaryState_;
00016 }
00017 
00018 State* FsmStates::movingState()
00019 {
00020     return movingState_;
00021 }
00022 
00023 State* FsmStates::currentState()
00024 {
00025     return currentState_;
00026 }
00027 void FsmStates::currentState(State* state)
00028 {
00029     currentState_ = state;
00030 }
00031 
00032 FsmStates::~FsmStates()
00033 {
00034     delete stacionaryState_;
00035     delete movingState_;
00036 }
00037 
00038 Fsm::Fsm() : states_()
00039 {
00040 
00041 
00042 }
00043 
00044 
00045