Changeset 13764 for trunk/FACT++/src
- Timestamp:
- 05/17/12 20:18:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/dimctrl.cc
r13754 r13764 53 53 map<string,string> fData; 54 54 string fScript; 55 string fScriptUser; 55 56 56 57 void ProcessStart() 57 58 { 58 if (!fScript.empty() || fLabel> =0)59 if (!fScript.empty() || fLabel>-3) 59 60 { 60 61 Error("Script execution still in progress."); … … 82 83 } 83 84 85 const auto user = fData.find("user"); 86 if (user!=fData.end()) 87 fScriptUser = user->second; 88 84 89 if (fDebug) 85 90 { … … 95 100 if (getCommand()==&fDimStop) 96 101 { 97 Debug("Stop received"); 102 const string user = fDimStop.getSize()>0 ? fDimStop.getString() : ""; 103 104 string msg = "Stop received"; 105 if (!user.empty()) 106 msg += " from user '"+user+"'"; 107 108 Debug(msg); 98 109 Readline::SetLabel(-2); 99 110 } … … 110 121 "|Text[string]:A human readable string sent by the last state change."), 111 122 fDimStart("DIM_CONTROL/START", "C", this), 112 fDimStop("DIM_CONTROL/STOP", " ", this)123 fDimStop("DIM_CONTROL/STOP", "C", this) 113 124 { 114 125 } … … 181 192 182 193 msg += ": "+Readline::GetScript()+" ["; 183 if (!f User.empty())184 msg += f User+":"+pid.str();194 if (!fScriptUser.empty()) 195 msg += fScriptUser+":"+pid.str(); 185 196 msg += "]"; 186 197 … … 212 223 fVerbosity = 90; 213 224 225 fUser = conf.Get<string>("user"); 226 fScriptUser = fUser; 227 214 228 if (conf.Get<bool>("stop")) 215 return Dim::SendCommand("DIM_CONTROL/STOP" ) + 1;229 return Dim::SendCommand("DIM_CONTROL/STOP", fUser) + 1; 216 230 217 231 if (conf.Has("start")) 218 return Dim::SendCommand("DIM_CONTROL/START", conf.Get<string>("start") ) + 1;232 return Dim::SendCommand("DIM_CONTROL/START", conf.Get<string>("start")+" user="+fUser) + 1; 219 233 220 234 fVerbosity = 40; … … 238 252 239 253 fDebug = conf.Get<bool>("debug"); 240 fUser = conf.Get<string>("user");241 254 242 255 return -1; … … 253 266 Readline::Instance()->Execute(s, fData); 254 267 fScript = ""; 268 fScriptUser = fUser; 255 269 } 256 270
Note:
See TracChangeset
for help on using the changeset viewer.