Changeset 229 for Evidence/Edd


Ignore:
Timestamp:
06/24/10 07:51:15 (15 years ago)
Author:
ogrimm
Message:
Config requests non-blocking if not made from main thread, adapted all servers to GetConfig() returning std::string, workaround for erroneous SERVICE_LIST
Location:
Evidence/Edd
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified Evidence/Edd/Edd.cc

    r224 r229  
    2727QWidget *OpenHistory(char *Service, int Index) {
    2828
     29  QString Format;
     30  DimBrowser Browser;
    2931  class EvidenceHistory *Hist = Handler->GetHistory(Service);
    3032
    31   // Check if hitory service available
     33  // Check if history service available
    3234  if (Hist == NULL || Hist->GetFormat() == NULL) {
    3335        QMessageBox::warning(NULL, "Edd Message", QString("Could not retrieve history for service ") + Service ,QMessageBox::Ok);
    34         Handler->DropHistory(Service);
    35         return NULL;
    36   }
    37 
    38   QString Format = Hist->GetFormat();
     36
     37        // If service currently available, take its format
     38        char *Name, *Fmt;
     39
     40        Browser.getServices(Service);
     41        if (Browser.getNextService(Name, Fmt) != 0) Format = QString(Fmt);
     42        else {
     43          Handler->DropHistory(Service);
     44          return NULL;
     45        }
     46  }
     47
     48  if (Format.isEmpty()) Format = Hist->GetFormat();
    3949  Handler->DropHistory(Service);
    4050 
    41   //if (strlen(Hist->GetFormat()) == 1 && *Hist->GetFormat() != 'C') return new EddPlot(Service, Index);
    4251  if (Format.size() == 1 && Format[0] != 'C') return new EddPlot(Service, Index);
    4352  else return new EddText(Service);
     
    6877        QLineEdit(P), ServiceName(Name), Index(Index) {
    6978
    70  LastHist = NULL;
     79  LastHist = NULL;
    7180 
    7281  // Widget properties
     
    112121        return;
    113122  }
     123  else Pal.setColor(QPalette::Base, Qt::white);
    114124
    115125  // Message service backgound colour determined by severity
     
    933943  if (!EvidenceServer::ServiceOK(getInfo())) YEP(getInfo()->getName(), -1);
    934944  else {
    935         char *Text = EvidenceServer::ToString(getInfo());
    936         YEP(getInfo()->getName(), getInfo()->getTimestamp(), QByteArray((char *) getInfo()->getData(), getInfo()->getSize()), getInfo()->getFormat(), Text);
    937         free(Text);
     945        YEP(getInfo()->getName(),
     946                getInfo()->getTimestamp(),
     947                QByteArray((char *) getInfo()->getData(),
     948                getInfo()->getSize()), getInfo()->getFormat(),
     949                QString::fromStdString(EvidenceServer::ToString(getInfo())));
    938950  }
    939951}
     
    11831195    Plot->AddService("ARDUINO/Data", i);
    11841196  }
    1185   Layout->addWidget(Plot, 0, 2, 8, 7);     
     1197  Layout->addWidget(Plot, 0, 2, 9, 7);     
    11861198
    11871199  // Night sky monitor
     1200  Line = new EddLineDisplay("SQM/Message");
     1201  Line->setMaximumWidth(200);
     1202  Layout->addWidget(Line, 6, 0, 1, 2);     
     1203
    11881204  Line = new EddLineDisplay("SQM/NSB");
    1189   Layout->addWidget(Line, 6, 0, 1, 1);         
     1205  Layout->addWidget(Line, 7, 0, 1, 1);         
    11901206}
    11911207
     
    15541570  bool OK;
    15551571
    1556   // Find all services that are not history services and sort
     1572  // Find all DIM services and sort
    15571573  getServices("*");
    15581574  while ((Type = getNextService(Name, Format)) != 0) {
  • TabularUnified Evidence/Edd/Edd.pro

    r208 r229  
    66TARGET =
    77DEPENDPATH += .
    8 INCLUDEPATH += . .. /ihp/local/qwt-5.2.1/include $(DIMDIR)/dim ../../drsdaq ../../pixelmap
     8INCLUDEPATH += . .. $(QWTDIR)/include $(DIMDIR)/dim ../../drsdaq ../../pixelmap
    99
    1010# Input
    1111HEADERS += Edd.h
    1212SOURCES += Edd.cc ../Evidence.cc ../../drsdaq/RawDataCTX.cc ../../pixelmap/Pixel.cc ../../pixelmap/PixelMap.cc
    13 LIBS += -L/ihp/local/qwt-5.2.1/lib -lqwt $(DIMDIR)/linux/libdim.a
     13LIBS += -L$(QWTDIR)/lib -lqwt $(DIMDIR)/linux/libdim.a
Note: See TracChangeset for help on using the changeset viewer.