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
d6c79901
Commit
d6c79901
authored
5 years ago
by
Thomas Juerges
Browse files
Options
Downloads
Patches
Plain Diff
Regenerated files with Pogo 9.6.31
parent
ec9f6fdc
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
RandomDataDev/RandomData.py
+177
-30
177 additions, 30 deletions
RandomDataDev/RandomData.py
crossechoTangoDev/Crossecho.py
+37
-17
37 additions, 17 deletions
crossechoTangoDev/Crossecho.py
with
214 additions
and
47 deletions
RandomDataDev/RandomData.py
+
177
−
30
View file @
d6c79901
...
...
@@ -12,13 +12,13 @@
"""
# PyTango imports
import
PyT
ango
from
PyT
ango
import
DebugIt
from
PyT
ango.server
import
run
from
PyT
ango.server
import
Device
,
DeviceMeta
from
PyT
ango.server
import
attribute
,
command
from
PyT
ango
import
AttrQuality
,
DispLevel
,
DevState
from
PyT
ango
import
AttrWriteType
,
PipeWriteType
import
t
ango
from
t
ango
import
DebugIt
from
t
ango.server
import
run
from
t
ango.server
import
Device
from
t
ango.server
import
attribute
,
command
from
t
ango
import
AttrQuality
,
DispLevel
,
DevState
from
t
ango
import
AttrWriteType
,
PipeWriteType
# Additional import
# PROTECTED REGION ID(RandomData.additionnal_import) ENABLED START #
from
numpy
import
random
...
...
@@ -30,7 +30,6 @@ __all__ = ["RandomData", "main"]
class
RandomData
(
Device
):
"""
"""
__metaclass__
=
DeviceMeta
# PROTECTED REGION ID(RandomData.class_variable) ENABLED START #
# PROTECTED REGION END # // RandomData.class_variable
...
...
@@ -39,7 +38,14 @@ class RandomData(Device):
# ----------
rnd1
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -51,7 +57,14 @@ class RandomData(Device):
)
rnd2
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -63,7 +76,14 @@ class RandomData(Device):
)
rnd3
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -75,7 +95,14 @@ class RandomData(Device):
)
rnd4
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -87,7 +114,14 @@ class RandomData(Device):
)
rnd5
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -99,7 +133,14 @@ class RandomData(Device):
)
rnd6
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -111,7 +152,14 @@ class RandomData(Device):
)
rnd7
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -123,7 +171,14 @@ class RandomData(Device):
)
rnd8
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -135,7 +190,14 @@ class RandomData(Device):
)
rnd9
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -147,7 +209,14 @@ class RandomData(Device):
)
rnd10
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -159,7 +228,14 @@ class RandomData(Device):
)
rnd11
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -171,7 +247,14 @@ class RandomData(Device):
)
rnd12
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -183,7 +266,14 @@ class RandomData(Device):
)
rnd13
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -195,7 +285,14 @@ class RandomData(Device):
)
rnd14
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -207,7 +304,14 @@ class RandomData(Device):
)
rnd15
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -219,7 +323,14 @@ class RandomData(Device):
)
rnd16
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -231,7 +342,14 @@ class RandomData(Device):
)
rnd17
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -243,7 +361,14 @@ class RandomData(Device):
)
rnd18
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -255,7 +380,14 @@ class RandomData(Device):
)
rnd19
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -267,7 +399,14 @@ class RandomData(Device):
)
rnd20
=
attribute
(
dtype
=
'
double
'
,
dtype
=
'
DevDouble
'
,
polling_period
=
100
,
period
=
1000
,
rel_change
=
1
,
abs_change
=
0.01
,
archive_period
=
1000
,
archive_rel_change
=
1
,
archive_abs_change
=
0.01
,
max_value
=
1.0
,
min_value
=
0.0
,
max_alarm
=
1.0
,
...
...
@@ -283,6 +422,7 @@ class RandomData(Device):
# ---------------
def
init_device
(
self
):
"""
Initialises the attributes and properties of the RandomData.
"""
Device
.
init_device
(
self
)
self
.
rnd1
.
set_data_ready_event
(
True
)
self
.
set_change_event
(
"
rnd1
"
,
True
,
True
)
...
...
@@ -348,15 +488,21 @@ class RandomData(Device):
# PROTECTED REGION END # // RandomData.init_device
def
always_executed_hook
(
self
):
"""
Method always executed before any TANGO command is executed.
"""
# PROTECTED REGION ID(RandomData.always_executed_hook) ENABLED START #
pass
# PROTECTED REGION END # // RandomData.always_executed_hook
def
delete_device
(
self
):
"""
Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(RandomData.delete_device) ENABLED START #
pass
# PROTECTED REGION END # // RandomData.delete_device
# ------------------
# Attributes methods
# ------------------
...
...
@@ -461,7 +607,6 @@ class RandomData(Device):
return
random
.
random
()
# PROTECTED REGION END # // RandomData.rnd20_read
# --------
# Commands
# --------
...
...
@@ -472,9 +617,11 @@ class RandomData(Device):
def
main
(
args
=
None
,
**
kwargs
):
"""
Main function of the RandomData module.
"""
# PROTECTED REGION ID(RandomData.main) ENABLED START #
return
run
((
RandomData
,),
args
=
args
,
**
kwargs
)
# PROTECTED REGION END # // RandomData.main
if
__name__
==
'
__main__
'
:
main
()
This diff is collapsed.
Click to expand it.
crossechoTangoDev/Crossecho.py
+
37
−
17
View file @
d6c79901
...
...
@@ -13,14 +13,14 @@ Implementation of a Tango device on top of an existing OPC-UA server in Python3.
"""
# PyTango imports
import
PyT
ango
from
PyT
ango
import
DebugIt
from
PyT
ango.server
import
run
from
PyT
ango.server
import
Device
,
DeviceMeta
from
PyT
ango.server
import
attribute
,
command
,
pipe
from
PyT
ango.server
import
device_property
from
PyT
ango
import
AttrQuality
,
DispLevel
,
DevState
from
PyT
ango
import
AttrWriteType
,
PipeWriteType
import
t
ango
from
t
ango
import
DebugIt
from
t
ango.server
import
run
from
t
ango.server
import
Device
from
t
ango.server
import
attribute
,
command
,
pipe
from
t
ango.server
import
device_property
from
t
ango
import
AttrQuality
,
DispLevel
,
DevState
from
t
ango
import
AttrWriteType
,
PipeWriteType
# Additional import
# PROTECTED REGION ID(Crossecho.additionnal_import) ENABLED START #
from
opcua
import
Client
...
...
@@ -34,8 +34,17 @@ __all__ = ["Crossecho", "main"]
class
Crossecho
(
Device
):
"""
Implementation of a Tango device on top of an existing OPC-UA server in Python3.
**Properties:**
- Device Property
OPC_Server_Name
- Type:
'
DevString
'
OPC_Server_Port
- Type:
'
DevString
'
OPC_time_out
- Type:
'
DevULong
'
"""
__metaclass__
=
DeviceMeta
# PROTECTED REGION ID(Crossecho.class_variable) ENABLED START #
# PROTECTED REGION END # // Crossecho.class_variable
...
...
@@ -44,15 +53,18 @@ class Crossecho(Device):
# -----------------
OPC_Server_Name
=
device_property
(
dtype
=
'
str
'
,
default_value
=
"
localhost
"
dtype
=
'
DevString
'
,
default_value
=
"
localhost
"
)
OPC_Server_Port
=
device_property
(
dtype
=
'
str
'
,
default_value
=
"
55555
"
dtype
=
'
DevString
'
,
default_value
=
"
55555
"
)
OPC_time_out
=
device_property
(
dtype
=
'
uint
'
,
default_value
=
1000
dtype
=
'
DevULong
'
,
default_value
=
1000
)
# ----------
...
...
@@ -60,12 +72,12 @@ class Crossecho(Device):
# ----------
RCU_modes
=
attribute
(
dtype
=
(
'
str
'
,),
dtype
=
(
'
DevString
'
,),
max_dim_x
=
1024
,
)
crosslet_stat
=
attribute
(
dtype
=
(
'
d
ouble
'
,),
dtype
=
(
'
DevD
ouble
'
,),
max_dim_x
=
10240
,
)
...
...
@@ -82,6 +94,7 @@ class Crossecho(Device):
# ---------------
def
init_device
(
self
):
"""
Initialises the attributes and properties of the Crossecho.
"""
Device
.
init_device
(
self
)
# PROTECTED REGION ID(Crossecho.init_device) ENABLED START #
try
:
...
...
@@ -103,17 +116,23 @@ class Crossecho(Device):
# PROTECTED REGION END # // Crossecho.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
def
delete_device
(
self
):
"""
Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(Crossecho.delete_device) ENABLED START #
if
self
.
client
is
not
Null
:
self
.
client
.
close_session
()
self
.
client
.
close_secure_channel
()
# PROTECTED REGION END # // Crossecho.delete_device∑
# PROTECTED REGION END # // Crossecho.delete_device
# ------------------
# Attributes methods
# ------------------
...
...
@@ -128,7 +147,6 @@ class Crossecho(Device):
return
crosslet_stat
# PROTECTED REGION END # // Crossecho.crosslet_stat_read
# -------------
# Pipes methods
# -------------
...
...
@@ -166,9 +184,11 @@ class Crossecho(Device):
def
main
(
args
=
None
,
**
kwargs
):
"""
Main function of the Crossecho module.
"""
# 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.
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