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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
8355e764
Commit
8355e764
authored
Jan 14, 2021
by
Thomas Juerges
Browse files
Options
Downloads
Patches
Plain Diff
Refactor for Paulus' pypcc2 version with arrays
parent
f2633184
No related branches found
No related tags found
1 merge request
!2
Refactor for Paulus' pypcc2 version with arrays
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CDB/LOFAR_ConfigDb.json
+80
-71
80 additions, 71 deletions
CDB/LOFAR_ConfigDb.json
CDB/thomas_ConfigDb.json
+81
-72
81 additions, 72 deletions
CDB/thomas_ConfigDb.json
RCUSCC/RCUSCC/RCUSCC.py
+301
-150
301 additions, 150 deletions
RCUSCC/RCUSCC/RCUSCC.py
with
462 additions
and
293 deletions
CDB/LOFAR_ConfigDb.json
+
80
−
71
View file @
8355e764
...
...
@@ -12,125 +12,116 @@
"RCUSCC"
:
{
"PTS/RCUSCC/1"
:
{
"attribute_properties"
:
{
"
ADC_JESD
_R"
:
{
"
RCU_ADC_CML
_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"Attenuator_R"
:
{
"event_period"
:
[
"0"
],
"RCU_ADC_JESD_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"Attenuator_RW"
:
{
"event_period"
:
[
"0"
],
"RCU_ADC_SYNC_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"Band_R"
:
{
"event_period"
:
[
"0"
],
"RCU_ADC_lock_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"Band_RW"
:
{
"event_period"
:
[
"0"
],
"RCU_ID_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"CLK_PLL_locked_R"
:
{
"event_period"
:
[
"0"
],
"RCU_LED0_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"Dither_Frequency_R"
:
{
"event_period"
:
[
"0"
],
"format"
:
[
"%6.8f"
],
"RCU_LED0_RW"
:
{
"rel_change"
:
[
"-
0.
1"
,
"
0.
1"
"-1"
,
"1"
]
},
"Dither_Frequency_RW"
:
{
"event_period"
:
[
"0"
],
"format"
:
[
"%6.8f"
],
"RCU_OUT1_R"
:
{
"rel_change"
:
[
"-
0.
1"
,
"
0.
1"
"-1"
,
"1"
]
},
"LED_R"
:
{
"event_period"
:
[
"0"
],
"RCU_OUT2_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"LED_RW"
:
{
"event_period"
:
[
"0"
],
"RCU_Pwr_dig_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"Pwr_dig_R"
:
{
"event_period"
:
[
"0"
],
"RCU_attenuator_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"State"
:
{
"event_period"
:
[
"0"
"RCU_attenuator_RW"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"Status"
:
{
"RCU_band_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"RCU_band_RW"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"RCU_monitor_rate"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"RCU_temperature_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"RCU_version_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"State"
:
{
"event_period"
:
[
"0"
]
},
"
Temperature_R
"
:
{
"
Status
"
:
{
"event_period"
:
[
"0"
],
"rel_change"
:
[
"-0.1"
,
"0.1"
]
}
},
...
...
@@ -145,29 +136,47 @@
"5.0"
],
"polled_attr"
:
[
"pwr_dig_r"
,
"1000"
,
"state"
,
"1000"
,
"status"
,
"1000"
,
"temperature_r"
,
"ant_mask_rw"
,
"1000"
,
"rcu_adc_cml_r"
,
"1000"
,
"rcu_adc_jesd_r"
,
"1000"
,
"rcu_adc_lock_r"
,
"1000"
,
"rcu_adc_sync_r"
,
"1000"
,
"rcu_attenuator_r"
,
"1000"
,
"rcu_attenuator_rw"
,
"1000"
,
"rcu_band_r"
,
"1000"
,
"rcu_band_rw"
,
"1000"
,
"rcu_id_r"
,
"1000"
,
"rcu_led0_r"
,
"1000"
,
"
attenuator
_r"
,
"
rcu_led0
_r
w
"
,
"1000"
,
"
attenuator
_rw"
,
"
rcu_mask
_rw"
,
"1000"
,
"
band_r
"
,
"
rcu_monitor_rate
"
,
"1000"
,
"
band
_r
w
"
,
"
rcu_out1
_r"
,
"1000"
,
"
clk_pll_locked
_r"
,
"
rcu_out2
_r"
,
"1000"
,
"
led
_r"
,
"
rcu_pwr_dig
_r"
,
"1000"
,
"
led
_r
w
"
,
"
rcu_temperature
_r"
,
"1000"
,
"
adc_jesd
_r"
,
"
rcu_version
_r"
,
"1000"
]
}
...
...
This diff is collapsed.
Click to expand it.
CDB/thomas_ConfigDb.json
+
81
−
72
View file @
8355e764
...
...
@@ -12,125 +12,116 @@
"RCUSCC"
:
{
"PTS/RCUSCC/1"
:
{
"attribute_properties"
:
{
"
ADC_JESD
_R"
:
{
"
RCU_ADC_CML
_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"Attenuator_R"
:
{
"event_period"
:
[
"0"
],
"RCU_ADC_JESD_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"Attenuator_RW"
:
{
"event_period"
:
[
"0"
],
"RCU_ADC_SYNC_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"Band_R"
:
{
"event_period"
:
[
"0"
],
"RCU_ADC_lock_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"Band_RW"
:
{
"event_period"
:
[
"0"
],
"RCU_ID_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"CLK_PLL_locked_R"
:
{
"event_period"
:
[
"0"
],
"RCU_LED0_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"Dither_Frequency_R"
:
{
"event_period"
:
[
"0"
],
"format"
:
[
"%6.8f"
],
"RCU_LED0_RW"
:
{
"rel_change"
:
[
"-
0.
1"
,
"
0.
1"
"-1"
,
"1"
]
},
"Dither_Frequency_RW"
:
{
"event_period"
:
[
"0"
],
"format"
:
[
"%6.8f"
],
"RCU_OUT1_R"
:
{
"rel_change"
:
[
"-
0.
1"
,
"
0.
1"
"-1"
,
"1"
]
},
"LED_R"
:
{
"event_period"
:
[
"0"
],
"RCU_OUT2_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"LED_RW"
:
{
"event_period"
:
[
"0"
],
"RCU_Pwr_dig_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"Pwr_dig_R"
:
{
"event_period"
:
[
"0"
],
"RCU_attenuator_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"State"
:
{
"event_period"
:
[
"0"
"RCU_attenuator_RW"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"Status"
:
{
"RCU_band_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"RCU_band_RW"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"RCU_monitor_rate"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"RCU_temperature_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"RCU_version_R"
:
{
"rel_change"
:
[
"-1"
,
"1"
]
},
"State"
:
{
"event_period"
:
[
"0"
]
},
"
Temperature_R
"
:
{
"
Status
"
:
{
"event_period"
:
[
"0"
],
"rel_change"
:
[
"-0.1"
,
"0.1"
]
}
},
...
...
@@ -139,35 +130,53 @@
"okeanos"
],
"OPC_Server_Port"
:
[
"
50000
"
"
4842
"
],
"OPC_Time_Out"
:
[
"5.0"
],
"polled_attr"
:
[
"pwr_dig_r"
,
"1000"
,
"state"
,
"1000"
,
"status"
,
"1000"
,
"temperature_r"
,
"ant_mask_rw"
,
"1000"
,
"rcu_adc_cml_r"
,
"1000"
,
"rcu_adc_jesd_r"
,
"1000"
,
"rcu_adc_lock_r"
,
"1000"
,
"rcu_adc_sync_r"
,
"1000"
,
"rcu_attenuator_r"
,
"1000"
,
"rcu_attenuator_rw"
,
"1000"
,
"rcu_band_r"
,
"1000"
,
"rcu_band_rw"
,
"1000"
,
"rcu_id_r"
,
"1000"
,
"rcu_led0_r"
,
"1000"
,
"
attenuator
_r"
,
"
rcu_led0
_r
w
"
,
"1000"
,
"
attenuator
_rw"
,
"
rcu_mask
_rw"
,
"1000"
,
"
band_r
"
,
"
rcu_monitor_rate
"
,
"1000"
,
"
band
_r
w
"
,
"
rcu_out1
_r"
,
"1000"
,
"
clk_pll_locked
_r"
,
"
rcu_out2
_r"
,
"1000"
,
"
led
_r"
,
"
rcu_pwr_dig
_r"
,
"1000"
,
"
led
_r
w
"
,
"
rcu_temperature
_r"
,
"1000"
,
"
adc_jesd
_r"
,
"
rcu_version
_r"
,
"1000"
]
}
...
...
This diff is collapsed.
Click to expand it.
RCUSCC/RCUSCC/RCUSCC.py
+
301
−
150
View file @
8355e764
...
...
@@ -70,67 +70,103 @@ class RCUSCC(Device):
# Attributes
# ----------
Attenuator_R
=
attribute
(
RCU_mask_RW
=
attribute
(
dtype
=
(
'
DevBoolean
'
,),
max_dim_x
=
32
,
access
=
AttrWriteType
.
READ_WRITE
,
)
Ant_mask_RW
=
attribute
(
dtype
=
((
'
DevBoolean
'
,),),
max_dim_x
=
32
,
max_dim_y
=
3
,
access
=
AttrWriteType
.
READ_WRITE
,
)
RCU_attenuator_R
=
attribute
(
dtype
=
((
'
DevLong64
'
,),),
max_dim_x
=
32
,
max_dim_y
=
3
,
)
A
ttenuator_RW
=
attribute
(
RCU_a
ttenuator_RW
=
attribute
(
dtype
=
((
'
DevLong64
'
,),),
max_dim_x
=
32
,
max_dim_y
=
3
,
access
=
AttrWriteType
.
READ_WRITE
,
)
B
and_R
=
attribute
(
RCU_b
and_R
=
attribute
(
dtype
=
((
'
DevLong64
'
,),),
max_dim_x
=
32
,
max_dim_y
=
3
,
)
B
and_RW
=
attribute
(
RCU_b
and_RW
=
attribute
(
dtype
=
((
'
DevLong64
'
,),),
max_dim_x
=
32
,
max_dim_y
=
3
,
access
=
AttrWriteType
.
READ_WRITE
,
)
ADC_JESD
_R
=
attribute
(
dtype
=
(
(
'
DevDouble
'
,),
),
max_dim_x
=
32
,
max_dim_y
=
3
,
RCU_temperature
_R
=
attribute
(
dtype
=
(
'
DevDouble
'
,),
max_dim_x
=
32
,
)
CLK_PLL_locked_R
=
attribute
(
dtype
=
'
DevLong64
'
,
RCU_Pwr_dig_R
=
attribute
(
dtype
=
(
'
DevLong64
'
,),
max_dim_x
=
32
,
)
# Dither_Frequency_R = attribute(
# dtype=(('DevDouble',),),
# max_dim_x=32, max_dim_y=2,
# )
#
# Dither_Frequency_RW = attribute(
# dtype=(('DevDouble',),),
# max_dim_x=32, max_dim_y=2,
# access=AttrWriteType.READ_WRITE,
# )
LED_R
=
attribute
(
RCU_LED0_R
=
attribute
(
dtype
=
(
'
DevLong64
'
,),
max_dim_x
=
32
,
)
LED_RW
=
attribute
(
RCU_
LED
0
_RW
=
attribute
(
dtype
=
(
'
DevLong64
'
,),
max_dim_x
=
32
,
access
=
AttrWriteType
.
READ_WRITE
,
)
Pwr_dig_R
=
attribute
(
RCU_ADC_lock_R
=
attribute
(
dtype
=
((
'
DevLong64
'
,),),
max_dim_x
=
32
,
max_dim_y
=
3
,
)
RCU_ADC_SYNC_R
=
attribute
(
dtype
=
((
'
DevLong64
'
,),),
max_dim_x
=
32
,
max_dim_y
=
3
,
)
RCU_ADC_JESD_R
=
attribute
(
dtype
=
((
'
DevLong64
'
,),),
max_dim_x
=
32
,
max_dim_y
=
3
,
)
RCU_ADC_CML_R
=
attribute
(
dtype
=
((
'
DevLong64
'
,),),
max_dim_x
=
32
,
max_dim_y
=
3
,
)
RCU_OUT1_R
=
attribute
(
dtype
=
((
'
DevLong64
'
,),),
max_dim_x
=
32
,
max_dim_y
=
3
,
)
RCU_OUT2_R
=
attribute
(
dtype
=
((
'
DevLong64
'
,),),
max_dim_x
=
32
,
max_dim_y
=
3
,
)
RCU_ID_R
=
attribute
(
dtype
=
(
'
DevLong64
'
,),
max_dim_x
=
32
,
)
Temperature_R
=
attribute
(
dtype
=
(
'
DevDouble
'
,),
max_dim_x
=
32
,
RCU_version_R
=
attribute
(
dtype
=
((
'
DevUChar
'
,),),
max_dim_x
=
32
,
max_dim_y
=
8
,
)
RCU_monitor_rate
=
attribute
(
dtype
=
'
DevULong64
'
,
)
...
...
@@ -159,49 +195,49 @@ class RCUSCC(Device):
self
.
debug_stream
(
"
Mapping OPC-UA MP/CP to attributes...
"
)
# 2020-11-27, thomas
# TODO
# Modify as soon as we have a real multi-dimensional array
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
"
))
self
.
attribute_mapping
[
"
RCU_mask_RW
"
]
=
self
.
get_pcc_node
(
"
RCU_mask_RW
"
)
self
.
attribute_mapping
[
"
Ant_mask_RW
"
]
=
self
.
get_pcc_node
(
"
Ant_mask_RW
"
)
self
.
attribute_mapping
[
"
RCU_attenuator_R
"
]
=
self
.
get_pcc_node
(
"
RCU_attenuator_R
"
)
self
.
attribute_mapping
[
"
RCU_attenuator_RW
"
]
=
self
.
get_pcc_node
(
"
RCU_attenuator_RW
"
)
self
.
attribute_mapping
[
"
RCU_band_R
"
]
=
self
.
get_pcc_node
(
"
RCU_band_R
"
)
self
.
attribute_mapping
[
"
RCU_band_RW
"
]
=
self
.
get_pcc_node
(
"
RCU_band_RW
"
)
self
.
attribute_mapping
[
"
RCU_temperature_R
"
]
=
self
.
get_pcc_node
(
"
RCU_temperature_R
"
)
self
.
attribute_mapping
[
"
RCU_Pwr_dig_R
"
]
=
self
.
get_pcc_node
(
"
RCU_Pwr_dig_R
"
)
# 2020-11-27, thomas
# TODO
# Modify as soon as we have a real multi-dimensional array
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
"
))
self
.
attribute_mapping
[
"
RCU_LED0_R
"
]
=
self
.
get_pcc_node
(
"
RCU_LED0_R
"
)
# 2020-11-27, thomas
# TODO
# Modify as soon as we have a real multi-dimensional array
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
"
))
self
.
attribute_mapping
[
"
RCU_LED0_RW
"
]
=
self
.
get_pcc_node
(
"
RCU_LED0_RW
"
)
# 2020-11-27, thomas
# TODO
# Modify as soon as we have a real multi-dimensional array
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
[
"
RCU_ADC_lock_R
"
]
=
self
.
get_pcc_node
(
"
RCU_ADC_lock_R
"
)
# 2020-11-27, thomas
# TODO
# Modify as soon as we have a real multi-dimensional array
self
.
attribute_mapping
[
"
ADC_JESD_R
"
]
=
(
self
.
get_pcc_node
(
"
RCUs_ADC1_JESD_R
"
),
self
.
get_pcc_node
(
"
RCUs_ADC2_JESD_R
"
),
self
.
get_pcc_node
(
"
RCUs_ADC3_JESD_R
"
))
self
.
attribute_mapping
[
"
RCU_ADC_SYNC_R
"
]
=
self
.
get_pcc_node
(
"
RCU_ADC_SYNC_R
"
)
self
.
attribute_mapping
[
"
RCU_ADC_CML_R
"
]
=
self
.
get_pcc_node
(
"
RCU_ADC_CML_R
"
)
self
.
attribute_mapping
[
"
CLK_PLL_locked
_R
"
]
=
self
.
get_pcc_node
(
"
CLK_PLL_locked
_R
"
)
self
.
attribute_mapping
[
"
RCU_ADC_JESD
_R
"
]
=
self
.
get_pcc_node
(
"
RCU_ADC_JESD
_R
"
)
#
self.attribute_mapping["
Dither_Frequency
_R"] = self.get_pcc_node("RCU
s_Dither_Frequency
_R")
self
.
attribute_mapping
[
"
RCU_OUT1
_R
"
]
=
self
.
get_pcc_node
(
"
RCU
_OUT1
_R
"
)
#
self.attribute_mapping["
Dither_Frequency
_R
W
"] = self.get_pcc_node("RCU
s_Dither_Frequency
_R
W
")
self
.
attribute_mapping
[
"
RCU_OUT2
_R
"
]
=
self
.
get_pcc_node
(
"
RCU
_OUT2
_R
"
)
self
.
attribute_mapping
[
"
LE
D_R
"
]
=
self
.
get_pcc_node
(
"
RCU
s_LED0
_R
"
)
self
.
attribute_mapping
[
"
RCU_I
D_R
"
]
=
self
.
get_pcc_node
(
"
RCU
_ID
_R
"
)
self
.
attribute_mapping
[
"
LED
_R
W
"
]
=
self
.
get_pcc_node
(
"
RCU
s_LED0
_R
W
"
)
self
.
attribute_mapping
[
"
RCU_version
_R
"
]
=
self
.
get_pcc_node
(
"
RCU
_version
_R
"
)
self
.
attribute_mapping
[
"
Pwr_dig_R
"
]
=
self
.
get_pcc_node
(
"
RCU
s_Pwr_dig_R
"
)
self
.
attribute_mapping
[
"
RCU_monitor_rate
"
]
=
self
.
get_pcc_node
(
"
RCU
_monitor_rate
"
)
self
.
attribute
_mapping
[
"
Temperature_R
"
]
=
self
.
get_pcc_node
(
"
RCU
s_Temperature_R
"
)
self
.
function
_mapping
[
"
RCU_off
"
]
=
self
.
get_pcc_node
(
"
RCU
_off
"
)
#
self.
attribute
_mapping["RCU_o
ff
"] = self.get_pcc_node("RCU
s_RCU_off
")
self
.
function
_mapping
[
"
RCU_o
n
"
]
=
self
.
get_pcc_node
(
"
RCU
_on
"
)
#
self.
attribute
_mapping["
RCU
_on"] = self.get_pcc_node("
RCUs_RCU
_on")
self
.
function
_mapping
[
"
ADC
_on
"
]
=
self
.
get_pcc_node
(
"
ADC
_on
"
)
self
.
debug_stream
(
"
Mapping OPC-UA MP/CP to attributes done.
"
)
...
...
@@ -219,41 +255,68 @@ class RCUSCC(Device):
# Set default values in the RW/R attributes and add them to
# the mapping.
self
.
_
Attenuator
_R
=
((
0
,),)
self
.
attribute_mapping
[
"
Attenuator
_R
"
]
=
{}
self
.
_
RCU_mask
_R
W
=
((
0
,),)
self
.
attribute_mapping
[
"
RCU_mask
_R
W
"
]
=
{}
self
.
_A
ttenuator
_RW
=
((
0
,),)
self
.
attribute_mapping
[
"
A
ttenuator
_RW
"
]
=
{}
self
.
_A
nt_mask
_RW
=
((
0
,),)
self
.
attribute_mapping
[
"
A
nt_mask
_RW
"
]
=
{}
self
.
_
CLK_PLL_locked_R
=
0
self
.
attribute_mapping
[
"
CLK_PLL_locked
_R
"
]
=
{}
self
.
_
RCU_attenuator_R
=
((
0
,),)
self
.
attribute_mapping
[
"
RCU_attenuator
_R
"
]
=
{}
self
.
_
Band
_R
=
((
0
,),)
self
.
attribute_mapping
[
"
Band
_R
"
]
=
{}
self
.
_
RCU_attenuator
_R
W
=
((
0
,),)
self
.
attribute_mapping
[
"
RCU_attenuator
_R
W
"
]
=
{}
self
.
_
B
and_R
W
=
((
0
,),)
self
.
attribute_mapping
[
"
B
and_R
W
"
]
=
{}
self
.
_
RCU_b
and_R
=
((
0
,),)
self
.
attribute_mapping
[
"
RCU_b
and_R
"
]
=
{}
self
.
_
ADC_JESD
_R
=
((
0
,),)
self
.
attribute_mapping
[
"
ADC_JESD
_R
"
]
=
{}
self
.
_
RCU_band
_R
W
=
((
0
,),)
self
.
attribute_mapping
[
"
RCU_band
_R
W
"
]
=
{}
self
.
_
Dither_Frequency
_R
=
(
(
0.0
,)
,)
self
.
attribute_mapping
[
"
Dither_Frequency
_R
"
]
=
{}
self
.
_
RCU_temperature
_R
=
(
0.0
,)
self
.
attribute_mapping
[
"
RCU_temperature
_R
"
]
=
{}
self
.
_
Dither_Frequency
_R
W
=
(
(
0.0
,)
,)
self
.
attribute_mapping
[
"
Dither_Frequency
_R
W
"
]
=
{}
self
.
_
RCU_Pwr_dig
_R
=
(
0
,)
self
.
attribute_mapping
[
"
RCU_Pwr_dig
_R
"
]
=
{}
self
.
_LED_R
=
((
0
,),)
self
.
attribute_mapping
[
"
LED_R
"
]
=
{}
self
.
_
RCU_
LED
0
_R
=
((
0
,),)
self
.
attribute_mapping
[
"
RCU_
LED
0
_R
"
]
=
{}
self
.
_LED0_RW
=
((
0
,),)
self
.
attribute_mapping
[
"
LED_RW
"
]
=
{}
self
.
_
RCU_
LED0_RW
=
((
0
,),)
self
.
attribute_mapping
[
"
RCU_
LED
0
_RW
"
]
=
{}
self
.
_
Pwr_dig
_R
=
(
0
,)
self
.
attribute_mapping
[
"
Pwr_dig
_R
"
]
=
{}
self
.
_
RCU_ADC_lock
_R
=
(
(
0
,)
,)
self
.
attribute_mapping
[
"
RCU_ADC_lock
_R
"
]
=
{}
self
.
_Temperature_R
=
(
0.0
,)
self
.
attribute_mapping
[
"
Temperature_R
"
]
=
{}
self
.
_RCU_ADC_SYNC_R
=
((
0
,),)
self
.
attribute_mapping
[
"
RCU_ADC_SYNC_R
"
]
=
{}
self
.
_RCU_ADC_JESD_R
=
((
0
,),)
self
.
attribute_mapping
[
"
RCU_ADC_JESD_R
"
]
=
{}
self
.
_RCU_ADC_CML_R
=
((
0
,),)
self
.
attribute_mapping
[
"
RCU_ADC_CML_R
"
]
=
{}
self
.
_RCU_OUT1_R
=
((
0
,),)
self
.
attribute_mapping
[
"
RCU_OUT1_R
"
]
=
{}
self
.
_RCU_OUT2_R
=
((
0
,),)
self
.
attribute_mapping
[
"
RCU_OUT2_R
"
]
=
{}
self
.
_RCU_ID_R
=
((
0
,),)
self
.
attribute_mapping
[
"
RCU_ID_R
"
]
=
{}
self
.
_RCU_version_R
=
((
0
,),)
self
.
attribute_mapping
[
"
RCU_version_R
"
]
=
{}
self
.
_RCU_monitor_rate
=
0.0
self
.
attribute_mapping
[
"
RCU_monitor_rate
"
]
=
{}
# Init the dict that contains function to OPC-UA function mappings.
self
.
function_mapping
=
{}
self
.
function_mapping
[
"
RCU_on
"
]
=
{}
self
.
function_mapping
[
"
RCU_off
"
]
=
{}
self
.
function_mapping
[
"
ADC_on
"
]
=
{}
self
.
client
=
opcua
.
Client
(
"
opc.tcp://{}:{}/
"
.
format
(
self
.
OPC_Server_Name
,
self
.
OPC_Server_Port
),
self
.
OPC_Time_Out
)
# timeout in seconds
...
...
@@ -310,120 +373,198 @@ class RCUSCC(Device):
@only_when_on
@fault_on_error
def
read_Attenuator_R
(
self
):
"""
Return the Attenuator_R attribute.
"""
self
.
_Attenuator_R
=
numpy
.
array
([
self
.
attribute_mapping
[
"
Attenuator_R
"
][
0
].
get_value
(),
self
.
attribute_mapping
[
"
Attenuator_R
"
][
1
].
get_value
(),
self
.
attribute_mapping
[
"
Attenuator_R
"
][
2
].
get_value
()])
return
self
.
_Attenuator_R
def
read_RCU_mask_R
(
self
):
"""
Return the RCU_mask_R attribute.
"""
self
.
_RCU_mask_R
=
numpy
.
array
([
self
.
attribute_mapping
[
"
RCU_mask_R
"
].
get_value
()])
return
self
.
_RCU_mask_R
@only_when_on
@fault_on_error
def
read_RCU_mask_RW
(
self
):
"""
Return the RCU_mask_RW attribute.
"""
return
self
.
_RCU_mask_RW
@only_when_on
@fault_on_error
def
read_Attenuator
_RW
(
self
):
"""
R
et
urn
the
Attenuator
_R attribute.
"""
self
.
_Attenuator_RW
=
numpy
.
array
([
self
.
attribute_mapping
[
"
Attenuator_RW
"
][
0
].
get_value
(),
self
.
attribute_mapping
[
"
Attenuator_RW
"
][
1
].
get_value
(),
self
.
attribute_mapping
[
"
Attenuator_RW
"
][
2
].
get_value
()
]
)
return
self
.
_Attenuator_RW
def
write_RCU_mask
_RW
(
self
,
value
):
"""
S
et the
RCU_mask
_R
W
attribute.
"""
self
.
attribute_mapping
[
"
RCU_mask_RW
"
].
set_value
(
value
.
tolist
())
self
.
_RCU_mask_RW
=
value
@only_when_on
@fault_on_error
def
write_Attenuator_RW
(
self
,
value
):
"""
Set the Attenuator_RW attribute.
"""
self
.
attribute_mapping
[
"
Attenuator_RW
"
][
0
].
set_value
(
value
[
0
].
tolist
())
self
.
attribute_mapping
[
"
Attenuator_RW
"
][
1
].
set_value
(
value
[
1
].
tolist
())
self
.
attribute_mapping
[
"
Attenuator_RW
"
][
2
].
set_value
(
value
[
2
].
tolist
())
self
.
_Attenuator_RW
=
value
def
read_Ant_mask_R
(
self
):
"""
Return the Ant_mask_R attribute.
"""
value
=
numpy
.
array
([
self
.
attribute_mapping
[
"
Ant_mask_R
"
].
get_value
()])
self
.
_Ant_mask_R
=
numpy
.
split
(
value
,
indices_or_sections
=
32
)
return
self
.
_Ant_mask_R
@only_when_on
@fault_on_error
def
read_Band_R
(
self
):
"""
Return the Band_R attribute.
"""
self
.
_Band_R
=
numpy
.
array
([
self
.
attribute_mapping
[
"
Band_R
"
][
0
].
get_value
(),
self
.
attribute_mapping
[
"
Band_R
"
][
1
].
get_value
(),
self
.
attribute_mapping
[
"
Band_R
"
][
2
].
get_value
()])
return
self
.
_Band_R
def
read_Ant_mask_RW
(
self
):
"""
Return the Ant_mask_RW attribute.
"""
return
self
.
_Ant_mask_RW
@only_when_on
@fault_on_error
def
read_Band_RW
(
self
):
"""
Return the Band_R attribute.
"""
self
.
_Band_RW
=
numpy
.
array
([
self
.
attribute_mapping
[
"
Band_RW
"
][
0
].
get_value
(),
self
.
attribute_mapping
[
"
Band_RW
"
][
1
].
get_value
(),
self
.
attribute_mapping
[
"
Band_RW
"
][
2
].
get_value
()])
return
self
.
_Band_RW
def
write_Ant_mask_RW
(
self
,
value
):
"""
Set the Ant_mask_RW attribute.
"""
v
=
numpy
.
concatenate
(
value
)
self
.
attribute_mapping
[
"
Ant_mask_RW
"
].
set_value
(
v
.
tolist
())
self
.
_Ant_mask_RW
=
value
@only_when_on
@fault_on_error
def
write_Band_RW
(
self
,
value
):
"""
Set the Band_RW attribute.
"""
self
.
attribute_mapping
[
"
Band_RW
"
][
0
].
set_value
(
value
[
0
].
tolist
())
self
.
attribute_mapping
[
"
Band_RW
"
][
1
].
set_value
(
value
[
1
].
tolist
())
self
.
attribute_mapping
[
"
Band_RW
"
][
2
].
set_value
(
value
[
2
].
tolist
())
self
.
_Band_RW
=
value
def
read_RCU_attenuator_R
(
self
):
"""
Return the RCU_attenuator_R attribute.
"""
value
=
numpy
.
array
([
self
.
attribute_mapping
[
"
RCU_attenuator_R
"
].
get_value
()])
self
.
_RCU_attenuator_R
=
numpy
.
split
(
value
,
indices_or_sections
=
32
)
return
self
.
_RCU_attenuator_R
@only_when_on
@fault_on_error
def
read_ADC_JESD_R
(
self
):
"""
Return the ADC_JESD_R attribute.
"""
self
.
_ADC_JESD_R
=
numpy
.
array
([
self
.
attribute_mapping
[
"
ADC_JESD_R
"
][
0
].
get_value
(),
self
.
attribute_mapping
[
"
ADC_JESD_R
"
][
1
].
get_value
(),
self
.
attribute_mapping
[
"
ADC_JESD_R
"
][
2
].
get_value
()])
return
self
.
_ADC_JESD_R
def
read_RCU_attenuator_RW
(
self
):
"""
Return the RCU_attenuator_RW attribute.
"""
return
self
.
_RCU_attenuator_RW
@only_when_on
@fault_on_error
def
read_Dither_Frequency_R
(
self
):
"""
Return the Dither_Frequency_R attribute.
"""
self
.
_Dither_Frequency_R
=
numpy
.
array
([
self
.
attribute_mapping
[
"
Dither_Frequency_R
"
][
0
].
get_value
(),
self
.
attribute_mapping
[
"
Dither_Frequency_R
"
][
1
].
get_value
()])
return
self
.
_Dither_Frequency_R
def
write_RCU_attenuator_RW
(
self
,
value
):
"""
Set the RCU_attenuator_RW attribute.
"""
v
=
numpy
.
concatenate
(
value
)
self
.
attribute_mapping
[
"
RCU_attenuator_RW
"
].
set_value
(
v
.
tolist
())
self
.
_RCU_attenuator_RW
=
value
@only_when_on
@fault_on_error
def
read_Dither_Frequency_RW
(
self
):
"""
Return the Dither_Frequency_R attribute.
"""
self
.
_Dither_Frequency_RW
=
numpy
.
array
([
self
.
attribute_mapping
[
"
Dither_Frequency_RW
"
][
0
].
get_value
(),
self
.
attribute_mapping
[
"
Dither_Frequency_RW
"
][
1
].
get_value
()])
return
self
.
_Dither_Frequency_RW
def
read_RCU_band_R
(
self
):
"""
Return the RCU_band_R attribute.
"""
value
=
numpy
.
array
([
self
.
attribute_mapping
[
"
RCU_band_R
"
].
get_value
()])
self
.
_RCU_band_R
=
numpy
.
split
(
value
,
indices_or_sections
=
32
)
return
self
.
_RCU_band_R
@only_when_on
@fault_on_error
def
write_Dither_Frequency_RW
(
self
,
value
):
"""
Set the Dither_Frequency_RW attribute.
"""
self
.
attribute_mapping
[
"
Dither_Frequency_RW
"
][
0
].
set_value
(
value
[
0
].
tolist
())
self
.
attribute_mapping
[
"
Dither_Frequency_RW
"
][
1
].
set_value
(
value
[
1
].
tolist
())
self
.
_Dither_Frequency_RW
=
value
def
read_RCU_band_RW
(
self
):
"""
Return the RCU_band_RW attribute.
"""
return
self
.
_RCU_band_RW
@only_when_on
@fault_on_error
def
read_LED_R
(
self
):
"""
Return the LED_R attribute.
"""
self
.
_LED_R
=
self
.
attribute_mapping
[
"
LED_R
"
].
get_value
()
return
self
.
_LED_R
def
write_RCU_band_RW
(
self
,
value
):
"""
Set the RCU_band_RW attribute.
"""
v
=
numpy
.
concatenate
(
value
)
self
.
attribute_mapping
[
"
RCU_band_RW
"
].
set_value
(
v
.
tolist
())
self
.
_RCU_band_RW
=
value
@only_when_on
@fault_on_error
def
read_
LED
_R
W
(
self
):
"""
Return the
LED
_R
W
attribute.
"""
self
.
_
LED
_R
W
=
self
.
attribute_mapping
[
"
LED
_R
W
"
].
get_value
()
return
self
.
_
LED
_R
W
def
read_
RCU_temperature
_R
(
self
):
"""
Return the
RCU_temperature
_R attribute.
"""
self
.
_
RCU_temperature
_R
=
self
.
attribute_mapping
[
"
RCU_temperature
_R
"
].
get_value
()
return
self
.
_
RCU_temperature
_R
@only_when_on
@fault_on_error
def
write_LED
_R
W
(
self
,
value
):
"""
S
et the
LED
_R
W
attribute.
"""
self
.
attribute_mapping
[
"
LED
_R
W
"
].
s
et_value
(
value
.
tolist
()
)
self
.
_LED_RW
=
value
def
read_RCU_Pwr_dig
_R
(
self
):
"""
R
et
urn
the
RCU_Pwr_dig
_R attribute.
"""
self
.
_RCU_Pwr_dig_R
=
self
.
attribute_mapping
[
"
RCU_Pwr_dig
_R
"
].
g
et_value
()
return
self
.
_RCU_Pwr_dig_R
@only_when_on
@fault_on_error
def
read_
Pwr_dig
_R
(
self
):
"""
Return the
Pwr_dig
_R attribute.
"""
self
.
_
Pwr_dig
_R
=
self
.
attribute_mapping
[
"
Pwr_dig
_R
"
].
get_value
()
return
self
.
_
Pwr_dig
_R
def
read_
RCU_LED0
_R
(
self
):
"""
Return the
RCU_LED0
_R attribute.
"""
self
.
_
RCU_LED0
_R
=
self
.
attribute_mapping
[
"
RCU_LED0
_R
"
].
get_value
()
return
self
.
_
RCU_LED0
_R
@only_when_on
@fault_on_error
def
read_Temperature_R
(
self
):
"""
Return the Temperature_R attribute.
"""
self
.
_Temperature_R
=
self
.
attribute_mapping
[
"
Temperature_R
"
].
get_value
()
return
self
.
_Temperature_R
def
read_RCU_LED0_RW
(
self
):
"""
Return the RCU_LED0_RW attribute.
"""
return
self
.
_RCU_LED0_RW
@only_when_on
@fault_on_error
def
read_CLK_PLL_locked_R
(
self
):
"""
Return the CLK_PLL_locked_R attribute.
"""
self
.
_CLK_PLL_locked_R
=
self
.
attribute_mapping
[
"
CLK_PLL_locked_R
"
].
get_value
()
return
self
.
_CLK_PLL_locked_R
def
write_RCU_LED0_RW
(
self
,
value
):
"""
Set the RCU_LED0_RW attribute.
"""
self
.
attribute_mapping
[
"
RCU_LED0_RW
"
].
set_value
(
value
.
tolist
())
self
.
_RCU_LED0_RW
=
value
@only_when_on
@fault_on_error
def
read_RCU_ADC_lock_R
(
self
):
"""
Return the RCU_ADC_lock_R attribute.
"""
value
=
numpy
.
array
([
self
.
attribute_mapping
[
"
RCU_ADC_lock_R
"
].
get_value
()])
self
.
_RCU_ADC_lock_R
=
numpy
.
split
(
value
,
indices_or_sections
=
32
)
return
self
.
_RCU_ADC_lock_R
@only_when_on
@fault_on_error
def
read_RCU_ADC_SYNC_R
(
self
):
"""
Return the RCU_ADC_SYNC_R attribute.
"""
value
=
numpy
.
array
([
self
.
attribute_mapping
[
"
RCU_ADC_SYNC_R
"
].
get_value
()])
self
.
_RCU_ADC_SYNC_R
=
numpy
.
split
(
value
,
indices_or_sections
=
32
)
return
self
.
_RCU_ADC_SYNC_R
@only_when_on
@fault_on_error
def
read_RCU_ADC_JESD_R
(
self
):
"""
Return the RCU_ADC_JESD_R attribute.
"""
value
=
numpy
.
array
([
self
.
attribute_mapping
[
"
RCU_ADC_JESD_R
"
].
get_value
()])
self
.
_RCU_ADC_JESD_R
=
numpy
.
split
(
value
,
indices_or_sections
=
32
)
return
self
.
_RCU_ADC_JESD_R
@only_when_on
@fault_on_error
def
read_RCU_ADC_CML_R
(
self
):
"""
Return the RCU_ADC_CML_R attribute.
"""
value
=
numpy
.
array
([
self
.
attribute_mapping
[
"
RCU_ADC_CML_R
"
].
get_value
()])
self
.
_RCU_ADC_CML_R
=
numpy
.
split
(
value
,
indices_or_sections
=
32
)
return
self
.
_RCU_ADC_CML_R
@only_when_on
@fault_on_error
def
read_RCU_OUT1_R
(
self
):
"""
Return the RCU_OUT1_R attribute.
"""
value
=
self
.
attribute_mapping
[
"
RCU_OUT1_R
"
].
get_value
()
self
.
_RCU_OUT1_R
=
numpy
.
split
(
value
,
indices_or_sections
=
32
)
return
self
.
_RCU_OUT1_R
@only_when_on
@fault_on_error
def
read_RCU_OUT2_R
(
self
):
"""
Return the RCU_OUT2_R attribute.
"""
value
=
self
.
attribute_mapping
[
"
RCU_OUT2_R
"
].
get_value
()
self
.
_RCU_OUT2_R
=
numpy
.
split
(
value
,
indices_or_sections
=
32
)
return
self
.
_RCU_OUT2_R
@only_when_on
@fault_on_error
def
read_RCU_ID_R
(
self
):
"""
Return the RCU_ID_R attribute.
"""
self
.
_RCU_ID_R
=
self
.
attribute_mapping
[
"
RCU_ID_R
"
].
get_value
()
return
self
.
_RCU_ID_R
@only_when_on
@fault_on_error
def
read_RCU_version_R
(
self
):
"""
Return the RCU_version_R attribute.
"""
self
.
_RCU_version_R
=
self
.
attribute_mapping
[
"
RCU_version_R
"
].
get_value
()
return
self
.
_RCU_version_R
@only_when_on
@fault_on_error
def
read_RCU_monitor_rate
(
self
):
"""
Return the RCU_monitor_rate attribute.
"""
return
self
.
_RCU_monitor_rate
@only_when_on
@fault_on_error
def
write_RCU_monitor_rate
(
self
,
value
):
"""
Set the RCU_monitor_rate attribute.
"""
self
.
attribute_mapping
[
"
RCU_monitor_rate
"
].
set_value
(
value
)
self
.
_RCU_monitor_rate
=
value
# --------
...
...
@@ -480,7 +621,7 @@ class RCUSCC(Device):
:return:None
"""
#
self.
attribute
_mapping["RCU_off"]()
self
.
function
_mapping
[
"
RCU_off
"
]()
@command
(
)
...
...
@@ -490,7 +631,17 @@ class RCUSCC(Device):
:return:None
"""
# self.attribute_mapping["RCU_on"]()
self
.
function_mapping
[
"
RCU_on
"
]()
@command
(
)
@DebugIt
()
def
ADC_on
(
self
):
"""
:return:None
"""
self
.
function_mapping
[
"
ADC_on
"
]()
# ----------
...
...
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