Commit a86f93aa authored by Jose Tiago Macara Coutinho's avatar Jose Tiago Macara Coutinho Committed by blissadm_ID31@bibhelm
Browse files

SPEC config: add support for raw icepap axes

shame, shame, shame!
parent 45a55d6b
......@@ -568,6 +568,38 @@ class Generator(object):
self.__spec_macros.add('blissspecmotor.mac')
self.__spec_setup.append('motorsettingssetup %s' % name)
####################
# Icepap
####################
def add_icepap(self, session_name, name, config_name):
# Last resort when bliss motors cannot be used. Example: ID31 CARNAC
config = self.config.get_config(config_name)
icepap = config.parent['host']
cfg = dict(config)
del cfg['name']
ctrl = self.__spec_setup_icepaps.get(icepap)
if ctrl is None:
ctrl = Device(ltype='PSE_MAC_MOT', addr='icepap', num=0)
self.spec_config.addDevice(ctrl)
self.__spec_setup_icepaps[icepap] = ctrl
addr = cfg.pop('address')
assert addr.count('/') == 1
addr = 'MAC_MOT:{0}/{1}'.format(ctrl.getCtrlIndex(), addr)
spec_motor = Motor(ctrl=addr, mne=name, name=name,
steps=cfg.pop('steps', 1),
sign=cfg.pop('sign', 1),
slew = cfg.pop('slew'),
base = cfg.pop('base', 0),
backl = cfg.pop('backl', 0),
accel = cfg.pop('accel'))
for k, v in cfg.items():
spec_motor.addPar('MOTPAR:{0} = {1}'.format(k, v))
self.spec_config.addMotor(spec_motor)
ctrl.num += 1
self.__spec_macros.add('ice.mac')
####################
# Wago
####################
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment