Changeset 4577 in ntrip
- Timestamp:
- Aug 29, 2012, 3:32:18 PM (12 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/graphwin.cpp
r4573 r4577 42 42 #include "qwt_scale_widget.h" 43 43 #include <qwt_scale_engine.h> 44 #include <qwt_plot_renderer.h> 44 45 45 46 using namespace std; … … 159 160 // Save the Widget as PNG Files 160 161 //////////////////////////////////////////////////////////////////////////// 161 void t_graphWin::savePNG(const QString& dirName, QByteArray ext) { 162 void t_graphWin::savePNG(const QString& dirName, QByteArray ext, 163 QwtPlot* plot) { 162 164 if (dirName.isEmpty()) { 163 165 return; 164 166 } 165 QImage image(_canvas->size(), QImage::Format_RGB32); 166 QPainter painter(&image); 167 _canvas->render(&painter); 167 168 168 QDir dir(dirName); 169 169 QFileInfo fileInfo(_fileName); … … 173 173 QString fileName = dir.path() + QDir::separator() 174 174 + fileInfo.completeBaseName() + ext; 175 image.save(fileName,"PNG"); 175 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 } 176 188 } -
trunk/BNC/src/rinex/graphwin.h
r4573 r4577 29 29 #include <QtGui> 30 30 #include <qwt_color_map.h> 31 #include <qwt_plot.h> 31 32 32 33 class QwtScaleWidget; … … 57 58 ~t_graphWin(); 58 59 59 void savePNG(const QString& dirName, QByteArray ext );60 void savePNG(const QString& dirName, QByteArray ext, QwtPlot* plot); 60 61 61 62 signals: -
trunk/BNC/src/rinex/reqcanalyze.cpp
r4576 r4577 42 42 #include <iomanip> 43 43 44 #include <qwt_plot.h>45 #include <qwt_plot_curve.h>46 #include <qwt_symbol.h>47 48 44 #include "reqcanalyze.h" 49 45 #include "bncapp.h" … … 54 50 #include "graphwin.h" 55 51 #include "polarplot.h" 52 #include "availplot.h" 56 53 57 54 using namespace std; … … 169 166 if (!dirName.isEmpty()) { 170 167 QByteArray ext = scaleTitle.isEmpty() ? "_SNR.png" : "_MP.png"; 171 graphWin->savePNG(dirName, ext );168 graphWin->savePNG(dirName, ext, 0); 172 169 } 173 170 } … … 516 513 if (dynamic_cast<bncApp*>(qApp)->GUIenabled()) { 517 514 518 QwtPlot* plot = new QwtPlot(); 519 520 int iC = 0; 521 QMapIterator<QString, QVector<int> > it(*prnAvail); 522 while (it.hasNext()) { 523 it.next(); 524 ++iC; 525 const QString& prn = it.key(); 526 const QVector<int>& epochs = it.value(); 527 528 QVector<QPointF> samples; 529 for (int ii = 0; ii < epochs.size(); ii++) { 530 samples << QPointF(epochs[ii], iC); 531 } 532 533 QwtPlotCurve* curve = new QwtPlotCurve(prn); 534 curve->setStyle( QwtPlotCurve::NoCurve ); 535 QwtSymbol* symbol = new QwtSymbol( QwtSymbol::XCross ); 536 symbol->setSize( 4 ); 537 curve->setSymbol( symbol ); 538 curve->setLegendAttribute( QwtPlotCurve::LegendShowSymbol ); 539 curve->setSamples(samples); 540 curve->attach(plot); 541 } 515 t_availPlot* plot = new t_availPlot(0, prnAvail); 542 516 543 517 QVector<QWidget*> plots; … … 550 524 if (!dirName.isEmpty()) { 551 525 QByteArray ext = "_AVAIL.png"; 552 graphWin->savePNG(dirName, ext );553 } 554 } 555 } 526 graphWin->savePNG(dirName, ext, plot); 527 } 528 } 529 } -
trunk/BNC/src/src.pro
r4440 r4577 115 115 rinex/rnxnavfile.h rinex/corrfile.h \ 116 116 rinex/reqcedit.h rinex/reqcanalyze.h \ 117 rinex/graphwin.h rinex/polarplot.h 117 rinex/graphwin.h rinex/polarplot.h \ 118 rinex/availplot.h 118 119 SOURCES += rinex/bncpostprocess.cpp rinex/rnxobsfile.cpp \ 119 120 rinex/rnxnavfile.cpp rinex/corrfile.cpp \ 120 121 rinex/reqcedit.cpp rinex/reqcanalyze.cpp \ 121 rinex/graphwin.cpp rinex/polarplot.cpp 122 rinex/graphwin.cpp rinex/polarplot.cpp \ 123 rinex/availplot.cpp 122 124 } 123 125
Note:
See TracChangeset
for help on using the changeset viewer.