Changeset 4579 in ntrip


Ignore:
Timestamp:
Aug 29, 2012, 4:48:42 PM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src/rinex
Files:
4 edited

Legend:

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

    r4578 r4579  
    33#include <qwt_symbol.h>
    44#include <qwt_plot_curve.h>
     5#include <qwt_plot_grid.h>
    56#include <qwt_legend.h>
    67
     
    1112: QwtPlot(parent) {
    1213
    13   setTitle("Availability Plot");
     14  setTitle("Availability Plot"); 
     15
     16  setCanvasBackground(QColor(Qt::white));
    1417
    1518  // Legend
     
    1720  QwtLegend* legend = new QwtLegend;
    1821  insertLegend(legend, QwtPlot::RightLegend);
     22
     23
     24    // grid
     25    QwtPlotGrid *grid = new QwtPlotGrid;
     26    grid->enableXMin(true);
     27    grid->setMajPen(QPen(Qt::gray, 0, Qt::DotLine));
     28    grid->setMinPen(QPen(Qt::gray, 0 , Qt::DotLine));
     29    grid->attach(this);
    1930
    2031  // Axes
     
    3647    double yData[epochs.size()];
    3748    for (int ii = 0; ii < epochs.size(); ii++) {
    38       xData[ii] = epochs[ii]/1.e5;
     49      xData[ii] = epochs[ii];
    3950      yData[ii] = iC;
    4051    }
     
    4556    QwtPlotCurve* curve = new QwtPlotCurve(prn);
    4657    curve->setSymbol( symbol );
    47     ///    curve->setStyle( QwtPlotCurve::NoCurve );
     58    curve->setStyle( QwtPlotCurve::NoCurve );
    4859    curve->setLegendAttribute( QwtPlotCurve::LegendShowSymbol );
    4960    curve->setXAxis(QwtPlot::xBottom);
  • trunk/BNC/src/rinex/graphwin.cpp

    r4577 r4579  
    138138void t_graphWin::slotPrint() {
    139139
     140  savePNG("./", ".PNG");
     141
    140142  QPrinter printer;
    141143  QPrintDialog* dialog = new QPrintDialog(&printer, this);
     
    160162// Save the Widget as PNG Files
    161163////////////////////////////////////////////////////////////////////////////
    162 void t_graphWin::savePNG(const QString& dirName, QByteArray ext,
    163                          QwtPlot* plot) {
     164void t_graphWin::savePNG(const QString& dirName, QByteArray ext) {
     165
    164166  if (dirName.isEmpty()) {
    165167    return;
     
    174176                   + fileInfo.completeBaseName() + ext;
    175177
    176   if (plot) {       
    177     QwtPlotRenderer renderer;
    178     renderer.setDiscardFlag(QwtPlotRenderer::DiscardBackground, false);
    179     renderer.setLayoutFlag(QwtPlotRenderer::KeepFrames, true);
    180     renderer.renderDocument(plot, fileName, QSizeF(300, 200), 85);
    181   }
    182   else {
    183     QImage image(_canvas->size(), QImage::Format_RGB32);
    184     QPainter painter(&image);
    185     _canvas->render(&painter);
    186     image.save(fileName,"PNG");
    187   }
     178  QImage image(_canvas->size(), QImage::Format_RGB32);
     179  QPainter painter(&image);
     180  _canvas->render(&painter);
     181  image.save(fileName,"PNG");
    188182}
  • trunk/BNC/src/rinex/graphwin.h

    r4577 r4579  
    5858  ~t_graphWin();
    5959
    60   void savePNG(const QString& dirName, QByteArray ext, QwtPlot* plot);
     60  void savePNG(const QString& dirName, QByteArray ext);
    6161
    6262 signals:
  • trunk/BNC/src/rinex/reqcanalyze.cpp

    r4577 r4579  
    4141#include <iostream>
    4242#include <iomanip>
     43#include <qwt_plot_renderer.h>
    4344
    4445#include "reqcanalyze.h"
     
    166167    if (!dirName.isEmpty()) {
    167168      QByteArray ext = scaleTitle.isEmpty() ? "_SNR.png" : "_MP.png";
    168       graphWin->savePNG(dirName, ext, 0);
     169      graphWin->savePNG(dirName, ext);
    169170    }
    170171  }
     
    524525    if (!dirName.isEmpty()) {
    525526      QByteArray ext = "_AVAIL.png";
    526       graphWin->savePNG(dirName, ext, plot);
    527     }
    528   }
    529 }
     527      graphWin->savePNG(dirName, ext);
     528    }
     529  }
     530}
Note: See TracChangeset for help on using the changeset viewer.