forked from M-Labs/artiq
applets: rename 'ctl' attribute to 'req'
This commit is contained in:
parent
bb7caacb5f
commit
47fc640f75
@ -22,10 +22,10 @@ class QCancellableLineEdit(QtWidgets.QLineEdit):
|
||||
|
||||
|
||||
class NumberWidget(QtWidgets.QStackedWidget):
|
||||
def __init__(self, args, ctl):
|
||||
def __init__(self, args, req):
|
||||
QtWidgets.QStackedWidget.__init__(self)
|
||||
self.dataset_name = args.dataset
|
||||
self.ctl = ctl
|
||||
self.req = req
|
||||
|
||||
self.lcd_widget = QResponsiveLCDNumber()
|
||||
self.lcd_widget.setDigitCount(args.digit_count)
|
||||
@ -55,7 +55,7 @@ class NumberWidget(QtWidgets.QStackedWidget):
|
||||
|
||||
def confirm_edit(self):
|
||||
value = float(self.edit_widget.text())
|
||||
self.ctl.set_dataset(self.dataset_name, value)
|
||||
self.req.set_dataset(self.dataset_name, value)
|
||||
self.setCurrentWidget(self.lcd_widget)
|
||||
|
||||
def cancel_edit(self):
|
||||
|
@ -7,7 +7,7 @@ from artiq.applets.simple import SimpleApplet
|
||||
|
||||
|
||||
class Image(pyqtgraph.ImageView):
|
||||
def __init__(self, args, ctl):
|
||||
def __init__(self, args, req):
|
||||
pyqtgraph.ImageView.__init__(self)
|
||||
self.args = args
|
||||
|
||||
|
@ -8,7 +8,7 @@ from artiq.applets.simple import TitleApplet
|
||||
|
||||
|
||||
class HistogramPlot(pyqtgraph.PlotWidget):
|
||||
def __init__(self, args, ctl):
|
||||
def __init__(self, args, req):
|
||||
pyqtgraph.PlotWidget.__init__(self)
|
||||
self.args = args
|
||||
self.timer = QTimer()
|
||||
|
@ -9,7 +9,7 @@ from artiq.applets.simple import TitleApplet
|
||||
|
||||
|
||||
class XYPlot(pyqtgraph.PlotWidget):
|
||||
def __init__(self, args, ctl):
|
||||
def __init__(self, args, req):
|
||||
pyqtgraph.PlotWidget.__init__(self)
|
||||
self.args = args
|
||||
self.timer = QTimer()
|
||||
|
@ -22,7 +22,7 @@ def _compute_ys(histogram_bins, histograms_counts):
|
||||
# pyqtgraph.GraphicsWindow fails to behave like a regular Qt widget
|
||||
# and breaks embedding. Do not use as top widget.
|
||||
class XYHistPlot(QtWidgets.QSplitter):
|
||||
def __init__(self, args, ctl):
|
||||
def __init__(self, args, req):
|
||||
QtWidgets.QSplitter.__init__(self)
|
||||
self.resize(1000, 600)
|
||||
self.setWindowTitle("XY/Histogram")
|
||||
|
@ -6,7 +6,7 @@ from artiq.applets.simple import SimpleApplet
|
||||
|
||||
|
||||
class ProgressWidget(QtWidgets.QProgressBar):
|
||||
def __init__(self, args, ctl):
|
||||
def __init__(self, args, req):
|
||||
QtWidgets.QProgressBar.__init__(self)
|
||||
self.setMinimum(args.min)
|
||||
self.setMaximum(args.max)
|
||||
|
@ -251,21 +251,21 @@ class SimpleApplet:
|
||||
if self.embed is not None:
|
||||
self.ipc.close()
|
||||
|
||||
def ctl_init(self):
|
||||
def req_init(self):
|
||||
if self.embed is None:
|
||||
dataset_ctl = RPCClient()
|
||||
self.loop.run_until_complete(dataset_ctl.connect_rpc(
|
||||
self.args.server, self.args.port_control, "master_dataset_db"))
|
||||
self.ctl = AppletRequestRPC(self.loop, dataset_ctl)
|
||||
self.req = AppletRequestRPC(self.loop, dataset_ctl)
|
||||
else:
|
||||
self.ctl = AppletRequestIPC(self.ipc)
|
||||
self.req = AppletRequestIPC(self.ipc)
|
||||
|
||||
def ctl_close(self):
|
||||
def req_close(self):
|
||||
if self.embed is None:
|
||||
self.ctl.dataset_ctl.close_rpc()
|
||||
self.req.dataset_ctl.close_rpc()
|
||||
|
||||
def create_main_widget(self):
|
||||
self.main_widget = self.main_widget_class(self.args, self.ctl)
|
||||
self.main_widget = self.main_widget_class(self.args, self.req)
|
||||
if self.embed is not None:
|
||||
self.ipc.set_close_cb(self.main_widget.close)
|
||||
if os.name == "nt":
|
||||
@ -367,7 +367,7 @@ class SimpleApplet:
|
||||
try:
|
||||
self.ipc_init()
|
||||
try:
|
||||
self.ctl_init()
|
||||
self.req_init()
|
||||
try:
|
||||
self.create_main_widget()
|
||||
self.subscribe()
|
||||
@ -376,7 +376,7 @@ class SimpleApplet:
|
||||
finally:
|
||||
self.unsubscribe()
|
||||
finally:
|
||||
self.ctl_close()
|
||||
self.req_close()
|
||||
finally:
|
||||
self.ipc_close()
|
||||
finally:
|
||||
|
Loading…
Reference in New Issue
Block a user