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
0c79ea3c
Commit
0c79ea3c
authored
1 year ago
by
Claudio Scafuri
Browse files
Options
Downloads
Patches
Plain Diff
tests and fixes
parent
a4f5fc4f
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
+48
-21
48 additions, 21 deletions
FRTND_E/active_frntd_e.py
with
48 additions
and
21 deletions
FRTND_E/active_frntd_e.py
+
48
−
21
View file @
0c79ea3c
...
@@ -39,7 +39,7 @@ class Worker(QtCore.QThread):
...
@@ -39,7 +39,7 @@ class Worker(QtCore.QThread):
self
.
nanoesca_stopper_value
=
-
1
# 0: closed , 1:open, -1 : unknown
self
.
nanoesca_stopper_value
=
-
1
# 0: closed , 1:open, -1 : unknown
self
.
superescastopper
=
0
self
.
superescastopper
=
0
self
.
superescas
hutt
erindex
=
0
self
.
superescas
topp
erindex
=
0
self
.
superesca_stopper_value
=
-
1
# 0: closed , 1:open, -1 : unknown
self
.
superesca_stopper_value
=
-
1
# 0: closed , 1:open, -1 : unknown
self
.
superescashutter
=
0
self
.
superescashutter
=
0
...
@@ -71,20 +71,23 @@ class Worker(QtCore.QThread):
...
@@ -71,20 +71,23 @@ class Worker(QtCore.QThread):
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
nano
esca - geco device
# tango device for
super
esca - geco device
self
.
superescastopper
=
0
self
.
superescastopper
=
0
self
.
superescastopperindex
=
0
self
.
superescastopperindex
=
0
self
.
superesca_stopper_value
=
-
1
# 0: closed , 1:open, -1 : unknown
self
.
superesca_stopper_value
=
-
1
# 0: closed , 1:open, -1 : unknown
try
:
try
:
self
.
superescastopper
=
tango
.
DeviceProxy
(
self
.
superescastopper
=
tango
.
DeviceProxy
(
"
bl024-control-01:20000/controls/interlock/geco
"
)
"
bl024-control-01.blcs:20000/controls/interlock/geco
"
)
except
tango
.
DevFailed
as
e
:
except
tango
.
DevFailed
as
e
:
print
(
"
failed STP_S02-04-F.01
"
)
self
.
superescastopper
=
0
self
.
superescastopper
=
0
self
.
superescashutter
=
0
self
.
superescashutter
=
0
self
.
superescashutterindex
=
0
self
.
superescashutterindex
=
0
self
.
superesca_shutter_value
=
-
1
# 0: closed , 1:open, -1 : unknown
self
.
superesca_shutter_value
=
-
1
# 0: closed , 1:open, -1 : unknown
self
.
superscashutter
=
self
.
superescastopper
# the tango device is the same of the stopper
self
.
superscashutter
=
self
.
superescastopper
# the tango device is the same of the stopper
# ---------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------
# tango device for vuvphotemission - geco device
# tango device for vuvphotemission - geco device
...
@@ -130,9 +133,10 @@ class Worker(QtCore.QThread):
...
@@ -130,9 +133,10 @@ class Worker(QtCore.QThread):
self
.
nanoesca_shutter_value
=
-
1
self
.
nanoesca_shutter_value
=
-
1
try
:
try
:
self
.
superesca_stopper_value
=
self
.
nano
escastopper
.
read_attribute
(
"
STP_S02-04-F.01
"
).
value
self
.
superesca_stopper_value
=
self
.
super
escastopper
.
read_attribute
(
"
STP_S02-04-F.01
"
).
value
self
.
superesca_shutter_value
=
self
.
nanoe
scashutter
.
read_attribute
(
"
SHT_S02-04-F.01
"
).
value
self
.
superesca_shutter_value
=
self
.
super
scashutter
.
read_attribute
(
"
SHT_S02-04-F.01
"
).
value
except
tango
.
DevFailed
as
e
:
except
tango
.
DevFailed
as
e
:
print
(
"
superesca read failed
"
)
self
.
superesca_stopper_value
=
-
1
self
.
superesca_stopper_value
=
-
1
self
.
superesca_shutter_value
=
-
1
self
.
superesca_shutter_value
=
-
1
...
@@ -201,7 +205,7 @@ class Worker(QtCore.QThread):
...
@@ -201,7 +205,7 @@ class Worker(QtCore.QThread):
self
.
emit
(
self
.
emit
(
QtCore
.
SIGNAL
(
"
ExecuteError(PyQt_PyObject,PyQt_PyObject)
"
),
QtCore
.
SIGNAL
(
"
ExecuteError(PyQt_PyObject,PyQt_PyObject)
"
),
self
.
BL
,
self
.
BL
,
"
geco/STP_S02-04.01
"
,
"
geco/STP_S02-04
-F
.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
)
...
@@ -213,7 +217,7 @@ class Worker(QtCore.QThread):
...
@@ -213,7 +217,7 @@ class Worker(QtCore.QThread):
)
)
#close superesca shutter
#close superesca shutter
try
:
try
:
self
.
super
e
scashutter
.
write_attribute
(
"
SHT_S02-04-F.01
"
,
0
)
self
.
superscashutter
.
write_attribute
(
"
SHT_S02-04-F.01
"
,
0
)
except
tango
.
DevFailed
as
e
:
except
tango
.
DevFailed
as
e
:
self
.
emit
(
self
.
emit
(
QtCore
.
SIGNAL
(
"
ExecuteError(PyQt_PyObject,PyQt_PyObject)
"
),
QtCore
.
SIGNAL
(
"
ExecuteError(PyQt_PyObject,PyQt_PyObject)
"
),
...
@@ -235,7 +239,8 @@ class Worker(QtCore.QThread):
...
@@ -235,7 +239,8 @@ class Worker(QtCore.QThread):
#close vuvphotoemission/spectromicro shutter
#close vuvphotoemission/spectromicro shutter
try
:
try
:
self
.
vuvphotoemissionshutter
.
write_attribute
(
"
SHTFE_S03-04.01
"
,
0
)
self
.
vuvphotemissionshutter
.
write_attribute
(
"
SHTFE_S03-04.01
"
,
0
)
except
tango
.
DevFailed
as
e
:
except
tango
.
DevFailed
as
e
:
self
.
emit
(
self
.
emit
(
QtCore
.
SIGNAL
(
"
ExecuteError(PyQt_PyObject,PyQt_PyObject)
"
),
QtCore
.
SIGNAL
(
"
ExecuteError(PyQt_PyObject,PyQt_PyObject)
"
),
...
@@ -301,7 +306,7 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
...
@@ -301,7 +306,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
+
5
)
self
.
tableWidget
.
setRowCount
(
n
+
7
)
row
=
0
row
=
0
for
entry
in
self
.
BL
.
bltable
:
for
entry
in
self
.
BL
.
bltable
:
bname
=
entry
[
2
]
bname
=
entry
[
2
]
...
@@ -362,6 +367,7 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
...
@@ -362,6 +367,7 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
self
.
thread
.
syrmepstopperindex
=
row
self
.
thread
.
syrmepstopperindex
=
row
self
.
syrmepstopperindex
=
row
self
.
syrmepstopperindex
=
row
row
=
row
+
1
row
=
row
+
1
#palette = self.label.palette()
#palette = self.label.palette()
#palette.setBrush(QtGui.QPalette.Window, self.graybrush)
#palette.setBrush(QtGui.QPalette.Window, self.graybrush)
#self.label.setPalette(palette)
#self.label.setPalette(palette)
...
@@ -383,7 +389,6 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
...
@@ -383,7 +389,6 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
self
.
nanoescastopperindex
=
row
self
.
nanoescastopperindex
=
row
row
=
row
+
1
row
=
row
+
1
bname
=
"
1.2 Nanospec. / NanoESCA
"
bname
=
"
1.2 Nanospec. / NanoESCA
"
objname
=
"
geco/SHFE_S01-04.01
"
objname
=
"
geco/SHFE_S01-04.01
"
stname
=
"
UNKNOWN
"
stname
=
"
UNKNOWN
"
...
@@ -397,11 +402,8 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
...
@@ -397,11 +402,8 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
self
.
tableWidget
.
setRowHeight
(
row
,
22
)
self
.
tableWidget
.
setRowHeight
(
row
,
22
)
self
.
thread
.
nanoescashutterindex
=
row
self
.
thread
.
nanoescashutterindex
=
row
self
.
nanoescashutterindex
=
row
self
.
nanoescashutterindex
=
row
row
=
row
+
1
row
=
row
+
1
# ==========================================================
bname
=
"
2.2 SuperESCA/ESCAmicro
"
bname
=
"
2.2 SuperESCA/ESCAmicro
"
objname
=
"
geco/STP_S02-04-F.01
"
objname
=
"
geco/STP_S02-04-F.01
"
stname
=
"
UNKNOWN
"
stname
=
"
UNKNOWN
"
...
@@ -414,8 +416,7 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
...
@@ -414,8 +416,7 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
self
.
tableWidget
.
setItem
(
row
,
2
,
col2
)
self
.
tableWidget
.
setItem
(
row
,
2
,
col2
)
self
.
tableWidget
.
setRowHeight
(
row
,
22
)
self
.
tableWidget
.
setRowHeight
(
row
,
22
)
self
.
thread
.
superescastopperindex
=
row
self
.
thread
.
superescastopperindex
=
row
self
.
nsuperescastopperindex
=
row
self
.
superescastopperindex
=
row
row
=
row
+
1
row
=
row
+
1
bname
=
"
2.2 SuperESCA/ESCAmicro
"
bname
=
"
2.2 SuperESCA/ESCAmicro
"
...
@@ -432,7 +433,6 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
...
@@ -432,7 +433,6 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
self
.
thread
.
superescashutterindex
=
row
self
.
thread
.
superescashutterindex
=
row
self
.
superescashutterindex
=
row
self
.
superescashutterindex
=
row
row
=
row
+
1
row
=
row
+
1
#----------------------------------------------------------
#----------------------------------------------------------
palette
=
self
.
label
.
palette
()
palette
=
self
.
label
.
palette
()
palette
.
setBrush
(
QtGui
.
QPalette
.
Window
,
self
.
graybrush
)
palette
.
setBrush
(
QtGui
.
QPalette
.
Window
,
self
.
graybrush
)
...
@@ -460,10 +460,10 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
...
@@ -460,10 +460,10 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
def
redraw_table
(
self
,
mybl
):
def
redraw_table
(
self
,
mybl
):
# redraw informations
# redraw informations
row
=
0
t
row
=
0
for
entry
in
mybl
.
bltable
:
for
entry
in
mybl
.
bltable
:
stname
=
entry
[
4
]
stname
=
entry
[
4
]
item
=
self
.
tableWidget
.
item
(
row
,
2
)
item
=
self
.
tableWidget
.
item
(
t
row
,
2
)
item
.
setText
(
stname
)
item
.
setText
(
stname
)
if
stname
==
"
OPEN
"
:
if
stname
==
"
OPEN
"
:
item
.
setBackground
(
self
.
redbrush
)
item
.
setBackground
(
self
.
redbrush
)
...
@@ -474,7 +474,7 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
...
@@ -474,7 +474,7 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
if
stname
==
"
UNKNOWN
"
:
if
stname
==
"
UNKNOWN
"
:
item
.
setBackground
(
self
.
graybrush
)
item
.
setBackground
(
self
.
graybrush
)
# self.tableWidget.setItem(row,2,item)
# self.tableWidget.setItem(row,2,item)
row
=
row
+
1
t
row
=
t
row
+
1
# check syrmep tango reading
# check syrmep tango reading
idx
=
self
.
thread
.
syrmepstopperindex
idx
=
self
.
thread
.
syrmepstopperindex
item
=
self
.
tableWidget
.
item
(
idx
,
2
)
item
=
self
.
tableWidget
.
item
(
idx
,
2
)
...
@@ -542,10 +542,37 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
...
@@ -542,10 +542,37 @@ class active_frntd_e(Ui_frntd_e, QtCore.QObject):
if
self
.
thread
.
nanoesca_shutter_value
==
-
1
:
if
self
.
thread
.
nanoesca_shutter_value
==
-
1
:
item
.
setBackground
(
self
.
graybrush
)
item
.
setBackground
(
self
.
graybrush
)
item
.
setText
(
"
UNKNOWN
"
)
item
.
setText
(
"
UNKNOWN
"
)
#---------------------------------------------
# check superesca stopper tango reading
idx
=
self
.
thread
.
superescastopperindex
item
=
self
.
tableWidget
.
item
(
idx
,
2
)
if
self
.
thread
.
superesca_stopper_value
==
1
:
item
.
setBackground
(
self
.
redbrush
)
item
.
setText
(
"
OPEN
"
)
if
self
.
thread
.
superesca_stopper_value
==
0
:
item
.
setBackground
(
self
.
greenbrush
)
item
.
setText
(
"
CLOSED
"
)
if
self
.
thread
.
superesca_stopper_value
==
-
1
:
item
.
setBackground
(
self
.
graybrush
)
item
.
setText
(
"
UNKNOWN
"
)
# check superesca shutter tango reading
idx
=
self
.
thread
.
superescashutterindex
item
=
self
.
tableWidget
.
item
(
idx
,
2
)
if
self
.
thread
.
superesca_shutter_value
==
1
:
item
.
setBackground
(
self
.
redbrush
)
item
.
setText
(
"
OPEN
"
)
if
self
.
thread
.
superesca_shutter_value
==
0
:
item
.
setBackground
(
self
.
greenbrush
)
item
.
setText
(
"
CLOSED
"
)
if
self
.
thread
.
superesca_shutter_value
==
-
1
:
item
.
setBackground
(
self
.
graybrush
)
item
.
setText
(
"
UNKNOWN
"
)
#-------------------------------------------------------------------
#-------------------------------------------------------------------
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
and
self
.
thread
.
superesca_shutter_value
==
0
and
self
.
thread
.
superesca_stopper_value
==
0
vuv_closed
=
self
.
thread
.
vuvphotemission_shutter_value
==
0
and
self
.
thread
.
vuvphotemission_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
and
vuv_closed
:
if
mybl
.
allclosed
()
==
1
and
all_tango_closed
and
vuv_closed
:
...
...
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