Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ApplicationCore
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ChimeraTK Mirror
ApplicationCore
Commits
f602a0ab
Unverified
Commit
f602a0ab
authored
4 years ago
by
Jens Georg
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #149 from ChimeraTK/wip-phako-144
Remove DeviceModule::writeOnOpen
parents
73948f83
07d059e4
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/DeviceModule.h
+0
-4
0 additions, 4 deletions
include/DeviceModule.h
src/Application.cc
+9
-4
9 additions, 4 deletions
src/Application.cc
src/DeviceModule.cc
+8
-3
8 additions, 3 deletions
src/DeviceModule.cc
src/ExceptionHandlingDecorator.cc
+0
-3
0 additions, 3 deletions
src/ExceptionHandlingDecorator.cc
with
17 additions
and
14 deletions
include/DeviceModule.h
+
0
−
4
View file @
f602a0ab
...
...
@@ -257,10 +257,6 @@ namespace ChimeraTK {
* The function is running an endless loop inside its own thread (moduleThread). */
void
handleException
();
/** List of TransferElements to be written after the device has been opened. This is used to write constant feeders
* to the device. */
std
::
list
<
boost
::
shared_ptr
<
TransferElement
>>
writeAfterOpen
;
/** List of TransferElements to be written after the device has been recovered.
* See function addRecoveryAccessor() for details.*/
std
::
list
<
boost
::
shared_ptr
<
TransferElement
>>
writeRecoveryOpen
;
...
...
This diff is collapsed.
Click to expand it.
src/Application.cc
+
9
−
4
View file @
f602a0ab
...
...
@@ -1006,8 +1006,13 @@ void Application::typedMakeConnection(VariableNetwork& network) {
impl
->
write
();
}
else
if
(
consumer
.
getType
()
==
NodeType
::
Device
)
{
auto
impl
=
createDeviceVariable
<
UserType
>
(
consumer
.
getDeviceAlias
(),
consumer
.
getRegisterName
(),
{
VariableDirection
::
consuming
,
false
},
consumer
.
getMode
(),
consumer
.
getNumberOfElements
());
// we register the required accessor as a recovery accessor. This is just a bare RegisterAccessor without any decorations directly from the backend.
if
(
deviceMap
.
count
(
consumer
.
getDeviceAlias
())
==
0
)
{
deviceMap
[
consumer
.
getDeviceAlias
()]
=
ChimeraTK
::
BackendFactory
::
getInstance
().
createBackend
(
consumer
.
getDeviceAlias
());
}
auto
impl
=
deviceMap
[
consumer
.
getDeviceAlias
()]
->
getRegisterAccessor
<
UserType
>
(
consumer
.
getRegisterName
(),
consumer
.
getNumberOfElements
(),
0
,
{});
impl
->
accessChannel
(
0
)
=
feedingImpl
->
accessChannel
(
0
);
// find the right DeviceModule for this alias name
DeviceModule
*
devmod
=
nullptr
;
...
...
@@ -1018,8 +1023,8 @@ void Application::typedMakeConnection(VariableNetwork& network) {
}
}
assert
(
devmod
!=
nullptr
);
// register feeder to be written after the device has been opened
devmod
->
writeAfterOpen
.
push_back
(
impl
);
devmod
->
addRecoveryAccessor
(
impl
);
}
else
if
(
consumer
.
getType
()
==
NodeType
::
TriggerReceiver
)
{
throw
ChimeraTK
::
logic_error
(
"Using constants as triggers is not supported!"
);
...
...
This diff is collapsed.
Click to expand it.
src/DeviceModule.cc
+
8
−
3
View file @
f602a0ab
...
...
@@ -294,13 +294,16 @@ namespace ChimeraTK {
}
}
}
// The device was successfully opened, try to initialise it
try
{
for
(
auto
&
initHandler
:
initialisationHandlers
)
{
initHandler
(
this
);
}
for
(
auto
&
te
:
writeAfterOpen
)
{
te
->
write
();
for
(
auto
&
te
:
writeRecoveryOpen
)
{
if
(
te
->
getVersionNumber
()
!=
VersionNumber
{
nullptr
})
{
te
->
write
();
}
}
}
catch
(
ChimeraTK
::
runtime_error
&
e
)
{
...
...
@@ -377,7 +380,9 @@ namespace ChimeraTK {
{
// scope for the lock guard
boost
::
unique_lock
<
boost
::
shared_mutex
>
uniqueLock
(
recoverySharedMutex
);
for
(
auto
&
te
:
writeRecoveryOpen
)
{
te
->
write
();
if
(
te
->
getVersionNumber
()
!=
VersionNumber
{
nullptr
})
{
te
->
write
();
}
}
}
// end of scope for the lock guard
}
...
...
This diff is collapsed.
Click to expand it.
src/ExceptionHandlingDecorator.cc
+
0
−
3
View file @
f602a0ab
...
...
@@ -52,9 +52,6 @@ namespace ChimeraTK {
// If the application has not yet fully started, we cannot wait for the device to open. Instead register
// the variable in the DeviceMoule, so the transfer will be performed after the device is opened.
assert
(
_recoveryAccessor
!=
nullptr
);
// should always be true for writeable registers with this decorator
// Note: it's ok to use the recoveryAccessor here as well, since device opening and recovery happens in the
// same thread in the DeviceModule.
deviceModule
.
writeAfterOpen
.
push_back
(
this
->
_recoveryAccessor
);
return
false
;
}
// We artificially increase the testabel mode counter so the test does not slip out of testable mode here in case
...
...
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