Skip to content

Commit

Permalink
fixes #191
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Jul 20, 2019
1 parent 816d54b commit 1207fc6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion apstools/migration/spec2ophyd.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def pop_word(line, int_result=False):
self.device = None
self.pvname = None
self.motpar = []
self.macro_prefix = None

def __str__(self):
items = [self.item_name_value(k) for k in "index mne name".split()]
Expand All @@ -120,7 +121,13 @@ def setDevice(self, devices):
self.device = device_list[unit]
self.pvname = "{}m{}".format(self.device.prefix, chan)
elif self.ctrl.startswith("MAC_MOT"):
pass # TODO:
device_list = devices.get("PSE_MAC_MOT")
if device_list is not None:
uc_str = self.ctrl[len("MAC_MOT:"):]
unit, chan = list(map(int, uc_str.split("/")))
self.device = device_list[unit]
self.macro_prefix = self.device.prefix
# TODO: what else?
elif self.ctrl.startswith("NONE"):
pass # TODO:

Expand All @@ -130,6 +137,8 @@ def ophyd_config(self):
s += f" # {self.name}"
if len(self.motpar) > 0:
s += f" # {', '.join(self.motpar)}"
if self.macro_prefix is not None:
s += f" # macro prefix: {self.macro_prefix}"
return s


Expand Down

0 comments on commit 1207fc6

Please sign in to comment.