Changeset 4579 in ntrip for trunk/BNC/src/rinex
- Timestamp:
- Aug 29, 2012, 4:48:42 PM (12 years ago)
- Location:
- trunk/BNC/src/rinex
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/availplot.cpp
r4578 r4579 3 3 #include <qwt_symbol.h> 4 4 #include <qwt_plot_curve.h> 5 #include <qwt_plot_grid.h> 5 6 #include <qwt_legend.h> 6 7 … … 11 12 : QwtPlot(parent) { 12 13 13 setTitle("Availability Plot"); 14 setTitle("Availability Plot"); 15 16 setCanvasBackground(QColor(Qt::white)); 14 17 15 18 // Legend … … 17 20 QwtLegend* legend = new QwtLegend; 18 21 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); 19 30 20 31 // Axes … … 36 47 double yData[epochs.size()]; 37 48 for (int ii = 0; ii < epochs.size(); ii++) { 38 xData[ii] = epochs[ii] /1.e5;49 xData[ii] = epochs[ii]; 39 50 yData[ii] = iC; 40 51 } … … 45 56 QwtPlotCurve* curve = new QwtPlotCurve(prn); 46 57 curve->setSymbol( symbol ); 47 ///curve->setStyle( QwtPlotCurve::NoCurve );58 curve->setStyle( QwtPlotCurve::NoCurve ); 48 59 curve->setLegendAttribute( QwtPlotCurve::LegendShowSymbol ); 49 60 curve->setXAxis(QwtPlot::xBottom); -
trunk/BNC/src/rinex/graphwin.cpp
r4577 r4579 138 138 void t_graphWin::slotPrint() { 139 139 140 savePNG("./", ".PNG"); 141 140 142 QPrinter printer; 141 143 QPrintDialog* dialog = new QPrintDialog(&printer, this); … … 160 162 // Save the Widget as PNG Files 161 163 //////////////////////////////////////////////////////////////////////////// 162 void t_graphWin::savePNG(const QString& dirName, QByteArray ext ,163 QwtPlot* plot) { 164 void t_graphWin::savePNG(const QString& dirName, QByteArray ext) { 165 164 166 if (dirName.isEmpty()) { 165 167 return; … … 174 176 + fileInfo.completeBaseName() + ext; 175 177 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"); 188 182 } -
trunk/BNC/src/rinex/graphwin.h
r4577 r4579 58 58 ~t_graphWin(); 59 59 60 void savePNG(const QString& dirName, QByteArray ext , QwtPlot* plot);60 void savePNG(const QString& dirName, QByteArray ext); 61 61 62 62 signals: -
trunk/BNC/src/rinex/reqcanalyze.cpp
r4577 r4579 41 41 #include <iostream> 42 42 #include <iomanip> 43 #include <qwt_plot_renderer.h> 43 44 44 45 #include "reqcanalyze.h" … … 166 167 if (!dirName.isEmpty()) { 167 168 QByteArray ext = scaleTitle.isEmpty() ? "_SNR.png" : "_MP.png"; 168 graphWin->savePNG(dirName, ext , 0);169 graphWin->savePNG(dirName, ext); 169 170 } 170 171 } … … 524 525 if (!dirName.isEmpty()) { 525 526 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.