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
dc070e14
Commit
dc070e14
authored
3 years ago
by
Jan David Mol
Browse files
Options
Downloads
Plain Diff
Merge branch '
L2SS-271
-statistics-base-class' into 'master'
L2SS-271
: Emergency patches Closes
L2SS-271
See merge request
!93
parents
39654b4d
b90f9c9e
No related branches found
No related tags found
1 merge request
!93
L2SS-271: Emergency patches
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
devices/devices/sdp/sst.py
+1
-1
1 addition, 1 deletion
devices/devices/sdp/sst.py
devices/devices/sdp/statistics.py
+1
-1
1 addition, 1 deletion
devices/devices/sdp/statistics.py
devices/devices/sdp/statistics_collector.py
+13
-8
13 additions, 8 deletions
devices/devices/sdp/statistics_collector.py
with
15 additions
and
10 deletions
devices/devices/sdp/sst.py
+
1
−
1
View file @
dc070e14
...
...
@@ -26,7 +26,7 @@ from tango import AttrWriteType
from
clients.attribute_wrapper
import
attribute_wrapper
from
clients.opcua_client
import
OPCUAConnection
from
clients.
S
tatistics
C
lient
import
StatisticsClient
from
clients.
s
tatistics
_c
lient
import
StatisticsClient
from
devices.hardware_device
import
hardware_device
...
...
This diff is collapsed.
Click to expand it.
devices/devices/sdp/statistics.py
+
1
−
1
View file @
dc070e14
...
...
@@ -120,7 +120,7 @@ class Statistics(hardware_device, metaclass=ABCMeta):
"""
user code here. is called when the sate is set to INIT
"""
"""
Initialises the attributes and properties of the statistics device.
"""
self
.
statistics_client
=
StasticsClient
(
self
.
STATISTICS_COLLECTOR_CLASS
,
"
0.0.0.0
"
,
self
.
Statistics_Client_Port
,
self
.
Fault
,
self
)
self
.
statistics_client
=
Sta
ti
sticsClient
(
self
.
STATISTICS_COLLECTOR_CLASS
,
"
0.0.0.0
"
,
self
.
Statistics_Client_Port
,
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
.
Fault
,
self
)
...
...
This diff is collapsed.
Click to expand it.
devices/devices/sdp/statistics_collector.py
+
13
−
8
View file @
dc070e14
...
...
@@ -23,7 +23,13 @@ class StatisticsCollector(Thread):
self
.
queue
=
queue
self
.
last_packet
=
None
self
.
parameters
=
{
self
.
parameters
=
self
.
_default_parameters
()
super
().
__init__
()
self
.
start
()
def
_default_parameters
(
self
):
return
{
"
nof_packets
"
:
numpy
.
uint64
(
0
),
# Packet count for packets that could not be parsed
...
...
@@ -33,9 +39,6 @@ class StatisticsCollector(Thread):
"
last_invalid_packet
"
:
numpy
.
zeros
((
9000
,),
dtype
=
numpy
.
uint8
),
}
super
().
__init__
()
self
.
start
()
def
run
(
self
):
logger
.
info
(
"
Starting statistics thread
"
)
...
...
@@ -54,7 +57,7 @@ class StatisticsCollector(Thread):
except
Exception
as
e
:
logger
.
exception
(
"
Could not parse statistics UDP packet
"
)
self
.
parameters
[
"
last_invalid_packet
"
]
=
numpy
.
frombuffer
(
packet
,
dtype
=
numpy
.
uint8
)
self
.
parameters
[
"
last_invalid_packet
"
]
=
numpy
.
frombuffer
(
self
.
last_
packet
,
dtype
=
numpy
.
uint8
)
self
.
parameters
[
"
nof_invalid_packets
"
]
+=
numpy
.
uint64
(
1
)
logger
.
info
(
"
Stopped statistics thread
"
)
...
...
@@ -92,10 +95,10 @@ class SSTCollector(StatisticsCollector):
# Maximum number of subbands we support (used to determine array sizes)
MAX_SUBBANDS
=
512
def
_
_init__
(
self
,
queue
):
super
().
__init__
(
queue
)
def
_
default_parameters
(
self
):
defaults
=
super
().
_default_parameters
(
)
self
.
parameters
.
extend
({
defaults
.
update
({
# Number of packets received so far that we could parse correctly and do not have a payload error
"
nof_valid_payloads
"
:
numpy
.
zeros
((
self
.
MAX_INPUTS
,),
dtype
=
numpy
.
uint64
),
...
...
@@ -108,6 +111,8 @@ class SSTCollector(StatisticsCollector):
"
integration_intervals
"
:
numpy
.
zeros
((
self
.
MAX_INPUTS
,),
dtype
=
numpy
.
float32
),
})
return
defaults
def
process_packet
(
self
,
packet
):
fields
=
SSTPacket
(
packet
)
...
...
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