Changeset 11876 for trunk/FACT++/gui/QCameraWidget.cc
- Timestamp:
- 08/10/11 16:33:30 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/QCameraWidget.cc
r11875 r11876 323 323 void QCameraWidget::SetMin(int64_t min) 324 324 { 325 cout << "min: " << min << endl; 325 326 fMin = min; 326 327 pixelColorUpToDate = false; … … 330 331 void QCameraWidget::SetMax(int64_t max) 331 332 { 333 cout << "max: " << max << endl; 332 334 fMax = max; 333 335 pixelColorUpToDate = false; … … 356 358 double dmin = fData[0]; 357 359 double dmax = fData[0]; 358 if (fMin < 0 && fMax < 0) 359 for (int i=0;i<1440;i++) 360 if (fMin < 0 || fMax < 0) 360 361 { 361 if (!fEnable[i]) continue; 362 if (fData[i] > dmax) dmax = fData[i]; 363 if (fData[i] < dmin) dmin = fData[i]; 362 for (int i=0;i<ACTUAL_NUM_PIXELS;i++) 363 { 364 if (!fEnable[i]) continue; 365 if (fData[i] > dmax) dmax = fData[i]; 366 if (fData[i] < dmin) dmin = fData[i]; 367 } 364 368 } 365 369 if (fMin >= 0) dmin = fMin; 366 370 if (fMax >= 0) dmax = fMax; 371 // cout << "min: " << dmin << " max: " << dmax << " fMin: " << fMin << " fMax: " << fMax << endl; 367 372 float color; 368 373 for (int i=0;i<ACTUAL_NUM_PIXELS;i++) … … 433 438 rms = 0; 434 439 median = 0; 435 set<float> medianSet;440 multiset<double> medianSet; 436 441 for (int i=0;i<ACTUAL_NUM_PIXELS;i++) 437 442 { … … 442 447 mean += fData[i]; 443 448 rms += fData[i]*fData[i]; 444 medianSet.insert( (float)(fData[i]));449 medianSet.insert(fData[i]); 445 450 } 446 451 mean /= ACTUAL_NUM_PIXELS; 447 452 rms /= ACTUAL_NUM_PIXELS; 448 453 rms = sqrt(rms); 449 set<float>::iterator it = medianSet.begin(); 454 // cout << "Size of the set: " << medianSet.size() << endl; 455 multiset<double>::iterator it = medianSet.begin(); 450 456 for (int i=0;i<(ACTUAL_NUM_PIXELS/2)-1;i++) 451 457 it++; … … 520 526 glPopMatrix(); 521 527 } 522 void QCameraWidget::setUnits( string& units)528 void QCameraWidget::setUnits(const string& units) 523 529 { 524 530 unitsText = units; 525 531 } 526 void QCameraWidget::setTitle( string& title)532 void QCameraWidget::setTitle(const string& title) 527 533 { 528 534 titleText = title;
Note:
See TracChangeset
for help on using the changeset viewer.