Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ID11
id11
Commits
c6ebfc3e
Commit
c6ebfc3e
authored
Oct 13, 2021
by
Emmanuel Papillon
Browse files
icepap_log added
parent
07515c3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
id11/icepos_log.py
0 → 100644
View file @
c6ebfc3e
def
icepos_log
(
quiet
=
True
):
import
time
import
bliss.common.session
current_session
=
bliss
.
common
.
session
.
get_current_session
()
global_map
=
bliss
.
common
.
session
.
global_map
logpath
=
"/users/opid11/logfiles/"
logname
=
current_session
.
name
+
time
.
strftime
(
"%Y%m%dT%Hh%M"
)
print
(
"Logging motor positions to:"
,
logpath
+
logname
)
with
open
(
logpath
+
logname
,
"a"
)
as
f
:
for
ax
in
global_map
.
get_axes_iter
():
if
hasattr
(
ax
.
controller
,
"read_encoder_all_types"
):
msg
=
"Name %s user %f dial %f limits %f %f %s
\n
"
%
(
ax
.
name
,
ax
.
position
,
ax
.
dial
,
ax
.
limits
[
0
],
ax
.
limits
[
1
],
ax
.
controller
.
read_encoder_all_types
(
ax
),
)
f
.
write
(
msg
)
if
not
quiet
:
print
(
msg
,
end
=
" "
)
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment