Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix test for QWT_POLAR
  • Loading branch information
nyalldawson committed Jan 1, 2016
1 parent 0df4cbe commit 144ca8d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/app/gps/qgsgpsinformationwidget.cpp
Expand Up @@ -48,7 +48,7 @@
#include <qwt_plot.h>
#include <qwt_plot_grid.h>

#if (WITH_QWTPOLAR)
#ifdef WITH_QWTPOLAR
// QWT Polar plot add on
#include <qwt_symbol.h>
#include <qwt_polar_grid.h>
Expand Down Expand Up @@ -79,7 +79,7 @@ QgsGPSInformationWidget::QgsGPSInformationWidget( QgsMapCanvas * thepCanvas, QWi
mpRubberBand = nullptr;
populateDevices();
QWidget * mpHistogramWidget = mStackedWidget->widget( 1 );
#if (!WITH_QWTPOLAR)
#ifndef WITH_QWTPOLAR
mBtnSatellites->setVisible( false );
#endif
//
Expand Down Expand Up @@ -115,7 +115,7 @@ QgsGPSInformationWidget::QgsGPSInformationWidget( QgsMapCanvas * thepCanvas, QWi
//
// Set up the polar graph for satellite pos
//
#if (WITH_QWTPOLAR)
#ifdef WITH_QWTPOLAR
QWidget * mpPolarWidget = mStackedWidget->widget( 2 );
mpSatellitesWidget = new QwtPolarPlot( /*QwtText( tr( "Satellite View" ), QwtText::PlainText ),*/ mpPolarWidget ); // possible title for graph removed for now as it is too large in small windows
mpSatellitesWidget->setAutoReplot( false ); // plot on demand (after all data has been handled)
Expand Down Expand Up @@ -256,7 +256,7 @@ QgsGPSInformationWidget::~QgsGPSInformationWidget()
delete mpMapMarker;
delete mpRubberBand;

#if (WITH_QWTPOLAR)
#ifdef WITH_QWTPOLAR
delete mpSatellitesGrid;
#endif

Expand Down Expand Up @@ -541,7 +541,7 @@ void QgsGPSInformationWidget::displayGPSInformation( const QgsGPSInformation& in
{
mpPlot->setAxisScale( QwtPlot::xBottom, 0, info.satellitesInView.size() );
} //signal
#if (WITH_QWTPOLAR)
#ifdef WITH_QWTPOLAR
if ( mStackedWidget->currentIndex() == 2 && info.satInfoComplete ) //satellites
{
while ( !mMarkerList.isEmpty() )
Expand Down Expand Up @@ -589,7 +589,7 @@ void QgsGPSInformationWidget::displayGPSInformation( const QgsGPSInformation& in
// Add a marker to the polar plot
if ( currentInfo.id > 0 ) // don't show satellite if id=0 (no satellite indication)
{
#if (WITH_QWTPOLAR)
#ifdef WITH_QWTPOLAR
QwtPolarMarker *mypMarker = new QwtPolarMarker();
#if (QWT_POLAR_VERSION<0x010000)
mypMarker->setPosition( QwtPolarPoint( currentInfo.azimuth, currentInfo.elevation ) );
Expand All @@ -605,7 +605,7 @@ void QgsGPSInformationWidget::displayGPSInformation( const QgsGPSInformation& in
{
myColor = Qt::black; //strong signal
}
#if (WITH_QWTPOLAR)
#ifdef WITH_QWTPOLAR
#if (QWT_POLAR_VERSION<0x010000)
mypMarker->setSymbol( QwtSymbol( QwtSymbol::Ellipse,
symbolBrush, QPen( myColor ), markerSize ) );
Expand Down Expand Up @@ -635,7 +635,7 @@ void QgsGPSInformationWidget::displayGPSInformation( const QgsGPSInformation& in
#endif
mpPlot->replot();
} //signal
#if (WITH_QWTPOLAR)
#ifdef WITH_QWTPOLAR
if ( mStackedWidget->currentIndex() == 2 && info.satInfoComplete ) //satellites
{
mpSatellitesWidget->replot();
Expand Down
4 changes: 2 additions & 2 deletions src/app/gps/qgsgpsinformationwidget.h
Expand Up @@ -23,7 +23,7 @@
#include <qgsgpsmarker.h>
#include <qgsmaptoolcapture.h>
#include <qwt_plot_curve.h>
#if (WITH_QWTPOLAR)
#ifdef WITH_QWTPOLAR
#include <qwt_polar_plot.h>
#include <qwt_polar_grid.h>
#include <qwt_polar_marker.h>
Expand Down Expand Up @@ -88,7 +88,7 @@ class QgsGPSInformationWidget: public QWidget, private Ui::QgsGPSInformationWidg
QgsGpsMarker * mpMapMarker;
QwtPlot * mpPlot;
QwtPlotCurve * mpCurve;
#if (WITH_QWTPOLAR)
#ifdef WITH_QWTPOLAR
QwtPolarPlot * mpSatellitesWidget;
QwtPolarGrid *mpSatellitesGrid;
QList< QwtPolarMarker * > mMarkerList;
Expand Down

0 comments on commit 144ca8d

Please sign in to comment.