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
21c2b6be
Commit
21c2b6be
authored
8 years ago
by
Martin Christoph Hierholzer
Browse files
Options
Downloads
Patches
Plain Diff
eliminated the DeviceAccessor class, since a standard NDRegisterAccessor can be used instead
parent
dc2da2c3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/Application.h
+0
-3
0 additions, 3 deletions
include/Application.h
include/DeviceAccessor.h
+0
-94
0 additions, 94 deletions
include/DeviceAccessor.h
src/Application.cc
+2
-7
2 additions, 7 deletions
src/Application.cc
with
2 additions
and
104 deletions
include/Application.h
+
0
−
3
View file @
21c2b6be
...
...
@@ -29,9 +29,6 @@ namespace ChimeraTK {
template
<
typename
UserType
>
class
Accessor
;
template
<
typename
UserType
>
class
DeviceAccessor
;
class
Application
:
public
ApplicationBase
,
public
EntityOwner
{
public:
...
...
This diff is collapsed.
Click to expand it.
include/DeviceAccessor.h
deleted
100644 → 0
+
0
−
94
View file @
dc2da2c3
/*
* DeviceAccessor.h
*
* Created on: Jun 10, 2016
* Author: Martin Hierholzer
*/
#ifndef CHIMERATK_DEVICE_ACCESSOR_H
#define CHIMERATK_DEVICE_ACCESSOR_H
#include
<mtca4u/NDRegisterAccessor.h>
#include
"Accessor.h"
namespace
ChimeraTK
{
/** A DeviceAccessor is used to provide access to register accessors from the DeviceAccess library. It is a temporary
* adapter class which harmonises the different interfaces. @todo TODO Once the control system adapter and the
* DeviceAccess interfaces have been harmonised, this class is no longer needed! */
template
<
typename
UserType
>
class
DeviceAccessor
:
public
mtca4u
::
NDRegisterAccessor
<
UserType
>
{
public:
/** */
DeviceAccessor
(
boost
::
shared_ptr
<
mtca4u
::
NDRegisterAccessor
<
UserType
>>
ndRegisterAccessor
,
VariableDirection
direction
,
UpdateMode
mode
)
:
mtca4u
::
NDRegisterAccessor
<
UserType
>
(
ndRegisterAccessor
->
getName
()),
impl
(
ndRegisterAccessor
),
_direction
(
direction
),
_mode
(
mode
)
{
mtca4u
::
NDRegisterAccessor
<
UserType
>::
buffer_2D
.
resize
(
impl
->
getNumberOfChannels
()
);
for
(
size_t
i
=
0
;
i
<
impl
->
getNumberOfChannels
();
i
++
)
{
mtca4u
::
NDRegisterAccessor
<
UserType
>::
buffer_2D
[
i
].
resize
(
impl
->
getNumberOfSamples
()
);
}
}
void
doReadTransfer
()
override
{
impl
->
read
();
}
bool
doReadTransferNonBlocking
()
override
{
return
impl
->
readNonBlocking
();
}
void
postRead
()
override
{
mtca4u
::
NDRegisterAccessor
<
UserType
>::
buffer_2D
[
0
].
swap
(
impl
->
accessChannel
(
0
));
}
void
write
()
override
{
mtca4u
::
NDRegisterAccessor
<
UserType
>::
buffer_2D
[
0
].
swap
(
impl
->
accessChannel
(
0
));
impl
->
write
();
mtca4u
::
NDRegisterAccessor
<
UserType
>::
buffer_2D
[
0
].
swap
(
impl
->
accessChannel
(
0
));
}
unsigned
int
getNInputQueueElements
()
const
override
{
return
impl
->
getNInputQueueElements
();
}
bool
isSameRegister
(
const
boost
::
shared_ptr
<
const
mtca4u
::
TransferElement
>&
other
)
const
override
{
return
impl
->
isSameRegister
(
other
);
}
bool
isReadOnly
()
const
override
{
return
impl
->
isReadOnly
();
}
bool
isReadable
()
const
override
{
return
impl
->
isReadable
();
}
bool
isWriteable
()
const
override
{
return
impl
->
isWriteable
();
}
std
::
vector
<
boost
::
shared_ptr
<
mtca4u
::
TransferElement
>
>
getHardwareAccessingElements
()
override
{
return
impl
->
getHardwareAccessingElements
();
}
void
replaceTransferElement
(
boost
::
shared_ptr
<
mtca4u
::
TransferElement
>
other
)
override
{
impl
->
replaceTransferElement
(
other
);
}
protected
:
boost
::
shared_ptr
<
mtca4u
::
NDRegisterAccessor
<
UserType
>>
impl
;
VariableDirection
_direction
;
UpdateMode
_mode
;
};
}
/* namespace ChimeraTK */
#endif
/* CHIMERATK_DEVICE_ACCESSOR_H */
This diff is collapsed.
Click to expand it.
src/Application.cc
+
2
−
7
View file @
21c2b6be
...
...
@@ -18,7 +18,6 @@
#include
"Application.h"
#include
"ApplicationModule.h"
#include
"Accessor.h"
#include
"DeviceAccessor.h"
#include
"ThreadedFanOut.h"
#include
"ConsumingFanOut.h"
#include
"FeedingFanOut.h"
...
...
@@ -265,12 +264,8 @@ boost::shared_ptr<mtca4u::NDRegisterAccessor<UserType>> Application::createDevic
mtca4u
::
AccessModeFlags
flags
{};
if
(
mode
==
UpdateMode
::
push
&&
direction
==
VariableDirection
::
consuming
)
flags
=
{
AccessMode
::
wait_for_new_data
};
// create DeviceAccessor for the proper UserType
boost
::
shared_ptr
<
mtca4u
::
NDRegisterAccessor
<
UserType
>>
impl
;
auto
regacc
=
deviceMap
[
deviceAlias
]
->
getRegisterAccessor
<
UserType
>
(
registerName
,
nElements
,
0
,
flags
);
impl
.
reset
(
new
DeviceAccessor
<
UserType
>
(
regacc
,
direction
,
mode
));
return
impl
;
// return the register accessor from the device
return
deviceMap
[
deviceAlias
]
->
getRegisterAccessor
<
UserType
>
(
registerName
,
nElements
,
0
,
flags
);
}
/*********************************************************************************************************************/
...
...
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