Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
LOFAR2.0
tango
Commits
1691f08a
Commit
1691f08a
authored
4 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
Boot into OFF state, requiring explicit INIT (f.e. after other devices have been instantiated).
parent
8746bb42
No related branches found
No related tags found
1 merge request
!1
State management
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
RCUSCC/RCUSCC/RCUSCC.py
+9
-4
9 additions, 4 deletions
RCUSCC/RCUSCC/RCUSCC.py
with
9 additions
and
4 deletions
RCUSCC/RCUSCC/RCUSCC.py
+
9
−
4
View file @
1691f08a
...
@@ -51,14 +51,14 @@ class RCUSCC(Device):
...
@@ -51,14 +51,14 @@ class RCUSCC(Device):
OFF = Device is turned off, drops connection to the hardware,
OFF = Device is turned off, drops connection to the hardware,
The following state transitions are implemented:
The following state transitions are implemented:
boot -> INIT: Triggered by device. Device will initialise when it is started,
boot -> OFF: Triggered by tango. Device will be instantiated,
OFF -> INIT: Triggered by device. Device will initialise (connect to hardware, other devices),
INIT -> STANDBY: Triggered by device. Device is initialised, and is ready for additional configuration by the user,
INIT -> STANDBY: Triggered by device. Device is initialised, and is ready for additional configuration by the user,
STANDBY -> ON: Triggered by user. Device reports to be functional,
STANDBY -> ON: Triggered by user. Device reports to be functional,
* -> FAULT: Triggered by device. Device has degraded to malfunctional, for example because the connection to the hardware is lost,
* -> FAULT: Triggered by device. Device has degraded to malfunctional, for example because the connection to the hardware is lost,
* -> FAULT: Triggered by user. Emulate a forced malfunction for integration testing purposes,
* -> FAULT: Triggered by user. Emulate a forced malfunction for integration testing purposes,
* -> OFF: Triggered by user. Device is turned off. Triggered by the Off() command,
* -> OFF: Triggered by user. Device is turned off. Triggered by the Off() command,
FAULT -> INIT: Triggered by user. Device is reinitialised to recover from an error,
FAULT -> INIT: Triggered by user. Device is reinitialised to recover from an error,
OFF -> INIT: Triggered by user. Device is turned on again.
The user triggers their transitions by the commands reflecting the target state (Init(), On(), Fault()).
The user triggers their transitions by the commands reflecting the target state (Init(), On(), Fault()).
"""
"""
...
@@ -226,11 +226,16 @@ class RCUSCC(Device):
...
@@ -226,11 +226,16 @@ class RCUSCC(Device):
self
.
debug_stream
(
"
Mapping OPC-UA MP/CP to attributes done.
"
)
self
.
debug_stream
(
"
Mapping OPC-UA MP/CP to attributes done.
"
)
def
init_device
(
self
):
def
init_device
(
self
):
"""
In
itialises the attributes and properties of the RCUSCC.
"""
"""
In
stantiates the device in the OFF state.
"""
# NOTE: Will delete_device first, if necessary
# NOTE: Will delete_device first, if necessary
Device
.
init_device
(
self
)
Device
.
init_device
(
self
)
self
.
set_state
(
DevState
.
OFF
)
def
initialise
(
self
):
"""
Initialises the attributes and properties of the RCUSCC.
"""
self
.
set_state
(
DevState
.
INIT
)
self
.
set_state
(
DevState
.
INIT
)
# Init the dict that contains attribute to OPC-UA MP/CP mappings.
# Init the dict that contains attribute to OPC-UA MP/CP mappings.
...
@@ -453,7 +458,7 @@ class RCUSCC(Device):
...
@@ -453,7 +458,7 @@ class RCUSCC(Device):
:return:None
:return:None
"""
"""
self
.
init
_devic
e
()
self
.
init
ialis
e
()
@only_in_states
([
DevState
.
INIT
])
@only_in_states
([
DevState
.
INIT
])
def
Standby
(
self
):
def
Standby
(
self
):
...
...
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