mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-04 22:17:31 +00:00
Renaming packet types, implementing different packet contents per hardware version
This commit is contained in:
parent
83dbfadf20
commit
9b4865dceb
34 changed files with 2184 additions and 500 deletions
|
|
@ -160,16 +160,16 @@ QString CompoundDriver::getSerial()
|
|||
std::set<DeviceDriver::Flag> CompoundDriver::getFlags()
|
||||
{
|
||||
std::set<DeviceDriver::Flag> ret;
|
||||
if(lastStatus.extRefInUse) {
|
||||
if(lastStatus.V1.extRefInUse) {
|
||||
ret.insert(Flag::ExtRef);
|
||||
}
|
||||
if(!lastStatus.source_locked || !lastStatus.LO1_locked) {
|
||||
if(!lastStatus.V1.source_locked || !lastStatus.V1.LO1_locked) {
|
||||
ret.insert(Flag::Unlocked);
|
||||
}
|
||||
if(lastStatus.unlevel) {
|
||||
if(lastStatus.V1.unlevel) {
|
||||
ret.insert(Flag::Unlevel);
|
||||
}
|
||||
if(lastStatus.ADC_overload) {
|
||||
if(lastStatus.V1.ADC_overload) {
|
||||
ret.insert(Flag::Overload);
|
||||
}
|
||||
return ret;
|
||||
|
|
@ -181,13 +181,13 @@ QString CompoundDriver::getStatus()
|
|||
ret.append("HW Rev.");
|
||||
ret.append(info.hardware_version);
|
||||
ret.append(" FW "+info.firmware_version);
|
||||
ret.append(" Temps: "+QString::number(lastStatus.temp_source)+"°C/"+QString::number(lastStatus.temp_LO1)+"°C/"+QString::number(lastStatus.temp_MCU)+"°C");
|
||||
ret.append(" Temps: "+QString::number(lastStatus.V1.temp_source)+"°C/"+QString::number(lastStatus.V1.temp_LO1)+"°C/"+QString::number(lastStatus.V1.temp_MCU)+"°C");
|
||||
ret.append(" Reference:");
|
||||
if(lastStatus.extRefInUse) {
|
||||
if(lastStatus.V1.extRefInUse) {
|
||||
ret.append("External");
|
||||
} else {
|
||||
ret.append("Internal");
|
||||
if(lastStatus.extRefAvailable) {
|
||||
if(lastStatus.V1.extRefAvailable) {
|
||||
ret.append(" (External available)");
|
||||
}
|
||||
}
|
||||
|
|
@ -495,8 +495,8 @@ void CompoundDriver::createCompoundJSON()
|
|||
void CompoundDriver::incomingPacket(LibreVNADriver *device, const Protocol::PacketInfo &p)
|
||||
{
|
||||
switch(p.type) {
|
||||
case Protocol::PacketType::DeviceStatusV1:
|
||||
updatedStatus(device, p.statusV1);
|
||||
case Protocol::PacketType::DeviceStatus:
|
||||
updatedStatus(device, p.status);
|
||||
break;
|
||||
case Protocol::PacketType::VNADatapoint:
|
||||
datapointReceivecd(device, p.VNAdatapoint);
|
||||
|
|
@ -557,7 +557,7 @@ void CompoundDriver::updatedInfo(LibreVNADriver *device)
|
|||
}
|
||||
}
|
||||
|
||||
void CompoundDriver::updatedStatus(LibreVNADriver *device, const Protocol::DeviceStatusV1 &status)
|
||||
void CompoundDriver::updatedStatus(LibreVNADriver *device, const Protocol::DeviceStatus &status)
|
||||
{
|
||||
deviceStatus[device] = status;
|
||||
if(deviceStatus.size() == devices.size()) {
|
||||
|
|
@ -567,16 +567,16 @@ void CompoundDriver::updatedStatus(LibreVNADriver *device, const Protocol::Devic
|
|||
if(i==0) {
|
||||
lastStatus = devStat;
|
||||
} else {
|
||||
lastStatus.extRefAvailable &= devStat.extRefAvailable;
|
||||
lastStatus.extRefInUse |= devStat.extRefInUse;
|
||||
lastStatus.FPGA_configured &= devStat.FPGA_configured;
|
||||
lastStatus.source_locked &= devStat.source_locked;
|
||||
lastStatus.LO1_locked &= devStat.LO1_locked;
|
||||
lastStatus.ADC_overload |= devStat.ADC_overload;
|
||||
lastStatus.unlevel |= devStat.unlevel;
|
||||
lastStatus.temp_source = std::max(lastStatus.temp_source, devStat.temp_source);
|
||||
lastStatus.temp_LO1 = std::max(lastStatus.temp_LO1, devStat.temp_LO1);
|
||||
lastStatus.temp_MCU = std::max(lastStatus.temp_MCU, devStat.temp_MCU);
|
||||
lastStatus.V1.extRefAvailable &= devStat.V1.extRefAvailable;
|
||||
lastStatus.V1.extRefInUse |= devStat.V1.extRefInUse;
|
||||
lastStatus.V1.FPGA_configured &= devStat.V1.FPGA_configured;
|
||||
lastStatus.V1.source_locked &= devStat.V1.source_locked;
|
||||
lastStatus.V1.LO1_locked &= devStat.V1.LO1_locked;
|
||||
lastStatus.V1.ADC_overload |= devStat.V1.ADC_overload;
|
||||
lastStatus.V1.unlevel |= devStat.V1.unlevel;
|
||||
lastStatus.V1.temp_source = std::max(lastStatus.V1.temp_source, devStat.V1.temp_source);
|
||||
lastStatus.V1.temp_LO1 = std::max(lastStatus.V1.temp_LO1, devStat.V1.temp_LO1);
|
||||
lastStatus.V1.temp_MCU = std::max(lastStatus.V1.temp_MCU, devStat.V1.temp_MCU);
|
||||
}
|
||||
}
|
||||
emit StatusUpdated();
|
||||
|
|
|
|||
|
|
@ -174,16 +174,16 @@ private:
|
|||
void createCompoundJSON();
|
||||
void incomingPacket(LibreVNADriver *device, const Protocol::PacketInfo &p);
|
||||
void updatedInfo(LibreVNADriver *device);
|
||||
void updatedStatus(LibreVNADriver *device, const Protocol::DeviceStatusV1 &status);
|
||||
void updatedStatus(LibreVNADriver *device, const Protocol::DeviceStatus &status);
|
||||
void datapointReceivecd(LibreVNADriver *dev, Protocol::VNADatapoint<32> *data);
|
||||
void spectrumResultReceived(LibreVNADriver *dev, Protocol::SpectrumAnalyzerResult res);
|
||||
|
||||
Info info;
|
||||
std::map<LibreVNADriver*, Info> deviceInfos;
|
||||
std::map<LibreVNADriver*, Protocol::DeviceStatusV1> deviceStatus;
|
||||
std::map<LibreVNADriver*, Protocol::DeviceStatus> deviceStatus;
|
||||
std::map<int, std::map<LibreVNADriver*, Protocol::VNADatapoint<32>*>> compoundVNABuffer;
|
||||
std::map<int, std::map<LibreVNADriver*, Protocol::SpectrumAnalyzerResult>> compoundSABuffer;
|
||||
Protocol::DeviceStatusV1 lastStatus;
|
||||
Protocol::DeviceStatus lastStatus;
|
||||
|
||||
// Parsed configuration of compound devices (as extracted from compoundJSONString
|
||||
std::vector<CompoundDevice*> configuredDevices;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
#include "deviceconfigurationdialogv1.h"
|
||||
#include "ui_deviceconfigurationdialogv1.h"
|
||||
|
||||
DeviceConfigurationDialogV1::DeviceConfigurationDialogV1(LibreVNADriver &dev, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DeviceConfigurationDialogV1),
|
||||
dev(dev)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
emit dev.acquireControl();
|
||||
|
||||
|
||||
auto updateADCRate = [=]() {
|
||||
// update ADC rate, see FPGA protocol for calculation
|
||||
ui->ADCRate->setValue(102400000.0 / ui->ADCpresc->value());
|
||||
};
|
||||
auto updateIF2 = [=]() {
|
||||
auto ADCrate = ui->ADCRate->value();
|
||||
ui->IF2->setValue(ADCrate * ui->ADCphaseInc->value() / 4096);
|
||||
};
|
||||
|
||||
connect(ui->ADCpresc, qOverload<int>(&QSpinBox::valueChanged), updateADCRate);
|
||||
connect(ui->ADCpresc, qOverload<int>(&QSpinBox::valueChanged), updateIF2);
|
||||
connect(ui->ADCphaseInc, qOverload<int>(&QSpinBox::valueChanged), updateIF2);
|
||||
|
||||
ui->IF1->setUnit("Hz");
|
||||
ui->IF1->setPrefixes(" kM");
|
||||
ui->IF1->setPrecision(5);
|
||||
ui->ADCRate->setUnit("Hz");
|
||||
ui->ADCRate->setPrefixes(" kM");
|
||||
ui->ADCRate->setPrecision(5);
|
||||
ui->IF2->setUnit("Hz");
|
||||
ui->IF2->setPrefixes(" kM");
|
||||
ui->IF2->setPrecision(5);
|
||||
ui->IF1->setValue(62000000);
|
||||
ui->ADCpresc->setValue(128);
|
||||
ui->ADCphaseInc->setValue(1280);
|
||||
|
||||
updateADCRate();
|
||||
updateIF2();
|
||||
|
||||
connect(&dev, &LibreVNADriver::receivedPacket, this, [=](const Protocol::PacketInfo &p) {
|
||||
if(p.type == Protocol::PacketType::DeviceConfiguration) {
|
||||
updateGUI(p.deviceConfig);
|
||||
}
|
||||
});
|
||||
|
||||
dev.sendWithoutPayload(Protocol::PacketType::RequestDeviceConfiguration);
|
||||
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, [=](){
|
||||
updateDevice();
|
||||
accept();
|
||||
});
|
||||
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, [=](){
|
||||
reject();
|
||||
});
|
||||
}
|
||||
|
||||
DeviceConfigurationDialogV1::~DeviceConfigurationDialogV1()
|
||||
{
|
||||
dev.releaseControl();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DeviceConfigurationDialogV1::updateGUI(const Protocol::DeviceConfig &c)
|
||||
{
|
||||
ui->IF1->setEnabled(false);
|
||||
ui->IF1->setValue(c.V1.IF1);
|
||||
ui->IF1->setEnabled(true);
|
||||
ui->ADCpresc->setValue(c.V1.ADCprescaler);
|
||||
ui->ADCphaseInc->setValue(c.V1.DFTphaseInc);
|
||||
}
|
||||
|
||||
void DeviceConfigurationDialogV1::updateDevice()
|
||||
{
|
||||
Protocol::PacketInfo p;
|
||||
p.type = Protocol::PacketType::DeviceConfiguration;
|
||||
p.deviceConfig.V1.IF1 = ui->IF1->value();
|
||||
p.deviceConfig.V1.ADCprescaler = ui->ADCpresc->value();
|
||||
p.deviceConfig.V1.DFTphaseInc = ui->ADCphaseInc->value();
|
||||
dev.SendPacket(p);
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
#ifndef DEVICECONFIGURATIONDIALOGV1_H
|
||||
#define DEVICECONFIGURATIONDIALOGV1_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include "librevnadriver.h"
|
||||
|
||||
namespace Ui {
|
||||
class DeviceConfigurationDialogV1;
|
||||
}
|
||||
|
||||
class DeviceConfigurationDialogV1 : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DeviceConfigurationDialogV1(LibreVNADriver &dev, QWidget *parent = nullptr);
|
||||
~DeviceConfigurationDialogV1();
|
||||
|
||||
private:
|
||||
void updateGUI(const Protocol::DeviceConfig &c);
|
||||
void updateDevice();
|
||||
|
||||
Ui::DeviceConfigurationDialogV1 *ui;
|
||||
LibreVNADriver &dev;
|
||||
};
|
||||
|
||||
#endif // DEVICECONFIGURATIONDIALOGV1_H
|
||||
|
|
@ -0,0 +1,159 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DeviceConfigurationDialogV1</class>
|
||||
<widget class="QDialog" name="DeviceConfigurationDialogV1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>497</width>
|
||||
<height>297</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Device Configuration</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_15">
|
||||
<property name="title">
|
||||
<string>IF frequencies</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_34">
|
||||
<property name="text">
|
||||
<string>This section contains advanced system settings. It is recommended to leave them at default values unless you know what you are doing. Slight changes of the IF frequencies can be used to shift possible spikes to less problematic frequencies. Large changes of these frequencies may severely impact device performance.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_29">
|
||||
<property name="text">
|
||||
<string>IF 1:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="SIUnitEdit" name="IF1">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Frequency of the first IF</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_30">
|
||||
<property name="text">
|
||||
<string>ADC prescaler:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="ADCpresc">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>ADC prescaler in FPGA. The ADC sample rate is determined by 102.4MHz/prescaler</p></body></html></string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>112</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>128</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_31">
|
||||
<property name="text">
|
||||
<string>ADC sample rate:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="SIUnitEdit" name="ADCRate">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_32">
|
||||
<property name="text">
|
||||
<string>Phase increment:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="ADCphaseInc">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Phase increment per ADC sample. Together with the ADC sample rate this determines the frequency of the second IF</p></body></html></string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>4095</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1280</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_33">
|
||||
<property name="text">
|
||||
<string>IF 2:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="SIUnitEdit" name="IF2">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>SIUnitEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>CustomWidgets/siunitedit.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
#include "deviceconfigurationdialogvff.h"
|
||||
#include "ui_deviceconfigurationdialogvff.h"
|
||||
|
||||
#include <QtEndian>
|
||||
|
||||
DeviceConfigurationDialogVFF::DeviceConfigurationDialogVFF(LibreVNADriver &dev, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DeviceConfigurationDialogVFF),
|
||||
dev(dev)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
emit dev.acquireControl();
|
||||
|
||||
auto updateAddress = [](QLineEdit* line, QHostAddress &address) {
|
||||
auto newAddress = QHostAddress(line->text());
|
||||
if(newAddress.isNull()) {
|
||||
// address is invalid, set edit to old address
|
||||
line->setText(address.toString());
|
||||
} else {
|
||||
// input is valid, store new address
|
||||
address = newAddress;
|
||||
}
|
||||
};
|
||||
|
||||
connect(ui->ip, &QLineEdit::editingFinished, this, [=](){
|
||||
updateAddress(ui->ip, ip);
|
||||
});
|
||||
connect(ui->mask, &QLineEdit::editingFinished, this, [=](){
|
||||
updateAddress(ui->mask, mask);
|
||||
});
|
||||
connect(ui->gateway, &QLineEdit::editingFinished, this, [=](){
|
||||
updateAddress(ui->gateway, gateway);
|
||||
});
|
||||
|
||||
connect(&dev, &LibreVNADriver::receivedPacket, this, [=](const Protocol::PacketInfo &p) {
|
||||
if(p.type == Protocol::PacketType::DeviceConfiguration) {
|
||||
updateGUI(p.deviceConfig);
|
||||
}
|
||||
});
|
||||
|
||||
dev.sendWithoutPayload(Protocol::PacketType::RequestDeviceConfiguration);
|
||||
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, [=](){
|
||||
updateDevice();
|
||||
accept();
|
||||
});
|
||||
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, [=](){
|
||||
reject();
|
||||
});
|
||||
}
|
||||
|
||||
DeviceConfigurationDialogVFF::~DeviceConfigurationDialogVFF()
|
||||
{
|
||||
dev.releaseControl();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DeviceConfigurationDialogVFF::updateGUI(const Protocol::DeviceConfig &c)
|
||||
{
|
||||
ui->dhcp->setChecked(c.VFF.dhcp);
|
||||
ip = QHostAddress(qFromBigEndian(c.VFF.ip));
|
||||
ui->ip->setText(ip.toString());
|
||||
mask = QHostAddress(qFromBigEndian(c.VFF.mask));
|
||||
ui->mask->setText(mask.toString());
|
||||
gateway = QHostAddress(qFromBigEndian(c.VFF.gw));
|
||||
ui->gateway->setText(gateway.toString());
|
||||
}
|
||||
|
||||
void DeviceConfigurationDialogVFF::updateDevice()
|
||||
{
|
||||
Protocol::PacketInfo p;
|
||||
p.type = Protocol::PacketType::DeviceConfiguration;
|
||||
p.deviceConfig.VFF.dhcp = ui->dhcp->isChecked() ? 1 : 0;
|
||||
p.deviceConfig.VFF.ip = qToBigEndian(ip.toIPv4Address());
|
||||
p.deviceConfig.VFF.mask = qToBigEndian(mask.toIPv4Address());
|
||||
p.deviceConfig.VFF.gw = qToBigEndian(gateway.toIPv4Address());
|
||||
dev.SendPacket(p);
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
#ifndef DEVICECONFIGURATIONDIALOGVFF_H
|
||||
#define DEVICECONFIGURATIONDIALOGVFF_H
|
||||
|
||||
#include "librevnadriver.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QHostAddress>
|
||||
|
||||
namespace Ui {
|
||||
class DeviceConfigurationDialogVFF;
|
||||
}
|
||||
|
||||
class DeviceConfigurationDialogVFF : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DeviceConfigurationDialogVFF(LibreVNADriver &dev, QWidget *parent = nullptr);
|
||||
~DeviceConfigurationDialogVFF();
|
||||
|
||||
private:
|
||||
void updateGUI(const Protocol::DeviceConfig &c);
|
||||
void updateDevice();
|
||||
|
||||
Ui::DeviceConfigurationDialogVFF *ui;
|
||||
LibreVNADriver &dev;
|
||||
|
||||
QHostAddress ip, mask, gateway;
|
||||
};
|
||||
|
||||
#endif // DEVICECONFIGURATIONDIALOGVFF_H
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DeviceConfigurationDialogVFF</class>
|
||||
<widget class="QDialog" name="DeviceConfigurationDialogVFF">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>389</width>
|
||||
<height>224</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Device Configuration</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Address configuration</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="dhcp">
|
||||
<property name="text">
|
||||
<string>DHCP</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Static/DHCP fallback</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>IP:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="ip"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Mask:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="mask"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Gateway:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="gateway"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -10,6 +10,8 @@
|
|||
#include <QPushButton>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QHostAddress>
|
||||
#include <QtEndian>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
@ -105,11 +107,11 @@ void DevicePacketLogView::addEntry(const DevicePacketLog::LogEntry &e)
|
|||
if(e.type == DevicePacketLog::LogEntry::Type::Packet) {
|
||||
item->setData(2, Qt::DisplayRole, "Packet");
|
||||
|
||||
static const QStringList packetNames = {"None", "Datapoint", "SweepSettings", "ManualStatusV1", "ManualControlV1", "DeviceInfo", "FirmwarePacket", "Ack",
|
||||
static const QStringList packetNames = {"None", "Datapoint", "SweepSettings", "ManualStatus", "ManualControl", "DeviceInfo", "FirmwarePacket", "Ack",
|
||||
"ClearFlash", "PerformFirmwareUpdate", "Nack", "Reference", "Generator", "SpectrumAnalyzerSettings",
|
||||
"SpectrumAnalyzerResult", "RequestDeviceInfo", "RequestSourceCal", "RequestReceiverCal", "SourceCalPoint",
|
||||
"ReceiverCalPoint", "SetIdle", "RequestFrequencyCorrection", "FrequencyCorrection", "RequestAcquisitionFrequencySettings",
|
||||
"AcquisitionFrequencySettings", "DeviceStatusV1", "RequestDeviceStatus", "VNADatapoint", "SetTrigger", "ClearTrigger"};
|
||||
"ReceiverCalPoint", "SetIdle", "RequestFrequencyCorrection", "FrequencyCorrection", "RequestDeviceConfiguration",
|
||||
"DeviceConfiguration", "DeviceStatus", "RequestDeviceStatus", "VNADatapoint", "SetTrigger", "ClearTrigger"};
|
||||
|
||||
item->setData(3, Qt::DisplayRole, "Type "+QString::number((int)e.p->type)+"("+packetNames[(int)e.p->type]+")");
|
||||
auto addDouble = [=](QTreeWidgetItem *parent, QString name, double value, QString unit = "", int precision = 8) {
|
||||
|
|
@ -177,18 +179,31 @@ void DevicePacketLogView::addEntry(const DevicePacketLog::LogEntry &e)
|
|||
addInteger(item, "Active port", s.activePort);
|
||||
}
|
||||
break;
|
||||
case Protocol::PacketType::DeviceStatusV1: {
|
||||
Protocol::DeviceStatusV1 s = e.p->statusV1;
|
||||
addBool(item, "External reference available", s.extRefAvailable);
|
||||
addBool(item, "External reference in use", s.extRefInUse);
|
||||
addBool(item, "FPGA configured", s.FPGA_configured);
|
||||
addBool(item, "Source locked", s.source_locked);
|
||||
addBool(item, "1.LO locked", s.LO1_locked);
|
||||
addBool(item, "ADC overload", s.ADC_overload);
|
||||
addBool(item, "Unlevel", s.unlevel);
|
||||
addInteger(item, "Source temperature", s.temp_source);
|
||||
addInteger(item, "1.LO temperature", s.temp_LO1);
|
||||
addInteger(item, "MCU temperature", s.temp_MCU);
|
||||
case Protocol::PacketType::DeviceStatus: {
|
||||
auto s = e.p->status.V1;
|
||||
auto V1 = new QTreeWidgetItem();
|
||||
V1->setData(2, Qt::DisplayRole, "V1");
|
||||
item->addChild(V1);
|
||||
addBool(V1, "External reference available", s.extRefAvailable);
|
||||
addBool(V1, "External reference in use", s.extRefInUse);
|
||||
addBool(V1, "FPGA configured", s.FPGA_configured);
|
||||
addBool(V1, "Source locked", s.source_locked);
|
||||
addBool(V1, "1.LO locked", s.LO1_locked);
|
||||
addBool(V1, "ADC overload", s.ADC_overload);
|
||||
addBool(V1, "Unlevel", s.unlevel);
|
||||
addInteger(V1, "Source temperature", s.temp_source);
|
||||
addInteger(V1, "1.LO temperature", s.temp_LO1);
|
||||
addInteger(V1, "MCU temperature", s.temp_MCU);
|
||||
|
||||
auto sFF = e.p->status.VFF;
|
||||
auto VFF = new QTreeWidgetItem();
|
||||
VFF->setData(2, Qt::DisplayRole, "VFF");
|
||||
item->addChild(VFF);
|
||||
addBool(VFF, "Source locked", sFF.source_locked);
|
||||
addBool(VFF, "LO locked", sFF.LO_locked);
|
||||
addBool(VFF, "ADC overload", sFF.ADC_overload);
|
||||
addBool(VFF, "Unlevel", sFF.unlevel);
|
||||
addInteger(VFF, "MCU temperature", s.temp_MCU);
|
||||
}
|
||||
break;
|
||||
case Protocol::PacketType::DeviceInfo: {
|
||||
|
|
@ -212,8 +227,8 @@ void DevicePacketLogView::addEntry(const DevicePacketLog::LogEntry &e)
|
|||
addDouble(item, "Maximum harmonic frequency", s.limits_maxFreqHarmonic, "Hz");
|
||||
}
|
||||
break;
|
||||
case Protocol::PacketType::ManualControlV1:
|
||||
case Protocol::PacketType::ManualStatusV1:
|
||||
case Protocol::PacketType::ManualControl:
|
||||
case Protocol::PacketType::ManualStatus:
|
||||
// TODO
|
||||
break;
|
||||
case Protocol::PacketType::SpectrumAnalyzerSettings: {
|
||||
|
|
@ -295,11 +310,23 @@ void DevicePacketLogView::addEntry(const DevicePacketLog::LogEntry &e)
|
|||
addDouble(item, "ppm", s.ppm, "");
|
||||
}
|
||||
break;
|
||||
case Protocol::PacketType::AcquisitionFrequencySettings: {
|
||||
Protocol::AcquisitionFrequencySettings s = e.p->acquisitionFrequencySettings;
|
||||
addDouble(item, "1.IF", s.IF1, "Hz");
|
||||
addInteger(item, "ADC prescaler", s.ADCprescaler);
|
||||
addInteger(item, "DFT phase increment", s.DFTphaseInc);
|
||||
case Protocol::PacketType::DeviceConfiguration: {
|
||||
auto s1 = e.p->deviceConfig.V1;
|
||||
auto V1 = new QTreeWidgetItem();
|
||||
V1->setData(2, Qt::DisplayRole, "V1");
|
||||
item->addChild(V1);
|
||||
addDouble(V1, "1.IF", s1.IF1, "Hz");
|
||||
addInteger(V1, "ADC prescaler", s1.ADCprescaler);
|
||||
addInteger(V1, "DFT phase increment", s1.DFTphaseInc);
|
||||
|
||||
auto sFF = e.p->deviceConfig.VFF;
|
||||
auto VFF = new QTreeWidgetItem();
|
||||
VFF->setData(2, Qt::DisplayRole, "VFF");
|
||||
item->addChild(VFF);
|
||||
addBool(VFF, "DHCP enabled", sFF.dhcp);
|
||||
addString(VFF, "IP", QHostAddress(qFromBigEndian(sFF.ip)).toString());
|
||||
addString(VFF, "Mask", QHostAddress(qFromBigEndian(sFF.mask)).toString());
|
||||
addString(VFF, "Gateway", QHostAddress(qFromBigEndian(sFF.gw)).toString());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
#include "librevnadriver.h"
|
||||
|
||||
#include "manualcontroldialog.h"
|
||||
#include "manualcontroldialogV1.h"
|
||||
#include "manualcontroldialogvff.h"
|
||||
#include "deviceconfigurationdialogv1.h"
|
||||
#include "deviceconfigurationdialogvff.h"
|
||||
#include "firmwareupdatedialog.h"
|
||||
#include "frequencycaldialog.h"
|
||||
#include "sourcecaldialog.h"
|
||||
|
|
@ -113,11 +116,38 @@ LibreVNADriver::LibreVNADriver()
|
|||
|
||||
auto manual = new QAction("Manual Control");
|
||||
connect(manual, &QAction::triggered, this, [=](){
|
||||
auto d = new ManualControlDialog(*this);
|
||||
d->show();
|
||||
QDialog *d = nullptr;
|
||||
switch(hardwareVersion) {
|
||||
case 1:
|
||||
d = new ManualControlDialogV1(*this);
|
||||
break;
|
||||
case 0xFF:
|
||||
d = new ManualControlDialogVFF(*this);
|
||||
break;
|
||||
}
|
||||
if(d) {
|
||||
d->show();
|
||||
}
|
||||
});
|
||||
specificActions.push_back(manual);
|
||||
|
||||
auto config = new QAction("Configuration");
|
||||
connect(config, &QAction::triggered, this, [=](){
|
||||
QDialog *d = nullptr;
|
||||
switch(hardwareVersion) {
|
||||
case 1:
|
||||
d = new DeviceConfigurationDialogV1(*this);
|
||||
break;
|
||||
case 0xFF:
|
||||
d = new DeviceConfigurationDialogVFF(*this);
|
||||
break;
|
||||
}
|
||||
if(d) {
|
||||
d->show();
|
||||
}
|
||||
});
|
||||
specificActions.push_back(config);
|
||||
|
||||
auto update = new QAction("Firmware Update");
|
||||
connect(update, &QAction::triggered, this, [=](){
|
||||
auto d = new FirmwareUpdateDialog(this);
|
||||
|
|
@ -165,17 +195,32 @@ LibreVNADriver::LibreVNADriver()
|
|||
std::set<DeviceDriver::Flag> LibreVNADriver::getFlags()
|
||||
{
|
||||
std::set<DeviceDriver::Flag> ret;
|
||||
if(lastStatus.extRefInUse) {
|
||||
ret.insert(Flag::ExtRef);
|
||||
}
|
||||
if(!lastStatus.source_locked || !lastStatus.LO1_locked) {
|
||||
ret.insert(Flag::Unlocked);
|
||||
}
|
||||
if(lastStatus.unlevel) {
|
||||
ret.insert(Flag::Unlevel);
|
||||
}
|
||||
if(lastStatus.ADC_overload) {
|
||||
ret.insert(Flag::Overload);
|
||||
switch(hardwareVersion) {
|
||||
case 1:
|
||||
if(lastStatus.V1.extRefInUse) {
|
||||
ret.insert(Flag::ExtRef);
|
||||
}
|
||||
if(!lastStatus.V1.source_locked || !lastStatus.V1.LO1_locked) {
|
||||
ret.insert(Flag::Unlocked);
|
||||
}
|
||||
if(lastStatus.V1.unlevel) {
|
||||
ret.insert(Flag::Unlevel);
|
||||
}
|
||||
if(lastStatus.V1.ADC_overload) {
|
||||
ret.insert(Flag::Overload);
|
||||
}
|
||||
break;
|
||||
case 0xFF:
|
||||
if(!lastStatus.VFF.source_locked || !lastStatus.VFF.LO_locked) {
|
||||
ret.insert(Flag::Unlocked);
|
||||
}
|
||||
if(lastStatus.VFF.unlevel) {
|
||||
ret.insert(Flag::Unlevel);
|
||||
}
|
||||
if(lastStatus.VFF.ADC_overload) {
|
||||
ret.insert(Flag::Overload);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -186,15 +231,22 @@ QString LibreVNADriver::getStatus()
|
|||
ret.append("HW ");
|
||||
ret.append(info.hardware_version);
|
||||
ret.append(" FW "+info.firmware_version);
|
||||
ret.append(" Temps: "+QString::number(lastStatus.temp_source)+"°C/"+QString::number(lastStatus.temp_LO1)+"°C/"+QString::number(lastStatus.temp_MCU)+"°C");
|
||||
ret.append(" Reference:");
|
||||
if(lastStatus.extRefInUse) {
|
||||
ret.append("External");
|
||||
} else {
|
||||
ret.append("Internal");
|
||||
if(lastStatus.extRefAvailable) {
|
||||
ret.append(" (External available)");
|
||||
switch (hardwareVersion) {
|
||||
case 1:
|
||||
ret.append(" Temps: "+QString::number(lastStatus.V1.temp_source)+"°C/"+QString::number(lastStatus.V1.temp_LO1)+"°C/"+QString::number(lastStatus.V1.temp_MCU)+"°C");
|
||||
ret.append(" Reference:");
|
||||
if(lastStatus.V1.extRefInUse) {
|
||||
ret.append("External");
|
||||
} else {
|
||||
ret.append("Internal");
|
||||
if(lastStatus.V1.extRefAvailable) {
|
||||
ret.append(" (External available)");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0xFF:
|
||||
ret.append("MCU Temp: "+QString::number(lastStatus.VFF.temp_MCU)+"°C");
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -219,35 +271,6 @@ QWidget *LibreVNADriver::createSettingsWidget()
|
|||
ui->DFTlimitRBW->setPrecision(3);
|
||||
ui->DFTlimitRBW->setValue(SARBWLimitForDFT);
|
||||
|
||||
auto updateADCRate = [=]() {
|
||||
// update ADC rate, see FPGA protocol for calculation
|
||||
ui->ADCRate->setValue(102400000.0 / ui->ADCpresc->value());
|
||||
};
|
||||
auto updateIF2 = [=]() {
|
||||
auto ADCrate = ui->ADCRate->value();
|
||||
ui->IF2->setValue(ADCrate * ui->ADCphaseInc->value() / 4096);
|
||||
};
|
||||
|
||||
connect(ui->ADCpresc, qOverload<int>(&QSpinBox::valueChanged), updateADCRate);
|
||||
connect(ui->ADCpresc, qOverload<int>(&QSpinBox::valueChanged), updateIF2);
|
||||
connect(ui->ADCphaseInc, qOverload<int>(&QSpinBox::valueChanged), updateIF2);
|
||||
|
||||
ui->IF1->setUnit("Hz");
|
||||
ui->IF1->setPrefixes(" kM");
|
||||
ui->IF1->setPrecision(5);
|
||||
ui->ADCRate->setUnit("Hz");
|
||||
ui->ADCRate->setPrefixes(" kM");
|
||||
ui->ADCRate->setPrecision(5);
|
||||
ui->IF2->setUnit("Hz");
|
||||
ui->IF2->setPrefixes(" kM");
|
||||
ui->IF2->setPrecision(5);
|
||||
ui->IF1->setValue(IF1);
|
||||
ui->ADCpresc->setValue(ADCprescaler);
|
||||
ui->ADCphaseInc->setValue(DFTPhaseInc);
|
||||
|
||||
updateADCRate();
|
||||
updateIF2();
|
||||
|
||||
connect(ui->UseHarmonicMixing, &QCheckBox::toggled, [=](bool enabled) {
|
||||
if(enabled) {
|
||||
InformationBox::ShowMessage("Harmonic Mixing", "When harmonic mixing is enabled, the frequency range of the VNA is (theoretically) extended up to 18GHz "
|
||||
|
|
@ -280,15 +303,6 @@ QWidget *LibreVNADriver::createSettingsWidget()
|
|||
connect(ui->DFTlimitRBW, &SIUnitEdit::valueChanged, this, [=](){
|
||||
SARBWLimitForDFT = ui->DFTlimitRBW->value();
|
||||
});
|
||||
connect(ui->IF1, &SIUnitEdit::valueChanged, this, [=](){
|
||||
IF1 = ui->IF1->value();
|
||||
});
|
||||
connect(ui->ADCpresc, qOverload<int>(&QSpinBox::valueChanged), this, [=](){
|
||||
ADCprescaler = ui->ADCpresc->value();
|
||||
});
|
||||
connect(ui->ADCphaseInc, qOverload<int>(&QSpinBox::valueChanged), this, [=](){
|
||||
DFTPhaseInc = ui->ADCphaseInc->value();
|
||||
});
|
||||
|
||||
return w;
|
||||
}
|
||||
|
|
@ -593,8 +607,8 @@ void LibreVNADriver::handleReceivedPacket(const Protocol::PacketInfo &packet)
|
|||
emit InfoUpdated();
|
||||
}
|
||||
break;
|
||||
case Protocol::PacketType::DeviceStatusV1:
|
||||
lastStatus = packet.statusV1;
|
||||
case Protocol::PacketType::DeviceStatus:
|
||||
lastStatus = packet.status;
|
||||
emit StatusUpdated();
|
||||
emit FlagsUpdated();
|
||||
break;
|
||||
|
|
@ -650,16 +664,6 @@ void LibreVNADriver::handleReceivedPacket(const Protocol::PacketInfo &packet)
|
|||
}
|
||||
}
|
||||
|
||||
void LibreVNADriver::updateIFFrequencies()
|
||||
{
|
||||
Protocol::PacketInfo p;
|
||||
p.type = Protocol::PacketType::AcquisitionFrequencySettings;
|
||||
p.acquisitionFrequencySettings.IF1 = IF1;
|
||||
p.acquisitionFrequencySettings.ADCprescaler = ADCprescaler;
|
||||
p.acquisitionFrequencySettings.DFTphaseInc = DFTPhaseInc;
|
||||
SendPacket(p);
|
||||
}
|
||||
|
||||
QString LibreVNADriver::hardwareVersionToString(uint8_t version)
|
||||
{
|
||||
switch(version) {
|
||||
|
|
|
|||
|
|
@ -191,7 +191,6 @@ signals:
|
|||
protected slots:
|
||||
void handleReceivedPacket(const Protocol::PacketInfo& packet);
|
||||
protected:
|
||||
void updateIFFrequencies();
|
||||
QString hardwareVersionToString(uint8_t version);
|
||||
|
||||
bool connected;
|
||||
|
|
@ -200,7 +199,7 @@ protected:
|
|||
uint8_t hardwareVersion;
|
||||
unsigned int limits_maxAmplitudePoints;
|
||||
|
||||
Protocol::DeviceStatusV1 lastStatus;
|
||||
Protocol::DeviceStatus lastStatus;
|
||||
|
||||
bool skipOwnPacketHandling;
|
||||
bool zerospan;
|
||||
|
|
@ -219,9 +218,6 @@ protected:
|
|||
double SARBWLimitForDFT;
|
||||
bool VNASuppressInvalidPeaks;
|
||||
bool VNAAdjustPowerLevel;
|
||||
double IF1;
|
||||
unsigned int ADCprescaler;
|
||||
unsigned int DFTPhaseInc;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(Protocol::PacketInfo)
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>615</width>
|
||||
<height>598</height>
|
||||
<width>545</width>
|
||||
<height>417</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -100,115 +100,17 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_15">
|
||||
<property name="title">
|
||||
<string>IF frequencies</string>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_34">
|
||||
<property name="text">
|
||||
<string>This section contains advanced system settings. It is recommended to leave them at default values unless you know what you are doing. Slight changes of the IF frequencies can be used to shift possible spikes to less problematic frequencies. Large changes of these frequencies may severely impact device performance.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_29">
|
||||
<property name="text">
|
||||
<string>IF 1:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="SIUnitEdit" name="IF1">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Frequency of the first IF</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_30">
|
||||
<property name="text">
|
||||
<string>ADC prescaler:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="ADCpresc">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>ADC prescaler in FPGA. The ADC sample rate is determined by 102.4MHz/prescaler</p></body></html></string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>112</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>128</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_31">
|
||||
<property name="text">
|
||||
<string>ADC sample rate:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="SIUnitEdit" name="ADCRate">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_32">
|
||||
<property name="text">
|
||||
<string>Phase increment:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="ADCphaseInc">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Phase increment per ADC sample. Together with the ADC sample rate this determines the frequency of the second IF</p></body></html></string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>4095</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1280</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_33">
|
||||
<property name="text">
|
||||
<string>IF 2:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="SIUnitEdit" name="IF2">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
|
|
|||
|
|
@ -52,9 +52,6 @@ LibreVNATCPDriver::LibreVNATCPDriver()
|
|||
specificSettings.push_back(Savable::SettingDescription(&VNAAdjustPowerLevel, "LibreVNATCPDriver.adjustPowerLevel", false));
|
||||
specificSettings.push_back(Savable::SettingDescription(&SAUseDFT, "LibreVNATCPDriver.useDFT", true));
|
||||
specificSettings.push_back(Savable::SettingDescription(&SARBWLimitForDFT, "LibreVNATCPDriver.RBWlimitDFT", 3000));
|
||||
specificSettings.push_back(Savable::SettingDescription(&IF1, "LibreVNATCPDriver.IF1", 62000000));
|
||||
specificSettings.push_back(Savable::SettingDescription(&ADCprescaler, "LibreVNATCPDriver.ADCprescaler", 128));
|
||||
specificSettings.push_back(Savable::SettingDescription(&DFTPhaseInc, "LibreVNATCPDriver.DFTPhaseInc", 1280));
|
||||
}
|
||||
|
||||
QString LibreVNATCPDriver::getDriverName()
|
||||
|
|
@ -74,7 +71,9 @@ std::set<QString> LibreVNATCPDriver::GetAvailableDevices()
|
|||
data.append("\r\n"
|
||||
"\r\n");
|
||||
|
||||
pruneDetectedDevices();
|
||||
// just delete everything instead of keeping old entries (they will answer again if they are still available)
|
||||
detectedDevices.clear();
|
||||
// pruneDetectedDevices();
|
||||
for(auto s : ssdpSockets) {
|
||||
s->writeDatagram(data.data(), SSDPaddress, SSDPport);
|
||||
}
|
||||
|
|
@ -144,7 +143,7 @@ bool LibreVNATCPDriver::connectTo(QString serial)
|
|||
|
||||
sendWithoutPayload(Protocol::PacketType::RequestDeviceInfo);
|
||||
sendWithoutPayload(Protocol::PacketType::RequestDeviceStatus);
|
||||
updateIFFrequencies();
|
||||
// updateIFFrequencies();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -134,9 +134,6 @@ LibreVNAUSBDriver::LibreVNAUSBDriver()
|
|||
specificSettings.push_back(Savable::SettingDescription(&VNAAdjustPowerLevel, "LibreVNAUSBDriver.adjustPowerLevel", false));
|
||||
specificSettings.push_back(Savable::SettingDescription(&SAUseDFT, "LibreVNAUSBDriver.useDFT", true));
|
||||
specificSettings.push_back(Savable::SettingDescription(&SARBWLimitForDFT, "LibreVNAUSBDriver.RBWlimitDFT", 3000));
|
||||
specificSettings.push_back(Savable::SettingDescription(&IF1, "LibreVNAUSBDriver.IF1", 62000000));
|
||||
specificSettings.push_back(Savable::SettingDescription(&ADCprescaler, "LibreVNAUSBDriver.ADCprescaler", 128));
|
||||
specificSettings.push_back(Savable::SettingDescription(&DFTPhaseInc, "LibreVNAUSBDriver.DFTPhaseInc", 1280));
|
||||
}
|
||||
|
||||
QString LibreVNAUSBDriver::getDriverName()
|
||||
|
|
@ -230,7 +227,7 @@ bool LibreVNAUSBDriver::connectTo(QString serial)
|
|||
|
||||
sendWithoutPayload(Protocol::PacketType::RequestDeviceInfo);
|
||||
sendWithoutPayload(Protocol::PacketType::RequestDeviceStatus);
|
||||
updateIFFrequencies();
|
||||
// updateIFFrequencies();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "manualcontroldialog.h"
|
||||
#include "manualcontroldialogV1.h"
|
||||
|
||||
#include "ui_manualcontroldialog.h"
|
||||
#include "ui_manualcontroldialogV1.h"
|
||||
#include "Util/util.h"
|
||||
|
||||
#include <QComboBox>
|
||||
|
|
@ -11,9 +11,9 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
ManualControlDialog::ManualControlDialog(LibreVNADriver &dev, QWidget *parent) :
|
||||
ManualControlDialogV1::ManualControlDialogV1(LibreVNADriver &dev, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ManualControlDialog),
|
||||
ui(new Ui::ManualControlDialogV1),
|
||||
dev(dev)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
|
@ -152,8 +152,8 @@ ManualControlDialog::ManualControlDialog(LibreVNADriver &dev, QWidget *parent) :
|
|||
MakeReadOnly(ui->refphase);
|
||||
|
||||
connect(&dev, &LibreVNADriver::receivedPacket, this, [=](const Protocol::PacketInfo &p){
|
||||
if(p.type == Protocol::PacketType::ManualStatusV1) {
|
||||
NewStatus(p.manualStatusV1);
|
||||
if(p.type == Protocol::PacketType::ManualStatus) {
|
||||
NewStatus(p.manualStatus);
|
||||
}
|
||||
}, Qt::QueuedConnection);
|
||||
|
||||
|
|
@ -189,38 +189,38 @@ ManualControlDialog::ManualControlDialog(LibreVNADriver &dev, QWidget *parent) :
|
|||
UpdateDevice();
|
||||
}
|
||||
|
||||
ManualControlDialog::~ManualControlDialog()
|
||||
ManualControlDialogV1::~ManualControlDialogV1()
|
||||
{
|
||||
emit dev.releaseControl();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ManualControlDialog::setHighSourceChipEnable(bool enable)
|
||||
void ManualControlDialogV1::setHighSourceChipEnable(bool enable)
|
||||
{
|
||||
ui->SourceCE->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialog::getHighSourceChipEnable()
|
||||
bool ManualControlDialogV1::getHighSourceChipEnable()
|
||||
{
|
||||
return ui->SourceCE->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setHighSourceRFEnable(bool enable)
|
||||
void ManualControlDialogV1::setHighSourceRFEnable(bool enable)
|
||||
{
|
||||
ui->SourceRFEN->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialog::getHighSourceRFEnable()
|
||||
bool ManualControlDialogV1::getHighSourceRFEnable()
|
||||
{
|
||||
return ui->SourceRFEN->isChecked();
|
||||
}
|
||||
|
||||
bool ManualControlDialog::getHighSourceLocked()
|
||||
bool ManualControlDialogV1::getHighSourceLocked()
|
||||
{
|
||||
return ui->SourceLocked->isChecked();
|
||||
}
|
||||
|
||||
bool ManualControlDialog::setHighSourcePower(int dBm)
|
||||
bool ManualControlDialogV1::setHighSourcePower(int dBm)
|
||||
{
|
||||
switch(dBm) {
|
||||
case -4:
|
||||
|
|
@ -242,23 +242,23 @@ bool ManualControlDialog::setHighSourcePower(int dBm)
|
|||
return true;
|
||||
}
|
||||
|
||||
int ManualControlDialog::getHighSourcePower()
|
||||
int ManualControlDialogV1::getHighSourcePower()
|
||||
{
|
||||
int powers[4] = {-4,-1,2,5};
|
||||
return powers[ui->SourceHighPower->currentIndex()];
|
||||
}
|
||||
|
||||
void ManualControlDialog::setHighSourceFrequency(double f)
|
||||
void ManualControlDialogV1::setHighSourceFrequency(double f)
|
||||
{
|
||||
ui->SourceHighFrequency->setValue(f);
|
||||
}
|
||||
|
||||
double ManualControlDialog::getHighSourceFrequency()
|
||||
double ManualControlDialogV1::getHighSourceFrequency()
|
||||
{
|
||||
return ui->SourceHighFrequency->value();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setHighSourceLPF(ManualControlDialog::LPF lpf)
|
||||
void ManualControlDialogV1::setHighSourceLPF(ManualControlDialogV1::LPF lpf)
|
||||
{
|
||||
switch(lpf) {
|
||||
case LPF::M947:
|
||||
|
|
@ -276,23 +276,23 @@ void ManualControlDialog::setHighSourceLPF(ManualControlDialog::LPF lpf)
|
|||
}
|
||||
}
|
||||
|
||||
ManualControlDialog::LPF ManualControlDialog::getHighSourceLPF()
|
||||
ManualControlDialogV1::LPF ManualControlDialogV1::getHighSourceLPF()
|
||||
{
|
||||
LPF lpfs[4] = {LPF::M947, LPF::M1880, LPF::M3500, LPF::None};
|
||||
return lpfs[ui->SourceLowpass->currentIndex()];
|
||||
}
|
||||
|
||||
void ManualControlDialog::setLowSourceEnable(bool enable)
|
||||
void ManualControlDialogV1::setLowSourceEnable(bool enable)
|
||||
{
|
||||
ui->SourceLowEnable->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialog::getLowSourceEnable()
|
||||
bool ManualControlDialogV1::getLowSourceEnable()
|
||||
{
|
||||
return ui->SourceLowEnable->isChecked();
|
||||
}
|
||||
|
||||
bool ManualControlDialog::setLowSourcePower(int mA)
|
||||
bool ManualControlDialogV1::setLowSourcePower(int mA)
|
||||
{
|
||||
switch(mA) {
|
||||
case 2:
|
||||
|
|
@ -314,23 +314,23 @@ bool ManualControlDialog::setLowSourcePower(int mA)
|
|||
return true;
|
||||
}
|
||||
|
||||
int ManualControlDialog::getLowSourcePower()
|
||||
int ManualControlDialogV1::getLowSourcePower()
|
||||
{
|
||||
int powers[4] = {2,4,6,8};
|
||||
return powers[ui->SourceLowPower->currentIndex()];
|
||||
}
|
||||
|
||||
void ManualControlDialog::setLowSourceFrequency(double f)
|
||||
void ManualControlDialogV1::setLowSourceFrequency(double f)
|
||||
{
|
||||
ui->SourceLowFrequency->setValue(f);
|
||||
}
|
||||
|
||||
double ManualControlDialog::getLowSourceFrequency()
|
||||
double ManualControlDialogV1::getLowSourceFrequency()
|
||||
{
|
||||
return ui->SourceLowFrequency->value();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setHighband(bool high)
|
||||
void ManualControlDialogV1::setHighband(bool high)
|
||||
{
|
||||
if(high) {
|
||||
ui->SwitchHighband->setChecked(true);
|
||||
|
|
@ -339,32 +339,32 @@ void ManualControlDialog::setHighband(bool high)
|
|||
}
|
||||
}
|
||||
|
||||
bool ManualControlDialog::getHighband()
|
||||
bool ManualControlDialogV1::getHighband()
|
||||
{
|
||||
return ui->SwitchHighband->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setAttenuator(double att)
|
||||
void ManualControlDialogV1::setAttenuator(double att)
|
||||
{
|
||||
ui->Attenuator->setValue(att);
|
||||
}
|
||||
|
||||
double ManualControlDialog::getAttenuator()
|
||||
double ManualControlDialogV1::getAttenuator()
|
||||
{
|
||||
return ui->Attenuator->value();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setAmplifierEnable(bool enable)
|
||||
void ManualControlDialogV1::setAmplifierEnable(bool enable)
|
||||
{
|
||||
ui->AmplifierEnable->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialog::getAmplifierEnable()
|
||||
bool ManualControlDialogV1::getAmplifierEnable()
|
||||
{
|
||||
return ui->AmplifierEnable->isChecked();
|
||||
}
|
||||
|
||||
bool ManualControlDialog::setPortSwitch(int port)
|
||||
bool ManualControlDialogV1::setPortSwitch(int port)
|
||||
{
|
||||
switch(port) {
|
||||
case 1:
|
||||
|
|
@ -380,7 +380,7 @@ bool ManualControlDialog::setPortSwitch(int port)
|
|||
return true;
|
||||
}
|
||||
|
||||
int ManualControlDialog::getPortSwitch()
|
||||
int ManualControlDialogV1::getPortSwitch()
|
||||
{
|
||||
if(ui->Port1Switch->isChecked()) {
|
||||
return 1;
|
||||
|
|
@ -389,223 +389,223 @@ int ManualControlDialog::getPortSwitch()
|
|||
}
|
||||
}
|
||||
|
||||
void ManualControlDialog::setLO1ChipEnable(bool enable)
|
||||
void ManualControlDialogV1::setLO1ChipEnable(bool enable)
|
||||
{
|
||||
ui->LO1CE->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialog::getLO1ChipEnable()
|
||||
bool ManualControlDialogV1::getLO1ChipEnable()
|
||||
{
|
||||
return ui->LO1CE->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setLO1RFEnable(bool enable)
|
||||
void ManualControlDialogV1::setLO1RFEnable(bool enable)
|
||||
{
|
||||
ui->LO1RFEN->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialog::getLO1RFEnable()
|
||||
bool ManualControlDialogV1::getLO1RFEnable()
|
||||
{
|
||||
return ui->LO1RFEN->isChecked();
|
||||
}
|
||||
|
||||
bool ManualControlDialog::getLO1Locked()
|
||||
bool ManualControlDialogV1::getLO1Locked()
|
||||
{
|
||||
return ui->LO1locked->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setLO1Frequency(double f)
|
||||
void ManualControlDialogV1::setLO1Frequency(double f)
|
||||
{
|
||||
ui->LO1FreqType->setCurrentIndex(1);
|
||||
ui->LO1Frequency->setValue(f);
|
||||
}
|
||||
|
||||
double ManualControlDialog::getLO1Frequency()
|
||||
double ManualControlDialogV1::getLO1Frequency()
|
||||
{
|
||||
return ui->LO1Frequency->value();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setIF1Frequency(double f)
|
||||
void ManualControlDialogV1::setIF1Frequency(double f)
|
||||
{
|
||||
ui->LO1FreqType->setCurrentIndex(0);
|
||||
ui->IF1->setValue(f);
|
||||
}
|
||||
|
||||
double ManualControlDialog::getIF1Frequency()
|
||||
double ManualControlDialogV1::getIF1Frequency()
|
||||
{
|
||||
return ui->IF1->value();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setLO2Enable(bool enable)
|
||||
void ManualControlDialogV1::setLO2Enable(bool enable)
|
||||
{
|
||||
ui->LO2EN->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialog::getLO2Enable()
|
||||
bool ManualControlDialogV1::getLO2Enable()
|
||||
{
|
||||
return ui->LO2EN->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setLO2Frequency(double f)
|
||||
void ManualControlDialogV1::setLO2Frequency(double f)
|
||||
{
|
||||
ui->LO2FreqType->setCurrentIndex(1);
|
||||
ui->LO2Frequency->setValue(f);
|
||||
}
|
||||
|
||||
double ManualControlDialog::getLO2Frequency()
|
||||
double ManualControlDialogV1::getLO2Frequency()
|
||||
{
|
||||
return ui->LO2Frequency->value();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setIF2Frequency(double f)
|
||||
void ManualControlDialogV1::setIF2Frequency(double f)
|
||||
{
|
||||
ui->LO2FreqType->setCurrentIndex(0);
|
||||
ui->IF2->setValue(f);
|
||||
}
|
||||
|
||||
double ManualControlDialog::getIF2Frequency()
|
||||
double ManualControlDialogV1::getIF2Frequency()
|
||||
{
|
||||
return ui->IF2->value();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setPort1Enable(bool enable)
|
||||
void ManualControlDialogV1::setPort1Enable(bool enable)
|
||||
{
|
||||
ui->Port1Enable->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialog::getPort1Enable()
|
||||
bool ManualControlDialogV1::getPort1Enable()
|
||||
{
|
||||
return ui->Port1Enable->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setPort2Enable(bool enable)
|
||||
void ManualControlDialogV1::setPort2Enable(bool enable)
|
||||
{
|
||||
ui->Port2Enable->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialog::getPort2Enable()
|
||||
bool ManualControlDialogV1::getPort2Enable()
|
||||
{
|
||||
return ui->Port2Enable->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setRefEnable(bool enable)
|
||||
void ManualControlDialogV1::setRefEnable(bool enable)
|
||||
{
|
||||
ui->RefEnable->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialog::getRefEnable()
|
||||
bool ManualControlDialogV1::getRefEnable()
|
||||
{
|
||||
return ui->RefEnable->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setNumSamples(int samples)
|
||||
void ManualControlDialogV1::setNumSamples(int samples)
|
||||
{
|
||||
ui->Samples->setValue(samples);
|
||||
}
|
||||
|
||||
int ManualControlDialog::getNumSamples()
|
||||
int ManualControlDialogV1::getNumSamples()
|
||||
{
|
||||
return ui->Samples->value();
|
||||
}
|
||||
|
||||
void ManualControlDialog::setWindow(ManualControlDialog::Window w)
|
||||
void ManualControlDialogV1::setWindow(ManualControlDialogV1::Window w)
|
||||
{
|
||||
ui->cbWindow->setCurrentIndex((int) w);
|
||||
}
|
||||
|
||||
ManualControlDialog::Window ManualControlDialog::getWindow()
|
||||
ManualControlDialogV1::Window ManualControlDialogV1::getWindow()
|
||||
{
|
||||
return (Window) ui->cbWindow->currentIndex();
|
||||
}
|
||||
|
||||
int ManualControlDialog::getPort1MinADC()
|
||||
int ManualControlDialogV1::getPort1MinADC()
|
||||
{
|
||||
return ui->port1min->text().toInt();
|
||||
}
|
||||
|
||||
int ManualControlDialog::getPort1MaxADC()
|
||||
int ManualControlDialogV1::getPort1MaxADC()
|
||||
{
|
||||
return ui->port1max->text().toInt();
|
||||
}
|
||||
|
||||
double ManualControlDialog::getPort1Magnitude()
|
||||
double ManualControlDialogV1::getPort1Magnitude()
|
||||
{
|
||||
return ui->port1mag->text().toDouble();
|
||||
}
|
||||
|
||||
double ManualControlDialog::getPort1Phase()
|
||||
double ManualControlDialogV1::getPort1Phase()
|
||||
{
|
||||
return ui->port1phase->text().toDouble();
|
||||
}
|
||||
|
||||
std::complex<double> ManualControlDialog::getPort1Referenced()
|
||||
std::complex<double> ManualControlDialogV1::getPort1Referenced()
|
||||
{
|
||||
return port1referenced;
|
||||
}
|
||||
|
||||
int ManualControlDialog::getPort2MinADC()
|
||||
int ManualControlDialogV1::getPort2MinADC()
|
||||
{
|
||||
return ui->port2min->text().toInt();
|
||||
}
|
||||
|
||||
int ManualControlDialog::getPort2MaxADC()
|
||||
int ManualControlDialogV1::getPort2MaxADC()
|
||||
{
|
||||
return ui->port2max->text().toInt();
|
||||
}
|
||||
|
||||
double ManualControlDialog::getPort2Magnitude()
|
||||
double ManualControlDialogV1::getPort2Magnitude()
|
||||
{
|
||||
return ui->port2mag->text().toDouble();
|
||||
}
|
||||
|
||||
double ManualControlDialog::getPort2Phase()
|
||||
double ManualControlDialogV1::getPort2Phase()
|
||||
{
|
||||
return ui->port2phase->text().toDouble();
|
||||
}
|
||||
|
||||
std::complex<double> ManualControlDialog::getPort2Referenced()
|
||||
std::complex<double> ManualControlDialogV1::getPort2Referenced()
|
||||
{
|
||||
return port2referenced;
|
||||
}
|
||||
|
||||
int ManualControlDialog::getRefMinADC()
|
||||
int ManualControlDialogV1::getRefMinADC()
|
||||
{
|
||||
return ui->refmin->text().toInt();
|
||||
}
|
||||
|
||||
int ManualControlDialog::getRefMaxADC()
|
||||
int ManualControlDialogV1::getRefMaxADC()
|
||||
{
|
||||
return ui->refmax->text().toInt();
|
||||
}
|
||||
|
||||
double ManualControlDialog::getRefMagnitude()
|
||||
double ManualControlDialogV1::getRefMagnitude()
|
||||
{
|
||||
return ui->refmag->text().toDouble();
|
||||
}
|
||||
|
||||
double ManualControlDialog::getRefPhase()
|
||||
double ManualControlDialogV1::getRefPhase()
|
||||
{
|
||||
return ui->refphase->text().toDouble();
|
||||
}
|
||||
|
||||
void ManualControlDialog::NewStatus(Protocol::ManualStatusV1 status)
|
||||
void ManualControlDialogV1::NewStatus(Protocol::ManualStatus status)
|
||||
{
|
||||
// ADC values
|
||||
ui->port1min->setText(QString::number(status.port1min));
|
||||
ui->port1max->setText(QString::number(status.port1max));
|
||||
auto port1 = complex<double>(status.port1real, status.port1imag);
|
||||
ui->port1min->setText(QString::number(status.V1.port1min));
|
||||
ui->port1max->setText(QString::number(status.V1.port1max));
|
||||
auto port1 = complex<double>(status.V1.port1real, status.V1.port1imag);
|
||||
ui->port1mag->setText(QString::number(abs(port1)));
|
||||
ui->port1phase->setText(QString::number(arg(port1)*180/M_PI));
|
||||
|
||||
ui->port2min->setText(QString::number(status.port2min));
|
||||
ui->port2max->setText(QString::number(status.port2max));
|
||||
auto port2 = complex<double>(status.port2real, status.port2imag);
|
||||
ui->port2min->setText(QString::number(status.V1.port2min));
|
||||
ui->port2max->setText(QString::number(status.V1.port2max));
|
||||
auto port2 = complex<double>(status.V1.port2real, status.V1.port2imag);
|
||||
ui->port2mag->setText(QString::number(abs(port2)));
|
||||
ui->port2phase->setText(QString::number(arg(port2)*180/M_PI));
|
||||
|
||||
ui->refmin->setText(QString::number(status.refmin));
|
||||
ui->refmax->setText(QString::number(status.refmax));
|
||||
auto ref = complex<double>(status.refreal, status.refimag);
|
||||
ui->refmin->setText(QString::number(status.V1.refmin));
|
||||
ui->refmax->setText(QString::number(status.V1.refmax));
|
||||
auto ref = complex<double>(status.V1.refreal, status.V1.refimag);
|
||||
ui->refmag->setText(QString::number(abs(ref)));
|
||||
ui->refphase->setText(QString::number(arg(ref)*180/M_PI));
|
||||
|
||||
|
|
@ -618,15 +618,15 @@ void ManualControlDialog::NewStatus(Protocol::ManualStatusV1 status)
|
|||
ui->port2referenced->setText(QString::number(port2db, 'f', 1) + "db@" + QString::number(arg(port2referenced)*180/M_PI, 'f', 0) + "°");
|
||||
|
||||
// PLL state
|
||||
ui->SourceLocked->setChecked(status.source_locked);
|
||||
ui->LO1locked->setChecked(status.LO_locked);
|
||||
ui->SourceLocked->setChecked(status.V1.source_locked);
|
||||
ui->LO1locked->setChecked(status.V1.LO_locked);
|
||||
}
|
||||
|
||||
void ManualControlDialog::UpdateDevice()
|
||||
void ManualControlDialogV1::UpdateDevice()
|
||||
{
|
||||
Protocol::PacketInfo p;
|
||||
p.type = Protocol::PacketType::ManualControlV1;
|
||||
Protocol::ManualControlV1 &m = p.manual;
|
||||
p.type = Protocol::PacketType::ManualControl;
|
||||
auto &m = p.manual.V1;
|
||||
// Source highband
|
||||
m.SourceHighCE = ui->SourceCE->isChecked();
|
||||
m.SourceHighRFEN = ui->SourceRFEN->isChecked();
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef MANUALCONTROLDIALOG_H
|
||||
#define MANUALCONTROLDIALOG_H
|
||||
#ifndef MANUALCONTROLDIALOGV1_H
|
||||
#define MANUALCONTROLDIALOGV1_H
|
||||
|
||||
#include "librevnadriver.h"
|
||||
|
||||
|
|
@ -7,16 +7,16 @@
|
|||
#include <complex>
|
||||
|
||||
namespace Ui {
|
||||
class ManualControlDialog;
|
||||
class ManualControlDialogV1;
|
||||
}
|
||||
|
||||
class ManualControlDialog : public QDialog
|
||||
class ManualControlDialogV1 : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ManualControlDialog(LibreVNADriver &dev, QWidget *parent = nullptr);
|
||||
~ManualControlDialog();
|
||||
explicit ManualControlDialogV1(LibreVNADriver &dev, QWidget *parent = nullptr);
|
||||
~ManualControlDialogV1();
|
||||
|
||||
void setHighSourceChipEnable(bool enable);
|
||||
bool getHighSourceChipEnable();
|
||||
|
|
@ -103,14 +103,14 @@ public:
|
|||
double getRefPhase();
|
||||
|
||||
public slots:
|
||||
void NewStatus(Protocol::ManualStatusV1 status);
|
||||
void NewStatus(Protocol::ManualStatus status);
|
||||
|
||||
private:
|
||||
void UpdateDevice();
|
||||
Ui::ManualControlDialog *ui;
|
||||
Ui::ManualControlDialogV1 *ui;
|
||||
LibreVNADriver &dev;
|
||||
std::complex<double> port1referenced;
|
||||
std::complex<double> port2referenced;
|
||||
};
|
||||
|
||||
#endif // MANUALCONTROLDIALOG_H
|
||||
#endif // MANUALCONTROLDIALOGV1_H
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ManualControlDialog</class>
|
||||
<widget class="QDialog" name="ManualControlDialog">
|
||||
<class>ManualControlDialogV1</class>
|
||||
<widget class="QDialog" name="ManualControlDialogV1">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::ApplicationModal</enum>
|
||||
</property>
|
||||
|
|
@ -776,7 +776,7 @@
|
|||
<resources/>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="PortSwitchGroup"/>
|
||||
<buttongroup name="SourceSwitchGroup"/>
|
||||
<buttongroup name="PortSwitchGroup"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,432 @@
|
|||
#include "manualcontroldialogvff.h"
|
||||
|
||||
#include "ui_manualcontroldialogvff.h"
|
||||
#include "Util/util.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QDebug>
|
||||
#include <QButtonGroup>
|
||||
#include <complex>
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
ManualControlDialogVFF::ManualControlDialogVFF(LibreVNADriver &dev, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ManualControlDialogVFF),
|
||||
dev(dev)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
emit dev.acquireControl();
|
||||
|
||||
ui->SourceFrequency->setUnit("Hz");
|
||||
ui->SourceFrequency->setPrefixes(" kMG");
|
||||
ui->SourceFrequency->setPrecision(6);
|
||||
ui->SourceFrequency->setValueQuiet(1000000000);
|
||||
|
||||
ui->IF->setUnit("Hz");
|
||||
ui->IF->setPrefixes(" kM");
|
||||
ui->IF->setPrecision(6);
|
||||
|
||||
ui->LOFrequency->setUnit("Hz");
|
||||
ui->LOFrequency->setPrefixes(" kMG");
|
||||
ui->LOFrequency->setPrecision(6);
|
||||
|
||||
auto UpdateLO = [=]() {
|
||||
double sourceFreq = ui->SourceFrequency->value();
|
||||
if (ui->LOFreqType->currentIndex() == 0) {
|
||||
// fixed IF mode
|
||||
ui->LOFrequency->setValueQuiet(sourceFreq + ui->IF->value());
|
||||
} else {
|
||||
// Manual Frequency mode
|
||||
ui->IF->setValueQuiet(ui->LOFrequency->value() - sourceFreq);
|
||||
}
|
||||
};
|
||||
|
||||
connect(ui->IF, &SIUnitEdit::valueChanged, [=](double) {
|
||||
UpdateLO();
|
||||
});
|
||||
connect(ui->LOFrequency, &SIUnitEdit::valueChanged, [=](double) {
|
||||
UpdateLO();
|
||||
});
|
||||
connect(ui->SourceFrequency, &SIUnitEdit::valueChanged, [=](double) {
|
||||
UpdateLO();
|
||||
});
|
||||
|
||||
ui->IF->setValue(100000);
|
||||
|
||||
// LO mode switch connections
|
||||
connect(ui->LOFreqType, qOverload<int>(&QComboBox::activated), [=](int index) {
|
||||
switch(index) {
|
||||
case 0:
|
||||
ui->LOFrequency->setEnabled(false);
|
||||
ui->IF->setEnabled(true);
|
||||
break;
|
||||
case 1:
|
||||
ui->LOFrequency->setEnabled(true);
|
||||
ui->IF->setEnabled(false);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
// Readonly widgets
|
||||
auto MakeReadOnly = [](QWidget* w) {
|
||||
w->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
w->setFocusPolicy(Qt::NoFocus);
|
||||
};
|
||||
MakeReadOnly(ui->SourceLocked);
|
||||
MakeReadOnly(ui->LOlocked);
|
||||
MakeReadOnly(ui->portmin);
|
||||
MakeReadOnly(ui->portmax);
|
||||
MakeReadOnly(ui->portmag);
|
||||
MakeReadOnly(ui->portphase);
|
||||
MakeReadOnly(ui->portreferenced);
|
||||
MakeReadOnly(ui->refmin);
|
||||
MakeReadOnly(ui->refmax);
|
||||
MakeReadOnly(ui->refmag);
|
||||
MakeReadOnly(ui->refphase);
|
||||
|
||||
connect(&dev, &LibreVNADriver::receivedPacket, this, [=](const Protocol::PacketInfo &p){
|
||||
if(p.type == Protocol::PacketType::ManualStatus) {
|
||||
NewStatus(p.manualStatus);
|
||||
}
|
||||
}, Qt::QueuedConnection);
|
||||
|
||||
connect(ui->SourceCE, &QCheckBox::toggled, [=](bool) { UpdateDevice(); });
|
||||
connect(ui->SourceRFEN, &QCheckBox::toggled, [=](bool) { UpdateDevice(); });
|
||||
connect(ui->LOCE, &QCheckBox::toggled, [=](bool) { UpdateDevice(); });
|
||||
connect(ui->LORFEN, &QCheckBox::toggled, [=](bool) { UpdateDevice(); });
|
||||
connect(ui->SourceAmplifierEnable, &QCheckBox::toggled, [=](bool) { UpdateDevice(); });
|
||||
connect(ui->Port1Enable, &QCheckBox::toggled, [=](bool) { UpdateDevice(); });
|
||||
connect(ui->RefEnable, &QCheckBox::toggled, [=](bool) { UpdateDevice(); });
|
||||
connect(ui->portgain, qOverload<int>(&QComboBox::currentIndexChanged), [=](int) { UpdateDevice(); });
|
||||
connect(ui->refgain, qOverload<int>(&QComboBox::currentIndexChanged), [=](int) { UpdateDevice(); });
|
||||
|
||||
connect(ui->SourcePower, qOverload<int>(&QComboBox::currentIndexChanged), [=](int) { UpdateDevice(); });
|
||||
connect(ui->SourceFrequency, &SIUnitEdit::valueChanged, [=](double) { UpdateDevice(); });
|
||||
connect(ui->LOAmplifierEnable, &QCheckBox::toggled, [=](bool) { UpdateDevice(); });
|
||||
connect(ui->LOExternal, &QRadioButton::toggled, [=](bool) { UpdateDevice(); });
|
||||
connect(ui->LOFrequency, &SIUnitEdit::valueChanged, [=](double) { UpdateDevice(); });
|
||||
connect(ui->IF, &SIUnitEdit::valueChanged, [=](double) { UpdateDevice(); });
|
||||
|
||||
connect(ui->Attenuator, qOverload<double>(&QDoubleSpinBox::valueChanged), [=](double) { UpdateDevice(); });
|
||||
connect(ui->Samples, qOverload<int>(&QSpinBox::valueChanged), [=](double) { UpdateDevice(); });
|
||||
connect(ui->cbWindow, qOverload<int>(&QComboBox::activated), [=](int) { UpdateDevice(); });
|
||||
|
||||
UpdateDevice();
|
||||
}
|
||||
|
||||
ManualControlDialogVFF::~ManualControlDialogVFF()
|
||||
{
|
||||
emit dev.releaseControl();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setSourceChipEnable(bool enable)
|
||||
{
|
||||
ui->SourceCE->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialogVFF::getSourceChipEnable()
|
||||
{
|
||||
return ui->SourceCE->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setSourceRFEnable(bool enable)
|
||||
{
|
||||
ui->SourceRFEN->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialogVFF::getSourceRFEnable()
|
||||
{
|
||||
return ui->SourceRFEN->isChecked();
|
||||
}
|
||||
|
||||
bool ManualControlDialogVFF::getSourceLocked()
|
||||
{
|
||||
return ui->SourceLocked->isChecked();
|
||||
}
|
||||
|
||||
static constexpr double powers[8] = {-1, +1, +2.5, +3.5, +4.5, +5.5, +6.5, +7};
|
||||
|
||||
bool ManualControlDialogVFF::setSourcePower(double dBm)
|
||||
{
|
||||
for(unsigned int i=0;i<8;i++) {
|
||||
if(dBm == powers[i]) {
|
||||
ui->SourcePower->setCurrentIndex(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// invalid power setting
|
||||
return false;
|
||||
}
|
||||
|
||||
double ManualControlDialogVFF::getSourcePower()
|
||||
{
|
||||
return powers[ui->SourcePower->currentIndex()];
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setSourceFrequency(double f)
|
||||
{
|
||||
ui->SourceFrequency->setValue(f);
|
||||
}
|
||||
|
||||
double ManualControlDialogVFF::getSourceFrequency()
|
||||
{
|
||||
return ui->SourceFrequency->value();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setAttenuator(double att)
|
||||
{
|
||||
ui->Attenuator->setValue(att);
|
||||
}
|
||||
|
||||
double ManualControlDialogVFF::getAttenuator()
|
||||
{
|
||||
return ui->Attenuator->value();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setSourceAmplifierEnable(bool enable)
|
||||
{
|
||||
ui->SourceAmplifierEnable->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialogVFF::getSourceAmplifierEnable()
|
||||
{
|
||||
return ui->SourceAmplifierEnable->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setLOAmplifierEnable(bool enable)
|
||||
{
|
||||
ui->LOAmplifierEnable->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialogVFF::getLOAmplifierEnable()
|
||||
{
|
||||
return ui->LOAmplifierEnable->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setLOPath(bool external)
|
||||
{
|
||||
if(external) {
|
||||
ui->LOExternal->setChecked(true);
|
||||
} else {
|
||||
ui->LOInternal->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
bool ManualControlDialogVFF::getLOPath()
|
||||
{
|
||||
return ui->LOExternal->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setLOChipEnable(bool enable)
|
||||
{
|
||||
ui->LOCE->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialogVFF::getLOChipEnable()
|
||||
{
|
||||
return ui->LOCE->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setLORFEnable(bool enable)
|
||||
{
|
||||
ui->LORFEN->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialogVFF::getLORFEnable()
|
||||
{
|
||||
return ui->LORFEN->isChecked();
|
||||
}
|
||||
|
||||
bool ManualControlDialogVFF::getLOLocked()
|
||||
{
|
||||
return ui->LOlocked->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setLOFrequency(double f)
|
||||
{
|
||||
ui->LOFreqType->setCurrentIndex(1);
|
||||
ui->LOFrequency->setValue(f);
|
||||
}
|
||||
|
||||
double ManualControlDialogVFF::getLOFrequency()
|
||||
{
|
||||
return ui->LOFrequency->value();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setIFFrequency(double f)
|
||||
{
|
||||
ui->LOFreqType->setCurrentIndex(0);
|
||||
ui->IF->setValue(f);
|
||||
}
|
||||
|
||||
double ManualControlDialogVFF::getIFFrequency()
|
||||
{
|
||||
return ui->IF->value();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setPortEnable(bool enable)
|
||||
{
|
||||
ui->Port1Enable->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialogVFF::getPortEnable()
|
||||
{
|
||||
return ui->Port1Enable->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setRefEnable(bool enable)
|
||||
{
|
||||
ui->RefEnable->setChecked(enable);
|
||||
}
|
||||
|
||||
bool ManualControlDialogVFF::getRefEnable()
|
||||
{
|
||||
return ui->RefEnable->isChecked();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setPortGain(Gain g)
|
||||
{
|
||||
ui->portgain->setCurrentIndex((int) g);
|
||||
}
|
||||
|
||||
ManualControlDialogVFF::Gain ManualControlDialogVFF::getPortGain()
|
||||
{
|
||||
return (Gain) ui->portgain->currentIndex();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setRefGain(Gain g)
|
||||
{
|
||||
ui->refgain->setCurrentIndex((int) g);
|
||||
}
|
||||
|
||||
ManualControlDialogVFF::Gain ManualControlDialogVFF::getRefGain()
|
||||
{
|
||||
return (Gain) ui->refgain->currentIndex();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setNumSamples(int samples)
|
||||
{
|
||||
ui->Samples->setValue(samples);
|
||||
}
|
||||
|
||||
int ManualControlDialogVFF::getNumSamples()
|
||||
{
|
||||
return ui->Samples->value();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::setWindow(ManualControlDialogVFF::Window w)
|
||||
{
|
||||
ui->cbWindow->setCurrentIndex((int) w);
|
||||
}
|
||||
|
||||
ManualControlDialogVFF::Window ManualControlDialogVFF::getWindow()
|
||||
{
|
||||
return (Window) ui->cbWindow->currentIndex();
|
||||
}
|
||||
|
||||
int ManualControlDialogVFF::getPortMinADC()
|
||||
{
|
||||
return ui->portmin->text().toInt();
|
||||
}
|
||||
|
||||
int ManualControlDialogVFF::getPortMaxADC()
|
||||
{
|
||||
return ui->portmax->text().toInt();
|
||||
}
|
||||
|
||||
double ManualControlDialogVFF::getPortMagnitude()
|
||||
{
|
||||
return ui->portmag->text().toDouble();
|
||||
}
|
||||
|
||||
double ManualControlDialogVFF::getPortPhase()
|
||||
{
|
||||
return ui->portphase->text().toDouble();
|
||||
}
|
||||
|
||||
std::complex<double> ManualControlDialogVFF::getPortReferenced()
|
||||
{
|
||||
return portreferenced;
|
||||
}
|
||||
|
||||
int ManualControlDialogVFF::getRefMinADC()
|
||||
{
|
||||
return ui->refmin->text().toInt();
|
||||
}
|
||||
|
||||
int ManualControlDialogVFF::getRefMaxADC()
|
||||
{
|
||||
return ui->refmax->text().toInt();
|
||||
}
|
||||
|
||||
double ManualControlDialogVFF::getRefMagnitude()
|
||||
{
|
||||
return ui->refmag->text().toDouble();
|
||||
}
|
||||
|
||||
double ManualControlDialogVFF::getRefPhase()
|
||||
{
|
||||
return ui->refphase->text().toDouble();
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::NewStatus(Protocol::ManualStatus status)
|
||||
{
|
||||
// ADC values
|
||||
ui->portmin->setText(QString::number(status.VFF.portmin));
|
||||
ui->portmax->setText(QString::number(status.VFF.portmax));
|
||||
auto port = complex<double>(status.VFF.portreal, status.VFF.portimag);
|
||||
ui->portmag->setText(QString::number(abs(port)));
|
||||
ui->portphase->setText(QString::number(arg(port)*180/M_PI));
|
||||
|
||||
ui->refmin->setText(QString::number(status.VFF.refmin));
|
||||
ui->refmax->setText(QString::number(status.VFF.refmax));
|
||||
auto ref = complex<double>(status.VFF.refreal, status.VFF.refimag);
|
||||
ui->refmag->setText(QString::number(abs(ref)));
|
||||
ui->refphase->setText(QString::number(arg(ref)*180/M_PI));
|
||||
|
||||
portreferenced = port / ref;
|
||||
auto portdb = Util::SparamTodB(portreferenced);
|
||||
|
||||
ui->portreferenced->setText(QString::number(portdb, 'f', 1) + "db@" + QString::number(arg(portreferenced)*180/M_PI, 'f', 0) + "°");
|
||||
|
||||
// PLL state
|
||||
ui->SourceLocked->setChecked(status.VFF.source_locked);
|
||||
ui->LOlocked->setChecked(status.VFF.LO_locked);
|
||||
}
|
||||
|
||||
void ManualControlDialogVFF::UpdateDevice()
|
||||
{
|
||||
Protocol::PacketInfo p;
|
||||
p.type = Protocol::PacketType::ManualControl;
|
||||
auto &m = p.manual.VFF;
|
||||
// Source highband
|
||||
m.SourceCE = ui->SourceCE->isChecked();
|
||||
m.SourceRFEN = ui->SourceRFEN->isChecked();
|
||||
m.SourcePower = ui->SourcePower->currentIndex();
|
||||
m.SourceFrequency = ui->SourceFrequency->value();
|
||||
m.SourceAmplifierEN = ui->SourceAmplifierEnable->isChecked();
|
||||
m.attenuator = -ui->Attenuator->value() / 0.25;
|
||||
// LO
|
||||
m.LOCE = ui->LOCE->isChecked();
|
||||
m.LORFEN = ui->LORFEN->isChecked();
|
||||
m.LOAmplifierEN = ui->LOAmplifierEnable->isChecked();
|
||||
m.LOexternal = ui->LOExternal->isChecked();
|
||||
m.LOFrequency = ui->LOFrequency->value();
|
||||
|
||||
// Acquisition
|
||||
m.PortEN = ui->Port1Enable->isChecked();
|
||||
m.PortGain = ui->portgain->currentIndex();
|
||||
m.RefEN = ui->RefEnable->isChecked();
|
||||
m.RefGain = ui->refgain->currentIndex();
|
||||
m.Samples = ui->Samples->value();
|
||||
m.WindowType = ui->cbWindow->currentIndex();
|
||||
|
||||
qDebug() << "Updating manual control state";
|
||||
|
||||
dev.SendPacket(p);
|
||||
}
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
#ifndef MANUALCONTROLDIALOGVFF_H
|
||||
#define MANUALCONTROLDIALOGVFF_H
|
||||
|
||||
#include "librevnadriver.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <complex>
|
||||
|
||||
namespace Ui {
|
||||
class ManualControlDialogVFF;
|
||||
}
|
||||
|
||||
class ManualControlDialogVFF : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ManualControlDialogVFF(LibreVNADriver &dev, QWidget *parent = nullptr);
|
||||
~ManualControlDialogVFF();
|
||||
|
||||
void setSourceChipEnable(bool enable);
|
||||
bool getSourceChipEnable();
|
||||
void setSourceRFEnable(bool enable);
|
||||
bool getSourceRFEnable();
|
||||
bool getSourceLocked();
|
||||
bool setSourcePower(double dBm);
|
||||
double getSourcePower();
|
||||
void setSourceFrequency(double f);
|
||||
double getSourceFrequency();
|
||||
|
||||
void setAttenuator(double att);
|
||||
double getAttenuator();
|
||||
void setSourceAmplifierEnable(bool enable);
|
||||
bool getSourceAmplifierEnable();
|
||||
void setLOAmplifierEnable(bool enable);
|
||||
bool getLOAmplifierEnable();
|
||||
|
||||
void setLOPath(bool external);
|
||||
bool getLOPath();
|
||||
|
||||
void setLOChipEnable(bool enable);
|
||||
bool getLOChipEnable();
|
||||
void setLORFEnable(bool enable);
|
||||
bool getLORFEnable();
|
||||
bool getLOLocked();
|
||||
void setLOFrequency(double f);
|
||||
double getLOFrequency();
|
||||
void setIFFrequency(double f);
|
||||
double getIFFrequency();
|
||||
void setPortEnable(bool enable);
|
||||
bool getPortEnable();
|
||||
void setRefEnable(bool enable);
|
||||
bool getRefEnable();
|
||||
|
||||
enum class Gain {
|
||||
G1 = 0,
|
||||
G10 = 1,
|
||||
G20 = 2,
|
||||
G30 = 3,
|
||||
G40 = 4,
|
||||
G60 = 5,
|
||||
G80 = 6,
|
||||
G120 = 7,
|
||||
G157 = 8,
|
||||
G0_25 = 9,
|
||||
};
|
||||
|
||||
void setPortGain(Gain g);
|
||||
Gain getPortGain();
|
||||
void setRefGain(Gain g);
|
||||
Gain getRefGain();
|
||||
|
||||
void setNumSamples(int samples);
|
||||
int getNumSamples();
|
||||
|
||||
enum class Window {
|
||||
None = 0,
|
||||
Kaiser = 1,
|
||||
Hann = 2,
|
||||
FlatTop = 3
|
||||
};
|
||||
|
||||
void setWindow(Window w);
|
||||
Window getWindow();
|
||||
|
||||
int getPortMinADC();
|
||||
int getPortMaxADC();
|
||||
double getPortMagnitude();
|
||||
double getPortPhase();
|
||||
std::complex<double> getPortReferenced();
|
||||
|
||||
int getRefMinADC();
|
||||
int getRefMaxADC();
|
||||
double getRefMagnitude();
|
||||
double getRefPhase();
|
||||
|
||||
public slots:
|
||||
void NewStatus(Protocol::ManualStatus status);
|
||||
|
||||
private:
|
||||
void UpdateDevice();
|
||||
Ui::ManualControlDialogVFF *ui;
|
||||
LibreVNADriver &dev;
|
||||
std::complex<double> portreferenced;
|
||||
};
|
||||
|
||||
#endif // MANUALCONTROLDIALOGVFF_H
|
||||
|
|
@ -0,0 +1,676 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ManualControlDialogVFF</class>
|
||||
<widget class="QDialog" name="ManualControlDialogVFF">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>724</width>
|
||||
<height>464</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Manual System Control</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_10">
|
||||
<property name="title">
|
||||
<string>Signal Generation</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Source</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="SourceCE">
|
||||
<property name="text">
|
||||
<string>Chip Enable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="SourceRFEN">
|
||||
<property name="text">
|
||||
<string>RF Enable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="SourceLocked">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Locked</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Power:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="SourcePower">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>-1dBm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>+1dBm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>+2.5dBm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>+3.5dBm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>+4.5dBm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>+5.5dBm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>+6.5dBm</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>+7dBm</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Frequency:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="SIUnitEdit" name="SourceFrequency"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_4">
|
||||
<property name="title">
|
||||
<string>Attenuator</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="Attenuator">
|
||||
<property name="suffix">
|
||||
<string>db</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-31.750000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.250000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_5">
|
||||
<property name="title">
|
||||
<string>Amplifier</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_11">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="SourceAmplifierEnable">
|
||||
<property name="text">
|
||||
<string>Enable</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_11">
|
||||
<property name="title">
|
||||
<string>Signal Analysis</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_7">
|
||||
<property name="title">
|
||||
<string>LO</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6" stretch="0,0">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="LOCE">
|
||||
<property name="text">
|
||||
<string>Chip Enable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="LORFEN">
|
||||
<property name="text">
|
||||
<string>RF Enable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="LOlocked">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Locked</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Freq. Type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="LOFreqType">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>IF</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Absolute</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Frequency:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="SIUnitEdit" name="LOFrequency">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>IF1:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="SIUnitEdit" name="IF"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_6">
|
||||
<property name="title">
|
||||
<string>Amplifier</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="LOAmplifierEnable">
|
||||
<property name="text">
|
||||
<string>Enable</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Path</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="LOInternal">
|
||||
<property name="text">
|
||||
<string>Internal</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="LOExternal">
|
||||
<property name="text">
|
||||
<string>External</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_9">
|
||||
<property name="title">
|
||||
<string>Aquisition</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="Port1Enable">
|
||||
<property name="text">
|
||||
<string>Port Enable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="RefEnable">
|
||||
<property name="text">
|
||||
<string>Reference Enable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_5">
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="portgain">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>10V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>20V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>30V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>40V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>60V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>80V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>120V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>157V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>0.25V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="refgain">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>10V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>20V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>30V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>40V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>60V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>80V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>120V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>157V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>0.25V/V</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Samples:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="Samples">
|
||||
<property name="minimum">
|
||||
<number>96</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>32000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>32000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>Window:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="cbWindow">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>None</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Kaiser</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Hann</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Flat Top</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Reference PGA gain:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Port PGA gain:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_12">
|
||||
<property name="title">
|
||||
<string>Measurements</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_16">
|
||||
<property name="title">
|
||||
<string>Port</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_19">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_9">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_25">
|
||||
<property name="text">
|
||||
<string>ADC min:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="portmin"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_26">
|
||||
<property name="text">
|
||||
<string>ADC max:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="portmax"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_27">
|
||||
<property name="text">
|
||||
<string>Magnitude:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="portmag"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_28">
|
||||
<property name="text">
|
||||
<string>Phase:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="portphase"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Referenced:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="portreferenced"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_15">
|
||||
<property name="title">
|
||||
<string>Reference</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_18">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_8">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_21">
|
||||
<property name="text">
|
||||
<string>ADC min:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="refmin"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_22">
|
||||
<property name="text">
|
||||
<string>ADC max:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="refmax"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_23">
|
||||
<property name="text">
|
||||
<string>Magnitude:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="refmag"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_24">
|
||||
<property name="text">
|
||||
<string>Phase:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="refphase"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>SIUnitEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>CustomWidgets/siunitedit.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="buttonGroup"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
|
@ -23,6 +23,8 @@ HEADERS += \
|
|||
Device/LibreVNA/Compound/compounddeviceeditdialog.h \
|
||||
Device/LibreVNA/Compound/compounddriver.h \
|
||||
Device/LibreVNA/amplitudecaldialog.h \
|
||||
Device/LibreVNA/deviceconfigurationdialogv1.h \
|
||||
Device/LibreVNA/deviceconfigurationdialogvff.h \
|
||||
Device/LibreVNA/devicepacketlog.h \
|
||||
Device/LibreVNA/devicepacketlogview.h \
|
||||
Device/LibreVNA/firmwareupdatedialog.h \
|
||||
|
|
@ -30,7 +32,8 @@ HEADERS += \
|
|||
Device/LibreVNA/librevnadriver.h \
|
||||
Device/LibreVNA/librevnatcpdriver.h \
|
||||
Device/LibreVNA/librevnausbdriver.h \
|
||||
Device/LibreVNA/manualcontroldialog.h \
|
||||
Device/LibreVNA/manualcontroldialogV1.h \
|
||||
Device/LibreVNA/manualcontroldialogvff.h \
|
||||
Device/LibreVNA/receivercaldialog.h \
|
||||
Device/LibreVNA/sourcecaldialog.h \
|
||||
Device/SSA3000X/ssa3000xdriver.h \
|
||||
|
|
@ -177,6 +180,8 @@ SOURCES += \
|
|||
Device/LibreVNA/Compound/compounddeviceeditdialog.cpp \
|
||||
Device/LibreVNA/Compound/compounddriver.cpp \
|
||||
Device/LibreVNA/amplitudecaldialog.cpp \
|
||||
Device/LibreVNA/deviceconfigurationdialogv1.cpp \
|
||||
Device/LibreVNA/deviceconfigurationdialogvff.cpp \
|
||||
Device/LibreVNA/devicepacketlog.cpp \
|
||||
Device/LibreVNA/devicepacketlogview.cpp \
|
||||
Device/LibreVNA/firmwareupdatedialog.cpp \
|
||||
|
|
@ -184,7 +189,8 @@ SOURCES += \
|
|||
Device/LibreVNA/librevnadriver.cpp \
|
||||
Device/LibreVNA/librevnatcpdriver.cpp \
|
||||
Device/LibreVNA/librevnausbdriver.cpp \
|
||||
Device/LibreVNA/manualcontroldialog.cpp \
|
||||
Device/LibreVNA/manualcontroldialogV1.cpp \
|
||||
Device/LibreVNA/manualcontroldialogvff.cpp \
|
||||
Device/LibreVNA/receivercaldialog.cpp \
|
||||
Device/LibreVNA/sourcecaldialog.cpp \
|
||||
Device/SSA3000X/ssa3000xdriver.cpp \
|
||||
|
|
@ -321,11 +327,14 @@ FORMS += \
|
|||
Device/LibreVNA/addamplitudepointsdialog.ui \
|
||||
Device/LibreVNA/amplitudecaldialog.ui \
|
||||
Device/LibreVNA/automaticamplitudedialog.ui \
|
||||
Device/LibreVNA/deviceconfigurationdialogv1.ui \
|
||||
Device/LibreVNA/deviceconfigurationdialogvff.ui \
|
||||
Device/LibreVNA/devicepacketlogview.ui \
|
||||
Device/LibreVNA/firmwareupdatedialog.ui \
|
||||
Device/LibreVNA/frequencycaldialog.ui \
|
||||
Device/LibreVNA/librevnadriversettingswidget.ui \
|
||||
Device/LibreVNA/manualcontroldialog.ui \
|
||||
Device/LibreVNA/manualcontroldialogV1.ui \
|
||||
Device/LibreVNA/manualcontroldialogvff.ui \
|
||||
Device/devicelog.ui \
|
||||
Device/devicetcpdriversettings.ui \
|
||||
Generator/signalgenwidget.ui \
|
||||
|
|
|
|||
|
|
@ -351,6 +351,7 @@ void SpectrumAnalyzer::initializeDevice()
|
|||
connect(window->getDevice(), &DeviceDriver::SAmeasurementReceived, this, &SpectrumAnalyzer::NewDatapoint, Qt::UniqueConnection);
|
||||
|
||||
// Configure initial state of device
|
||||
ConstrainAndUpdateFrequencies();
|
||||
SettingsChanged();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -724,6 +724,7 @@ void VNA::initializeDevice()
|
|||
removeDefaultCal->setEnabled(false);
|
||||
}
|
||||
// Configure initial state of device
|
||||
ConstrainAndUpdateFrequencies();
|
||||
SettingsChanged();
|
||||
emit deviceInitialized();
|
||||
if(window->getDevice() && !cal.validForDevice(window->getDevice()->getSerial())) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue