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
382aa4d7
Commit
382aa4d7
authored
3 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
Log more exceptions, fixed comment typo
parent
bdfc4e73
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!16
Generic code cleanup
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
devices/PCC.py
+4
-2
4 additions, 2 deletions
devices/PCC.py
devices/SDP.py
+5
-2
5 additions, 2 deletions
devices/SDP.py
with
9 additions
and
4 deletions
devices/PCC.py
+
4
−
2
View file @
382aa4d7
...
@@ -20,7 +20,7 @@ from tango.server import device_property
...
@@ -20,7 +20,7 @@ from tango.server import device_property
from
clients.opcua_connection
import
OPCUAConnection
from
clients.opcua_connection
import
OPCUAConnection
from
util.attribute_wrapper
import
*
from
util.attribute_wrapper
import
*
from
util.hardware_device
import
*
from
util.hardware_device
import
*
from
util.lofar_logging
import
device_logging_to_python
from
util.lofar_logging
import
device_logging_to_python
,
log_exceptions
__all__
=
[
"
PCC
"
,
"
main
"
]
__all__
=
[
"
PCC
"
,
"
main
"
]
...
@@ -103,7 +103,7 @@ class PCC(hardware_device):
...
@@ -103,7 +103,7 @@ class PCC(hardware_device):
RCU_monitor_rate_RW
=
attribute_wrapper
(
comms_annotation
=
[
"
2:PCC
"
,
"
2:RCU_monitor_rate_RW
"
],
datatype
=
numpy
.
float64
,
access
=
AttrWriteType
.
READ_WRITE
)
RCU_monitor_rate_RW
=
attribute_wrapper
(
comms_annotation
=
[
"
2:PCC
"
,
"
2:RCU_monitor_rate_RW
"
],
datatype
=
numpy
.
float64
,
access
=
AttrWriteType
.
READ_WRITE
)
@log_exceptions
()
def
delete_device
(
self
):
def
delete_device
(
self
):
"""
Hook to delete resources allocated in init_device.
"""
Hook to delete resources allocated in init_device.
...
@@ -118,12 +118,14 @@ class PCC(hardware_device):
...
@@ -118,12 +118,14 @@ class PCC(hardware_device):
# --------
# --------
# overloaded functions
# overloaded functions
# --------
# --------
@log_exceptions
()
def
off
(
self
):
def
off
(
self
):
"""
user code here. is called when the state is set to OFF
"""
"""
user code here. is called when the state is set to OFF
"""
# Stop keep-alive
# Stop keep-alive
self
.
OPCua_client
.
disconnect
()
self
.
OPCua_client
.
disconnect
()
@log_exceptions
()
def
initialise
(
self
):
def
initialise
(
self
):
"""
user code here. is called when the state is set to INIT
"""
"""
user code here. is called when the state is set to INIT
"""
...
...
This diff is collapsed.
Click to expand it.
devices/SDP.py
+
5
−
2
View file @
382aa4d7
...
@@ -19,7 +19,7 @@ from tango.server import device_property
...
@@ -19,7 +19,7 @@ from tango.server import device_property
from
clients.opcua_connection
import
OPCUAConnection
from
clients.opcua_connection
import
OPCUAConnection
from
util.attribute_wrapper
import
*
from
util.attribute_wrapper
import
*
from
util.hardware_device
import
*
from
util.hardware_device
import
*
from
util.lofar_logging
import
device_logging_to_python
from
util.lofar_logging
import
device_logging_to_python
,
log_exceptions
__all__
=
[
"
SDP
"
,
"
main
"
]
__all__
=
[
"
SDP
"
,
"
main
"
]
...
@@ -79,6 +79,7 @@ class SDP(hardware_device):
...
@@ -79,6 +79,7 @@ class SDP(hardware_device):
"""
Method always executed before any TANGO command is executed.
"""
"""
Method always executed before any TANGO command is executed.
"""
pass
pass
@log_exceptions
()
def
delete_device
(
self
):
def
delete_device
(
self
):
"""
Hook to delete resources allocated in init_device.
"""
Hook to delete resources allocated in init_device.
...
@@ -94,15 +95,17 @@ class SDP(hardware_device):
...
@@ -94,15 +95,17 @@ class SDP(hardware_device):
# --------
# --------
# overloaded functions
# overloaded functions
# --------
# --------
@log_exceptions
()
def
off
(
self
):
def
off
(
self
):
"""
user code here. is called when the state is set to OFF
"""
"""
user code here. is called when the state is set to OFF
"""
# Stop keep-alive
# Stop keep-alive
self
.
opcua_connection
.
stop
()
self
.
opcua_connection
.
stop
()
@log_exceptions
()
def
initialise
(
self
):
def
initialise
(
self
):
"""
user code here. is called when the sate is set to INIT
"""
"""
user code here. is called when the sate is set to INIT
"""
"""
Initialises the attributes and properties of the
PCC
.
"""
"""
Initialises the attributes and properties of the
SDP
.
"""
# set up the OPC ua client
# set up the OPC ua client
self
.
OPCua_client
=
OPCUAConnection
(
"
opc.tcp://{}:{}/
"
.
format
(
self
.
OPC_Server_Name
,
self
.
OPC_Server_Port
),
"
http://lofar.eu
"
,
self
.
OPC_Time_Out
,
self
.
Standby
,
self
.
Fault
,
self
)
self
.
OPCua_client
=
OPCUAConnection
(
"
opc.tcp://{}:{}/
"
.
format
(
self
.
OPC_Server_Name
,
self
.
OPC_Server_Port
),
"
http://lofar.eu
"
,
self
.
OPC_Time_Out
,
self
.
Standby
,
self
.
Fault
,
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