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
e038646a
Commit
e038646a
authored
4 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
Abstracted pcc_node.get_child to avoid repetition
parent
d36e1393
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
RCUSCC/RCUSCC/RCUSCC.py
+16
-13
16 additions, 13 deletions
RCUSCC/RCUSCC/RCUSCC.py
with
16 additions
and
13 deletions
RCUSCC/RCUSCC/RCUSCC.py
+
16
−
13
View file @
e038646a
...
@@ -159,6 +159,9 @@ class RCUSCC(Device):
...
@@ -159,6 +159,9 @@ class RCUSCC(Device):
# General methods
# General methods
# ---------------
# ---------------
def
get_pcc_node
(
self
,
node
):
return
self
.
pcc_node
.
get_child
([
"
{}:{}
"
.
format
(
self
.
name_space_index
,
node
)])
def
init_device
(
self
):
def
init_device
(
self
):
"""
Initialises the attributes and properties of the RCUSCC.
"""
"""
Initialises the attributes and properties of the RCUSCC.
"""
...
@@ -228,40 +231,40 @@ class RCUSCC(Device):
...
@@ -228,40 +231,40 @@ class RCUSCC(Device):
# 2020-11-27, thomas
# 2020-11-27, thomas
# TODO
# TODO
# Modify as soon as we have a real multi-dimensional array
# Modify as soon as we have a real multi-dimensional array
self
.
attribute_mapping
[
"
Attenuator_R
"
]
=
(
self
.
pcc_node
.
get_child
([
"
{}:
RCUs_Attenuator1_R
"
.
format
(
self
.
name_space_index
)]
),
self
.
pcc_node
.
get_child
([
"
{}:
RCUs_Attenuator2_R
"
.
format
(
self
.
name_space_index
)]
),
self
.
pcc_node
.
get_child
([
"
{}:
RCUs_Attenuator3_R
"
.
format
(
self
.
name_space_index
)]
))
self
.
attribute_mapping
[
"
Attenuator_R
"
]
=
(
self
.
get_
pcc_node
(
"
RCUs_Attenuator1_R
"
),
self
.
get_
pcc_node
(
"
RCUs_Attenuator2_R
"
),
self
.
get_
pcc_node
(
"
RCUs_Attenuator3_R
"
))
# 2020-11-27, thomas
# 2020-11-27, thomas
# TODO
# TODO
# Modify as soon as we have a real multi-dimensional array
# Modify as soon as we have a real multi-dimensional array
self
.
attribute_mapping
[
"
Attenuator_RW
"
]
=
(
self
.
pcc_node
.
get_child
([
"
{}:
RCUs_Attenuator1_RW
"
.
format
(
self
.
name_space_index
)]
),
self
.
pcc_node
.
get_child
([
"
{}:
RCUs_Attenuator2_RW
"
.
format
(
self
.
name_space_index
)]
),
self
.
pcc_node
.
get_child
([
"
{}:
RCUs_Attenuator3_RW
"
.
format
(
self
.
name_space_index
)]
))
self
.
attribute_mapping
[
"
Attenuator_RW
"
]
=
(
self
.
get_
pcc_node
(
"
RCUs_Attenuator1_RW
"
),
self
.
get_
pcc_node
(
"
RCUs_Attenuator2_RW
"
),
self
.
get_
pcc_node
(
"
RCUs_Attenuator3_RW
"
))
# 2020-11-27, thomas
# 2020-11-27, thomas
# TODO
# TODO
# Modify as soon as we have a real multi-dimensional array
# Modify as soon as we have a real multi-dimensional array
self
.
attribute_mapping
[
"
Band_R
"
]
=
(
self
.
pcc_node
.
get_child
([
"
{}:RCUs_Band1_R
"
.
format
(
self
.
name_space_index
)]
),
self
.
pcc_node
.
get_child
([
"
{}:RCUs_Band2_R
"
.
format
(
self
.
name_space_index
)]
),
self
.
pcc_node
.
get_child
([
"
{}:RCUs_Band3_R
"
.
format
(
self
.
name_space_index
)]
))
self
.
attribute_mapping
[
"
Band_R
"
]
=
(
self
.
get_
pcc_node
(
"
RCUs_Band1_R
"
),
self
.
get_
pcc_node
(
"
RCUs_Band2_R
"
),
self
.
get_
pcc_node
(
"
RCUs_Band3_R
"
))
# 2020-11-27, thomas
# 2020-11-27, thomas
# TODO
# TODO
# Modify as soon as we have a real multi-dimensional array
# Modify as soon as we have a real multi-dimensional array
self
.
attribute_mapping
[
"
Band_RW
"
]
=
(
self
.
pcc_node
.
get_child
([
"
{}:RCUs_Band1_RW
"
.
format
(
self
.
name_space_index
)]
),
self
.
pcc_node
.
get_child
([
"
{}:RCUs_Band2_RW
"
.
format
(
self
.
name_space_index
)]
),
self
.
pcc_node
.
get_child
([
"
{}:RCUs_Band3_RW
"
.
format
(
self
.
name_space_index
)]
))
self
.
attribute_mapping
[
"
Band_RW
"
]
=
(
self
.
get_
pcc_node
(
"
RCUs_Band1_RW
"
),
self
.
get_
pcc_node
(
"
RCUs_Band2_RW
"
),
self
.
get_
pcc_node
(
"
RCUs_Band3_RW
"
))
self
.
attribute_mapping
[
"
CLK_PLL_locked_R
"
]
=
self
.
pcc_node
.
get_child
([
"
{}:
CLK_PLL_locked_R
"
.
format
(
self
.
name_space_index
)]
)
self
.
attribute_mapping
[
"
CLK_PLL_locked_R
"
]
=
self
.
get_
pcc_node
(
"
CLK_PLL_locked_R
"
)
# self.attribute_mapping["Dither_Frequency_R"] = self.pcc_node
.get_child(["{}:
RCUs_Dither_Frequency_R"
.format(self.name_space_index)]
)
# self.attribute_mapping["Dither_Frequency_R"] = self.
get_
pcc_node
("
RCUs_Dither_Frequency_R")
# self.attribute_mapping["Dither_Frequency_RW"] = self.pcc_node
.get_child(["{}:
RCUs_Dither_Frequency_RW"
.format(self.name_space_index)]
)
# self.attribute_mapping["Dither_Frequency_RW"] = self.
get_
pcc_node
("
RCUs_Dither_Frequency_RW")
self
.
attribute_mapping
[
"
LED_R
"
]
=
self
.
pcc_node
.
get_child
([
"
{}:RCUs_LED0_R
"
.
format
(
self
.
name_space_index
)]
)
self
.
attribute_mapping
[
"
LED_R
"
]
=
self
.
get_
pcc_node
(
"
RCUs_LED0_R
"
)
self
.
attribute_mapping
[
"
LED_RW
"
]
=
self
.
pcc_node
.
get_child
([
"
{}:RCUs_LED0_RW
"
.
format
(
self
.
name_space_index
)]
)
self
.
attribute_mapping
[
"
LED_RW
"
]
=
self
.
get_
pcc_node
(
"
RCUs_LED0_RW
"
)
self
.
attribute_mapping
[
"
Pwr_dig_R
"
]
=
self
.
pcc_node
.
get_child
([
"
{}:RCUs_Pwr_dig_R
"
.
format
(
self
.
name_space_index
)]
)
self
.
attribute_mapping
[
"
Pwr_dig_R
"
]
=
self
.
get_
pcc_node
(
"
RCUs_Pwr_dig_R
"
)
self
.
attribute_mapping
[
"
Temperature_R
"
]
=
self
.
pcc_node
.
get_child
([
"
{}:
RCUs_Temperature_R
"
.
format
(
self
.
name_space_index
)]
)
self
.
attribute_mapping
[
"
Temperature_R
"
]
=
self
.
get_
pcc_node
(
"
RCUs_Temperature_R
"
)
# self.attribute_mapping["RCU_off"] = self.pcc_node
.get_child(["{}:RCUs_RCU_off".format(self.name_space_index)]
)
# self.attribute_mapping["RCU_off"] = self.
get_
pcc_node
("RCUs_RCU_off"
)
# self.attribute_mapping["RCU_on"] = self.pcc_node
.get_child(["{}:RCUs_RCU_on".format(self.name_space_index)]
)
# self.attribute_mapping["RCU_on"] = self.
get_
pcc_node
("RCUs_RCU_on"
)
self
.
debug_stream
(
"
Mapping OPC-UA MP/CP to attributes done.
"
)
self
.
debug_stream
(
"
Mapping OPC-UA MP/CP to attributes done.
"
)
...
...
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