Changeset 12173 for trunk/FACT++/gui/RawEventsViewer
- Timestamp:
- 10/12/11 12:04:33 (13 years ago)
- Location:
- trunk/FACT++/gui/RawEventsViewer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
r12157 r12173 1 /* 1 2 /* 2 3 * QtGl.cpp … … 270 271 float divideMe = (float)(VALUES_SPAN-1); 271 272 float plusMe = VALUES_SPAN/2; 273 274 cout << "---> value span..." << endl; 275 276 /* 272 277 if (drawCalibrationLoaded) 273 278 plusMe += 0;//VALUES_SPAN/2; … … 276 281 divideMe /=2; 277 282 plusMe = 0 ;///=2; 278 } 283 }*/ 284 279 285 for (int i=0;i<nRoi-1;i++) 280 286 { … … 460 466 updateNeighbors(i); 461 467 462 calibrationLoaded = false;463 drawCalibrationLoaded = false;468 //calibrationLoaded = false; 469 //drawCalibrationLoaded = false; 464 470 465 471 } … … 1039 1045 void RawDataViewer::openCalibFile(string& file) 1040 1046 { 1041 calibrationLoaded = false; 1047 //calibrationLoaded = false; 1048 1049 MessageImp msg; 1050 if (!DataCalib::ReadFits(file, msg)) 1051 { 1052 DataCalib::Restart(); 1053 return; 1054 } 1055 /* 1056 1042 1057 calibInputFile = new fits(file); 1043 1058 if (!*calibInputFile) … … 1073 1088 1074 1089 delete calibInputFile; 1075 1076 calibrationLoaded = true;1090 */ 1091 //calibrationLoaded = true; 1077 1092 1078 1093 emit newFileLoaded(); 1079 if (drawCalibrationLoaded) 1094 1095 //if (calibratedCheckBox->isChecked()) 1080 1096 updateGL(); 1081 1097 } … … 1125 1141 #endif 1126 1142 1127 if (drawCalibrationLoaded && calibrationLoaded) 1128 { 1143 // if (drawCalibrationLoaded && calibrationLoaded) 1144 // { 1145 1146 // if (calibratedCheckBox->isChecked()) 1147 DataCalib::Apply(eventData, rawEventData, startPix, nRoi); 1148 /* 1129 1149 for (int i=0;i<1440;i++) 1130 1150 for (int j=0;j<nRoi;j++) 1131 1151 { 1132 int realj = (j+startPix[ j])%1024;1152 int realj = (j+startPix[i])%1024; 1133 1153 eventData[i*1024+j] *= 2000.f/4096.f; 1134 1154 eventData[i*1024+j] -= (baseLineMean[i*1024+realj]+triggerOffsetMean[i*1024+j]); … … 1137 1157 } 1138 1158 } 1139 updateGL(); 1159 */ 1160 updateGL(); 1140 1161 emit signalCurrentEvent(eventNum); 1141 1162 emit signalCurrentPixel(selectedPixel); … … 1277 1298 void UIConnector::drawCalibratedDataChanged(int state) 1278 1299 { 1279 if (state) 1280 { 1281 if (viewer->calibrationLoaded) 1282 { 1283 viewer->drawCalibrationLoaded = true; 1284 for (int i=0;i<1440;i++) 1285 for (int j=0;j<viewer->nRoi;j++) 1286 { 1287 int realj = (j+viewer->startPix[j])%1024; 1288 viewer->eventData[i*1024+j] *= 2000.f/4096.f; 1289 viewer->eventData[i*1024+j] -= (viewer->baseLineMean[i*1024+realj]+viewer->triggerOffsetMean[i*1024+j]); 1290 viewer->eventData[i*1024+j] /= viewer->gainMean[i*1024+realj]; 1291 viewer->eventData[i*1024+j] *= (50000.f/65536.f) * 2500.f; 1292 } 1293 viewer->updateGL(); 1294 } 1295 else 1296 { 1297 drawCalibrationCheckBox->setChecked(false); 1298 } 1299 } 1300 else 1301 { 1302 viewer->drawCalibrationLoaded = false; 1303 if (viewer->calibrationLoaded) 1304 { 1305 for (int i=0;i<1440;i++) 1306 for (int j=0;j<viewer->nRoi;j++) 1307 { 1308 int realj = (j+viewer->startPix[j])%1024; 1309 viewer->eventData[i*1024+j] /= (50000.f/65536.f) * 2500.f; 1310 viewer->eventData[i*1024+j] *= viewer->gainMean[i*1024+realj]; 1311 viewer->eventData[i*1024+j] += (viewer->baseLineMean[i*1024+realj]+viewer->triggerOffsetMean[i*1024+j]); 1312 viewer->eventData[i*1024+j] /= 2000.f/4096.f; 1313 } 1314 viewer->updateGL(); 1315 } 1316 1317 } 1318 autoScalePressed(); 1319 pixelChanged(viewer->selectedPixel); 1300 cout << "=== drawCalibratedDataChanged " << state << endl; 1301 1302 for (int i=0;i<(1440+160)*viewer->nRoi;i++) 1303 viewer->eventData[i] = (float)viewer->rawEventData[i]; 1304 1305 // if (viewer->calibratedCheckBox->isChecked()) 1306 if (state) 1307 DataCalib::Apply(viewer->eventData, viewer->rawEventData, viewer->startPix, viewer->nRoi); 1308 1309 viewer->updateGL(); 1310 1311 //drawCalibrationCheckBox->setChecked(false); 1312 1313 autoScalePressed(); 1314 pixelChanged(viewer->selectedPixel); 1320 1315 1321 1316 } … … 1325 1320 void UIConnector::drawPatchesCheckChange(int state) 1326 1321 { 1327 if (state) 1328 viewer->drawPatch = true; 1329 else 1330 viewer->drawPatch = false; 1322 viewer->drawPatch = state; 1331 1323 viewer->updateGL(); 1332 1324 } … … 1336 1328 void UIConnector::drawImpulseCheckChange(int state) 1337 1329 { 1338 if (state) 1339 viewer->drawImpulse = true; 1340 else 1341 viewer->drawImpulse = false; 1330 viewer->drawImpulse = state; 1342 1331 viewer->updateGL(); 1343 1332 } … … 1347 1336 void UIConnector::drawBlurCheckChange(int state) 1348 1337 { 1349 if (state) 1350 viewer->drawBlur = true; 1351 else 1352 viewer->drawBlur = false; 1338 viewer->drawBlur = state; 1353 1339 viewer->updateGL(); 1354 1340 } 1355 1341 void UIConnector::loopEventCheckChange(int state) 1356 1342 { 1357 if (state) 1358 viewer->loopCurrentEvent = true; 1359 else 1360 viewer->loopCurrentEvent = false; 1343 viewer->loopCurrentEvent = state; 1361 1344 } 1362 1345 /************************************************************ … … 1628 1611 extraInfoLabel->setText(QString(str.str().c_str())); 1629 1612 1613 /* 1630 1614 if (viewer->calibrationLoaded) 1631 1615 { 1632 1616 drawCalibrationCheckBox->setEnabled(true); 1633 } 1617 }*/ 1634 1618 1635 1619 … … 2409 2393 viewer->ss[4] = maxRange; 2410 2394 range4->setValue(viewer->ss[4]); 2411 viewer->ss[2] = midRange; 2395 // viewer->ss[2] = midRange; 2396 // range2->setValue(viewer->ss[2]); 2397 // viewer->ss[1] = (minRange+midRange)/2; 2398 // range1->setValue(viewer->ss[1]); 2399 // viewer->ss[3] = (maxRange+midRange)/2; 2400 // range3->setValue(viewer->ss[3]); 2401 2402 viewer->ss[2] = (maxRange+minRange)/2; 2412 2403 range2->setValue(viewer->ss[2]); 2413 viewer->ss[1] = (minRange+midRange)/2; 2404 2405 viewer->ss[1] = minRange+(maxRange-minRange)/4; 2414 2406 range1->setValue(viewer->ss[1]); 2415 viewer->ss[3] = (maxRange+midRange)/2; 2407 2408 viewer->ss[3] = minRange+3*(maxRange-minRange)/4; 2416 2409 range3->setValue(viewer->ss[3]); 2417 2410 … … 2461 2454 configs.add_options() 2462 2455 ("color.range", vars<double>(), "Range of the display colours") 2463 ("color.red", vars<double>(), "Range of red values")2456 ("color.red", vars<double>(), "Range of red values") 2464 2457 ("color.green", vars<double>(), "Range of green values") 2465 ("color.blue", vars<double>(), "Range of blue values") 2466 ("file,f", var<string>(), "File to be loaded at startup") 2458 ("color.blue", vars<double>(), "Range of blue values") 2459 ("file,f", var<string>(), "File to be loaded") 2460 ("drs,d", var<string>(), "DRS calibration file to be loaded") 2467 2461 ; 2468 2462 conf.AddOptions(configs); … … 2470 2464 po::positional_options_description p; 2471 2465 p.add("file", 1); // The first positional options 2466 p.add("drs", 2); // The first positional options 2472 2467 conf.SetArgumentPositions(p); 2473 2468 … … 2619 2614 connector.range4 = myUi.colorRange4; 2620 2615 connector.drawCalibrationCheckBox = myUi.calibratedCheckBox; 2621 connector.drawCalibrationCheckBox->setEnabled(false);2616 // connector.drawCalibrationCheckBox->setEnabled(false); 2622 2617 2623 2618 connector.initHistograms(); … … 2771 2766 if (conf.Has("file")) 2772 2767 { 2773 string str = conf.Get<string>("file"); 2774 QString qstr(str.c_str()); 2768 const QString qstr(conf.Get<string>("file").c_str()); 2775 2769 connector.fileSelected(qstr); 2776 2770 } 2777 2771 2772 if (conf.Has("drs")) 2773 { 2774 const QString qstr(conf.Get<string>("drs").c_str()); 2775 connector.calibFileSelected(qstr); 2776 } 2777 2778 2778 mainWindow.show(); 2779 2779 -
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h
r12158 r12173 44 44 45 45 #include <string> 46 47 #include "../../src/DataCalib.h" 48 46 49 47 50 namespace std … … 153 156 // vector<edge> patchesIndices[160]; 154 157 std::fits* inputFile; 155 std::fits* calibInputFile;156 float baseLineMean[1440*1024];157 float gainMean[1440*1024];158 float triggerOffsetMean[1440*1024];159 bool calibrationLoaded;158 // std::fits* calibInputFile; 159 // float baseLineMean[1440*1024]; 160 // float gainMean[1440*1024]; 161 // float triggerOffsetMean[1440*1024]; 162 // bool calibrationLoaded; 160 163 bool drawCalibrationLoaded; 161 164
Note:
See TracChangeset
for help on using the changeset viewer.