|
@@ -36,7 +36,7 @@ class Enum():
|
|
|
setattr(self, i, self.idx)
|
|
|
self.idx += 1
|
|
|
|
|
|
-plotList = [tr("Label", "Heatmap"), tr("Label", "FFT"), tr("Label", "Trains"), tr("Label", "Combined"), tr("Label", "Compare"), tr("Label", "Follow")]
|
|
|
+plotList = [tr("Label", "Heatmap"), tr("Label", "FFT"), tr("Label", "Trains"), tr("Label", "Combined"), tr("Label", "Compare")]
|
|
|
PlotType = Enum(*[str(i) for i in plotList])
|
|
|
|
|
|
# gradient = {'mode': 'rgb',
|
|
@@ -479,7 +479,7 @@ class SubPlotWidget(pg.GraphicsLayoutWidget):
|
|
|
self._disableCustomAutoRange()
|
|
|
self.plotItem.setClipToView(True)
|
|
|
|
|
|
- if self.plotType == PlotType.Trains or self.plotType == PlotType.Follow:
|
|
|
+ if self.plotType == PlotType.Trains:
|
|
|
self.img.clear()
|
|
|
self.plotItemPlot[0].show()
|
|
|
self.gradient_legend.hide()
|
|
@@ -550,7 +550,7 @@ class SubPlotWidget(pg.GraphicsLayoutWidget):
|
|
|
elif self.plotType == PlotType.FFT:
|
|
|
self.plotItem.setLabel('left', 'Bunch Position', '')
|
|
|
self.plotItem.setLabel('bottom', 'Frequency', 'Hz')
|
|
|
- elif self.plotType == PlotType.Trains or self.plotType == PlotType.Follow:
|
|
|
+ elif self.plotType == PlotType.Trains:
|
|
|
self.plotItem.setLabel('left', '', '')
|
|
|
self.plotItem.setLabel('bottom', 'Sample Point', '')
|
|
|
elif self.plotType == PlotType.Combined:
|
|
@@ -659,10 +659,9 @@ class PlotWidget(kcgw.KCGWidgets):
|
|
|
self.trains_button = self.createButton(text=tr("Button", "Trains"), connect=lambda: self.plot(type=PlotType.Trains))
|
|
|
self.combined_button = self.createButton(text=tr("Button", "Combined"), connect=lambda: self.plot(type=PlotType.Combined))
|
|
|
self.compare_button = self.createButton(text=tr("Button", "Compare"), connect=lambda: self.plot(type=PlotType.Compare))
|
|
|
- self.follow_button = self.createButton(text=tr("Button", "Follow"), connect=lambda: self.plot(type=PlotType.Follow))
|
|
|
self.type_buttons = {PlotType.Heatmap:self.heatmap_button, PlotType.FFT:self.fft_button,
|
|
|
PlotType.Trains:self.trains_button, PlotType.Combined:self.combined_button,
|
|
|
- PlotType.Compare:self.compare_button, PlotType.Follow:self.follow_button}
|
|
|
+ PlotType.Compare:self.compare_button}
|
|
|
self.defaultButtonStyleSheet = self.heatmap_button.styleSheet()
|
|
|
|
|
|
self.plot_buttons_layout.addWidget(self.heatmap_button)
|
|
@@ -670,7 +669,6 @@ class PlotWidget(kcgw.KCGWidgets):
|
|
|
self.plot_buttons_layout.addWidget(self.trains_button)
|
|
|
self.plot_buttons_layout.addWidget(self.combined_button)
|
|
|
self.plot_buttons_layout.addWidget(self.compare_button)
|
|
|
- self.plot_buttons_layout.addWidget(self.follow_button)
|
|
|
|
|
|
|
|
|
self.adcCheckBox = []
|
|
@@ -721,16 +719,9 @@ class PlotWidget(kcgw.KCGWidgets):
|
|
|
self.groupWidgetCompare.hide()
|
|
|
|
|
|
self.from_to_layout = QtGui.QHBoxLayout()
|
|
|
- self.bucket_part = QtGui.QWidget()
|
|
|
- self.bucket_layout = QtGui.QHBoxLayout()
|
|
|
- self.bucket_layout.addWidget(self.createLabel(tr("Label", "Bucket:")))
|
|
|
- self.bucket_spinbox = self.createSpinbox(0, config.bunches_per_turn-1, interval=1, connect=lambda: self.plot(self.theType))
|
|
|
- self.bucket_layout.addWidget(self.bucket_spinbox)
|
|
|
- self.bucket_part.setLayout(self.bucket_layout)
|
|
|
self.from_spinbox = self.createSpinbox(0, 100000000, interval=100, connect=lambda: self.plot(self.theType))
|
|
|
self.to_spinbox = self.createSpinbox(0, 100000000, start_value=1000, interval=100, connect=lambda: self.plot(self.theType))
|
|
|
self.from_to_layout.addStretch()
|
|
|
- self.from_to_layout.addWidget(self.bucket_part)
|
|
|
self.from_to_layout.addWidget(self.createLabel(tr("Label", "From:")))
|
|
|
self.from_to_layout.addWidget(self.from_spinbox)
|
|
|
self.from_to_layout.addWidget(self.createLabel(tr("Label", "To:")))
|
|
@@ -815,10 +806,6 @@ class PlotWidget(kcgw.KCGWidgets):
|
|
|
style += self.defaultButtonStyleSheet
|
|
|
style += "QPushButton:focus{background-color: lightgrey!important; border-color: lightblue;}" # Note: this does not work
|
|
|
button.setStyleSheet(style)
|
|
|
- if self.theType == PlotType.Follow:
|
|
|
- self.bucket_part.show()
|
|
|
- else:
|
|
|
- self.bucket_part.hide()
|
|
|
|
|
|
|
|
|
if self.theType == PlotType.Trains:
|
|
@@ -863,7 +850,7 @@ class PlotWidget(kcgw.KCGWidgets):
|
|
|
type = self._old_type
|
|
|
else:
|
|
|
type = self.theType
|
|
|
- if type == PlotType.Trains or type == PlotType.Combined or type == PlotType.Follow:
|
|
|
+ if type == PlotType.Trains or type == PlotType.Combined:
|
|
|
self.do_plot(type, autorange=True)
|
|
|
else:
|
|
|
self.do_plot(type, autorange=False)
|
|
@@ -912,7 +899,6 @@ class PlotWidget(kcgw.KCGWidgets):
|
|
|
|
|
|
f = self.from_spinbox.value()
|
|
|
t = self.to_spinbox.value() if self.to_spinbox.value() > f else f+1
|
|
|
- b = self.bucket_spinbox.value()
|
|
|
if type == PlotType.FFT:
|
|
|
self.plot_widget.plot(np.abs(self.data.fft(adc=self.adc, frm=f, to=t+1, drop_first_bin=True)).transpose(),
|
|
|
autorange=autorange,
|
|
@@ -923,8 +909,6 @@ class PlotWidget(kcgw.KCGWidgets):
|
|
|
self.plot_widget.plot([self.data.heatmap(adc=self.adc, frm=f, to=t).transpose(),self.data.heatmap(adc=self.secadc, frm=f, to=t).transpose()], autorange=autorange)
|
|
|
if type == PlotType.Trains:
|
|
|
self.plot_widget.plot(self.data.train(adc=self.adc, frm=f, to=t), autorange=autorange)
|
|
|
- if type == PlotType.Follow:
|
|
|
- self.plot_widget.plot(self.data.follow(adc=self.adc, frm=f, to=t, bunch=b), autorange=autorange)
|
|
|
if type == PlotType.Combined:
|
|
|
self.plot_widget.plot(self.data.combined(frm=f, to=t), autorange=autorange)
|
|
|
|