Changeset 11360 for fact/tools/Edd


Ignore:
Timestamp:
07/12/11 15:29:14 (14 years ago)
Author:
ogrimm
Message:
Updates to make Edd more responsive with high incoming event rate
Location:
fact/tools/Edd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/Edd/Edd.cc

    r11189 r11360  
    111111 
    112112// Update event buffer
    113 void EventScope::Update(QString Name, int Time, QByteArray Data, QString Format, QString) {
    114  
    115   if (Name != this->Name) return;
     113void EventScope::Update(const QString &, int Time, const QByteArray &Data, const QString &Format, const QString &, int) {
    116114
    117115  // Check if service available
    118116  if (!SetStatus(this, Name, Time, Format)) return;
    119117  if (Data.size() < (int) sizeof(RunHeader)) return;
    120  
    121   // Disconnect while processing to avoid queing of events
    122   disconnect(Handler, SIGNAL(YEP(QString, int, QByteArray, QString, QString)), this, SLOT(Update(QString, int, QByteArray, QString, QString)));
     118
     119  // Ignore further data while processing this one
     120  Handler->Ignore(Name, true);
    123121 
    124122  // Clear temporary file and write event data to this file
     
    132130  // Open temporary raw data file
    133131  OpenRawFile(File.fileName());
    134  
    135   // Reconnect after processing
    136   connect(Handler, SIGNAL(YEP(QString, int, QByteArray, QString, QString)), SLOT(Update(QString, int, QByteArray, QString, QString)));
     132
     133
     134  // Process all pending events, then allow data again
     135  QApplication::processEvents();
     136  Handler->Ignore(Name, false);
    137137}
    138138
     
    191191 
    192192  // Display first event
    193   NewEventNum(0);
     193  NewEventNum(DAQPage->Channel->value());
    194194}
    195195
     
    316316void EventScope::SetActive(bool State) {
    317317
    318   if (State && !Active) {
    319         Handler->Subscribe(DRSBoard+"/EventData");
    320         connect(Handler, SIGNAL(YEP(QString, int, QByteArray, QString, QString)), SLOT(Update(QString, int, QByteArray, QString, QString)));
    321   }
    322   if (!State && Active) {
    323         Handler->Unsubscribe(DRSBoard+"/EventData");
    324         disconnect(Handler, SIGNAL(YEP(QString, int, QByteArray, QString, QString)), this, SLOT(Update(QString, int, QByteArray, QString, QString)));
    325   }
     318  if (State && !Active) Handler->Subscribe(DRSBoard+"/EventData", this, -1);
     319  if (!State && Active) Handler->Unsubscribe(DRSBoard+"/EventData", this);
     320
    326321  Active = State;
    327322}
     
    929924  connect(Timer, SIGNAL(timeout()), this, SLOT(CheckAlarm()));
    930925  Timer->start(5000);
    931 
    932   // Force update of all widgets constructed (in thread for GUI responsiveness)
    933   QtConcurrent::run(Handler, &EddDim::ForceEmit);
    934926
    935927   
  • fact/tools/Edd/Edd.h

    r11088 r11360  
    1111
    1212// Event oscilloscope
    13 class EventScope: public EddBasePlot, public PixelMap {
     13class EventScope: public EddBasePlot, public PixelMap, public EddWidget {
    1414  Q_OBJECT
    1515
     
    3434    EventScope(class TP_DAQ *, QWidget * = NULL);
    3535    ~EventScope();
    36        
     36
     37        void Update(const QString &, int, const QByteArray &, const QString &, const QString &, int=-1);
    3738        void UpdateFirst(int, int, int);
    3839        void AddTrace(int, int, int);
     
    4344
    4445  private slots:
    45         void Update(QString, int, QByteArray, QString, QString);
    4646        void PlotTraces();
    4747        void DeleteCurve(QwtPlotCurve *);
Note: See TracChangeset for help on using the changeset viewer.