94 lines
2.4 KiB
C++
94 lines
2.4 KiB
C++
#ifndef VNA_H
|
|
#define VNA_H
|
|
|
|
#include <QObject>
|
|
#include <QWidget>
|
|
#include "appwindow.h"
|
|
#include "mode.h"
|
|
#include "CustomWidgets/tilewidget.h"
|
|
|
|
class VNA : public Mode
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
VNA(AppWindow *window);
|
|
|
|
void deactivate() override;
|
|
void initializeDevice() override;
|
|
void deviceDisconnected() override;
|
|
private slots:
|
|
void NewDatapoint(Protocol::Datapoint d);
|
|
void StartImpedanceMatching();
|
|
// Sweep control
|
|
void SetStartFreq(double freq);
|
|
void SetStopFreq(double freq);
|
|
void SetCenterFreq(double freq);
|
|
void SetSpan(double span);
|
|
void SetFullSpan();
|
|
void SpanZoomIn();
|
|
void SpanZoomOut();
|
|
// Acquisition control
|
|
void SetSourceLevel(double level);
|
|
void SetPoints(unsigned int points);
|
|
void SetIFBandwidth(double bandwidth);
|
|
void SetAveraging(unsigned int averages);
|
|
void ExcitationRequired(bool port1, bool port2);
|
|
// Calibration
|
|
void DisableCalibration(bool force = false);
|
|
void ApplyCalibration(Calibration::Type type);
|
|
void StartCalibrationMeasurement(Calibration::Measurement m);
|
|
|
|
signals:
|
|
void CalibrationMeasurementComplete(Calibration::Measurement m);
|
|
|
|
private:
|
|
void UpdateStatusPanel();
|
|
void SettingsChanged();
|
|
void ConstrainAndUpdateFrequencies();
|
|
void LoadSweepSettings();
|
|
void StoreSweepSettings();
|
|
|
|
Preferences &pref;
|
|
|
|
Protocol::SweepSettings settings;
|
|
unsigned int averages;
|
|
TraceModel traceModel;
|
|
TraceMarkerModel *markerModel;
|
|
Averaging average;
|
|
|
|
// Calibration
|
|
Calibration cal;
|
|
bool calValid;
|
|
Calibration::Measurement calMeasurement;
|
|
bool calMeasuring;
|
|
bool calWaitFirst;
|
|
QProgressDialog calDialog;
|
|
|
|
QMenu *defaultCalMenu;
|
|
QAction *assignDefaultCal, *removeDefaultCal;
|
|
|
|
// Status Labels
|
|
QLabel *lStart, *lCenter, *lStop, *lSpan, *lPoints, *lBandwidth;
|
|
QLabel *lCalibration;
|
|
QLabel *lAverages;
|
|
|
|
TileWidget *central;
|
|
|
|
signals:
|
|
void dataChanged();
|
|
void startFreqChanged(double freq);
|
|
void stopFreqChanged(double freq);
|
|
void centerFreqChanged(double freq);
|
|
void spanChanged(double span);
|
|
|
|
void sourceLevelChanged(double level);
|
|
void pointsChanged(unsigned int points);
|
|
void IFBandwidthChanged(double bandwidth);
|
|
void averagingChanged(unsigned int averages);
|
|
|
|
void CalibrationDisabled();
|
|
void CalibrationApplied(Calibration::Type type);
|
|
};
|
|
|
|
#endif // VNA_H
|