Legend:
- Unmodified
- Added
- Removed
-
tools/ddd/Functions.cpp
r81 r82 19 19 void ddd::OpenDatafile() { 20 20 21 if(Socket->state() == QAbstractSocket::ConnectedState) { // do not execute if socket is open 22 MakeConnection(); 23 } 24 21 25 CloseDatafile(); // Close previous file if open 22 26 23 27 // Write run header to temporary file 28 ftruncate(fileno(Tmpfile),0); 24 29 rewind(Tmpfile); 25 30 switch (RD->OpenDataFile(FilenameBox->text().toAscii().data(), Tmpfile)) { … … 51 56 M0Start->setEnabled(true); 52 57 M0Stop->setEnabled(true); 53 EventNo->setValue(1);54 58 EventNo->setRange(1, RD->RHeader->Events); 55 M0Start->setValue(0);56 M0Stop->setValue((RD->RHeader->Samples)-1);57 59 M0Start->setRange(0,(RD->RHeader->Samples)-1); 58 60 M0Stop->setRange(0,(RD->RHeader->Samples)-1); 59 ChannelNo->setValue(0);60 61 ChannelNo->setRange(0, RD->RHeader->NChannels*RD->RHeader->NChips-1); 61 BoardNo->setValue(0);62 62 BoardNo->setRange(0, RD->RHeader->NBoards-1); 63 63 DisplayEvent(); … … 86 86 87 87 // Read event 88 ftruncate(fileno(Tmpfile),0); 88 89 rewind(Tmpfile); 89 90 if (RD->ReadEvent(EventNo->value(), Tmpfile) != CTX_OK) { … … 251 252 ManualDisconnect = false; 252 253 253 OpenAction->setEnabled(false);254 FilenameBox->setEnabled(false);255 LoadButton->setEnabled(false);256 254 FilenameBox->clear(); 257 255 CloseDatafile(); … … 330 328 } 331 329 330 // +++ Reset graph axes to autoscale when fully unzoomed +++ 331 void ddd::HandleZoom(const QwtDoubleRect &) { 332 if(Zoomer->zoomRectIndex() == 0) { 333 Graph->setAxisAutoScale(QwtPlot::xBottom); 334 Graph->setAxisAutoScale(QwtPlot::yLeft); 335 } 336 } 337 332 338 // +++ Disconnect from socket +++ 333 339 void ddd::GotDisconnected() { … … 339 345 340 346 GetButton->setEnabled(false); 341 FilenameBox->setEnabled(true);342 OpenAction->setEnabled(true);343 LoadButton->setEnabled(true);344 347 ChannelNo->setEnabled(false); 345 348 BoardNo->setEnabled(false); … … 402 405 "1. Reading and displaying the content of a raw data file written by the drsdaq program\n" 403 406 "2. Acquiring and displaying online data from a running drsdaq program via the socket interface\n\n" 404 "With an established socket connection, displaying of raw data files is disabled."); 407 "With an established socket connection, displaying of raw data files is disabled.\n\n" 408 "Navigation in signal display: Left mouse button to zoom, right to unzoom fully, middle to unzoom one level. Left mouse button plus shift key to pan.\n" 409 "When unzoomed, the axes are rescaled automatically."); 410 405 411 Message.setWindowTitle("ddd Help"); 406 412 Message.exec(); … … 410 416 QMessageBox::about(this, "ddd About","DRS Data Display\n\n" 411 417 "Written by Oliver Grimm, IPP, ETH Zurich\n" 418 "Event display by Quirin Weitzel.\n\n" 412 419 "This version compiled "__DATE__".\n\n" 413 420 "Graphical user interface implemented with Qt.\n" -
tools/ddd/GUI.cpp
r81 r82 102 102 Graph->setAutoReplot(true); 103 103 Graph->setCanvasBackground(QColor(Qt::yellow)); 104 Graph->setToolTip("Left mouse button to zoom (+Shift to pan)");105 104 Zoomer = new QwtPlotZoomer(QwtPlot::xBottom,QwtPlot::yLeft,Graph->canvas()); 105 connect(Zoomer, SIGNAL(zoomed(const QwtDoubleRect &)), this, SLOT(HandleZoom(const QwtDoubleRect &))); 106 106 Panner = new QwtPlotPanner(Graph->canvas()); 107 107 Panner->setMouseButton(Qt::LeftButton, Qt::ShiftModifier); … … 112 112 Signal->attach(Graph); 113 113 Signal->setStyle(QwtPlotCurve::Steps); 114 115 AutoscaleBox = new QCheckBox("Autoscale", Central);116 AutoscaleBox->setFont(QFont("Times", 10, QFont::Bold));117 AutoscaleBox->setToolTip("Scale axes automatically");118 119 GraphLayout = new QVBoxLayout;120 GraphLayout->addWidget(Graph);121 GraphLayout->addWidget(AutoscaleBox);122 114 123 115 // Text boxes for run and event header … … 246 238 M0Stop = new QSpinBox(M0Window); 247 239 M0Stop->setEnabled(false); 240 M0Stop->setRange(0,1023); 241 M0Stop->setValue(1023); 248 242 connect(M0Stop, SIGNAL(valueChanged(int)), this, SLOT(DisplayEvent(int))); 249 243 M0Stop->setToolTip("Last bin/sample of time window"); -
tools/ddd/GUI.h
r81 r82 29 29 30 30 QPushButton *GetButton, *SocketButton, *Connect, *M0Display; 31 QCheckBox *ContinuousBox , *AutoscaleBox;31 QCheckBox *ContinuousBox; 32 32 QToolButton *LoadButton; 33 33 QLineEdit *FilenameBox, *IPAddress, *Command, *PixelID; … … 39 39 QAction *OpenAction, *ConnectAction; 40 40 QGridLayout *SocketLayout, *MainLayout, *M0Layout; 41 QVBoxLayout *GraphLayout;42 41 QFormLayout *CommandLayout, *PortLayout, *AddressLayout, *FormLayout, *SpinLayout, *M0StartLayout, *M0StopLayout; 43 42 … … 73 72 void ReadFromSocket(); 74 73 void GotDisconnected(); 74 void HandleZoom(const QwtDoubleRect &); 75 75 void TranslatePixelID(); 76 76
Note:
See TracChangeset
for help on using the changeset viewer.