From 47fc640f755b7bbf9e82b0876fcf6450e56645e9 Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Thu, 5 Oct 2023 12:28:46 +0800 Subject: [PATCH] applets: rename 'ctl' attribute to 'req' --- artiq/applets/big_number.py | 6 +++--- artiq/applets/image.py | 2 +- artiq/applets/plot_hist.py | 2 +- artiq/applets/plot_xy.py | 2 +- artiq/applets/plot_xy_hist.py | 2 +- artiq/applets/progress_bar.py | 2 +- artiq/applets/simple.py | 16 ++++++++-------- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/artiq/applets/big_number.py b/artiq/applets/big_number.py index a085ce8e4..56458f507 100755 --- a/artiq/applets/big_number.py +++ b/artiq/applets/big_number.py @@ -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): diff --git a/artiq/applets/image.py b/artiq/applets/image.py index 36af01cab..75cecd05a 100755 --- a/artiq/applets/image.py +++ b/artiq/applets/image.py @@ -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 diff --git a/artiq/applets/plot_hist.py b/artiq/applets/plot_hist.py index 3be604930..5d386cc6c 100755 --- a/artiq/applets/plot_hist.py +++ b/artiq/applets/plot_hist.py @@ -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() diff --git a/artiq/applets/plot_xy.py b/artiq/applets/plot_xy.py index 3838ce345..d7d67803b 100755 --- a/artiq/applets/plot_xy.py +++ b/artiq/applets/plot_xy.py @@ -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() diff --git a/artiq/applets/plot_xy_hist.py b/artiq/applets/plot_xy_hist.py index 7d42aeacc..f757b520d 100755 --- a/artiq/applets/plot_xy_hist.py +++ b/artiq/applets/plot_xy_hist.py @@ -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") diff --git a/artiq/applets/progress_bar.py b/artiq/applets/progress_bar.py index b25d380d8..9ea7db836 100644 --- a/artiq/applets/progress_bar.py +++ b/artiq/applets/progress_bar.py @@ -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) diff --git a/artiq/applets/simple.py b/artiq/applets/simple.py index 580991982..cd980bb34 100644 --- a/artiq/applets/simple.py +++ b/artiq/applets/simple.py @@ -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: