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
ee15f79a
Commit
ee15f79a
authored
4 months ago
by
Alexandre MALFREYT
Browse files
Options
Downloads
Patches
Plain Diff
Fix FAULT on Init if already connected to socket (socket closure handling in delete_device)
parent
f4c6cbb6
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
GEpressCtrlPACE5000/GEpressCtrlPACE5000.py
+25
-2
25 additions, 2 deletions
GEpressCtrlPACE5000/GEpressCtrlPACE5000.py
GEpressCtrlPACE5000Channel/GEpressCtrlPACE5000Channel.py
+0
-1
0 additions, 1 deletion
GEpressCtrlPACE5000Channel/GEpressCtrlPACE5000Channel.py
with
25 additions
and
3 deletions
GEpressCtrlPACE5000/GEpressCtrlPACE5000.py
+
25
−
2
View file @
ee15f79a
...
@@ -42,6 +42,7 @@ __all__ = ["GEpressCtrlPACE5000", "GEpressCtrlPACE5000Class", "main"]
...
@@ -42,6 +42,7 @@ __all__ = ["GEpressCtrlPACE5000", "GEpressCtrlPACE5000Class", "main"]
__docformat__
=
'
restructuredtext
'
__docformat__
=
'
restructuredtext
'
import
time
import
PyTango
import
PyTango
import
sys
import
sys
# Add additional import
# Add additional import
...
@@ -81,9 +82,31 @@ class GEpressCtrlPACE5000 (PyTango.LatestDeviceImpl):
...
@@ -81,9 +82,31 @@ class GEpressCtrlPACE5000 (PyTango.LatestDeviceImpl):
def
delete_device
(
self
):
def
delete_device
(
self
):
self
.
debug_stream
(
"
In delete_device()
"
)
self
.
debug_stream
(
"
In delete_device()
"
)
#----- PROTECTED REGION ID(GEpressCtrlPACE5000.delete_device) ENABLED START -----#
#----- PROTECTED REGION ID(GEpressCtrlPACE5000.delete_device) ENABLED START -----#
self
.
info_stream
(
"
Closing socket connection
"
)
self
.
info_stream
(
"
Closing socket connection
"
)
# Close the socket connection if it exists
if
hasattr
(
self
,
'
socket
'
)
and
self
.
socket
:
try
:
self
.
socket
.
close
()
self
.
socket
.
close
()
except
Exception
as
e
:
self
.
error_stream
(
"
Error closing socket:
"
+
str
(
e
))
# Check if the socket is closed (doesn't usually close immediately)
max_tries
=
5
sleep_time
=
0.2
closed
=
False
for
_
in
range
(
max_tries
):
if
not
hasattr
(
self
,
'
socket
'
)
or
self
.
socket
is
None
:
closed
=
True
break
time
.
sleep
(
sleep_time
)
if
not
closed
:
self
.
error_stream
(
"
Socket connection could not be closed after
"
+
str
(
max_tries
)
+
"
tries
"
)
self
.
set_state
(
PyTango
.
DevState
.
FAULT
)
self
.
set_status
(
"
Socket connection could not be closed
"
)
else
:
self
.
info_stream
(
"
Socket connection closed successfully
"
)
#----- PROTECTED REGION END -----# // GEpressCtrlPACE5000.delete_device
#----- PROTECTED REGION END -----# // GEpressCtrlPACE5000.delete_device
...
...
This diff is collapsed.
Click to expand it.
GEpressCtrlPACE5000Channel/GEpressCtrlPACE5000Channel.py
+
0
−
1
View file @
ee15f79a
...
@@ -85,7 +85,6 @@ class GEpressCtrlPACE5000Channel (PyTango.LatestDeviceImpl):
...
@@ -85,7 +85,6 @@ class GEpressCtrlPACE5000Channel (PyTango.LatestDeviceImpl):
self
.
info_stream
(
"
Deleting channel
"
+
self
.
get_name
())
self
.
info_stream
(
"
Deleting channel
"
+
self
.
get_name
())
self
.
set_state
(
PyTango
.
DevState
.
OFF
)
self
.
set_state
(
PyTango
.
DevState
.
OFF
)
self
.
socket
.
close
()
#----- PROTECTED REGION END -----# // GEpressCtrlPACE5000Channel.delete_device
#----- PROTECTED REGION END -----# // GEpressCtrlPACE5000Channel.delete_device
...
...
This diff is collapsed.
Click to expand it.
Alexandre MALFREYT
@MALFREYT
mentioned in commit
e07de1dc
·
4 months ago
mentioned in commit
e07de1dc
mentioned in commit e07de1dc6b1915b1068d46b241b4ccd29d894d01
Toggle commit list
Alexandre MALFREYT
@MALFREYT
mentioned in commit
0cf7a857
·
4 months ago
mentioned in commit
0cf7a857
mentioned in commit 0cf7a857437e32a03eb9ca8a388bde024038a6d3
Toggle commit list
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