fixing recursion in assemblies
This commit is contained in:
@@ -491,10 +491,19 @@ class MotorRecord(Assembly):
|
||||
AdjustablePvEnum, self.pvname + ".SPMG", name="mode", is_setting=False
|
||||
)
|
||||
self._append(
|
||||
DetectorPvData, self.pvname + ".MSTA", name="_flags", is_setting=False
|
||||
DetectorPvData,
|
||||
self.pvname + ".MSTA",
|
||||
name="_flags",
|
||||
is_setting=False,
|
||||
is_display=False,
|
||||
)
|
||||
self._append(
|
||||
MotorRecordFlags, self._flags, name="flags", is_display="recursive"
|
||||
MotorRecordFlags,
|
||||
self._flags,
|
||||
name="flags",
|
||||
is_display="recursive",
|
||||
is_setting=False,
|
||||
is_status=True,
|
||||
)
|
||||
self._append(
|
||||
AdjustablePvEnum,
|
||||
@@ -779,6 +788,7 @@ class MotorRecordFlags(Assembly):
|
||||
[self._flags],
|
||||
partial(self._get_flag_name_value, flag_name=flag_name),
|
||||
name=flag_name,
|
||||
is_status=True,
|
||||
is_display=True,
|
||||
)
|
||||
|
||||
@@ -944,6 +954,7 @@ class SmaractRecord(Assembly):
|
||||
self._flags,
|
||||
name="flags",
|
||||
is_display="recursive",
|
||||
is_status=True,
|
||||
)
|
||||
# self._append(
|
||||
# AdjustablePvEnum,
|
||||
|
||||
@@ -89,7 +89,6 @@ class Assembly:
|
||||
# self.__dict__[name] = foo_obj_init(*args, **kwargs)
|
||||
if is_setting:
|
||||
self.settings_collection.append(self.__dict__[name], recursive=True)
|
||||
|
||||
if is_status:
|
||||
self.status_collection.append(self.__dict__[name], recursive=True)
|
||||
if is_display:
|
||||
|
||||
@@ -52,6 +52,9 @@ class DetectorVirtual(Assembly):
|
||||
self._foo_get_current_value = foo_get_current_value
|
||||
if unit:
|
||||
self.unit = AdjustableMemory(unit, name="unit")
|
||||
self.settings_collection.append(self, force=True)
|
||||
self.status_collection.append(self, force=True)
|
||||
self.display_collection.append(self, force=True)
|
||||
|
||||
def get_current_value(self):
|
||||
return self._foo_get_current_value(
|
||||
|
||||
@@ -21,8 +21,8 @@ class DetectorPvData(Assembly):
|
||||
self.status_collection.append(self)
|
||||
self.pvname = pvname
|
||||
singular = (unit is None) and (not has_unit)
|
||||
if name == "aramis_undulator_photon_energy":
|
||||
print(f"singular is {singular}", unit, has_unit)
|
||||
# if name == "aramis_undulator_photon_energy":
|
||||
# print(f"singular is {singular}", unit, has_unit)
|
||||
|
||||
if unit:
|
||||
self._append(AdjustableMemory, unit, name="unit")
|
||||
|
||||
Reference in New Issue
Block a user