Skip to content
GitLab
Explore
Sign in
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
79c58b8d
Commit
79c58b8d
authored
2 years ago
by
Taya Snijder
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-1204
formatting
parent
c63b24ac
No related branches found
No related tags found
1 merge request
!549
L2SS-1204 added station state stubs for the StationManager
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/devices/station_manager.py
+10
-12
10 additions, 12 deletions
...ioncontrol/tangostationcontrol/devices/station_manager.py
with
10 additions
and
12 deletions
tangostationcontrol/tangostationcontrol/devices/station_manager.py
+
10
−
12
View file @
79c58b8d
...
@@ -22,8 +22,8 @@ logger = logging.getLogger()
...
@@ -22,8 +22,8 @@ logger = logging.getLogger()
__all__
=
[
"
StationManager
"
,
"
main
"
]
__all__
=
[
"
StationManager
"
,
"
main
"
]
class
StationState
:
class
StationState
:
# all station states
# all station states
OFF
=
"
OFF
"
OFF
=
"
OFF
"
HIBERNATE
=
"
HIBERNATE
"
HIBERNATE
=
"
HIBERNATE
"
...
@@ -41,7 +41,6 @@ class StationState:
...
@@ -41,7 +41,6 @@ class StationState:
@device_logging_to_python
()
@device_logging_to_python
()
class
StationManager
(
LOFARDevice
):
class
StationManager
(
LOFARDevice
):
# -----------------
# -----------------
# Device Properties
# Device Properties
# -----------------
# -----------------
...
@@ -54,14 +53,15 @@ class StationManager(LOFARDevice):
...
@@ -54,14 +53,15 @@ class StationManager(LOFARDevice):
# Attributes
# Attributes
# ----------
# ----------
station_name_R
=
attribute
(
dtype
=
str
,
fisallowed
=
"
is_attribute_access_allowed
"
)
station_name_R
=
attribute
(
dtype
=
str
,
fisallowed
=
"
is_attribute_access_allowed
"
)
def
read_station_name_R
(
self
):
def
read_station_name_R
(
self
):
return
self
.
Station_Name
return
self
.
Station_Name
station_state_R
=
attribute
(
dtype
=
str
,
fisallowed
=
"
is_attribute_access_allowed
"
)
station_state_R
=
attribute
(
dtype
=
str
,
fisallowed
=
"
is_attribute_access_allowed
"
)
def
read_station_state_R
(
self
):
def
read_station_state_R
(
self
):
return
self
.
Station_State
return
self
.
Station_State
# --------
# --------
# overloaded functions
# overloaded functions
# --------
# --------
...
@@ -80,7 +80,6 @@ class StationManager(LOFARDevice):
...
@@ -80,7 +80,6 @@ class StationManager(LOFARDevice):
# --------
# --------
def
_is_transition_allowed
(
self
,
to_state
)
->
bool
:
def
_is_transition_allowed
(
self
,
to_state
)
->
bool
:
# get allowed transitions for the current state
# get allowed transitions for the current state
allowed_transitions
=
StationState
.
allowed_transitions
[
self
.
station_state
]
allowed_transitions
=
StationState
.
allowed_transitions
[
self
.
station_state
]
...
@@ -128,7 +127,6 @@ class StationManager(LOFARDevice):
...
@@ -128,7 +127,6 @@ class StationManager(LOFARDevice):
# TODO: functionality
# TODO: functionality
return
return
# --------
# --------
# Commands
# Commands
# --------
# --------
...
@@ -182,7 +180,6 @@ class StationManager(LOFARDevice):
...
@@ -182,7 +180,6 @@ class StationManager(LOFARDevice):
# update the station_state variable when successful
# update the station_state variable when successful
self
.
station_state
=
StationState
.
STANDBY
self
.
station_state
=
StationState
.
STANDBY
@command
()
@command
()
@DebugIt
()
@DebugIt
()
@log_exceptions
()
@log_exceptions
()
...
@@ -198,6 +195,7 @@ class StationManager(LOFARDevice):
...
@@ -198,6 +195,7 @@ class StationManager(LOFARDevice):
# update the station_state variable when successful
# update the station_state variable when successful
self
.
station_state
=
StationState
.
ON
self
.
station_state
=
StationState
.
ON
# ----------
# ----------
# Run server
# Run server
# ----------
# ----------
...
...
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