in callback function check for ca disconnect and return (access to cafeCache is forbidden)
This commit is contained in:
20
src/gui.py
20
src/gui.py
@@ -207,7 +207,9 @@ class AppGui(QWidget):
|
||||
pvsplit = pv.split("-")
|
||||
secsplit = pvsplit[0].split("Z")
|
||||
sec = secsplit[1]
|
||||
|
||||
if pvdata.status == self.cyca.ICAFE_CA_OP_CONN_DOWN:
|
||||
return
|
||||
|
||||
#But is SHIFTTYPE CORRECT?
|
||||
#is_shift_type_ok = True
|
||||
##shift_type = self.cafe.getCache("ZORG:SHIFT-TYPE", 'str')
|
||||
@@ -217,20 +219,30 @@ class AppGui(QWidget):
|
||||
def already_in_standby():
|
||||
devices = self.settings.data[sec]["iocDevice"]
|
||||
pv_list = []
|
||||
standby_value_list = []
|
||||
|
||||
for magnet in devices:
|
||||
pv_list.append(magnet + ":SOL:2")
|
||||
idx = self.settings.data[sec]["device"].index(magnet)
|
||||
standby_value = self.settings.data[sec]["standby"][idx]
|
||||
standby_value_list.append(standby_value)
|
||||
|
||||
value_list, status, status_list = self.cafe.getScalarList(
|
||||
pv_list, cacheFlag=True)
|
||||
print("valuelist", pv_list, value_list)
|
||||
|
||||
|
||||
if status != self.cyca.ICAFE_NORMAL:
|
||||
self.check_status_list(pv_list, status_list, _line())
|
||||
|
||||
print("valuelist", pv_list, value_list)
|
||||
#get standby values:
|
||||
standby_value_list = []
|
||||
for magnet in devices:
|
||||
idx = self.settings.data[sec]["device"].index(magnet)
|
||||
standby_value = self.settings.data[sec]["standby"][idx]
|
||||
standby_value_list.append(standby_value)
|
||||
|
||||
|
||||
#check standby values
|
||||
in_standby = True
|
||||
for value, standby in zip(value_list, standby_value_list):
|
||||
if abs(value) < abs(standby)*0.8 or abs(value) > abs(standby)*1.2:
|
||||
@@ -239,7 +251,7 @@ class AppGui(QWidget):
|
||||
print("is_standby", in_standby, flush=True)
|
||||
return in_standby
|
||||
|
||||
if pvdata.value[0] == 'ON': # and not already_in_standby():
|
||||
if pvdata.value[0] == 'ON' and not already_in_standby():
|
||||
#print("sec-ON", secsplit[1], flush=True)
|
||||
self.table_sol_dict[sec].init_value_button.setEnabled(True)
|
||||
self.table_pwr_dict[sec].init_value_button.setEnabled(True)
|
||||
|
||||
Reference in New Issue
Block a user