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
fb46b5d7
Commit
fb46b5d7
authored
4 years ago
by
Martin Christoph Hierholzer
Browse files
Options
Downloads
Patches
Plain Diff
fix not testable-mode decorating return channels of CS to app variables
parent
4448698f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Application.cc
+27
-19
27 additions, 19 deletions
src/Application.cc
with
27 additions
and
19 deletions
src/Application.cc
+
27
−
19
View file @
fb46b5d7
...
@@ -446,30 +446,38 @@ boost::shared_ptr<ChimeraTK::NDRegisterAccessor<UserType>> Application::createPr
...
@@ -446,30 +446,38 @@ boost::shared_ptr<ChimeraTK::NDRegisterAccessor<UserType>> Application::createPr
auto
varId
=
getNextVariableId
();
auto
varId
=
getNextVariableId
();
pvIdMap
[
pvar
->
getUniqueId
()]
=
varId
;
pvIdMap
[
pvar
->
getUniqueId
()]
=
varId
;
// Decorate the process variable if testable mode is enabled and this is the
// Decorate the process variable if testable mode is enabled and this is the
receiving end of the variable (feeding
//
receiving end of the variable (feeding to the network)
. Also don't decorate, if the mode is polling.
//
to the network), or a bidirectional consumer
. Also don't decorate, if the mode is polling.
Instead flag the
//
Instead flag the
variable to be polling, so the TestFacility is aware of
// variable to be polling, so the TestFacility is aware of
this.
// this.
if
(
testableMode
)
{
if
(
testableMode
&&
node
.
getDirection
().
dir
==
VariableDirection
::
feeding
)
{
if
(
node
.
getDirection
().
dir
==
VariableDirection
::
feeding
)
{
// The transfer mode of this process variable is considered to be polling,
// The transfer mode of this process variable is considered to be polling,
// if only one consumer exists and this consumer is polling. Reason:
// if only one consumer exists and this consumer is polling. Reason:
// mulitple consumers will result in the use of a FanOut, so the
// mulitple consumers will result in the use of a FanOut, so the
// communication up to the FanOut will be push-type, even if all consumers
// communication up to the FanOut will be push-type, even if all consumers
// are poll-type.
// are poll-type.
/// @todo Check if this is true!
/// @todo Check if this is true!
auto
mode
=
UpdateMode
::
push
;
auto
mode
=
UpdateMode
::
push
;
if
(
node
.
getOwner
().
countConsumingNodes
()
==
1
)
{
if
(
node
.
getOwner
().
countConsumingNodes
()
==
1
)
{
if
(
node
.
getOwner
().
getConsumingNodes
().
front
().
getMode
()
==
UpdateMode
::
poll
)
mode
=
UpdateMode
::
poll
;
if
(
node
.
getOwner
().
getConsumingNodes
().
front
().
getMode
()
==
UpdateMode
::
poll
)
mode
=
UpdateMode
::
poll
;
}
}
if
(
mode
!=
UpdateMode
::
poll
)
{
if
(
mode
!=
UpdateMode
::
poll
)
{
auto
pvarDec
=
boost
::
make_shared
<
TestableModeAccessorDecorator
<
UserType
>>
(
pvar
,
true
,
false
,
varId
,
varId
);
testableMode_names
[
varId
]
=
"ControlSystem:"
+
node
.
getPublicName
();
return
pvarDec
;
}
else
{
testableMode_isPollMode
[
varId
]
=
true
;
}
}
else
if
(
node
.
getDirection
().
withReturn
)
{
// Return channels are always push. The decorator must handle only reads on the return channel, since writes into
// the control system do not block the testable mode.
auto
pvarDec
=
boost
::
make_shared
<
TestableModeAccessorDecorator
<
UserType
>>
(
pvar
,
true
,
false
,
varId
,
varId
);
auto
pvarDec
=
boost
::
make_shared
<
TestableModeAccessorDecorator
<
UserType
>>
(
pvar
,
true
,
false
,
varId
,
varId
);
testableMode_names
[
varId
]
=
"ControlSystem:"
+
node
.
getPublicName
();
testableMode_names
[
varId
]
=
"ControlSystem:"
+
node
.
getPublicName
();
return
pvarDec
;
return
pvarDec
;
}
}
else
{
testableMode_isPollMode
[
varId
]
=
true
;
}
}
}
// return the process variable
// return the process variable
...
...
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