Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bcsbridge
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
cs
cli
bcsbridge
Commits
52a7db31
Commit
52a7db31
authored
1 year ago
by
Claudio Scafuri
Browse files
Options
Downloads
Patches
Plain Diff
#20400 add SPECTRO/VUV tango shutter and stopper
parent
009cc4b2
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
FRTND_E/active_frntd_e.py
+113
-8
113 additions, 8 deletions
FRTND_E/active_frntd_e.py
with
113 additions
and
8 deletions
FRTND_E/active_frntd_e.py
+
113
−
8
View file @
52a7db31
...
@@ -44,6 +44,7 @@ class Worker(QtCore.QThread):
...
@@ -44,6 +44,7 @@ class Worker(QtCore.QThread):
)
)
except
tango
.
DevFailed
as
e
:
except
tango
.
DevFailed
as
e
:
self
.
nanoescastopper
=
0
self
.
nanoescastopper
=
0
# tango device for nanoesca - geco device
# tango device for nanoesca - geco device
self
.
nanoescastopper
=
0
self
.
nanoescastopper
=
0
self
.
nanoescastopperindex
=
0
self
.
nanoescastopperindex
=
0
...
@@ -60,6 +61,27 @@ class Worker(QtCore.QThread):
...
@@ -60,6 +61,27 @@ class Worker(QtCore.QThread):
self
.
nanoescashutterindex
=
0
self
.
nanoescashutterindex
=
0
self
.
nanoesca_shutter_value
=
-
1
# 0: closed , 1:open, -1 : unknown
self
.
nanoesca_shutter_value
=
-
1
# 0: closed , 1:open, -1 : unknown
self
.
nanoescashutter
=
self
.
nanoescastopper
# the tango device is the same of the stopper
self
.
nanoescashutter
=
self
.
nanoescastopper
# the tango device is the same of the stopper
# tango device for vuvphotemission - geco device
self
.
vuvphotoemissionstopper
=
0
self
.
vuvphotemissionstopperindex
=
0
self
.
vuvphotemission_stopper_value
=
-
1
# 0: closed , 1:open, -1 : unknown
self
.
vuvphotemissionshutter
=
0
self
.
vuvphotemissionshutterindex
=
0
self
.
vuvphotemission_shutter_value
=
-
1
# 0: closed , 1:open, -1 : unknown
try
:
self
.
vuvphotoemissionstopper
=
tango
.
DeviceProxy
(
"
bl034-control-01.blcs.elettra.trieste.it:20000/controls/interlock/geco
"
)
self
.
vuvphotemissionshutter
=
tango
.
DeviceProxy
(
"
bl034-control-01.blcs.elettra.trieste.it:20000/controls/interlock/geco
"
)
except
tango
.
DevFailed
as
e
:
self
.
vuvphotoemissionstopper
=
0
self
.
vuvphotemissionshutter
=
0
def
run
(
self
):
def
run
(
self
):
if
self
.
mode
==
"
update
"
:
if
self
.
mode
==
"
update
"
:
...
@@ -81,11 +103,18 @@ class Worker(QtCore.QThread):
...
@@ -81,11 +103,18 @@ class Worker(QtCore.QThread):
except
tango
.
DevFailed
as
e
:
except
tango
.
DevFailed
as
e
:
self
.
nanoesca_stopper_value
=
-
1
self
.
nanoesca_stopper_value
=
-
1
self
.
nanoesca_shutter_value
=
-
1
self
.
nanoesca_shutter_value
=
-
1
try
:
self
.
vuvphotemission_stopper_value
=
self
.
vuvphotoemissionstopper
.
read_attribute
(
"
STPFE_S03-04.01
"
).
value
self
.
vuvphotemission_shutter_value
=
self
.
vuvphotemissionshutter
.
read_attribute
(
"
SHTFE_S03-04.01
"
).
value
except
tango
.
DevFailed
as
e
:
self
.
vuvphotemission_stopper_value
=
-
1
self
.
vuvphotemission_shutter_value
=
-
1
def
execute
(
self
):
def
execute
(
self
):
errtable
=
self
.
BL
.
closeall
()
errtable
=
self
.
BL
.
closeall
()
# close tango controlloed syrme stopper
# close tango controlloed syrme
p
stopper
try
:
try
:
self
.
syrmepstopper
.
r_bs4_v
=
0
self
.
syrmepstopper
.
r_bs4_v
=
0
except
tango
.
DevFailed
as
e
:
except
tango
.
DevFailed
as
e
:
...
@@ -129,6 +158,27 @@ class Worker(QtCore.QThread):
...
@@ -129,6 +158,27 @@ class Worker(QtCore.QThread):
self
.
BL
,
self
.
BL
,
"
geco/SHFE_S01-04.01
"
,
"
geco/SHFE_S01-04.01
"
,
)
)
#close vuvphotoemission/spectromicro stopper
try
:
self
.
vuvphotoemissionstopper
.
write_attribute
(
"
STPFE_S03-04.01
"
,
0
)
except
tango
.
DevFailed
as
e
:
self
.
emit
(
QtCore
.
SIGNAL
(
"
ExecuteError(PyQt_PyObject,PyQt_PyObject)
"
),
self
.
BL
,
"
geco/STPFE_S03-04.01
"
,
)
#close vuvphotoemission/spectromicro shutter
try
:
self
.
vuvphotoemissionshutter
.
write_attribute
(
"
SHTFE_S03-04.01
"
,
0
)
except
tango
.
DevFailed
as
e
:
self
.
emit
(
QtCore
.
SIGNAL
(
"
ExecuteError(PyQt_PyObject,PyQt_PyObject)
"
),
self
.
BL
,
"
geco/SHTFE_S03-04.01
"
,
)
if
errtable
is
None
:
if
errtable
is
None
:
self
.
emit
(
QtCore
.
SIGNAL
(
"
ExecuteThread(PyQt_PyObject)
"
),
self
.
BL
)
self
.
emit
(
QtCore
.
SIGNAL
(
"
ExecuteThread(PyQt_PyObject)
"
),
self
.
BL
)
else
:
else
:
...
@@ -187,7 +237,7 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
...
@@ -187,7 +237,7 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
self
.
redbrush
=
QtGui
.
QBrush
(
QtGui
.
QColor
(
"
red
"
))
self
.
redbrush
=
QtGui
.
QBrush
(
QtGui
.
QColor
(
"
red
"
))
self
.
graybrush
=
QtGui
.
QBrush
(
QtGui
.
QColor
(
"
gray
"
))
self
.
graybrush
=
QtGui
.
QBrush
(
QtGui
.
QColor
(
"
gray
"
))
n
=
self
.
BL
.
nentries
n
=
self
.
BL
.
nentries
self
.
tableWidget
.
setRowCount
(
n
+
3
)
self
.
tableWidget
.
setRowCount
(
n
+
5
)
row
=
0
row
=
0
for
entry
in
self
.
BL
.
bltable
:
for
entry
in
self
.
BL
.
bltable
:
bname
=
entry
[
2
]
bname
=
entry
[
2
]
...
@@ -203,7 +253,38 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
...
@@ -203,7 +253,38 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
self
.
tableWidget
.
setRowHeight
(
row
,
22
)
self
.
tableWidget
.
setRowHeight
(
row
,
22
)
row
=
row
+
1
row
=
row
+
1
# add Tango managed entries - different
# add Tango managed entries - different
bname
=
"
Syrmep
"
bname
=
"
3.2 Spectro / VUV
"
objname
=
"
geco/SHTFE_S03-04.01
"
stname
=
"
UNKNOWN
"
col0
=
QtGui
.
QTableWidgetItem
(
bname
,
0
)
col1
=
QtGui
.
QTableWidgetItem
(
objname
,
1
)
col2
=
QtGui
.
QTableWidgetItem
(
stname
,
2
)
col2
.
setBackground
(
self
.
graybrush
)
self
.
tableWidget
.
setItem
(
row
,
0
,
col0
)
self
.
tableWidget
.
setItem
(
row
,
1
,
col1
)
self
.
tableWidget
.
setItem
(
row
,
2
,
col2
)
self
.
tableWidget
.
setRowHeight
(
row
,
22
)
self
.
thread
.
vuvphotemissionshutterindex
=
row
self
.
vuvphotemissionshutterindex
=
row
row
=
row
+
1
bname
=
"
3.2 Spectro / VUV
"
objname
=
"
geco/STPFE_S03-04.01
"
stname
=
"
UNKNOWN
"
col0
=
QtGui
.
QTableWidgetItem
(
bname
,
0
)
col1
=
QtGui
.
QTableWidgetItem
(
objname
,
1
)
col2
=
QtGui
.
QTableWidgetItem
(
stname
,
2
)
col2
.
setBackground
(
self
.
graybrush
)
self
.
tableWidget
.
setItem
(
row
,
0
,
col0
)
self
.
tableWidget
.
setItem
(
row
,
1
,
col1
)
self
.
tableWidget
.
setItem
(
row
,
2
,
col2
)
self
.
tableWidget
.
setRowHeight
(
row
,
22
)
self
.
thread
.
vuvphotemissionstopperindex
=
row
self
.
vuvphotemissionstopperindex
=
row
row
=
row
+
1
# ---------------------------------------------
bname
=
"
6.1 Syrmep
"
objname
=
"
geco/r_bs4_v
"
objname
=
"
geco/r_bs4_v
"
stname
=
"
UNKNOWN
"
stname
=
"
UNKNOWN
"
col0
=
QtGui
.
QTableWidgetItem
(
bname
,
0
)
col0
=
QtGui
.
QTableWidgetItem
(
bname
,
0
)
...
@@ -223,7 +304,7 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
...
@@ -223,7 +304,7 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
#self.label.setAutoFillBackground(1)
#self.label.setAutoFillBackground(1)
#self.label.setText("UNKNOWN")
#self.label.setText("UNKNOWN")
# ----
# ----
bname
=
"
NanoEsca/Nanospectr.
"
bname
=
"
1.2 Nanospec. / NanoESCA
"
objname
=
"
geco/STFE_S01-04.01
"
objname
=
"
geco/STFE_S01-04.01
"
stname
=
"
UNKNOWN
"
stname
=
"
UNKNOWN
"
col0
=
QtGui
.
QTableWidgetItem
(
bname
,
0
)
col0
=
QtGui
.
QTableWidgetItem
(
bname
,
0
)
...
@@ -236,11 +317,10 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
...
@@ -236,11 +317,10 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
self
.
tableWidget
.
setRowHeight
(
row
,
22
)
self
.
tableWidget
.
setRowHeight
(
row
,
22
)
self
.
thread
.
nanoescastopperindex
=
row
self
.
thread
.
nanoescastopperindex
=
row
self
.
nanoescastopperindex
=
row
self
.
nanoescastopperindex
=
row
row
=
row
+
1
row
=
row
+
1
bname
=
"
NanoEsca/Nanospectr.
"
bname
=
"
1.2 Nanospec. / NanoESCA
"
objname
=
"
geco/SHFE_S01-04.01
"
objname
=
"
geco/SHFE_S01-04.01
"
stname
=
"
UNKNOWN
"
stname
=
"
UNKNOWN
"
col0
=
QtGui
.
QTableWidgetItem
(
bname
,
0
)
col0
=
QtGui
.
QTableWidgetItem
(
bname
,
0
)
...
@@ -329,7 +409,31 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
...
@@ -329,7 +409,31 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
#---------------------------------------------
#---------------------------------------------
# check vuvphotomission stopper tango reading
idx
=
self
.
thread
.
vuvphotemissionstopperindex
item
=
self
.
tableWidget
.
item
(
idx
,
2
)
if
self
.
thread
.
vuvphotemission_stopper_value
==
1
:
item
.
setBackground
(
self
.
redbrush
)
item
.
setText
(
"
OPEN
"
)
if
self
.
thread
.
vuvphotemission_stopper_value
==
0
:
item
.
setBackground
(
self
.
greenbrush
)
item
.
setText
(
"
CLOSED
"
)
if
self
.
thread
.
vuvphotemission_stopper_value
==
-
1
:
item
.
setBackground
(
self
.
graybrush
)
item
.
setText
(
"
UNKNOWN
"
)
#---------------------------------------------
# check vuvphotomission shutter tango reading
idx
=
self
.
thread
.
vuvphotemissionshutterindex
item
=
self
.
tableWidget
.
item
(
idx
,
2
)
if
self
.
thread
.
vuvphotemission_shutter_value
==
1
:
item
.
setBackground
(
self
.
redbrush
)
item
.
setText
(
"
OPEN
"
)
if
self
.
thread
.
vuvphotemission_shutter_value
==
0
:
item
.
setBackground
(
self
.
greenbrush
)
item
.
setText
(
"
CLOSED
"
)
if
self
.
thread
.
vuvphotemission_shutter_value
==
-
1
:
item
.
setBackground
(
self
.
graybrush
)
item
.
setText
(
"
UNKNOWN
"
)
#---------------------------------------------
#---------------------------------------------
# check nanoesca shutter tango reading
# check nanoesca shutter tango reading
idx
=
self
.
thread
.
nanoescashutterindex
idx
=
self
.
thread
.
nanoescashutterindex
...
@@ -347,8 +451,9 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
...
@@ -347,8 +451,9 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
#-------------------------------------------------------------------
#-------------------------------------------------------------------
all_tango_closed
=
self
.
thread
.
syrmep_stopper_value
==
0
and
self
.
thread
.
nanoesca_stopper_value
==
0
and
self
.
thread
.
nanoesca_shutter_value
==
0
all_tango_closed
=
self
.
thread
.
syrmep_stopper_value
==
0
and
self
.
thread
.
nanoesca_stopper_value
==
0
and
self
.
thread
.
nanoesca_shutter_value
==
0
vuv_closed
=
self
.
thread
.
vuvphotemission_shutter_value
==
0
and
self
.
thread
.
vuvphotemission_shutter_value
==
0
palette
=
self
.
label
.
palette
()
palette
=
self
.
label
.
palette
()
if
mybl
.
allclosed
()
==
1
and
all_tango_closed
:
if
mybl
.
allclosed
()
==
1
and
all_tango_closed
and
vuv_closed
:
palette
.
setBrush
(
QtGui
.
QPalette
.
Window
,
self
.
greenbrush
)
palette
.
setBrush
(
QtGui
.
QPalette
.
Window
,
self
.
greenbrush
)
self
.
label
.
setText
(
"
ALL CLOSED
"
)
self
.
label
.
setText
(
"
ALL CLOSED
"
)
else
:
else
:
...
...
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