Changeset 11498 for trunk/FACT++/src/mcp.cc
- Timestamp:
- 07/20/11 20:20:31 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/mcp.cc
r11494 r11498 211 211 } 212 212 213 string fRunType; 213 uint64_t fMaxTime; 214 uint64_t fNumEvents; 215 string fRunType; 214 216 215 217 int StartRun(const EventImp &evt) 216 218 { 217 Message("Starting configuration '"+evt.GetString()+"' for new run."); 218 fRunType = evt.GetString(); 219 fMaxTime = evt.Get<int64_t>(); 220 fNumEvents = evt.Get<int64_t>(8); 221 fRunType = evt.Ptr<char>(16); 222 223 ostringstream str; 224 str << "Starting configuration '" << fRunType << "' for new run"; 225 if (fNumEvents>0 || fMaxTime>0) 226 str << " ["; 227 str << fNumEvents << " events" 228 if (fNumEvents>0 && fMaxTime>0) 229 str << " / "; 230 if (fMaxTime>0) 231 str << fMaxTime << "s"; 232 if (fNumEvents>0 || fMaxTime>0) 233 str << "]"; 234 Message(str); 235 219 236 return kStateConfiguring1; 237 } 238 239 void ConfigureFAD() 240 { 241 struct Value 242 { 243 uint64_t time; 244 uint64_t nevts; 245 char type[]; 246 }; 247 248 const size_t len = sizeof(Value)+fRunType.length()+1; 249 250 char *buf = new char[len]; 251 252 Value *val = reinterpret_cast<Value*>(buf); 253 254 val->time = fMaxTime; 255 val->nevts = fNumEvents; 256 257 strcpy(val->type, fRunType.c_str()); 258 259 Dim::SendCommand("FAD_CONTROL/CONFIGURE", buf, len); 260 261 delete buf; 220 262 } 221 263 … … 251 293 return GetCurrentState(); 252 294 253 Dim::SendCommand("FAD_CONTROL/CONFIGURE", fRunType); 295 Message("Starting FAD"); 296 ConfigureFAD(); 254 297 return kStateConfiguring3; 255 298 } … … 261 304 return GetCurrentState(); 262 305 263 Message("START DATA TAKING"); 264 Fatal("Distribute run-number to start datalogger!"); 265 //Fatal("Must configure if FTM should be started or not?"); 306 Message("Starting Trigger (FTM)"); 266 307 Dim::SendCommand("FTM_CONTROL/START_RUN"); 267 308 return kStateConfigured; … … 343 384 344 385 345 AddEvent("START", " C", kStateIdle)386 AddEvent("START", "X:2;C")//, kStateIdle) 346 387 (bind(&StateMachineMCP::StartRun, this, placeholders::_1)) 347 388 ("");
Note:
See TracChangeset
for help on using the changeset viewer.