FACT++  1.0
int StateMachineDimControl::StartScript ( const EventImp imp,
const std::string &  cmd 
)

Definition at line 91 of file StateMachineDimControl.cc.

References data, Debug, Error(), EventImp::GetSize(), EventImp::GetString(), Readline::SetExternalInput(), and Tools::Split().

Referenced by StateMachineDimControl().

92 {
93  string opt(imp.GetString());
94 
95  const map<string,string> data = Tools::Split(opt, true);
96  if (imp.GetSize()==0 || opt.size()==0 || opt[0]==0)
97  {
98  Error("File name missing in DIM_CONTROL/START");
99  return GetCurrentState();
100  }
101 
102  if (fDebug)
103  Debug("Start '"+opt+"' received.");
104 
105  if (fDebug)
106  Debug("Received data: "+imp.GetString());
107 
108  const auto user = data.find("user");
109  fScriptUser = user==data.end() ? fUser : user->second;
110 
111  if (fDebug)
112  {
113  for (auto it=data.begin(); it!=data.end(); it++)
114  Debug(" Arg: "+it->first+" = "+it->second);
115  }
116 
117  string emit = cmd+imp.GetString();
118  if (cmd==".js ")
119  emit += fArgumentsJS;
120 
122  return GetCurrentState();
123 }
int GetCurrentState() const
return the current state of the machine
int Debug(const std::string &str)
Definition: MessageImp.h:45
std::string GetString() const
Definition: EventImp.cc:194
std::string fArgumentsJS
Default arguments provided to very java script.
int Error(const std::string &str)
Definition: MessageImp.h:49
std::map< std::string, std::string > Split(std::string &, bool=false)
Definition: tools.cc:230
static void SetExternalInput(const std::string &inp)
Definition: Readline.h:116
float data[4 *1440]
virtual size_t GetSize() const
Definition: EventImp.h:55

+ Here is the call graph for this function:

+ Here is the caller graph for this function: