|
@@ -156,10 +156,26 @@ class TimingPart(kcgw.KCGWidgets):
|
|
|
for i in range(self.adc_number):
|
|
|
self.fineAdcInput.append(self.createSpinbox(0, 31, connect=self.on_adc_delay_changed))
|
|
|
|
|
|
+ Elements.addItem(["timing_{}".format(self.board_id),
|
|
|
+ "no_board_{}".format(self.board_id),
|
|
|
+ "acquire_{}".format(self.board_id),
|
|
|
+ "continuous_read_{}".format(board_id)], self.fineAdcInput)
|
|
|
+
|
|
|
+ self.bunchShiftLabel = self.createLabel(tr("Label", "Bunch Shift"))
|
|
|
+
|
|
|
+ self.bunchShiftInput = []
|
|
|
+ for i in range(self.adc_number):
|
|
|
+ self.bunchShiftInput.append(self.createSpinbox(-2, 2, connect=self.on_bunch_shift_changed))
|
|
|
+
|
|
|
+ Elements.addItem(["timing_{}".format(self.board_id),
|
|
|
+ "no_board_{}".format(self.board_id),
|
|
|
+ "acquire_{}".format(self.board_id),
|
|
|
+ "continuous_read_{}".format(board_id)], self.bunchShiftInput)
|
|
|
+
|
|
|
+
|
|
|
#---------[ End ]---------
|
|
|
|
|
|
|
|
|
- Elements.addItem(["timing_{}".format(self.board_id), "no_board_{}".format(self.board_id), "acquire_{}".format(self.board_id), "continuous_read_{}".format(board_id)], self.fineAdcInput)
|
|
|
|
|
|
|
|
|
def setValueSilent(value, spinbox, adc):
|
|
@@ -181,6 +197,8 @@ class TimingPart(kcgw.KCGWidgets):
|
|
|
)
|
|
|
for i, item in enumerate(self.fineAdcInput):
|
|
|
obs(item, 'chip_delay', i)
|
|
|
+ for i, item in enumerate(self.bunchShiftInput):
|
|
|
+ obs(item, 'bunch_shift', i)
|
|
|
|
|
|
obs(self.coarseInputTh, 'delay_330_th')
|
|
|
obs(self.coarseInputAdc, 'delay_330_adc')
|
|
@@ -270,6 +288,9 @@ class TimingPart(kcgw.KCGWidgets):
|
|
|
self.layout.addWidget(self.fineLabel, 6, 0)
|
|
|
for i, item in enumerate(self.fineAdcInput):
|
|
|
self.layout.addWidget(item, 6, i+1)
|
|
|
+ self.layout.addWidget(self.bunchShiftLabel, 7, 0)
|
|
|
+ for i, item in enumerate(self.bunchShiftInput):
|
|
|
+ self.layout.addWidget(item, 7, i+1)
|
|
|
|
|
|
self.layout.addItem(QtGui.QSpacerItem(10, 15), 7, 1)
|
|
|
line = QtGui.QFrame()
|
|
@@ -419,6 +440,8 @@ class TimingPart(kcgw.KCGWidgets):
|
|
|
|
|
|
for i, item in enumerate(self.fineAdcInput):
|
|
|
self.board_config.unobserve(item, 'chip_delay')
|
|
|
+ for i, item in enumerate(self.bunchShiftInput):
|
|
|
+ self.board_config.unobserve(item, 'bunch_shift')
|
|
|
|
|
|
|
|
|
self.board_config.unobserve(self.coarseInputTh, 'delay_330_th')
|
|
@@ -443,6 +466,7 @@ class TimingPart(kcgw.KCGWidgets):
|
|
|
|
|
|
Elements.emptyGroup('timing_{}'.format(self.board_id))
|
|
|
Elements.removeItem(None, self.fineAdcInput)
|
|
|
+ Elements.removeItem(None, self.bunchShiftInput)
|
|
|
Elements.removeItem(None, [
|
|
|
self.coarseInputTh,
|
|
|
self.coarseInputAdc,
|
|
@@ -489,6 +513,21 @@ class TimingPart(kcgw.KCGWidgets):
|
|
|
|
|
|
|
|
|
|
|
|
+ def on_bunch_shift_changed(self):
|
|
|
+ """
|
|
|
+ Handler that gets called when a bunch shift setting gets changed
|
|
|
+ """
|
|
|
+ try:
|
|
|
+ factors = []
|
|
|
+ for item in self.bunchShiftInput:
|
|
|
+ factors.extend([item.value()])
|
|
|
+
|
|
|
+ self.board_config.update('bunch_shift', factors)
|
|
|
+ except board.BoardError as e:
|
|
|
+ logging.error("ADC bunch shift failed: {}".format(str(e)))
|
|
|
+ bif.bk_status_readout(self.board_id)
|
|
|
+ return
|
|
|
+
|
|
|
|
|
|
|
|
|
|