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
7b39dd1f
Commit
7b39dd1f
authored
4 years ago
by
Thomas Juerges
Browse files
Options
Downloads
Patches
Plain Diff
Pogo does not allow '-' in a class name
parent
720a7f3d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Femto-DS/Femto.py
+42
-36
42 additions, 36 deletions
Femto-DS/Femto.py
Femto-DS/Femto.xmi
+0
-0
0 additions, 0 deletions
Femto-DS/Femto.xmi
RandomData-DS/RandomData.py
+0
-0
0 additions, 0 deletions
RandomData-DS/RandomData.py
RandomData-DS/RandomData.xmi
+0
-0
0 additions, 0 deletions
RandomData-DS/RandomData.xmi
with
42 additions
and
36 deletions
Femto-DS/Femto
-DS
.py
→
Femto-DS/Femto.py
+
42
−
36
View file @
7b39dd1f
# -*- coding: utf-8 -*-
#
# This file is part of the
Crossech
o project
# This file is part of the
Femt
o project
#
#
#
...
...
@@ -22,16 +22,16 @@ from tango.server import device_property
from
tango
import
AttrQuality
,
DispLevel
,
DevState
from
tango
import
AttrWriteType
,
PipeWriteType
# Additional import
# PROTECTED REGION ID(
Crossech
o.additionnal_import) ENABLED START #
# PROTECTED REGION ID(
Femt
o.additionnal_import) ENABLED START #
from
opcua
import
Client
import
numpy
import
traceback
# PROTECTED REGION END # //
Crossech
o.additionnal_import
# PROTECTED REGION END # //
Femt
o.additionnal_import
__all__
=
[
"
Crossech
o
"
,
"
main
"
]
__all__
=
[
"
Femt
o
"
,
"
main
"
]
class
Crossech
o
(
Device
):
class
Femt
o
(
Device
):
"""
Implementation of a Tango device on top of an existing OPC-UA server in Python3.
...
...
@@ -45,8 +45,8 @@ class Crossecho(Device):
OPC_time_out
- Type:
'
DevULong
'
"""
# PROTECTED REGION ID(
Crossech
o.class_variable) ENABLED START #
# PROTECTED REGION END # //
Crossech
o.class_variable
# PROTECTED REGION ID(
Femt
o.class_variable) ENABLED START #
# PROTECTED REGION END # //
Femt
o.class_variable
# -----------------
# Device Properties
...
...
@@ -94,9 +94,11 @@ class Crossecho(Device):
# ---------------
def
init_device
(
self
):
"""
Initialises the attributes and properties of the
Crossech
o.
"""
"""
Initialises the attributes and properties of the
Femt
o.
"""
Device
.
init_device
(
self
)
# PROTECTED REGION ID(Crossecho.init_device) ENABLED START #
# PROTECTED REGION ID(Femto.init_device) ENABLED START #
self
.
_rcu_modes
=
(
''
,)
self
.
_crosslet_stat
=
(
0.0
,)
try
:
self
.
client
=
Client
(
"
opc.tcp://{}:{}/
"
.
format
(
self
.
OPC_Server_Name
,
self
.
OPC_Server_Port
),
self
.
OPC_time_out
)
self
.
client
.
connect
()
...
...
@@ -113,13 +115,12 @@ class Crossecho(Device):
print
(
"
Failed to connect to the OPC-UA server %s. Traceback: %s
"
%
(
self
.
OPC_Server_Name
,
traceback
.
format_exc
()))
self
.
delete_device
()
raise
e
# PROTECTED REGION END # //
Crossech
o.init_device
# PROTECTED REGION END # //
Femt
o.init_device
def
always_executed_hook
(
self
):
"""
Method always executed before any TANGO command is executed.
"""
# PROTECTED REGION ID(Crossecho.always_executed_hook) ENABLED START #
pass
# PROTECTED REGION EloggND # // Crossecho.always_executed_hook
# PROTECTED REGION ID(Femto.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // Femto.always_executed_hook
def
delete_device
(
self
):
"""
Hook to delete resources allocated in init_device.
...
...
@@ -128,33 +129,35 @@ class Crossecho(Device):
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(
Crossech
o.delete_device) ENABLED START #
# PROTECTED REGION ID(
Femt
o.delete_device) ENABLED START #
if
self
.
client
is
not
Null
:
self
.
client
.
close_session
()
self
.
client
.
close_secure_channel
()
# PROTECTED REGION END # //
Crossech
o.delete_device
# PROTECTED REGION END # //
Femt
o.delete_device
# ------------------
# Attributes methods
# ------------------
def
read_RCU_modes
(
self
):
# PROTECTED REGION ID(Crossecho.RCU_modes_read) ENABLED START #
return
self
.
RCU_modes
# PROTECTED REGION END # // Crossecho.RCU_modes_read
# PROTECTED REGION ID(Femto.RCU_modes_read) ENABLED START #
"""
Return the RCU_modes attribute.
"""
return
self
.
_rcu_modes
# PROTECTED REGION END # // Femto.RCU_modes_read
def
read_crosslet_stat
(
self
):
# PROTECTED REGION ID(Crossecho.crosslet_stat_read) ENABLED START #
return
crosslet_stat
# PROTECTED REGION END # // Crossecho.crosslet_stat_read
# PROTECTED REGION ID(Femto.crosslet_stat_read) ENABLED START #
"""
Return the crosslet_stat attribute.
"""
return
self
.
_crosslet_stat
# PROTECTED REGION END # // Femto.crosslet_stat_read
# -------------
# Pipes methods
# -------------
def
read_xlt_stat
(
self
):
# PROTECTED REGION ID(
Crossech
o.xlt_stat_read) ENABLED START #
return
dict
(
x
=
self
.
crosslet_stat
,
y
=
self
.
RCU
_modes
)
# PROTECTED REGION END # //
Crossech
o.xlt_stat_read
# PROTECTED REGION ID(
Femt
o.xlt_stat_read) ENABLED START #
return
dict
(
x
=
self
.
_
crosslet_stat
,
y
=
self
.
_rcu
_modes
)
# PROTECTED REGION END # //
Femt
o.xlt_stat_read
# --------
# Commands
...
...
@@ -164,19 +167,22 @@ class Crossecho(Device):
)
@DebugIt
()
def
record_cross
(
self
):
# PROTECTED REGION ID(Crossecho.record_cross) ENABLED START #
# PROTECTED REGION ID(Femto.record_cross) ENABLED START #
"""
:return:None
"""
if
self
.
is_record_cross_allowed
()
is
True
:
timeStamp
,
self
.
crosslet_stat
,
self
.
RCU
_modes
=
self
.
opc_obj
.
call_method
(
"
{}:record_cross
"
.
format
(
idx
),
self
.
subBand
,
self
.
integrationTime
)
timeStamp
,
self
.
_
crosslet_stat
,
self
.
_rcu
_modes
=
self
.
opc_obj
.
call_method
(
"
{}:record_cross
"
.
format
(
idx
),
self
.
subBand
,
self
.
integrationTime
)
print
(
"
Timestamp is
"
,
timeStamp
)
print
(
"
Crosscorrelations are
"
,
self
.
crosslet_stat
)
print
(
"
RCU modes are
"
,
self
.
RCU_modes
)
# PROTECTED REGION END # // Crossecho.record_cross
print
(
"
Crosscorrelations are
"
,
self
.
_crosslet_stat
)
print
(
"
RCU modes are
"
,
self
.
_rcu_modes
)
# PROTECTED REGION END # // Femto.record_cross
def
is_record_cross_allowed
(
self
):
# PROTECTED REGION ID(
Crossech
o.is_record_cross_allowed) ENABLED START #
# PROTECTED REGION ID(
Femt
o.is_record_cross_allowed) ENABLED START #
return
self
.
get_state
()
not
in
[
DevState
.
OFF
,
DevState
.
INIT
,
DevState
.
FAULT
]
# PROTECTED REGION END # //
Crossech
o.is_record_cross_allowed
# PROTECTED REGION END # //
Femt
o.is_record_cross_allowed
# ----------
# Run server
...
...
@@ -184,10 +190,10 @@ class Crossecho(Device):
def
main
(
args
=
None
,
**
kwargs
):
"""
Main function of the
Crossech
o module.
"""
# PROTECTED REGION ID(
Crossech
o.main) ENABLED START #
return
run
((
Crossech
o
,),
args
=
args
,
**
kwargs
)
# PROTECTED REGION END # //
Crossech
o.main
"""
Main function of the
Femt
o module.
"""
# PROTECTED REGION ID(
Femt
o.main) ENABLED START #
return
run
((
Femt
o
,),
args
=
args
,
**
kwargs
)
# PROTECTED REGION END # //
Femt
o.main
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
Femto-DS/Femto
-DS
.xmi
→
Femto-DS/Femto.xmi
+
0
−
0
View file @
7b39dd1f
File moved
This diff is collapsed.
Click to expand it.
RandomData-DS/RandomData
-DS
.py
→
RandomData-DS/RandomData.py
+
0
−
0
View file @
7b39dd1f
File moved
This diff is collapsed.
Click to expand it.
RandomData-DS/RandomData
-DS
.xmi
→
RandomData-DS/RandomData.xmi
+
0
−
0
View file @
7b39dd1f
File moved
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