Changeset 4610 in ntrip for trunk/BNC/src/rinex/availplot.cpp


Ignore:
Timestamp:
Aug 31, 2012, 11:33:14 AM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/rinex/availplot.cpp

    r4604 r4610  
    11
    2 #include <qwt_plot_curve.h>
    32#include <qwt_scale_draw.h>
    43#include <qwt_text.h>
     4#include <qwt_legend.h>
    55
    66#include "availplot.h"
     
    5757  QwtSymbol* symbolBlue  = new QwtSymbol(QwtSymbol::Rect, QBrush(blue),
    5858                                         QPen(blue), QSize(1,1));
     59
     60  // Legend
     61  // ------
     62  QwtLegend* legend = new QwtLegend;
     63  insertLegend(legend, QwtPlot::RightLegend);
    5964 
    6065  // Curves
     
    7782      const QVector<double>& xData = availData._L1ok;
    7883      QVector<double>        yData(xData.size(), double(iC)+eps);
    79       addCurve(prn, symbolGreen, xData, yData);
     84      QwtPlotCurve* curve = addCurve(prn, symbolGreen, xData, yData);
     85      curve->setItemAttribute(QwtPlotItem::Legend, false);
    8086    }
    8187
     
    8591      const QVector<double>& xData = availData._L2ok;
    8692      QVector<double>        yData(xData.size(), double(iC)-eps);
    87       addCurve(prn, symbolGreen, xData, yData);
     93      QwtPlotCurve* curve = addCurve(prn, symbolGreen, xData, yData);
     94      curve->setItemAttribute(QwtPlotItem::Legend, false);
    8895    }
    8996
     
    93100      const QVector<double>& xData = availData._L1gap;
    94101      QVector<double>        yData(xData.size(), double(iC)+eps);
    95       addCurve(prn, symbolBlue, xData, yData);
     102      QwtPlotCurve* curve = addCurve(prn, symbolBlue, xData, yData);
     103      curve->setItemAttribute(QwtPlotItem::Legend, false);
    96104    }
    97105
     
    101109      const QVector<double>& xData = availData._L2gap;
    102110      QVector<double>        yData(xData.size(), double(iC)-eps);
    103       addCurve(prn, symbolBlue, xData, yData);
     111      QwtPlotCurve* curve = addCurve(prn, symbolBlue, xData, yData);
     112      curve->setItemAttribute(QwtPlotItem::Legend, false);
    104113    }
    105114
     
    109118      const QVector<double>& xData = availData._L1slip;
    110119      QVector<double>        yData(xData.size(), double(iC)+eps);
    111       addCurve(prn, symbolRed, xData, yData);
     120      QwtPlotCurve* curve = addCurve(prn, symbolRed, xData, yData);
     121      curve->setItemAttribute(QwtPlotItem::Legend, false);
    112122    }
    113123
     
    117127      const QVector<double>& xData = availData._L2slip;
    118128      QVector<double>        yData(xData.size(), double(iC)-eps);
    119       addCurve(prn, symbolRed, xData, yData);
     129      QwtPlotCurve* curve = addCurve(prn, symbolRed, xData, yData);
     130      curve->setItemAttribute(QwtPlotItem::Legend, false);
    120131    }
    121132  }
     
    138149// Add Curve
    139150//////////////////////////////////////////////////////////////////////////////
    140 void t_availPlot::addCurve(const QString& name, const QwtSymbol* symbol,
    141                            const QVector<double>& xData,
    142                            const QVector<double>& yData) {
     151QwtPlotCurve* t_availPlot::addCurve(const QString& name,
     152                                    const QwtSymbol* symbol,
     153                                    const QVector<double>& xData,
     154                                    const QVector<double>& yData) {
    143155  QwtPlotCurve* curve = new QwtPlotCurve(name);
    144156  curve->setSymbol(symbol);
     
    148160  curve->setSamples(xData, yData);
    149161  curve->attach(this);
     162  return curve;
    150163}
Note: See TracChangeset for help on using the changeset viewer.