Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
FofbTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
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
DG
FOFB
FofbTool
Commits
83953762
Commit
83953762
authored
7 months ago
by
BRONES Romain
Browse files
Options
Downloads
Patches
Plain Diff
refactor comlbp operation
parent
8f5461cd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
FofbTool/Operation.py
+30
-25
30 additions, 25 deletions
FofbTool/Operation.py
FofbTool/Utils.py
+3
-3
3 additions, 3 deletions
FofbTool/Utils.py
with
33 additions
and
28 deletions
FofbTool/Operation.py
+
30
−
25
View file @
83953762
...
@@ -10,7 +10,6 @@ import tango
...
@@ -10,7 +10,6 @@ import tango
import
logging
import
logging
import
numpy
as
np
import
numpy
as
np
import
time
import
time
import
FofbTool.Utils
# Get the module logger
# Get the module logger
...
@@ -315,64 +314,70 @@ def ack_combpm(node_tangopath):
...
@@ -315,64 +314,70 @@ def ack_combpm(node_tangopath):
# OPERATIONS ON COMLBP
# OPERATIONS ON COMLBP
###################################################################################################
###################################################################################################
def
stop_comlbp
(
cellnodename
):
def
stop_comlbp
(
node_tangopath
):
"""
"""
Stop the communication with LBP on the specified cellnode.
Stop the communication with LBP on the specified cellnode.
PARAMETERS
PARAMETERS
----------
----------
cellnodename
: str
node_tangopath
: str
The target fofbnode
, ie
'
cellnode-c09
'
The target fofbnode
tango path, ie
'
ans/dg/fofb-
cellnode-c09
'
"""
"""
prx
=
FofbTool
.
Utils
.
get_prx_from_nodename
(
cellnodename
)
try
:
if
prx
is
None
:
prx
=
tango
.
DeviceProxy
(
node_tangopath
)
logger
.
error
(
"
Failed to stop ComLBP on {}
"
.
format
(
p
))
prx
.
ping
()
return
except
tango
.
DevFailed
:
logger
.
error
(
"
Failed to obtain tango proxy or to ping to {}
"
.
format
(
node_tangopath
))
return
None
logger
.
info
(
"
Stopping ComLBP on {}
"
.
format
(
cellnodename
))
logger
.
info
(
"
Stopping ComLBP on {}
"
.
format
(
node_tangopath
))
for
n
in
range
(
4
):
for
n
in
range
(
4
):
prx
[
"
comlbp{}_control
"
.
format
(
n
)]
=
1
prx
[
"
comlbp{}_control
"
.
format
(
n
)]
=
1
time
.
sleep
(
1
)
time
.
sleep
(
1
)
for
n
in
range
(
4
):
for
n
in
range
(
4
):
prx
[
"
comlbp{}_control
"
.
format
(
n
)]
=
0
prx
[
"
comlbp{}_control
"
.
format
(
n
)]
=
0
def
start_comlbp
(
cellnodename
):
def
start_comlbp
(
node_tangopath
):
"""
"""
Start the communication with LBP on the specified cellnode.
Start the communication with LBP on the specified cellnode.
PARAMETERS
PARAMETERS
----------
----------
cellnodename
: str
node_tangopath
: str
The target fofbnode
, ie
'
cellnode-c09
'
The target fofbnode
tango path, ie
'
ans/dg/fofb-
cellnode-c09
'
"""
"""
prx
=
FofbTool
.
Utils
.
get_prx_from_nodename
(
cellnodename
)
try
:
if
prx
is
None
:
prx
=
tango
.
DeviceProxy
(
node_tangopath
)
logger
.
error
(
"
Failed to start ComLBP on {}
"
.
format
(
p
))
prx
.
ping
()
return
except
tango
.
DevFailed
:
logger
.
error
(
"
Failed to obtain tango proxy or to ping to {}
"
.
format
(
node_tangopath
))
return
None
logger
.
info
(
"
Starting ComLBP on {}
"
.
format
(
cellnodename
))
logger
.
info
(
"
Starting ComLBP on {}
"
.
format
(
node_tangopath
))
for
n
in
range
(
4
):
for
n
in
range
(
4
):
prx
[
"
comlbp{}_control
"
.
format
(
n
)]
=
0x10
prx
[
"
comlbp{}_control
"
.
format
(
n
)]
=
0x10
def
reset_comlbp
(
cellnodename
):
def
reset_comlbp
(
node_tangopath
):
"""
"""
Reset the communication with LBP on the specified cellnode.
Reset the communication with LBP on the specified cellnode.
PARAMETERS
PARAMETERS
----------
----------
cellnodename
: str
node_tangopath
: str
The target fofbnode
, ie
'
cellnode-c09
'
The target fofbnode
tango path, ie
'
ans/dg/fofb-
cellnode-c09
'
"""
"""
prx
=
FofbTool
.
Utils
.
get_prx_from_nodename
(
cellnodename
)
try
:
if
prx
is
None
:
prx
=
tango
.
DeviceProxy
(
node_tangopath
)
logger
.
error
(
"
Failed to reset ComLBP on {}
"
.
format
(
p
))
prx
.
ping
()
return
except
tango
.
DevFailed
:
logger
.
error
(
"
Failed to obtain tango proxy or to ping to {}
"
.
format
(
node_tangopath
))
return
None
logger
.
info
(
"
Reset ComLBP on {}
"
.
format
(
cellnodename
))
logger
.
info
(
"
Reset ComLBP on {}
"
.
format
(
node_tangopath
))
for
n
in
range
(
4
):
for
n
in
range
(
4
):
prx
[
"
comlbp{}_control
"
.
format
(
n
)]
=
0x3
prx
[
"
comlbp{}_control
"
.
format
(
n
)]
=
0x3
...
...
This diff is collapsed.
Click to expand it.
FofbTool/Utils.py
+
3
−
3
View file @
83953762
...
@@ -258,8 +258,8 @@ def stop_all_comlbp(force=False):
...
@@ -258,8 +258,8 @@ def stop_all_comlbp(force=False):
for
n
,
p
in
FofbTool
.
Configuration
.
config
[
"
tangopath.fofbnodes
"
].
items
():
for
n
,
p
in
FofbTool
.
Configuration
.
config
[
"
tangopath.fofbnodes
"
].
items
():
if
'
cellnode
'
in
n
:
if
'
cellnode
'
in
n
:
try
:
try
:
FofbTool
.
Operation
.
reset_comlbp
(
n
)
FofbTool
.
Operation
.
reset_comlbp
(
p
)
FofbTool
.
Operation
.
stop_comlbp
(
n
)
FofbTool
.
Operation
.
stop_comlbp
(
p
)
except
(
tango
.
DevFailed
,
TypeError
):
except
(
tango
.
DevFailed
,
TypeError
):
logger
.
error
(
"
Could not stop cpmlbp on {}
"
.
format
(
n
))
logger
.
error
(
"
Could not stop cpmlbp on {}
"
.
format
(
n
))
...
@@ -300,7 +300,7 @@ def start_all_comlbp():
...
@@ -300,7 +300,7 @@ def start_all_comlbp():
for
n
,
p
in
FofbTool
.
Configuration
.
config
[
"
tangopath.fofbnodes
"
].
items
():
for
n
,
p
in
FofbTool
.
Configuration
.
config
[
"
tangopath.fofbnodes
"
].
items
():
if
'
cellnode
'
in
n
:
if
'
cellnode
'
in
n
:
try
:
try
:
FofbTool
.
Operation
.
start_comlbp
(
n
)
FofbTool
.
Operation
.
start_comlbp
(
p
)
except
(
tango
.
DevFailed
,
TypeError
):
except
(
tango
.
DevFailed
,
TypeError
):
logger
.
error
(
"
Could not start LBP on {}
"
.
format
(
n
))
logger
.
error
(
"
Could not start LBP on {}
"
.
format
(
n
))
...
...
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