mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-09 00:13:41 +00:00
Fix warning and valgrind issues
This commit is contained in:
parent
1a779531ea
commit
d08388f903
12 changed files with 53 additions and 18 deletions
|
|
@ -21,6 +21,11 @@ TraceWaterfall::TraceWaterfall(TraceModel &model, QWidget *parent)
|
|||
keepDataBeyondPlotSize(false),
|
||||
maxDataSweeps(500)
|
||||
{
|
||||
plotAreaTop = 0;
|
||||
plotAreaLeft = 0;
|
||||
plotAreaWidth = 0;
|
||||
plotAreaBottom = 0;
|
||||
|
||||
xAxis.set(XAxis::Type::Frequency, false, true, 0, 6000000000, 500000000);
|
||||
yAxis.set(YAxis::Type::Magnitude, false, true, -1, 1, 1);
|
||||
initializeTraceInfo();
|
||||
|
|
@ -478,7 +483,7 @@ double TraceWaterfall::nearestTracePoint(Trace *t, QPoint pixel, double *distanc
|
|||
QString TraceWaterfall::mouseText(QPoint pos)
|
||||
{
|
||||
QString ret;
|
||||
if(QRect(plotAreaLeft, 0, plotAreaWidth + 1, plotAreaBottom).contains(pos)) {
|
||||
if(QRect(plotAreaLeft, plotAreaTop, plotAreaWidth + 1, plotAreaBottom).contains(pos)) {
|
||||
double x = xAxis.inverseTransform(pos.x(), plotAreaLeft, plotAreaLeft + plotAreaWidth);
|
||||
int significantDigits = floor(log10(abs(xAxis.getRangeMax()))) - floor(log10((abs(xAxis.getRangeMax() - xAxis.getRangeMin())) / 1000.0)) + 1;
|
||||
ret += Unit::ToString(x, xAxis.Unit(), "fpnum kMG", significantDigits) + "\n";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue