- Timestamp:
- 08/30/11 13:52:37 (13 years ago)
- Location:
- trunk/FACT++/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/BasicGlCamera.cc
r11901 r11917 133 133 fcSlice = 0; 134 134 fData.resize(1440); 135 for (int i=0;i< ACTUAL_NUM_PIXELS+2;i++)135 for (int i=0;i<NPIX;i++) 136 136 fData[i] = (double)i;///1.44;//(double)(i)/(double)(ACTUAL_NUM_PIXELS); 137 137 … … 639 639 void BasicGlCamera::drawCamera(bool alsoWire) 640 640 { 641 cout << "Super PaintGL" << endl;641 // cout << "Super PaintGL" << endl; 642 642 glColor3f(0.5,0.5,0.5); 643 643 glLineWidth(1.0); … … 746 746 void BasicGlCamera::drawHexagon(int index, bool solid) 747 747 { 748 /* float minX, maxX, minY, maxY; 749 minX = minY = 1e10; 750 maxX = maxY = -1e10; 751 for (int i=0;i<1438;i++) 752 { 753 for (int j=0;j<6;j++) 754 { 755 if (verticesList[verticesIndices[i][j]][0] > maxX) 756 maxX = verticesList[verticesIndices[i][j]][0]; 757 if (verticesList[verticesIndices[i][j]][0] < minX) 758 minX = verticesList[verticesIndices[i][j]][0]; 759 if (verticesList[verticesIndices[i][j]][1] > maxY) 760 maxY = verticesList[verticesIndices[i][j]][1]; 761 if (verticesList[verticesIndices[i][j]][1] < minY) 762 minY = verticesList[verticesIndices[i][j]][1]; 763 } 764 } 765 cout << "Min, Max X: " << minX << " " << maxX << endl; 766 cout << "Min, Max Y: " << minY << " " << maxY << endl; 767 exit(0);*/ 748 768 if (solid) 749 769 glBegin(GL_POLYGON); … … 878 898 //Ok. So now we've circled around all the way to MAX_NUM_PIXELS 879 899 //do the required shifts so that it matches the fact camera up to ACTUAL_NUM_PIXELS pixels 900 //remember the location pixels 1438 and 1439, and re-assign them later on 901 GLfloat backupCoords[4]; 880 902 skipPixels(1200, 1); 881 903 skipPixels(1218, 3); … … 889 911 skipPixels(1354, 6); 890 912 skipPixels(1368, 7); 913 //la c'est dans 1390 qu'il y a 1439 914 backupCoords[0] = pixelsCoords[1390][0]; 915 backupCoords[1] = pixelsCoords[1390][1]; 891 916 skipPixels(1382, 9); 892 skipPixels(1394, 12);917 skipPixels(1394, 12); 893 918 skipPixels(1402, 15); 894 919 skipPixels(1410, 12); 920 //la c'est dans 1422 qu'il y a 1438 921 backupCoords[2] = pixelsCoords[1422][0]; 922 backupCoords[3] = pixelsCoords[1422][1]; 895 923 skipPixels(1422, 12); 896 924 skipPixels(1430, 15); 897 } 925 926 pixelsCoords[1438][0] = backupCoords[2]; 927 pixelsCoords[1438][1] = backupCoords[3]; 928 pixelsCoords[1439][0] = backupCoords[0]; 929 pixelsCoords[1439][1] = backupCoords[1]; 930 } 898 931 void BasicGlCamera::buildVerticesList() 899 932 { … … 926 959 } 927 960 } 961 //cout << "numVertices: " << numVertices << endl; 928 962 for (int i=0;i<NPIX;i++) 929 963 { -
trunk/FACT++/gui/BasicGlCamera.h
r11901 r11917 7 7 8 8 #define MAX_NUM_PIXELS 1600 9 #define ACTUAL_NUM_PIXELS 14 389 #define ACTUAL_NUM_PIXELS 1440 10 10 11 11 #include <QtOpenGL/QGLWidget> … … 100 100 101 101 protected: 102 v oid initializeGL();103 v oid resizeGL(int width, int height);102 virtual void initializeGL(); 103 virtual void resizeGL(int width, int height); 104 104 virtual void paintGL(); 105 105 virtual void mousePressEvent(QMouseEvent *event); … … 156 156 void updateNeighbors(int currentPixel); 157 157 void calculatePixelsCoords(); 158 private: 158 float viewSize; 159 private: 159 160 void skipPixels(int start, int howMany); 160 161 float hexRadius; 161 162 float hexTolerance; 162 float viewSize;163 163 int numVertices; 164 164 -
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
r11909 r11917 201 201 for (int i=0;i<ACTUAL_NUM_PIXELS;i++) 202 202 { 203 if (i == 690 ||204 i == 70)205 continue;203 // if (i == 690 || 204 // i == 70) 205 // continue; 206 206 glColor3fv(pixelsColor[i]); 207 207 glLoadName(i); … … 217 217 for (int i=0;i<ACTUAL_NUM_PIXELS;i++) 218 218 { 219 if (i == 690 ||220 i == 70)221 continue;219 // if (i == 690 || 220 // i == 70) 221 // continue; 222 222 drawHexagon(i, false); 223 223 } … … 292 292 glVertex2f(bboxMin[0] + xRange*whichSlice/(float)nRoi, 293 293 bboxMax[1]); 294 295 /* glColor3f(0.f,0.5f,0.f); 296 for (int i=0;i<nRoi-1;i++) 297 { 298 glVertex2f(bboxMin[0] + xRange*i/(float)nRoi, 299 bboxMin[1] + yRange*(n1mean[ i]+plusMe) /divideMe); 300 glVertex2f(bboxMin[0] + xRange*(i+1)/(float)nRoi, 301 bboxMin[1] + yRange*(n1mean[i+1]+plusMe) /divideMe); 302 } 303 */ 294 304 glEnd(); 295 305 glEnable(GL_MULTISAMPLE); … … 448 458 delete[] eventData; 449 459 delete[] rawEventData; 460 delete[] waveLetArray; 450 461 } 451 462 } … … 461 472 for (int j=0;j<9;j++)//for all cells of the current patch 462 473 { 463 if (patches[i][j] == 690 ||464 patches[i][j] == 70)465 continue;474 // if (patches[i][j] == 690 || 475 // patches[i][j] == 70) 476 // continue; 466 477 for (int k=0;k<6;k++)//for all sides of the current cell 467 478 { … … 685 696 delete[] eventData; 686 697 delete[] rawEventData; 698 delete[] waveLetArray; 687 699 } 688 700 eventData = new float[(1440+160)*nRoi]; 689 701 rawEventData = new int16_t[(1440+160)*nRoi]; 702 waveLetArray = new int16_t[1024*1440]; 690 703 if (!inputFile->SetPtrAddress("Data", rawEventData)){ 691 704 cout << "Missing column " << "Data" << " Aborting load..." << endl; … … 715 728 rowNum = -1; 716 729 eventStep = 1; 730 731 doMyWaveletTestPlease(); 732 733 717 734 plusEvent(); 718 735 eventStep = backupStep; 719 736 emit newFileLoaded(); 720 737 emit signalCurrentPixel(selectedPixel); 738 } 739 /* 740 bool RawDataViewer::doWaveLetsPlease(int givenSpan, int16_t* orig_in, int16_t* wavelets_in, bool verifyResult) 741 { 742 float* interArray = new float[givenSpan]; 743 float* resultArray = new float[givenSpan]; 744 float* orig = new float[givenSpan]; 745 float* wavelets = new float[givenSpan]; 746 for (int i=0;i<givenSpan;i++) 747 { 748 if (fabs((float)(orig_in[i])) > 32767.f) 749 cout << "Input overflow: " << orig_in[i] << endl; 750 orig[i] = (float)orig_in[i]; 751 } 752 for (int k=0;k<givenSpan;k++) 753 interArray[k] = orig[k]; 754 int span = givenSpan/2; 755 while (span > 0) 756 { 757 for (int k=0;k<span;k++) 758 { 759 wavelets[k] = (interArray[2*k] + interArray[2*k + 1])/2.f; 760 wavelets[k + span] = (interArray[2*k + 1] - interArray[2*k])/2.f; 761 } 762 for (int k=0;k<givenSpan;k++) 763 interArray[k] = wavelets[k]; 764 span /= 2; 765 } 766 //move float results to int16_t array 767 float intScaling = 15.9f; 768 int max = 0; 769 for (int i=0;i<givenSpan;i++) 770 { 771 float cValue = intScaling*wavelets[i];// 772 if (cValue > 0) 773 cValue += 0.5f; 774 else 775 cValue -= 0.5f; 776 wavelets_in[i] = (int16_t)(cValue); 777 if (fabs(cValue) > 32767.f) 778 { 779 cout << "Overflow ! " << cValue << endl; 780 } 781 if (fabs(cValue) > fabs(max)) 782 max = cValue; 783 } 784 // cout << "Max wave value: " << max << endl; 785 //result reconstruction and checking 786 if (!verifyResult) 787 return true; 788 789 for (int k=0;k<givenSpan;k++) 790 { 791 resultArray[k] = wavelets_in[k]/intScaling; 792 } 793 794 span = 1; 795 while (span < givenSpan) 796 { 797 for (int k=0;k<givenSpan;k++) 798 interArray[k] = resultArray[k]; 799 for (int k=0;k<span;k++) 800 { 801 resultArray[2*k] = (float)(((interArray[k] - interArray[k + span])*(1.f/1.f)) + 0.0f); 802 resultArray[2*k + 1] = (float)(((interArray[k] + interArray[k + span])*(1.f/1.f)) + 0.0f); 803 } 804 span *= 2; 805 } 806 807 for (int k=0;k<givenSpan;k++) 808 { 809 float plus = 0.5f; 810 if (resultArray[k] < 0) 811 plus *= -1.f; 812 if ((int)(resultArray[k]+plus) != (int)(orig_in[k])) 813 { 814 cout << "Nop, sorry: k: " << k << " " << resultArray[k] << " " << (int)(resultArray[k]+plus) << " " << plus << " " << orig[k] << endl; 815 return false; 816 } 817 } 818 return true; 819 } 820 */ 821 bool RawDataViewer::doWaveLetsPlease(int givenSpan, int16_t* orig_in, int16_t* wavelets_in, bool verifyResult) 822 { 823 float* interArray = new float[givenSpan]; 824 float* resultArray = new float[givenSpan]; 825 float* orig = new float[givenSpan]; 826 float* wavelets = new float[givenSpan]; 827 for (int i=0;i<givenSpan;i++) 828 { 829 if (fabs((float)(orig_in[i])) > 32767.f) 830 cout << "Input overflow: " << orig_in[i] << endl; 831 orig[i] = (float)orig_in[i]; 832 } 833 for (int k=0;k<givenSpan;k++) 834 interArray[k] = orig[k]; 835 int span = givenSpan/2; 836 while (span > 0) 837 { 838 for (int k=0;k<span;k++) 839 { 840 wavelets[k] = interArray[2*k];// + interArray[2*k + 1])/2.f; 841 wavelets[k + span] = interArray[2*k + 1] - interArray[2*k];//)/2.f; 842 } 843 for (int k=0;k<givenSpan;k++) 844 interArray[k] = wavelets[k]; 845 span /= 2; 846 } 847 //move float results to int16_t array 848 float intScaling = 1.f; 849 int max = 0; 850 for (int i=0;i<givenSpan;i++) 851 { 852 float cValue = intScaling*wavelets[i];// 853 if (cValue > 0) 854 cValue += 0.5f; 855 else 856 cValue -= 0.5f; 857 wavelets_in[i] = (int16_t)(cValue); 858 if (fabs(cValue) > 32767.f) 859 { 860 cout << "Overflow ! " << cValue << endl; 861 } 862 if (fabs(cValue) > fabs(max)) 863 max = cValue; 864 } 865 // cout << "Max wave value: " << max << endl; 866 //result reconstruction and checking 867 if (!verifyResult) 868 return true; 869 870 for (int k=0;k<givenSpan;k++) 871 { 872 resultArray[k] = wavelets_in[k]/intScaling; 873 } 874 875 span = 1; 876 while (span < givenSpan) 877 { 878 for (int k=0;k<givenSpan;k++) 879 interArray[k] = resultArray[k]; 880 for (int k=0;k<span;k++) 881 { 882 resultArray[2*k] = (float)(((interArray[k])*(1.f/1.f)) + 0.0f); 883 resultArray[2*k + 1] = (float)(((interArray[k] + interArray[k + span])*(1.f/1.f)) + 0.0f); 884 } 885 span *= 2; 886 } 887 888 for (int k=0;k<givenSpan;k++) 889 { 890 float plus = 0.5f; 891 if (resultArray[k] < 0) 892 plus *= -1.f; 893 if ((int)(resultArray[k]+plus) != (int)(orig_in[k])) 894 { 895 cout << "Nop, sorry: k: " << k << " " << resultArray[k] << " " << (int)(resultArray[k]+plus) << " " << plus << " " << orig[k] << endl; 896 return false; 897 } 898 } 899 delete[] interArray; 900 delete[] resultArray; 901 delete[] orig; 902 delete[] wavelets; 903 return true; 904 } 905 906 void RawDataViewer::doWaveLetOnCurrentEventPlease() 907 { 908 int16_t* origTheWayIWant = new int16_t[1024*1440]; 909 910 int numPixels = 1024; 911 int leftOver = 1440-numPixels; 912 for (int k=0;k<1024;k++) 913 for (int j=0;j<1440;j++) 914 { 915 origTheWayIWant[k*1440 + j] = rawEventData[j + k*1440]; 916 } 917 918 int waveSpan = 1024; 919 int waveToPixelsRatio = 32; 920 waveSpan = waveSpan*waveToPixelsRatio; 921 int totalNumSamples = 1024*1440; 922 int j=0; 923 for (;j<totalNumSamples;j+= waveSpan) 924 { 925 if (j + waveSpan < totalNumSamples) 926 if (!doWaveLetsPlease(waveSpan, &origTheWayIWant[j], &waveLetArray[j], true)) 927 return; 928 } 929 930 while (j%1440 != 0) 931 { 932 int lastRun = 1; 933 while (lastRun < 1440 - j%1440) 934 lastRun *= 2; 935 lastRun /= 2; 936 if (lastRun > 2) 937 { 938 doWaveLetsPlease(lastRun, &origTheWayIWant[j], &waveLetArray[j], true); 939 } 940 else 941 { 942 for (int l=0;l<lastRun;l++) 943 waveLetArray[j+l] = origTheWayIWant[j+l]; 944 } 945 if (!lastRun) 946 break; 947 j += lastRun; 948 } 949 950 delete[] origTheWayIWant; 951 952 } 953 void RawDataViewer::doMyWaveletTestPlease() 954 { 955 // cout << "Size of float: " << sizeof(float) << endl; 956 return; 957 ofstream outBin("/scratch/bin/outputBin.bin", ios_base::out | ios_base::binary); 958 ofstream outWave("/scratch/bin/outputWave.bin", ios_base::out | ios_base::binary); 959 int16_t* waveLetArray = new int16_t[1024*1440]; 960 int16_t* origTheWayIWant = new int16_t[1024*1440]; 961 962 for (int i=0;i<300;i++)//nRows;i++) 963 { 964 cout << '\r' << "Doing row " << i << " of " << nRows; 965 cout.flush(); 966 inputFile->GetRow(i); 967 outBin.write((const char*)(rawEventData), 1440*1024*2); 968 969 int numPixels = 1024; 970 int leftOver = 1440-numPixels; 971 for (int k=0;k<1024;k++) 972 for (int j=0;j<1440;j++) 973 { 974 origTheWayIWant[k*1440 + j] = rawEventData[j + k*1440]; 975 } 976 977 int waveSpan = 1024; 978 int waveToPixelsRatio = 32; 979 waveSpan = waveSpan*waveToPixelsRatio; 980 int totalNumSamples = 1024*1440; 981 int j=0; 982 for (;j<totalNumSamples;j+= waveSpan)//1440/waveToPixelsRatio;j++) 983 { 984 if (j + waveSpan < totalNumSamples) 985 if (!doWaveLetsPlease(waveSpan, &origTheWayIWant[j], &waveLetArray[j], true)) 986 return; 987 } 988 989 while (j%1440 != 0)// < totalNumSamples) 990 { 991 int lastRun = 1; 992 while (lastRun < 1440 - j%1440)//totalNumSamples-j) 993 lastRun *= 2; 994 lastRun /= 2; 995 if (lastRun > 2) 996 { 997 // cout << " Doint one last run of " << lastRun << " samples" << endl; 998 doWaveLetsPlease(lastRun, &origTheWayIWant[j], &waveLetArray[j], true); 999 } 1000 else 1001 { 1002 // cout << " Filling in " << lastRun << " samples" << endl; 1003 for (int l=0;l<lastRun;l++) 1004 waveLetArray[j+l] = origTheWayIWant[j+l]; 1005 } 1006 if (!lastRun) 1007 break; 1008 j += lastRun; 1009 } 1010 outWave.write((const char*)(waveLetArray), 1440*1024*2); 1011 } 1012 outWave.close(); 1013 outBin.close(); 1014 inputFile->GetRow(0); 1015 1016 delete[] waveLetArray; 1017 delete[] origTheWayIWant; 721 1018 } 722 1019 void RawDataViewer::openCalibFile(string& file) … … 851 1148 emit signalCurrentSlice(whichSlice); 852 1149 updateGL(); 1150 } 1151 1152 void RawDataViewer::computePulsesStatistics() 1153 { 1154 if (!inputFile) 1155 { 1156 cout << "A FITS file must be open in order to complete this operation" << endl; 1157 return; 1158 } 1159 1160 1161 // for (int i=0;i<nRows;i++)//for all events 1162 // { 1163 // inputFile->GetRow(rowNum); 1164 // for (int i=0;i<(1440+160)*nRoi;i++) 1165 // eventData[i] = (float)rawEventData[i]; 1166 1167 // for (int j=0;j<ACTUAL_NUM_PIXELS;j++) 1168 /// { 1169 int j = selectedPixel; 1170 for (int i=0;i<nRoi;i++) 1171 { 1172 aMeas[i] = eventData[j*1024+i];// * adcCount; 1173 1174 } 1175 for (int i=0;i<nRoi;i++) 1176 { 1177 if (i==0) 1178 n1mean[i] = aMeas[i+1]; 1179 else 1180 { 1181 if (i==1023) 1182 n1mean[i] = aMeas[i-1]; 1183 else 1184 n1mean[i] = (aMeas[i-1]+aMeas[i+1])/2.f; 1185 } 1186 } 1187 //find spike 1188 for (int i=0;i<nRoi-3;i++) 1189 { 1190 const float fract = 0.8f; 1191 float xx, xp, xpp; 1192 vCorr[i] = 0;//aMeas[i]; 1193 xx = aMeas[i] - n1mean[i]; 1194 if (xx < -8.f) 1195 { 1196 xp = aMeas[i+1] - n1mean[i+1]; 1197 xpp = aMeas[i+2] - n1mean[i+2]; 1198 if ((aMeas[i+2] - (aMeas[i] + aMeas[i+3])/2.f) > 10.f) 1199 { 1200 vCorr[i+1] = (aMeas[i] + aMeas[i+3])/2.f; 1201 vCorr[i+2] = (aMeas[i] + aMeas[i+3])/2.f; 1202 i = i+2; 1203 } 1204 else 1205 { 1206 if ((xp > -2.*xx*fract) && (xpp < -10.f)) 1207 { 1208 vCorr[i+1] = n1mean[i+1]; 1209 n1mean[i+2] = aMeas[i+1] - aMeas[i+3]/2.f; 1210 i++; 1211 } 1212 } 1213 } 1214 } 1215 for (int i=0;i<nRoi;i++) 1216 n1mean[i] = aMeas[i]-n1mean[i]; 1217 // } 1218 // } 853 1219 } 854 1220 /************************************************************ … … 1263 1629 * CURRENT EVENT HAS CHANGED. ui handler 1264 1630 ************************************************************/ 1265 double xval[ 4096];1266 double yval[ 4096];1631 double xval[50000]; 1632 double yval[50000]; 1267 1633 void UIConnector::eventChangedFromSpinner(int cEvent) 1268 1634 { … … 1286 1652 viewer->updateGL(); 1287 1653 } 1288 void UIConnector::currentEventHasChanged(int cEvent)1654 void UIConnector::currentEventHasChanged(int ) 1289 1655 { 1290 1656 ostringstream str; … … 1298 1664 updateSpinnerDisplay = true; 1299 1665 } 1666 1667 viewer->doWaveLetOnCurrentEventPlease(); 1668 1300 1669 //retrieve the data that we want to display 1301 1670 str.str(""); … … 1356 1725 pixelHistoMap[viewer->startPix[i]] = 1; 1357 1726 } 1727 1358 1728 std::map<int, int> timeMarksMap; 1359 1729 for (int i=0;i <NTMARK; i++) … … 1540 1910 triggerDelayHistoItem.setSamples(xval, yval, nsamples); 1541 1911 #endif 1542 1543 // startCellHistoZoom->setZoomBase(startCellHistoItem.boundingRect()); 1912 //WAVELETS HACK 1913 std::map<int, int> valuesHistoMap; 1914 std::map<int, int> waveletHistoMap; 1915 for (int i=0;i<1024*1440;i++) 1916 { 1917 if (valuesHistoMap.find(viewer->rawEventData[i]) != valuesHistoMap.end()) 1918 valuesHistoMap[viewer->rawEventData[i]]++; 1919 else 1920 valuesHistoMap[viewer->rawEventData[i]] = 1; 1921 if (waveletHistoMap.find(viewer->waveLetArray[i]) != waveletHistoMap.end()) 1922 waveletHistoMap[viewer->waveLetArray[i]]++; 1923 else 1924 waveletHistoMap[viewer->waveLetArray[i]] = 1; 1925 } 1926 1927 it = valuesHistoMap.begin(); 1928 nsamples = 0; 1929 previousValue = it->first-10; 1930 cout << "Num values Original: " << valuesHistoMap.size() << endl; 1931 for (unsigned int i=0;i<valuesHistoMap.size();i++) 1932 { 1933 if (previousValue != it->first-1) 1934 { 1935 xval[nsamples] = previousValue+1; 1936 yval[nsamples] = 0; 1937 nsamples++; 1938 xval[nsamples] = it->first-1; 1939 yval[nsamples] = 0; 1940 nsamples++; 1941 } 1942 xval[nsamples] = it->first; 1943 yval[nsamples] = it->second; 1944 previousValue = it->first; 1945 it++; 1946 nsamples++; 1947 xval[nsamples] = previousValue; 1948 yval[nsamples] = 0; 1949 nsamples++; 1950 if (nsamples > 50000) 1951 { 1952 cout << "Error: Maximum number of samples reached for histograms. skipping what's remaining" << endl; 1953 break; 1954 } 1955 } 1956 xval[nsamples] = it==valuesHistoMap.begin() ? 0 : (--it)->first+1; 1957 yval[nsamples] = 0; 1958 nsamples++; 1959 // if (nsamples > 5) 1960 #if QWT_VERSION < 0x060000 1961 triggerDelayHistoItem.setData(xval, yval, nsamples); 1962 #else 1963 triggerDelayHistoItem.setSamples(xval, yval, nsamples); 1964 #endif 1965 1966 it = waveletHistoMap.begin(); 1967 nsamples = 0; 1968 previousValue = it->first-10; 1969 cout << "Num values WaveLets: " << waveletHistoMap.size() << endl; 1970 for (unsigned int i=0;i<waveletHistoMap.size();i++) 1971 { 1972 if (previousValue != it->first-1) 1973 { 1974 xval[nsamples] = previousValue+1; 1975 yval[nsamples] = 0; 1976 nsamples++; 1977 xval[nsamples] = it->first-1; 1978 yval[nsamples] = 0; 1979 nsamples++; 1980 } 1981 xval[nsamples] = it->first; 1982 yval[nsamples] = it->second; 1983 previousValue = it->first; 1984 it++; 1985 nsamples++; 1986 xval[nsamples] = previousValue; 1987 yval[nsamples] = 0; 1988 nsamples++; 1989 if (nsamples > 50000) 1990 { 1991 cout << "Error: Maximum number of samples reached for histograms. skipping what's remaining" << endl; 1992 break; 1993 } 1994 } 1995 xval[nsamples] = it==waveletHistoMap.begin() ? 0 : (--it)->first+1; 1996 yval[nsamples] = 0; 1997 nsamples++; 1998 // if (nsamples > 5) 1999 #if QWT_VERSION < 0x060000 2000 startTimeMarkHistoItem.setData(xval, yval, nsamples); 2001 #else 2002 startTimeMarkHistoItem.setSamples(xval, yval, nsamples); 2003 #endif 2004 2005 //END OF WAVELETS HACK 2006 // startCellHistoZoom->setZoomBase(startCellHistoItem.boundingRect()); 1544 2007 QStack< QRectF > stack; 1545 2008 // QRectF cRectangle = boardsTimeHistoItem.boundingRect(); … … 1645 2108 //curve 1646 2109 // pixelValueCurveItem.setSymbol(new QwtSymbol(QwtSymbol::Cross, Qt::NoBrush, QPen(Qt::black), QSize(5,5))); 1647 pixelValueCurveItem.setPen(QColor(Qt::darkGreen)); 2110 pixelValueCurveItem.setPen(QColor(Qt::black)); 2111 aMeanCurveItem.setPen(QColor(Qt::darkGreen)); 2112 vCorrCurveItem.setPen(QColor(Qt::red)); 2113 meanCurveItem.setPen(QColor(Qt::blue)); 1648 2114 pixelValueCurveItem.setStyle(QwtPlotCurve::Lines); 2115 aMeanCurveItem.setStyle(QwtPlotCurve::Lines); 2116 vCorrCurveItem.setStyle(QwtPlotCurve::Lines); 2117 meanCurveItem.setStyle(QwtPlotCurve::Lines); 2118 1649 2119 // pixelValueCurveItem.setCurveAttribute(QwtPlotCurve::Fitted); 1650 2120 pixelValueCurveItem.attach(pixelValueCurve); 2121 // aMeanCurveItem.attach(pixelValueCurve); 2122 vCorrCurveItem.attach(pixelValueCurve); 2123 // meanCurveItem.attach(pixelValueCurve); 1651 2124 1652 2125 //FIXME delete these pointers with the destructor … … 1685 2158 #endif 1686 2159 } 2160 2161 viewer->computePulsesStatistics(); 1687 2162 #if QWT_VERSION < 0x060000 1688 pixelValueCurveItem.setData(xval, yval, viewer->nRoi); 2163 pixelValueCurveItem.setData(xval, yval, viewer->nRoi); 2164 aMeanCurveItem.setData(xval, viewer->aMeas, viewer->nRoi); 2165 meanCurveItem.setData(xval, viewer->n1mean, viewer->nRoi); 2166 vCorrCurveItem.setData(xval, viewer->vCorr, viewer->nRoi-3); 1689 2167 #else 1690 2168 pixelValueCurveItem.setSamples(xval, yval, viewer->nRoi); 2169 aMeanCurveItem.setSamples(xval, viewer->aMeas, viewer->nRoi); 2170 meanCurveItem.setSamples(xval, viewer->n1mean, viewer->nRoi); 2171 vCorrCurveItem.setSamples(xval, viewer->vCorr, viewer->nRoi-3); 1691 2172 #endif 1692 2173 2174 1693 2175 QStack< QRectF > stack; 1694 stack.push(scaleBoundingRectangle(pixelValueCurveItem.boundingRect(), 1. 05f));2176 stack.push(scaleBoundingRectangle(pixelValueCurveItem.boundingRect(), 1.5f)); 1695 2177 curveZoom->setZoomStack(stack); 1696 2178 stack.pop(); … … 1698 2180 hwID = pixel; 1699 2181 swID = viewer->softwareMapping[pixel]; 1700 // cout << "here" << endl;1701 /* int channel = hwID%360;1702 channel = channel%36;1703 channel = channel%9;1704 int inter = (pixel-channel)%360;1705 inter = inter%36;1706 patchID = inter/9;1707 inter = pixel - channel - patchID*9;1708 inter = inter%360;1709 boardID = inter/36;1710 inter = pixel - channel - patchID*9 - boardID*36;1711 crateID = inter/360;1712 */1713 2182 crateID = pixel/360; 1714 2183 boardID = (pixel - crateID*360)/36; 1715 2184 patchID = (pixel - crateID*360 - boardID*36)/9; 1716 // cout << "Value: " << hwID << " " << swID;1717 // cout << " " << crateID << " " << boardID;1718 // cout << " " << patchID << endl;1719 // cout << "there " << crateID << " " << boardID << " " << patchID << endl;1720 // crateID = (pixel/4)/10;1721 // boardID = (pixel/4)%10;1722 // patchID = pixel%4;1723 // cout << "there2 " << crateID << " " << boardID << " " << patchID << endl;1724 2185 1725 2186 if (HwIDBox->value() != hwID) … … 1741 2202 emit updateCurrentPixelSliceValue(qstr); 1742 2203 1743 // cout << "Pixel: " << viewer->softwareMapping[pixel] << " Hardware ID: " << pixel << " Patch: " << pixel%4;1744 // cout << " Board: " << (pixel/4)%10 << " Crate: " << (pixel/4)/10 << endl;1745 1746 // curveZoom->setZoomBase();1747 // cout << "pixel changed ! " << pixel << endl;1748 2204 } 1749 2205
Note:
See TracChangeset
for help on using the changeset viewer.