Changeset 10118 for fact/Evidence/Edd
- Timestamp:
- 01/25/11 09:47:27 (14 years ago)
- Location:
- fact/Evidence/Edd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/Evidence/Edd/Edd.cc
r10112 r10118 23 23 class EddDim *Handler; 24 24 QString DRSBoard = "drsdaq"; 25 std::string PixelMapText; 25 26 26 27 // History chooser function (opens plot for numeric data, TextHist for all other) … … 1016 1017 1017 1018 // Constructor 1018 EventScope::EventScope(QWidget *P): EddBasePlot(P), PixelMap( "../../config/PixelMap.txt", false) {1019 EventScope::EventScope(QWidget *P): EddBasePlot(P), PixelMap(PixelMapText, false) { 1019 1020 1020 1021 Name = DRSBoard+"/EventData"; … … 1064 1065 struct ItemDetails N; 1065 1066 1066 N.Signal = NewCurve(QString::number(Board)+","+QString::number(Chip)+","+ QString::number(Channel)+ " (" + DRS_to_Pixel(Board, Chip, Channel).c_str() + ")");1067 N.Signal = NewCurve(QString::number(Board)+","+QString::number(Chip)+","+ QString::number(Channel)+ " (" + ToPixel(0, Board, Chip, Channel) + ")"); 1067 1068 N.Board = Board; 1068 1069 N.Chip = Chip; … … 1090 1091 ClearCurve(0); 1091 1092 1092 List.first().Signal->setTitle(QString::number(Board)+","+QString::number(Chip)+","+ QString::number(Channel) + " (" + DRS_to_Pixel(Board, Chip, Channel).c_str() + ")");1093 List.first().Signal->setTitle(QString::number(Board)+","+QString::number(Chip)+","+ QString::number(Channel) + " (" + ToPixel(0, Board, Chip, Channel) + ")"); 1093 1094 List.first().Board = Board; 1094 1095 List.first().Chip = Chip; … … 1269 1270 } 1270 1271 1271 1272 // Translate FPA ID to Pixel ID (use '-' instead of PM_ERROR_CODE) 1273 QString EventScope::ToPixel(unsigned int Crate, unsigned int Board, unsigned int Patch, unsigned int Pixel) { 1274 1275 if (FPA_to_Pixel(Crate, Board, Patch, Pixel) == PM_ERROR_CODE) return "-"; 1276 else return QString::number(FPA_to_Pixel(Crate, Board, Patch, Pixel)); 1277 } 1278 1272 1279 //------------------------------------------------------------------ 1273 1280 //**************************** Tab pages *************************** … … 1491 1498 1492 1499 // Pixel ID 1493 PixelID = new Q LineEdit;1500 PixelID = new QSpinBox; 1494 1501 PixelID->setMaximumWidth(60); 1495 connect(PixelID, SIGNAL(returnPressed()), SLOT(TranslatePixelID())); 1502 PixelID->setRange(-1, 9999); 1503 PixelID->setSpecialValueText("n/a"); 1504 connect(PixelID, SIGNAL(valueChanged(int)), SLOT(TranslatePixelID(int))); 1496 1505 PixelID->setToolTip("Pixel identification"); 1497 1506 … … 1560 1569 StartStop(false); 1561 1570 connect(Scope, SIGNAL(PixelData(QVector<double>)), SLOT(SetPixelData(QVector<double>))); 1571 1572 // Call to get initial pixel ID correct 1573 UpdateScope(0); 1562 1574 } 1563 1575 … … 1568 1580 1569 1581 // Translate pixel ID to board, chip, channel 1570 void TP_DAQ::TranslatePixelID() { 1571 1572 if (Scope->Pixel_to_DRSboard(PixelID->text().toStdString()) == 999999999) { 1573 QMessageBox::warning(this, "Edd Message","Pixel ID unknown.",QMessageBox::Ok); 1574 } 1582 void TP_DAQ::TranslatePixelID(int ID) { 1583 1584 // setValue() below will call UpdateScope() through signal, therefore need to store numbers here 1585 unsigned int BoardNo = Scope->Pixel_to_FPAboard(ID); 1586 unsigned int PatchNo = Scope->Pixel_to_FPApatch(ID); 1587 unsigned int PixelNo = Scope->Pixel_to_FPApixel(ID); 1588 1589 if (BoardNo == Scope->PM_ERROR_CODE) PixelID->setValue(-1); 1575 1590 else { 1576 Board->setValue( Scope->Pixel_to_DRSboard(PixelID->text().toStdString()));1577 Chip->setValue( Scope->Pixel_to_DRSchip(PixelID->text().toStdString()));1578 Channel->setValue( Scope->Pixel_to_DRSchannel(PixelID->text().toStdString()));1591 Board->setValue(BoardNo); 1592 Chip->setValue(PatchNo); 1593 Channel->setValue(PixelNo); 1579 1594 } 1580 1595 } … … 1599 1614 1600 1615 // Update pixel ID 1601 PixelID->setText(Scope->DRS_to_Pixel(Board->value(), Chip->value(), Channel->value()).c_str()); 1616 PixelID->setValue(Scope->FPA_to_Pixel(0, Board->value(), Chip->value(), Channel->value())); 1617 if (PixelID->value() == (int) Scope->PM_ERROR_CODE) PixelID->setValue(-1); 1618 1602 1619 // Update first trace 1603 1620 Scope->UpdateFirst(Board->value(), Chip->value(), Channel->value()); … … 1885 1902 if (argc > 1) DRSBoard = "FADctrl"; 1886 1903 1904 // Make RPC to get pixelmap 1905 DimRpcInfo RPC((char *) "ConfigRequest", (char *) ""); 1906 RPC.setData((char *) "Misc PixelMap"); 1907 PixelMapText = std::string(RPC.getString(), RPC.getSize()); 1908 1887 1909 QApplication app(argc, argv); 1888 1910 GUI MainWindow; -
fact/Evidence/Edd/Edd.h
r10112 r10118 290 290 void AddTrace(int, int, int); 291 291 void SetActive(bool); 292 QString ToPixel(unsigned int, unsigned int, unsigned int, unsigned int); 292 293 293 294 private slots: … … 339 340 QPlainTextEdit *RunHeaderDisplay, *EventHeaderDisplay; 340 341 341 QSpinBox *Channel, *Chip, *Board; 342 QLineEdit *PixelID; 342 QSpinBox *Channel, *Chip, *Board, *PixelID; 343 343 QFormLayout *FormLayout; 344 344 QWidget *Display; … … 347 347 348 348 private slots: 349 void TranslatePixelID( );349 void TranslatePixelID(int); 350 350 void UpdateScope(int); 351 351 void KeepCurrent();
Note:
See TracChangeset
for help on using the changeset viewer.