LibreVNA/Software/PC_Application/LibreVNA-GUI/Calibration/LibreCAL/librecaldialog.h

61 lines
1.4 KiB
C
Raw Normal View History

2022-10-01 17:10:44 +02:00
#ifndef LIBRECALDIALOG_H
#define LIBRECALDIALOG_H
#include "Calibration/calibration.h"
#include "caldevice.h"
#include "Device/devicedriver.h"
2022-10-01 17:10:44 +02:00
#include <QDialog>
#include <QTimer>
#include <QComboBox>
namespace Ui {
class LibreCALDialog;
}
class LibreCALDialog : public QDialog
{
Q_OBJECT
public:
explicit LibreCALDialog(Calibration *cal);
~LibreCALDialog();
private:
signals:
void portAssignmentChanged();
void autoPortComplete();
2022-10-01 17:10:44 +02:00
private slots:
bool validatePortSelection(bool autoAllowed);
bool validateCoefficients();
2022-10-01 17:10:44 +02:00
void updateCalibrationStartStatus();
void updateDeviceStatus();
void determineAutoPorts();
void loadCoefficients();
2022-10-01 17:10:44 +02:00
void startCalibration();
// auto port slots
void handleIncomingMeasurement(DeviceDriver::VNAMeasurement m);
void startSweep();
void stopSweep();
2022-10-01 17:10:44 +02:00
private:
void disableUI();
void enableUI();
void createPortAssignmentUI();
Ui::LibreCALDialog *ui;
Calibration *cal;
CalDevice *device;
CalDevice::CoefficientSet coeffSet;
QTimer updateTimer;
bool busy;
// 0 for unused port, -1 for auto port, otherwise the port number
2022-10-01 17:10:44 +02:00
std::vector<int> portAssignment;
std::vector<QComboBox*> portAssignmentComboBoxes;
std::vector<DeviceDriver::VNAMeasurement> autoPortMeasurements;
DeviceDriver *driver;
2022-10-01 17:10:44 +02:00
int measurementsTaken;
};
#endif // LIBRECALDIALOG_H