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
2b2460f5
Commit
2b2460f5
authored
4 years ago
by
Thomas Juerges
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-170
Use of enumerations simplifies the RCU mask set-up
parent
4959ba23
No related branches found
No related tags found
1 merge request
!22
L2SS-170: First stab at an LTS cold start script
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
devices/util/lts_cold_start.py
+12
-18
12 additions, 18 deletions
devices/util/lts_cold_start.py
with
12 additions
and
18 deletions
devices/util/lts_cold_start.py
+
12
−
18
View file @
2b2460f5
...
...
@@ -189,26 +189,20 @@ def lts_cold_start():
#
#
# Steps 3.1 & 3.2
# 2021-04-30, Thomas
# This should be refactored into a function.
rcu_i2c_status
=
numpy
.
array
(
pcc
.
RCU_I2C_STATUS_R
)
i2c_ok_rcus
=
numpy
.
where
(
rcu_i2c_status
==
0
,
True
,
False
)
i2c_not_ok_rcus
=
~
i2c_ok_rcus
adc_locked
=
pcc
.
RCU_ADC_lock_R
rcu
=
-
1
for
status
in
i2c_ok_rcus
:
rcu
=
rcu
+
1
if
status
is
True
:
logging
.
debug
(
"
RCU #{} is available.
"
.
format
(
rcu
))
adc
=
-
1
for
lock
in
adc_locked
[
rcu
]:
adc
=
adc
+
1
if
lock
[
adc
]
is
False
:
logging
.
warning
(
"
RCU #{} ADC #{} is unlocked. Please investigate! Will continue with normal operation.
"
.
format
(
rcu
,
adc
))
rcu_mask
=
pcc
.
RCU_mask_RW
adc_locked
=
numpy
.
array
(
pcc
.
RCU_ADC_lock_R
)
for
rcu
,
i2c_status
in
enumerate
(
pcc
.
RCU_I2C_STATUS_R
):
if
i2c_status
==
0
:
pcc
.
RCU_mask_RW
[
rcu
]
=
True
logging
.
info
(
"
RCU #{} is available.
"
.
format
(
rcu
))
for
adc
,
adc_is_locked
in
enumerate
(
adc_locked
[
rcu
]):
if
adc_is_locked
<
1
:
logging
.
warning
(
"
RCU#{}, ADC#{} is unlocked. Please investigate! Will continue with normal operation.
"
.
format
(
rcu
,
adc
))
else
:
# The RCU's I2C bus is not working.
pcc
.
RCU_mask_RW
[
rcu
]
=
False
logging
.
warning
(
"
RCU #{}
'
s I2C is not working. Please investigate! Disabling RCU #{} to avoid damage.
"
.
format
(
rcu
,
rcu
))
rcu_mask
[
rcu
]
=
False
logging
.
error
(
"
RCU #{}
'
s I2C is not working. Please investigate! Disabling RCU #{} to avoid damage.
"
.
format
(
rcu
,
rcu
))
pcc
.
RCU_mask_RW
=
rcu_mask
# Step 3.3
# 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