Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EbsFlags
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
Accelerators
System
EbsFlags
Commits
f2789213
Commit
f2789213
authored
2 years ago
by
Nicolas Leclercq
Browse files
Options
Downloads
Patches
Plain Diff
initial import
parent
a04f82a0
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
server/EbsFlags.py
+14
-14
14 additions, 14 deletions
server/EbsFlags.py
with
14 additions
and
14 deletions
server/EbsFlags.py
+
14
−
14
View file @
f2789213
...
...
@@ -16,7 +16,7 @@ from tango.server import Device, device_property, command, attribute, run
###################################################################################################
class
EbsFlags
(
Device
):
InjectionInProgressTmoInSeconds
=
device_property
(
dtype
=
tango
.
DevUShort
,
default_value
=
120
)
TopUp
InjectionInProgressTmoInSeconds
=
device_property
(
dtype
=
tango
.
DevUShort
,
default_value
=
120
)
class
TangoHandler
(
logging
.
Handler
):
...
...
@@ -67,9 +67,9 @@ class EbsFlags(Device):
t
.
name
=
"
MAIN
"
# EBS flags
self
.
__flags
=
{
'
InjectionInProgress
'
:
{
'
value
'
:
False
,
'
timeout
'
:
self
.
InjectionInProgressTmoInSeconds
,
'
timestamp
'
:
datetime
.
datetime
.
now
()}
'
TopUp
InjectionInProgress
'
:
{
'
value
'
:
False
,
'
timeout
'
:
self
.
TopUp
InjectionInProgressTmoInSeconds
,
'
timestamp
'
:
datetime
.
datetime
.
now
()}
}
self
.
__injection_in_progress
=
False
# setup the device logger
...
...
@@ -105,22 +105,22 @@ class EbsFlags(Device):
elapsed_seconds
=
(
datetime
.
datetime
.
now
()
-
flag_info
[
'
timestamp
'
]).
total_seconds
()
if
flag_info
[
'
value
'
]
and
elapsed_seconds
>=
flag_info
[
'
timeout
'
]:
self
.
__logger
.
info
(
"
timeout expires for flag
'
{}
'
- resetting it
'
s value to False
"
.
format
(
flag
))
self
.
__flags
[
'
InjectionInProgress
'
][
'
timestamp
'
]
=
datetime
.
datetime
.
now
()
self
.
__flags
[
'
InjectionInProgress
'
][
'
value
'
]
=
False
self
.
__flags
[
flag
][
'
timestamp
'
]
=
datetime
.
datetime
.
now
()
self
.
__flags
[
flag
][
'
value
'
]
=
False
@attribute
(
dtype
=
[
str
],
max_dim_x
=
4096
)
def
Traces
(
self
):
return
list
(
self
.
__traces
)
@attribute
(
dtype
=
tango
.
DevBoolean
)
def
InjectionInProgress
(
self
):
return
self
.
__flags
[
'
InjectionInProgress
'
][
'
value
'
]
@InjectionInProgress.write
def
InjectionInProgress
(
self
,
iip
:
bool
):
self
.
__logger
.
info
(
"
flag InjectionInProgress set to {}
"
.
format
(
iip
))
self
.
__flags
[
'
InjectionInProgress
'
][
'
timestamp
'
]
=
datetime
.
datetime
.
now
()
self
.
__flags
[
'
InjectionInProgress
'
][
'
value
'
]
=
iip
def
TopUp
InjectionInProgress
(
self
):
return
self
.
__flags
[
'
TopUp
InjectionInProgress
'
][
'
value
'
]
@
TopUp
InjectionInProgress.write
def
TopUp
InjectionInProgress
(
self
,
iip
:
bool
):
self
.
__logger
.
info
(
"
flag
TopUp
InjectionInProgress set to {}
"
.
format
(
iip
))
self
.
__flags
[
'
TopUp
InjectionInProgress
'
][
'
timestamp
'
]
=
datetime
.
datetime
.
now
()
self
.
__flags
[
'
TopUp
InjectionInProgress
'
][
'
value
'
]
=
iip
if
__name__
==
'
__main__
'
:
try
:
...
...
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