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
33b4a179
Commit
33b4a179
authored
4 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
added move constructors to StatusMonitors
parent
ff22ae12
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
Modules/include/StatusMonitor.h
+14
-13
14 additions, 13 deletions
Modules/include/StatusMonitor.h
with
14 additions
and
13 deletions
Modules/include/StatusMonitor.h
+
14
−
13
View file @
33b4a179
...
...
@@ -45,13 +45,14 @@ namespace ChimeraTK {
* needs to identify any StatusMonitor.
*/
struct
StatusMonitor
:
public
ApplicationModule
{
StatusMonitor
(
EntityOwner
*
owner
,
const
std
::
string
&
name
,
const
std
::
string
&
description
,
const
std
::
string
&
input
,
const
std
::
string
&
output
,
HierarchyModifier
modifier
,
const
std
::
unordered_set
<
std
::
string
>&
outputTags
=
{},
const
std
::
unordered_set
<
std
::
string
>&
parameterTags
=
{},
const
std
::
unordered_set
<
std
::
string
>&
tags
=
{})
:
ApplicationModule
(
owner
,
name
,
description
,
modifier
,
tags
),
_parameterTags
(
parameterTags
),
_input
(
input
),
status
(
this
,
output
,
""
,
""
,
outputTags
)
{}
StatusMonitor
(
StatusMonitor
&&
)
=
default
;
~
StatusMonitor
()
override
{}
void
prepare
()
override
{}
...
...
@@ -69,7 +70,6 @@ namespace ChimeraTK {
ScalarPushInput
<
int
>
disable
{
this
,
"disable"
,
""
,
"Disable the status monitor"
};
};
/** Common template base class for StatusMonitors
*
* This provides a ScalarPushInput for the variable to be monitored, which
...
...
@@ -77,18 +77,19 @@ namespace ChimeraTK {
*/
template
<
typename
T
>
struct
StatusMonitorImpl
:
public
StatusMonitor
{
/** Number of convience constructors for ease of use.
* The input and output variable names can be given by user which
* should be mapped with the variables of module to be watched.
*/
StatusMonitorImpl
(
EntityOwner
*
owner
,
const
std
::
string
&
name
,
const
std
::
string
&
description
,
const
std
::
string
&
input
,
const
std
::
string
&
output
,
HierarchyModifier
modifier
,
const
std
::
unordered_set
<
std
::
string
>&
outputTags
=
{},
StatusMonitorImpl
(
EntityOwner
*
owner
,
const
std
::
string
&
name
,
const
std
::
string
&
description
,
const
std
::
string
&
input
,
const
std
::
string
&
output
,
HierarchyModifier
modifier
,
const
std
::
unordered_set
<
std
::
string
>&
outputTags
=
{},
const
std
::
unordered_set
<
std
::
string
>&
parameterTags
=
{},
const
std
::
unordered_set
<
std
::
string
>&
tags
=
{})
:
StatusMonitor
(
owner
,
name
,
description
,
input
,
output
,
modifier
,
outputTags
,
parameterTags
,
tags
),
oneUp
(
this
,
input
){}
oneUp
(
this
,
input
)
{}
StatusMonitorImpl
()
{
throw
logic_error
(
"Default constructor unusable. Just exists to work around gcc bug."
);
}
StatusMonitorImpl
(
StatusMonitorImpl
&&
)
=
default
;
~
StatusMonitorImpl
()
override
{}
void
prepare
()
override
{}
...
...
@@ -118,7 +119,7 @@ namespace ChimeraTK {
// evaluate and publish first, then read and wait. This takes care of the publishing the initial variables
if
(
StatusMonitorImpl
<
T
>::
disable
!=
0
)
{
StatusMonitorImpl
<
T
>::
status
=
OFF
;
}
}
else
if
(
StatusMonitorImpl
<
T
>::
oneUp
.
watch
>=
error
)
{
StatusMonitorImpl
<
T
>::
status
=
ERROR
;
}
...
...
@@ -151,7 +152,7 @@ namespace ChimeraTK {
while
(
true
)
{
if
(
StatusMonitorImpl
<
T
>::
disable
!=
0
)
{
StatusMonitorImpl
<
T
>::
status
=
OFF
;
}
}
else
if
(
StatusMonitorImpl
<
T
>::
oneUp
.
watch
<=
error
)
{
StatusMonitorImpl
<
T
>::
status
=
ERROR
;
}
...
...
@@ -192,12 +193,12 @@ namespace ChimeraTK {
/**This is where state evaluation is done*/
void
mainLoop
()
{
/** If there is a change either in value monitored or in thershold values, the status is re-evaluated*/
ReadAnyGroup
group
{
StatusMonitorImpl
<
T
>::
oneUp
.
watch
,
StatusMonitorImpl
<
T
>::
disable
,
warningUpperThreshold
,
warningLowerThreshold
,
errorUpperThreshold
,
errorLowerThreshold
};
ReadAnyGroup
group
{
StatusMonitorImpl
<
T
>::
oneUp
.
watch
,
StatusMonitorImpl
<
T
>::
disable
,
warningUpperThreshold
,
warningLowerThreshold
,
errorUpperThreshold
,
errorLowerThreshold
};
while
(
true
)
{
if
(
StatusMonitorImpl
<
T
>::
disable
!=
0
)
{
StatusMonitorImpl
<
T
>::
status
=
OFF
;
}
}
// Check for error limits first. Like this they supersede the warning,
// even if they are stricter then the warning limits (mis-configuration)
else
if
(
StatusMonitorImpl
<
T
>::
oneUp
.
watch
<=
errorLowerThreshold
||
...
...
@@ -233,7 +234,7 @@ namespace ChimeraTK {
while
(
true
)
{
if
(
StatusMonitorImpl
<
T
>::
disable
!=
0
)
{
StatusMonitorImpl
<
T
>::
status
=
OFF
;
}
}
else
if
(
StatusMonitorImpl
<
T
>::
oneUp
.
watch
!=
requiredValue
)
{
StatusMonitorImpl
<
T
>::
status
=
ERROR
;
}
...
...
@@ -264,7 +265,7 @@ namespace ChimeraTK {
while
(
true
)
{
if
(
StatusMonitorImpl
<
T
>::
disable
!=
0
)
{
StatusMonitorImpl
<
T
>::
status
=
OFF
;
}
}
else
if
(
StatusMonitorImpl
<
T
>::
oneUp
.
watch
!=
nominalState
)
{
StatusMonitorImpl
<
T
>::
status
=
ERROR
;
}
...
...
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