add app_utils for motion_assert, contextMenu og GraphItem, further fixes
This commit is contained in:
10
backlight.py
10
backlight.py
@@ -14,13 +14,13 @@ import epics
|
||||
#from app_utils import assert_motor_positions
|
||||
|
||||
class Backlight(object):
|
||||
def __init__(self, prefix: str='SAR-EXPMX:MOT_BLGT'):
|
||||
def __init__(self, prefix: str='SAR-EXPMX:MOT_BLGT',pos={'pos_in':-29000,'pos_out':0,'pos_diode':0}):
|
||||
if prefix is None:
|
||||
self._sim={'pos':'out'}
|
||||
_log.info('simulated mode:{}'.format(self._sim))
|
||||
return #simulated mode
|
||||
self._mot = epics.Motor(prefix)
|
||||
self._pos = {'in':-29000,'out':0}
|
||||
self._pos = pos
|
||||
|
||||
def is_pos(self,strPos):
|
||||
try:
|
||||
@@ -29,7 +29,7 @@ class Backlight(object):
|
||||
_log.info('simulated mode:{}'.format(strPos))
|
||||
return self._sim['pos']==strPos
|
||||
m.refresh()
|
||||
return abs(m.readback - self._pos[strPos]) < 10
|
||||
return abs(m.readback - self._pos['pos_'+strPos]) < 10
|
||||
|
||||
def move(self, strPos, wait=False):
|
||||
try:
|
||||
@@ -40,7 +40,7 @@ class Backlight(object):
|
||||
return
|
||||
m=self._mot
|
||||
_log.debug("backlight to {}".format(strPos))
|
||||
target=self._pos[strPos]
|
||||
target=self._pos['pos_'+strPos]
|
||||
m.move(target, ignore_limits=True, wait=wait)
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ if __name__ == "__main__":
|
||||
parser.add_argument("-t", "--test", help="test sequence", action="store_true")
|
||||
|
||||
args = parser.parse_args()
|
||||
os.environ['EPICS_CA_ADDR_LIST'] = '129.129.244.255 sf-saresc-cagw.psi.ch:5062 sf-saresc-cagw.psi.ch:5066'
|
||||
os.environ['EPICS_CA_ADDR_LIST']='129.129.244.255 sf-saresc-cagw.psi.ch:5062 sf-saresc-cagw.psi.ch:5066'
|
||||
_log.info('Arguments:{}'.format(args.__dict__))
|
||||
|
||||
bl = Backlight()
|
||||
|
||||
Reference in New Issue
Block a user