FACT++  1.0
template<class T , class S >
StateMachineLidControl< T, S >::StateMachineLidControl ( ostream &  out = cout)
inline

Definition at line 578 of file lidctrl.cc.

References StateMachineLidControl< T, S >::Close(), Lid::State::kClosed, Lid::State::kConnected, Lid::State::kDisconnected, Lid::State::kInconsistent, Lid::State::kLocked, Lid::State::kMoving, Lid::State::kOpen, Lid::State::kOvercurrent, Lid::State::kPowerProblem, Lid::State::kUnidentified, Lid::State::kUnknown, StateMachineLidControl< T, S >::Open(), StateMachineLidControl< T, S >::Post(), StateMachineLidControl< T, S >::SetVerbosity(), and StateMachineLidControl< T, S >::Unlock().

578  :
579  StateMachineAsio<T>(out, "LID_CONTROL"), fLid(*this, *this),
580  fSunRise(Time().GetNextSunRise(-6))
581  {
582  // State names
583  T::AddStateName(Lid::State::kDisconnected, "NoConnection",
584  "No connection to web-server could be established recently");
585 
586  T::AddStateName(Lid::State::kConnected, "Connected",
587  "Connection established, but status still not known");
588 
589  T::AddStateName(Lid::State::kUnidentified, "Unidentified",
590  "At least one lid reported a state which could not be identified by lidctrl");
591 
592  T::AddStateName(Lid::State::kInconsistent, "Inconsistent",
593  "Both lids show different states");
594 
595  T::AddStateName(Lid::State::kUnknown, "Unknown",
596  "Arduino reports at least one lids in an unknown status");
597 
598  T::AddStateName(Lid::State::kPowerProblem, "PowerProblem",
599  "Arduino reports both lids to have a power problem (might also be that both are at the end switches)");
600 
601  T::AddStateName(Lid::State::kOvercurrent, "Overcurrent",
602  "Arduino reports both lids to have a overcurrent (might also be that both are at the end switches)");
603 
604  T::AddStateName(Lid::State::kClosed, "Closed",
605  "Both lids are closed");
606 
607  T::AddStateName(Lid::State::kOpen, "Open",
608  "Both lids are open");
609 
610  T::AddStateName(Lid::State::kMoving, "Moving",
611  "Lids are supposed to move, waiting for next status");
612 
613  T::AddStateName(Lid::State::kLocked, "Locked",
614  "Locked, no commands accepted except UNLOCK.");
615 
616 
617  // Verbosity commands
618  T::AddEvent("SET_VERBOSE", "B")
619  (bind(&StateMachineLidControl::SetVerbosity, this, placeholders::_1))
620  ("set verbosity state"
621  "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data");
622 
624  (bind(&StateMachineLidControl::Open, this))
625  ("Open the lids");
626 
628  (bind(&StateMachineLidControl::Close, this))
629  ("Close the lids");
630 
632  (bind(&StateMachineLidControl::Post, this, placeholders::_1))
633  ("set verbosity state"
634  "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data");
635 
636  T::AddEvent("UNLOCK", Lid::State::kLocked)
637  (bind(&StateMachineLidControl::Unlock, this))
638  ("Unlock if in locked state.");
639  }
int Post(const EventImp &evt)
Definition: lidctrl.cc:500
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
int SetVerbosity(const EventImp &evt)
Definition: lidctrl.cc:490

+ Here is the call graph for this function: