bec-widgets 0.48.0__tar.gz → 0.49.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/PKG-INFO +1 -1
- bec_widgets-0.49.0/bec_widgets/cli/bec_widgets_icon.png +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/cli/client_utils.py +28 -4
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/cli/server.py +10 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/utils/bec_connector.py +4 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets.egg-info/PKG-INFO +1 -1
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets.egg-info/SOURCES.txt +1 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/setup.py +8 -2
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/LICENSE +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/README.md +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/cli/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/cli/auto_updates.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/cli/client.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/cli/generate_cli.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/eiger_plot/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/eiger_plot/eiger_plot.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/eiger_plot/eiger_plot.ui +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/jupyter_console/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/jupyter_console/jupyter_console_window.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/jupyter_console/jupyter_console_window.ui +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/mca_readout/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/mca_readout/mca_plot.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/mca_readout/mca_sim.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/motor_movement/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/motor_movement/config_example.yaml +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/motor_movement/csax_bec_config.yaml +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/motor_movement/csaxs_config.yaml +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/motor_movement/motor_control_compilations.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/motor_movement/motor_controller.ui +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/motor_movement/motor_example.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/stream_plot/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/stream_plot/line_plot.ui +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/stream_plot/stream_plot.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/simulations/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/utils/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/utils/bec_dispatcher.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/utils/bec_table.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/utils/colors.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/utils/container_utils.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/utils/crosshair.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/utils/ctrl_c.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/utils/entry_validator.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/utils/rpc_decorator.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/utils/thread_checker.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/utils/validator_delegate.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/utils/widget_io.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/utils/yaml_dialog.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/validation/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/validation/monitor_config_validator.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/editor/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/editor/editor.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/figure/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/figure/figure.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/monitor/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/monitor/config_dialog.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/monitor/config_dialog.ui +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/monitor/monitor.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/monitor/tab_template.ui +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/motor_control/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/motor_control/motor_control.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/motor_control/motor_control_absolute.ui +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/motor_control/motor_control_relative.ui +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/motor_control/motor_control_selection.ui +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/motor_control/motor_control_table.ui +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/motor_map/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/motor_map/motor_map.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/plots/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/plots/image.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/plots/motor_map.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/plots/plot_base.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/plots/waveform.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/scan_control/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/scan_control/scan_control.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/toolbar/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/toolbar/toolbar.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets.egg-info/dependency_links.txt +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets.egg-info/requires.txt +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets.egg-info/top_level.txt +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/setup.cfg +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/client_mocks.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/conftest.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_bec_connector.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_bec_dispatcher.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_bec_figure.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_bec_monitor.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_bec_motor_map.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_client_utils.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_config_dialog.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_crosshair.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_editor.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_eiger_plot.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_generate_cli_client.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_motor_control.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_motor_map.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_msgs/__init__.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_msgs/available_scans_message.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_plot_base.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_scan_control.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_stream_plot.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_validator_errors.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_waveform1d.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_widget_io.py +0 -0
- {bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_yaml_dialog.py +0 -0
Binary file
|
@@ -121,7 +121,10 @@ class BECFigureClientMixin:
|
|
121
121
|
"""
|
122
122
|
if self._process is None:
|
123
123
|
return
|
124
|
-
self.
|
124
|
+
if self.gui_is_alive():
|
125
|
+
self._run_rpc("close", (), wait_for_rpc_response=True)
|
126
|
+
else:
|
127
|
+
self._run_rpc("close", (), wait_for_rpc_response=False)
|
125
128
|
self._process.terminate()
|
126
129
|
self._process_output_processing_thread.join()
|
127
130
|
self._process = None
|
@@ -167,6 +170,15 @@ class BECFigureClientMixin:
|
|
167
170
|
self.stderr_output.append(self._process.stderr.read(1024))
|
168
171
|
|
169
172
|
|
173
|
+
class RPCResponseTimeoutError(Exception):
|
174
|
+
"""Exception raised when an RPC response is not received within the expected time."""
|
175
|
+
|
176
|
+
def __init__(self, request_id, timeout):
|
177
|
+
super().__init__(
|
178
|
+
f"RPC response not received within {timeout} seconds for request ID {request_id}"
|
179
|
+
)
|
180
|
+
|
181
|
+
|
170
182
|
class RPCBase:
|
171
183
|
def __init__(self, gui_id: str = None, config: dict = None, parent=None) -> None:
|
172
184
|
self._client = BECDispatcher().client
|
@@ -212,7 +224,7 @@ class RPCBase:
|
|
212
224
|
parameter={"args": args, "kwargs": kwargs, "gui_id": self._gui_id},
|
213
225
|
metadata={"request_id": request_id},
|
214
226
|
)
|
215
|
-
|
227
|
+
|
216
228
|
# pylint: disable=protected-access
|
217
229
|
receiver = self._root._gui_id
|
218
230
|
self._client.connector.set_and_publish(MessageEndpoints.gui_instructions(receiver), rpc_msg)
|
@@ -247,16 +259,28 @@ class RPCBase:
|
|
247
259
|
return cls(parent=self, **msg_result)
|
248
260
|
return msg_result
|
249
261
|
|
250
|
-
def _wait_for_response(self, request_id):
|
262
|
+
def _wait_for_response(self, request_id: str, timeout: int = 5):
|
251
263
|
"""
|
252
264
|
Wait for the response from the server.
|
265
|
+
Args:
|
266
|
+
request_id(str): The request ID.
|
267
|
+
timeout(int): The timeout in seconds.
|
268
|
+
|
269
|
+
Returns:
|
270
|
+
The response from the server.
|
253
271
|
"""
|
272
|
+
start_time = time.time()
|
254
273
|
response = None
|
255
|
-
|
274
|
+
|
275
|
+
while response is None and self.gui_is_alive() and (time.time() - start_time) < timeout:
|
256
276
|
response = self._client.connector.get(
|
257
277
|
MessageEndpoints.gui_instruction_response(request_id)
|
258
278
|
)
|
259
279
|
QCoreApplication.processEvents() # keep UI responsive (and execute signals/slots)
|
280
|
+
time.sleep(0.1)
|
281
|
+
if response is None and (time.time() - start_time) >= timeout:
|
282
|
+
raise RPCResponseTimeoutError(request_id, timeout)
|
283
|
+
|
260
284
|
return response
|
261
285
|
|
262
286
|
def gui_is_alive(self):
|
@@ -1,4 +1,6 @@
|
|
1
1
|
import inspect
|
2
|
+
import threading
|
3
|
+
import time
|
2
4
|
|
3
5
|
from bec_lib import MessageEndpoints, messages
|
4
6
|
from qtpy.QtCore import QTimer
|
@@ -109,17 +111,25 @@ class BECWidgetsCLIServer:
|
|
109
111
|
def shutdown(self):
|
110
112
|
self._shutdown_event = True
|
111
113
|
self._heartbeat_timer.stop()
|
114
|
+
self.client.shutdown()
|
112
115
|
|
113
116
|
|
114
117
|
if __name__ == "__main__": # pragma: no cover
|
115
118
|
import argparse
|
116
119
|
import sys
|
117
120
|
|
121
|
+
from qtpy.QtCore import QSize
|
122
|
+
from qtpy.QtGui import QIcon
|
118
123
|
from qtpy.QtWidgets import QApplication, QMainWindow
|
119
124
|
|
120
125
|
app = QApplication(sys.argv)
|
121
126
|
app.setApplicationName("BEC Figure")
|
127
|
+
icon = QIcon()
|
128
|
+
icon.addFile("bec_widgets_icon.png", size=QSize(48, 48))
|
129
|
+
app.setWindowIcon(icon)
|
130
|
+
|
122
131
|
win = QMainWindow()
|
132
|
+
win.setWindowTitle("BEC Widgets")
|
123
133
|
|
124
134
|
parser = argparse.ArgumentParser(description="BEC Widgets CLI Server")
|
125
135
|
parser.add_argument("--id", type=str, help="The id of the server")
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# pylint: disable= missing-module-docstring
|
2
2
|
from setuptools import find_packages, setup
|
3
3
|
|
4
|
-
__version__ = "0.
|
4
|
+
__version__ = "0.49.0"
|
5
5
|
|
6
6
|
# Default to PyQt6 if no other Qt binding is installed
|
7
7
|
QT_DEPENDENCY = "PyQt6>=6.0"
|
@@ -48,5 +48,11 @@ if __name__ == "__main__":
|
|
48
48
|
version=__version__,
|
49
49
|
packages=find_packages(),
|
50
50
|
include_package_data=True,
|
51
|
-
package_data={
|
51
|
+
package_data={
|
52
|
+
"": [
|
53
|
+
"*.ui",
|
54
|
+
"*.yaml",
|
55
|
+
"*.png",
|
56
|
+
]
|
57
|
+
},
|
52
58
|
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/motor_movement/config_example.yaml
RENAMED
File without changes
|
{bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/motor_movement/csax_bec_config.yaml
RENAMED
File without changes
|
{bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/motor_movement/csaxs_config.yaml
RENAMED
File without changes
|
File without changes
|
{bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/motor_movement/motor_controller.ui
RENAMED
File without changes
|
{bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/examples/motor_movement/motor_example.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/validation/monitor_config_validator.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/motor_control/motor_control.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{bec_widgets-0.48.0 → bec_widgets-0.49.0}/bec_widgets/widgets/motor_control/motor_control_table.ui
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{bec_widgets-0.48.0 → bec_widgets-0.49.0}/tests/unit_tests/test_msgs/available_scans_message.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|