diff --git a/pyctbgui/pyctbgui/services/Acquisition.py b/pyctbgui/pyctbgui/services/Acquisition.py index b32b8a659..dcf06707d 100644 --- a/pyctbgui/pyctbgui/services/Acquisition.py +++ b/pyctbgui/pyctbgui/services/Acquisition.py @@ -133,6 +133,7 @@ class AcquisitionTab(QtWidgets.QWidget): self.view.labelDigital.setDisabled(True) self.view.labelTransceiver.setDisabled(True) self.view.spinBoxTransceiver.setDisabled(True) + self.plotTab.enableallCounterCheckBox(False) case readoutMode.DIGITAL_ONLY: self.view.spinBoxAnalog.setDisabled(True) self.view.labelAnalog.setDisabled(True) @@ -140,6 +141,7 @@ class AcquisitionTab(QtWidgets.QWidget): self.view.labelDigital.setEnabled(True) self.view.labelTransceiver.setDisabled(True) self.view.spinBoxTransceiver.setDisabled(True) + self.plotTab.enableallCounterCheckBox(False) case readoutMode.ANALOG_AND_DIGITAL: self.view.spinBoxAnalog.setEnabled(True) self.view.labelAnalog.setEnabled(True) @@ -147,6 +149,7 @@ class AcquisitionTab(QtWidgets.QWidget): self.view.labelDigital.setEnabled(True) self.view.labelTransceiver.setDisabled(True) self.view.spinBoxTransceiver.setDisabled(True) + self.plotTab.enableallCounterCheckBox(False) case readoutMode.TRANSCEIVER_ONLY: self.view.spinBoxAnalog.setDisabled(True) self.view.labelAnalog.setDisabled(True) @@ -154,6 +157,7 @@ class AcquisitionTab(QtWidgets.QWidget): self.view.labelDigital.setDisabled(True) self.view.labelTransceiver.setEnabled(True) self.view.spinBoxTransceiver.setEnabled(True) + self.plotTab.enableallCounterCheckBox(self.plotTab.view.radioButtonImage.isChecked()) # enable counter checkboxes for matterhorn case _: self.view.spinBoxAnalog.setDisabled(True) self.view.labelAnalog.setDisabled(True) @@ -161,6 +165,7 @@ class AcquisitionTab(QtWidgets.QWidget): self.view.labelDigital.setEnabled(True) self.view.labelTransceiver.setEnabled(True) self.view.spinBoxTransceiver.setEnabled(True) + self.plotTab.enableallCounterCheckBox(self.plotTab.view.radioButtonImage.isChecked()) # enable counter checkboxes for matterhorn self.view.comboBoxROMode.currentIndexChanged.connect(self.setReadOut) self.view.spinBoxAnalog.editingFinished.connect(self.setAnalog) diff --git a/pyctbgui/pyctbgui/services/Plot.py b/pyctbgui/pyctbgui/services/Plot.py index a14ef1a0a..2b66e71f5 100644 --- a/pyctbgui/pyctbgui/services/Plot.py +++ b/pyctbgui/pyctbgui/services/Plot.py @@ -4,7 +4,7 @@ import random from pathlib import Path import numpy as np -from PyQt5 import QtWidgets, QtGui, uic +from PyQt5 import QtWidgets, QtGui, QtCore, uic from aare import transform, ReadoutMode from aare._aare import Matterhorn10, Matterhorn02, Moench04 @@ -43,6 +43,7 @@ class PlotTab(QtWidgets.QWidget): self.pedestalApply: bool = True self.__acqFrames = None self.logger = logging.getLogger('PlotTab') + self.plotSplitter = None def setup_ui(self): self.signalsTab = self.mainWindow.signalsTab @@ -51,10 +52,17 @@ 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(False) + checkBox.setEnabled(False) + self.imagePlots = ( self.mainWindow.plotAnalogImage, self.mainWindow.plotDigitalImage, - self.mainWindow.plotTransceiverImage, + self.transceiverTab.transceiverImageViews, ) def connect_ui(self): @@ -93,12 +101,54 @@ 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)) - for plot in self.imagePlots: - plot.scene.sigMouseMoved.connect(partial(self.showPlotValues, plot)) - plot.getHistogramWidget().item.sigLevelChangeFinished.connect(partial(self.handleHistogramChange, plot)) + 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 + frame = lambda : self.mainWindow.analog_frame + plot = self.mainWindow.plotAnalogImage + plot.scene.sigMouseMoved.connect(partial(self.showPlotValues, plot, nMaxX, nMaxY, frame)) + plot.getHistogramWidget().item.sigLevelChangeFinished.connect(partial(self.handleHistogramChange, plot)) + + # show image Values for digital image + nMaxY = lambda : self.mainWindow.nDigitalRows + nMaxX = lambda : self.mainWindow.nDigitalCols + frame = lambda : self.mainWindow.digital_frame + plot = self.mainWindow.plotDigitalImage + plot.scene.sigMouseMoved.connect(partial(self.showPlotValues, plot, nMaxX, nMaxY, frame)) + plot.getHistogramWidget().item.sigLevelChangeFinished.connect(partial(self.handleHistogramChange, plot)) + + # show image Values for transceiver image + nMaxY = lambda : self.transceiverTab.nTransceiverRows + nMaxX = lambda : self.transceiverTab.nTransceiverCols + + for index, image_view in enumerate(self.transceiverTab.transceiverImageViews): + frame = lambda : image_view.getImageItem().image + image_view.scene.sigMouseMoved.connect(partial(self.showPlotValues, image_view, nMaxX, nMaxY, frame)) + image_view.getHistogramWidget().item.sigLevelChangeFinished.connect(partial(self.handleHistogramChange, image_view)) 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 setCounterCheckBox(self, index : int, check : bool): + self.checkBoxCounters[index].setChecked(check) + + def enableCounterCheckBox(self, index : int, enabled : bool): + is_transceiver = self.mainWindow.romode.value in [3, 4] + is_image = self.view.radioButtonImage.isChecked() + self.checkBoxCounters[index].setEnabled(enabled and is_transceiver and is_image) + + def enableallCounterCheckBox(self, enabled : bool): + for checkBox in self.checkBoxCounters: + checkBox.setEnabled(enabled) + def refresh(self): self.getZMQHWM() @@ -262,7 +312,11 @@ class PlotTab(QtWidgets.QWidget): updates UI views should be called after every change to cmin or cmax """ for plot in self.imagePlots: - plot.getHistogramWidget().item.setLevels(min=self.cmin, max=self.cmax) + if isinstance(plot, list): # hacky for now only transceiver image is a PlotSplitter + for p in plot: + p.getHistogramWidget().item.setLevels(min=self.cmin, max=self.cmax) + else: + plot.getHistogramWidget().item.setLevels(min=self.cmin, max=self.cmax) self.view.cminSpinBox.setValue(self.cmin) self.view.cmaxSpinBox.setValue(self.cmax) @@ -271,7 +325,9 @@ class PlotTab(QtWidgets.QWidget): # print(f'color map:{self.comboBoxColorMap.currentText()}') self.mainWindow.plotAnalogImage.setColorMap(cm) self.mainWindow.plotDigitalImage.setColorMap(cm) - self.mainWindow.plotTransceiverImage.setColorMap(cm) + for i, showncounter in enumerate(self.transceiverTab.shownCounters): + if showncounter: + self.transceiverTab.transceiverImageViews[i].setColorMap(cm) def getZMQHWM(self): @@ -343,11 +399,11 @@ class PlotTab(QtWidgets.QWidget): self.mainWindow.transceiverPlots[i].hide() def addAllSelectedTransceiverPlots(self): - for i in range(Defines.transceiver.count): + for i in range(Defines.transceiver.maxcount): self.addSelectedTransceiverPlots(i) def removeAllTransceiverPlots(self): - for i in range(Defines.transceiver.count): + for i in range(Defines.transceiver.maxcount): self.mainWindow.transceiverPlots[i].hide() def showPlot(self): @@ -356,7 +412,7 @@ class PlotTab(QtWidgets.QWidget): self.mainWindow.plotTransceiverWaveform.hide() self.mainWindow.plotAnalogImage.hide() self.mainWindow.plotDigitalImage.hide() - self.mainWindow.plotTransceiverImage.hide() + self.transceiverTab.transceiverImageSplitter.hide() self.view.labelDigitalWaveformOption.setDisabled(True) self.view.radioButtonOverlay.setDisabled(True) self.view.radioButtonStripe.setDisabled(True) @@ -379,7 +435,10 @@ class PlotTab(QtWidgets.QWidget): if self.view.radioButtonWaveform.isChecked(): self.mainWindow.plotTransceiverWaveform.show() elif self.view.radioButtonImage.isChecked(): - self.mainWindow.plotTransceiverImage.show() + for i, showncounter in enumerate(self.transceiverTab.shownCounters): + self.transceiverTab.transceiverImageViews[i].setVisible(showncounter) + + self.transceiverTab.transceiverImageSplitter.show() def plotOptions(self): @@ -404,14 +463,18 @@ class PlotTab(QtWidgets.QWidget): 'bottom', "Transceiver Sample [#]") self.view.stackedWidgetPlotType.setCurrentIndex(0) + self.enableallCounterCheckBox(False) # disable counter checkboxes for waveform elif self.view.radioButtonImage.isChecked(): self.view.stackedWidgetPlotType.setCurrentIndex(2) + is_transceiver = self.mainWindow.romode.value in [3, 4] + self.enableallCounterCheckBox(is_transceiver) # enable counter checkboxes for matterhorn self.setDecoder() if self.view.radioButtonNoPlot.isChecked(): self.view.labelPlotOptions.hide() self.view.stackedWidgetPlotType.hide() + self.enableallCounterCheckBox(False) # disable counter checkboxes when no plot is selected # enable plotting else: self.view.labelPlotOptions.show() @@ -419,40 +482,48 @@ class PlotTab(QtWidgets.QWidget): self.mainWindow.read_timer.start(Defines.Time_Plot_Refresh_ms) def setDecoder(self): + # TODO: really dont like to set attributes on the fly - hard to understand whats going on if self.view.comboBoxPlot.currentText() == "Matterhorn02": print("Initializing decoder for Matterhorn02") - self.mainWindow.nTransceiverRows = Matterhorn02.nRows - self.mainWindow.nTransceiverCols = Matterhorn02.nCols + self.transceiverTab.nTransceiverRows = Matterhorn02.nRows + self.transceiverTab.nTransceiverCols = Matterhorn02.nCols + self.transceiverTab.update_numCounters(1) self.mainWindow.decoder = transform.Matterhorn02TransceiverTransform() elif self.view.comboBoxPlot.currentText() == "Matterhorn1_16bit_1_counter": print("Initializing decoder for Matterhorn1 with 1 counter 16 bit dynamic range") - self.mainWindow.nTransceiverRows = Matterhorn10.nRows - self.mainWindow.nTransceiverCols = Matterhorn10.nCols + self.transceiverTab.nTransceiverRows = Matterhorn10.nRows + self.transceiverTab.nTransceiverCols = Matterhorn10.nCols + self.transceiverTab.update_numCounters(1) self.mainWindow.decoder = transform.Matterhorn10Transform(16, 1) elif self.view.comboBoxPlot.currentText() == "Matterhorn1_16bit_4_counters": print("Initializing decoder for Matterhorn1 with 4 counters 16 bit dynamic range") - self.mainWindow.nTransceiverRows = Matterhorn10.nRows*4 - self.mainWindow.nTransceiverCols = Matterhorn10.nCols + self.transceiverTab.nTransceiverRows = Matterhorn10.nRows + self.transceiverTab.nTransceiverCols = Matterhorn10.nCols + self.transceiverTab.update_numCounters(4) self.mainWindow.decoder = transform.Matterhorn10Transform(16, 4) elif self.view.comboBoxPlot.currentText() == "Matterhorn1_8bit_1_counter": print("Initializing decoder for Matterhorn1 with 1 counter 8 bit dynamic range") - self.mainWindow.nTransceiverRows = Matterhorn10.nRows - self.mainWindow.nTransceiverCols = Matterhorn10.nCols + self.transceiverTab.nTransceiverRows = Matterhorn10.nRows + self.transceiverTab.nTransceiverCols = Matterhorn10.nCols + self.transceiverTab.update_numCounters(1) self.mainWindow.decoder = transform.Matterhorn10Transform(8, 1) elif self.view.comboBoxPlot.currentText() == "Matterhorn1_8bit_4_counters": print("Initializing decoder for Matterhorn1 with 4 counters 8 bit dynamic range") - self.mainWindow.nTransceiverRows = Matterhorn10.nRows*4 - self.mainWindow.nTransceiverCols = Matterhorn10.nCols + self.transceiverTab.nTransceiverRows = Matterhorn10.nRows + self.transceiverTab.nTransceiverCols = Matterhorn10.nCols + self.transceiverTab.update_numCounters(4) self.mainWindow.decoder = transform.Matterhorn10Transform(8, 4) elif self.view.comboBoxPlot.currentText() == "Matterhorn1_4bit_4_counters": print("Initializing decoder for Matterhorn1 with 4 counters 4 bit dynamic range") - self.mainWindow.nTransceiverRows = Matterhorn10.nRows*4 - self.mainWindow.nTransceiverCols = Matterhorn10.nCols + self.transceiverTab.nTransceiverRows = Matterhorn10.nRows + self.transceiverTab.nTransceiverCols = Matterhorn10.nCols + self.transceiverTab.update_numCounters(4) self.mainWindow.decoder = transform.Matterhorn10Transform(4, 4) elif self.view.comboBoxPlot.currentText() == "Matterhorn1_4bit_1_counter": print("Initializing decoder for Matterhorn1 with 1 counter 4 bit dynamic range") - self.mainWindow.nTransceiverRows = Matterhorn10.nRows - self.mainWindow.nTransceiverCols = Matterhorn10.nCols + self.transceiverTab.nTransceiverRows = Matterhorn10.nRows + self.transceiverTab.nTransceiverCols = Matterhorn10.nCols + self.transceiverTab.update_numCounters(1) self.mainWindow.decoder = transform.Matterhorn10Transform(4, 1) elif self.view.comboBoxPlot.currentText() == "Moench04": self.mainWindow.nAnalogRows = Moench04.nRows @@ -533,21 +604,13 @@ class PlotTab(QtWidgets.QWidget): # get the RGB Values # print(color.getRgb()) - def showPlotValues(self, sender, pos): + def showPlotValues(self, sender, get_nMaxX, get_nMaxY, get_frame, pos): x = sender.getImageItem().mapFromScene(pos).x() y = sender.getImageItem().mapFromScene(pos).y() val = 0 - nMaxY = self.mainWindow.nAnalogRows - nMaxX = self.mainWindow.nAnalogCols - frame = self.mainWindow.analog_frame - if sender == self.mainWindow.plotDigitalImage: - nMaxY = self.mainWindow.nDigitalRows - nMaxX = self.mainWindow.nDigitalCols - frame = self.mainWindow.digital_frame - elif sender == self.mainWindow.plotTransceiverImage: - nMaxY = self.mainWindow.nTransceiverRows - nMaxX = self.mainWindow.nTransceiverCols - frame = self.mainWindow.transceiver_frame + nMaxX = get_nMaxX() + nMaxY = get_nMaxY() + frame = get_frame() if 0 <= x < nMaxX and 0 <= y < nMaxY and not np.array_equal(frame, []): val = frame[int(y), int(x)] message = f'[row, col]: [{y:.2f}, {x:.2f}] = {val:.2f}' diff --git a/pyctbgui/pyctbgui/services/Transceiver.py b/pyctbgui/pyctbgui/services/Transceiver.py index 13bb72fca..828decd26 100644 --- a/pyctbgui/pyctbgui/services/Transceiver.py +++ b/pyctbgui/pyctbgui/services/Transceiver.py @@ -2,7 +2,7 @@ from functools import partial from pathlib import Path import numpy as np -from PyQt5 import QtWidgets, uic +from PyQt5 import QtWidgets, QtCore, uic import pyqtgraph as pg from pyqtgraph import LegendItem @@ -24,11 +24,18 @@ class TransceiverTab(QtWidgets.QWidget): self.plotTab = None self.legend: LegendItem | None = None self.acquisitionTab = None - + self.nCounters: int = Defines.transceiver.maxcount + self.nTransceiverRows : int = 0 + self.nTransceiverCols : int = 0 + self.shownCounters: list[bool] = [True] * Defines.transceiver.maxcount # per default show all 4 counters + self.transceiverImageSplitter = QtWidgets.QSplitter(QtCore.Qt.Vertical) + self.transceiverImageViews : list = [] # pg image view for each counter + self.firstTransceiverImage : list[bool] = [True] * Defines.transceiver.maxcount # to keep track of first image for each counter to maintain zoom state + def setup_ui(self): self.plotTab = self.mainWindow.plotTab self.acquisitionTab = self.mainWindow.acquisitionTab - for i in range(Defines.transceiver.count): + for i in range(Defines.transceiver.maxcount): self.setTransceiverButtonColor(i, self.plotTab.getRandomColor()) self.initializeAllTransceiverPlots() @@ -39,7 +46,7 @@ class TransceiverTab(QtWidgets.QWidget): self.plotTab.subscribeToggleLegend(self.updateLegend) def connect_ui(self): - for i in range(Defines.transceiver.count): + for i in range(Defines.transceiver.maxcount): getattr(self.view, f"checkBoxTransceiver{i}").stateChanged.connect(partial(self.setTransceiverEnable, i)) getattr(self.view, f"checkBoxTransceiver{i}Plot").stateChanged.connect(partial(self.setTransceiverEnablePlot, i)) @@ -55,7 +62,7 @@ class TransceiverTab(QtWidgets.QWidget): """ enabledPlots = [] self.legend.clear() - for i in range(Defines.transceiver.count): + for i in range(Defines.transceiver.maxcount): if getattr(self.view, f'checkBoxTransceiver{i}Plot').isChecked(): plotName = getattr(self.view, f"labelTransceiver{i}").text() enabledPlots.append((self.mainWindow.transceiverPlots[i], plotName)) @@ -104,7 +111,7 @@ class TransceiverTab(QtWidgets.QWidget): trans_array = self._processWaveformData(data, dSamples, self.mainWindow.romode.value, self.mainWindow.nDBitEnabled, self.nTransceiverEnabled) idx = 0 - for i in range(Defines.transceiver.count): + for i in range(Defines.transceiver.maxcount): checkBoxPlot = getattr(self.view, f"checkBoxTransceiver{i}Plot") checkBoxEn = getattr(self.view, f"checkBoxTransceiver{i}") if checkBoxEn.isChecked() and checkBoxPlot.isChecked(): @@ -133,9 +140,7 @@ class TransceiverTab(QtWidgets.QWidget): transceiverOffset += nDBitEnabled * (nbitsPerDBit // 8) trans_array = np.array(np.frombuffer(data, offset=transceiverOffset, dtype=np.uint8)) - tmp = self.mainWindow.decoder(trans_array) - - return tmp + return self.mainWindow.decoder(trans_array) def processImageData(self, data, dSamples): """ @@ -145,28 +150,47 @@ class TransceiverTab(QtWidgets.QWidget): data: raw image data """ # get zoom state - viewBox = self.mainWindow.plotTransceiverImage.getView() - - state = viewBox.getState() + image_states = [image_view.getView().getState() for image_view in self.transceiverImageViews] + + transceiver_frame : np.ndarray = None try: - self.mainWindow.transceiver_frame = self._processImageData(data, dSamples, self.mainWindow.romode.value, + transceiver_frame = self._processImageData(data, dSamples, self.mainWindow.romode.value, self.mainWindow.nDBitEnabled) self.plotTab.ignoreHistogramSignal = True - self.mainWindow.plotTransceiverImage.setImage(self.mainWindow.transceiver_frame) + + for i in range(transceiver_frame.shape[0]): + self.transceiverImageViews[i].setImage(transceiver_frame[i]) except Exception as e: self.mainWindow.statusbar.setStyleSheet("color:red") self.acquisitionTab.updateCurrentFrame('Invalid Image') self.mainWindow.statusbar.showMessage(str(e)) print("Error: ", str(e)) - self.plotTab.setFrameLimits(self.mainWindow.transceiver_frame) + self.plotTab.setFrameLimits(transceiver_frame) # keep the zoomed in state (not 1st image) - if self.mainWindow.firstTransceiverImage: - self.mainWindow.firstTransceiverImage = False - else: - viewBox.setState(state) - return self.mainWindow.transceiver_frame + for idx, image_view in enumerate(self.transceiverImageViews): + if(self.firstTransceiverImage[idx] and self.shownCounters[idx]): + self.firstTransceiverImage[idx] = False + else: + image_view.getView().setState(image_states[idx]) + + return transceiver_frame + + def update_numCounters(self, num_counters): + # update the number of counters and adjust the image splitter accordingly + self.nCounters = num_counters + for i in range(Defines.transceiver.maxcount): + self.shownCounters[i] = i < self.nCounters + self.plotTab.setCounterCheckBox(i, self.shownCounters[i]) # check the counter checkbox + self.plotTab.enableCounterCheckBox(i, self.shownCounters[i]) # disable counter checkbox + + self.update_ImageSplitter() # update the splitter to show/hide image views based on the number of counters + + + def update_ImageSplitter(self): + for i, showncounter in enumerate(self.shownCounters): + self.transceiverImageViews[i].setVisible(showncounter) def initializeAllTransceiverPlots(self): self.mainWindow.plotTransceiverWaveform = pg.plot() @@ -174,7 +198,7 @@ class TransceiverTab(QtWidgets.QWidget): self.mainWindow.verticalLayoutPlot.addWidget(self.mainWindow.plotTransceiverWaveform, 5) self.mainWindow.transceiverPlots = {} waveform = np.zeros(1000) - for i in range(Defines.transceiver.count): + for i in range(Defines.transceiver.maxcount): pen = pg.mkPen(color=self.getTransceiverButtonColor(i), width=1) legendName = getattr(self.view, f"labelTransceiver{i}").text() self.mainWindow.transceiverPlots[i] = self.mainWindow.plotTransceiverWaveform.plot(waveform, @@ -182,16 +206,19 @@ class TransceiverTab(QtWidgets.QWidget): name=legendName) self.mainWindow.transceiverPlots[i].hide() - self.mainWindow.plotTransceiverImage = pg.ImageView() - self.mainWindow.nTransceiverRows = 0 - self.mainWindow.nTransceiverCols = 0 - self.mainWindow.transceiver_frame = np.zeros( - (self.mainWindow.nTransceiverRows, self.mainWindow.nTransceiverCols)) - self.mainWindow.plotTransceiverImage.setImage(self.mainWindow.transceiver_frame) - self.mainWindow.verticalLayoutPlot.addWidget(self.mainWindow.plotTransceiverImage, 6) - + # initialize image cm = pg.colormap.get('CET-L9') # prepare a linear color map - self.mainWindow.plotTransceiverImage.setColorMap(cm) + + for i in range(self.nCounters): + imageView = pg.ImageView() + imageView.setColorMap(cm) + self.transceiverImageViews.append(imageView) + self.transceiverImageSplitter.addWidget(imageView) + + self.update_ImageSplitter() # update the splitter + self.mainWindow.verticalLayoutPlot.addWidget(self.transceiverImageSplitter, 6) + + def getTransceiverEnableReg(self): retval = self.det.transceiverenable diff --git a/pyctbgui/pyctbgui/ui/plot.ui b/pyctbgui/pyctbgui/ui/plot.ui index 848d48f16..3abb75fb4 100644 --- a/pyctbgui/pyctbgui/ui/plot.ui +++ b/pyctbgui/pyctbgui/ui/plot.ui @@ -6,8 +6,8 @@ 0 0 - 860 - 800 + 1937 + 1104 @@ -25,7 +25,7 @@ 10 50 841 - 141 + 161 @@ -35,13 +35,10 @@ QFrame::Raised - - - - true - + + - Type: + Options: @@ -50,6 +47,12 @@ false + + + 0 + 31 + + Distribution @@ -58,28 +61,193 @@ - - - - Qt::Vertical + + + + true - + - 20 - 40 + 0 + 31 - + + Waveform + + + true + + + buttonGroup + + + + + + + + 0 + 31 + + + + Counter 2 + + + + + + + + 0 + 31 + + + + Counter 3 + + + + + + + true + + + + 0 + 31 + + + + No Plot + + + false + + + buttonGroup + + + + + + + + 0 + 31 + + + + Counter 0 + + + + + + + true + + + + 0 + 31 + + + + <html><head/><body><p>If set to high readout, zmq HWM is set to 2 and buffer size to 1MB to drop zmq packets to catch up.</p><p>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.</p></body></html> + + + + Low - drop no zmq packet + + + + + High - drop zmq packets to catch up + + + + + + + + true + + + + 0 + 31 + + + + Type: + + + + + + + + 150 + 16777215 + + + + <html><head/><body><p>If set to high readout, zmq HWM is set to 2 and buffer size to 1MB to drop zmq packets to catch up.</p><p>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.</p></body></html> + + + Readout speed: + + + + + + + true + + + + 0 + 31 + + + + Image + + + buttonGroup + + + + + 16777215 + 31 + + - 2 + 0 + + 0 + + + 0 + + + + 0 + 31 + + Digital plot: @@ -87,6 +255,12 @@ + + + 0 + 31 + + Overlay @@ -110,6 +284,12 @@ + + + 0 + 31 + + show legend @@ -120,6 +300,12 @@ + + + 0 + 31 + + Stripe @@ -149,6 +335,42 @@ + + 0 + + + 0 + + + + + Decoder: + + + + + + + Color Map: + + + + + + + true + + + + 120 + 31 + + + + Color map of the image + + + @@ -210,35 +432,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - true - - - - 120 - 31 - - - - Color map of the image - - - @@ -255,292 +448,661 @@ - - - - Decoder: + + + + Qt::Horizontal - - - - - - Color Map: + + + 40 + 20 + - + - - + + + + + 0 + 31 + + - Options: + Counter 1 - - - - true - - - No Plot - - - false - - - buttonGroup - - - - - - - true - + + 0 31 - - <html><head/><body><p>If set to high readout, zmq HWM is set to 2 and buffer size to 1MB to drop zmq packets to catch up.</p><p>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.</p></body></html> - - - - Low - drop no zmq packet - - - - - High - drop zmq packets to catch up - - - - - - <html><head/><body><p>If set to high readout, zmq HWM is set to 2 and buffer size to 1MB to drop zmq packets to catch up.</p><p>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.</p></body></html> - Readout speed: + Counters: - - - - true - - - Image - - - buttonGroup - - - - - - - true - - - Waveform - - - true - - - buttonGroup - - - - 0 - 480 + 10 + 440 841 - 311 + 400 + + + 0 + 400 + + + + + 16777215 + 16777215 + + QFrame::StyledPanel QFrame::Sunken - - - + + + false + + + 0 + 31 + + + + + 16777215 + 16777215 + + Fit Panel ADC: - - + + false - - Max: + + + 0 + 31 + - - - - - - false + + + 16777215 + 16777215 + - - Values - - - - - - - false + + QFrame::NoFrame Dynamic Range: - - + + false + + + 0 + 31 + + + + + 16777215 + 16777215 + + - Y: + Serial Offset: - - + + false + + + 100 + 31 + + + + + 45 + 16777215 + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + false + + + 100 + 31 + + + + + 16777215 + 16777215 + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + false + + + 0 + 0 + + + + + 16777215 + 16777215 + + Min: - - + + false + + + 245 + 31 + + + + + 200 + 16777215 + + - X: + Pedestal Subtract - + false + + + 100 + 31 + + + + + 45 + 16777215 + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + false - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + 31 + + + + Raw Data - - + + false - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + 31 + + + + + 16777215 + 16777215 + + + + Min: - + + + + false + + + + 0 + 31 + + + + + 16777215 + 16777215 + + + + N Counters: + + + + + + + false + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Max: + + + + false + + + 100 + 31 + + + + + 45 + 16777215 + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + false + + + 100 + 31 + + + + + 45 + 16777215 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + + 0 + 31 + + Image Pixels: - + + + + false + + + + 100 + 31 + + + + + 45 + 16777215 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + + 0 + 31 + + + + + 16777215 + 16777215 + + + + X: + + + + false + + + 100 + 31 + + + + + 16777215 + 16777215 + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + + + + false + + + + 100 + 31 + + + + + 16777215 + 16777215 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + + 100 + 31 + + + + + 45 + 16777215 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + false + + + 100 + 31 + + + + + 45 + 16777215 + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + false + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Plot Bit: + + + + + + + false + + + + 115 + 0 + + + + + 156 + 16777215 + + + + Max: + + + + + + + false + + + + 0 + 31 + + + + + 16777215 + 31 + + + + Y: + + + + + + + false + + + + 100 + 31 + + + + + 45 + 16777215 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + X + + + + + false @@ -549,77 +1111,17 @@ - - + + false - Min: + Values - - - - false - - - X - - - - - - - false - - - Max: - - - - - - - false - - - Serial offset: - - - - - - - false - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - false - - - Plot Bit: - - - - - - - false - - - Raw Data - - - - + @@ -635,241 +1137,223 @@ - - - - false - - - Pedestal Subtract - - - - - - - false - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - false - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - false - - - N Counters: - - - 10 - 219 + 221 841 - 81 + 91 + + + 0 + 0 + + QFrame::StyledPanel QFrame::Raised - - - - 0 - -7 - 841 - 111 - + + + 9 - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - Color Range: - - - - - - - - - 0 - 0 - 121 - 91 - - - - - - - - 16777215 - 15 - - - - All - - - true - - - buttonGroup_4 - - - - - - - true - - - - 16777215 - 15 - - - - 3-97% - - - buttonGroup_4 - - - - - - - - 16777215 - 15 - - - - Fixed - - - buttonGroup_4 - - - - - - - - - - - - 50 - 16777215 - - - - min: - - - - - - - false - - - -1000.000000000000000 - - - 100000.000000000000000 - - - - - - - - 50 - 16777215 - - - - max: - - - - - - - false - - - 100000.000000000000000 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - + + 9 + + + + + QFrame::NoFrame + + + QFrame::Plain + + + + + + true + + + + 16777215 + 15 + + + + 3-97% + + + buttonGroup_4 + + + + + + + + 16777215 + 15 + + + + All + + + true + + + buttonGroup_4 + + + + + + + + 16777215 + 15 + + + + Fixed + + + buttonGroup_4 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + + 0 + 31 + + + + + 16777215 + 31 + + + + Color Range: + + + + + + + false + + + + 0 + 31 + + + + -1000.000000000000000 + + + 100000.000000000000000 + + + + + + + + 50 + 31 + + + + max: + + + + + + + false + + + + 0 + 31 + + + + 100000.000000000000000 + + + + + + + + 50 + 31 + + + + min: + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + 10 - 330 + 322 841 - 101 + 108 @@ -878,208 +1362,183 @@ QFrame::Raised - - - - 0 - 0 - 841 - 51 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - true - - - Pedestal: - - - - - - - - 250 - 0 - - - - recorded frames: 0 - - - - - - - true - - - Record - - - true - - - false - - - buttonGroup_3 - - - - - - - true - - - Apply - - - true - - - buttonGroup_3 - - - - - - - true - - - - 0 - 31 - - - - background-color: rgb(199, 213, 207); - - - Reset - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - -1 - 49 - 841 - 51 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 120 - 31 - - - - background-color: rgb(199, 213, 207); - - - Load Pedestal - - - - - - - - 120 - 31 - - - - background-color: rgb(199, 213, 207); - - - Save Pedestal - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 40 - 20 - - - - - - + + + + + true + + + + 16777215 + 31 + + + + Apply + + + true + + + buttonGroup_3 + + + + + + + true + + + + 16777215 + 31 + + + + Record + + + true + + + false + + + buttonGroup_3 + + + + + + + + 0 + 0 + + + + + 16777215 + 31 + + + + recorded frames: 0 + + + + + + + true + + + + 0 + 31 + + + + background-color: rgb(199, 213, 207); + + + Reset + + + + + + + true + + + + 150 + 0 + + + + + 16777215 + 31 + + + + Pedestal: + + + + + + + QFrame::NoFrame + + + QFrame::Raised + + + + + + + 120 + 31 + + + + background-color: rgb(199, 213, 207); + + + Save Pedestal + + + + + + + + 120 + 31 + + + + background-color: rgb(199, 213, 207); + + + Load Pedestal + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + + - diff --git a/pyctbgui/pyctbgui/utils/defines.py b/pyctbgui/pyctbgui/utils/defines.py index 2226b5c33..b4ecfc04e 100644 --- a/pyctbgui/pyctbgui/utils/defines.py +++ b/pyctbgui/pyctbgui/utils/defines.py @@ -35,8 +35,8 @@ class Defines: loops_count = 6 class transceiver: - count = 4 - tabIndex = 4 + maxcount = 4 + maxtabIndex = 4 class slowAdc: tabIndex = 2