Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bliss
bliss
Commits
b32b0eaa
Commit
b32b0eaa
authored
Sep 24, 2021
by
Valentin Valls
Browse files
Create a pplot standard command to print curve/lima plot into the logbook
parent
0ff73c6c
Changes
1
Show whitespace changes
Inline
Side-by-side
bliss/shell/standard.py
View file @
b32b0eaa
...
...
@@ -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__ = (
"tw"
,
]
+
scans
.
__all__
+
[
"lprint"
,
"ladd"
,
"elog_print"
,
"elog_add"
]
+
[
"lprint"
,
"ladd"
,
"elog_print"
,
"elog_add"
,
"elog_plot"
]
+
[
"cleanup"
,
"error_cleanup"
,
...
...
@@ -1534,6 +1535,35 @@ def elog_add(index=-1):
logtools
.
elogbook
.
comment
(
comment
)
@
typeguard
.
typechecked
def
elog_plot
(
controller
=
None
):
"""Export the actual curve plot to the logbook
Arguments:
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"
)
return
flint
.
wait_end_of_scans
()
if
controller
is
None
:
p
=
flint
.
get_live_plot
(
kind
=
"curve"
)
elif
isinstance
(
controller
,
Lima
):
p
=
flint
.
get_live_plot
(
image_detector
=
controller
.
name
)
elif
isinstance
(
controller
,
BaseMCA
):
p
=
flint
.
get_live_plot
(
mca_detector
=
controller
.
name
)
else
:
raise
RuntimeError
(
"Reaching plot from controller type {type(controller)} is not supported"
)
try
:
p
.
export_to_logbook
()
except
RuntimeError
as
e
:
print
(
e
.
args
[
0
])
@
logtools
.
elogbook
.
disable_command_logging
def
lprint
(
*
args
,
**
kw
):
elog_print
(
*
args
,
**
kw
)
...
...
Cyril Guilloud
@cyril.guilloud
mentioned in issue
#3011
·
Oct 11, 2021
mentioned in issue
#3011
mentioned in issue #3011
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment