Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Device tango control led ring
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
PX2 Beamline
Device tango control led ring
Commits
a824074a
Commit
a824074a
authored
May 21, 2021
by
Damien JEANGERARD
Browse files
Options
Downloads
Patches
Plain Diff
nettoyage de code.
parent
b9271f55
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
led_controler.py
+9
-25
9 additions, 25 deletions
led_controler.py
with
9 additions
and
25 deletions
led_controler.py
+
9
−
25
View file @
a824074a
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
## (c) - Software Engineering Group - ESRF
## (c) - Software Engineering Group - ESRF
##############################################################################
##############################################################################
"""
Gestio
n
d
u
beamstop en fonction de la position du detecteur
"""
"""
Commander u
n
o
u
des anneaux LED via un Arduino connecte a un reseau local. Par protocole de communication UDP
"""
__all__
=
[
"
led_controler
"
,
"
led_controlerClass
"
,
"
main
"
]
__all__
=
[
"
led_controler
"
,
"
led_controlerClass
"
,
"
main
"
]
...
@@ -50,22 +50,11 @@ import sys
...
@@ -50,22 +50,11 @@ import sys
from
socket
import
socket
,
AF_INET
,
SOCK_DGRAM
from
socket
import
socket
,
AF_INET
,
SOCK_DGRAM
import
time
import
time
#sys.path.insert(0, '/nfs/ruche-proxima2a/proxima2a-soleil/gitRepos')
##sys.path.insert(0, '/nfs/ruche/proxima2a-soleil/gitRepos/')
#from beam_center import beam_center
#bc = beam_center()
# Add additional import
# Add additional import
#----- PROTECTED REGION ID(led_controler.additionnal_import) ENABLED START -----#
#----- PROTECTED REGION ID(led_controler.additionnal_import) ENABLED START -----#
#----- PROTECTED REGION END -----# // led_controler.additionnal_import
#----- PROTECTED REGION END -----# // led_controler.additionnal_import
## Device States Description
## STANDBY :
## ON :
## OFF :
## ALARM :
class
led_controler
(
PyTango
.
Device_4Impl
):
class
led_controler
(
PyTango
.
Device_4Impl
):
#--------- Add you global variables here --------------------------
#--------- Add you global variables here --------------------------
...
@@ -98,10 +87,11 @@ class led_controler (PyTango.Device_4Impl):
...
@@ -98,10 +87,11 @@ class led_controler (PyTango.Device_4Impl):
#----- PROTECTED REGION ID(led_controler.init_device) ENABLED START -----#
#----- PROTECTED REGION ID(led_controler.init_device) ENABLED START -----#
self
.
attr_brightness_read
=
10
# Etat de l'anneau a l'init du device
self
.
attr_sector_read
=
'
0
'
self
.
attr_brightness_read
=
10
# Intensite
self
.
attr_color_read
=
'
w
'
self
.
attr_sector_read
=
'
0
'
# Secteur de l'anneau utilise
self
.
led_power
=
'
ON
'
self
.
attr_color_read
=
'
w
'
# Couleur
self
.
led_power
=
'
ON
'
# Etat du device
# Parametre envoi UDP
# Parametre envoi UDP
self
.
sock_send
=
socket
(
AF_INET
,
SOCK_DGRAM
)
self
.
sock_send
=
socket
(
AF_INET
,
SOCK_DGRAM
)
...
@@ -269,8 +259,7 @@ class led_controler (PyTango.Device_4Impl):
...
@@ -269,8 +259,7 @@ class led_controler (PyTango.Device_4Impl):
#----- PROTECTED REGION END -----# // led_controler.INIT
#----- PROTECTED REGION END -----# // led_controler.INIT
self
.
init_device
()
# ???
self
.
init_device
()
# ???
argout
=
'
ttttt
'
argout
=
'
init
'
return
argout
return
argout
def
is_INIT_allowed
(
self
):
def
is_INIT_allowed
(
self
):
...
@@ -279,7 +268,6 @@ class led_controler (PyTango.Device_4Impl):
...
@@ -279,7 +268,6 @@ class led_controler (PyTango.Device_4Impl):
def
OFF
(
self
):
def
OFF
(
self
):
self
.
debug_stream
(
"
OFF()
"
)
self
.
debug_stream
(
"
OFF()
"
)
#----- PROTECTED REGION ID(led_controler.OFF) ENABLED START -----#
#----- PROTECTED REGION ID(led_controler.OFF) ENABLED START -----#
self
.
led_power
=
'
OFF
'
self
.
led_power
=
'
OFF
'
argout
=
self
.
send_command_udp
(
c
=
'
0
'
)
argout
=
self
.
send_command_udp
(
c
=
'
0
'
)
...
@@ -291,7 +279,6 @@ class led_controler (PyTango.Device_4Impl):
...
@@ -291,7 +279,6 @@ class led_controler (PyTango.Device_4Impl):
def
ON
(
self
):
def
ON
(
self
):
self
.
debug_stream
(
"
ON()
"
)
self
.
debug_stream
(
"
ON()
"
)
#----- PROTECTED REGION ID(led_controler.ON) ENABLED START -----#
#----- PROTECTED REGION ID(led_controler.ON) ENABLED START -----#
self
.
led_power
=
'
ON
'
self
.
led_power
=
'
ON
'
argout
=
self
.
send_command_udp
()
argout
=
self
.
send_command_udp
()
...
@@ -366,9 +353,6 @@ class led_controler (PyTango.Device_4Impl):
...
@@ -366,9 +353,6 @@ class led_controler (PyTango.Device_4Impl):
return
argout
return
argout
#def posiBST3(self,outarg):
#self.dev_BST3Tx.position, self.dev_BST3Tz.position = outarg[0],outarg[1] #positionner le BST3 sur le faisceau axe Tx et Tz
class
led_controlerClass
(
PyTango
.
DeviceClass
):
class
led_controlerClass
(
PyTango
.
DeviceClass
):
#--------- Add you global class variables here --------------------------
#--------- Add you global class variables here --------------------------
#----- PROTECTED REGION ID(led_controler.global_class_variables) ENABLED START -----#
#----- PROTECTED REGION ID(led_controler.global_class_variables) ENABLED START -----#
...
...
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