From 2df815d479f3f7da693d59b0448bb647f6cdb980 Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Thu, 16 Feb 2023 16:21:27 +0000 Subject: [PATCH] Fix compiler warnings and doc typos. --- plugins/channelrx/heatmap/heatmapgui.cpp | 15 +++++++-------- plugins/channelrx/heatmap/heatmapgui.h | 1 - plugins/channelrx/heatmap/readme.md | 12 ++++++------ 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/plugins/channelrx/heatmap/heatmapgui.cpp b/plugins/channelrx/heatmap/heatmapgui.cpp index bcdedadde..e21683ef9 100644 --- a/plugins/channelrx/heatmap/heatmapgui.cpp +++ b/plugins/channelrx/heatmap/heatmapgui.cpp @@ -205,7 +205,7 @@ const QStringList HeatMapGUI::m_averagePeriodTexts = { void HeatMapGUI::on_averagePeriod_valueChanged(int value) { - m_settings.m_averagePeriodUS = (int)std::powf(10.0f, (float)value); + m_settings.m_averagePeriodUS = (int)std::pow(10.0f, (float)value); ui->averagePeriodText->setText(m_averagePeriodTexts[value-1]); applySettings(); } @@ -216,7 +216,7 @@ const QStringList HeatMapGUI::m_sampleRateTexts = { void HeatMapGUI::on_sampleRate_valueChanged(int value) { - m_settings.m_sampleRate = (int)std::powf(10.0f, (float)value); + m_settings.m_sampleRate = (int)std::pow(10.0f, (float)value); ui->sampleRateText->setText(m_sampleRateTexts[value-1]); ui->averagePeriod->setMinimum(std::max(1, m_averagePeriodTexts.size() - value)); m_scopeVis->setLiveRate(m_settings.m_sampleRate); @@ -296,8 +296,8 @@ void HeatMapGUI::coordsToPixel(double latitude, double longitude, int& x, int& y void HeatMapGUI::pixelToCoords(int x, int y, double& latitude, double& longitude) const { - latitude = m_north - (y /*+ 0.5*/) * m_degreesLatPerPixel; - longitude = m_west + (x /*+ 0.5*/) * m_degreesLonPerPixel; + latitude = m_north - y * m_degreesLatPerPixel; + longitude = m_west + x * m_degreesLonPerPixel; } void HeatMapGUI::on_writeCSV_clicked() @@ -460,6 +460,8 @@ void HeatMapGUI::on_txPower_valueChanged(double value) void HeatMapGUI::on_txPositionSet_clicked(bool checked) { + (void) checked; + ui->txLatitude->setText(QString::number(m_latitude)); ui->txLongitude->setText(QString::number(m_longitude)); m_settings.m_txLatitude = m_latitude; @@ -536,7 +538,6 @@ HeatMapGUI::HeatMapGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS m_basebandSampleRate(1), m_doApplySettings(true), m_tickCount(0), - m_brush(Qt::SolidPattern), m_powerChart(nullptr), m_powerAverageSeries(nullptr), m_powerMaxPeakSeries(nullptr), @@ -613,14 +614,13 @@ HeatMapGUI::HeatMapGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS ui->longitude->setText(QString::number(m_longitude)); QStringList colorMapNames = ColorMap::getColorMapNames(); - for (const auto color : colorMapNames) { + for (const auto& color : colorMapNames) { ui->colorMap->addItem(color); } m_colorMap = ColorMap::getColorMap(m_settings.m_colorMapName); m_pen.setColor(Qt::black); m_painter.setPen(m_pen); - //m_painter.setBrush(m_brush); createMap(); @@ -946,7 +946,6 @@ void HeatMapGUI::plotPixel(int x, int y, double power) QColor color = QColor::fromRgbF(m_colorMap[index*3], m_colorMap[index*3+1], m_colorMap[index*3+2]); m_pen.setColor(color); m_painter.setPen(m_pen); - //m_painter.setBrush(m_brush); m_painter.drawPoint(QPoint(x, y)); } diff --git a/plugins/channelrx/heatmap/heatmapgui.h b/plugins/channelrx/heatmap/heatmapgui.h index ca2ee4f6e..6d8c10777 100644 --- a/plugins/channelrx/heatmap/heatmapgui.h +++ b/plugins/channelrx/heatmap/heatmapgui.h @@ -116,7 +116,6 @@ private: double m_altitude; QPainter m_painter; QPen m_pen; - QBrush m_brush; const float *m_colorMap; int m_x; // Current position int m_y; diff --git a/plugins/channelrx/heatmap/readme.md b/plugins/channelrx/heatmap/readme.md index 4af4fcb6c..98f6ff568 100644 --- a/plugins/channelrx/heatmap/readme.md +++ b/plugins/channelrx/heatmap/readme.md @@ -11,7 +11,7 @@ To record data for a heat map, a GPS is required, and Preferences > My Position On Android, GPS setup should be automatic. On Windows/Linux/Mac, a GPS supporting NMEA via a serial port at 4800 baud is required. The COM port / serial device should be specfied via the QT_NMEA_SERIAL_PORT environment variable before SDRangel is started. -![Heat Map plugin GUI](../../../doc/img/HeatMap_plugin.png) +![A Heat Map](../../../doc/img/HeatMap_plugin_map.png)

Interface

@@ -39,7 +39,7 @@ Bandwidth in Hz of the channel for which power is to be measured.

5: Res - Resolution

-Displays the heat map resolution in metres per pixel. Currently this is fixed at ~3m. +Displays the heat map resolution in metres per pixel. Currently this is fixed at ~3m per pixel.

6: SR - Sample Rate

@@ -79,7 +79,7 @@ The colour map minimum power field, specifies the power in dB, below which, powe

15: Max - Colour Map Maximum Power

-The colour map maximum power field, specifies the power in dB, above which, all power measurements are mapped to the highest entry in the colour map. +The colour map maximum power field, specifies the power in dB, above which, all power measurements are mapped to the highest entry in the colour map (16).

16: Colour Map

@@ -99,7 +99,7 @@ Displays the range from the current position to the transmitter position in metr

20: Loss

-Displays the free space path loss from the current position to the transmitter, based on the channel centre frequency, in dB +Displays the free space path loss from the current position to the transmitter, based on the channel centre frequency, in dB.

21: Avg - Average Power

@@ -115,7 +115,7 @@ Displays the current minimum peak power measurement in dB.

24: Pulse - Pulse Average Power

-Displays the most recent pulse average power in dB. +Displays the most recent pulse average power measurement in dB.

25: Data

@@ -147,7 +147,7 @@ The chart displays the most recent average, max peak, min peak and pulse average received signal level from the transmitter (9), taking in to account free space path loss. Each series can be individually enabled or disabled. -The last number of minutes worth of data displayed can be specified from 1 to 60 minutes. +The last number of minutes worth of data displayed can be specified from 1 to 10 minutes.

Power Measurements