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
8f5461cd
Commit
8f5461cd
authored
7 months ago
by
BRONES Romain
Browse files
Options
Downloads
Patches
Plain Diff
Refactor combpm
parent
b6f3e0c0
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
+31
-25
31 additions, 25 deletions
FofbTool/Operation.py
FofbTool/Utils.py
+6
-6
6 additions, 6 deletions
FofbTool/Utils.py
with
37 additions
and
31 deletions
FofbTool/Operation.py
+
31
−
25
View file @
8f5461cd
...
...
@@ -244,63 +244,69 @@ def ack_ccn(node_tangopath, ccnif=[]):
# OPERATIONS ON COMBPM
###################################################################################################
def
stop_combpm
(
cellnodename
):
def
stop_combpm
(
node_tangopath
):
"""
Stop the communication with bpm on the specified cellnode.
PARAMETERS
----------
cellnodename
: str
The target fofbnode
, ie
'
cellnode-c09
'
node_tangopath
: str
The target fofbnode
tango path, ie
'
ans/dg/fofb-
cellnode-c09
'
"""
prx
=
FofbTool
.
Utils
.
get_prx_from_nodename
(
cellnodename
)
if
prx
is
None
:
logger
.
error
(
"
Failed to stop ComBPM on {}
"
.
format
(
p
))
return
try
:
prx
=
tango
.
DeviceProxy
(
node_tangopath
)
prx
.
ping
()
except
tango
.
DevFailed
:
logger
.
error
(
"
Failed to obtain tango proxy or to ping to {}
"
.
format
(
node_tangopath
))
return
None
logger
.
info
(
"
Stopping ComBPM on {}
"
.
format
(
cellnodename
))
logger
.
info
(
"
Stopping ComBPM on {}
"
.
format
(
node_tangopath
))
prx
[
"
combpm_reset
"
]
=
1
prx
[
"
combpm_gt_control
"
]
=
0x5
def
start_combpm
(
cellnodename
):
def
start_combpm
(
node_tangopath
):
"""
Start the communication with bpm on the specified cellnode.
PARAMETERS
----------
cellnodename
: str
The target fofbnode
, ie
'
cellnode-c09
'
node_tangopath
: str
The target fofbnode
tango path, ie
'
ans/dg/fofb-
cellnode-c09
'
"""
prx
=
FofbTool
.
Utils
.
get_prx_from_nodename
(
cellnodename
)
if
prx
is
None
:
logger
.
error
(
"
Failed to start ComBPM on {}
"
.
format
(
cellnodename
))
return
try
:
prx
=
tango
.
DeviceProxy
(
node_tangopath
)
prx
.
ping
()
except
tango
.
DevFailed
:
logger
.
error
(
"
Failed to obtain tango proxy or to ping to {}
"
.
format
(
node_tangopath
))
return
None
logger
.
info
(
"
Starting ComBpm on {}
"
.
format
(
cellnodename
))
logger
.
info
(
"
Starting ComBpm on {}
"
.
format
(
node_tangopath
))
prx
[
"
combpm_reset
"
]
=
0
prx
[
"
combpm_gt_control
"
]
=
0x1
time
.
sleep
(
1
)
ack_combpm
(
cellnodename
)
ack_combpm
(
node_tangopath
)
def
ack_combpm
(
cellnodename
):
def
ack_combpm
(
node_tangopath
):
"""
Ack errors on the communication with bpm on the specified cellnode.
PARAMETERS
----------
cellnodename
: str
The target fofbnode
, ie
'
cellnode-c09
'
node_tangopath
: str
The target fofbnode
tango path, ie
'
ans/dg/fofb-
cellnode-c09
'
"""
prx
=
FofbTool
.
Utils
.
get_prx_from_nodename
(
cellnodename
)
if
prx
is
None
:
logger
.
error
(
"
Failed to start ComBPM on {}
"
.
format
(
cellnodename
))
return
try
:
prx
=
tango
.
DeviceProxy
(
node_tangopath
)
prx
.
ping
()
except
tango
.
DevFailed
:
logger
.
error
(
"
Failed to obtain tango proxy or to ping to {}
"
.
format
(
node_tangopath
))
return
None
logger
.
info
(
"
Ack ComBpm on {}
"
.
format
(
cellnodename
))
logger
.
info
(
"
Ack ComBpm on {}
"
.
format
(
node_tangopath
))
prx
[
"
combpm_reset_error
"
]
=
True
time
.
sleep
(
1
)
prx
[
"
combpm_reset_error
"
]
=
False
...
...
This diff is collapsed.
Click to expand it.
FofbTool/Utils.py
+
6
−
6
View file @
8f5461cd
...
...
@@ -22,7 +22,7 @@ def init_opcua(force=False):
"""
if
not
check_fofbnotrunning
(
force
):
logger
.
warning
(
"
Not running
configuration of combpm
because FOFB seems to be running.
"
)
logger
.
warning
(
"
Not running because FOFB seems to be running.
"
)
return
for
n
,
p
in
FofbTool
.
Configuration
.
config
[
"
tangopath.fofbnodes
"
].
items
():
...
...
@@ -40,7 +40,7 @@ def init_watcher(force=False):
"""
if
not
check_fofbnotrunning
(
force
):
logger
.
warning
(
"
Not running
configuration of combpm
because FOFB seems to be running.
"
)
logger
.
warning
(
"
Not running because FOFB seems to be running.
"
)
return
p
=
FofbTool
.
Configuration
.
config
[
"
tangopath
"
][
"
fofb-watcher
"
]
...
...
@@ -241,7 +241,7 @@ def stop_all_combpm(force=False):
for
n
,
p
in
FofbTool
.
Configuration
.
config
[
"
tangopath.fofbnodes
"
].
items
():
if
'
cellnode
'
in
n
:
FofbTool
.
Operation
.
stop_combpm
(
n
)
FofbTool
.
Operation
.
stop_combpm
(
p
)
def
stop_all_comlbp
(
force
=
False
):
...
...
@@ -252,7 +252,7 @@ def stop_all_comlbp(force=False):
"""
if
not
check_fofbnotrunning
(
force
):
logger
.
warning
(
"
Not running stop combp
m
because FOFB seems to be running.
"
)
logger
.
warning
(
"
Not running stop com
l
bp because FOFB seems to be running.
"
)
return
for
n
,
p
in
FofbTool
.
Configuration
.
config
[
"
tangopath.fofbnodes
"
].
items
():
...
...
@@ -272,7 +272,7 @@ def stop_all_ccn(force=False):
"""
if
not
check_fofbnotrunning
(
force
):
logger
.
warning
(
"
Not running stop com
bpm
because FOFB seems to be running.
"
)
logger
.
warning
(
"
Not running stop com
ccn
because FOFB seems to be running.
"
)
return
for
n
,
p
in
FofbTool
.
Configuration
.
config
[
"
tangopath.fofbnodes
"
].
items
():
...
...
@@ -289,7 +289,7 @@ def start_all_combpm():
for
n
,
p
in
FofbTool
.
Configuration
.
config
[
"
tangopath.fofbnodes
"
].
items
():
if
'
cellnode
'
in
n
:
FofbTool
.
Operation
.
start_combpm
(
n
)
FofbTool
.
Operation
.
start_combpm
(
p
)
def
start_all_comlbp
():
"""
...
...
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