- Timestamp:
- 10/23/11 15:00:51 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/ratescan.cc
r12240 r12241 91 91 uint16_t fReferenceIdx; 92 92 93 string fCommand; 94 93 95 pair<Time, int> GetNewState(DimStampedInfo &info) const 94 96 { … … 219 221 220 222 const int32_t data[2] = { -1, fThresholdMin+fCounter*fThresholdStep }; 221 DimClient::sendCommandNB( "FTM_CONTROL/SET_THRESHOLD", (void*)data, 8);223 DimClient::sendCommandNB(fCommand.c_str(), (void*)data, 8); 222 224 } 223 225 } … … 247 249 } 248 250 249 int StartRateScan(const EventImp &evt )251 int StartRateScan(const EventImp &evt, const string &command) 250 252 { 251 253 if (!CheckEventSize(evt.GetSize(), "StartRateScan", 12)) 252 254 return kSM_FatalError; 253 255 254 fThresholdMin = evt.Get<uint32_t>(); 255 fThresholdMax = evt.Get<uint32_t>(4); 256 fCommand = "FTM_CONTROL/"+command; 257 258 fThresholdMin = evt.Get<uint32_t>(); 259 fThresholdMax = evt.Get<uint32_t>(4); 256 260 fThresholdStep = evt.Get<uint32_t>(8); 257 261 262 258 263 ofstream fout("ratescan.txt", ios::app); 259 fout << "# ----- " << Time() << " -----" << endl; 264 fout << "# ----- " << Time() << " -----\n"; 265 fout << "# Command: " << fCommand << '\n'; 260 266 fout << "# Reference: "; 261 267 switch (fReference) … … 274 280 //Message("Starting Trigger (FTM)"); 275 281 //Dim::SendCommand("FTM_CONTROL/SET_PRESCALING", int32_t(20)); 276 Dim::SendCommand( "FTM_CONTROL/SET_THRESHOLD", data);282 Dim::SendCommand(fCommand, data); 277 283 //Dim::SendCommand("FTM_CONTROL/STOP_RUN"); 278 284 … … 372 378 fFTM("FTM_CONTROL/STATE", (void*)NULL, 0, this), 373 379 fRates("FTM_CONTROL/TRIGGER_RATES", (void*)NULL, 0, this), 374 fCounter(-1) 380 fCounter(-1), fReference(kCamera), fReferenceIdx(0) 375 381 { 376 382 // ba::io_service::work is a kind of keep_alive for the loop. … … 394 400 "Rate scan in progress."); 395 401 396 AddEvent("START", "I:3", kStateConnected) 397 (bind(&StateMachineRateScan::StartRateScan, this, placeholders::_1)) 398 ("Start rate scan for the defined range" 402 AddEvent("START_THRESHOLD_SCAN", "I:3", kStateConnected) 403 (bind(&StateMachineRateScan::StartRateScan, this, placeholders::_1, "SET_THRESHOLD")) 404 ("Start rate scan for the threshold in the defined range" 405 "|min[int]:Start value in DAC counts" 406 "|max[int]:Limiting value in DAC counts" 407 "|step[int]:Single step in DAC counts"); 408 409 AddEvent("START_N_OUT_OF_4_SCAN", "I:3", kStateConnected) 410 (bind(&StateMachineRateScan::StartRateScan, this, placeholders::_1, "SET_N_OUT_OF_4")) 411 ("Start rate scan for N-out-of-4 in the defined range" 399 412 "|min[int]:Start value in DAC counts" 400 413 "|max[int]:Limiting value in DAC counts"
Note:
See TracChangeset
for help on using the changeset viewer.