Changeset 11907 for trunk/FACT++/gui/RawEventsViewer
- Timestamp:
- 08/16/11 11:53:58 (13 years ago)
- Location:
- trunk/FACT++/gui/RawEventsViewer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
r11902 r11907 5 5 * Author: lyard 6 6 */ 7 7 8 8 9 #include "RawEventsViewer.h" … … 603 604 delete inputFile; 604 605 } 606 try { 605 607 inputFile = new fits(file); 608 } 609 catch (std::runtime_error e) 610 { 611 cout << "Something went wrong while loading fits. aborting: " << e.what() << endl; 612 return; 613 } 606 614 if (!*inputFile) 607 615 { … … 635 643 for (vector<string>::const_iterator it=entriesToCheck.begin(); it != entriesToCheck.end(); it++) 636 644 { 645 try { 637 646 if (!inputFile->HasKey(*it)){ 638 647 cout << *it << " missing. Aborting load..." << endl; 639 648 return;} 649 } 650 catch (std::runtime_error e) 651 { 652 cout << e.what() << endl; 653 return; 654 } 640 655 } 641 656 nRows = inputFile->GetInt("NAXIS2"); … … 779 794 return; 780 795 inputFile->GetRow(rowNum); 796 // cout << "Getting row " << rowNum << endl; 781 797 for (int i=0;i<(1440+160)*nRoi;i++) 782 798 eventData[i] = (float)rawEventData[i]; … … 841 857 UIConnector::UIConnector(QWidget*) 842 858 { 859 updateSpinnerDisplay = true; 860 843 861 timer.setInterval(10.0); 844 862 QObject::connect(&timer, SIGNAL(timeout()), … … 1169 1187 { 1170 1188 ostringstream str; 1171 str << "File loaded: " << currentFile << "\n"; 1172 str << "Calibration file loaded: " << currentCalibFile << "\n"; 1189 1190 //extract the file name only (no path) from the full name 1191 str << "File: " << currentFile.substr(currentFile.find_last_of("//")+1, currentFile.size()) << "\n"; 1192 str << "Calibration: " << currentCalibFile.substr(currentCalibFile.find_last_of("//")+1, currentCalibFile.size()) << "\n"; 1173 1193 // fileLoadedLabel->setText(QString(str.str().c_str())); 1174 1194 // str.str(""); … … 1177 1197 // str.str(""); 1178 1198 str << "Number of Events: " << viewer->nRows << "\n"; 1199 1200 eventNumberBox->setMaximum(viewer->nRows-1); 1201 1179 1202 str << "Number of Slices: " << viewer->nRoi << "\n";// << "/1024"; 1180 1203 // numberOfSlicesLabel->setText(QString(str.str().c_str())); … … 1226 1249 { 1227 1250 ostringstream str; 1228 str << "Displaying Slice " << slice; 1229 QString qstr(str.str().c_str()); 1230 emit updateCurrentSliceDisplay(qstr); 1251 // str << "Displaying Slice " << slice; 1252 // QString qstr(str.str().c_str()); 1253 if (updateSpinnerDisplay) 1254 emit updateCurrentSliceDisplay(slice); 1231 1255 1232 1256 str.str(""); 1233 1257 str << "Current Pixel val.: " << viewer->eventData[viewer->nRoi*viewer->selectedPixel + viewer->whichSlice]; 1234 qstr = qstr.fromStdString(str.str());1258 QString qstr = qstr.fromStdString(str.str()); 1235 1259 emit updateCurrentPixelSliceValue(qstr); 1236 1260 … … 1241 1265 double xval[4096]; 1242 1266 double yval[4096]; 1243 1267 void UIConnector::eventChangedFromSpinner(int cEvent) 1268 { 1269 // cout << "Here " << updateSpinnerDisplay << endl; 1270 if (!updateSpinnerDisplay) 1271 return; 1272 updateSpinnerDisplay = false; 1273 // currentEventHasChanged(cEvent); 1274 viewer->rowNum = cEvent - viewer->eventStep; 1275 viewer->eventStepping(true); 1276 updateSpinnerDisplay = true; 1277 1278 // viewer->updateGL(); 1279 } 1280 void UIConnector::sliceChangedFromSpinner(int cSlice) 1281 { 1282 updateSpinnerDisplay = false; 1283 currentSliceHasChanged(cSlice); 1284 updateSpinnerDisplay = true; 1285 viewer->whichSlice = cSlice; 1286 viewer->updateGL(); 1287 } 1244 1288 void UIConnector::currentEventHasChanged(int cEvent) 1245 1289 { 1246 1290 ostringstream str; 1247 str << "Displaying Event " << cEvent; 1248 QString qstr(str.str().c_str()); 1249 emit updateCurrentEventDisplay(qstr); 1250 //retrieve the data that we want to display 1291 // str << "Displaying Event " << cEvent; 1292 // QString qstr(str.str().c_str()); 1293 // emit updateCurrentEventDisplay(qstr); 1294 if (updateSpinnerDisplay) 1295 { 1296 updateSpinnerDisplay = false; 1297 emit updateCurrentEventDisplay(viewer->rowNum); 1298 updateSpinnerDisplay = true; 1299 } 1300 //retrieve the data that we want to display 1251 1301 str.str(""); 1252 1302 str << "PC Time: " << viewer->pcTime; 1253 qstr = qstr.fromStdString(str.str());1303 QString qstr = qstr.fromStdString(str.str()); 1254 1304 emit updateCurrentPCTime(qstr); 1255 1305 … … 2032 2082 connector.patchIDBox = myUi.patchIDBox; 2033 2083 2084 connector.eventNumberBox = myUi.displayingEventBox; 2085 2034 2086 connector.range0 = myUi.colorRange0; 2035 2087 connector.range1 = myUi.colorRange1; … … 2157 2209 &connector, SLOT(currentEventHasChanged(int))); 2158 2210 2159 QObject::connect(&connector, SIGNAL(updateCurrentSliceDisplay(QString)), 2160 myUi.displayingSliceLabel, SLOT(setText(const QString))); 2161 QObject::connect(&connector, SIGNAL(updateCurrentEventDisplay(QString)), 2162 myUi.displayingEventLabel, SLOT(setText(const QString))); 2211 QObject::connect(&connector, SIGNAL(updateCurrentSliceDisplay(int)), 2212 myUi.displayingSliceBox, SLOT(setValue(int))); 2213 2214 QObject::connect(myUi.displayingSliceBox, SIGNAL(valueChanged(int)), 2215 &connector, SLOT(sliceChangedFromSpinner(int))); 2216 QObject::connect(myUi.displayingEventBox, SIGNAL(valueChanged(int)), 2217 &connector, SLOT(eventChangedFromSpinner(int))); 2218 2219 // QObject::connect(&connector, SIGNAL(updateCurrentEventDisplay(QString)), 2220 // myUi.displayingEventLabel, SLOT(setText(const QString))); 2221 QObject::connect(&connector, SIGNAL(updateCurrentEventDisplay(int)), 2222 myUi.displayingEventBox, SLOT(setValue(int))); 2223 2163 2224 QObject::connect(&connector, SIGNAL(updateCurrentPCTime(QString)), 2164 2225 myUi.PCTimeLabel, SLOT(setText(const QString))); -
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h
r11901 r11907 44 44 45 45 #include <string> 46 46 47 #include "externals/fits.h" 47 48 … … 222 223 void slicesMinusMinus(); 223 224 void drawCalibratedDataChanged(int state); 225 void eventChangedFromSpinner(int cEvent); 226 void sliceChangedFromSpinner(int cSlice); 224 227 225 228 Q_SIGNALS: 226 void updateCurrentSliceDisplay( QString);227 void updateCurrentEventDisplay( QString);229 void updateCurrentSliceDisplay(int); 230 void updateCurrentEventDisplay(int); 228 231 void updateCurrentPCTime(QString); 229 232 void updateCurrentSoftTrigger(QString); … … 244 247 bool rescaleWholeCamera; 245 248 QRectF scaleBoundingRectangle(QRectF rectangle, float scale); 249 bool updateSpinnerDisplay; 246 250 public: 247 251 QListWidget *boardsTimeList; … … 285 289 QSpinBox* patchIDBox; 286 290 291 QSpinBox* eventNumberBox; 292 287 293 QRadioButton* currentPixelScale; 288 294 QRadioButton* entireCameraScale; -
trunk/FACT++/gui/RawEventsViewer/viewer.ui
r11901 r11907 213 213 <widget class="QLabel" name="label"> 214 214 <property name="text"> 215 <string>FACT - Raw events viewer - v0. 2</string>215 <string>FACT - Raw events viewer - v0.3</string> 216 216 </property> 217 217 </widget> … … 393 393 </item> 394 394 <item> 395 <widget class="QLabel" name="displayingEventLabel"> 396 <property name="text"> 397 <string>Displaying Event 0</string> 398 </property> 399 </widget> 400 </item> 401 <item> 402 <widget class="QLabel" name="displayingSliceLabel"> 403 <property name="text"> 404 <string>Displaying Slice 0</string> 405 </property> 406 </widget> 395 <layout class="QHBoxLayout" name="horizontalLayout_10"> 396 <item> 397 <widget class="QLabel" name="displayingEventLabel"> 398 <property name="text"> 399 <string>Displaying Event</string> 400 </property> 401 </widget> 402 </item> 403 <item> 404 <widget class="QSpinBox" name="displayingEventBox"/> 405 </item> 406 </layout> 407 </item> 408 <item> 409 <layout class="QHBoxLayout" name="horizontalLayout_9"> 410 <item> 411 <widget class="QLabel" name="displayingSliceLabel"> 412 <property name="text"> 413 <string>Displaying Slice </string> 414 </property> 415 </widget> 416 </item> 417 <item> 418 <widget class="QSpinBox" name="displayingSliceBox"> 419 <property name="maximum"> 420 <number>1023</number> 421 </property> 422 </widget> 423 </item> 424 </layout> 407 425 </item> 408 426 <item>
Note:
See TracChangeset
for help on using the changeset viewer.