- Timestamp:
- 02/08/10 15:03:53 (15 years ago)
- Location:
- Evidence
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Evidence/Edd/Edd.cc
r159 r164 22 22 class GUI *Handler; 23 23 24 25 // History chooser function (opens plot for numeric data, TextHist for all other) 26 QWidget *OpenHistory(char *Service) { 27 28 char *Name, *Format; 29 DimBrowser Browser; 30 31 //if (Browser.getServices(Service) == 0) return NULL; 32 Browser.getServices(Service); 33 if (Browser.getNextService(Name, Format) != DimSERVICE) return NULL; 34 35 if (strlen(Format) == 1 && *Format != 'C') return new Edd_Plot(Service); 36 else return new Edd_TextHist(Service); 37 } 38 39 24 40 ////////////////////////////////////////// 25 41 // Text display for arbitary DIM service// … … 41 57 // Context menu 42 58 Menu = new QMenu(this); 43 Menu->addAction("Open history", this, SLOT(MenuOpenHistory()));59 Menu->addAction("Open new history", this, SLOT(MenuOpenHistory())); 44 60 Menu->addAction("Copy service", this, SLOT(MenuCopyService())); 45 61 Menu->addAction("Copy data", this, SLOT(MenuCopyData())); … … 135 151 void Edd_Indicator::MenuOpenHistory() { 136 152 137 LastPlot = new Edd_Plot(Data->getName());138 LastPlot->show();153 LastPlot = OpenHistory(Data->getName()); 154 if (LastPlot != NULL) LastPlot->show(); 139 155 } 140 156 … … 165 181 // Graph properties 166 182 setAutoReplot(false); 167 QwtText XAxisTitle("Time (RJD-55200)");168 XAxisTitle.setFont(QFont("Helvetica", 10));169 setAxisTitle(QwtPlot::xBottom, XAxisTitle);170 183 setCanvasBackground(QColor(Qt::yellow)); 184 setAxisScaleDraw(QwtPlot::xBottom, new TimeScale()); 171 185 172 186 Zoomer = new QwtPlotZoomer(QwtPlot::xBottom,QwtPlot::yLeft,canvas()); … … 347 361 else Items[ItemNo].Signal->setSymbol(Sym1); 348 362 349 int DataPoints = Items[ItemNo].x.size(); 350 363 int DataPoints = Items[ItemNo].x.size(); 351 364 if (DataPoints == 0) continue; 352 353 double *x = new double [DataPoints];365 366 // Normalize y scale if requested 354 367 double *y = new double [DataPoints]; 355 356 // Adapt time scale and normalize y scale if requested357 368 for (int i=0; i<DataPoints; i++) { 358 x[i] = Items[ItemNo].x[i] / 86400.0 + 40587.5 - 55200;359 369 y[i] = Items[ItemNo].y[i]; 360 370 … … 368 378 369 379 // Plot data 370 Items[ItemNo].Signal->setData( x, y, DataPoints);380 Items[ItemNo].Signal->setData(Items[ItemNo].x.data(), y, DataPoints); 371 381 Items[ItemNo].Signal->show(); 372 382 Zoomer->setZoomBase(Items[ItemNo].Signal->boundingRect()); 373 383 374 delete[] x;375 384 delete[] y; 376 385 } … … 825 834 Result = Result.trimmed(); 826 835 if (Result.endsWith(".hist")) Result.chop(5); 827 Edd_Plot *Plot = new Edd_Plot(Result);828 Plot->show();836 QWidget *Hist = OpenHistory(Result.toAscii().data()); 837 if (Hist != NULL) Hist->show(); 829 838 } 830 839 } -
Evidence/Edd/Edd.h
r159 r164 24 24 25 25 #define SVN_REVISION "$Revision$" 26 27 QWidget *OpenHistory(char *); 28 29 // Time scale for axis 30 class TimeScale: public QwtScaleDraw { 31 public: 32 TimeScale() { } 33 virtual QwtText label(double v) const { 34 QDateTime t = QDateTime::fromTime_t((int) v); 35 return t.toString("dMMM'\n'h:m:s"); 36 } 37 }; 38 26 39 27 40 // General indicator for DIM service … … 31 44 QMenu *Menu; 32 45 QPoint dragStart; 33 QwtPlot *LastPlot; 46 //QwtPlot *LastPlot; 47 QWidget *LastPlot; 34 48 35 49 DimStampedInfo *Data; -
Evidence/Evidence.cc
r159 r164 51 51 52 52 // Start server 53 static char Init[] = "Server started ";53 static char Init[] = "Server started (" EVIDENCE_REVISION " Compiled "__DATE__ __TIME__ ")"; 54 54 Status = new DimService((string(Name) + "/Status").c_str(), (char *) "C", Init, sizeof(Init)); 55 55 -
Evidence/Evidence.h
-
Property svn:keywords
set to
Revision
r159 r164 8 8 #include <exception> 9 9 #include <vector> 10 10 11 11 #include "dis.hxx" 12 12 #include "dic.hxx" … … 14 14 #define NO_LINK (char *) "__&DIM&NOLINK&__" // Data if no link available 15 15 #define STATUS_SIZE 1000 // Bytes for status service string 16 #define EVIDENCE_REVISION "$Revision$" 16 17 17 18 // Class declation of Evidence server -
Property svn:keywords
set to
Note:
See TracChangeset
for help on using the changeset viewer.