source: ntrip/trunk/BNC/src/rinex/availplot.cpp@ 4585

Last change on this file since 4585 was 4585, checked in by mervart, 10 years ago
File size: 1.3 KB
Line 
1
2#include <qwt_symbol.h>
3#include <qwt_plot_curve.h>
4
5#include "availplot.h"
6#include "reqcanalyze.h"
7
8t_availPlot::t_availPlot(QWidget* parent,
9 QMap<QString, t_availData>* availDataMap)
10: QwtPlot(parent) {
11
12 setCanvasBackground(QColor(Qt::white));
13
14 // Axes
15 // ----
16 setAxisTitle(QwtPlot::xBottom, "Epoch");
17 setAxisTitle(QwtPlot::yLeft, "PRN");
18
19 // Curves
20 // ------
21 int iC = 0;
22 QMapIterator<QString, t_availData > it(*availDataMap);
23 while (it.hasNext()) {
24 it.next();
25 ++iC;
26 const QString& prn = it.key();
27 const t_availData& availData = it.value();
28 const QVector<double>& epochs = availData._epoL1;
29
30 double xData[epochs.size()];
31 double yData[epochs.size()];
32 for (int ii = 0; ii < epochs.size(); ii++) {
33 xData[ii] = epochs[ii];
34 yData[ii] = iC;
35 }
36
37 QwtSymbol* symbol = new QwtSymbol( QwtSymbol::XCross );
38 symbol->setSize( 4 );
39
40 QwtPlotCurve* curve = new QwtPlotCurve(prn);
41 curve->setSymbol( symbol );
42 curve->setStyle( QwtPlotCurve::NoCurve );
43 curve->setXAxis(QwtPlot::xBottom);
44 curve->setYAxis(QwtPlot::yLeft);
45 curve->setSamples(xData, yData, epochs.size());
46 curve->attach(this);
47 }
48
49 // Important !!!
50 // -------------
51 replot();
52}
53
Note: See TracBrowser for help on using the repository browser.