Changeset 19368 for trunk/FACT++/gui
- Timestamp:
- 11/10/18 18:09:41 (6 years ago)
- Location:
- trunk/FACT++/gui/RawEventsViewer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
r19364 r19368 563 563 * OPEN FILE. opens a new fits file 564 564 ************************************************************/ 565 void RawDataViewer::openFile(string & file)565 void RawDataViewer::openFile(string file, bool reopen) 566 566 { 567 567 if (inputFile) … … 571 571 } 572 572 try { 573 inputFile =new factfits(file, "Events");573 inputFile = reopen && fIsDrsCalibration ? new zfits(file, "Events") : new factfits(file, "Events"); 574 574 } 575 575 catch (std::runtime_error e) … … 761 761 762 762 763 int backupStep = eventStep; 764 rowNum = -1; 765 eventStep = 1; 766 767 plusEvent(); 768 eventStep = backupStep; 763 if (!reopen) 764 { 765 int backupStep = eventStep; 766 rowNum = -1; 767 eventStep = 1; 768 plusEvent(); 769 eventStep = backupStep; 770 } 771 else 772 readEvent(); 773 769 774 emit newFileLoaded(); 770 775 emit signalCurrentPixel(selectedPixel); … … 933 938 rowNum += nRows; 934 939 940 readEvent(); 941 } 942 943 void RawDataViewer::readEvent() 944 { 935 945 if (inputFile == NULL) 936 946 return; … … 1084 1094 initHistograms(); 1085 1095 1086 currentFile = "none";1087 currentCalibFile = "none";1088 1089 1096 updateSpinnerDisplay = true; 1090 1097 updating = false; … … 1165 1172 { 1166 1173 GLWindow->fIsDrsCalibration = state; 1174 1175 if (currentCalibFile.empty()) 1176 GLWindow->openFile(currentFile, true); 1177 1167 1178 GLWindow->ApplyCalibration(); 1179 1168 1180 threeD_Window->setData(GLWindow->eventData); 1169 1181 … … 1292 1304 void UIConnector::fileSelected(QString file) 1293 1305 { 1306 const bool reopen = !currentFile.empty(); 1307 1294 1308 currentFile = file.toStdString(); 1295 if ( currentFile != "")1296 GLWindow->openFile(currentFile );1309 if (!currentFile.empty()) 1310 GLWindow->openFile(currentFile, reopen && currentCalibFile.empty()); 1297 1311 } 1298 1312 void UIConnector::calibFileSelected(QString file) 1299 1313 { 1314 const bool reopen = currentCalibFile.empty(); 1315 1300 1316 currentCalibFile = file.toStdString(); 1317 if (reopen && !currentFile.empty()) 1318 GLWindow->openFile(currentFile, true); 1301 1319 if (currentCalibFile != "") 1302 1320 GLWindow->openCalibFile(currentCalibFile); 1321 1322 1303 1323 if (GLWindow->fDrsCalib.fRoi != 0) 1304 1324 {//spread the calibration data to the displayers -
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h
r19314 r19368 52 52 RawDataViewer(QWidget *parent = 0); 53 53 ~RawDataViewer(); 54 void openFile(std::string & file);54 void openFile(std::string file, bool reopen); 55 55 void openCalibFile(std::string& file); 56 56 … … 65 65 void plusEvent(); 66 66 void minusEvent(); 67 void readEvent(); 67 68 void setEventStep(int step); 68 69 void nextSlice();
Note:
See TracChangeset
for help on using the changeset viewer.