Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Benoit Rousselle
bliss
Commits
cdedab50
Commit
cdedab50
authored
May 21, 2019
by
Sebastien Petitdemange
Browse files
flint: follow new way of watching_session
parent
dbf1c61a
Changes
1
Hide whitespace changes
Inline
Side-by-side
bliss/flint/flint.py
View file @
cdedab50
...
...
@@ -434,32 +434,22 @@ class Flint:
local_event
=
self
.
_last_event
self
.
_last_event
=
dict
()
for
(
master_name
,
_
),
(
data_type
,
data
)
in
local_event
.
items
():
last_data
=
data
[
"data"
]
if
data_type
in
(
"1d"
,
"2d"
):
if
data_type
==
"2d"
:
last_data
.
from_stream
=
True
try
:
last_data
=
last_data
[
-
1
]
except
IndexError
:
continue
else
:
data
[
"channel_index"
]
=
0
try
:
self
.
_new_scan_data
(
data_type
,
master_name
,
data
,
last_
data
)
self
.
_new_scan_data
(
data_type
,
master_name
,
data
)
except
:
sys
.
excepthook
(
*
sys
.
exc_info
())
finally
:
self
.
_refresh_task
=
None
def
_new_scan_data
(
self
,
data_type
,
master_name
,
data
,
last_
data
):
def
_new_scan_data
(
self
,
data_type
,
master_name
,
data
):
if
data_type
==
"0d"
:
for
plot
in
self
.
live_scan_plots_dict
[
master_name
][
"0d"
]:
for
channel_name
,
channel_data
in
last_data
.
items
():
self
.
update_data
(
plot
.
plot_id
,
channel_name
,
channel_data
)
plot
.
update_all
()
elif
data_type
==
"1d"
:
spectrum_data
=
last_data
channel_name
=
data
[
"channel_name"
]
spectrum_data
=
data
[
"channel_data_node"
].
get
(
-
1
)
plot
=
self
.
live_scan_plots_dict
[
master_name
][
"1d"
][
data
[
"channel_index"
]]
self
.
update_data
(
plot
.
plot_id
,
channel_name
,
spectrum_data
)
if
spectrum_data
.
ndim
==
1
:
...
...
@@ -472,9 +462,13 @@ class Flint:
y
=
spectrum_data
[
1
]
plot
.
addCurve
(
x
,
y
,
legend
=
channel_name
)
elif
data_type
==
"2d"
:
plot
=
self
.
live_scan_plots_dict
[
master_name
][
"2d"
][
data
[
"channel_index"
]]
channel_name
=
data
[
"channel_name"
]
image_data
=
last_data
channel_data_node
=
data
[
"channel_data_node"
]
channel_data_node
.
from_stream
=
True
image_view
=
channel_data_node
.
get
(
-
1
)
image_data
=
image_view
.
get
(
-
1
)
self
.
update_data
(
plot
.
plot_id
,
channel_name
,
image_data
)
plot_image
=
plot
.
getImage
(
channel_name
)
# returns last plotted image
if
plot_image
is
None
:
...
...
Write
Preview
Supports
Markdown
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