From d526270fd2999a4c0cd6a882f46916969f46157e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Sun, 13 Mar 2022 23:00:06 +0100 Subject: [PATCH] Linear magnitude option --- Software/PC_Application/LibreVNA-GUI.pro | 2 +- Software/PC_Application/Traces/tracexyplot.cpp | 6 ++++++ Software/PC_Application/Traces/tracexyplot.h | 1 + Software/PC_Application/Traces/xyplotaxisdialog.cpp | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Software/PC_Application/LibreVNA-GUI.pro b/Software/PC_Application/LibreVNA-GUI.pro index cb38875..7ac0c4f 100644 --- a/Software/PC_Application/LibreVNA-GUI.pro +++ b/Software/PC_Application/LibreVNA-GUI.pro @@ -305,5 +305,5 @@ RESOURCES += \ CONFIG += c++17 REVISION = $$system(git rev-parse HEAD) DEFINES += GITHASH=\\"\"$$REVISION\\"\" -DEFINES += FW_MAJOR=1 FW_MINOR=2 FW_PATCH=1 FW_SUFFIX=""#\\"\"-alpha.2\\"\" +DEFINES += FW_MAJOR=1 FW_MINOR=2 FW_PATCH=2 FW_SUFFIX=""#\\"\"-alpha.2\\"\" DEFINES -= _UNICODE UNICODE diff --git a/Software/PC_Application/Traces/tracexyplot.cpp b/Software/PC_Application/Traces/tracexyplot.cpp index 7400930..fdb9838 100644 --- a/Software/PC_Application/Traces/tracexyplot.cpp +++ b/Software/PC_Application/Traces/tracexyplot.cpp @@ -886,6 +886,7 @@ QString TraceXYPlot::AxisTypeToName(TraceXYPlot::YAxisType type) switch(type) { case YAxisType::Disabled: return "Disabled"; case YAxisType::Magnitude: return "Magnitude"; + case YAxisType::MagnitudeLinear: return "Magnitude (linear)"; case YAxisType::Phase: return "Phase"; case YAxisType::UnwrappedPhase: return "Unwrapped Phase"; case YAxisType::VSWR: return "VSWR"; @@ -998,6 +999,9 @@ QPointF TraceXYPlot::traceToCoordinate(Trace *t, unsigned int sample, TraceXYPlo case YAxisType::Magnitude: ret.setY(Util::SparamTodB(data.y)); break; + case YAxisType::MagnitudeLinear: + ret.setY(abs(data.y)); + break; case YAxisType::Phase: ret.setY(Util::SparamToDegree(data.y)); break; @@ -1236,6 +1240,7 @@ QString TraceXYPlot::AxisUnit(TraceXYPlot::YAxisType type) if(source == TraceModel::DataSource::VNA) { switch(type) { case TraceXYPlot::YAxisType::Magnitude: return "dB"; + case TraceXYPlot::YAxisType::MagnitudeLinear: return ""; case TraceXYPlot::YAxisType::Phase: return "°"; case TraceXYPlot::YAxisType::UnwrappedPhase: return "°"; case TraceXYPlot::YAxisType::VSWR: return ""; @@ -1270,6 +1275,7 @@ QString TraceXYPlot::AxisPrefixes(TraceXYPlot::YAxisType type) if(source == TraceModel::DataSource::VNA) { switch(type) { case TraceXYPlot::YAxisType::Magnitude: return " "; + case TraceXYPlot::YAxisType::MagnitudeLinear: return "num "; case TraceXYPlot::YAxisType::Phase: return " "; case TraceXYPlot::YAxisType::UnwrappedPhase: return " "; case TraceXYPlot::YAxisType::VSWR: return " "; diff --git a/Software/PC_Application/Traces/tracexyplot.h b/Software/PC_Application/Traces/tracexyplot.h index 68194b8..6fdbe65 100644 --- a/Software/PC_Application/Traces/tracexyplot.h +++ b/Software/PC_Application/Traces/tracexyplot.h @@ -16,6 +16,7 @@ public: Disabled, // S parameter options Magnitude, + MagnitudeLinear, Phase, UnwrappedPhase, VSWR, diff --git a/Software/PC_Application/Traces/xyplotaxisdialog.cpp b/Software/PC_Application/Traces/xyplotaxisdialog.cpp index 3bde501..f98356b 100644 --- a/Software/PC_Application/Traces/xyplotaxisdialog.cpp +++ b/Software/PC_Application/Traces/xyplotaxisdialog.cpp @@ -230,6 +230,7 @@ std::set XYplotAxisDialog::supportedYAxis(TraceXYPlot::X case TraceXYPlot::XAxisType::Frequency: case TraceXYPlot::XAxisType::Power: ret.insert(TraceXYPlot::YAxisType::Magnitude); + ret.insert(TraceXYPlot::YAxisType::MagnitudeLinear); ret.insert(TraceXYPlot::YAxisType::Phase); ret.insert(TraceXYPlot::YAxisType::UnwrappedPhase); ret.insert(TraceXYPlot::YAxisType::VSWR);