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
60e39a05
Commit
60e39a05
authored
8 months ago
by
Adriano Contillo
Browse files
Options
Downloads
Patches
Plain Diff
Ported to Python 3 (backward compatible with Python 2)
parent
dc92ef3b
Branches
master
Tags
2.0.0
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile
+1
-1
1 addition, 1 deletion
Makefile
src/bcs.py
+8
-8
8 additions, 8 deletions
src/bcs.py
with
9 additions
and
9 deletions
Makefile
+
1
−
1
View file @
60e39a05
...
...
@@ -6,7 +6,7 @@ MODNAME = $(MAIN:.py=)
default
:
bin
@
cp
src/
*
.py bin/
${
DIRNAME
}
@
echo
"#!/usr/bin/env python
\n
import sys
\n
sys.path.append(sys.path[0]+'/
${
DIRNAME
}
')
\n
from
${
MODNAME
}
import main
\n
if __name__ == '__main__':
\n
main()
\n
"
>
bin/
${
NAME
}
@
echo
"#!/usr/bin/env python
3
\n
import sys
\n
sys.path.append(sys.path[0]+'/
${
DIRNAME
}
')
\n
from
${
MODNAME
}
import main
\n
if __name__ == '__main__':
\n
main()
\n
"
>
bin/
${
NAME
}
@
chmod
+x bin/
${
NAME
}
bin/
${
DIRNAME
}
/
${
MAIN
}
bin
:
...
...
This diff is collapsed.
Click to expand it.
src/bcs.py
+
8
−
8
View file @
60e39a05
...
...
@@ -67,7 +67,7 @@ class BCS(PyTango.Device_4Impl):
# Device destructor
#------------------------------------------------------------------
def
delete_device
(
self
):
#print "[Device delete_device method] for device",self.get_name()
#print
(
"[Device delete_device method] for device",self.get_name()
)
if
self
.
connectionOk
:
self
.
s
.
close
()
del
self
.
s
...
...
@@ -77,7 +77,7 @@ class BCS(PyTango.Device_4Impl):
# Device initialization
#------------------------------------------------------------------
def
init_device
(
self
):
#print "In ", self.get_name(), "::init_device()"
#print
(
"In ", self.get_name(), "::init_device()"
)
self
.
set_state
(
PyTango
.
DevState
.
ON
)
self
.
get_device_properties
(
self
.
get_device_class
())
self
.
connectionOk
=
False
...
...
@@ -101,7 +101,7 @@ class BCS(PyTango.Device_4Impl):
# Read Attribute Hardware
#------------------------------------------------------------------
def
read_attr_hardware
(
self
,
data
):
#print "In ", self.get_name(), "::read_attr_hardware()"
#print
(
"In ", self.get_name(), "::read_attr_hardware()"
)
return
...
...
@@ -109,7 +109,7 @@ class BCS(PyTango.Device_4Impl):
# Read Monitoring attribute
#------------------------------------------------------------------
def
read_ConnectionOK
(
self
,
attr
):
#print "In ", self.get_name(), "::read_Monitoring()"
#print
(
"In ", self.get_name(), "::read_Monitoring()"
)
# Add your own code here
attr
.
set_value
(
self
.
connectionOk
)
...
...
@@ -128,7 +128,7 @@ class BCS(PyTango.Device_4Impl):
# argin:
#------------------------------------------------------------------
def
WriteRead
(
self
,
argin
):
#print "In ", self.get_name(), "::Acquire()"
#print
(
"In ", self.get_name(), "::Acquire()"
)
# Add your own code here
reply
=
None
if
not
self
.
connectToBCS
():
...
...
@@ -141,7 +141,7 @@ class BCS(PyTango.Device_4Impl):
if
not
readable
[
0
]:
PyTango
.
Except
.
throw_exception
(
"
BCS Communication error
"
,
"
Timeout error
"
,
"
WriteRead
"
)
reply
=
str
(
self
.
s
.
recv
(
1024
))
self
.
failures
=
0
self
.
failures
=
0
except
:
self
.
failures
+=
1
if
self
.
failures
==
10
:
...
...
@@ -215,7 +215,7 @@ class BCS(PyTango.Device_4Impl):
bcs_full_cmd
=
"
UES %s %d
"
%
(
self
.
BCS_cmds
[
attr
.
get_name
()],
value_in
)
reply
=
self
.
WriteRead
(
bcs_full_cmd
)
if
not
"
OK
"
in
reply
:
self
.
error_stream
(
"
BCS Communication error %s
"
%
str
(
reply
))
self
.
error_stream
(
"
BCS Communication error %s
"
%
str
(
reply
))
PyTango
.
Except
.
throw_exception
(
"
BCS Communication error
"
,
reply
,
"
writedUesToBCS
"
)
#------------------------------------------------------------------
...
...
@@ -416,7 +416,7 @@ class BCSClass(PyTango.DeviceClass):
def
__init__
(
self
,
name
):
PyTango
.
DeviceClass
.
__init__
(
self
,
name
)
self
.
set_type
(
name
);
#print "In BCSClass constructor"
#print
(
"In BCSClass constructor"
)
#==================================================================
#
...
...
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