Option to display only the current span in smithchart

This commit is contained in:
Jan Käberich 2020-11-06 13:05:09 +01:00
parent c3bcb70d87
commit 1dab72238b
12 changed files with 194 additions and 60 deletions

View file

@ -115,7 +115,7 @@ private:
};
TraceXYPlot::TraceXYPlot(TraceModel &model, QWidget *parent)
: TracePlot(parent),
: TracePlot(model, parent),
selectedMarker(nullptr)
{
YAxis[0].log = false;
@ -164,7 +164,7 @@ TraceXYPlot::TraceXYPlot(TraceModel &model, QWidget *parent)
layout->setContentsMargins(0, 0, 0, 0);
setLayout(layout);
plot->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
initializeTraceInfo(model);
initializeTraceInfo();
setAutoFillBackground(true);
// Setup default axis
@ -173,8 +173,6 @@ TraceXYPlot::TraceXYPlot(TraceModel &model, QWidget *parent)
// enable autoscaling and set for full span (no information about actual span available yet)
updateSpan(0, 6000000000);
setXAxis(XAxisType::Frequency, XAxisMode::UseSpan, 0, 6000000000, 600000000);
// get notified when the span changes
connect(&model, &TraceModel::SpanChanged, this, qOverload<double, double>(&TraceXYPlot::updateSpan));
allPlots.insert(this);
}
@ -190,12 +188,6 @@ TraceXYPlot::~TraceXYPlot()
allPlots.erase(this);
}
void TraceXYPlot::updateSpan(double min, double max)
{
sweep_fmin = min;
sweep_fmax = max;
}
void TraceXYPlot::setYAxis(int axis, TraceXYPlot::YAxisType type, bool log, bool autorange, double min, double max, double div)
{
if(YAxis[axis].type != type) {