Changeset 11933 for trunk/FACT++/gui/RawEventsViewer
- Timestamp:
- 09/01/11 16:16:52 (13 years ago)
- Location:
- trunk/FACT++/gui/RawEventsViewer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
r11922 r11933 960 960 int16_t* origTheWayIWant = new int16_t[1024*1440]; 961 961 962 for (int i=0;i< 300;i++)//nRows;i++)962 for (int i=0;i<nRows;i++) 963 963 { 964 964 cout << '\r' << "Doing row " << i << " of " << nRows; … … 989 989 while (j%1440 != 0)// < totalNumSamples) 990 990 { 991 cout << "Copying the remaining of the data" << endl; 991 992 int lastRun = 1; 992 993 while (lastRun < 1440 - j%1440)//totalNumSamples-j) … … 1023 1024 if (!*calibInputFile) 1024 1025 { 1026 delete calibInputFile; 1027 calibInputFile = NULL; 1028 return; 1029 } 1030 1031 if (calibInputFile->HasKey("NROI")) 1032 { 1033 cout << "Looks like you're trying to load a regular raw data file as DRS calib. aborting." << endl; 1025 1034 delete calibInputFile; 1026 1035 calibInputFile = NULL; … … 1339 1348 void UIConnector::nextSlicePlease() 1340 1349 { 1341 viewer->nextSlice(); 1350 if (playEventsRadio->isChecked ()) 1351 viewer->eventStepping(true); 1352 else 1353 viewer->nextSlice(); 1342 1354 } 1343 1355 /************************************************************ … … 1621 1633 void UIConnector::currentSliceHasChanged(int slice) 1622 1634 { 1635 if (!viewer->nRoi) 1636 return; 1623 1637 ostringstream str; 1624 1638 // str << "Displaying Slice " << slice; … … 2321 2335 } 2322 2336 2323 int min = 10000 ; //real min = -20482324 int max = -10000 ; //real max = 20472337 int min = 100000; //real min = -2048, int_16 = -32768 to 32767 2338 int max = -100000; //real max = 2047 2325 2339 long average = 0; 2326 int numSamples = 0; 2340 long numSamples = 0; 2341 int errorDetected = -1; 2327 2342 for (int i=start;i<end;i++) 2328 2343 { … … 2330 2345 { 2331 2346 int cValue = viewer->eventData[i*viewer->nRoi+j]; 2332 if (cValue > max )2347 if (cValue > max && cValue < 32767) 2333 2348 max = cValue; 2334 if (cValue < min )2349 if (cValue < min && cValue > -32768) 2335 2350 min = cValue; 2336 average+=cValue; 2337 numSamples++; 2351 if (cValue < 32767 && cValue > -32768) 2352 { 2353 average+=cValue; 2354 numSamples++; 2355 } 2356 else 2357 { 2358 errorDetected = i; 2359 } 2360 // numSamples++; 2338 2361 } 2339 2362 } 2340 2363 average /= numSamples; 2341 2364 if (errorDetected != -1) 2365 { 2366 cout << "Overflow detected at pixel " << errorDetected << " (at least)" << endl; 2367 } 2368 // cout << "min: " << min << " max: " << max << " average: " << average << endl; 2342 2369 double minRange = (double)(min+(VALUES_SPAN/2))/(double)VALUES_SPAN; 2343 2370 double maxRange = (double)(max+(VALUES_SPAN/2))/(double)VALUES_SPAN; … … 2501 2528 2502 2529 2503 QObject::connect(myUi.eventsMinusButton, SIGNAL(clicked()), 2504 canvas, SLOT(minusEvent())); 2505 QObject::connect(myUi.eventsPlusButton, SIGNAL(clicked()), 2506 canvas, SLOT(plusEvent())); 2507 QObject::connect(myUi.eventsStepBox, SIGNAL(valueChanged(int)), 2508 canvas, SLOT(setEventStep(int))); 2530 // QObject::connect(myUi.eventsMinusButton, SIGNAL(clicked()), 2531 // canvas, SLOT(minusEvent())); 2532 // QObject::connect(myUi.eventsPlusButton, SIGNAL(clicked()), 2533 // canvas, SLOT(plusEvent())); 2534 // QObject::connect(myUi.eventsStepBox, SIGNAL(valueChanged(int)), 2535 // canvas, SLOT(setEventStep(int))); 2536 2509 2537 myUi.colorRange0->setValue(canvas->ss[0]); 2510 2538 myUi.colorRange1->setValue(canvas->ss[1]); … … 2551 2579 connector.currentPixelScale = myUi.currentPixelScale; 2552 2580 connector.entireCameraScale = myUi.entireCameraScale; 2581 connector.playEventsRadio = myUi.playEventsRadio; 2553 2582 2554 2583 connector.extraInfoLabel = myUi.extraInfoLabel; … … 2572 2601 connector.initHistograms(); 2573 2602 2574 QObject::connect(myUi.slicesPlusPlusButton, SIGNAL(clicked()), 2575 &connector, SLOT(slicesPlusPlus())); 2576 QObject::connect(myUi.slicesMinusMinusButton, SIGNAL(clicked()), 2577 &connector, SLOT(slicesMinusMinus())); 2603 QButtonGroup scaleGroup(canvas);// = new QButtonGroup(canvas); 2604 QButtonGroup animateGroup(canvas);// = new QButtonGroup(canvas); 2605 scaleGroup.addButton(myUi.currentPixelScale); 2606 scaleGroup.addButton(myUi.entireCameraScale); 2607 animateGroup.addButton(myUi.playEventsRadio); 2608 animateGroup.addButton(myUi.playSlicesRadio); 2609 myUi.entireCameraScale->setChecked(true); 2610 // QObject::connect(myUi.slicesPlusPlusButton, SIGNAL(clicked()), 2611 // &connector, SLOT(slicesPlusPlus())); 2612 // QObject::connect(myUi.slicesMinusMinusButton, SIGNAL(clicked()), 2613 // &connector, SLOT(slicesMinusMinus())); 2614 2578 2615 QObject::connect(myUi.autoScaleColor, SIGNAL(clicked()), 2579 2616 &connector, SLOT(autoScalePressed())); -
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h
r11920 r11933 308 308 QRadioButton* currentPixelScale; 309 309 QRadioButton* entireCameraScale; 310 QRadioButton* playEventsRadio; 310 311 311 312 QDoubleSpinBox* range0; -
trunk/FACT++/gui/RawEventsViewer/viewer.ui
r11908 r11933 769 769 <layout class="QHBoxLayout" name="horizontalLayout"> 770 770 <item> 771 <widget class="QPushButton" name="playPauseButton"> 772 <property name="toolTip"> 773 <string>Play/Pause events animation</string> 774 </property> 775 <property name="text"> 776 <string>Play/Pause</string> 777 </property> 778 </widget> 779 </item> 780 <item> 771 781 <widget class="QLabel" name="label_24"> 772 782 <property name="text"> … … 794 804 <property name="value"> 795 805 <double>100.000000000000000</double> 796 </property>797 </widget>798 </item>799 </layout>800 </item>801 <item row="1" column="8">802 <layout class="QHBoxLayout" name="horizontalLayout_4">803 <item>804 <widget class="QLabel" name="label_2">805 <property name="text">806 <string>Events stepping</string>807 </property>808 </widget>809 </item>810 <item>811 <widget class="QPushButton" name="eventsMinusButton">812 <property name="toolTip">813 <string>Step backwards in events</string>814 </property>815 <property name="text">816 <string>-</string>817 </property>818 </widget>819 </item>820 <item>821 <widget class="QSpinBox" name="eventsStepBox">822 <property name="toolTip">823 <string>Number of events to skip at each step</string>824 </property>825 <property name="minimum">826 <number>1</number>827 </property>828 <property name="maximum">829 <number>9999</number>830 </property>831 </widget>832 </item>833 <item>834 <widget class="QPushButton" name="eventsPlusButton">835 <property name="sizePolicy">836 <sizepolicy hsizetype="Minimum" vsizetype="Minimum">837 <horstretch>0</horstretch>838 <verstretch>0</verstretch>839 </sizepolicy>840 </property>841 <property name="toolTip">842 <string>Step forward in events</string>843 </property>844 <property name="text">845 <string>+</string>846 806 </property> 847 807 </widget> … … 952 912 <layout class="QHBoxLayout" name="horizontalLayout_5"> 953 913 <item> 954 <widget class="QPushButton" name="slicesMinusMinusButton"> 955 <property name="toolTip"> 956 <string>Step backward one slice</string> 957 </property> 914 <widget class="QRadioButton" name="playEventsRadio"> 958 915 <property name="text"> 959 <string>Slice--</string> 960 </property> 961 </widget> 962 </item> 963 <item> 964 <widget class="QPushButton" name="playPauseButton"> 965 <property name="toolTip"> 966 <string>Play/Pause events animation</string> 967 </property> 968 <property name="text"> 969 <string>Play/Pause</string> 970 </property> 971 </widget> 972 </item> 973 <item> 974 <widget class="QPushButton" name="slicesPlusPlusButton"> 975 <property name="toolTip"> 976 <string>Step forward one slice</string> 977 </property> 978 <property name="text"> 979 <string>Slice++</string> 916 <string>play Events</string> 980 917 </property> 981 918 </widget> … … 1013 950 </property> 1014 951 </widget> 952 </item> 953 <item row="1" column="8"> 954 <layout class="QHBoxLayout" name="horizontalLayout_4"> 955 <item> 956 <widget class="QRadioButton" name="playSlicesRadio"> 957 <property name="text"> 958 <string>play Slices</string> 959 </property> 960 <property name="checked"> 961 <bool>true</bool> 962 </property> 963 </widget> 964 </item> 965 </layout> 1015 966 </item> 1016 967 </layout>
Note:
See TracChangeset
for help on using the changeset viewer.