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
4bbe1340
Commit
4bbe1340
authored
7 months ago
by
BRONES Romain
Browse files
Options
Downloads
Patches
Plain Diff
Add configuration command, status
parent
6d02f00d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
DG_PY_FOFBTool/DG_PY_FOFBTool.py
+57
-3
57 additions, 3 deletions
DG_PY_FOFBTool/DG_PY_FOFBTool.py
DG_PY_FOFBTool/DG_PY_FOFBTool.xmi
+5
-1
5 additions, 1 deletion
DG_PY_FOFBTool/DG_PY_FOFBTool.xmi
with
62 additions
and
4 deletions
DG_PY_FOFBTool/DG_PY_FOFBTool.py
+
57
−
3
View file @
4bbe1340
...
...
@@ -62,8 +62,26 @@ class DG_PY_FOFBTool(Device):
- Type:
'
DevString
'
tangopath_centraltiming
- Type:
'
DevString
'
tangopath_centralnode
- Type:
'
DevString
'
"""
# PROTECTED REGION ID(DG_PY_FOFBTool.class_variable) ENABLED START #
d_status
=
{}
"""
def dev_status(self):
return my_status()
"""
def
my_status
(
self
):
try
:
return
"
\n\n
"
.
join
([
str
(
v
)
for
v
in
self
.
d_status
.
values
()])
+
"
\n
"
except
Exception
:
self
.
debug_stream
(
str
(
self
.
d_status
))
return
"
Status failure
\n
"
# PROTECTED REGION END # // DG_PY_FOFBTool.class_variable
# -----------------
...
...
@@ -114,6 +132,11 @@ class DG_PY_FOFBTool(Device):
dtype
=
'
DevString
'
,
)
tangopath_centralnode
=
device_property
(
dtype
=
'
DevString
'
,
mandatory
=
True
)
# ----------
# Attributes
# ----------
...
...
@@ -148,7 +171,7 @@ class DG_PY_FOFBTool(Device):
def
always_executed_hook
(
self
):
"""
Method always executed before any TANGO command is executed.
"""
#----- PROTECTED REGION ID(DG_PY_FOFBTool.always_executed_hook) ENABLED START -----#
self
.
set_status
(
self
.
my_status
())
#----- PROTECTED REGION END -----# // DG_PY_FOFBTool.always_executed_hook
def
delete_device
(
self
):
...
...
@@ -182,6 +205,7 @@ class DG_PY_FOFBTool(Device):
# --------
@command
(
dtype_out
=
'
DevBoolean
'
,
)
@DebugIt
()
def
configure
(
self
):
...
...
@@ -190,13 +214,43 @@ class DG_PY_FOFBTool(Device):
:return:None
"""
success
=
True
self
.
d_status
[
"
configure
"
]
=
"
Configure: pending
"
self
.
debug
_stream
(
"
Configure COMBPM
"
)
self
.
info
_stream
(
"
Configure COMBPM
"
)
for
cn
,
bpm
in
zip
(
self
.
tangopath_cellnode
,
self
.
combpm_bpmfilter
):
bpmid
=
[
int
(
b
)
for
b
in
bpm
.
split
()]
self
.
debug_stream
(
"
Set {} to {}
"
.
format
(
cn
,
bpmid
))
FofbTool
.
Configuration
.
cellnode_configure_combpm
(
cn
,
bpmid
)
s
=
FofbTool
.
Configuration
.
cellnode_configure_combpm
(
cn
,
bpmid
)
success
=
success
and
s
if
not
s
:
self
.
error_stream
(
"
Failed to configure COMBPM on {}
"
.
format
(
cn
))
self
.
info_stream
(
"
Configure COMCORR
"
)
for
cn
,
psc
in
zip
(
self
.
tangopath_cellnode
,
self
.
comcorr_pscid
):
pscid
=
[
int
(
b
)
for
b
in
psc
.
split
()]
self
.
debug_stream
(
"
Set {} to {}
"
.
format
(
cn
,
pscid
))
s
=
FofbTool
.
Configuration
.
cellnode_configure_comcorr
(
cn
,
pscid
,
True
)
success
=
success
and
s
if
not
s
:
self
.
error_stream
(
"
Failed to configure COMCORR on {}
"
.
format
(
cn
))
self
.
info_stream
(
"
Configure CCN
"
)
for
cn
,
nbpm
in
zip
(
self
.
tangopath_cellnode
,
self
.
ccn_nbpm
):
self
.
debug_stream
(
"
Set {} to {} bpm and {} psc
"
.
format
(
cn
,
nbpm
,
self
.
ccn_npsc
))
FofbTool
.
Configuration
.
cellnode_configure_ccn
(
cn
,
nbpm
,
self
.
ccn_npsc
)
success
=
success
and
s
if
not
s
:
self
.
error_stream
(
"
Failed to configure CCN on {}
"
.
format
(
cn
))
s
=
FofbTool
.
Configuration
.
centralnode_configure_ccn
(
self
.
tangopath_centralnode
,
self
.
ccn_nbpm
,
self
.
ccn_npsc
)
if
success
:
self
.
d_status
[
"
configure
"
]
=
"
Configure: success
"
else
:
self
.
d_status
[
"
configure
"
]
=
"
Configure: failed
"
return
success
# PROTECTED REGION END # // DG_PY_FOFBTool.configure
@command
(
...
...
This diff is collapsed.
Click to expand it.
DG_PY_FOFBTool/DG_PY_FOFBTool.xmi
+
5
−
1
View file @
4bbe1340
...
...
@@ -41,6 +41,10 @@
<type
xsi:type=
"pogoDsl:StringType"
/>
<status
abstract=
"false"
inherited=
"false"
concrete=
"true"
concreteHere=
"true"
/>
</deviceProperties>
<deviceProperties
name=
"tangopath_centralnode"
mandatory=
"true"
description=
""
>
<type
xsi:type=
"pogoDsl:StringType"
/>
<status
abstract=
"false"
inherited=
"false"
concrete=
"true"
concreteHere=
"true"
/>
</deviceProperties>
<commands
name=
"State"
description=
"This command gets the device state (stored in its device_state data member) and returns it to the caller."
execMethod=
"dev_state"
displayLevel=
"OPERATOR"
polledPeriod=
"0"
>
<argin
description=
"none"
>
<type
xsi:type=
"pogoDsl:VoidType"
/>
...
...
@@ -64,7 +68,7 @@
<type
xsi:type=
"pogoDsl:VoidType"
/>
</argin>
<argout
description=
""
>
<type
xsi:type=
"pogoDsl:
Void
Type"
/>
<type
xsi:type=
"pogoDsl:
Boolean
Type"
/>
</argout>
<status
abstract=
"false"
inherited=
"false"
concrete=
"true"
concreteHere=
"true"
/>
</commands>
...
...
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