Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ControlSystemAdapter-DoocsAdapter
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
ControlSystemAdapter-DoocsAdapter
Commits
7bd69cc1
Commit
7bd69cc1
authored
4 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
IFFF: Hacked in the first version CS->app
* compiles but untested * existing tests for app->CS still passing.
parent
934a3e04
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/DoocsIfff.h
+7
-1
7 additions, 1 deletion
include/DoocsIfff.h
src/DoocsIfff.cc
+37
-2
37 additions, 2 deletions
src/DoocsIfff.cc
with
44 additions
and
3 deletions
include/DoocsIfff.h
+
7
−
1
View file @
7bd69cc1
...
...
@@ -27,13 +27,19 @@ namespace ChimeraTK {
boost
::
shared_ptr
<
NDRegisterAccessor
<
float
>>
const
&
f2Value
,
boost
::
shared_ptr
<
NDRegisterAccessor
<
float
>>
const
&
f3Value
,
DoocsUpdater
&
updater
);
void
set
(
EqAdr
*
eqAdr
,
EqData
*
data1
,
EqData
*
data2
,
EqFct
*
eqFct
)
override
;
void
auto_init
(
void
)
override
;
protected:
void
updateValues
(
TransferElementID
&
elementId
);
void
updateAppToDoocs
(
TransferElementID
&
elementId
);
void
sendToApplication
();
DataConsistencyGroup
_consistencyGroup
;
boost
::
shared_ptr
<
NDRegisterAccessor
<
int
>>
_i1Value
;
boost
::
shared_ptr
<
NDRegisterAccessor
<
float
>>
_f1Value
;
boost
::
shared_ptr
<
NDRegisterAccessor
<
float
>>
_f2Value
;
boost
::
shared_ptr
<
NDRegisterAccessor
<
float
>>
_f3Value
;
bool
isWriteable
;
};
}
// namespace ChimeraTK
This diff is collapsed.
Click to expand it.
src/DoocsIfff.cc
+
37
−
2
View file @
7bd69cc1
...
...
@@ -12,7 +12,7 @@ namespace ChimeraTK {
:
D_ifff
(
eqFct
,
doocsPropertyName
),
_i1Value
(
i1Value
),
_f1Value
(
f1Value
),
_f2Value
(
f2Value
),
_f3Value
(
f3Value
)
{
auto
registerSource
=
[
&
](
const
ChimeraTK
::
TransferElementAbstractor
&
var
)
{
if
(
var
.
isReadable
())
{
updater
.
addVariable
(
var
,
eqFct
,
std
::
bind
(
&
DoocsIfff
::
update
Value
s
,
this
,
var
.
getId
()));
updater
.
addVariable
(
var
,
eqFct
,
std
::
bind
(
&
DoocsIfff
::
update
AppToDooc
s
,
this
,
var
.
getId
()));
_consistencyGroup
.
add
(
var
);
}
};
...
...
@@ -20,9 +20,15 @@ namespace ChimeraTK {
registerSource
(
OneDRegisterAccessor
<
float
>
(
_f1Value
));
registerSource
(
OneDRegisterAccessor
<
float
>
(
_f2Value
));
registerSource
(
OneDRegisterAccessor
<
float
>
(
_f3Value
));
// FIXME: get this from a constructor parameter isReadOnly so this can be turned off
isWriteable
=
true
;
if
(
!
_i1Value
->
isWriteable
()
||
!
_f1Value
->
isWriteable
()
||
!
_f2Value
->
isWriteable
()
||
!
_f3Value
->
isWriteable
())
{
isWriteable
=
false
;
}
}
void
DoocsIfff
::
update
Value
s
(
TransferElementID
&
elementId
)
{
void
DoocsIfff
::
update
AppToDooc
s
(
TransferElementID
&
elementId
)
{
if
(
_consistencyGroup
.
update
(
elementId
))
{
if
(
_i1Value
->
dataValidity
()
!=
ChimeraTK
::
DataValidity
::
ok
||
_f1Value
->
dataValidity
()
!=
ChimeraTK
::
DataValidity
::
ok
||
...
...
@@ -58,4 +64,33 @@ namespace ChimeraTK {
}
}
}
void
DoocsIfff
::
set
(
EqAdr
*
eqAdr
,
EqData
*
data1
,
EqData
*
data2
,
EqFct
*
eqFct
)
{
D_ifff
::
set
(
eqAdr
,
data1
,
data2
,
eqFct
);
// inherited functionality fill the local doocs buffer
sendToApplication
();
}
void
DoocsIfff
::
auto_init
(
void
)
{
D_ifff
::
auto_init
();
// inherited functionality fill the local doocs buffer
if
(
isWriteable
)
{
sendToApplication
();
}
}
void
DoocsIfff
::
sendToApplication
()
{
IFFF
*
ifff
=
value
();
_i1Value
->
accessData
(
0
)
=
ifff
->
i1_data
;
_f1Value
->
accessData
(
0
)
=
ifff
->
f1_data
;
_f2Value
->
accessData
(
0
)
=
ifff
->
f2_data
;
_f3Value
->
accessData
(
0
)
=
ifff
->
f3_data
;
// write all with the same version number
VersionNumber
v
=
{};
_i1Value
->
write
(
v
);
_f1Value
->
write
(
v
);
_f2Value
->
write
(
v
);
_f3Value
->
write
(
v
);
}
}
// namespace ChimeraTK
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