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

feat: added config plotter

This commit is contained in:
2023-07-11 17:58:07 +02:00
parent 88f5aca2dd
commit db274c644f
3 changed files with 173 additions and 0 deletions

View File

@ -0,0 +1,45 @@
import pyqtgraph as pg
from pytestqt import qtbot
from bec_widgets import config_plotter
def test_config_plotter(qtbot):
"""Test ConfigPlotter"""
config = [
{
"cols": 1,
"rows": 1,
"y": 0,
"x": 0,
"config": {"channels": ["a"], "label_xy": ["", "a"], "item": "PlotItem"},
}
]
plotter = config_plotter.ConfigPlotter(config)
assert isinstance(plotter.plots["a"]["item"], pg.PlotItem)
def test_config_plotter_image(qtbot):
"""Test ConfigPlotter"""
config = [
{
"cols": 1,
"rows": 1,
"y": 0,
"x": 0,
"config": {"channels": ["a"], "label_xy": ["", "a"], "item": "PlotItem"},
},
{
"cols": 1,
"rows": 1,
"y": 1,
"x": 0,
"config": {"channels": ["b"], "label_xy": ["", "b"], "item": "ImageItem"},
},
]
plotter = config_plotter.ConfigPlotter(config)
assert isinstance(plotter.plots["a"]["item"], pg.PlotItem)