added checkboxes for different images

This commit is contained in:
2026-06-10 10:55:41 +02:00
parent 8172bf2a25
commit 773a19ffca
3 changed files with 113 additions and 51 deletions
+21
View File
@@ -52,6 +52,13 @@ class PlotTab(QtWidgets.QWidget):
self.adcTab = self.mainWindow.adcTab
self.initializeColorMaps()
# TODO use list comprehension
self.checkBoxCounters = [self.view.checkBoxCounter0, self.view.checkBoxCounter1, self.view.checkBoxCounter2, self.view.checkBoxCounter3]
for checkBox in self.checkBoxCounters:
checkBox.setChecked(True)
checkBox.setEnabled(True)
self.imagePlots = (
self.mainWindow.plotAnalogImage,
self.mainWindow.plotDigitalImage,
@@ -94,6 +101,11 @@ class PlotTab(QtWidgets.QWidget):
self.view.radioButtonFixed.clicked.connect(partial(self.setColorRangeMode, Defines.colorRange.fixed))
self.view.radioButtonCenter.clicked.connect(partial(self.setColorRangeMode, Defines.colorRange.center))
# TODO: need to disable for all but matterhorn/non transceiver I guess, need to be disabled
# shown counters
for index, checkBox in enumerate(self.checkBoxCounters):
checkBox.stateChanged.connect(partial(self.displayCounter, index))
# show image Values for analog image
nMaxY = lambda : self.mainWindow.nAnalogRows
nMaxX = lambda : self.mainWindow.nAnalogCols
@@ -121,6 +133,15 @@ class PlotTab(QtWidgets.QWidget):
self.view.checkBoxShowLegend.stateChanged.connect(self.toggleLegend)
def displayCounter(self, index : int, state : int):
# toggle the display of the counter i and update the splitter
self.transceiverTab.shownCounters[index] = (state == QtCore.Qt.Checked)
self.transceiverTab.update_ImageSplitter()
def enableCounterCheckBox(self, index : int, enabled : bool):
self.checkBoxCounters[index].setEnabled(enabled)
def refresh(self):
self.getZMQHWM()
+5 -2
View File
@@ -182,9 +182,12 @@ class TransceiverTab(QtWidgets.QWidget):
def update_numCounters(self, num_counters):
# update the number of counters and adjust the image splitter accordingly
self.nCounters = num_counters
self.shownCounters = [i < self.nCounters for i in range(Defines.transceiver.maxcount)]
self.update_ImageSplitter()
for i in range(Defines.transceiver.maxcount):
self.shownCounters[i] = i < self.nCounters
self.plotTab.enableCounterCheckBox(i, self.shownCounters[i])
def update_ImageSplitter(self):
for i, showncounter in enumerate(self.shownCounters):
self.transceiverImageViews[i].setVisible(showncounter)
+87 -49
View File
@@ -25,7 +25,7 @@
<x>10</x>
<y>50</y>
<width>841</width>
<height>141</height>
<height>161</height>
</rect>
</property>
<property name="frameShape">
@@ -45,19 +45,6 @@
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QRadioButton" name="radioButtonDistribution">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Distribution</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
@@ -71,6 +58,32 @@
</property>
</spacer>
</item>
<item row="3" column="1" colspan="2">
<widget class="QComboBox" name="comboBoxZMQHWM">
<property name="enabled">
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>31</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If set to high readout, zmq HWM is set to 2 and buffer size to 1MB to drop zmq packets to catch up.&lt;/p&gt;&lt;p&gt;If set to low readout (default), zmq HWM is set to zmq default (1000) and buffer size to os default to not drop any zmq packets.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Low - drop no zmq packet</string>
</property>
</item>
<item>
<property name="text">
<string>High - drop zmq packets to catch up</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1" colspan="4">
<widget class="QStackedWidget" name="stackedWidgetPlotType">
<property name="currentIndex">
@@ -273,11 +286,20 @@
</widget>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelPlotOptions">
<property name="text">
<string>Options:</string>
<item row="0" column="2">
<widget class="QRadioButton" name="radioButtonWaveform">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Waveform</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item row="0" column="1">
@@ -296,30 +318,24 @@
</attribute>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QComboBox" name="comboBoxZMQHWM">
<item row="0" column="3">
<widget class="QRadioButton" name="radioButtonDistribution">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>31</height>
</size>
<property name="text">
<string>Distribution</string>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If set to high readout, zmq HWM is set to 2 and buffer size to 1MB to drop zmq packets to catch up.&lt;/p&gt;&lt;p&gt;If set to low readout (default), zmq HWM is set to zmq default (1000) and buffer size to os default to not drop any zmq packets.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelPlotOptions">
<property name="text">
<string>Options:</string>
</property>
<item>
<property name="text">
<string>Low - drop no zmq packet</string>
</property>
</item>
<item>
<property name="text">
<string>High - drop zmq packets to catch up</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0">
@@ -345,20 +361,42 @@
</attribute>
</widget>
</item>
<item row="0" column="2">
<widget class="QRadioButton" name="radioButtonWaveform">
<property name="enabled">
<bool>true</bool>
<item row="4" column="0">
<widget class="QLabel" name="labelCounters">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If set to high readout, zmq HWM is set to 2 and buffer size to 1MB to drop zmq packets to catch up.&lt;/p&gt;&lt;p&gt;If set to low readout (default), zmq HWM is set to zmq default (1000) and buffer size to os default to not drop any zmq packets.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Waveform</string>
<string>Counters:</string>
</property>
<property name="checked">
<bool>true</bool>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="checkBoxCounter0">
<property name="text">
<string>Counter 0</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QCheckBox" name="checkBoxCounter1">
<property name="text">
<string>Counter 1</string>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QCheckBox" name="checkBoxCounter2">
<property name="text">
<string>Counter 2</string>
</property>
</widget>
</item>
<item row="4" column="4">
<widget class="QCheckBox" name="checkBoxCounter3">
<property name="text">
<string>Counter 3</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
</layout>
@@ -1078,8 +1116,8 @@
<connections/>
<buttongroups>
<buttongroup name="buttonGroup_2"/>
<buttongroup name="buttonGroup_4"/>
<buttongroup name="buttonGroup"/>
<buttongroup name="buttonGroup_4"/>
<buttongroup name="buttonGroup_3"/>
</buttongroups>
</ui>