nix-servo/fast-servo/linien-gui-add-afe_gain-combo-boxes.patch

133 lines
5.3 KiB
Diff

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>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;FAST IN 1 GAIN&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;FAST IN 2 GAIN&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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">