Changeset 11941 for trunk/FACT++
- Timestamp:
- 09/02/11 09:34:54 (13 years ago)
- Location:
- trunk/FACT++/gui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/BasicGlCamera.cc
r11917 r11941 24 24 fMin = -1; 25 25 fMax = -1; 26 autoRefresh = false; 26 27 logScale = false; 27 28 cameraRotation = 0; … … 260 261 { 261 262 } 263 void BasicGlCamera::setPatchColor(int id, float color[3]) 264 { 265 for (int i=0;i<9;i++) 266 for (int j=0;j<3;j++) 267 pixelsColor[softwareMapping[patches[id][i]]][j] = color[j]; 268 } 262 269 void BasicGlCamera::setUnits(const string& units) 263 270 { 264 271 unitsText = units; 265 272 pixelColorUpToDate = false; 266 if (isVisible() )273 if (isVisible() && autoRefresh) 267 274 updateGL(); 268 275 } … … 271 278 titleText = title; 272 279 pixelColorUpToDate = false; 273 if (isVisible() )280 if (isVisible() && autoRefresh) 274 281 updateGL(); 275 282 } … … 278 285 fWhite = idx; 279 286 fWhitePatch = pixelsPatch[fWhite]; 280 if (isVisible() )287 if (isVisible() && autoRefresh) 281 288 updateGL(); 282 289 // CalculatePatchColor(); … … 287 294 fMin = min; 288 295 pixelColorUpToDate = false; 289 if (isVisible() )296 if (isVisible() && autoRefresh) 290 297 updateGL(); 291 298 } … … 295 302 fMax = max; 296 303 pixelColorUpToDate = false; 297 if (isVisible() )304 if (isVisible() && autoRefresh) 298 305 updateGL(); 299 306 } … … 304 311 pixelColorUpToDate = false; 305 312 emit colorPaletteHasChanged(); 306 if (isVisible() )313 if (isVisible() && autoRefresh) 307 314 updateGL(); 308 315 } … … 355 362 356 363 357 int textLength = titleText.size();364 // int textLength = titleText.size(); 358 365 renderText(-shownSizex/2.f + shiftx, shownSizey/2.f - textSize*pixelSize - shifty, 0.f, QString(titleText.c_str())); 359 366 360 367 glPopMatrix(); 368 369 textSize = (int)(600*14/600); 370 setFont(QFont("Times", textSize)); 361 371 } 362 372 void BasicGlCamera::DrawScale() … … 421 431 else 422 432 value = (float)(i)/10.f; 423 float y = -shownSizey/2.f + value*shownSizey;424 glVertex2f(oneX, y );425 glVertex2f(twoX, y );433 float yy = -shownSizey/2.f + value*shownSizey; 434 glVertex2f(oneX, yy); 435 glVertex2f(twoX, yy); 426 436 } 427 437 glEnd(); … … 435 445 pixelColorUpToDate = false; 436 446 emit colorPaletteHasChanged(); 437 if (isVisible() )447 if (isVisible() && autoRefresh) 438 448 updateGL(); 439 449 } … … 455 465 emit colorPaletteHasChanged(); 456 466 457 if (isVisible() )467 if (isVisible() && autoRefresh) 458 468 updateGL(); 459 469 } … … 475 485 emit colorPaletteHasChanged(); 476 486 477 if (isVisible() )487 if (isVisible() && autoRefresh) 478 488 updateGL(); 479 489 } … … 495 505 emit colorPaletteHasChanged(); 496 506 497 if (isVisible() )507 if (isVisible() && autoRefresh) 498 508 updateGL(); 499 509 } … … 515 525 emit colorPaletteHasChanged(); 516 526 517 if (isVisible()) 527 if (isVisible() && autoRefresh) 528 updateGL(); 529 } 530 void BasicGlCamera::SetAutoRefresh(bool on) 531 { 532 autoRefresh = on; 533 if (isVisible() && autoRefresh) 518 534 updateGL(); 519 535 } … … 523 539 cameraRotation = 0; 524 540 pixelColorUpToDate = false; 525 if (isVisible() )541 if (isVisible() && autoRefresh) 526 542 updateGL(); 527 543 } … … 531 547 cameraRotation = 90; 532 548 pixelColorUpToDate = false; 533 if (isVisible() )549 if (isVisible() && autoRefresh) 534 550 updateGL(); 535 551 } … … 539 555 cameraRotation = -90; 540 556 pixelColorUpToDate = false; 541 if (isVisible() )557 if (isVisible() && autoRefresh) 542 558 updateGL(); 543 559 } … … 625 641 } 626 642 627 void BasicGlCamera::mousePressEvent(QMouseEvent * cEvent)628 { 629 630 } 631 void BasicGlCamera::mouseMoveEvent(QMouseEvent * cEvent)632 { 633 634 } 635 void BasicGlCamera::mouseDoubleClickEvent(QMouseEvent * cEvent)643 void BasicGlCamera::mousePressEvent(QMouseEvent *) 644 { 645 646 } 647 void BasicGlCamera::mouseMoveEvent(QMouseEvent *) 648 { 649 650 } 651 void BasicGlCamera::mouseDoubleClickEvent(QMouseEvent *) 636 652 { 637 653 -
trunk/FACT++/gui/BasicGlCamera.h
r11917 r11941 74 74 void SetMin(int64_t min); 75 75 void SetMax(int64_t max); 76 void SetAutoRefresh(bool on); 76 77 77 78 float ss[5];// = {0.00, 0.25, 0.5, 0.75, 1.00}; … … 108 109 virtual void drawCamera(bool alsoWire); 109 110 virtual void drawPatches(); 110 int PixelAtPosition(const QPoint &pos); 111 virtual void setPatchColor(int id, float color[3]); 112 virtual int PixelAtPosition(const QPoint &pos); 111 113 void drawHexagon(int index, bool solid); 112 114 … … 130 132 float pixelSize; 131 133 void DrawCameraText(); 132 v oid UpdateText();134 virtual void UpdateText(); 133 135 void DrawScale(); 134 136 void toggleInterfaceDisplay(); … … 157 159 void calculatePixelsCoords(); 158 160 float viewSize; 161 bool autoRefresh; 162 159 163 private: 160 164 void skipPixels(int start, int howMany); … … 163 167 int numVertices; 164 168 169 165 170 }; 166 171 -
trunk/FACT++/gui/QCameraWidget.cc
r11923 r11941 104 104 if (fWhitePatch != -1) 105 105 { 106 glTranslatef(0,0,0.01); 106 107 glColor3f(1.f, 0.5f, 0.f);//patchColour);//[0],patchColour[1],patchColour[2]);//0.5f, 0.5f, 0.3f); 107 108 glBegin(GL_LINES); -
trunk/FACT++/gui/QCameraWidget.h
r11923 r11941 16 16 typedef vector<Position> Positions; 17 17 18 //FIXME this variable seems to be deprecated 18 19 Positions fGeom; 19 20 -
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
r11933 r11941 25 25 26 26 #include "src/Configuration.h" 27 28 //#include "../BasicGlCamera.cc"29 27 30 28 #undef ACTUAL_NUM_PIXELS … … 353 351 drawBlur = false; 354 352 loopCurrentEvent = false; 353 SetAutoRefresh(true); 355 354 #ifdef LOAD_RAW 356 355 loadEvents("/scratch/00000043.001_T.bin"); … … 908 907 int16_t* origTheWayIWant = new int16_t[1024*1440]; 909 908 910 int numPixels = 1024;911 int leftOver = 1440-numPixels;909 // int numPixels = 1024; 910 // int leftOver = 1440-numPixels; 912 911 for (int k=0;k<1024;k++) 913 912 for (int j=0;j<1440;j++) … … 957 956 ofstream outBin("/scratch/bin/outputBin.bin", ios_base::out | ios_base::binary); 958 957 ofstream outWave("/scratch/bin/outputWave.bin", ios_base::out | ios_base::binary); 959 int16_t* waveLetArray = new int16_t[1024*1440];958 int16_t* waveLetArray_ = new int16_t[1024*1440]; 960 959 int16_t* origTheWayIWant = new int16_t[1024*1440]; 961 960 … … 967 966 outBin.write((const char*)(rawEventData), 1440*1024*2); 968 967 969 970 int leftOver = 1440-numPixels;968 // int numPixels = 1024; 969 // int leftOver = 1440-numPixels; 971 970 for (int k=0;k<1024;k++) 972 971 for (int j=0;j<1440;j++) … … 983 982 { 984 983 if (j + waveSpan < totalNumSamples) 985 if (!doWaveLetsPlease(waveSpan, &origTheWayIWant[j], &waveLetArray [j], true))984 if (!doWaveLetsPlease(waveSpan, &origTheWayIWant[j], &waveLetArray_[j], true)) 986 985 return; 987 986 } … … 997 996 { 998 997 // cout << " Doint one last run of " << lastRun << " samples" << endl; 999 doWaveLetsPlease(lastRun, &origTheWayIWant[j], &waveLetArray [j], true);998 doWaveLetsPlease(lastRun, &origTheWayIWant[j], &waveLetArray_[j], true); 1000 999 } 1001 1000 else … … 1003 1002 // cout << " Filling in " << lastRun << " samples" << endl; 1004 1003 for (int l=0;l<lastRun;l++) 1005 waveLetArray [j+l] = origTheWayIWant[j+l];1004 waveLetArray_[j+l] = origTheWayIWant[j+l]; 1006 1005 } 1007 1006 if (!lastRun) … … 1009 1008 j += lastRun; 1010 1009 } 1011 outWave.write((const char*)(waveLetArray ), 1440*1024*2);1010 outWave.write((const char*)(waveLetArray_), 1440*1024*2); 1012 1011 } 1013 1012 outWave.close(); … … 1015 1014 inputFile->GetRow(0); 1016 1015 1017 delete[] waveLetArray ;1016 delete[] waveLetArray_; 1018 1017 delete[] origTheWayIWant; 1019 1018 } … … 1266 1265 for (int j=0;j<viewer->nRoi;j++) 1267 1266 { 1268 // cout << "start value: " << viewer->eventData[i*1024+j] << " baseline: " << viewer->baseLineMean[i*1024+j];1269 // cout << " triggerOffset: " << viewer->triggerOffsetMean[i*1024+j] << " gain: " << viewer->gainMean[i*1024+j];1270 1267 int realj = (j+viewer->startPix[j])%1024; 1271 1268 viewer->eventData[i*1024+j] *= 2000.f/4096.f; … … 1273 1270 viewer->eventData[i*1024+j] /= viewer->gainMean[i*1024+realj]; 1274 1271 viewer->eventData[i*1024+j] *= (50000.f/65536.f) * 2500.f; 1275 // cout << " end value: " << viewer->eventData[i*1024+j] << endl;1276 1272 } 1277 1273 viewer->updateGL();
Note:
See TracChangeset
for help on using the changeset viewer.