Changeset 12457
- Timestamp:
- 11/09/11 00:10:43 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/ratecontrol.cc
r12441 r12457 268 268 for (int i=0; i<40; i++) 269 269 { 270 if ( fabs(sdata.fBoardRate[i]-mb)< 3*db)270 if ( fabs(sdata.fBoardRate[i]-mb)<2.5*db) 271 271 { 272 272 avg += sdata.fBoardRate[i]; … … 275 275 } 276 276 277 fTriggerRate = avg /num * 40;277 fTriggerRate = avg/num * 40; 278 278 279 279 if (fVerbose) … … 284 284 } 285 285 286 if (sdata.fTriggerRate<0) 287 fTriggerRate = sdata.fTriggerRate; 288 286 289 // ---------------------- 287 290 288 if (fTriggerRate>0 && fTriggerRate<fTargetRate) 291 /* 292 if (avg>0 && avg<fTargetRate) 289 293 { 290 294 // I am assuming here (and at other places) the the answer from the FTM when setting 291 295 // the new threshold always arrives faster than the next rate update. 292 296 fThresholdMin = fThresholds[0]; 297 Out() << "Setting fThresholdMin to " << fThresholds[0] << endl; 298 } 299 */ 300 301 if (fTriggerRate>0 && fTriggerRate<fTargetRate) 302 { 303 fThresholds.assign(160, fThresholdMin); 293 304 return; 294 305 } … … 298 309 const float step = (log10(fTriggerRate)-log10(fTargetRate))/0.039 + 1; 299 310 300 const uint16_t diff = fThresholds[0]+int16_t(truncf(step)); 301 302 cout << diff << endl; 303 304 if (diff==fThresholds[0]) 311 const uint16_t diff = fThresholdMin+int16_t(truncf(step)); 312 if (diff<=fThresholdMin) 305 313 return; 306 314 … … 308 316 { 309 317 //Out() << idx/40 << "|" << (idx/4)%10 << "|" << idx%4; 310 Out() << fThreshold s[0];318 Out() << fThresholdMin; 311 319 Out() << (step>0 ? " += " : " -= "); 312 320 Out() << step << " (" << diff << ")" << endl; … … 315 323 const uint32_t val[2] = { -1, diff }; 316 324 DimClient::sendCommandNB("FTM_CONTROL/SET_THRESHOLD", (void*)val, 8); 325 326 fThresholdMin = diff; 317 327 } 318 328 … … 580 590 581 591 fThresholdReference = 300; 582 fTargetRate = 7 0;592 fTargetRate = 75; 583 593 584 594 return -1;
Note:
See TracChangeset
for help on using the changeset viewer.