Compare commits

...

3 commits

Author SHA1 Message Date
Jan Käberich d77215aecb initialize new plots with the correct span
Some checks failed
Build / PC_Application_Ubuntu (push) Has been cancelled
Build / PC_Application_RPi5 (push) Has been cancelled
Build / PC_Application_Windows (push) Has been cancelled
Build / PC_Application_OSX (push) Has been cancelled
Build / PC_Application_OSX_13 (push) Has been cancelled
Build / Embedded_Firmware (push) Has been cancelled
HIL_Tests / Get_Repository (push) Has been cancelled
Unit_Tests / Tests (push) Has been cancelled
HIL_Tests / PC_Application_RPi5 (push) Has been cancelled
HIL_Tests / Embedded_Firmware (push) Has been cancelled
HIL_Tests / HIL (push) Has been cancelled
2025-10-31 15:42:42 +01:00
Jan Käberich 7acb847a2b update compound device section in manual 2025-10-31 15:06:45 +01:00
Jan Käberich 92088ec646 Enable auto mode comobobox when auto range is active for X axis 2025-10-31 14:26:19 +01:00
11 changed files with 27 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

View file

@ -1410,14 +1410,14 @@ When connected to a compound device and in VNA mode, there is no phase informati
\end{important} \end{important}
\subsection{Creating a compound device} \subsection{Creating a compound device}
Compound devices must be configured in the preferences: \menu[,]{Window,Preferences,Compound Devices} Compound devices must be configured in the preferences:\linebreak\menu[,]{Window,Preferences,Device Drivers,LibreVNA/Compound}
\screenshot{1.0}{CompoundDeviceList.png} \screenshot{1.0}{CompoundDeviceList.png}
Create and remove compound devices with the buttons on the right. Edit an existing compound device by double-clicking it: Create and remove compound devices with the buttons on the right. Edit an existing compound device by double-clicking it:
\screenshot{1.0}{CompoundDeviceEdit.png} \screenshot{1.0}{CompoundDeviceEdit.png}
Required steps when creating a compound device: Required steps when creating a compound device:
\begin{enumerate} \begin{enumerate}
\item Assign a name to the new compound device \item Assign a name to the new compound device
\item Select the synchronization method between devices. At the moment, only USB synchronization is supported but future hardware versions might support faster synchronization via dedicated trigger ports \item Select the synchronization method between devices. At the moment, only GUI synchronization is supported but future hardware versions might support faster synchronization via dedicated trigger ports
\item Drag-and-drop a LibreVNA symbol into the configuration area for every physical device in the compound device \item Drag-and-drop a LibreVNA symbol into the configuration area for every physical device in the compound device
\begin{itemize} \begin{itemize}
\item At least two physical devices must be used \item At least two physical devices must be used

View file

@ -914,7 +914,7 @@ void SpectrumAnalyzer::ConfigureDevice()
average.reset(DeviceDriver::SApoints()); average.reset(DeviceDriver::SApoints());
UpdateAverageCount(); UpdateAverageCount();
traceModel.clearLiveData(); traceModel.clearLiveData();
emit traceModel.SpanChanged(settings.freqStart, settings.freqStop); traceModel.setSpan(settings.freqStart, settings.freqStop);
} else { } else {
if(window->getDevice()) { if(window->getDevice()) {
changingSettings = true; changingSettings = true;

View file

@ -9,6 +9,8 @@ using namespace std;
TraceModel::TraceModel(QObject *parent) TraceModel::TraceModel(QObject *parent)
: QAbstractTableModel(parent) : QAbstractTableModel(parent)
{ {
spanFmin = 0.0;
spanFmax = 6000000000.0;
traces.clear(); traces.clear();
source = DataSource::Unknown; source = DataSource::Unknown;
lastSweepPosition = 0.0; lastSweepPosition = 0.0;
@ -368,6 +370,13 @@ double TraceModel::getSweepPosition() const
} }
} }
void TraceModel::setSpan(double fmin, double fmax)
{
spanFmin = fmin;
spanFmax = fmax;
emit SpanChanged(fmin, fmax);
}
MarkerModel *TraceModel::getMarkerModel() const MarkerModel *TraceModel::getMarkerModel() const
{ {
return markerModel; return markerModel;

View file

@ -62,6 +62,10 @@ public:
double getSweepPosition() const; double getSweepPosition() const;
void setSpan(double fmin, double fmax);
double getSpanStart() {return spanFmin;}
double getSpanStop() {return spanFmax;}
signals: signals:
void SpanChanged(double fmin, double fmax); void SpanChanged(double fmin, double fmax);
void traceAdded(Trace *t); void traceAdded(Trace *t);
@ -80,6 +84,8 @@ private:
QDateTime lastReceivedData; QDateTime lastReceivedData;
std::vector<Trace*> traces; std::vector<Trace*> traces;
MarkerModel *markerModel; MarkerModel *markerModel;
double spanFmin, spanFmax;
}; };
#endif // TRACEMODEL_H #endif // TRACEMODEL_H

View file

@ -42,8 +42,7 @@ TracePlot::TracePlot(TraceModel &model, QWidget *parent)
lastUpdate = QTime::currentTime(); lastUpdate = QTime::currentTime();
replotTimer.setSingleShot(true); replotTimer.setSingleShot(true);
connect(&replotTimer, &QTimer::timeout, this, qOverload<>(&TracePlot::update)); connect(&replotTimer, &QTimer::timeout, this, qOverload<>(&TracePlot::update));
sweep_fmin = std::numeric_limits<double>::lowest(); TracePlot::updateSpan(model.getSpanStart(), model.getSpanStop());
sweep_fmax = std::numeric_limits<double>::max();
xSweep = std::numeric_limits<double>::quiet_NaN(); xSweep = std::numeric_limits<double>::quiet_NaN();
// get notified when the span changes // get notified when the span changes
connect(&model, &TraceModel::SpanChanged, this, qOverload<double, double>(&TracePlot::updateSpan)); connect(&model, &TraceModel::SpanChanged, this, qOverload<double, double>(&TracePlot::updateSpan));

View file

@ -29,8 +29,7 @@ TraceXYPlot::TraceXYPlot(TraceModel &model, QWidget *parent)
// Setup default axis // Setup default axis
setYAxis(0, YAxis::Type::Magnitude, false, false, YAxis::getDefaultLimitMin(YAxis::Type::Magnitude), YAxis::getDefaultLimitMax(YAxis::Type::Magnitude), 14, true); setYAxis(0, YAxis::Type::Magnitude, false, false, YAxis::getDefaultLimitMin(YAxis::Type::Magnitude), YAxis::getDefaultLimitMax(YAxis::Type::Magnitude), 14, true);
setYAxis(1, YAxis::Type::Phase, false, false, YAxis::getDefaultLimitMin(YAxis::Type::Phase), YAxis::getDefaultLimitMax(YAxis::Type::Phase), 12, true); setYAxis(1, YAxis::Type::Phase, false, false, YAxis::getDefaultLimitMin(YAxis::Type::Phase), YAxis::getDefaultLimitMax(YAxis::Type::Phase), 12, true);
// enable autoscaling and set for full span (no information about actual span available yet)
updateSpan(0, 6000000000);
setXAxis(XAxis::Type::Frequency, XAxisMode::UseSpan, false, 0, 6000000000, 10, true); setXAxis(XAxis::Type::Frequency, XAxisMode::UseSpan, false, 0, 6000000000, 10, true);
initializeTraceInfo(); initializeTraceInfo();
} }

View file

@ -116,7 +116,7 @@ XYplotAxisDialog::XYplotAxisDialog(TraceXYPlot *plot) :
setupYAxisConnetions(ui->Y1type, ui->Y1linear, ui->Y1log, ui->Y1auto, ui->Y1min, ui->Y1max, ui->Y1Divs, ui->Y1autoDivs); setupYAxisConnetions(ui->Y1type, ui->Y1linear, ui->Y1log, ui->Y1auto, ui->Y1min, ui->Y1max, ui->Y1Divs, ui->Y1autoDivs);
setupYAxisConnetions(ui->Y2type, ui->Y2linear, ui->Y2log, ui->Y2auto, ui->Y2min, ui->Y2max, ui->Y2Divs, ui->Y2autoDivs); setupYAxisConnetions(ui->Y2type, ui->Y2linear, ui->Y2log, ui->Y2auto, ui->Y2min, ui->Y2max, ui->Y2Divs, ui->Y2autoDivs);
auto updateXenableState = [](QRadioButton *linear, QRadioButton *log, QCheckBox *CBauto, SIUnitEdit *min, SIUnitEdit *max, QSpinBox *divs, QCheckBox *autoDivs) { auto updateXenableState = [](QRadioButton *linear, QRadioButton *log, QCheckBox *CBauto, SIUnitEdit *min, SIUnitEdit *max, QSpinBox *divs, QCheckBox *autoDivs, QComboBox *autoMode) {
log->setEnabled(true); log->setEnabled(true);
linear->setEnabled(true); linear->setEnabled(true);
CBauto->setEnabled(true); CBauto->setEnabled(true);
@ -126,6 +126,7 @@ XYplotAxisDialog::XYplotAxisDialog(TraceXYPlot *plot) :
max->setEnabled(false); max->setEnabled(false);
divs->setEnabled(false); divs->setEnabled(false);
autoDivs->setEnabled(false); autoDivs->setEnabled(false);
autoMode->setEnabled(true);
} else { } else {
min->setEnabled(true); min->setEnabled(true);
max->setEnabled(true); max->setEnabled(true);
@ -136,14 +137,15 @@ XYplotAxisDialog::XYplotAxisDialog(TraceXYPlot *plot) :
autoDivs->setEnabled(true); autoDivs->setEnabled(true);
divs->setEnabled(!autoDivs->isChecked()); divs->setEnabled(!autoDivs->isChecked());
} }
autoMode->setEnabled(false);
} }
}; };
connect(ui->Xauto, &QCheckBox::toggled, [this, updateXenableState](bool) { connect(ui->Xauto, &QCheckBox::toggled, [this, updateXenableState](bool) {
updateXenableState(ui->Xlinear, ui->Xlog, ui->Xauto, ui->Xmin, ui->Xmax, ui->XDivs, ui->XautoDivs); updateXenableState(ui->Xlinear, ui->Xlog, ui->Xauto, ui->Xmin, ui->Xmax, ui->XDivs, ui->XautoDivs, ui->Xautomode);
}); });
connect(ui->XautoDivs, &QCheckBox::toggled, [this, updateXenableState](bool) { connect(ui->XautoDivs, &QCheckBox::toggled, [this, updateXenableState](bool) {
updateXenableState(ui->Xlinear, ui->Xlog, ui->Xauto, ui->Xmin, ui->Xmax, ui->XDivs, ui->XautoDivs); updateXenableState(ui->Xlinear, ui->Xlog, ui->Xauto, ui->Xmin, ui->Xmax, ui->XDivs, ui->XautoDivs, ui->Xautomode);
}); });
ui->XType->setCurrentIndex((int) plot->xAxis.getType()); ui->XType->setCurrentIndex((int) plot->xAxis.getType());
@ -159,7 +161,7 @@ XYplotAxisDialog::XYplotAxisDialog(TraceXYPlot *plot) :
XAxisTypeChanged((int) plot->xAxis.getType()); XAxisTypeChanged((int) plot->xAxis.getType());
connect(ui->XType, qOverload<int>(&QComboBox::currentIndexChanged), this, &XYplotAxisDialog::XAxisTypeChanged); connect(ui->XType, qOverload<int>(&QComboBox::currentIndexChanged), this, &XYplotAxisDialog::XAxisTypeChanged);
connect(ui->Xlog, &QCheckBox::toggled, [=](bool){ connect(ui->Xlog, &QCheckBox::toggled, [=](bool){
updateXenableState(ui->Xlinear, ui->Xlog, ui->Xauto, ui->Xmin, ui->Xmax, ui->XDivs, ui->XautoDivs); updateXenableState(ui->Xlinear, ui->Xlog, ui->Xauto, ui->Xmin, ui->Xmax, ui->XDivs, ui->XautoDivs, ui->Xautomode);
}); });
// Fill initial values // Fill initial values

View file

@ -1961,7 +1961,7 @@ void VNA::ConfigureDevice(bool resetTraces, std::function<void(bool)> cb)
double start = settings.sweepType == SweepType::Frequency ? settings.Freq.start : settings.Power.start; double start = settings.sweepType == SweepType::Frequency ? settings.Freq.start : settings.Power.start;
double stop = settings.sweepType == SweepType::Frequency ? settings.Freq.stop : settings.Power.stop; double stop = settings.sweepType == SweepType::Frequency ? settings.Freq.stop : settings.Power.stop;
int npoints = settings.npoints; int npoints = settings.npoints;
emit traceModel.SpanChanged(start, stop); traceModel.setSpan(start, stop);
if (settings.segments > 1) { if (settings.segments > 1) {
// more than one segment, adjust start/stop // more than one segment, adjust start/stop
npoints = ceil((double) settings.npoints / settings.segments); npoints = ceil((double) settings.npoints / settings.segments);