Legend:
- Unmodified
- Added
- Removed
-
tools/ddd/Functions.cpp
r61 r66 56 56 BoardNo->setEnabled(true); 57 57 PixelID->setEnabled(true); 58 M0Start->setEnabled(true); 59 M0Stop->setEnabled(true); 58 60 EventNo->setValue(1); 59 61 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); 60 66 ChannelNo->setValue(0); 61 67 ChannelNo->setRange(0, RD->RHeader->NChannels*RD->RHeader->NChips-1); … … 72 78 BoardNo->setEnabled(false); 73 79 PixelID->setEnabled(false); 80 M0Start->setEnabled(false); 81 M0Stop->setEnabled(false); 74 82 RunHeaderDisplay->clear(); 75 83 EventHeaderDisplay->clear(); … … 150 158 int biny = 5-(((superpixel-1)%3)*2)-(int((pixel-1)/2)); 151 159 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()); 155 164 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; 157 172 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 169 173 if (sample > z[binx][biny]) { 170 174 z[binx][biny]=sample; … … 172 176 173 177 }//sample loop 174 178 175 179 }//only M0 data 176 180 … … 185 189 Graph2D->replot(); 186 190 //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); 187 195 188 196 delete[] x; delete[] y; -
tools/ddd/GUI.cpp
r60 r66 224 224 Graph2D->setCanvasBackground(QColor(Qt::white)); 225 225 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 226 240 M0Layout = new QGridLayout(M0Window); 227 241 M0Layout->addWidget(Graph2D, 1,1,3,3); 242 M0Layout->addLayout(M0StartLayout,4,1); 243 M0Layout->addLayout(M0StopLayout,4,2); 228 244 229 245 Signal2D = new QwtPlotSpectrogram; … … 260 276 // Layout items 261 277 delete PortLayout; delete CommandLayout; 278 delete M0StartLayout; delete M0StopLayout; 262 279 delete AddressLayout; delete FormLayout; 263 280 delete SpinLayout; -
tools/ddd/GUI.h
r60 r66 32 32 QToolButton *LoadButton; 33 33 QLineEdit *FilenameBox, *IPAddress, *Command, *PixelID; 34 QSpinBox *EventNo, *ChannelNo, *BoardNo, *Port ;34 QSpinBox *EventNo, *ChannelNo, *BoardNo, *Port, *M0Start, *M0Stop; 35 35 QPlainTextEdit *RunHeaderDisplay, *EventHeaderDisplay, *SocketOutput; 36 36 QTabWidget *TabWidget; … … 39 39 QAction *OpenAction, *ConnectAction; 40 40 QGridLayout *SocketLayout, *MainLayout, *M0Layout; 41 QFormLayout *CommandLayout, *PortLayout, *AddressLayout, *FormLayout, *SpinLayout ;41 QFormLayout *CommandLayout, *PortLayout, *AddressLayout, *FormLayout, *SpinLayout, *M0StartLayout, *M0StopLayout; 42 42 43 43 QwtPlot *Graph, *Graph2D;
Note:
See TracChangeset
for help on using the changeset viewer.