rework motor tweak

This commit is contained in:
2022-08-19 09:51:21 +02:00
parent 9e72b681a4
commit 3ef576f690
5 changed files with 108 additions and 73 deletions

13
zoom.py
View File

@@ -70,7 +70,7 @@ class Zoom(QGroupBox, Ui_Zoom):
buttons=((1, "1"), (200, "200"), (400, "400"), (600, "600"), (800, "800"), (1000, "1000"),)
zoom=QApplication.instance()._zoom
current_zoom_value = zoom.get_rb()
current_zoom_value = zoom.get_val()
# zoom widgets
layout = QVBoxLayout()
@@ -306,21 +306,22 @@ class QopticZoom(object):
self._pv[name]=pv
return pv
def get_rb(self) -> int:
# get_rb somtimes lags. therefore get_sp will get the last set_point without usage of pvs
def get_rbv(self) -> int:
# get_rbv lags. therefore get_val is often the better choicewill get the last set_point without usage of pvs
# default do not get the RBV, because this might be delayed
try:
pv = self.getPv('POS_RB') #default do not get the RBV, because this might be delayed
pv = self.getPv('POS_RB')
except AttributeError:
val=self._val; _log.debug('simulated mode:{}'.format(val))
return val
else:
return pv.get()
def get_sp(self) -> int:
def get_val(self) -> int:
try:
val=self._val
except AttributeError:
pv=self.getPv('POS_RB') # default do not get the RBV, because this might be delayed
pv=self.getPv('POS_SP')
self._val=val=pv.get()
return val