diff --git a/fast-servo/linien-gui-add-afe_gain-combo-boxes.patch b/fast-servo/linien-gui-add-afe_gain-combo-boxes.patch new file mode 100644 index 0000000..4d353e9 --- /dev/null +++ b/fast-servo/linien-gui-add-afe_gain-combo-boxes.patch @@ -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 @@ + + + ++ ++ ++ ++ ++ ++ <html><head/><body><p><span style=" font-weight:600;">FAST IN 1 GAIN</span></p></body></html> ++ ++ ++ Qt::AutoText ++ ++ ++ ++ ++ ++ ++ ++ 0 ++ 0 ++ ++ ++ ++ ++ 1x ++ ++ ++ ++ ++ 10x ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ <html><head/><body><p><span style=" font-weight:600;">FAST IN 2 GAIN</span></p></body></html> ++ ++ ++ Qt::AutoText ++ ++ ++ ++ ++ ++ ++ ++ 0 ++ 0 ++ ++ ++ ++ ++ 1x ++ ++ ++ ++ ++ 10x ++ ++ ++ ++ ++ ++ + + + diff --git a/flake.nix b/flake.nix index f1a7d50..24f12ed 100644 --- a/flake.nix +++ b/flake.nix @@ -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