FACT++  1.0
int StateMachineDimControl::InterruptScript ( const EventImp imp)

Definition at line 145 of file StateMachineDimControl.cc.

References EventImp::GetString(), and str.

Referenced by StateMachineDimControl().

146 {
147  if (!fInterruptHandler)
148  return GetCurrentState();
149 
150  string str = evt.GetString();
151 
152  const size_t p = str.find_last_of('\n');
153  if (p!=string::npos)
154  str[p] = ':';
155 
156  if (GetCurrentState()<3)
157  {
158  Warn("Interrupt request received ["+str+"]... but no running script.");
159  return GetCurrentState();
160  }
161 
162  Info("Interrupt request received ["+str+"]");
163  return fInterruptHandler(evt);
164 }
int GetCurrentState() const
return the current state of the machine
std::function< int(const EventImp &)> fInterruptHandler
char str[80]
Definition: test_client.c:7
int Warn(const std::string &str)
Definition: MessageImp.h:48
int Info(const std::string &str)
Definition: MessageImp.h:47

+ Here is the call graph for this function:

+ Here is the caller graph for this function: