Changeset 4356 in ntrip for trunk/BNC/src


Ignore:
Timestamp:
Jun 24, 2012, 6:52:38 PM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src/rinex
Files:
5 edited

Legend:

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

    r4349 r4356  
    4747// Constructor
    4848////////////////////////////////////////////////////////////////////////////
    49 t_graphWin::t_graphWin(QWidget* parent, const QVector<QWidget*>& plots) :
    50  QDialog(parent) {
     49t_graphWin::t_graphWin(QWidget* parent, const QVector<QWidget*>& plots,
     50                       const QwtInterval scaleInterval) :  QDialog(parent) {
    5151
    5252  this->setAttribute(Qt::WA_DeleteOnClose);
     
    7979   _colorScale->setTitle( title );
    8080
    81    QwtInterval interval(0.0, 1.0);
    82    _colorScale->setColorMap(interval, new t_colorMap());
     81   _colorScale->setColorMap(scaleInterval, new t_colorMap());
    8382
    8483   QwtLinearScaleEngine scaleEngine;
    8584   _colorScale->setScaleDiv(scaleEngine.transformation(),
    86       scaleEngine.divideScale(interval.minValue(), interval.maxValue(), 8, 5));
     85                            scaleEngine.divideScale(scaleInterval.minValue(),
     86                                                    scaleInterval.maxValue(),
     87                                                    8, 5));
    8788
    8889  // Layout
  • trunk/BNC/src/rinex/graphwin.h

    r4349 r4356  
    3838  t_colorMap() : QwtLinearColorMap(Qt::darkBlue, Qt::yellow) {
    3939    addColorStop(0.05, Qt::blue);
    40     addColorStop(0.30, Qt::cyan);
    41     addColorStop(0.60, Qt::green);
    42     addColorStop(0.98, Qt::red);
     40//    addColorStop(0.30, Qt::cyan);
     41//    addColorStop(0.60, Qt::green);
     42    addColorStop(9.98, Qt::red);
    4343  }
    4444};
     
    5151
    5252 public:
    53   t_graphWin(QWidget* parent, const QVector<QWidget*>& plots);
     53  t_graphWin(QWidget* parent, const QVector<QWidget*>& plots,
     54             const QwtInterval scaleInterval);
    5455  ~t_graphWin();
    5556
  • trunk/BNC/src/rinex/polarplot.cpp

    r4345 r4356  
    3333    QwtSymbol ss(symbol);
    3434    const QwtPointPolar& point = sample(ii);
    35     const QColor color = colorMap.color(QwtInterval(0.0, 1.0), point._value);
     35    const QColor color = colorMap.color(_scaleInterval, point._value);
    3636    ss.setBrush(QBrush(color));
    3737    ss.setPen(QPen(color));
     
    4242// Constructor
    4343////////////////////////////////////////////////////////////////////////////
    44 t_polarPlot::t_polarPlot(const QwtText& title, QWidget* parent) :
     44t_polarPlot::t_polarPlot(const QwtText& title, const QwtInterval& scaleInterval,
     45                         QWidget* parent) : QwtPolarPlot(title, parent) {
    4546
    46   QwtPolarPlot(title, parent) {
     47  _scaleInterval = scaleInterval;
    4748
    4849  setPlotBackground(Qt::white);
     
    8182void t_polarPlot::addCurve(QVector<t_polarPoint*>* data) {
    8283  t_polarCurve* curve = new t_polarCurve();
     84  curve->setScaleInterval(_scaleInterval);
    8385  curve->setStyle(QwtPolarCurve::NoCurve);  // draw only symbols
    8486  curve->setSymbol(new QwtSymbol(QwtSymbol::Ellipse,
  • trunk/BNC/src/rinex/polarplot.h

    r4345 r4356  
    1212  t_polarCurve() {}
    1313  virtual ~t_polarCurve() {}
     14  void setScaleInterval(const QwtInterval& scaleInterval) {
     15    _scaleInterval = scaleInterval;
     16  }
    1417 protected:
    15    virtual void drawSymbols(QPainter* painter, const QwtSymbol& symbol,
    16                             const QwtScaleMap& azimuthMap,
    17                             const QwtScaleMap& radialMap,
    18                             const QPointF& pole, int from, int to) const;
     18  virtual void drawSymbols(QPainter* painter, const QwtSymbol& symbol,
     19                           const QwtScaleMap& azimuthMap,
     20                           const QwtScaleMap& radialMap,
     21                           const QPointF& pole, int from, int to) const;
     22 private:
     23  QwtInterval _scaleInterval;
    1924};
    2025
     
    6368
    6469 public:
    65   t_polarPlot(const QwtText& title, QWidget* = 0);
     70  t_polarPlot(const QwtText& title, const QwtInterval& scaleInterval,
     71              QWidget* = 0);
    6672  void addCurve(QVector<t_polarPoint*>* data);
    6773
    6874 private:
     75  QwtInterval _scaleInterval;
    6976};
    7077
  • trunk/BNC/src/rinex/reqcanalyze.cpp

    r4355 r4356  
    9090  if (app->mode() == bncApp::interactive) {
    9191
    92     t_polarPlot* plotMP1 = new t_polarPlot(QwtText("MP1"), app->mainWindow());
     92    double maxMP = 0.0;
     93    for (int ii = 0; ii < dataMP1->size(); ii++) {
     94      double mp = dataMP1->at(ii)->_value;
     95      if (maxMP < mp) {
     96        maxMP = mp;
     97      }
     98    }
     99    for (int ii = 0; ii < dataMP2->size(); ii++) {
     100      double mp = dataMP2->at(ii)->_value;
     101      if (maxMP < mp) {
     102        maxMP = mp;
     103      }
     104    }
     105
     106    qDebug() << maxMP;
     107
     108    QwtInterval scaleInterval(0.0, maxMP);
     109
     110    t_polarPlot* plotMP1 = new t_polarPlot(QwtText("MP1"), scaleInterval,
     111                                           app->mainWindow());
    93112    plotMP1->addCurve(dataMP1);
    94113
    95     t_polarPlot* plotMP2 = new t_polarPlot(QwtText("MP2"), app->mainWindow());
     114    t_polarPlot* plotMP2 = new t_polarPlot(QwtText("MP2"), scaleInterval,
     115                                           app->mainWindow());
    96116    plotMP2->addCurve(dataMP2);
    97117   
     
    100120    plots << plotMP2;
    101121
    102     t_graphWin* graphWin = new t_graphWin(0, plots);
     122    t_graphWin* graphWin = new t_graphWin(0, plots, scaleInterval);
    103123
    104124    graphWin->show();
Note: See TracChangeset for help on using the changeset viewer.