VFF device config update
This commit is contained in:
parent
e05df7ef19
commit
a0c45d3c56
@ -40,6 +40,11 @@ DeviceConfigurationDialogVFF::DeviceConfigurationDialogVFF(LibreVNADriver &dev,
|
||||
}
|
||||
});
|
||||
|
||||
connect(ui->autogain, &QCheckBox::toggled, this, [=](){
|
||||
ui->portgain->setEnabled(!ui->autogain->isChecked());
|
||||
ui->refgain->setEnabled(!ui->autogain->isChecked());
|
||||
});
|
||||
|
||||
dev.sendWithoutPayload(Protocol::PacketType::RequestDeviceConfiguration);
|
||||
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, [=](){
|
||||
@ -66,6 +71,10 @@ void DeviceConfigurationDialogVFF::updateGUI(const Protocol::DeviceConfig &c)
|
||||
ui->mask->setText(mask.toString());
|
||||
gateway = QHostAddress(qFromBigEndian(c.VFF.gw));
|
||||
ui->gateway->setText(gateway.toString());
|
||||
|
||||
ui->autogain->setChecked(c.VFF.autogain);
|
||||
ui->portgain->setCurrentIndex(c.VFF.portGain);
|
||||
ui->refgain->setCurrentIndex(c.VFF.refGain);
|
||||
}
|
||||
|
||||
void DeviceConfigurationDialogVFF::updateDevice()
|
||||
@ -76,5 +85,9 @@ void DeviceConfigurationDialogVFF::updateDevice()
|
||||
p.deviceConfig.VFF.ip = qToBigEndian(ip.toIPv4Address());
|
||||
p.deviceConfig.VFF.mask = qToBigEndian(mask.toIPv4Address());
|
||||
p.deviceConfig.VFF.gw = qToBigEndian(gateway.toIPv4Address());
|
||||
|
||||
p.deviceConfig.VFF.autogain = ui->autogain->isChecked() ? 1 : 0;
|
||||
p.deviceConfig.VFF.portGain = ui->portgain->currentIndex();
|
||||
p.deviceConfig.VFF.refGain = ui->refgain->currentIndex();
|
||||
dev.SendPacket(p);
|
||||
}
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>389</width>
|
||||
<height>224</height>
|
||||
<width>318</width>
|
||||
<height>344</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -17,7 +17,7 @@
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Address configuration</string>
|
||||
<string>Address configuration (permanently stored in device)</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
@ -69,6 +69,148 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>PGA configuration (reset after reboot)</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="autogain">
|
||||
<property name="text">
|
||||
<string>Autogain</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Port gain:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<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="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Reference gain:</string>
|
||||
</property>
|
||||
</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>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
|
@ -327,6 +327,9 @@ void DevicePacketLogView::addEntry(const DevicePacketLog::LogEntry &e)
|
||||
addString(VFF, "IP", QHostAddress(qFromBigEndian(sFF.ip)).toString());
|
||||
addString(VFF, "Mask", QHostAddress(qFromBigEndian(sFF.mask)).toString());
|
||||
addString(VFF, "Gateway", QHostAddress(qFromBigEndian(sFF.gw)).toString());
|
||||
addBool(VFF, "PGA autogain", sFF.autogain);
|
||||
addInteger(VFF, "Port gain", sFF.portGain);
|
||||
addInteger(VFF, "Reference gain", sFF.refGain);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -384,10 +384,13 @@ using DeviceConfig = struct _deviceconfig {
|
||||
uint16_t DFTphaseInc;
|
||||
} V1;
|
||||
struct {
|
||||
uint32_t ip;
|
||||
uint32_t mask;
|
||||
uint32_t gw;
|
||||
uint8_t dhcp :1;
|
||||
uint32_t ip;
|
||||
uint32_t mask;
|
||||
uint32_t gw;
|
||||
uint16_t dhcp :1;
|
||||
uint16_t autogain :1;
|
||||
uint16_t portGain :4;
|
||||
uint16_t refGain :4;
|
||||
} VFF;
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user