Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Rongkun Wang
swrod
Commits
46f0a305
Commit
46f0a305
authored
Mar 22, 2022
by
Serguei Kolos
Browse files
Finalize resources handling for stop/start of a run
parent
a0b3b04d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Core.cpp
View file @
46f0a305
...
...
@@ -417,11 +417,6 @@ void Core::ROB::enable(uint32_t lastL1ID) {
return
;
}
// The order is important. First the links, which were explicitly disabled
// must be re enabled
std
::
vector
<
InputLinkId
>
links
(
m_disabled_elinks
.
begin
(),
m_disabled_elinks
.
end
());
enableLinks
(
links
,
lastL1ID
);
m_builder
->
enable
(
lastL1ID
,
0
);
m_enabled
=
true
;
for
(
auto
&
c
:
m_consumers
)
{
...
...
@@ -447,7 +442,11 @@ void Core::ROB::runStarted(const RunParams & run_params) {
// Re enables all temporary disabled resources which could have been disabled
// during the last run. Must be called after the runStarted()
// The order is important. First the ORB has to be enabled and only then
// the E-Links which were explicitly disabled.
std
::
vector
<
InputLinkId
>
links
(
m_disabled_elinks
.
begin
(),
m_disabled_elinks
.
end
());
enable
(
-
1
);
enableLinks
(
links
,
-
1
);
}
void
Core
::
ROB
::
runStopped
()
{
...
...
src/DataInputHandlerBase.cpp
View file @
46f0a305
...
...
@@ -96,14 +96,7 @@ void DataInputHandlerBase::disable() {
ERS_LOG
(
"Disable '"
<<
m_id
<<
"' input handler"
);
m_input
->
executeSynchronousAction
([
this
]{
for
(
Link
&
link
:
m_links
)
{
if
(
link
.
m_enabled
)
{
m_input
->
unsubscribe
(
link
.
m_fid
);
link
.
m_enabled
=
false
;
--
m_links_number
;
ERS_DEBUG
(
1
,
"Unsubscribed from the 0x"
<<
std
::
hex
<<
link
.
m_fid
<<
" input link"
);
}
}
unsubscribeFromFelix
();
disabled
();
});
...
...
@@ -150,12 +143,10 @@ void DataInputHandlerBase::enable(uint32_t lastL1ID, uint64_t triggersNumber) {
<<
" triggers counter = "
<<
std
::
dec
<<
triggersNumber
);
for
(
Link
&
link
:
m_links
)
{
if
(
not
link
.
m_enabled
)
{
if
(
link
.
m_enabled
)
{
m_input
->
subscribe
(
link
.
m_fid
,
m_callback
.
bind
(
link
));
link
.
m_enabled
=
true
;
link
.
m_packets_counter
=
triggersNumber
;
link
.
m_expected_l1id
=
(
lastL1ID
&
0xff000000
)
+
0x01000000
;
++
m_links_number
;
ERS_DEBUG
(
2
,
"Subscribed to the "
<<
std
::
hex
<<
link
.
m_fid
<<
" input link"
);
}
}
...
...
@@ -182,6 +173,12 @@ void DataInputHandlerBase::enableLinks(std::vector<InputLinkId> & link_ids,
continue
;
}
if
(
link
->
m_enabled
)
{
ERS_LOG
(
"Link 0x"
<<
std
::
hex
<<
*
id
<<
" is already enabled"
);
id
=
link_ids
.
erase
(
id
);
continue
;
}
try
{
m_input
->
subscribe
(
link
->
m_fid
,
m_callback
.
bind
(
*
link
));
link
->
m_enabled
=
true
;
...
...
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