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
4f6a7c87
Commit
4f6a7c87
authored
4 years ago
by
Thomas Juerges
Browse files
Options
Downloads
Patches
Plain Diff
Forgot to add important files
parent
e37679dc
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
crossechoTangoDev/Crossecho.py
+144
-0
144 additions, 0 deletions
crossechoTangoDev/Crossecho.py
crossechoTangoDev/requirements.txt
+2
-0
2 additions, 0 deletions
crossechoTangoDev/requirements.txt
with
146 additions
and
0 deletions
crossechoTangoDev/Crossecho.py
0 → 100644
+
144
−
0
View file @
4f6a7c87
# -*- coding: utf-8 -*-
#
# This file is part of the Crossecho project
#
#
#
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
"""
LOFAR2.0 Station Software
Implementation of a Tango device on top of an existing OPC-UA server in Python3.
"""
# PyTango imports
import
PyTango
from
PyTango
import
DebugIt
from
PyTango.server
import
run
from
PyTango.server
import
Device
,
DeviceMeta
from
PyTango.server
import
attribute
,
command
,
pipe
from
PyTango.server
import
device_property
from
PyTango
import
AttrQuality
,
DispLevel
,
DevState
from
PyTango
import
AttrWriteType
,
PipeWriteType
# Additional import
# PROTECTED REGION ID(Crossecho.additionnal_import) ENABLED START #
# PROTECTED REGION END # // Crossecho.additionnal_import
__all__
=
[
"
Crossecho
"
,
"
main
"
]
class
Crossecho
(
Device
):
"""
Implementation of a Tango device on top of an existing OPC-UA server in Python3.
"""
__metaclass__
=
DeviceMeta
# PROTECTED REGION ID(Crossecho.class_variable) ENABLED START #
# PROTECTED REGION END # // Crossecho.class_variable
# -----------------
# Device Properties
# -----------------
OPC_Server_Name
=
device_property
(
dtype
=
'
str
'
,
default_value
=
"
localhost
"
)
OPC_Server_Port
=
device_property
(
dtype
=
'
str
'
,
default_value
=
"
55555
"
)
# ----------
# Attributes
# ----------
RCU_modes
=
attribute
(
dtype
=
(
'
str
'
,),
max_dim_x
=
1024
,
)
crosslet_stat
=
attribute
(
dtype
=
(
'
double
'
,),
max_dim_x
=
10240
,
)
# -----
# Pipes
# -----
xlt_stat
=
pipe
(
label
=
"
xlt
"
,
)
# ---------------
# General methods
# ---------------
def
init_device
(
self
):
Device
.
init_device
(
self
)
# PROTECTED REGION ID(Crossecho.init_device) ENABLED START #
# PROTECTED REGION END # // Crossecho.init_device
def
always_executed_hook
(
self
):
# PROTECTED REGION ID(Crossecho.always_executed_hook) ENABLED START #
pass
# PROTECTED REGION END # // Crossecho.always_executed_hook
def
delete_device
(
self
):
# PROTECTED REGION ID(Crossecho.delete_device) ENABLED START #
pass
# PROTECTED REGION END # // Crossecho.delete_device
# ------------------
# Attributes methods
# ------------------
def
read_RCU_modes
(
self
):
# PROTECTED REGION ID(Crossecho.RCU_modes_read) ENABLED START #
return
[
''
]
# PROTECTED REGION END # // Crossecho.RCU_modes_read
def
read_crosslet_stat
(
self
):
# PROTECTED REGION ID(Crossecho.crosslet_stat_read) ENABLED START #
return
[
0.0
]
# PROTECTED REGION END # // Crossecho.crosslet_stat_read
# -------------
# Pipes methods
# -------------
def
read_xlt_stat
(
self
):
# PROTECTED REGION ID(Crossecho.xlt_stat_read) ENABLED START #
return
dict
(
x
=
0
,
y
=
0
)
# PROTECTED REGION END # // Crossecho.xlt_stat_read
# --------
# Commands
# --------
@command
(
)
@DebugIt
()
def
record_cross
(
self
):
# PROTECTED REGION ID(Crossecho.record_cross) ENABLED START #
pass
# PROTECTED REGION END # // Crossecho.record_cross
def
is_record_cross_allowed
(
self
):
# PROTECTED REGION ID(Crossecho.is_record_cross_allowed) ENABLED START #
return
self
.
get_state
()
not
in
[
DevState
.
OFF
,
DevState
.
INIT
,
DevState
.
FAULT
]
# PROTECTED REGION END # // Crossecho.is_record_cross_allowed
# ----------
# Run server
# ----------
def
main
(
args
=
None
,
**
kwargs
):
# PROTECTED REGION ID(Crossecho.main) ENABLED START #
return
run
((
Crossecho
,),
args
=
args
,
**
kwargs
)
# PROTECTED REGION END # // Crossecho.main
if
__name__
==
'
__main__
'
:
main
()
This diff is collapsed.
Click to expand it.
crossechoTangoDev/requirements.txt
0 → 100644
+
2
−
0
View file @
4f6a7c87
numpy==1.18.1
opcua==0.98.9
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