FACT++  1.0
int StateMachineSmartFACT::HandleControlStateChange ( const EventImp d)
inlineprivate

Definition at line 835 of file smartfact.cc.

References DimControl::file, EventImp::GetQoS(), EventImp::GetSize(), DimState::kOffline, StateMachineImp::kSM_KeepState, DimState::last, DimControl::scriptdepth, and DimControl::shortmsg.

Referenced by StateMachineSmartFACT().

836  {
837  if (d.GetSize()==0)
839 
840  if (fDimControl.scriptdepth>0)
842 
843  if (d.GetQoS()>=2)
845 
846 #if BOOST_VERSION < 104600
847  const string file = boost::filesystem::path(fDimControl.file).filename();
848 #else
849  const string file = boost::filesystem::path(fDimControl.file).filename().string();
850 #endif
851 
852  // [0] DimControl::kIdle
853  // [1] DimControl::kLoading
854  // [2] DimControl::kCompiling
855  // [3] DimControl::kRunning
856  if (d.GetQoS()==1)
857  {
858  fControlMessageHist.clear();
859  HandleControlMessageImp(Event(d, "========================================", 41));
860  }
861 
862  HandleControlMessageImp(Event(d, ("----- "+fDimControl.shortmsg+" -----").data(), fDimControl.shortmsg.length()+13));
863  if (!file.empty() && d.GetQoS()<2)
864  HandleControlMessageImp(Event(d, file.data(), file.length()+1));
865 
866  // Note that this will also "ding" just after program startup
867  // if the dimctrl is still in state -3
868  if (d.GetQoS()==0)
869  {
870  HandleControlMessageImp(Event(d, "========================================", 41));
871  if (fDimControl.last.second!=DimState::kOffline)
872  SetAudio("ding");
873  }
874 
876  }
int scriptdepth
Definition: DimState.h:301
std::pair< Time, int32_t > last
Definition: DimState.h:64
std::string shortmsg
Definition: DimState.h:300
virtual int GetQoS() const
Definition: EventImp.h:58
void SetAudio(const string &name)
Definition: smartfact.cc:615
Concerete implementation of an EventImp stroring name, format, data and time.
Definition: Event.h:6
std::string file
Definition: DimState.h:299
DimControl fDimControl
Definition: smartfact.cc:624
EventHist fControlMessageHist
Definition: smartfact.cc:527
virtual size_t GetSize() const
Definition: EventImp.h:55
void HandleControlMessageImp(const EventImp &d)
Definition: smartfact.cc:798

+ Here is the call graph for this function:

+ Here is the caller graph for this function: