Changeset 66 for tools/ddd


Ignore:
Timestamp:
06/17/09 12:40:37 (16 years ago)
Author:
qweitzel
Message:
MO event display improved: start- and stopbin spinbox added
Location:
tools/ddd
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tools/ddd/Functions.cpp

    r61 r66  
    5656  BoardNo->setEnabled(true);
    5757  PixelID->setEnabled(true);
     58  M0Start->setEnabled(true);
     59  M0Stop->setEnabled(true);
    5860  EventNo->setValue(1);
    5961  EventNo->setRange(1, RD->RHeader->Events);
     62  M0Start->setValue(0);
     63  M0Stop->setValue((RD->RHeader->Samples)-1);
     64  M0Start->setRange(0,(RD->RHeader->Samples)-1); 
     65  M0Stop->setRange(0,(RD->RHeader->Samples)-1);
    6066  ChannelNo->setValue(0);
    6167  ChannelNo->setRange(0, RD->RHeader->NChannels*RD->RHeader->NChips-1);
     
    7278    BoardNo->setEnabled(false);
    7379    PixelID->setEnabled(false);
     80    M0Start->setEnabled(false);
     81    M0Stop->setEnabled(false);
    7482    RunHeaderDisplay->clear();
    7583    EventHeaderDisplay->clear();
     
    150158              int biny = 5-(((superpixel-1)%3)*2)-(int((pixel-1)/2));
    151159             
    152               //search maximum sample amplitude within following window -> should not be hardcoded!
    153               int StartBin = 100;
    154               int StopBin = 120;
     160              //search maximum sample amplitude within user specified window
     161              //start bin is always smaller than stop bin (taken care of by updated ranges)
     162              int StartBin = (int)(M0Start->value());
     163              int StopBin = (int)(M0Stop->value());
    155164             
    156               for(int l=StartBin; l<(StopBin+1); l++){
     165              for(int l=StartBin; l<=StopBin; l++){
     166                 
     167                float sample = *((short *) (RD->Data + RD->RHeader->NBoards*RD->RHeader->NChips*sizeof(int)) +
     168                                 i*RD->RHeader->NChips*RD->RHeader->NChannels*RD->RHeader->Samples+
     169                                 j*RD->RHeader->NChannels*RD->RHeader->Samples+
     170                                 k*RD->RHeader->Samples+
     171                                 l)*RD->BStruct[i].ScaleFactor;
    157172               
    158 /*              float sample = RD->Data[i*RD->RHeader->NChips*RD->RHeader->NChannels*RD->RHeader->Samples+
    159                                         j*RD->RHeader->NChannels*RD->RHeader->Samples+
    160                                         k*RD->RHeader->Samples+
    161                                         l]*RD->BStruct[i].ScaleFactor;
    162  */
    163                 float sample = *((short *) (RD->Data + RD->RHeader->NBoards*RD->RHeader->NChips*sizeof(int)) +
    164                                         i*RD->RHeader->NChips*RD->RHeader->NChannels*RD->RHeader->Samples+
    165                                         j*RD->RHeader->NChannels*RD->RHeader->Samples+
    166                                         k*RD->RHeader->Samples+
    167                                         l)*RD->BStruct[i].ScaleFactor;
    168                                
    169173                if (sample > z[binx][biny]) {
    170174                  z[binx][biny]=sample;
     
    172176               
    173177              }//sample loop
    174              
     178
    175179            }//only M0 data
    176180           
     
    185189      Graph2D->replot();
    186190      //Signal2D->show();
     191
     192      //update ranges for start and stop bin to avoid startbin > stopbin
     193      M0Start->setRange(0, M0Stop->value()); 
     194      M0Stop->setRange(M0Start->value(),(RD->RHeader->Samples)-1);
    187195
    188196      delete[] x;       delete[] y;
  • tools/ddd/GUI.cpp

    r60 r66  
    224224  Graph2D->setCanvasBackground(QColor(Qt::white));
    225225
     226  M0Start = new QSpinBox(M0Window);
     227  M0Start->setEnabled(false);
     228  connect(M0Start, SIGNAL(valueChanged(int)), this, SLOT(DisplayEvent(int)));
     229  M0Start->setToolTip("First bin/sample of time window");
     230  M0StartLayout = new QFormLayout; 
     231  M0StartLayout->addRow("First Bin", M0Start);
     232
     233  M0Stop = new QSpinBox(M0Window);
     234  M0Stop->setEnabled(false);
     235  connect(M0Stop, SIGNAL(valueChanged(int)), this, SLOT(DisplayEvent(int)));
     236  M0Stop->setToolTip("Last bin/sample of time window");
     237  M0StopLayout = new QFormLayout; 
     238  M0StopLayout->addRow("Last Bin", M0Stop);
     239
    226240  M0Layout = new QGridLayout(M0Window);
    227241  M0Layout->addWidget(Graph2D, 1,1,3,3);
     242  M0Layout->addLayout(M0StartLayout,4,1);
     243  M0Layout->addLayout(M0StopLayout,4,2);
    228244
    229245  Signal2D = new QwtPlotSpectrogram;
     
    260276  // Layout items
    261277  delete PortLayout;            delete CommandLayout;
     278  delete M0StartLayout;         delete M0StopLayout;
    262279  delete AddressLayout;         delete FormLayout;
    263280  delete SpinLayout;
  • tools/ddd/GUI.h

    r60 r66  
    3232    QToolButton *LoadButton;
    3333    QLineEdit *FilenameBox, *IPAddress, *Command, *PixelID;
    34     QSpinBox *EventNo, *ChannelNo, *BoardNo, *Port;
     34    QSpinBox *EventNo, *ChannelNo, *BoardNo, *Port, *M0Start, *M0Stop;
    3535    QPlainTextEdit *RunHeaderDisplay, *EventHeaderDisplay, *SocketOutput;
    3636    QTabWidget *TabWidget;
     
    3939    QAction *OpenAction, *ConnectAction;
    4040    QGridLayout *SocketLayout, *MainLayout, *M0Layout;
    41     QFormLayout *CommandLayout, *PortLayout, *AddressLayout, *FormLayout, *SpinLayout;
     41    QFormLayout *CommandLayout, *PortLayout, *AddressLayout, *FormLayout, *SpinLayout, *M0StartLayout, *M0StopLayout;
    4242   
    4343    QwtPlot *Graph, *Graph2D;
Note: See TracChangeset for help on using the changeset viewer.