Commit b32b0eaa authored by Valentin Valls's avatar Valentin Valls
Browse files

Create a pplot standard command to print curve/lima plot into the logbook

parent 0ff73c6c
......@@ -49,6 +49,7 @@ from bliss.common.standard import ( # noqa
from bliss.common.standard import wid as std_wid
from bliss.common.event import connect
from bliss.controllers.mca.base import BaseMCA
from bliss.controllers.lima.limatools import *
from bliss.controllers.lima import limatools
from bliss.controllers.lima import roi as lima_roi
......@@ -198,7 +199,7 @@ __all__ = (
+ scans.__all__
+ ["lprint", "ladd", "elog_print", "elog_add"]
+ ["lprint", "ladd", "elog_print", "elog_add", "elog_plot"]
+ [
......@@ -1534,6 +1535,35 @@ def elog_add(index=-1):
def elog_plot(controller=None):
"""Export the actual curve plot to the logbook
controller: If specified, a Lima or MCA controller can be specified
to export the relative specific plot
flint = plot_module.get_flint(creation_allowed=False, mandatory=False)
if flint is None:
print("Flint is not available or not reachable")
if controller is None:
p = flint.get_live_plot(kind="curve")
elif isinstance(controller, Lima):
p = flint.get_live_plot(
elif isinstance(controller, BaseMCA):
p = flint.get_live_plot(
raise RuntimeError(
"Reaching plot from controller type {type(controller)} is not supported"
except RuntimeError as e:
def lprint(*args, **kw):
elog_print(*args, **kw)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment