Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
GEpressCtrlPACE5000
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Tango devices
SampleEnvironment
GEpressCtrlPACE5000
Commits
20a27922
Commit
20a27922
authored
4 months ago
by
Alexandre MALFREYT
Committed by
Florent LANGLOIS
4 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix MakeHWTest
parent
d9657d3d
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!2
Python 3 + améliorations
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
GEpressCtrlPACE5000/GEpressCtrlPACE5000.py
+22
-9
22 additions, 9 deletions
GEpressCtrlPACE5000/GEpressCtrlPACE5000.py
with
22 additions
and
9 deletions
GEpressCtrlPACE5000/GEpressCtrlPACE5000.py
+
22
−
9
View file @
20a27922
...
...
@@ -289,22 +289,35 @@ class GEpressCtrlPACE5000 (PyTango.LatestDeviceImpl):
#----- PROTECTED REGION ID(GEpressCtrlPACE5000.MakeHWTest) ENABLED START -----#
self
.
info_stream
(
"
Performing hardware self-test
"
)
value
=
int
(
self
.
WriteReadSocket
(
"
*TST?
"
))
# Temporarily increase socket timeout for hardware test
if
hasattr
(
self
,
'
socket
'
)
and
self
.
socket
:
original_timeout
=
self
.
socket
.
gettimeout
()
self
.
socket
.
settimeout
(
120
)
# 2 minutes timeout for hardware test
try
:
response
=
self
.
WriteReadSocket
(
"
*TST?
"
)
_
,
value
=
response
.
split
(
"
"
,
1
)
res
:
bool
=
int
(
value
)
finally
:
# Restore original timeout
if
hasattr
(
self
,
'
socket
'
)
and
self
.
socket
:
self
.
socket
.
settimeout
(
original_timeout
)
save_state
=
self
.
get_state
()
if
value
==
0
:
self
.
set_state
(
PyTango
.
DevState
.
ALARM
)
self
.
set_status
(
"
Hardware test failed
"
)
self
.
error_stream
(
"
Hardware self-test failed
"
)
argout
=
0
else
:
argout
=
1
if
res
:
self
.
info_stream
(
"
Hardware self-test passed successfully
"
)
if
save_state
==
PyTango
.
DevState
.
ALARM
:
self
.
set_state
(
PyTango
.
DevState
.
ON
)
self
.
set_status
(
"
Device in ON state
"
)
self
.
info_stream
(
"
Device state changed from ALARM to ON
"
)
else
:
self
.
set_state
(
PyTango
.
DevState
.
ALARM
)
self
.
set_status
(
"
Hardware test failed
"
)
self
.
error_stream
(
"
Hardware self-test failed
"
)
self
.
info_stream
(
"
MakeHWTest completed with result:
"
+
str
(
argout
))
self
.
info_stream
(
"
MakeHWTest completed with result:
"
+
str
(
res
))
argout
=
res
#----- PROTECTED REGION END -----# // GEpressCtrlPACE5000.MakeHWTest
return
argout
...
...
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