Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
beamlinetools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HZB
Bluesky
beamlines_endstations
SE_LAB
source
beamlinetools
Commits
94cffaef
Commit
94cffaef
authored
11 months ago
by
Marcel Bajdel
Browse files
Options
Downloads
Patches
Plain Diff
update magics to work with SeCop devices
parent
f5ca9b2b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
beamlinetools/BEAMLINE_CONFIG/magics.py
+19
-14
19 additions, 14 deletions
beamlinetools/BEAMLINE_CONFIG/magics.py
beamlinetools/magics/standard_magics.py
+12
-4
12 additions, 4 deletions
beamlinetools/magics/standard_magics.py
with
31 additions
and
18 deletions
beamlinetools/BEAMLINE_CONFIG/magics.py
+
19
−
14
View file @
94cffaef
...
...
@@ -10,21 +10,26 @@ from .base import RE, bec
get_ipython
().
register_magics
(
BlueskyMagics
)
# custom magics - it will override some standard magics
label_axis_dict
=
{
"
dcm
"
:
[
"
dcm.monoz.user_readback
"
,
"
dcm.p.energy.readback
"
,
"
dcm.p.height.readback
"
,
"
dcm.p.cr2vetr.user_readback
"
,
"
dcm.p.cr2latr.user_readback
"
,
# "r.tttz.readback",
# "r.ttrx.readback",
# "r.ttry.readback",
# "r.ttrz.readback",
# "r.ps.det1.readback",
# "r.ps.det2.readback",
]
"
temperature_regulator
"
:
[
"
reactor_c.temperature_reg.target
"
,
"
reactor_c.temperature_reg.value
"
,
"
reactor_c.temperature_reg.ramp
"
,
"
reactor_c.temperature_reg.status
"
,
],
"
temperature_sensor
"
:
[
"
reactor_c.temperature_sam.value
"
,
"
reactor_c.temperature_sam.status
"
,
],
"
pressure_controller_1
"
:
[
"
gas_d.backpressure_contr1.target
"
,
"
gas_d.backpressure_contr1.value
"
,
"
gas_d.backpressure_contr1.ramp
"
,
"
gas_d.backpressure_contr1.status
"
,
]
}
exclude_labels_from_wa
=
[
'
detectors
'
]
get_ipython
().
register_magics
(
BlueskyMagicsBessy
(
RE
,
get_ipython
(),
database_name
=
"
db
"
,
exclude_labels_from_wa
=
exclude_labels_from_wa
,
label_axis_dict
=
label_axis_dict
))
exclude_labels_from_wa
=
[
'
detectors
'
,
'
motors
'
]
get_ipython
().
register_magics
(
BlueskyMagicsBessy
(
RE
,
get_ipython
(),
database_name
=
"
db
"
,
exclude_labels_from_wa
=
exclude_labels_from_wa
,
label_axis_dict
=
label_axis_dict
))
simplify
=
Simplify
(
get_ipython
())
simplify
.
autogenerate_magics
(
'
/opt/bluesky/beamlinetools/beamlinetools/BEAMLINE_CONFIG/plans.py
'
)
...
...
This diff is collapsed.
Click to expand it.
beamlinetools/magics/standard_magics.py
+
12
−
4
View file @
94cffaef
...
...
@@ -418,7 +418,13 @@ class BlueskyMagicsBessy(Magics, metaclass=MetaclassForClassProperties):
None
"""
try
:
axis_value
=
eval
(
axis
+
'
.get()
'
,
self
.
shell
.
user_ns
)
command
=
f
"
asyncio.run(
{
axis
}
.read())
"
# this is the command to use once we update the container,
# Peter added it, should give directlz the value
# command = f"asyncio.run({axis}.get_value())"
axis_dict
=
eval
(
command
,
self
.
shell
.
user_ns
)
keys
=
list
(
axis_dict
.
keys
())
axis_value
=
axis_dict
[
keys
[
0
]][
'
value
'
]
except
Exception
as
e
:
# print(f'exception {e}')
axis_value
=
'
Disconnected
'
...
...
@@ -464,11 +470,13 @@ class BlueskyMagicsBessy(Magics, metaclass=MetaclassForClassProperties):
else
:
# Show all labels.
labels
=
list
(
devices_dict
.
keys
())
additional_labels
=
[
lab
for
lab
in
self
.
label_axis_dict
.
keys
()
if
lab
not
in
labels
]
labels
.
extend
(
additional_labels
)
additional_labels
=
[
lab
for
lab
in
self
.
label_axis_dict
.
keys
()
if
lab
not
in
labels
]
labels
.
extend
(
additional_labels
)
for
label
in
labels
:
headers
=
[
'
Positioner
'
,
'
Value
'
]
LINE_FMT
=
'
{: <
3
0} {: <11}
'
LINE_FMT
=
'
{: <
4
0} {: <11}
'
lines
=
[]
lines
.
append
(
LINE_FMT
.
format
(
*
headers
))
try
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment