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
0dacb360
Commit
0dacb360
authored
1 year ago
by
BRONES Romain
Browse files
Options
Downloads
Plain Diff
Integrate latest fixes
parents
3923503c
e70142b6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
FofbTool/Utils.py
+13
-3
13 additions, 3 deletions
FofbTool/Utils.py
bin/FofbTool
+26
-15
26 additions, 15 deletions
bin/FofbTool
install_rcm.sh
+2
-2
2 additions, 2 deletions
install_rcm.sh
with
41 additions
and
20 deletions
FofbTool/Utils.py
+
13
−
3
View file @
0dacb360
...
...
@@ -53,17 +53,27 @@ def init_watcher():
Run init on Fofb-Watcher, waiting for its completion then init on the FofbCommand.
"""
wprx
=
tango
.
DeviceProxy
(
tangopath
[
"
fofb-watcher
"
])
wprx
.
set_timeout_millis
(
30000
)
try
:
wprx
=
tango
.
DeviceProxy
(
tangopath
[
"
fofb-watcher
"
])
wprx
.
set_timeout_millis
(
30000
)
except
tango
.
DevFailed
as
e
:
logger
.
error
(
"
Could not get DeviceProxy on {}
"
.
format
(
tangopath
[
"
fofb-watcher
"
]))
logger
.
debug
(
str
(
e
))
return
logger
.
info
(
"
Perform init() on Fofb-Watcher. This takes nearly a minute.
"
)
try
:
wprx
.
init
()
except
tango
.
DevFailed
as
e
:
logger
.
error
(
"
Could not perform init() on Fofb-Watcher.
"
)
logger
.
debug
(
str
(
e
))
logger
.
info
(
"
Perform init() on Fofb-Command.
"
)
tango
.
DeviceProxy
(
tangopath
[
"
fofb-command
"
]).
init
()
try
:
tango
.
DeviceProxy
(
tangopath
[
"
fofb-command
"
]).
init
()
except
tango
.
DevFailed
as
e
:
logger
.
error
(
"
Could not perform init() on
'
{}
'
, got DevFailed.
"
.
format
(
tangopath
[
'
fofb-command
'
]))
logger
.
debug
(
str
(
e
))
def
confds_opcua
():
"""
...
...
This diff is collapsed.
Click to expand it.
bin/FofbTool
+
26
−
15
View file @
0dacb360
...
...
@@ -32,7 +32,10 @@ if __name__ == '__main__':
parser
.
add_argument
(
"
--log
"
,
default
=
"
info
"
,
help
=
"
Log level (error, warning, info, debug)
"
)
parser
.
add_argument
(
"
--conf-file
"
,
type
=
str
,
parser
.
add_argument
(
"
--force
"
,
action
=
"
store_true
"
,
help
=
"
Force operation even if FOFB is running.
"
)
parser
.
add_argument
(
"
--fileconfig
"
,
type
=
str
,
help
=
"
Path to config file to apply.
"
)
parser
.
add_argument
(
"
--DS-init-opcua
"
,
action
=
"
store_true
"
,
...
...
@@ -49,9 +52,10 @@ if __name__ == '__main__':
parser
.
add_argument
(
"
--stop-ccn
"
,
action
=
"
store_true
"
,
help
=
"
Stop command for the ComBPM applications blocks.
"
)
parser
.
add_argument
(
"
--configure
"
,
choices
=
[
"
combpm
"
,
"
ccn
"
,
"
comcorr
"
,
"
corr
"
,
"
all
"
,
"
every
"
],
nargs
=
"
+
"
,
parser
.
add_argument
(
"
--configure
"
,
choices
=
[
"
combpm
"
,
"
ccn
"
,
"
comcorr
"
,
"
corr
"
,
"
all
"
,
"
every
"
],
nargs
=
'
?
'
,
const
=
'
all
'
,
help
=
"
Configuration commands for the Fofb applications blocs.
"
+
"
'
all
'
is for all com, not configuring corrector.
'
every
'
configure everything.
"
)
"
'
all
'
is for all com, not configuring corrector.
'
every
'
configure everything.
Default is
'
all
'
"
)
parser
.
add_argument
(
"
--start
"
,
action
=
"
store_true
"
,
help
=
"
Start command for the CCN and ComBPM applications blocks.
"
)
...
...
@@ -68,10 +72,19 @@ if __name__ == '__main__':
logger
.
debug
(
args
)
if
"
conf_file
"
in
args
:
FofbTool
.
Configuration
.
loadconfig
(
args
.
conf_file
)
if
not
args
.
fileconfig
is
None
:
FofbTool
.
Configuration
.
loadconfig
(
args
.
fileconfig
)
FofbTool
.
Configuration
.
logdebugconf
()
## Check running
if
not
FofbTool
.
Utils
.
check_fofbnotrunning
():
logger
.
warning
(
"
FOFB is running
"
)
if
not
args
.
force
:
logger
.
warning
(
"
Stoping here
"
)
exit
(
1
)
else
:
logger
.
warning
(
"
Action forced
"
)
## Device Server related commands
if
args
.
DS_init_opcua
:
FofbTool
.
Utils
.
init_opcua
()
...
...
@@ -87,16 +100,14 @@ if __name__ == '__main__':
if
args
.
stop
or
args
.
stop_ccn
:
FofbTool
.
Utils
.
stop_all_ccn
()
if
not
args
.
configure
is
None
:
for
conf
in
args
.
configure
:
if
conf
in
(
"
combpm
"
,
"
all
"
,
"
every
"
):
FofbTool
.
Utils
.
conf_all_combpm
()
if
conf
in
(
"
comcorr
"
,
"
all
"
,
"
every
"
):
FofbTool
.
Utils
.
conf_all_comcorr
()
if
conf
in
(
"
ccn
"
,
"
all
"
,
"
every
"
):
FofbTool
.
Utils
.
conf_all_ccn
()
if
conf
in
(
"
corr
"
,
"
every
"
):
FofbTool
.
Configuration
.
centralnode_configure_corr
()
if
args
.
configure
in
(
"
combpm
"
,
"
all
"
,
"
every
"
):
FofbTool
.
Utils
.
conf_all_combpm
()
if
args
.
configure
in
(
"
comcorr
"
,
"
all
"
,
"
every
"
):
FofbTool
.
Utils
.
conf_all_comcorr
()
if
args
.
configure
in
(
"
ccn
"
,
"
all
"
,
"
every
"
):
FofbTool
.
Utils
.
conf_all_ccn
()
if
args
.
configure
in
(
"
corr
"
,
"
every
"
):
FofbTool
.
Configuration
.
centralnode_configure_corr
()
if
args
.
start
or
args
.
start_combpm
:
FofbTool
.
Utils
.
start_all_combpm
()
...
...
This diff is collapsed.
Click to expand it.
install_rcm.sh
+
2
−
2
View file @
0dacb360
...
...
@@ -9,7 +9,7 @@ cp FofbTool/*.py $ipath/ -rvf
cp
FofbTool/
*
.cfg
$ipath
/
-rvf
# Copy bin CLI
cp
bin/FofbTool
~
/bin/
-vf
cp
bin/FofbTool
/home/production/scripts/DG/python
/bin/
-vf
# Put exec rights
chmod
+x
~
/bin/FofbTool
chmod
+x
/home/production/scripts/DG/python
/bin/FofbTool
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