Changeset 11498 for trunk/FACT++/src
- Timestamp:
- 07/20/11 20:20:31 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/fadctrl.cc
r11483 r11498 1066 1066 int StartConfigure(const EventImp &evt) 1067 1067 { 1068 const string name = evt. GetText();1068 const string name = evt.Ptr<char>(16); 1069 1069 1070 1070 fTargetConfig = fConfigs.find(name); … … 1075 1075 } 1076 1076 1077 const uint32_t runno = StartNewRun( );1077 const uint32_t runno = StartNewRun(evt.Get<uint64_t>(), evt.Get<uint64_t>(8)); 1078 1078 1079 1079 ostringstream str; … … 1616 1616 "|val[short]:Value to be set"); 1617 1617 1618 T::AddEvent("CONFIGURE", " C", FAD::kConnected, FAD::kConfigured)1618 T::AddEvent("CONFIGURE", "X:2;C", FAD::kConnected, FAD::kConfigured) 1619 1619 (bind(&StateMachineFAD::StartConfigure, this, placeholders::_1)) 1620 1620 (""); -
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.