Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BCS
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
spe
ds
BCS
Commits
dc92ef3b
Commit
dc92ef3b
authored
1 year ago
by
Roberto Borghes
Browse files
Options
Downloads
Patches
Plain Diff
Bug fixes: timeout errors and CYCLIC DB option
parent
a06b3bcd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bcs.py
+9
-7
9 additions, 7 deletions
src/bcs.py
with
9 additions
and
7 deletions
src/bcs.py
+
9
−
7
View file @
dc92ef3b
...
...
@@ -37,6 +37,7 @@ import numpy as np
import
socket
from
select
import
select
import
time
import
traceback
#==================================================================
# BCS Class Description:
...
...
@@ -137,15 +138,17 @@ class BCS(PyTango.Device_4Impl):
# Sockets from which we expect to read
timeout
=
2.5
readable
=
select
([
self
.
s
],[],[],
timeout
)
if
readable
:
reply
=
str
(
self
.
s
.
recv
(
1024
))
except
Exception
as
e
:
if
not
readable
[
0
]:
PyTango
.
Except
.
throw_exception
(
"
BCS Communication error
"
,
"
Timeout error
"
,
"
WriteRead
"
)
reply
=
str
(
self
.
s
.
recv
(
1024
))
self
.
failures
=
0
except
:
self
.
failures
+=
1
if
self
.
failures
==
10
:
self
.
connectionOk
=
False
self
.
s
.
close
()
self
.
error_stream
(
"
BCS Communication error %s
"
%
str
(
reply
))
PyTango
.
Except
.
throw_exception
(
"
BCS Communication error
"
,
e
.
message
.
strip
(),
"
WriteRead
"
)
PyTango
.
Except
.
throw_exception
(
"
BCS Communication error
"
,
traceback
.
format_exc
(),
"
WriteRead
"
)
return
reply
.
split
(
"
\r\n
"
)[
0
]
...
...
@@ -315,9 +318,8 @@ class BCS(PyTango.Device_4Impl):
def_prop
.
set_standard_unit
(
attrinfo
[
1
])
def_prop
.
set_label
(
attrName
);
dynAttr
.
set_default_properties
(
def_prop
);
a
=
self
.
add_attribute
(
dynAttr
,
self
.
readFromBCS
)
if
(
PyTango
.
__version_info__
[
0
]
==
8
)
and
(
attrinfo
[
-
2
]
==
"
C
"
):
if
(
PyTango
.
__version_info__
[
0
]
>
7
)
and
(
attrinfo
[
-
2
]
==
"
C
"
):
# "Easy" Attribute Polling available only with PyTango 8.x
self
.
poll_attribute
(
attrName
,
int
(
attrinfo
[
-
1
]))
#
...
...
@@ -327,7 +329,7 @@ class BCS(PyTango.Device_4Impl):
self
.
BCS_cmds
[
attrName
]
=
uespoint
[
1
]
dynAttr
=
PyTango
.
Attr
(
attrName
,
attrtype
,
PyTango
.
AttrWriteType
.
READ_WRITE
)
a
=
self
.
add_attribute
(
dynAttr
,
self
.
readUesFromBCS
,
self
.
writedUesToBCS
)
if
(
PyTango
.
__version_info__
[
0
]
==
8
)
and
(
attrinfo
[
-
2
]
==
"
C
"
):
if
(
PyTango
.
__version_info__
[
0
]
>
7
)
and
(
attrinfo
[
-
2
]
==
"
C
"
):
# "Easy" Attribute Polling available only with PyTango 8.x
self
.
poll_attribute
(
attrName
,
int
(
attrinfo
[
-
1
]))
#
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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