forked from M-Labs/nix-servo
gui: add afe gain combo boxes for gain selection
This commit is contained in:
parent
2618724aeb
commit
a3eb78d39a
132
fast-servo/linien-gui-add-afe_gain-combo-boxes.patch
Normal file
132
fast-servo/linien-gui-add-afe_gain-combo-boxes.patch
Normal file
@ -0,0 +1,132 @@
|
||||
diff --git a/linien-gui/linien_gui/ui/general_panel.py b/linien-gui/linien_gui/ui/general_panel.py
|
||||
index cad2d91..499146d 100644
|
||||
--- a/linien-gui/linien_gui/ui/general_panel.py
|
||||
+++ b/linien-gui/linien_gui/ui/general_panel.py
|
||||
@@ -48,6 +48,8 @@ class GeneralPanel(QtWidgets.QWidget):
|
||||
polarityContainerFastOut2: QtWidgets.QWidget
|
||||
polarityComboBoxFastOut2: QtWidgets.QComboBox
|
||||
modulationChannelComboBox: QtWidgets.QComboBox
|
||||
+ afeGainComboBoxFastIn1: QtWidgets.QComboBox
|
||||
+ afeGainComboBoxFastIn2: QtWidgets.QComboBox
|
||||
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
super(GeneralPanel, self).__init__(*args, **kwargs)
|
||||
@@ -80,6 +82,14 @@ class GeneralPanel(QtWidgets.QWidget):
|
||||
self.on_polarity_analog_out0_changed
|
||||
)
|
||||
|
||||
+ self.afeGainComboBoxFastIn1.currentIndexChanged.connect(
|
||||
+ self.on_afe_gain_in1_changed
|
||||
+ )
|
||||
+
|
||||
+ self.afeGainComboBoxFastIn2.currentIndexChanged.connect(
|
||||
+ self.on_afe_gain_in2_changed
|
||||
+ )
|
||||
+
|
||||
for idx in range(1, 4):
|
||||
element: CustomDoubleSpinBoxNoSign = getattr(
|
||||
self, f"analogOutComboBox{idx}"
|
||||
@@ -126,6 +136,9 @@ class GeneralPanel(QtWidgets.QWidget):
|
||||
param2ui(self.parameters.polarity_fast_out2, self.polarityComboBoxFastOut2)
|
||||
param2ui(self.parameters.polarity_analog_out0, self.polarityComboBoxAnalogOut0)
|
||||
|
||||
+ param2ui(self.parameters.adc_afe_10x_gain_1, self.afeGainComboBoxFastIn1)
|
||||
+ param2ui(self.parameters.adc_afe_10x_gain_2, self.afeGainComboBoxFastIn2)
|
||||
+
|
||||
self.parameters.control_channel.add_callback(self.show_polarity_settings)
|
||||
self.parameters.sweep_channel.add_callback(self.show_polarity_settings)
|
||||
self.parameters.mod_channel.add_callback(self.show_polarity_settings)
|
||||
@@ -211,6 +224,14 @@ class GeneralPanel(QtWidgets.QWidget):
|
||||
self.parameters.polarity_analog_out0.value = bool(polarity)
|
||||
self.control.write_registers()
|
||||
|
||||
+ def on_afe_gain_in1_changed(self, polarity):
|
||||
+ self.parameters.adc_afe_10x_gain_1.value = bool(polarity)
|
||||
+ self.control.write_registers()
|
||||
+
|
||||
+ def on_afe_gain_in2_changed(self, polarity):
|
||||
+ self.parameters.adc_afe_10x_gain_2.value = bool(polarity)
|
||||
+ self.control.write_registers()
|
||||
+
|
||||
def show_polarity_settings(self, *args):
|
||||
used_channels = {
|
||||
self.parameters.control_channel.value,
|
||||
diff --git a/linien-gui/linien_gui/ui/general_panel.ui b/linien-gui/linien_gui/ui/general_panel.ui
|
||||
index 6c2bd45..79f4580 100644
|
||||
--- a/linien-gui/linien_gui/ui/general_panel.ui
|
||||
+++ b/linien-gui/linien_gui/ui/general_panel.ui
|
||||
@@ -508,6 +508,74 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
+ <item>
|
||||
+ <layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||
+ <item>
|
||||
+ <widget class="QLabel" name="label_22">
|
||||
+ <property name="text">
|
||||
+ <string><html><head/><body><p><span style=" font-weight:600;">FAST IN 1 GAIN</span></p></body></html></string>
|
||||
+ </property>
|
||||
+ <property name="textFormat">
|
||||
+ <enum>Qt::AutoText</enum>
|
||||
+ </property>
|
||||
+ </widget>
|
||||
+ </item>
|
||||
+ <item>
|
||||
+ <widget class="QComboBox" name="afeGainComboBoxFastIn1">
|
||||
+ <property name="sizePolicy">
|
||||
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
+ <horstretch>0</horstretch>
|
||||
+ <verstretch>0</verstretch>
|
||||
+ </sizepolicy>
|
||||
+ </property>
|
||||
+ <item>
|
||||
+ <property name="text">
|
||||
+ <string>1x</string>
|
||||
+ </property>
|
||||
+ </item>
|
||||
+ <item>
|
||||
+ <property name="text">
|
||||
+ <string>10x</string>
|
||||
+ </property>
|
||||
+ </item>
|
||||
+ </widget>
|
||||
+ </item>
|
||||
+ </layout>
|
||||
+ </item>
|
||||
+ <item>
|
||||
+ <layout class="QHBoxLayout" name="horizontalLayout_14">
|
||||
+ <item>
|
||||
+ <widget class="QLabel" name="label_24">
|
||||
+ <property name="text">
|
||||
+ <string><html><head/><body><p><span style=" font-weight:600;">FAST IN 2 GAIN</span></p></body></html></string>
|
||||
+ </property>
|
||||
+ <property name="textFormat">
|
||||
+ <enum>Qt::AutoText</enum>
|
||||
+ </property>
|
||||
+ </widget>
|
||||
+ </item>
|
||||
+ <item>
|
||||
+ <widget class="QComboBox" name="afeGainComboBoxFastIn2">
|
||||
+ <property name="sizePolicy">
|
||||
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
+ <horstretch>0</horstretch>
|
||||
+ <verstretch>0</verstretch>
|
||||
+ </sizepolicy>
|
||||
+ </property>
|
||||
+ <item>
|
||||
+ <property name="text">
|
||||
+ <string>1x</string>
|
||||
+ </property>
|
||||
+ </item>
|
||||
+ <item>
|
||||
+ <property name="text">
|
||||
+ <string>10x</string>
|
||||
+ </property>
|
||||
+ </item>
|
||||
+ </widget>
|
||||
+ </item>
|
||||
+ </layout>
|
||||
+ </item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="dualChannelMixingGroupBox">
|
||||
<property name="title">
|
@ -31,6 +31,7 @@
|
||||
./fast-servo/linien-common-fast-servo-hardware-specific.patch
|
||||
./fast-servo/linien-server-fast-servo-hardware-specific.patch
|
||||
./fast-servo/linien-gui-fast-servo-hardware-specific.patch
|
||||
./fast-servo/linien-gui-add-afe_gain-combo-boxes.patch
|
||||
./fast-servo/linien-client-ssh-port-change.patch
|
||||
./fast-servo/linien-server-fast-servo.patch
|
||||
./fast-servo/linien-server-cli.patch
|
||||
|
Loading…
Reference in New Issue
Block a user