0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-14 03:31:50 +02:00

refactor(figure): logic for .add_image and .image consolidated; logic for .add_plot and .plot consolidated

This commit is contained in:
2024-06-06 14:25:42 +02:00
parent 8479caf53a
commit 52bc322b2b
5 changed files with 194 additions and 128 deletions

View File

@ -9,7 +9,7 @@ def test_rpc_waveform1d_custom_curve(rpc_server_figure):
fig = BECFigure(rpc_server_figure)
ax = fig.add_plot()
curve = ax.add_curve_custom([1, 2, 3], [1, 2, 3])
curve = ax.plot(x=[1, 2, 3], y=[1, 2, 3])
curve.set_color("red")
curve = ax.curves[0]
curve.set_color("blue")
@ -24,7 +24,7 @@ def test_rpc_plotting_shortcuts_init_configs(rpc_server_figure, qtbot):
plt = fig.plot(x_name="samx", y_name="bpm4i")
im = fig.image("eiger")
motor_map = fig.motor_map("samx", "samy")
plt_z = fig.add_plot("samx", "samy", "bpm4i")
plt_z = fig.add_plot(x_name="samx", y_name="samy", z_name="bpm4i")
# Checking if classes are correctly initialised
assert len(fig.widgets) == 4

View File

@ -9,7 +9,7 @@ def test_rpc_register_list_connections(rpc_server_figure):
plt = fig.plot(x_name="samx", y_name="bpm4i")
im = fig.image("eiger")
motor_map = fig.motor_map("samx", "samy")
plt_z = fig.add_plot("samx", "samy", "bpm4i")
plt_z = fig.add_plot(x_name="samx", y_name="samy", z_name="bpm4i")
# keep only class names from objects, since objects on server and client are different
# so the best we can do is to compare types (rpc register is unit-tested elsewhere)