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
c84121a7
Commit
c84121a7
authored
4 years ago
by
Thomas Juerges
Browse files
Options
Downloads
Patches
Plain Diff
Begin adding code to talk to Mattia's OPC-UA device
parent
2074faac
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
crossechoTangoDev/Crossecho.py
+18
-2
18 additions, 2 deletions
crossechoTangoDev/Crossecho.py
with
18 additions
and
2 deletions
crossechoTangoDev/Crossecho.py
+
18
−
2
View file @
c84121a7
...
@@ -23,6 +23,8 @@ from PyTango import AttrQuality, DispLevel, DevState
...
@@ -23,6 +23,8 @@ from PyTango import AttrQuality, DispLevel, DevState
from
PyTango
import
AttrWriteType
,
PipeWriteType
from
PyTango
import
AttrWriteType
,
PipeWriteType
# Additional import
# Additional import
# PROTECTED REGION ID(Crossecho.additionnal_import) ENABLED START #
# PROTECTED REGION ID(Crossecho.additionnal_import) ENABLED START #
from
lib.opc_interface
import
connect_to_server
,
DEFAULT_URI
import
numpy
# PROTECTED REGION END # // Crossecho.additionnal_import
# PROTECTED REGION END # // Crossecho.additionnal_import
__all__
=
[
"
Crossecho
"
,
"
main
"
]
__all__
=
[
"
Crossecho
"
,
"
main
"
]
...
@@ -77,6 +79,14 @@ class Crossecho(Device):
...
@@ -77,6 +79,14 @@ class Crossecho(Device):
def
init_device
(
self
):
def
init_device
(
self
):
Device
.
init_device
(
self
)
Device
.
init_device
(
self
)
# PROTECTED REGION ID(Crossecho.init_device) ENABLED START #
# PROTECTED REGION ID(Crossecho.init_device) ENABLED START #
self
.
client
=
connect_to_server
(
self
.
OPC_Server_Name
,
self
.
OPC_Server_Port
)
self
.
objects
=
self
.
client
.
get_objects_node
()
self
.
idx
=
self
.
client
.
get_namespace_index
(
DEFAULT_URI
)
# Now getting a variable node using its browse path
self
.
opc_obj
=
self
.
client
.
get_root_node
().
get_child
([
"
0:Objects
"
,
"
{}:StationMetrics
"
.
format
(
idx
),
"
{}:RCU
"
.
format
(
idx
)])
# PROTECTED REGION END # // Crossecho.init_device
# PROTECTED REGION END # // Crossecho.init_device
def
always_executed_hook
(
self
):
def
always_executed_hook
(
self
):
...
@@ -86,7 +96,8 @@ class Crossecho(Device):
...
@@ -86,7 +96,8 @@ class Crossecho(Device):
def
delete_device
(
self
):
def
delete_device
(
self
):
# PROTECTED REGION ID(Crossecho.delete_device) ENABLED START #
# PROTECTED REGION ID(Crossecho.delete_device) ENABLED START #
pass
self
.
client
.
close_session
()
self
.
client
.
close_secure_channel
()
# PROTECTED REGION END # // Crossecho.delete_device
# PROTECTED REGION END # // Crossecho.delete_device
# ------------------
# ------------------
...
@@ -122,7 +133,12 @@ class Crossecho(Device):
...
@@ -122,7 +133,12 @@ class Crossecho(Device):
@DebugIt
()
@DebugIt
()
def
record_cross
(
self
):
def
record_cross
(
self
):
# PROTECTED REGION ID(Crossecho.record_cross) ENABLED START #
# PROTECTED REGION ID(Crossecho.record_cross) ENABLED START #
pass
if
self
.
is_record_cross_allowed
()
is
True
:
timeStamp
,
crossletStats
,
rcuModes
=
self
.
opc_obj
.
call_method
(
"
{}:record_cross
"
.
format
(
idx
),
self
.
subBand
,
self
.
integrationTime
)
print
(
"
Timestamp is
"
,
result
[
0
])
print
(
"
Crosscorrelations are
"
,
numpy
.
array
(
result
[
1
]))
print
(
"
RCU modes are
"
,
numpy
.
array
(
result
[
2
]))
# PROTECTED REGION END # // Crossecho.record_cross
# PROTECTED REGION END # // Crossecho.record_cross
def
is_record_cross_allowed
(
self
):
def
is_record_cross_allowed
(
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