mirror of https://github.com/m-labs/artiq.git
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):
|
class NumberWidget(QtWidgets.QStackedWidget):
|
||||||
def __init__(self, args, ctl):
|
def __init__(self, args, req):
|
||||||
QtWidgets.QStackedWidget.__init__(self)
|
QtWidgets.QStackedWidget.__init__(self)
|
||||||
self.dataset_name = args.dataset
|
self.dataset_name = args.dataset
|
||||||
self.ctl = ctl
|
self.req = req
|
||||||
|
|
||||||
self.lcd_widget = QResponsiveLCDNumber()
|
self.lcd_widget = QResponsiveLCDNumber()
|
||||||
self.lcd_widget.setDigitCount(args.digit_count)
|
self.lcd_widget.setDigitCount(args.digit_count)
|
||||||
|
@ -55,7 +55,7 @@ class NumberWidget(QtWidgets.QStackedWidget):
|
||||||
|
|
||||||
def confirm_edit(self):
|
def confirm_edit(self):
|
||||||
value = float(self.edit_widget.text())
|
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)
|
self.setCurrentWidget(self.lcd_widget)
|
||||||
|
|
||||||
def cancel_edit(self):
|
def cancel_edit(self):
|
||||||
|
|
|
@ -7,7 +7,7 @@ from artiq.applets.simple import SimpleApplet
|
||||||
|
|
||||||
|
|
||||||
class Image(pyqtgraph.ImageView):
|
class Image(pyqtgraph.ImageView):
|
||||||
def __init__(self, args, ctl):
|
def __init__(self, args, req):
|
||||||
pyqtgraph.ImageView.__init__(self)
|
pyqtgraph.ImageView.__init__(self)
|
||||||
self.args = args
|
self.args = args
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ from artiq.applets.simple import TitleApplet
|
||||||
|
|
||||||
|
|
||||||
class HistogramPlot(pyqtgraph.PlotWidget):
|
class HistogramPlot(pyqtgraph.PlotWidget):
|
||||||
def __init__(self, args, ctl):
|
def __init__(self, args, req):
|
||||||
pyqtgraph.PlotWidget.__init__(self)
|
pyqtgraph.PlotWidget.__init__(self)
|
||||||
self.args = args
|
self.args = args
|
||||||
self.timer = QTimer()
|
self.timer = QTimer()
|
||||||
|
|
|
@ -9,7 +9,7 @@ from artiq.applets.simple import TitleApplet
|
||||||
|
|
||||||
|
|
||||||
class XYPlot(pyqtgraph.PlotWidget):
|
class XYPlot(pyqtgraph.PlotWidget):
|
||||||
def __init__(self, args, ctl):
|
def __init__(self, args, req):
|
||||||
pyqtgraph.PlotWidget.__init__(self)
|
pyqtgraph.PlotWidget.__init__(self)
|
||||||
self.args = args
|
self.args = args
|
||||||
self.timer = QTimer()
|
self.timer = QTimer()
|
||||||
|
|
|
@ -22,7 +22,7 @@ def _compute_ys(histogram_bins, histograms_counts):
|
||||||
# pyqtgraph.GraphicsWindow fails to behave like a regular Qt widget
|
# pyqtgraph.GraphicsWindow fails to behave like a regular Qt widget
|
||||||
# and breaks embedding. Do not use as top widget.
|
# and breaks embedding. Do not use as top widget.
|
||||||
class XYHistPlot(QtWidgets.QSplitter):
|
class XYHistPlot(QtWidgets.QSplitter):
|
||||||
def __init__(self, args, ctl):
|
def __init__(self, args, req):
|
||||||
QtWidgets.QSplitter.__init__(self)
|
QtWidgets.QSplitter.__init__(self)
|
||||||
self.resize(1000, 600)
|
self.resize(1000, 600)
|
||||||
self.setWindowTitle("XY/Histogram")
|
self.setWindowTitle("XY/Histogram")
|
||||||
|
|
|
@ -6,7 +6,7 @@ from artiq.applets.simple import SimpleApplet
|
||||||
|
|
||||||
|
|
||||||
class ProgressWidget(QtWidgets.QProgressBar):
|
class ProgressWidget(QtWidgets.QProgressBar):
|
||||||
def __init__(self, args, ctl):
|
def __init__(self, args, req):
|
||||||
QtWidgets.QProgressBar.__init__(self)
|
QtWidgets.QProgressBar.__init__(self)
|
||||||
self.setMinimum(args.min)
|
self.setMinimum(args.min)
|
||||||
self.setMaximum(args.max)
|
self.setMaximum(args.max)
|
||||||
|
|
|
@ -251,21 +251,21 @@ class SimpleApplet:
|
||||||
if self.embed is not None:
|
if self.embed is not None:
|
||||||
self.ipc.close()
|
self.ipc.close()
|
||||||
|
|
||||||
def ctl_init(self):
|
def req_init(self):
|
||||||
if self.embed is None:
|
if self.embed is None:
|
||||||
dataset_ctl = RPCClient()
|
dataset_ctl = RPCClient()
|
||||||
self.loop.run_until_complete(dataset_ctl.connect_rpc(
|
self.loop.run_until_complete(dataset_ctl.connect_rpc(
|
||||||
self.args.server, self.args.port_control, "master_dataset_db"))
|
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:
|
else:
|
||||||
self.ctl = AppletRequestIPC(self.ipc)
|
self.req = AppletRequestIPC(self.ipc)
|
||||||
|
|
||||||
def ctl_close(self):
|
def req_close(self):
|
||||||
if self.embed is None:
|
if self.embed is None:
|
||||||
self.ctl.dataset_ctl.close_rpc()
|
self.req.dataset_ctl.close_rpc()
|
||||||
|
|
||||||
def create_main_widget(self):
|
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:
|
if self.embed is not None:
|
||||||
self.ipc.set_close_cb(self.main_widget.close)
|
self.ipc.set_close_cb(self.main_widget.close)
|
||||||
if os.name == "nt":
|
if os.name == "nt":
|
||||||
|
@ -367,7 +367,7 @@ class SimpleApplet:
|
||||||
try:
|
try:
|
||||||
self.ipc_init()
|
self.ipc_init()
|
||||||
try:
|
try:
|
||||||
self.ctl_init()
|
self.req_init()
|
||||||
try:
|
try:
|
||||||
self.create_main_widget()
|
self.create_main_widget()
|
||||||
self.subscribe()
|
self.subscribe()
|
||||||
|
@ -376,7 +376,7 @@ class SimpleApplet:
|
||||||
finally:
|
finally:
|
||||||
self.unsubscribe()
|
self.unsubscribe()
|
||||||
finally:
|
finally:
|
||||||
self.ctl_close()
|
self.req_close()
|
||||||
finally:
|
finally:
|
||||||
self.ipc_close()
|
self.ipc_close()
|
||||||
finally:
|
finally:
|
||||||
|
|
Loading…
Reference in New Issue