- Timestamp:
- 06/08/13 12:56:21 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/ratecontrol.cc
r16772 r16778 131 131 132 132 // RETUNR VALUE 133 voidStep(int idx, float step)133 int32_t Step(int idx, float step) 134 134 { 135 135 uint16_t diff = fThresholds[idx]+int16_t(truncf(step)); … … 138 138 139 139 if (diff==fThresholds[idx]) 140 return ;140 return -1; 141 141 142 142 if (fVerbose) … … 147 147 } 148 148 149 const uint32_t val[2] = { idx, diff };150 Dim::SendCommandNB("FTM_CONTROL/SET_THRESHOLD", val);149 //const uint32_t val[2] = { idx, diff }; 150 //Dim::SendCommandNB("FTM_CONTROL/SET_THRESHOLD", val); 151 151 152 152 fBlock[idx/4] = true; 153 154 return diff; 153 155 } 154 156 … … 186 188 if (fVerbose) 187 189 Out() << Tools::Form("Board: Med=%3.1f +- %3.1f Patch: Med=%3.1f +- %3.1f", mb, db, mp, dp) << endl; 190 191 vector<int32_t> newth(160, -1); 188 192 189 193 for (int i=0; i<40; i++) … … 225 229 const float step = (log10(sdata.fPatchRate[i*4+j])-log10(mp+3.5*dp))/0.039; 226 230 // * (dif-5)/dif 227 Step(i*4+j, step);231 newth[i*4+j] = Step(i*4+j, step); 228 232 continue; 229 233 } … … 233 237 { 234 238 const float step = (log10(sdata.fPatchRate[i*4+j])-log10(mp+3.5*dp))/0.039; 235 Step(i*4+j, step);239 newth[i*4+j] = Step(i*4+j, step); 236 240 continue; 237 241 } 238 242 239 243 const float step = -1.5*(log10(mp+dp)-log10(mp))/0.039; 240 Step(i*4+j, step);244 newth[i*4+j] = Step(i*4+j, step); 241 245 } 242 // SET_SELECTED_THRESHOLDS 243 244 } 246 } 247 248 // WARNING: By _not_ updating fThresholds here, we assume 249 // the the returned static data block is received before the 250 // next update. If not, we will just skip these patches (block 251 // condition) and send the same update next time again. 252 if (std::count(newth.begin(), newth.end(), -1)!=160) 253 Dim::SendCommandNB("FTM_CONTROL/SET_SELECTED_THRESHOLDS", newth); 245 254 } 246 255 … … 535 544 vector<int32_t> val(160, fThresholdMin); 536 545 std::copy(fThresholds.begin(), fThresholds.end(), val.begin()); 537 Dim::SendCommandNB("FTM_CONTROL/SET_ALL_THRESHOLDS", val .data(), val.size()*sizeof(int32_t));546 Dim::SendCommandNB("FTM_CONTROL/SET_ALL_THRESHOLDS", val); 538 547 539 548
Note:
See TracChangeset
for help on using the changeset viewer.